Skip to content

fleet: end a gpu lock wait at its queue bound, quiet-window park included - #5197

Merged
jakildev merged 2 commits into
masterfrom
claude/5196-queue-deadline
Nov 19, 2026
Merged

jakildev merged 2 commits into
masterfrom
claude/5196-queue-deadline

Conversation

@jakildev

@jakildev jakildev commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

A gpu/perf lock wait now ends at IR_QUEUE_TIMEOUT, counted from its first attempt, even when it was parked behind a benchmark quiet window. Before, each park reset the clock, so chained windows let a pass queue past the printed bound (721 s against 600 s in the incident) until render-verify's backstop fired. ir-run now prints the bound ir-acquire actually enforces (env → host.toml → concurrency.toml). render-verify derives its backstop from that same resolved bound and reports a never-granted pass as a non-recordable LOCK-FAILED row instead of CRASH. cpu-slot waits (ir-build) keep their uncharged deferral.

Acceptance evidence

Criterion Check run Observed
1. Parked gpu waiter ends at the bound; marker never runs bash scripts/fleet/tests/test_quiet_window.sh rc 1, timeout waiting for lock lock (gpu, 3s), 3 s ≤ 8 s, no marker, parker row dropped; 94 passed, 0 failed
1. Reversal on master fleet-positive-control scripts/fleet/tests/test_quiet_window.sh origin/master --include engine/tools --include CMakePresets.json MEANINGFUL: master waiter took 13 s (fails ≤ 8 s); 65 + 1 = 66
Review fix: a failing parker fails the gpu and cpu waiters closed bash scripts/fleet/tests/test_quiet_window.sh (parker stubbed to exit 2 / 1 / 143, plus an exit-0 control) rc 1, quiet-window park for park-fail failed (exit N), no command run, no lock owner; exit-0 control grants. Against the pre-fix helper (b6f994468, helper file swapped in the same tree): exactly these 24 assertions fail, 70 pass
2. Through ir-run: LOCK-FAILED, printed bound = 3, ≤ 8 s; host.toml-only bound printed and enforced bash scripts/fleet/tests/test_ir_run_result_reporting.sh 3 s and 2 s (TOML) exits, every queued line IR_QUEUE_TIMEOUT=3s; 110 passed, 0 failed
2. Reversal on master fleet-positive-control scripts/fleet/tests/test_ir_run_result_reporting.sh origin/master --include engine/tools --include CMakePresets.json MEANINGFUL: 2 fail on master (13 s park; TOML bound printed as 600 s)
3. render-verify: lock-failed row, non-recordable, sweep fails; backstop and pass env from the resolved bound; real ir-run gets LOCK-FAILED before the backstop with no process tree python3 -m unittest scripts/tests/test_render_verify.py Ran 109, OK (the #5171 PassBackstop* cases included)
4. Unregressed suites bash scripts/fleet/tests/run_all.sh --only ir_ / --only quiet 16 of 16 / 4 of 4 suites passed
4. Engine concurrency tests env -u IR_LOCK_ROOT -u IR_QUIET_OWNER bash test/tools/concurrency_test.sh 15 passed, 0 failed
5. macOS live audit PATH=$PWD/scripts/fleet:$PATH fleet-jobs start render-verify -- --all --tracker 4904 job 20261119T073230Z-render-verify-72e8e9 terminal (failed exit=1); 0 queued on the lines (no pass queued); no LOCK-FAILED or BACKSTOP row; 365 checks, 38 FAIL, 10 skipped
Reviewer notes

Plan departures

  • Criterion 5 ran without --record-control: _validate_control_source refuses any HEAD not on origin/master. scripts/fleet was put first on PATH so fleet-run went through this branch's ir-run/ir-acquire; the log shows the worktree's ir-acquire path on every pass.
  • Fixture updates the plan didn't list: test_ir_run_capture_priority.sh stubs concurrency_helpers.sh and needed an ir_queue_timeout stub, and test_quiet_window_windows.py builds its park Namespace by hand and needed deadline.

Notes for reviewer

  • Live audit FAIL rows: ShapeDebug's 36 match the issue's master control (36 FAIL), and the 2 VoxelEditor rows are already red on master in the default spatial view. No C++ or shader changed here.
  • The bound comes from ir-acquire --queue-timeout in render-verify's own tree, which resolves the same layers as the lock wait. If that call fails, render-verify falls back to the env value (or 600) and logs a warning.
  • ir-acquire benchmark still applies the bound to cpu, gpu and perf one after another, so an --auto-profile run could queue for up to 3× the printed bound. That's outside this gpu-scoped plan and was left unchanged.
  • .claude/skills/render-verify/SKILL.md and platform-catchup/SKILL.md describe the HOST-CLOSED no-verdict row but not the new lock-failed row. Both files are gated self-config, so a human would need to add the one line.

Closes #5196

🤖 Generated with Claude Code

…uded

A gpu/perf waiter parked behind a benchmark quiet window used to restart
its queue clock when the park returned, so chained windows let it wait
far past the IR_QUEUE_TIMEOUT that ir-run printed. The bound is now a
deadline from the first attempt: `quiet_window.py park --deadline` exits
at it (dropping its own parker row) and ir-acquire takes the normal
timeout exit. cpu-slot waits keep their uncharged deferral.

ir-run resolves the bound once (env, host.toml, concurrency.toml),
prints that value and exports it to ir-acquire. render-verify resolves
it through `ir-acquire --queue-timeout`, derives its backstop from it,
and reports RESULT=LOCK-FAILED as its own non-recordable lock-failed row
instead of CRASH.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jakildev jakildev added fleet:author-claude Implementation last authored by Claude; route review to Codex fleet:authored-on-macos PR was authored and smoke-tested on macOS Metal backend labels Nov 19, 2026

@jakildev jakildev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — fleet: end a gpu lock wait at its queue bound, quiet-window park included

Verdict: approve

The exclusive-lock deadline, shared bound resolution, and no-verdict reporting match the issue plan; the changed synchronization and process-lifecycle boundary warrants an Opus recheck.

Praise

  • concurrency_helpers.sh::ir_acquire_exclusive keeps CPU-slot deferral intentionally separate while charging only GPU/perf quiet-window parking to the exclusive-lock deadline.
  • quiet_window.py::cmd_park removes its parker row through the existing finally path when its deadline expires, avoiding stale quiet-window accounting.

Acceptance (issue #5196)

5 of 5 met. The defect-path test, ir-run host-TOML resolution test, verifier integration/process-tree test, regression suites, and recorded macOS audit each provide evidence for their corresponding criterion.

Checked

  • Read the complete issue #5196 plan/corrections and PR #5197 metadata, discussion, inline comments, commit, full diff, and changed-file context at b6f99446864a8b3b29f76b32e4e506b621344001.
  • python3 -m unittest scripts/tests/test_render_verify.py — 109 passed.
  • fleet-jobs wait --timeout 60 20261119T082747Z-fleet-tests-406463 — test_ir_run_result_reporting.sh passed; terminal job exit 0.
  • git diff --check origin/master...HEAD — clean.
  • CI checks linux-build, render-harness-tests, and fleet-tests were still in progress when reviewed; no completed check was failing.

🤖 Reviewed by Codex (review-pr skill)
Opus recheck required: lock acquisition deadline and process-lifecycle semantics.

@jakildev jakildev added fleet:needs-opus-recheck Sonnet flagged this PR for Opus recheck before merge and removed fleet:reviewing-mac-pool-1 labels Nov 19, 2026

@jakildev jakildev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — fleet: end a gpu lock wait at its queue bound, quiet-window park included

Verdict: needs-fix

Sonnet flagged the lock-acquisition deadline and process-lifecycle boundary; on closer read I confirm the deadline path and parker cleanup are sound, but the refactored helper now fails open when the parker itself errors.

Needs-fix

  • engine/tools/lib/concurrency_helpers.sh::_ir_quiet_defer_nonbenchmark — lines 385–387 convert every ir_quiet_park failure except the new deadline exit 3 into return 0. Previously, a non-zero parker exit propagated under set -e; now an argparse/runtime/filesystem failure (for example exit 2) is reported as a completed park, so ir_acquire_exclusive may try and grant the GPU/perf lock and ir_acquire_cpu may restart its timeout while an active benchmark window still requires the caller to stay parked. That breaks the quiet-window no-contamination contract. Preserve the intentional 3 → deadline result, but fail closed for every other non-zero parker status, and add a regression case that stubs the parker to exit non-zero and proves the wrapped command is never granted.

Acceptance (issue #5196)

5 of 5 met. The defect-path deadline, shared printed/enforced bound, render-verifier lock-failure/process-tree behavior, regression suites, and terminal macOS audit all have positive evidence in the changed tests and PR record.

Checked

  • Read the complete issue #5196 plan/corrections and PR #5197 body, review, inline-comment stream, commit, full diff, and changed-file context at b6f99446864a8b3b29f76b32e4e506b621344001.
  • bash scripts/fleet/tests/test_quiet_window.sh — 66 passed, 0 failed.
  • bash scripts/fleet/tests/test_ir_run_result_reporting.sh — 110 passed, 0 failed.
  • python3 -m unittest scripts/tests/test_render_verify.py — 109 passed.
  • Focused failure probe: with ir_quiet_status active and ir_quiet_park returning 2, _ir_quiet_defer_nonbenchmark --deadline ... returned 0, confirming the fail-open edge.
  • CI linux-build, render-harness-tests, and fleet-tests remain pending; all completed checks are green.

Test plan the author should run before merge

  • Add and run a hermetic quiet-window case where the parker returns a non-deadline error and assert no GPU/perf or CPU acquisition is granted.
  • Re-run the three suites listed above.

🤖 Reviewed by Codex gpt-5.6-sol (opus-class, review-pr skill)

@jakildev jakildev added fleet:needs-fix Fleet reviewer found issues — author must address and removed fleet:needs-opus-recheck Sonnet flagged this PR for Opus recheck before merge fleet:reviewing-mac-pool-1 labels Nov 19, 2026
@jakildev jakildev removed the fleet:needs-fix Fleet reviewer found issues — author must address label Nov 19, 2026
_ir_quiet_defer_nonbenchmark mapped every parker exit except the deadline
status to "parked", so a parker crash or argparse failure let the gpu/perf
and cpu waiters take their resource inside an open benchmark window. It now
returns 3 for a failed parker and both acquire paths fail on it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jakildev jakildev added fleet:changes-made Agent addressed human feedback — ready for human re-review and removed fleet:amending-mac-pool-1 labels Nov 19, 2026
@jakildev

Copy link
Copy Markdown
Owner Author

Addressed feedback:

  • Needs-fix (_ir_quiet_defer_nonbenchmark fails open on a parker error): the helper now returns 0 only for a clean park and maps the parker's deadline exit 3 to 2. Every other non-zero parker exit logs ir-acquire: quiet-window park for <owner> failed (exit N) and returns 3, and both ir_acquire_exclusive and ir_acquire_cpu return 1 on 3 without trying the lock. The README now states the fail-closed rule.
  • Regression case (test_quiet_window.sh): stubs an open window whose parker exits 2, 1 or 143, for both the gpu and the cpu waiter. It asserts rc 1, the error line, no command run and no lock owner, plus an exit-0 stub control that does grant. Against the pre-fix helper, exactly these 24 assertions fail.
  • Re-ran: test_quiet_window.sh 94/0, test_ir_run_result_reporting.sh 110/0, test_render_verify.py 109 OK, test_ir_run_capture_priority.sh 117/0. The bash-3.2, lock-transfer, acquire-queue, quiet-wait, perf-grid-quiet, handoff-lock and acquire-info suites are all green.

— worker

@jakildev jakildev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — fleet: end a gpu lock wait at its queue bound, quiet-window park included

Verdict: approve

The re-review fix correctly fails closed for every non-deadline parker error, and the added probes cover both exclusive and CPU acquisition paths.

Praise

  • concurrency_helpers.sh::_ir_quiet_defer_nonbenchmark preserves the distinct deadline status while making all other parker failures explicit and non-granting.
  • test_quiet_window.sh::park_probe exercises failed parker exits 2, 1, and 143, plus the successful control, for both resource paths.

Acceptance (issue #5196)

5 of 5 met. The amended delta addresses the prior needs-fix without changing the established queue-bound or lock-failure behavior.

Checked

  • Read the complete issue #5196 plan and corrections, PR metadata, discussion, reviews, inline-comment stream, full diff, and changed-file context at 5a12a3188c1ac64c6e26428e4a2479156302055b.
  • Re-review scope: verified the prior fail-open finding is fixed; a failed parker returns a non-granting status in both ir_acquire_exclusive and ir_acquire_cpu.
  • fleet-jobs wait --timeout 60 20261119T085416Z-fleet-tests-95b5d4 — quiet subset: 4 suites passed, terminal exit 0.
  • fleet-jobs wait --timeout 60 20261119T085532Z-fleet-tests-da7ea0 — test_ir_run_result_reporting.sh passed, terminal exit 0.
  • python3 -m unittest scripts/tests/test_render_verify.py — 109 passed.
  • git diff --check origin/master...HEAD — clean.
  • CI: completed checks are green; linux-build, render-harness-tests, and fleet-tests remain in progress.

🤖 Reviewed by GPT-5 (Codex runtime, review-pr skill)
Opus recheck required: lock acquisition deadline and process-lifecycle semantics.

@jakildev jakildev added fleet:needs-opus-recheck Sonnet flagged this PR for Opus recheck before merge and removed fleet:changes-made Agent addressed human feedback — ready for human re-review fleet:reviewing-mac-pool-1 labels Nov 19, 2026

@jakildev jakildev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — fleet: end a gpu lock wait at its queue bound, quiet-window park included

Verdict: approve

Sonnet flagged the amended fail-closed parker path for final review; on closer read I confirm every non-deadline parker failure now prevents both exclusive and CPU acquisition, while the deadline status keeps its distinct timeout path.

Acceptance (issue #5196)

5 of 5 met. The amendment closes the prior fail-open finding without changing the established queue-deadline, shared-bound, verifier no-verdict, regression, or live-audit evidence.

Checked

  • Read the complete issue #5196 plan and corrections plus PR #5197 metadata, discussion, reviews, inline-comment stream, timeline, full diff, and changed-file context at 5a12a3188c1ac64c6e26428e4a2479156302055b.
  • Delta-scoped re-review: concurrency_helpers.sh::_ir_quiet_defer_nonbenchmark maps only the reserved parker deadline exit to timeout; exits 1, 2, and 143 fail closed before either acquisition path attempts a lock.
  • bash scripts/fleet/tests/test_quiet_window.sh — 94 passed, 0 failed.
  • bash scripts/fleet/tests/test_ir_run_result_reporting.sh — 110 passed, 0 failed.
  • python3 -m unittest scripts/tests/test_render_verify.py — 109 passed.
  • git diff --check origin/master...HEAD — clean.
  • CI: all completed checks are green; fleet-tests, linux-build, and render-harness-tests remain in progress.

🤖 Reviewed by GPT-5 (Codex runtime, review-pr skill)

@jakildev jakildev added fleet:approved Fleet reviewer approved — ready for human merge and removed fleet:needs-opus-recheck Sonnet flagged this PR for Opus recheck before merge fleet:reviewing-mac-pool-3 labels Nov 19, 2026
@jakildev
jakildev merged commit 89a3435 into master Nov 19, 2026
13 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fleet:approved Fleet reviewer approved — ready for human merge fleet:author-claude Implementation last authored by Claude; route review to Codex fleet:authored-on-macos PR was authored and smoke-tested on macOS Metal backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fleet: GPU lock wait exceeds advertised IR_QUEUE_TIMEOUT

1 participant