Repository navigation
test(esp32): assert the empty core leg relative to the sketch leg - #2154
Merged
Merged
Conversation
empty_core_leg_does_not_inherit_the_sketch_time asserted an absolute 30 ms bound on a leg that compiles zero TUs. On an oversubscribed runner the empty leg's own scheduling cost alone reached 32.36 ms, so a correct build went red (merge group for #2146, run 45026460907, and again on PR #2148's Check at 23m44s). The bug this guards has a relative signature: compile-core, compile-core-variant and compile-sketch all land on the same value. So assert the ratio instead (core * 3 < sketch) and raise the fake compiler's delay to 200 ms so the margin is wide. Mutating the production call back to sketch_elapsed reproduces the inherited time exactly (core 202.28 ms vs sketch 202.28 ms) and the new assertion fails, so the guard still has teeth.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
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.
Why
empty_core_leg_does_not_inherit_the_sketch_timeasserted an absolute wall-clock bound(
core_phase < 30 ms) on a leg that compiles zero translation units. On an oversubscribedrunner the empty leg's own scheduling cost alone reached 32.36 ms, so a correct build went
red:
got 32.362751ms,compile-core=32 msvscompile-sketch=93 ms, runnerthrottled 18%,wall=1823slinux / Check, run 45000269036 —264 passed; 1 failed,wall=1424s,throttled=3008/17128 periods (18%)Neither PR touches
fbuild-build-esp, so this is a wall-clock-dependent assertion, not aregression. Filed as #2152.
What
The bug being guarded has a relative signature — when the empty leg wrongly inherits the
sketch region,
compile-core ≈ compile-core-variant ≈ compile-sketch. So:SlowCompilerdelay for this test60 ms → 200 ms, giving the ratio a wide margin(a per-test +140 ms is cheap),
core_phase * 3 < sketch_phaseinstead of the absolute 30 ms,sketch_phase >= 40 msas the sanity floor so a silently-zero sketch leg cannot satisfythe ratio.
The sibling
core_leg_is_recorded_independently_of_the_sketchkeeps its assertions: they arelower bounds against a sleep-based fake, and a sleep can only be inflated by load, never
shortened, so that class is load-monotone and safe.
Verification (real output)
Mutation check — put the inherited time back (
perf.record("compile-core", sketch_elapsed)):The mutation was reverted; the only changed file in this PR is
compile_phases_tests.rs(12 insertions, 4 deletions).Scope
Test-only. It also unblocks PR #2148, whose only red Check was this flake — #2148 stays a
separate PR and is not touched here.
Fixes #2152