Skip to content

ci: perf-ab lock-up detector, run budget, and a 45% faster latency replay - #621

Merged
zackees merged 1 commit into
mainfrom
ci/perf-ab-hang-detector
Oct 23, 2026
Merged

zackees merged 1 commit into
mainfrom
ci/perf-ab-hang-detector

Conversation

@zackees

@zackees zackees commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Why #616's V7 campaign could not reach a verdict, and the fix. Related: #614, #616, #620.

Diagnosis: not a lock-up, a time budget

Run 39897074404 was cancelled by the 90-min job timeout. Its checkpoint was complete: false, so no verdict could be drawn. Nothing hung: its 858 measured children took 5.4–9.8 s each, with < 0.1 s spread within a row. Every row stayed INCONCLUSIVE, so the adaptive loop took all 12 rows to 25 reps: 12 × 3 arms × 25 × ~6.3 s ≈ 5,700 s > 5,400 s. The build takes < 1 min; the rest is measurement.

About 5.2 s of each ~6.3 s measurement was sleep. Each child samples RSS for 2 × the 1,300 ms release bound, including the latency replay, which reports only p99, recorded while workers run.

Changes (ci/ only, no allocator code)

  • Lock-up detector. Every measured child gets PERF_AB_CHILD_TIMEOUT_S (180 s, ~18× the slowest observed). On expiry gdb dumps every thread's backtrace; the child opts in with PR_SET_PTRACER, because Yama blocks a sibling from attaching, and there is a /proc fallback. The child is then killed, and the run fails with the stacks in the artifact failure field and the step summary. Previously a hang silently used up the 90 minutes and left nothing.
  • --budget-minutes (workflow passes 80). Adaptive extension adds a 5-rep step only if its projected time (5 × slowest observed rep per pending row) fits, so runs end complete and judgeable with honest INCONCLUSIVE labels. Rows the budget stops are recorded as stopped_by_budget.
  • Latency replay skips the release-sampling window. Measured on large-class/8 with the same host and builds: 6.3 s → 3.4 s per measurement (−45%). Timed-run metrics are untouched. latency_protocol is bumped to v2, so v1 and v2 artifacts are never pooled. A full 12 × 25 campaign is now ~53 min.

Tests

4 new tests (budget, child output/failure, lock-up → stack dump + kill), plus the existing perf-ab suites: 95 pass. Verified locally that the gdb dump attaches and prints #0… frames.

Not done: sharding rows across parallel runners. Each row is judged on its own, so it is possible, but the dispatcher's artifact pooling would need changes. With these fixes it isn't needed to fit the budget.

🤖 Generated with Claude Code

…'s drain window

Run 39897074404 was cancelled by the 90-min job timeout one rep short of
max (complete=false: no verdict) though nothing hung: 858 children,
5.4-9.8 s each. Every row stayed inconclusive, so all 12 extended to 25
reps: 12 x 3 arms x 25 x ~6.3 s > 5400 s.

- Lock-up detector: each measured child gets PERF_AB_CHILD_TIMEOUT_S
  (180 s, ~18x the slowest observed). On expiry gdb dumps every thread
  (the child opts in with PR_SET_PTRACER; /proc fallback), the child is
  killed, and the run fails with the stacks in the artifact and summary.
- --budget-minutes (workflow: 80): adaptive extension starts another step
  only if its projected time fits, so a run ends complete and judgeable.
- The latency replay emits only p99, sampled while workers run, yet slept
  through twice the release bound (2.6 s) per child. Skip it: 6.3 s ->
  3.4 s per measurement on large-class/8. latency_protocol -> v2 so old and
  new artifacts never pool.

Local-Gate: v1 tree=ca9f9717a102b8ed346d7b2718dee3bf929d1ddd secs=147 lanes=lint:run
Ci-Attestation: {"at":1792735169,"gate":"python/all/lint","host":"linux-x86_64","key":"c8ad26cfa5f66ca93c0eb7c02afd7c96b51050de8b08d3f089070facf4a24f14","lane":"lint","parents":["5a5e97e16cf872bb5d66220bbb8827db3e1822dc"],"secs":147,"stamp":"f40c2c83d3c29969d6c2e920a1188f70","tree":"ca9f9717a102b8ed346d7b2718dee3bf929d1ddd","v":1,"via":"run"}
@zackees
zackees merged commit aaef948 into main Oct 23, 2026
64 checks passed
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.

1 participant