Skip to content

t0 under uutils coreutils: the bounded forms run a timeout that keeps GNU's exit codes, the batch mutexes are one mkdir(2), two fixtures read the same - #1153

Merged
juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-q38-fix-uutils-t0
Nov 3, 2026

Conversation

@juliankang4

@juliankang4 juliankang4 commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Ubuntu 26.04처럼 uutils coreutils를 쓰는 환경에서 빨갛던 self-test들을 고쳤습니다.

What and why

On Ubuntu 26.04 the coreutils are uutils 0.10.0, and several tools/ self-tests and the t0 tier fail there while they pass on GNU coreutils. Four behaviours differ. timeout --kill-after returns 124 after a TERM from outside, so a cancelled run reads as one cut off at its bound. mkdir(2) can be won by more than one racer, so the batch mutexes could be taken twice. sort -t= and join -t= reject the attached form. cat with a closed stdout exits 0.

Fixes #1150.

  • bound_timeout in tools/gate-bound.sh picks the monitor that run_bounded, bounded and bounded_bg start: the timeout on PATH unless it names a coreutils other than GNU's, else gnutimeout, gtimeout or tools/ref/stub-timeout.py. tools/contrib-check.sh bounds its units with it, tools/nightly/install.sh installs the stand-in beside gate-bound.sh, and tools/narrow-scan.sh sends bound_timeout and the stand-in with the box command.
  • mkdir_lock in tools/nightly/units.sh is one mkdir(2) that returns nonzero when the directory exists. The gate-batch.sh chain and pool mutexes and the output directory owner use it.
  • tools/ref/ik-pin-tree.sh spells the separators sort -t '=' and join -t '='. In tools/nightly/selftest.sh the unit fixtures print one line each and stdout is opened read-only, so cat reports the write error on uutils and GNU alike.
  • The monitor-choice-forms case in the tools/gate-bound.sh self-test sets LEASE_STOP_GRACE=4 and expects --kill-after=4, so it holds under contrib-check.sh, whose run_bounded passes half its grace to each unit.
  • tools/ref/load-groups.sh drops its own timeout stand-in, which bound_timeout now covers.
  • docs/contrib/local-check.md and the headers of the touched scripts describe the above.

Release notes: internal: t0 and the tool self-tests run on a host whose coreutils is uutils.

Code shape

The review reads these first. A box left unticked needs one line of why.

  • No second copy. Logic two models (or two call sites) share has one common owner; I lifted it there instead of
    copying it (AGENTS.md "Common code first", docs/rust-quality.md R14). Where I found an existing copy, I
    named it below.
  • Model code holds only architecture facts. A model's own files carry only what its architecture forces
    (tensor shapes, the attention kind, the quant). A common owner gained no per-model branch, flag or trait method.
  • Dead code is gone. Nothing I made unused is left behind (functions, flags, gate clauses, docs).
  • No silent failure. Undefined input is a named error or panic, never a defined-looking output.
  • Comments state what is true now. No dates, issue numbers or how a bug was found (tools/check-comments.sh).
  • No relaxed gate. No band, tolerance or lint moved to make a check pass; a re-pin carries PIN(YYYY-MM-DD):
    and its reason.
  • cargo fmt and cargo clippy are clean on what I touched; the lint count did not go up.

Duplication found or removed (path:line), or "none": removed. tools/contrib-check.sh had its own timeout or gtimeout choice and tools/ref/load-groups.sh its own stand-in injection; both now use bound_timeout in tools/gate-bound.sh.

What I ran

Upstream base 18e15bb654edf31805658395c9c7121c2be25c1a, PR head ed8e7d5d7fcfcba98997ee7913d2068b5d7b0b2e.

The self-tests ran in an ubuntu:26.04 container on an x86_64 Linux machine, as a normal user, with python3, git, gcc, just and rustup installed. The container's coreutils:

timeout: timeout (uutils coreutils) 0.10.0

Each test is bash <path> --self-test for tools/gate-batch.sh, tools/gate-bound.sh, tools/gpu-gate.sh, tools/nightly/selftest.sh, tools/ref/ik-pin-tree.sh, tools/ref/lease.sh, tools/ref/load-groups.sh, tools/release/pick.sh and tools/narrow-scan.sh.

Metric Base Head
tools/gate-batch.sh self-test FAIL chain: no two members overlap (the mutex); FAIL chain: a big-host item never overlaps a member 853 of 853 ok
tools/gpu-gate.sh self-test 153 of 155 ok 215 of 215 ok
tools/nightly/selftest.sh self-test FAILED (100 checks, 9 failures) ok (101 checks, 0 failures)
tools/ref/ik-pin-tree.sh self-test FAIL (7 failures) ok (0 failures)
tools/ref/lease.sh self-test FAIL (38 failures) ok (0 failures)
tools/ref/load-groups.sh self-test FAIL (2 failures) ok (0 failures)

On the PR head, narrow-scan.sh in the same container picks the gnutimeout monitor:

bound_timeout: gnutimeout
narrow-scan: self-test ok (142 cases, 0 failed)

On a GNU coreutils host (timeout (GNU coreutils) 9.7) the same test passes on the PR head:

narrow-scan: self-test ok (142 cases, 0 failed)

The monitor-choice-forms case in the tools/gate-bound.sh self-test sets LEASE_STOP_GRACE=4 itself, the value run_bounded hands to the units contrib-check.sh runs. Its expected --kill-after is 4 to match. With the variable set and the old expected value, 9, the case fails; on the PR head it passes. Same container (uutils timeout, bound_timeout: gnutimeout):

$ LEASE_STOP_GRACE=4 bash tools/gate-bound.sh --self-test
FAIL   monitor-choice-forms: got [gnutimeout --kill-after=1 5 true gnutimeout --kill-after=4 5 true gnutimeout --kill-after=4 5 true timeout ], want [gnutimeout --kill-after=1 5 true gnutimeout --kill-after=9 5 true gnutimeout --kill-after=9 5 true timeout ]
gate-bound self-test: FAIL (1 failures)

PR head:

$ LEASE_STOP_GRACE=4 bash tools/gate-bound.sh --self-test
ok     monitor-choice-forms
gate-bound self-test: ok (0 failures)

Lint on the head, the clippy run the repository's lint recipe uses: chain-clippy: lint rc 0 (^warning: 0, the ratchet 0 in tools/lint-ratchet.txt).

The change reaches the mamba2 GPU gate through gpu-gate.sh. It ran on an RTX 5090 machine with just gate-gpu-mamba2:

nvidia-smi
| NVIDIA-SMI 595.99.02              Driver Version: 595.99.02      CUDA Version: 13.2     |
|   0  NVIDIA GeForce RTX 5090        Off |   00000000:01:00.0  On |                  N/A |
|  0%   42C    P8             15W /  400W |      34MiB /  32607MiB |      0%      Default |
./tools/box.sh 'cargo oxide build --arch sm_120a -- -p bloomery-gpu-gates --features gpu --release --bin gate_mamba2 && BLOOMERY_GATE_CARD=${BLOOMERY_GATE_CARD:-any} bash tools/gpu-gate.sh gate_mamba2'
PASSED: gate_mamba2 the fused Mamba-2 decode step equals the host twin bit for bit where the device library is not asked for a value libm gives differently ...
gpu-gate.sh: gate_mamba2 ran 1 s (exit 0)

The ellipsis marks where the long summary line is cut.

Hardware (if the change is for a machine)

  • Card: NVIDIA GeForce RTX 5090, 32607 MiB
  • Driver: 595.99.02
  • CUDA: 13.2

AI help

AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.

@github-actions github-actions Bot added documentation Improvements or additions to documentation tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo labels Nov 3, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: CLEAN: No reachable behavior defect or proven quality defect remains in the reviewed changes.

Checked

Duplicates: 3 new functions checked (bound_timeout, mkdir_lock, and the embedded __narrow_timeout); no duplicate owner found. The embedded function runs the existing Python source.
Complexity: no Rust functions changed; no crapper targets.
Silent failure: 3 new error-handling sites followed. An unreadable fallback source returns failure; an existing directory refuses ownership; a failed version probe preserves an opaque timeout stand-in.
Tests: syntax checks passed for 10 shell files and the Python fallback. File-free probes passed six monitor choices, foreground dispatch, child-option forwarding, external TERM with child exits 0 and 7, expiry 124, and forced termination 137.
Mutation review: bypassing selection at tools/gate-bound.sh:172, :217, or :423 fails the monitor assertions. Removing the argument guard at tools/ref/stub-timeout.py:24 fails the new status assertion; this mutant was executed. Removing directory creation at tools/nightly/units.sh:66 fails the winner-count assertion. Dropping print-error propagation at tools/nightly/units.sh:114 fails the revised output assertion. The updated batch mutants remove the locks at tools/gate-batch.sh:7483 and :7542; the overlap assertions detect them.
Gates: no threshold or PIN moved. The output fixture now produces bytes before exercising a write error. The removed load-group timeout injection is covered by the common selector.
Escape catalog: C1–C4 checked; no matching defect. The changed substitutions preserve relevant failures, and the remote heredoc remains quoted.
Adversarial checks: fallback argument loss, external cancellation losing the child's status, and competing directory owners were checked against the parser, signal handling, and single os.mkdir call. No inference hot path changes.

Notes

Dryer and crapper did not run because no Rust file changed.
Full repository self-tests were not run; validation used syntax checks and focused probes.
The supplied RTX 5090 gate evidence names head 74208a2c6fcccd5a621a8775b434327929180b66; this review covers 26b7191c242b675de308fbf4fff2e1f1fd526192.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

… GNU's exit codes, the batch mutexes are one mkdir(2), two fixtures read the same

Ubuntu 26.04 (the GitHub runner since image 20261025) ships uutils coreutils 0.10.0 as timeout, sort, cat and
mkdir. Its timeout returns 124 after a TERM from outside when given --kill-after, so a cancelled run read as one
cut off at its bound (ref/lease, ref/load-groups, gpu-gate). bound_timeout in gate-bound.sh now picks the monitor
run_bounded, bounded and bounded_bg start: the `timeout` on PATH unless it names a coreutils other than GNU's,
else gnutimeout, gtimeout or tools/ref/stub-timeout.py; contrib-check bounds its units with the same one, and
nightly/install.sh installs the stand-in beside its copy of gate-bound.sh, and narrow-scan sends bound_timeout and the
stand-in with the box command.

uutils mkdir takes a directory another process made between its check and its mkdir(2) as made, so two lanes
could both hold gate-batch's chain mutex. mkdir_lock in nightly/units.sh is one os.mkdir, and the chain and pool
mutexes and the output directory owner take it.

run-unit-print-fails gives cat a line to write and a stdout open only for reading: uutils cat ends 0 with a
closed stdout, even with a line to write. ik-pin-tree passes `=` to sort -t and join -t as its own word (uutils
read -t= as an empty separator).
@juliankang4
juliankang4 force-pushed the dgx-spark-q38-fix-uutils-t0 branch from 26b7191 to ed8e7d5 Compare November 3, 2026 21:24

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since the last review: no must-fix or non-blocking items were open. The dropped Git identity fix remains in both base and head at tools/release/pick.sh:140. The updated GPU evidence names the current base and head.

Verdict: CLEAN: Dropping the commit preserves its fix because the base already contains it; the remaining patch is unchanged from the previous review.

Checked

Duplicates: 0 new items in the interdiff; the previous ownership review stands. No dryer pairs were supplied.
Complexity: no changed Rust functions or crapper targets.
Silent failure: the dropped commit's command substitution was checked; its explicit Git identity remains, so an unconfigured host still creates the side commit.
Tests: nine changed shell files and the Python fallback passed syntax checks. No new tests require mutation review. The existing mutant replacing tag enumeration with git describe remains checked by the assertion requiring the side release tag.
Gates: no thresholds, PINs, tests or assertions changed in the interdiff.
Escape catalog: C1–C4 checked; no matching defect introduced.
Adversarial checks: missing Git identity and loss of the side release tag fixture are blocked by the retained code. The release self-test is byte-for-byte identical in base and head. No inference hot path changed.

Notes

Dryer and crapper did not run because no Rust file changed.
Full self-tests were not rerun; this re-review checked the interdiff and syntax.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

@juliankang4

Copy link
Copy Markdown
Collaborator Author

The review is done and the contribution check passed, so I'm merging this.

@juliankang4
juliankang4 merged commit 0e763b8 into midagedev:main Nov 3, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

contrib-check t0 is red on the GitHub runner since 99a6bfd5: six self-tests that pass on a Linux host

1 participant