Repository navigation
fix: warm native timer locks before batch allocation measurement - #587
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
Reviewed the head of #587 (test-only change: Findings: none blocking.
The change is sound and keeps the allocation test strict. |
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
| Follow-up #588 records the analogous throttles in the separate direct-send and overlapping-send allocation comparisons, pending this shared setup helper. The present PR remains scoped to the deterministic batch comparison. Claude’s current-head review is clear; Codex review was requested. |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
| Both required reviewers cleared head 1ac29a2. Rechecked all review surfaces: no findings or threads outstanding. Before promotion, independently reverified all 1,706 archived entries against their originals for length and SHA-256; all match. Evidence remains at the location in the PR body, with inventory SHA-256 a3f56ca232d41176f6f6279d42b84ee6c0416f3d0bf7b1a630948148d940c8ef. No code changed and no tests rerun. |
The warmed batch allocation comparison could include 56 B of native timer-lock initialization during its measured window. Warm each native timer queue's
Lockthrough contention before the counters, and remove the test'sNotInParallelattribute. Exact equality, finite send deadlines, buffered sends and parallel execution remain intact.Closes #585
Deterministic diagnosis: forcing first timer-queue contention reproduces the actual comparison at 312,056 B versus 312,000 B on Linux x64/.NET 10.0.15 and macOS ARM64/.NET 10.0.14. The existing native profiler identifies one 24 B
AutoResetEventand one 32 BSafeWaitHandle, with zero callback failures; the separate nativeCancelAfterprobe allocates 56 B on first contention and 0 B on the second. With the setup warmup, the forced batch comparison passes on both platforms; its callback report contains only the expected DI objects. All diagnostic outcomes, including failures, are retained. This establishes a deterministic cause of the same failure; it does not reconstruct the historical CI window. Callback sizes and thread-local counter totals are distinct measurements, and background TUnit allocations are retained rather than subtracted.Native/existing reuse:
CancellationTokenSource.CancelAfter, nativeTimerQueue/Locklazy initialization, the existing DI allocation baseline, andtools/FrozenAllocationProfilerwith its known-type fixture (8 tests passed). No timer implementation or allocation-accounting mechanism is duplicated. The setup helper reads onlyTimerQueue.InstancesandSharedLock, then uses public locking operations; an unsupported runtime shape fails with an actionable message. This test-only runtime dependency is deliberate so native deadlines and the exact assertion stay exercised.Validation: all 44
BatchPipelineTestspassed on each of net10.0 and net11.0 on macOS ARM64 (88 total), and all 44 passed on Linux x64/.NET 10.0.15. Forced before/after controls and native profiler fixture passed their expected outcomes.git diff --checkpassed; full diff reviewed for correctness, reuse and efficiency. No benchmark needed: production per-message cost unchanged, 0 B added. No docs impact: only test warmup/parallelism changes; no library API or observable behavior changes.Validation evidence:
/Users/tom/git/Relayer-evidence/pr-587/1ac29a23991b3f4b9464c0164126d380bd442d9b/. All 1,706 source, loaded-binary/runtime, profiler SDK, diagnostic and report entries were independently length/SHA-256 checked against their originals and read back againstinventory.json(SHA-256a3f56ca232d41176f6f6279d42b84ee6c0416f3d0bf7b1a630948148d940c8ef). Linux runtime bytes were also checked against SHA-256 output from the immutable runtime image. Local evidence is retained while the PR is open. Historical input evidence remains under #585’s existing retained location.