Skip to content

tools: contrib-check runs tier t1 on aarch64 Linux as well as x86_64 Linux - #83

Merged
midagedev merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-t1
Oct 12, 2026
Merged

midagedev merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-t1

Conversation

@juliankang4

Copy link
Copy Markdown
Collaborator

What and why

Part of #13. just contrib-check --tier t1 refuses every host but x86_64 Linux with rc 64. The host tier's crates
build on aarch64 Linux now and their tests pass there, so on a DGX Spark with the CUDA headers and libclang in
place, only the guard keeps a contributor from running the host-nightly units. With this change the guard takes Linux
on x86_64 or aarch64 and still refuses any other OS or arch by name, with the same rc 64.

Two things stay as they were. The default tier is still T1 on x86_64 Linux only, so a plain just contrib-check on an
aarch64 host still runs T0 and T1 is opt in. The script still sets RUSTFLAGS='-C target-cpu=native' on x86_64 only,
because .cargo/config.toml's [target.aarch64-unknown-linux-gnu] table already builds for the native CPU (the run
below prints RUSTFLAGS: not set (the repo's .cargo/config.toml applies)). The script's header names both arches on its
T1 line. .github/workflows/pr.yml runs T0 only and is unchanged. tools/nightly/install.sh fetches the x86_64
packages only; on the Spark the headers came from the container's CUDA 13.3.1 toolkit.

I did not change the docs. These lines now say less than the script does:

  • docs/contrib/local-check.md:20: "The host tier, x86_64 Linux, no card, no model file" could name aarch64 Linux too.
  • docs/contrib/local-check.md:40: "--tier t1 on another host is a named 64" now holds only off x86_64 and
    aarch64 Linux; the default in the same sentence stays true.
  • docs/contrib/local-check.md:47: the T1 row's "Where" could read "x86_64 or aarch64 Linux, no card needed".
  • docs/contrib/local-check.md:66: "aarch64 Linux runs T0 only until the host compiles there" no longer holds; it
    could say that --tier t1 runs there and T0 stays the default.
  • CONTRIBUTING.md:18 and CONTRIBUTING.ko.md:16: the host tier bullet names x86_64 Linux only.
  • docs/BUILD.md:312: the host tier is described for an x86_64 CPU only.
  • justfile:93: the recipe's comment puts the host-nightly units on x86_64 Linux.

CONTRIBUTING.md:30 and CONTRIBUTING.ko.md:21 stay true, since they describe the default.

Code shape

  • No second copy. One new flag, HOST_TIER, next to HOST_LINUX_X86. The default tier and RUSTFLAGS keep
    reading HOST_LINUX_X86, the T1 guard reads HOST_TIER.
  • Model code holds only architecture facts. No model code.
  • Dead code is gone.
  • No silent failure. Another OS or arch still gets a named rc 64 that says what it is.
  • Comments state what is true now.
  • No relaxed gate.
  • cargo fmt and cargo clippy are clean on what I touched; the lint count did not go up. (No Rust changed:
    fmt ran green as a unit of the T1 run below; for the shell change, shellcheck -x tools/contrib-check.sh is
    clean.)

Duplication found or removed (path:line), or "none": none.

What I ran

On a DGX Spark, in an Ubuntu 24.04 container with CUDA 13.3.1, the pinned nightly and LLVM 21.1.8 (bindgen's
libclang), no card in view.

Fail first, main 697790c4 as shipped (the script is the same blob, ac9d5633, on main 1cba9707):

$ bash tools/contrib-check.sh --tier t1; echo rc=$?
contrib-check: tier t1 runs the host tier, which needs x86_64 Linux (this is Linux aarch64); use --tier t0
rc=64

With this commit (the file's blob is 72a4788c):

$ bash tools/contrib-check.sh --tier t1; echo rc=$?
contrib-check tier=t1 commit=<this commit>
host: Linux 6.17.0-1032-nvidia aarch64, unknown
toolchain: rustc 1.100.0-nightly (e457a7b0d 2026-08-27) (nightly-2026-08-28); RUSTFLAGS: not set (the repo's .cargo/config.toml applies); timeout 1200s a unit
...
tools/boxq.py rc=0 16s
...
tools/type-census.py rc=0 0s
...
check-recipes rc=0 502s
...
bloomery-app rc=0 0s
bloomery-decision rc=0 0s
bloomery-engram rc=0 1s
bloomery-engram-lab rc=0 0s
bloomery-gguf rc=0 0s
bloomery-hf rc=0 0s
bloomery-jinja rc=0 0s
bloomery-levers rc=0 0s
bloomery-model rc=0 1s
bloomery-models rc=0 0s
bloomery-placement rc=0 18s
bloomery-qdot rc=0 1s
bloomery-refset rc=0 0s
bloomery-runtime rc=0 0s
bloomery-sampler rc=0 1s
bloomery-serve rc=0 9s
bloomery-threads rc=0 0s
bloomery-tokenizer rc=0 0s
bloomery-vision rc=0 1s
DONE tier=t1 total=86 red=0 wall=1023s
rc=0

86 units on main 1cba9707: T0's 67 and the 19 host-nightly units T0 does not run, all green. The host crates' times
are short because a run in the same container just before had built them. Main moved while I worked, so I ran the
same change four times on three earlier mains too (697790c4 twice, f9706dbd, ae992198; 85 units there, one
Python self-test fewer). The first of those runs ended DONE tier=t1 total=85 red=1 wall=1109s red: check-recipes
with every host unit green, and the red came from a test fixture that lets one case write into the next (the first
item under "What I ran into"). The other three ended red=0.

On a Mac (Darwin arm64): bash tools/contrib-check.sh --tier t1 exits 64 with the new message ("needs x86_64 or
aarch64 Linux (this is Darwin arm64)"), shellcheck -x tools/contrib-check.sh is clean, and
bash tools/check-comments.sh is ok.

What I ran into

This change does not touch either script. I'm writing them down because they cost me time and you may want to change
them.

  • gate-batch.sh --self-test, "chain only". The first T1 run went red here:

    FAIL chain only: the member ran once and no lane invented a call: 2 lines match / gen_/ in .../fake-state/ran.log, want 1
    

    The batch in that case was green (its DONE line was total=1 red=0 and the member was recorded once), so the
    second line was written by something outside it. The three "lane killed" cases (tools/gate-batch.sh:1469, :1497,
    :1524) run v41-a@FAKE_SLEEP=20 and TERM lane A, or both lanes, while that item runs (:1478, :1506, :1533).
    The item's fake box.sh is not stopped with its lane. just runs the recipe line as sh -cu "./tools/box.sh ...",
    and with dash as /bin/sh (Ubuntu's default) that shell stays between just and box.sh. The TERM that reaches
    just (the batch and the case both signal the pids in lane-*.child) ends just and that shell, and box.sh goes
    on with PPID 1, sleeps out its 20 s and appends its gen_y line to ran.log. Every case uses the same
    $t/fake-state (st=$here/fake-state, :995) and only clears it when it starts, so the line lands in whatever case
    is running 20 s later.

    I added log lines to the fake and the case loop and ran the self-test three times under bash -x on the DGX Spark,
    idle. In all three, the leftovers of the killed-lane cases wrote into ch-lpt and ch-lptm, which do not count
    gen_y lines, and the hold cases that stop a steal-slow@FAKE_SLEEP=20 batch (:2421 to :2486) left gen_s
    lines that landed in the yield cases. Inside check-recipes the self-test runs beside the script's other blocks
    (tools/check-recipes.sh:648), so the timing is not that of a run on its own. That first T1 run did not keep its
    ran.log, so I cannot show which process wrote the second line there, but a leftover most likely landed in "chain
    only", which counts every gen_ line. On a Mac no leftover wrote into a later case in 13 runs. Two ways out, if you
    want one: the killed-lane cases could stop the fake's process too (it could write its pid under fake-state, say),
    or each case could get its own fake-state directory, so a late line has nowhere to land. The script's header says
    "A box process a killed item left behind is just box-gc's to clear" (tools/gate-batch.sh:392), which the second
    way leaves as it is; which fits better is your call.

    Once, on a Mac, the same self-test stopped right after its mutant ch-anywant line with no FAIL line, and
    check-recipes reported the self-test as failed. I could not make it happen again (13 runs with bash -x, some of
    them three at a time), so I cannot say whether it has the same cause.

  • boxq.py --self-test, run-done. This case goes red now and then: one of the two tails misses the line the
    fake daemon appends after the terminal poll. The case runs the client with BOXQ_POLL_S=0.5 (tools/boxq.py:806),
    the fake appends late-out and late-err 0.1 s after it answers the terminal poll (:563), and the client gives
    the tails min(poll_s, FLUSH_MAX_S) = 0.5 s before it stops them (:377). A tail has 0.4 s to see the append and
    copy it. I found two ways for it to miss:

    • A tail that cannot use inotify. GNU tail then polls once a second (tail_cmd at :229 passes no -s). In the
      container /tmp is overlayfs, which GNU tail 9.4 does not watch with inotify, and strace shows the tails
      sleeping 1 s between reads. The tails start when the client sees the job running and the terminal poll comes one
      poll interval later, so the tails' second read and the client's stop both fall about 1 s after the tails
      started. In one red run under strace (times from the tails' start), the terminal poll was answered at 0.504 s,
      the append came at 0.605 s, the out tail read late-out at 1.004 s, and the err tail, which had gone to sleep
      3 ms later, was stopped before it woke at 1.007 s. In the container it failed 2 of 100 runs idle, 4 of 100 with
      twice as many busy loops as cores, and 6 of 200 under that load in a second batch. With TMPDIR on an ext4 bind
      mount in the same container, where tail uses inotify, it failed 0 of 200 under the same load.
    • More busy threads than the CPU has. Outside any container, on an x86_64 desktop with 32 hardware threads
      (Ryzen 9 9950X, Python 3.14), it failed 0 of 200 idle, 0 of 200 with 32 busy loops and 60 of 200 with 64.

    To reproduce: for i in $(seq 200); do python3 tools/boxq.py --self-test run-done | grep '^FAIL'; done with /tmp
    on overlayfs (inside a container) or with twice as many yes > /dev/null as hardware threads running. With the
    default BOXQ_POLL_S of 5 s the tails get the full 2 s, so I don't think a real job loses its last lines this way,
    though I did not run the default under load; it is the case's 0.5 s that leaves the margin thin. If you want to
    change it, some options are a longer BOXQ_POLL_S in the case (1.5 s gives the tails 1.4 s, still under
    FLUSH_MAX_S), -s in tail_cmd so a polling tail looks more often, or a stop that waits until each tail has read
    up to its file's size.

Hardware (if the change is for a machine)

DGX Spark: NVIDIA GB10 (compute capability 12.1), driver 595.84, 20 cores (Cortex-X925 and Cortex-A725), 128 GB
unified memory, Linux 6.17 aarch64. The card was not used.

…Linux

`--tier t1` refused every host but x86_64 Linux with rc 64. The host tier's crates now build on
aarch64 Linux and their tests pass there, so the guard takes Linux on x86_64 or aarch64 and still
refuses any other OS or arch by name. The default tier stays T1 on x86_64 Linux only, and the
script still sets RUSTFLAGS on x86_64 only: on aarch64 the repo's .cargo/config.toml already
builds for the native CPU. The header's T1 line names both arches.

Checked on a DGX Spark (GB10, aarch64) in an Ubuntu 24.04 container (CUDA 13.3.1, the pinned
nightly, LLVM 21.1.8), no card in view: with main's script, `contrib-check.sh --tier t1` exits 64
("needs x86_64 Linux (this is Linux aarch64)"); with this commit it runs 86 units, T0's 67 and the
19 host-nightly units T0 does not run, and all are green (DONE tier=t1 total=86 red=0).
@midagedev

Copy link
Copy Markdown
Owner

Thank you. This is small and correct. We will merge it when its check is green, after the train that is running now lands. We will then update the doc lines you listed (docs/contrib/local-check.md and CONTRIBUTING.md) on main ourselves.

@midagedev
midagedev merged commit 0f81e85 into midagedev:main Oct 12, 2026
1 check passed
midagedev added a commit that referenced this pull request Oct 12, 2026
contrib-check's T1 takes aarch64 Linux since #83; the docs that named
x86_64 only now name both, and T0 stays the default off x86_64. The lines
are the ones the PR listed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
juliankang4 added a commit to juliankang4/bloomery that referenced this pull request Oct 13, 2026
…e on their own machine, with local mode (midagedev#38), single-card timing (midagedev#39) and aarch64 T1 (midagedev#83) as built

The page says what to run on a Mac, on Linux with no card and on Linux with an NVIDIA card, and
what each result shows. The box assumptions table moves to a reference section with a state
column; its two counts do not reproduce at the commit that wrote them, so each is struck through
beside the count at 3bc2a17 and its command. The open questions keep their numbers, 2 and 3
marked answered and midagedev#38's question 2 added as 4.
juliankang4 added a commit to juliankang4/bloomery that referenced this pull request Oct 13, 2026
…e on their own machine, with local mode (midagedev#38), single-card timing (midagedev#39) and aarch64 T1 (midagedev#83) as built

The page says what to run on a Mac, on Linux with no card and on Linux with an NVIDIA card, and
what each result shows. The box assumptions table moves to a reference section with a state
column; its two counts do not reproduce at the commit that wrote them, so each is struck through
beside the count at 3bc2a17 and its command. The open questions keep their numbers, 2 and 3
marked answered and midagedev#38's question 2 added as 4.
juliankang4 added a commit to juliankang4/bloomery that referenced this pull request Oct 13, 2026
…e on their own machine, with local mode (midagedev#38), single-card timing (midagedev#39) and aarch64 T1 (midagedev#83) as built

The page says what to run on a Mac, on Linux with no card and on Linux with an NVIDIA card, and
what each result shows. The box assumptions table moves to a reference section with a state
column; its two counts do not reproduce at the commit that wrote them, so each is struck through
beside the count at 3bc2a17 and its command. The open questions keep their numbers, 2 and 3
marked answered and midagedev#38's question 2 added as 4.
midagedev pushed a commit that referenced this pull request Oct 13, 2026
…e on their own machine, with local mode (#38), single-card timing (#39) and aarch64 T1 (#83) as built

The page says what to run on a Mac, on Linux with no card and on Linux with an NVIDIA card, and
what each result shows. The box assumptions table moves to a reference section with a state
column; its two counts do not reproduce at the commit that wrote them, so each is struck through
beside the count at 3bc2a17 and its command. The open questions keep their numbers, 2 and 3
marked answered and #38's question 2 added as 4.
@juliankang4 juliankang4 added the tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo label Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools Tools, recipes, CI and the toolchain: tools/, justfile, .github/, Cargo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants