Skip to content

test: measure a warm call in the update field allocation tests - #586

Merged
Xian55 merged 1 commit into
masterfrom
fix/584-allocation-test
Nov 2, 2026
Merged

Xian55 merged 1 commit into
masterfrom
fix/584-allocation-test

Conversation

@Xian55

@Xian55 Xian55 commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Fixes #584

UpdateFieldsArrayAllocationTests failed now and then in full runs, in any of its three tests.

They measured the first call of the code under test, and were the only allocation tests that did. Failing runs reported 3240, 49200 and 98352 bytes. The last two are a doubling (49152 + 48, 98304 + 48), which points to a global table growing during JIT or type loading, charged to whichever thread trips it. That table is inferred from those numbers, not observed.

AllocatedBy now calls the action once before measuring, as the other allocation tests do. Test code only.

Tested

Check Before After
Two full-suite loops at once, on Windows 3 failed runs of 120 0 of 200
A boxed index added to the three accessors on purpose All 3 tests fail, with 1440, 1440 and 72 bytes

The second row shows the warm-up doesn't hide what these tests are for: a box costs every call.

Ruled out on the way: forced gen0 collections from another thread didn't move the counter in 7.2M measurements.

🤖 Generated with Claude Code

These three measured the first call of the code under test. JIT and type loading now and then land
on a runtime table that has to grow, and that counts against the thread: 3240, 49200 and 98352 bytes
in failing runs, and the two big ones are a doubling. Every other allocation test warms up first.

They now call the action once before measuring. A boxed index still fails all three, as it costs
every call. With two suite loops at once, they failed 3 runs of 120 before and none of 200 after.

Fixes #584

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Xian55 Xian55 added bugfix A fix has been proposed or merged for this reported bug ai Artificial Intelligence contribution labels Nov 2, 2026
@Xian55
Xian55 merged commit ff8de6d into master Nov 2, 2026
5 checks passed
@Xian55
Xian55 deleted the fix/584-allocation-test branch November 2, 2026 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai Artificial Intelligence contribution bugfix A fix has been proposed or merged for this reported bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allocation test failed once in a full run

1 participant