Repository navigation
tools: an ended gate run takes its binary's timeout with it - #319
Conversation
There was a problem hiding this comment.
Verdict: MUST_FIX: A cancellation signal can be discarded before the next grouped load starts.
Must fix
1. Replay cancellation recorded after the load is reaped
tools/ref/load-groups.sh:231: TERM or HUP arriving after pid='' on line 229 and before trap reset on line 230 sets lg_sig, but skips lg_stop because the PID is empty. Trap restoration never checks that flag. With another unit queued, the DS41 round loop and Qwen3-MoE round loop continue into another load while holding the timing lease.
Replaying the recorded signal prevents a cancelled run from consuming another load. Replace line 231 with:
eval "$lg_traps"
[ -z "$lg_sig" ] || kill -s "$lg_sig" $$Add a cancellation case immediately after PID clearing. A probe using the trap and reap excerpts prints NEXT_ARM_STARTED and exits 0 for either signal; the replacement prevents that marker and terminates with 143 for TERM or 129 for HUP, with and without set -e.
Checked
Evidence: signal traps, PID clearing, trap restoration, both callers' round loops and lease ownership confirmed. The finding meets kind A; no review exclusion or ledger lesson applies.
Tests: cancellation probes and Bash syntax checks of the suggested replacement passed. Existing load cancellation tests signal a running child and do not cover this post-reap window.
Inline suggestion: line 231 is added by the diff and the replacement is valid Bash.
Notes
Full shell self-tests were not rerun during validation.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
| wait "$pid" || rc=$? | ||
| pid='' | ||
| trap - TERM INT HUP | ||
| eval "$lg_traps" |
There was a problem hiding this comment.
After PID clearing, the trap records cancellation without stopping the runner. Replay that signal after restoring the caller's traps, before another load starts.
| eval "$lg_traps" | |
| eval "$lg_traps" | |
| [ -z "$lg_sig" ] || kill -s "$lg_sig" $$ |
3148d73 to
e078e39
Compare
There was a problem hiding this comment.
Verdict: MUST_FIX: Cancelling a GPU gate leaves a nested Clefvis dump running with inherited lock and output descriptors.
Must fix
1. Forward cancellation through the Clefvis gate wrapper
tools/gpu-gate.sh:1947 runs the Clefvis shell wrapper through an outer timeout. The wrapper starts a second timeout group at tools/ref/clefvis/clefvis.sh:227, without a forwarding trap. On TERM, tools/gate-bound.sh:35 stops the outer timeout and its group; the inner dump survives in its separate group and keeps the inherited card lock and output descriptors until its own bound.
A validator probe returned 143 while the nested command remained alive, its inherited descriptor lock stayed held, and output had no EOF. This is a remaining sibling path in the cancellation fix.
Cost: Fix this caller before relying on cancellation to release card locks.
Reuse lease_bounded for these calls. It also re-raises the signal after cleanup, preventing another arm from starting when the child exits successfully.
--- a/tools/ref/clefvis/clefvis.sh
+++ b/tools/ref/clefvis/clefvis.sh
@@ -61,2 +61,4 @@
fi
+# shellcheck source=tools/ref/lease.sh
+source "$HERE/tools/ref/lease.sh"
# shellcheck source=tools/ref/ref-paths.sh
@@ -145,3 +147,3 @@
SECONDS=0
- if env CUDA_VISIBLE_DEVICES= timeout --kill-after=10 "$BOUND" "$BIN" chat --mmproj "$MMPROJ" -m "$TEXT" --mmproj-sha256 "$MMPROJ_SHA256" \
+ if lease_bounded "$BOUND" env CUDA_VISIBLE_DEVICES= "$BIN" chat --mmproj "$MMPROJ" -m "$TEXT" --mmproj-sha256 "$MMPROJ_SHA256" \
--card cpu --requests "$REQUESTS" "${img_args[@]}" "${seat_args[@]}" --out "$stage" -t "$THREADS"; then
@@ -226,3 +228,3 @@
SECONDS=0
- if "${run[@]}" timeout --kill-after=10 "$BOUND" "$BIN" tower --mmproj "$MMPROJ" -m "$TEXT" --mmproj-sha256 "$MMPROJ_SHA256" \
+ if lease_bounded "$BOUND" "${run[@]}" "$BIN" tower --mmproj "$MMPROJ" -m "$TEXT" --mmproj-sha256 "$MMPROJ_SHA256" \
--card "$device" "${img_args[@]}" "${pre_args[@]}" "${tap_args[@]}" "${tower_seat_args[@]}" --out-taps "$taps.staging" "${where[@]}"; then
@@ -269,3 +271,3 @@
SECONDS=0
- if "${run[@]}" timeout --kill-after=10 "$BOUND" "$BIN" hidden --mmproj "$MMPROJ" -m "$TEXT" --mmproj-sha256 "$MMPROJ_SHA256" \
+ if lease_bounded "$BOUND" "${run[@]}" "$BIN" hidden --mmproj "$MMPROJ" -m "$TEXT" --mmproj-sha256 "$MMPROJ_SHA256" \
--card "$device" --ids "$ids" "${img_args[@]}" --rows "$rows" "${extra[@]}" --out "$dir.staging" \Extend the cancellation fixture with a shell wrapper containing an inner timeout. Assert that its command ends, the lock is free, output reaches EOF, and no next arm starts. Validator probes using the proposed owner with child TERM statuses 0 and 7 ended the child, reached EOF, and started no next arm. All four patch hunks match the current file, and the patched shell passes syntax checking.
Checked
Duplicates: the proposed fix reuses the existing lease_bounded owner.
Complexity: no Rust functions changed.
Silent failure: followed cancellation through lease_stop, run_bounded and the GPU runner's exit status.
Tests: reproduced the nested-group failure and checked the proposed owner; all 43 changed shell files pass syntax checks, and the changed Python file compiles.
Gates: the stack-watch timing allowance has a dated PIN and reason.
Escape catalog: this finding matches none of C1–C4. No ledger lessons are in force.
Notes
Full self-tests and hardware gates were not rerun by the validator.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
e078e39 to
ba4aee3
Compare
There was a problem hiding this comment.
Verdict: MUST_FIX: One cancellation can force immediate server termination before requests drain.
Must fix
1. Send group TERM only after the monitor exits
tools/gate-bound.sh:35 sends TERM to timeout, which forwards it, then sends TERM to its group. The command can receive two signals from one cancellation. When tools/ref/lease-hold.sh:81 wraps a running server, this can reach its second-interrupt _exit(1) in crates/serve/src/api.rs:822 before pending answers drain.
A shutdown probe completed draining with status 0 in all five monitor-only runs. The current implementation returned 1 after two signals without draining in all five runs. Fixing the shared stop protects its callers together.
Signal the monitor first. Signal surviving group members after the monitor exits; retain the shared deadline and KILL escalation. Add a regression whose first TERM drains and whose second aborts. The replacement below passed that probe and the nonforwarding-monitor case.
lease_stop() {
local pid=$1 sig target err table p pg state live monitor failed=0 deadline
for sig in TERM KILL; do
deadline=$((SECONDS + 10))
for target in "$pid" "-$pid"; do
if err=$(LC_ALL=C kill -s "$sig" -- "$target" 2>&1); then :; else
case $err in
*'No such process'*) ;;
*) printf '[bound] cannot send %s to %s: %s\n' "$sig" "$target" "$err" >&2; failed=70 ;;
esac
fi
if [ "$sig" = KILL ] && [ "$target" = "$pid" ]; then continue; fi
while :; do
if ! table=$(ps -eo pid=,pgid=,stat=); then
echo "[bound] cannot read processes while stopping $pid" >&2
failed=70
break 2
fi
live='' monitor=''
while IFS=$' \t\n' read -r p pg state; do
if { [ "$p" = "$pid" ] || [ "$pg" = "$pid" ]; } && [[ $state != Z* ]]; then
live=1
[ "$p" != "$pid" ] || monitor=1
fi
done <<< "$table"
[ -n "$live" ] || break 3
if [ "$sig" = TERM ] && [ "$target" = "$pid" ] && [ -z "$monitor" ]; then break; fi
if [ "$SECONDS" -ge "$deadline" ]; then
if [ "$sig" = KILL ]; then
echo "[bound] $pid or its process group still alive 10 s after KILL" >&2
return 70
fi
break 2
fi
sleep 0.1 9>&-
done
done
done
[ "$failed" = 0 ] || return "$failed"
wait "$pid" 2> /dev/null || :
return "$failed"
}Checked
Evidence: followed lease-hold through run_bounded and lease_stop to the server's signal handler and orderly shutdown wait. The finding is kind A and is outside the exclusion and escape-catalog patterns. No ledger lessons are in force.
Tests: syntax passed for all 44 changed shell files and the changed Python file. The replacement passed syntax and all five draining probes. With a nonforwarding monitor, it also stopped the surviving child group, completed draining and closed output.
Notes
No Rust file changed. Full shell suites and GPU gates were not rerun during validation.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
Share bounded process-group cleanup across the gate and lease runners. Forward signals before PID publication, wait for commands and stack dumps, and reap filtered-output readers before releasing locks and output. Cover startup windows, orphaned timeout groups, cleanup failures and FIFO setup failures with the gate and watcher fixtures.
Capture bounded output in the runner's shell instead of substitutions and pipelines. Share live FIFO filtering, preserve caller traps and argument frames, and stop on failed prompts or invalid bounds before starting work. Use the same owner in depth arms, preheats and C-state runs. Exercise cancellation, startup gaps, filter cleanup and capture trap ownership.
Hold signals until the load monitor is known, stop its group, and restore the caller's traps only after reaping it. Keep cleanup failures unless the command already failed, including extra-arm and idle-timeout paths. Have memory scopes wait through repeated signals and keep the child's status. Cover grouped loads, fork-exit monitors and scope cancellation.
Own the background decoder through startup and EXIT cleanup, then leave later profiling commands under the shared bounded owner. Preserve decoder failures with a diagnostic log tail and keep the symbol table BSD-awk compatible. Exercise cancellation before PID publication and during record, annotate and caller reports, plus decoder and cleanup failure statuses.
Run the remaining profiling, reference, conversion and build commands through the shared signal owner without an extra timeout supervisor. Publish monitor PIDs from the bounded child when a runner needs them. Stop and reap concurrent copy groups on exit, supervise generic lease holders, and cover a TERM-ignoring profiler through KILL escalation.
ba4aee3 to
babd6b9
Compare
There was a problem hiding this comment.
Verdict: CLEAN: The changed runners forward cancellation, wait for owned processes, and preserve failure statuses.
Checked
Duplicates: 15 new helpers checked, including shared test fixtures; no duplicate owner found. Test doubles have distinct fixture roles.
Complexity: no Rust functions changed; the shell cleanup and signal-state branches were reviewed for correctness.
Silent failure: 9 shell status and cleanup paths followed through their consumers; child, reader and cleanup failures remain visible.
Tests: assertions cover signal forwarding, startup traps, cleanup-error propagation, reader-error propagation and next-arm suppression. All 44 changed shell files pass bash -n; both Python files parse. Runtime self-tests and process probes were not rerun during validation.
Gates: the widened stack-watch test window has a dated PIN, a reason and a delayed-gdb fixture that explains the change.
Escape catalog: C1–C4 checked; no matching defect remains in the changed code.
Performance: tools only; no inference hot path changed.
Notes
Dryer and crapper did not run because no Rust file changed.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
The review is done and the contribution check passed, so I'm merging this. |
Supersedes #201.
What and why
Closes #171.
Release notes: internal: a gate or timing runner that is stopped with TERM, INT or HUP now ends the binary it started, so the binary's gate locks, output and timing lease go with the runner instead of staying held until the binary's own bound.
GNU
timeoutputs its command in a process group of its own, and the gate runners start their binary undertimeoutin the foreground. A TERM, INT or HUP sent to a runner's process group never reaches the binary or itstimeout, and a TERM sent to the runner's pid ends the runner alone. Either way the binary runs on until its own bound and keeps what it holds:tools/gpu-gate.sh: the gate lock descriptors and the writers of the run's output, up to 900 s whenBLOOMERY_GATE_BOUNDis unset.tools/ref/time-gate.sh: the machine-wide lease, up to 600 s.tools/host-gate.shandtools/gate.sh: the binary, orcargo test, still writing to the run's output.tools/ref/lease.sh'slease_bounded, which bounds the children the timing runners start under the lease: the lease (descriptor 9), up toLEASE_ARM_BOUND(900 s by default). Most timing runners also call it inside a command substitution or a pipeline (out=$(lease_bounded …)), where even a fix insidelease_boundedwould not see a TERM sent to the runner's pid. The DS41 and Qwen3-MoE depth runners start their arms under atimeoutof their own, piped into a fault marker. The DS41 and GLM5Next preheats andtools/ref/cstate-ab.sh's arms start theirs inside a command substitution (out=$(timeout … 2>&1)).tools/ref/perf-decode.shandtools/ref/load-groups.sh, which start the decoder or the load under atimeoutof their own in the background and give the runner no way to stop it: the lease, up to thattimeout's bound.The gpu-gate self-test meets this when
gate()'s bound ends a held run. The bound returns 124, but the stub binary and itstimeoutstay alive, and a later blockingflockon the same lock, or arelay()reading that output, waits for them.The issue offers two fixes. This PR takes the first: the runner passes the signal on to the inner
timeoutand its process group, and waits for them.run_boundednow lives intools/gate-bound.sh, which gpu-gate.sh, host-gate.sh and gate.sh already source. It sets its trap first, then starts the bounded command in the background and waits for it. A signal that comes before the child's pid is known is recorded and passed on as soon as the pid is, so no signal falls between the start and the trap.BIN_SENTrecords that the trap has passed the signal on already, so the child gets it once. The trap ignores nothing before the child starts, because a child started with signals ignored would keep them. On TERM or HUP it stops that child withlease_stop, ignores further signals and waits until the child ends; the runner then goes on with the child's code. Iflease_stopcannot clear the child's group,run_boundedreturns that failure when the child itself ended with 0, and the child's own nonzero code otherwise. Stopping a child that has already ended is no error, underset -etoo (time-gate.shand the timing runners run under it), and the pid is cleared once the child is reaped, so a late signal reaches no other process. INT works the same way unless the runner itself was started with&by a shell, because bash leaves INT ignored in that case. The child keeps the runner's stdin (<&0), because a background command in a non-interactive shell reads/dev/nullotherwise.lease_stop <pid>, also intools/gate-bound.sh, sends TERM totimeoutand to its process group, waits for the group's live members (a zombie counts as ended), then sends KILL and reapstimeout, all within one cleanup budget (9 s by default, the TERM wait ending 2 s before it). A group still alive at the end of the budget is reported ([bound] <pid> or its process group still alive after its <n> s cleanup budget) andlease_stopreturns 70, as it does when it cannot read the process table. The TERM goes to the group too because GNUtimeoutthat receives a TERM before it has returned fromforkexits without signalling its command, and the command then keeps the lease or the lock intimeout's group.run_bounded: gpu-gate.sh's three start paths (plain,BLOOMERY_GATE_STACKSandBLOOMERY_GATE_GDB; the stacks path now sources stack-watch.sh into the runner's shell and puts the runner's own traps back after the watch), host-gate.sh, gate.sh, time-gate.sh and lease.sh'slease_bounded. lease.sh now sourcesgate-bound.shbesidelease-probe.sh, and time-gate.sh getsrun_boundedthrough lease.sh and keeps its own 600 s bound.lease_boundedsends the signal it passed on to the runner again (kill -s <signal> $$), and the runner stops, by its own trap where it set one, instead of starting its next arm. For that,run_boundedrecords the signal it passed on inBIN_SIGNALand puts back the caller's own TERM, INT and HUP traps when it returns, instead of resetting them.dump.shanddump-mtp.shsetexit 143andexit 130traps before they calllease_bounded, and a reset would drop them. The gate runners other than gate.sh set no such traps and ignoreBIN_SIGNAL, so for them nothing changes.run_bounded. lease.sh has three helpers for this:lease_capture <seconds> <command…>runslease_boundedwith stdout and stderr in a temp file and puts them inLEASE_OUT, as$(… 2>&1)gave them.lease_filter <seconds> <stdout|stderr> <file> <filter…> -- <command…>runs a live filter (the depth runners'majflt_mark, dma-dram-share.sh'sstamp) on the command's output through a FIFO:stdoutfilters the combined output,stderrfilters stderr and leaves stdout inLEASE_OUT_FILE. The filter runs with descriptor 9 closed, so it never holds the lease. The bound and the arguments are checked before the filter starts. Likerun_bounded,lease_filtersets its trap before it starts the filter, and a signal that comes before the filter's pid is known is acted on as soon as it is: the trap ends and reaps the filter, puts back the caller's traps and sends the signal on to the runner. Without that, a filter still waiting to open the FIFO would outlive the runner and hold the runner's stderr open. A signal that comes after the filter is reaped but before the caller's traps are back is held and sent to the runner once they are, so the caller's trap, or the default action, ends the runner and its next arm does not start. When the command succeeds and the filter fails,lease_filterreturns the filter's code.lease_out_initmakes the temp dir with that file and FIFO, and addslease_out_cleanto the runner's EXIT trap without replacing what is there.lease_boundedalso takesLEASE_BOUNDED_OUTandLEASE_BOUNDED_ERR, for a caller that names its own files.lease_capture; perf-decode.sh's three readers and governor-ab.sh's ik arm, whose stderr was dropped, write to files throughLEASE_BOUNDED_OUT. depth-glm5next.sh'soursarms, depth-ds41.sh's and depth-qwen3moe.sh's reference arms, depth-ds41.sh'soursarm and dma-dram-share.sh's bench go throughlease_filter, and depth-qwen3moe.sh'soursarms throughlease_capture. The DS41 and Qwen3-MoE arms keep their$BOUND. The DS41 and GLM5Next preheats and cstate-ab.sh's arms take their output throughlease_capturewith the bound they had ($BOUND, and 600 s in cstate-ab.sh). qdot-rate.sh runs its rounds in its own shell into the sitting file and prints the file after them, and expert-union-dump.sh reads its prompts from a process substitution instead of a pipe into its loop.lease_boundedas well: the build steps of build-dump-draft.sh, build-dump-mtp.sh, build-ik-cand.sh and build-ik-mimo2.sh, and host-rate.sh, ik-draft.sh, ik-greedy.sh, ik-ppl.sh, router-trace.sh, r8-sidecar.sh, ncu-gpu.sh, nsys-ds41.sh and nsys-gpu.sh (its profiled arms and itsanalyzestep). ik-ppl.sh and router-trace.sh used to start the command in the background to publish its pid. They now setLEASE_BOUNDED_PIDFILE, andlease_boundedwritestimeout's pid there before the binary starts.lease-hold.shruns its command throughrun_bounded timeout --kill-after=10 0, where the 0 means no bound, so the command gets a group thatlease_stopcan reach.timeoutand its group withlease_stop, and a TERM, INT or HUP that comes before the decoder's pid is known is held and acted on as soon as it is (exit 143, 130 or 129). Before, a TERM duringperf recordended the profiler and then the runner, and the decoder and itstimeoutkept the lease. After a normal run the runner reaps the decoder and clears its pid, so the laterperf script,annotateandreportcalls keep their usual signal handling. A decoder that fails now fails the run with its code, a reason (cut off at its <n> s boundfor 124) and the last 20 lines of its log. The EXIT trap keeps the runner's exit code, removes the capture files withlease_out_clean, and exits with the cleanup failure whenlease_stopfails. Its symbol table'sawknow writes to("sort -rn | head -n " top)in parentheses, which BSDawkon the Mac needs.lg_processruns a load of arms under onetimeoutin the background. It now sets a TERM, INT and HUP trap before it starts thattimeout: the trap stops the load withlease_stop, puts back the caller's traps and sends the signal on to the runner, and a signal that comes before the load's pid is known is acted on as soon as it is. A signal that comes after the load is reaped but before the caller's traps are back is sent to the runner once they are, so the runner stops instead of starting the next load. Its own stops (no line within the bound, a line past the last arm) also go throughlease_stop, and a stop that fails ends the run with its code unless the load itself exited nonzero. depth-qwen3moe.sh's memory scope (MEM_SCOPE_SCRIPT) passes a TERM, INT or HUP on to its command once, ignores further ones and waits again, so it returns the command's code; it used to stop waiting at the first signal.PIPESTATUS[0]. expert-union-dump.sh now stops with code 1 at the first failed prompt; itsexit 1used to end only the pipeline's subshell, and the script went on. dma-dram-share.sh now refuses a value with a leading zero (0600) with 64, aslease_boundedrefuses such a bound; it used to refuse only0. Its EXIT cleanup now stops the copy's group withlease_stop, removes the capture files and exits with the cleanup failure, and a TERM, INT or HUP that comes while the copy is starting ends the run once the copy's pid is known.depth-*-stub.shtests build temp trees with a copy of lease.sh; those trees now gettools/gate-bound.shtoo. The lease self-test reads depth-qwen3moe.sh's arms through a variable path, so check-recipes' walk of the timing scripts does not count lease.sh as a caller of that lease-taking runner.cargo testintotee. In a pipeline,run_boundedwould run in a subshell that a TERM to the runner does not reach. The output now reachesteethrough a FIFO beside the log, and the runner waits forteebefore it counts the passed tests. A FIFO that cannot be made ends the runner with 70 before cargo starts, and ateethat fails after a passing run ends the runner withtee's code (cargo's own failure wins).teestarts beforerun_boundedsets its trap, so gate.sh sets a TERM, INT and HUP trap of its own before it startstee: oncetee's pid is known the trap exits (143, 130 or 129), and a signal that comes before that pid is known is acted on as soon as it is. The EXIT trap then ignores further signals, sendsteea KILL and reaps it before it removes the log and the FIFO, because the reader may still be the shell opening the FIFO, beforeteehas its default signal handlers. Without this, a TERM in that window ended the runner, andtee, still waiting to open the FIFO, held the runner's output open.tools/ref/stack-watch.shpasses a TERM or HUP on to its command and to a gdb dump under way. It now sourcesgate-bound.shand runs both the command and the dump throughrun_bounded. The command starts as(set -m; run_bounded "$@"), so it has a process group of its own and a background descendant of the command gets the TERM too. gpu-gate.sh now sources stack-watch.sh into the runner's shell instead of starting it withrun_bounded bash, and puts back its own TERM, INT and HUP traps after the watch. A cancelled watch waits for eachtimeout's group, and a lock either child inherited is free when the watch returns. The dump runs in the background and is waited for. Before, a TERM that came during a dump was handled only after the dump, and an outer KILL in that window left the innertimeoutand the binary behind. Once it has passed a signal on, the trap ignores further ones, because under GNUtimeoutthe watch gets the bound's TERM twice (from the outertimeout's group signal and from the runner). The first signal still cuts short the wait it arrives in, so the watch makes each wait, for the dump and for the command, twice, asrun_boundeddoes: it goes on only after the child has ended, and returns the command's code. The first wait of each pair is writtenwait ... || true, and each TERM the watch sends to a child that may have ended is written|| :, so a watch run underbash -estill reaches its last waits. The trap also sets$stop. A signal that comes outside a wait (during the loop's one-second sleep) ends the loop at its next turn, and the watch then waits for the command and starts no dump. Without it, a command that took longer than QUIET to end after its TERM was dumped with a gdb that no signal would reach. As inrun_bounded, the trap is set before the command starts: a signal before the command's pid is known sets$stop, and the command gets its TERM as soon as the pid is known, unless the trap has sent it one already ($told). The trap also ignores nothing from the last$stopcheck before a dump until the dump's pid is known ($spawning), because a dump started with TERM ignored can lose the TERM the watch sends it beforetimeoutsets its own handler. A signal in that window goes on to the command, and the dump gets its TERM as soon as its pid is known. The dump writes to a file beside the watch's log, and the watch passes that file to stderr, prefixed, once the dump has ended, so no child of the dump outlives it. The dump'stimeoutsends a TERM at 120 s and, with--kill-after=10, a KILL ten seconds later. After a dump the watch gives the quiet process ten seconds to end before a KILL. It reads the process state withps -o stat=and counts a zombie as ended;kill -0succeeds on a zombie, so a process whose parent, or the subreaper it was reparented to, does not reap it held the watch for the full ten seconds. Whenpscannot read the state,alivechecks withkill -0that the pid exists; an existing pid is reported on stderr (stack-watch: cannot read state of existing pid <pid>) and counted as alive, so a command that ignores the TERM still gets its KILL whenpsfails. An INT reaches the watch's trap only when the watch runs in the foreground.tools/ref/stub-timeout.pystands in fortimeouton hosts without coreutils (the Mac). It now keeps coreutils' timing and exit codes. It sends TERM at its bound or when it receives a TERM. It sends KILL--kill-afterseconds after the first of the two, and--kill-after=0means no KILL. It exits 124 when the bound ran out and 137 when the KILL ended the command. It sets its TERM handler before it starts the command, so a TERM that comes right after the runner starts it reaches the command's group. Like coreutils, it now leads a process group of its own and sends its TERM and KILL to the group, ignoring its own TERM while it forwards it. A bound of 0 means no bound, and the command inherits the monitor's open descriptors, including a lease held on descriptor 9. Before, it sent KILL at once at its bound and signalled only its direct child, so a run that left a grandchild behind could not fail on the Mac. The card tests copy it ontoPATHastimeoutwhen the host has none.tools/ref/cancel-stubs.shholds the two fixtures the lease and stack-watch self-tests share: atimeoutthat makes its own group and exits on a TERM without passing it on, and a readiness check that waits until the stub'stimeoutis asleep.The second option in the issue keeps both bounds in one process group. The simplest way to do that is
timeout --foregroundon the inner bound, and in that modetimeoutdoes not end the command's own children when the bound expires. So I did not use it.The tests:
gate()takesGB=<s>for its own bound (the default stays 60 s). The stub writes its pid and its parent's pid (the binary'stimeout) toSTUB_PID. WithSTUB_TERM=7it ends with code 7 one second after a TERM. The case holds the stub and letsgate()'s bound end the run withGB=10, once plain and once under the watch. Right after the bound returns 124 it checks that the stub and itstimeoutare gone and the card lock is free. Then it checks that the output pipe reached EOF and that the runner's own exit line saysexit 7. The processes are checked before the wait for EOF, so a runner that passes the TERM on and exits without waiting does not pass. The exit line catches a runner that returns the status of its interrupted wait (143) instead of the child's.BLOOMERY_GATE_STACKS), with atimeoutstand-in that makes its own group and exits on a TERM without passing it on, and asleepstand-in that holds the watch's one-second sleep until the case lets go. The case sends the runner's pid a TERM while the watch sleeps. The runner must end with 143, the command and itstimeoutmust be gone, the output must reach EOF and the gate and v41-load locks must be free. Two more cases makepsfail whilerun_boundedstops a child that exits with 0 or 7. The run must end with 70 for the child that exited with 0 and with 7 for the other, and printcannot read processes while stopping.gdbon PATH holds, so the watch (QUIET 1) stays in its dump, and the stub ends only six seconds after its TERM; it sets its TERM trap before it writes the pid the case waits for. The case sends a TERM to the watch and a second one 1.5 s later. The watch must end within 20 s with the command's code (7, two seconds after its TERM), and neither the gdb nor the command may be left. In the second, the command goes on after the watch has ended its quietsleep, and the case sends a TERM while the watch waits for the command. The watch must end with the command's 7, not 143, and the command must be gone. In the third, the command prints every 0.2 s until its TERM and then takes five seconds to end, longer than the quiet time (2 s), and the case sends the TERM a second after the command's pid is there. Its printing, not the TERM's timing, keeps the quiet time from running out before the TERM. No dump may start (the stub gdb writes its pid when it starts), the watch must return 4 to 7 s after the TERM with the command's 7, and the command must be gone. In the fourth, the command sets its TERM trap, starts a backgroundsleepand writes its pid and its parent's pid. The case waits until the command'stimeoutis asleep and the descendant is there, then sends the TERM. It runs twice: once after the watch has read the command's pid, and once on a copy of the watch with a wait planted right after the command starts, so the TERM comes before the pid is read. Each time the watch must end with the command's 7 and both the command and its background descendant must be gone; in the planted run the watch must have recorded the TERM before it had a pid. The fifth and sixth put atimeoutstand-in on PATH that makes its own group and exits on a TERM without passing it on, as GNUtimeoutcan beforeforkreturns, once for the command and once for the dump, with a lock the held child inherited. The case waits until the child and itstimeoutare there with the lock held, sends the watch a TERM, and the child must be gone and the lock free. A further case puts apsstand-in that exits 2 first onPATHand callsalivewith the pid of the running self-test:alivemust succeed and printstack-watch: cannot read state of existing pid <pid>. The checks that a child has gone use the samealive(five places), so a zombie is not counted as left behind. A failed case prints the last line of what it read (for exampledumping: yes, ended in N s, left: none) on its FAIL line, so a log that keeps only FAIL lines shows why.teestarts, before and after its pid is recorded: the runner must end with 143 or 129, cargo must never start, andteemust end. Two cases give gate.sh ateethat exits 9 after it has copied the output: after a passing summary the runner must end with 9 (GATE RED (exit 9)), and when cargo ends with 3 it must end with 3.next arm. The stub sets a trap that ends it with 7 one second after a TERM, then writes its pid and its parent's pid (itstimeout) and holds. The case waits until that pid file is there and the stub'stimeoutis asleep waiting for it (polled every 0.1 s), checks that it got there, and sends a TERM to the runner's pid, once with no runner trap and once with a runner trap that printstrap ranand exits 143. Each time the runner must end with 143 before the call's 20 s bound, the stub and itstimeoutmust be gone, the lease must be free andnext armmust not appear; with the trap,trap ranmust appear. The call islease_boundedin the runner's shell,lease_capture(whose temp dir must be gone too), alease_boundedwhose copy ofrun_boundedwaits between starting the child and reading its pid, so the TERM lands in that window, alease_boundedunder thetimeoutstand-in that exits without passing the TERM on,lg_processwith a stub load (also under that stand-in; skipped where bash is older than 4.1, as/bin/bash3.2 on a Mac is), a profiler arm (the profiled-arm lines of nsys-gpu.sh run with a stub profiler that ignores TERM, andLEASE_BOUNDED_PIDFILEmust name itstimeout), and nine arms taken fromdepth-ds41.sh,depth-glm5next.sh,depth-qwen3moe.shandcstate-ab.sh: the DS41 and Qwen3-MoEoursand reference arms, the DS41pparm, the Qwen3-MoE memory-capped arm, the DS41 and GLM5Next preheats (with a held stub in place of the preheat script) and cstate-ab.sh's arm loop.MEM_SCOPE_SCRIPTruns the held stub and gets two TERMs 0.1 s apart; it must return the stub's 7, and the stub must be gone.perf, and the case sends the runner a TERM duringperf record(also under thetimeoutstand-in), before the decoder's pid is assigned, and duringannotateand during the callers report. Each time the runner must end with 143 before the 20 s bound, with the decoder, the profiler and theirtimeouts gone and the lease free; before the pid, noperfcommand may run. A decoder that ends with 23, and one that ends with 124, must fail the run with that code, thedecode exited <code>:line and the last 20 lines of its log. The EXIT trap is also run alone, for a runner that ends with 0 or 23 and alease_stopthat returns 0 or 70: the code must be the runner's own unless the stop failed, in which case it is 70, andlease_out_cleanmust run each time.lease_stopis replaced by a stub that fails with 70 (71 in the second pair). A load that stalls and exits with 0 must end the run with 70, and one that exits with 7 with 7. A load that prints a line past the last arm gives 71 and 7 the same way.lease_filterwaits between starting the filter and reading its pid, and the case sends the runner a TERM there, with no runner trap, with one that exits and with one that returns. The filter must be gone and the runner's stderr must reach EOF before the case cleans up, the lease must be free, and a trap that returns must find its own trap back afterwards. The case never signals the filter itself.DEBUGtrap sends the runner a TERM or a HUP right afterlease_filterhas reaped its filter and before it puts the caller's traps back, once withset -eoff and once with it on. The runner must end with 143 for the TERM and 129 for the HUP, and the marker of the next arm (NEXT_ARM_STARTED) must not appear.lg_run_unitwith a stub load. The stub's command builder printsNEXT_ARM_STARTEDwhen a further load starts, and it must not appear.lease_capture's output and code; the EXIT trap it extends (a quoted one and one with a trailing comment, both still run), read in the runner's own shell with its positional arguments untouched; amktempthat fails (code 70, empty output);lease_filter's two streams; a failed filter's code; a refused bound that starts no filter; dma-dram-share.sh refusing0600; expert-union-dump.sh stopping at a failed prompt; and a command that reads the runner's stdin.Left open:
run_bounded,lease_filter, gate.sh and the watch each set their trap before they start their child. The lease self-test reaches the first two windows with a planted wait, the card tests reach gate.sh's with a signal planted right afterteestarts, and the stack-watch self-test reaches the watch's window before the command's pid is read with a wait planted in a copy of the watch. The watch's window before a dump's pid is read is reached only by a mutant under "Fail first".$stopin two places. The loop's condition ends the loop at its next turn, so no new round starts after the signal; the round under way when the signal came may still scan withpsand print "nothing dumped". The check before a dump keeps that round from starting a dump.What I ran into
This does not block the PR.
The head is rebased onto main
85511826. After the review onba4aee3d,lease_stopsends TERM to the monitor first and to the rest of its group only after the monitor exits, with one deadline and the KILL step kept. A new case intools/gpu-gate.sh --self-testuses a child that drains on the first TERM and aborts on a second: the oldlease_stopfails it (49 of 50 ok), and the head passes the whole self-test (111 of 111 ok).tools/recipes.py --self-testnow names the Clefvis reference tree as the never-skip reason of the cancellation fixture (174 gate recipes, 0 failures).After the review on
e078e390, the Clefvis wrapper's three innertimeoutcalls (chat,tower,hidden) go throughlease_bounded, andtools/ref/lease.sh --self-testgains twelve cases: each call, with the child ending TERM at 0 and at 7, with and without an outer TERM trap. Each case checks that the child and its timeout end, the lock is free, the output reaches EOF, the runner returns 143 and no next arm starts. With the oldclefvis.shthose cases fail (24 failures); at the head the self-test reportsok (0 failures). This ran on an Apple Silicon Mac with bash 5.3, through the self-test's timeout stub.After the review on
b15f54a2, two more changes:run_boundedno longer resets TERM, INT and HUP before it puts back the caller's traps. It saves an explicit reset only for a signal the caller had no handler for and restores each handler directly, so a TERM that arrives at that point still runs the caller's handler. A lease self-test case sends the TERM there and checks that the server ends, the caller's handler runs, the lease is free, the output reaches EOF and no next arm starts.lease_stopuses a single deadline for the TERM wait, the KILL and the reap: 9 seconds by default, 7 for TERM and up to 2 for KILL and reap, so it finishes before an enclosingtimeout --kill-after=10.run_boundedpasses half of its budget to its command (LEASE_STOP_GRACE, 9, 4, 2, 1),lease_boundeduses the inherited budget for itstimeout --kill-after, and a budget of 0 refuses to start the next bounded command with a named error and status 70. A lease self-test case runs a child that ignores TERM, INT and HUP under an outertimeout, an outer TERM trap and the innerlease_bounded, and checks the lock and EOF right after the outer bound returns. Before the change it returned 137 with the lease held; now it returns 124 with the lease free.The new regressions fail on the previous head (11 failures) and pass at
babd6b99. The head is rebased onto main98a513fc; the five commits are unchanged by the rebase.timeoutis uutils coreutils 0.8.0. Whentimeoutitself receives a TERM from outside, GNU coreutils returns the child's code and uutils returns 143:timeout 900 bash -c 'trap "sleep 1; exit 7" TERM; sleep 30 & wait' & p=$!; sleep 1; kill -TERM $p; wait $p; echo $?prints 143 there and 7 with GNU coreutils 9.4 on a DGX Spark.run_boundedreturnstimeout's code (the comment aboverun_boundedstates that it expects GNU's), so on such a machine an ended runner reports 143 instead of the binary's code, and the two gpu-gate self-test cases that look forexit 7expect GNU's behavior. Options: take the binary's code from somewhere other thantimeout's status; or require GNUtimeoutfor the gate runners and say so in the tools' requirements.just contrib-check --tier t1on that Ubuntu machine, with its owntimeout, endedtotal=104 red=1atd4d899b1and at main, withcheck-recipesred. There the load-groups self-test got 15 atd4d899b1and 124 at main where it expects 143, which is thetimeoutdifference above, and the two gpu-gate cases that look forexit 7failed atd4d899b1. I ran it once more with GNUtimeout9.7 first onPATH. Those failures were gone and both trees still endedred=1, on the gate-batch self-test's checks that two items sharing a lock never run at overlapping times. Main failedpool: two pool items never overlapin the second run andchain: a big-host item never overlaps a memberin the first.d4d899b1failedchain: no two members overlap (the mutex)in both runs andpool: two pool items never overlapin the second. I did not find why that chain case fails. The same t1 on a DGX Spark endedred=0atd4d899b1.shellcheckis not installed, at main too.Code shape
run_boundedandlease_stophave one owner,tools/gate-bound.sh, which the gate runners already source and lease.sh and stack-watch.sh now source too; the four gate runners,lease_boundedand stack-watch.sh run their bounded children throughrun_bounded, and perf-decode.sh and load-groups.sh stop their backgroundtimeoutwithlease_stop. The timing runners' bounded children go throughlease_bounded,lease_captureorlease_filter. The DS41 and Qwen3-MoE arms, the two preheats and cstate-ab.sh's arms no longer start atimeoutof their own.stack-watch.shkeeps its own trap for its loop and its dump.lease_filterrefuses by name a stream other thanstdoutorstderrand a call without a filter or a--command, and checks its bound aslease_boundeddoes, all with 64 and before the filter starts. A temp dir or FIFO it cannot make returns 70, and so does gate.sh when it cannot make its FIFO.lease_stopreports a group that outlives its KILL and returns 70. dma-dram-share.sh now refuses a leading zero. A runner that is ended still exits with a status, now the binary's, a failed filter fails the arm, and a failed decoder fails perf-decode.sh with its code and the end of its log.tools/check-comments.shpasses at the head on the Mac (mac-static: check-comments rc 0). It also passed on an RTX 5090 machine atd4d899b1, andd4d899b1differs from the head only intools/ref/stack-watch.sh.gate()'s default bound is still 60 s. One window is wider: the stack-watch dump case allowed[0-7] sand now allows1?[0-9] s, because its stub gdb now ends six seconds after its TERM. Without the signal passed on, the stub holds until the dump's TERM at 120 s, so the window still tells the two apart. The case carries aPIN(2026-10-15):comment with this reason. No other case changed its expectation.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up. No Rust file is touched.Duplication found or removed (
path:line, at main55acee0b): the same foregroundtimeoutstart was intools/host-gate.sh:25,tools/gate.sh:74,tools/gate.sh:79,tools/gpu-gate.sh:1779,:1794and:1799,tools/ref/time-gate.sh:38andtools/ref/lease.sh:461. All of them now go throughrun_bounded. The DS41 and Qwen3-MoE arms started their own attools/ref/depth-ds41.sh:1619,:1621,:1730and:1732andtools/ref/depth-qwen3moe.sh:2223,:2372and:2378, the preheats attools/ref/depth-ds41.sh:1588andtools/ref/depth-glm5next.sh:820, and cstate-ab.sh attools/ref/cstate-ab.sh:65.lease_boundedran inside a substitution or a pipeline in ab-decode.sh (for exampletools/ref/ab-decode.sh:58), decode-measure.sh, depth-decode.sh, depth-glm5next.sh, depth-gpu.sh, dma-dram-share.sh, governor-ab.sh, perf-decode.sh, qdot-rate.sh (tools/ref/qdot-rate.sh:49) and expert-union-dump.sh (tools/ref/expert-union-dump.sh:16). All of these now run in the runner's shell throughlease_bounded,lease_captureorlease_filter. The backgroundtimeouts attools/ref/perf-decode.sh:31andtools/ref/load-groups.sh:152had no stop of their own and now stop throughlease_stop. Other runners undertools/ref/still start some commands under a foregroundtimeoutof their own (for exampletools/ref/depth-ds41.sh:1355); they are not changed here. Cancelling and cleaning up the runners that remain is out of scope and tracked in #313.What I ran
The head,
babd6b99, has five commits, one per contract. Againstfdff9218it changestools/ref/lcpp-warm.sh: the shared llama-server arm that the DS41 and Qwen depth runners use stops its server andtimeoutgroup throughlease_stopon TERM, INT or HUP, before or after the pid is known and during a request, so the lease is released; its self-test covers those cases, failed with 13 failures before the change and passes after it. It also changes one line oftools/ref/card-tests/run.sh: the tee cleanup check now keeps an existing pid alive whenpscannot read it, and the card tests ran again at the head (card-tests: 735 tests, 0 failed). Both sit on main55acee0band were not rebased. Every result below comes fromfdff9218, exceptcontrib-checkt1, which ran atd4d899b1, and the gates and the two GPU gates marked "ata0776ff3".d4d899b1differs from the head only intools/ref/stack-watch.sh(aliveand its self-test),3148d735differs fromd4d899b1only intools/ref/lease.shandtools/ref/load-groups.sh, anda0776ff3differs from3148d735only insideself_test()intools/ref/stack-watch.sh. At the last check main wasd0e8a8e1; the head merges with it without conflicts (git merge-tree).On a Mac
./tools/mac-static.sh 55acee0b…, with a local edit totools/check-recipes.shthat starts its blocks two at a time:mac-static: ok.check-recipesran the tool self-tests, among themcard-tests: 735 tests, 0 failed,gpu-gate self-test: 109 of 109 ok,stack-watch self-test: okandgate-batch self-test: 639 of 639 ok, withcheck-recipes: 57 tool self-tests ok./bin/bash3.2.57, withLC_ALL=C:/bin/bash3.2.57bash tools/ref/stack-watch.sh --self-teststack-watch self-test: okstack-watch self-test: okbash tools/ref/lease.sh --self-testself-test: ok (0 failures)self-test: ok (0 failures), withskip bounded-ds41-load: the runner's bash has no exec {fd}<>andskip bounded-ds41-load-fork: the runner's bash has no exec {fd}<>bash tools/gpu-gate.sh --self-testgpu-gate self-test: 109 of 109 okgpu-gate self-test: 109 of 109 okbash tools/ref/card-tests/run.shcard-tests: 735 tests, 0 failedcard-tests: 735 tests, 0 failedbash tools/ref/card-tests/cpu-guard.shcpu-guard: 9 tests, 0 failedcpu-guard: 9 tests, 0 failedbash tools/ref/load-groups.sh --self-testself-test: ok (0 failures)self-test: ok (0 failures), withskip stall: bash 3.2.57(1)-release has no exec {fd}<>shellcheckon the changed timing scripts did not run:shellcheck: command not foundon that Mac atd4d899b1, the same at main55acee0b.tools/check-comments.shran inside mac-static above.On a DGX Spark
just contrib-check --tier t1, which runs the t0 units and the host-nightly units, ran atd4d899b1three times in thebloomery-devCUDA 13.3.1 container (NVIDIA GB10, driver 595.84). Each run endedDONE tier=t1 total=104 red=0, in 408 s, 298 s and 297 s. The head differs fromd4d899b1only intools/ref/stack-watch.sh, and t1 was not run again on it. The head's stack-watch self-test passed on a Mac and on an RTX 5090 machine (see their sections). t0 was not run on its own.On an RTX 5090 machine
The machine runs Ubuntu on x86_64 with GNU bash 5.3.9 and
LC_ALL=C. Its owntimeoutis uutils coreutils 0.8.0, which reports a cancelled run's status differently (see "What I ran into"). The suites therefore ran with GNUtimeout9.7 first onPATH.bash tools/ref/stack-watch.sh --self-teststack-watch self-test: okbash tools/ref/lease.sh --self-testself-test: ok (0 failures)bash tools/gpu-gate.sh --self-testgpu-gate self-test: 110 of 110 okbash tools/ref/card-tests/run.shcard-tests: 735 tests, 0 failedbash tools/ref/card-tests/cpu-guard.shcpu-guard: 9 tests, 0 failedbash tools/ref/load-groups.sh --self-testself-test: ok (0 failures)bash tools/ref/depth-glm5next-stub.shdepth-glm5next-stub: 49 checks, 0 failedbash tools/ref/depth-ds41-stub.shdepth-ds41-stub: 84 checks, 2 failed, the same line and failures as main55acee0bon that machine, so not from this changebash tools/ref/depth-qwen3moe-stub.shdepth-qwen3moe-stub: 86 checks, 1 failed, the same line and failure as main55acee0bon that machine, so not from this changeThe failures are the
warmcases:FAIL warmandFAIL warm-failin the DS41 test, andFAIL warm: rc 0, want 1in the Qwen3-MoE test. Atd4d899b1, with the machine's owntimeout, gpu-gate ended108 of 110 okand load-groups failedstall-term.stack-watch's self-test under a child subreaper that does not reap orphans, so an ended child stays a zombie, three runs on CPUs 0 to 3:
stack-watch self-test: okeach time, with the dump casedumping: yes, ended in 6 s, left: nonein two runs anddumping: yes, ended in 10 s, left: nonein the other. In the same setup, 3 of 20 runs of the full self-test ata0776ff3failed withleft: gdbon a DGX Spark, and the process caught each time was an endedgdbin state Z ([gdb] <defunct>). The self-test's checks for a leftover now usealive, which counts a zombie as ended.Gates at
a0776ff3The gates ran at
a0776ff3, before the two helper scripts that differ at the head.tools/affected-gates.shon those two files selects no gate (0 of 166 gate-recipes selected), so I did not repeat them.tools/affected-gates.sh 55acee0b --no-boxata0776ff3selects166 of 166 gate-recipes. Each ran asBLOOMERY_BOX_LOCAL=1 just <recipe>. A gate that failed ran again on main55acee0bon the same machine, and the two failure lists were compared:gates-affected: 175 gates, ok 32, same as base 143, differs 0, unproven 0. The other gates counted as "same as base" fail at the head and at main with the same failure lines, so they are failures on this machine, not passes. Nine of the 175 are fixture variants (<recipe>@BLOOMERY_FIXTURE_VARIANT=<variant>) that ended withhead 64 base 64 same.GPU gates through
run_boundedtools/gpu-gate.shstarts every GPU gate's binary throughrun_bounded. One gate ran on each card ata0776ff3, on base55acee0b. Neither gate reads a model file; both build their inputs from fixed shapes.nvidia-smilineNVIDIA GB10, 595.84, [N/A]:BLOOMERY_BOX_LOCAL=1 BLOOMERY_ARCH=sm_121 just gate-gpu-kquantprintedPASSED: gate_kquant q5k_gemv_sel within 1e-5 of the f64 dequant_row reference at 8 shapesandgpu-gate.sh: gate_kquant ran 1 s (exit 0).nvidia-smilineNVIDIA GeForce RTX 5090, 595.99.02, 32607 MiB:BLOOMERY_BOX_LOCAL=1 BLOOMERY_ARCH=sm_120 just gate-gpu-p1printedPASSED: gate_p1 K-quant gemvs within 0.00001 of the q8_1 referenceandgpu-gate.sh: gate_p1 ran 7 s (exit 0).Fail first
I planted each of 28 candidate mutants in a copy of the head's tree on the RTX 5090 machine. The check ran on the mutant, then on the restored copy, and the restored source was compared with the head. 26 of the 28 were caught there at this head. The failure lines in the table are from the run at
d4d899b1, except those of the newalivemutant and the ones the run at the head also recorded. The 27 earlier mutants ran again at the head, and each restored copy ended green. One is excluded and one is caught only by BSDawkon a Mac; both are explained below the table. Every row ran with GNUtimeout9.7 first onPATH, because that machine's owntimeoutended the restored copy red in three of them atd4d899b1(the two cleanup-status mutants and the one that sendsteea single TERM). Four rows use a probe outside this PR that sends the TERM inside a delay the mutant plants. On every restored copy the check ended green.lease_filtersends no signal on after it has reaped the filterFAIL bounded-filter-reaped-TERM-off-rc: got [0], want [143], with the same in all four cases of each signal andset -estate, andself-test: FAIL (8 failures)lg_processsends no signal on after it has reaped the loadFAIL reaped-TERM-off-rc: got [0], want [143], with the same in all four cases, andself-test: FAIL (8 failures)lease_filtersets no trap of its own and acts on no signal held from before the filter's pidreader=alive stderr=openinbounded-filter-open-term-none-readerrun_boundedstarts the child before it sets its trapleft: stub timeout, lease: heldinbounded-startup-termlease_capturetakes the output with$(lease_bounded … 2>&1)self-test: FAIL (12 failures), among them the preheat and cstate-ab.sh armswatch still waiting 25 s after the TERM, gdb started: yes, left: gdbbash -ebash -erc 1, ended in 3 s, gdb started: yes, left: commandteerun_boundedrunner gone: yes, output ended: notee's pidrunner gone: no, output ended: nolease_filter's trap does not end and reap the filterreader=alive stderr=openinbounded-filter-open-term-none-readerleft: decoder decoder-timeout, lease: heldinbounded-perf-record-termlease_stopsends one TERM totimeoutonlyleft: stub, lease: heldinbounded-fork-term,left: decoder record, lease: heldinbounded-perf-fork-termlg_processsets no signal trapleft: stub timeout, lease: heldinbounded-ds41-load-termno line matches /^decode exited 23: /inbounded-perf-fail-reasonrun_boundedstack-watch self-test: 4 failedstack-watch self-test: 2 failedrun_boundedleft: child, lock after: heldin the dump caselease_stopreads thepsrows without its ownIFSleft: stub, lease: heldinbounded-ds41-load-fork-termalivereturns false whenpscannot read the state of a pid that existsFAIL a failed state read of an existing pid: alive, with a diagnostic (rc 1, want 0run_boundedno longer changes the runner's exit coderc 0 (want 70)in the case "a failed process read after TERM keeps cleanup failure"lease_stopwhen it stops a loadstall-cleanup-0-rc: got [post 0 rc=0], want [post 0 rc=70]teeand acts on no held signalteestartstee-four-cases: total=12 failed=2teeone TERM and does not reap itbounded-startup-ready: got [no], want [yes]timeoutself-test: FAIL (31 failures)python3 tools/recipes.py --self-testself-test: FAIL (166 gate recipes, 1 failures)ff-term-readyis not counted. It changes only the lease self-test's own readiness wait and deletes its assertion, so no product behavior differs, and the self-test ends with rc 0 with it.The
awkmutant removes the parentheses around("sort -rn | head -n " top)in perf-decode.sh. GNUawkaccepts that, so the Linux run does not catch it (red=0 restored=0). BSDawkon a Mac does: the lease self-test ended withFAIL bounded-perf-annotate-term-rc: got [2], want [143]there, and ended with rc 0 on the restored copy.No mutant covers the case where gate.sh cannot make its FIFO.
Hardware (if the change is for a machine)
Not a machine-specific change. The runs used a Mac, one DGX Spark (NVIDIA GB10, driver 595.84) and an RTX 5090 machine (NVIDIA GeForce RTX 5090, driver 595.99.02).
AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.