Repository navigation
Warm the stack-guard recovery test before it measures depth - #3080
Merged
Merged
Conversation
TheEngineIsUnchangedAfterTheGuardFires asserts that the guard fires at the same depth on three successive runs, because a frame the unwind failed to release would shorten a later run. Depth is a count of native stack frames, so it also moves whenever the JIT re-compiles an interpreter method the recursion runs through, and the promoted code has a different frame size. CI produced 543/533/533, 613/533/533, 705/571/571 and 533/713/696 on four unrelated branches. The last of those rises before it falls, which no leaked frame can do; a fall on its own is indistinguishable from the defect the test exists to catch. Discard two rounds before measuring. Two rather than one because the fib(20) recovery check inside each round promotes code of its own, so a single warm-up still left the second measured round moving. The assertions are unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
lahma
force-pushed
the
fix/stack-guard-depth-test-warmup
branch
from
August 20, 2026 08:48
3846ff3 to
e120031
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
StackOverflowGuardTests.TheEngineIsUnchangedAfterTheGuardFiresfails intermittently on CI. Four unrelated branches, four different shapes:The test is right about what it wants to detect, and right that a shorter later run is the signal — a frame the unwind failed to release would shorten the next one. But depth here is a count of native stack frames, and that count also moves whenever the JIT re-compiles an interpreter method the recursion runs through, because the promoted code has a different frame size.
The fourth line above is the one that settles the diagnosis: it rises before it falls, and no leaked frame can make a later run go deeper. So this is the runtime, not the engine — but a fall on its own is indistinguishable from the defect the test exists to catch, which is why it cannot simply be given a tolerance.
This discards two rounds before measuring. Two rather than one because the
fib(20)recovery check inside each round promotes code of its own, so a single warm-up still left the second measured round moving (533 → 713 → 696). By the third round everything the measurement touches is at its final tier, and the three compared numbers are about the unwind alone. The assertions themselves are unchanged — same equality across three runs, same> 100floor.Found while landing the #3021 staging PRs, where it failed on four unrelated branches and cost a CI re-run each time.
🤖 Generated with Claude Code