Skip to content

fleet: bound ir-run's watchdog kill and render-verify's capture passes - #5171

Merged
jakildev merged 1 commit into
masterfrom
claude/5151-ir-run-term-kill-escalation
Nov 19, 2026
Merged

jakildev merged 1 commit into
masterfrom
claude/5151-ir-run-term-kill-escalation

Conversation

@jakildev

Copy link
Copy Markdown
Owner

Summary

A capture pass can no longer keep render-verify (or any ir-run --timeout caller) alive without bound. ir-run's watchdog now escalates TERM to SIGKILL after IR_RUN_KILL_GRACE (default 5 s), bounds the launch's exit and the output drain, and kills a leftover descendant's process group. A process that ignored TERM reports the new RESULT=TERM-IGNORED (exit 1), never ALIVE-TIMEOUT. render-verify adds its own per-pass backstop past ir-run's bound and stops the whole tree when it fires. A timed-out pass is a named timeout row that is never compared or recordable, and a pass queued on the gpu lock now says so live in the job log.

Acceptance evidence

Criterion Check run Observed
AC1: ir-run TERM-ignoring stub returns within the bound as TERM-IGNORED exit 1, no stub left; sleeper/hang stay ALIVE-TIMEOUT exit 0 bash scripts/fleet/tests/test_ir_run_result_reporting.sh 101 passed, 0 failed; TERM-ignoring cases return within the 9 s bound (1 + 3×1 grace + 5)
AC1 control: master hangs on the same stub master ir-run --timeout 3 IRHang (trap '' TERM loop) under timeout 30 master: rc 124 at 30 s, stub still alive; branch: RESULT=TERM-IGNORED … reaped by SIGKILL at 9 s, stub gone
AC2: real hanging extra pass → named timeout row, rc ≠ 0, not recordable, bounded elapsed, tree gone; ALIVE-TIMEOUT maps to the same row python3 scripts/tests/test_render_verify.py Ran 102 tests … OK (PassBackstop, test_zero_exit_watchdog_is_a_timeout_row_even_when_every_image_matches)
AC2 control: master _run_capture on a hanging launch driver calling _run_capture under timeout 30 master: rc 124 at 30 s, child orphaned; branch: verdict=BACKSTOP at 4.0 s, child gone
Correction 1: bounded drain + descendant holding the FIFO killed test_ir_run_result_reporting.sh "output drain is bounded…" fd-holder, fd-holder-ignorer, fd-holder-clean all return within the bound, and stub and descendant are gone
Correction 2: backstop kills the process tree PassBackstop hanging pass pid and its sleep 300 grandchild both gone after _verify_one returns
Correction 3: TERM-IGNORED stdout/JSON parity bash scripts/fleet/tests/test_ir_run_result_file.sh passed: 17 failed: 0
Correction 4: NO-DISPLAY + TERM ignored → TERM-IGNORED/1; TERM honoured → NO-DISPLAY/69 test_ir_run_result_reporting.sh "NO-DISPLAY stops through the same bounded kill" both arms pass
AC3: no regression in the named suites bash scripts/fleet/tests/run_all.sh --only ir_run 6 suite(s) — 6 passed, 0 failed
AC3: no regression in the render-harness suites bash scripts/tests/run_all.sh 135 suite(s) — 135 passed, 0 failed (display held awake; an earlier run with the display asleep read EXIT_ENV_FAIL in two suites)
AC4 (issue AC1 + AC3): supervised macOS --all sweep ends on its own fleet-jobs start render-verify -- --all --json-out build/render-verify-5151.json --tracker 4904; fleet-jobs wait fleet-jobs: 20261118T030111Z-render-verify-634ef7 failed exit=1, no fleet-jobs kill; tally total: 365 checks across 13 demos, 53 FAIL, 10 skipped; ShapeDebug glitch_standard_off RESULT=CLEAN after 8 s
AC4: lock-wait text in job.log same job log (detached_field_hidden) ir-run: queued on the gpu lock for 1s; the 60s run clock has not started … then gpu lock granted after 6s; run clock started
The 53 pixel FAILs are not this PR's render-verify --target IRUIWidgetsDemo --no-build under master's and this branch's ir-run; --target IRShapeDebug under master's UIWidgets 7/7 PASS under both, rows identical; ShapeDebug under master's ir-run: 68 FAIL (43 shared with the sweep's 45)
Reviewer notes

Plan departures

  • AC4 ran --all --json-out … --tracker 4904, not --record-control: --record-control refuses a HEAD that is not on origin/master, and this PR's head is not. The sweep and its exit path are the same.
  • AC4 ran with PATH="$PWD/scripts/fleet:$PATH": a bare fleet-run on PATH resolves to the main clone's (master) ir-run, so without it the sweep would have tested master's watchdog.
  • Decision 1 left the grace's value and name open: a single IR_RUN_KILL_GRACE (default 5 s) covers all three stages (TERM→KILL, the launch's exit, the output drain). The backstop reads the same variable.
  • Decision 5's open call: a timed-out pass's partial captures are not compared. Comparing them could raise the shot-count SystemExit, which reads as ERROR in a sweep. Three existing tests that expected a compared watchdog pass now assert the timeout row instead.

Notes for reviewer

Closes #5151

🤖 Generated with Claude Code

ir-run's watchdog sent TERM and then waited without bound on the launch
and on its output tees, so a process that ignored TERM, or a descendant
holding the output FIFO, kept the run alive forever. It now escalates to
SIGKILL after IR_RUN_KILL_GRACE, bounds the launch's exit and the output
drain, kills the launch's process group once the launch has exited, and
reports RESULT=TERM-IGNORED (exit 1) when TERM did not stop the exe. The
lock stays with ir-acquire until the exe is really gone. While a run is
queued on its lock, ir-run now says so every 15 s.

render-verify runs each pass in its own session behind a backstop past
ir-run's own bound, and stops the whole tree when it fires. A pass that
times out (ALIVE-TIMEOUT, TERM-IGNORED, or the backstop) becomes a named
timeout row: never compared, never recordable, and counted apart in the
--all tally. Wrapper status lines print live, so a lock wait shows up in
a supervised job's log.

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 18, 2026
@jakildev

Copy link
Copy Markdown
Owner Author

Gated self-config this PR cannot edit. A human should apply these after merge:

  • .claude/skills/platform-catchup/SKILL.md: wherever ALIVE-TIMEOUT is the hang signal (lines 78, 116–118, 137, 310, 458), also accept RESULT=TERM-IGNORED (exit 1). It is a watchdog stop that the process ignored until SIGKILL. Until then the skill reads it as a failed run, which is safe.
  • .claude/skills/render-verify/SKILL.md §"What it does" (around line 81): after the HOST-CLOSED sentences, add that a pass ending ALIVE-TIMEOUT or TERM-IGNORED, or one that outlives the harness backstop, prints a TIMEOUT row. That row is never compared and never recordable, it exits 1, and --all tallies it apart from FAIL and ERROR.

— 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: bound ir-run's watchdog kill and render-verify's capture passes

Verdict: approve

The bounded-stop design preserves the GPU-lock ownership invariant while making both the wrapper and capture harness terminate predictably.

Praise

  • engine/tools/bin/ir-run::ir_stop_launch correctly targets the executable rather than ir-acquire, and only reaps a leftover process group after the launch exits, preserving the lock until the executable is gone.
  • scripts/render-verify.py::_run_pass_process gives each pass an isolated session and maps watchdog/backstop outcomes to non-recordable timeout rows, so partial captures cannot become a false pixel verdict.

Acceptance (issue #5151)

4 of 4 criteria are evidenced by the PR: the focused watchdog, result-file, render-harness, and supervised-sweep evidence covers the requested TERM-ignoring, descriptor-holder, process-tree, and lock-wait cases.

Checked

  • Read the complete PR and issue threads, full changed-file context, and inline-review thread; reviewed head c668ab3ce36519a9e506412a2d0eb3b8979b411b.
  • git diff --check origin/master...HEAD completed cleanly.
  • python3 scripts/tests/test_render_verify.py completed: 102 tests passed.
  • The local test_ir_run_result_reporting.sh run reached the added TERM-ignoring and output-drain assertions successfully, but did not reach a terminal result within this runtime's command window; the corresponding hosted checks are still in progress, so they are unread rather than green.

🤖 Reviewed by Codex (GPT-5, Codex runtime; review-pr skill)
Opus recheck required: ir-run changes process-group termination and GPU-lock lifetime semantics.

@jakildev jakildev added fleet:needs-opus-recheck Sonnet flagged this PR for Opus recheck before merge and removed fleet:reviewing-mac-pool-5 labels Nov 18, 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: bound ir-run's watchdog kill and render-verify's capture passes

Verdict: approve

Sonnet flagged process-group termination and GPU-lock lifetime semantics; on closer read I confirm the stop ordering preserves them: ir_stop_launch targets the executable first, waits for the launch wrapper before reaping its residual group, and the verifier's session-wide backstop remains strictly beyond the lock-queue, run, and kill-grace budget.

Acceptance (issue #5151)

4 of 4 criteria met. The focused watchdog and harness tests cover TERM refusal, held output descriptors, whole-tree backstop cleanup, result-file parity, and timeout-row classification; the supervised macOS sweep supplied the requested terminal-job and lock-wait evidence.

Checked

  • Read the complete PR and issue threads, inline-review thread, changed process-control paths, and their tests at head c668ab3ce36519a9e506412a2d0eb3b8979b411b.
  • bash scripts/fleet/tests/test_ir_run_result_reporting.sh: 101 passed, 0 failed.
  • bash scripts/fleet/tests/test_ir_run_result_file.sh: 17 passed, 0 failed.
  • python3 scripts/tests/test_render_verify.py: 102 tests passed; python3 scripts/tests/test_render_verify_demo_args.py: 9 tests passed.
  • git diff --check origin/master...HEAD completed cleanly; hosted render-harness-tests passed.
  • Hosted fleet-tests is red for the same two out-of-tree registry failures on exact base 18a91f6943d1c22058d0be0630bc4ccf383f0662, so it is inherited rather than introduced here. linux-build remains in progress and is unread, not green.

🤖 Reviewed by Codex (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-5 labels Nov 18, 2026
@jakildev
jakildev merged commit 374596f into master Nov 19, 2026
12 of 15 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.

render-verify: macOS ShapeDebug glitch extra run ignores timeout

1 participant