Skip to content

Measure disabled tach recording after a warm-up pass - #197

Merged
Views2k merged 1 commit into
mainfrom
fix/tach-allocation-warmup
Nov 9, 2026
Merged

Views2k merged 1 commit into
mainfrom
fix/tach-allocation-warmup

Conversation

@Views2k

@Views2k Views2k commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Problem

TachDiagnosticsTests.DisabledRecordCallsCreateNoHistoryOrPerCallAllocations measured the first run of a loop in the test method. That run includes the loop's on-stack-replacement compile, which happens on the test thread near the 10,000th iteration, and runtime work during that compile can allocate on the test thread (locally a 16,344-byte object on the pinned object heap; 49,200 bytes in the isolated nightly run of 2026-10-27). The test then failed although the disabled record calls allocate nothing, and whether it happens depends on process state from earlier work.

Change

Run the same loop once before measuring, and read the elapsed time after the allocation count, so the measured window contains only the record calls (tests/Wisp.App.Tests/TachDiagnosticsTests.cs). Test-only; no product code changes.

Verification

CI runs the test in the full suite; the nightly runs it isolated.

Closes #195

DisabledRecordCallsCreateNoHistoryOrPerCallAllocations measured the first
run of a loop in the test method. That run includes the loop's on-stack
replacement compile, which happens on the test thread near the
10,000th iteration. Runtime work during that compile can allocate on the
test thread: in local runs that force the compile into the window, the
runtime added a 16,344-byte object to the pinned object heap, and the test
failed although the disabled record calls allocate nothing. Whether this
happens depends on process state from earlier work, so the isolated
nightly run failed intermittently (49,200 bytes on 2026-10-27).

Run the same loop once before measuring, and read the elapsed time after
the allocation count, so the measured window contains only the record
calls.
@Views2k
Views2k marked this pull request as ready for review November 8, 2026 20:35
@Views2k
Views2k merged commit 62179dd into main Nov 9, 2026
10 checks passed
@Views2k
Views2k deleted the fix/tach-allocation-warmup branch November 9, 2026 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky nightly test: DisabledRecordCallsCreateNoHistoryOrPerCallAllocations measures the loop's OSR compile

1 participant