Repository navigation
test: pin nested-payload linearity structurally, not by wall-clock (#8687) - #8702
Conversation
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Design Review (Fable 5) — ✅ PASSDesign-level review of Helpers are module-level functions resolved through module globals at call time, so the monkeypatch instrumentation genuinely intercepts the path under test, and the test's own floor assertions guard against the instrument silently observing nothing. The change is exactly what the repo's testing conventions mandate (assert complexity by shape, not duration), mirrors the two sibling tests already converted in the same file, and states its one residual blind spot honestly. No design-level concerns. Design-Verdict: PASS Deterministic call-count pins replace a runner-dependent timing ratio, matching the file's established structural pattern and the repo's own flake-class doctrine; residuals stated honestly. [DESIGN-REVIEWED] 71ba3c5 |
Opus 4.8 Review — ✅ no blocking findingsReviewed Review detailsI've verified both replacement tests against the actual Test 1 ( Test 2 ( Both tests are deterministic, touch no host state (auto-reverting No findings. [OPUS-REVIEWED] 71ba3c5 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
Status: functionally review-ready; the only red is main-inheritedAll PR-owned signals are green:
The two reds are
Holding this branch unchanged and re-checking readiness after main's Windows shard is fixed. |
95ed4c7 to
afb69eb
Compare
afb69eb to
71ba3c5
Compare
Summary
Converts the two remaining wall-clock-ratio pins in
TestNestedPayloadExtractionIsLinearto deterministic structural call-count assertions, mirroring the two siblings already in the file (TestSelfModuleIndexIsLinear::test_the_scan_is_linear_not_quadratic,test_a_chain_of_glued_redirects_is_linear).The ratio form measured the runner, not the code: on a starved shared Windows runner (PR #8672, Backend Tests (Windows) shard 2), scheduler noise alone produced a 3.1x ratio against the 3x bound and false-redded a PR whose diff never touched
_nested_shell_payloads.What the tests now pin
test_the_scan_is_linear_not_quadratic(padding shape["bash", "-x"] * (n // 2), sizes 2000/4000/6000):_next_stop_indexesruns exactly TWICE per call (env stop table + past-the-dashes table), regardless of n_program_basenamecall count is an exact arithmetic progression (once per token; the pre-fix quadratic re-walked the tail per shell token)_is_shell_command_flagand_is_not_double_dashcall counts hold exact arithmetic progressions — the predicates a per-shell-token forward re-walk must re-consult. The padding token is dash-prefixed so the flag predicate is genuinely consulted (n/2 calls) rather than holding vacuously.test_a_long_double_dash_run_is_also_linear(shape["$0"]*n + ["-c"] + ["--"]*n):_next_stop_indexes == 2pinned_is_not_double_dashcount is an exact arithmetic progression in n (the pre-fix third forward walk re-consulted it once per run token PER program token)No absolute wall-clock cap, per the file's own #8630 precedent (coverage tracing prices line events). Both docstrings state the structural contract and the one residual (an inlined comparison is not observed by the counts) plainly.
test_the_payload_set_is_unchangeduntouched — it pins the payload set.Testing
tables=2, basename=n, flag=n/2, dash=n; shape 2 givestables=2, dash=2n+1; both shapes yield[](the empty-payload worst case)Pre-push review
sizestuple instead of duplicated literalsCloses #8687