Repository navigation
mac-remote: fake_remote stubs uname with the Mac arch its toolchain is built for, so the self-test's lock cases pass on aarch64 Linux - #113
Conversation
There was a problem hiding this comment.
Verdict: MUST_FIX: the lock fixture duplicates an architecture decision that already belongs to fake_remote.
Must fix
1. Make the fixture own its stub architecture
tools/mac-remote.sh:891 repeats tools/mac-remote.sh:804: both select the fake Mac architecture from the local uname -m. This is a proven duplicate (kind B, R14). The toolchain and its stub now require separate edits to keep them consistent.
Close this in the existing fixture now, before another host mapping requires synchronized changes.
Replace fake_remote's local declaration and architecture case with:
local rh=$1 ch=$2 h m t
case $(uname -m) in
arm64) h=aarch64-apple-darwin; m=arm64 ;;
*) h=x86_64-apple-darwin; m=x86_64 ;;
esacImmediately after its mkdir -p, add:
printf '#!/bin/sh\ncase $1 in -s) echo Darwin ;; -m) echo %s ;; *) /usr/bin/env -i PATH=/usr/bin:/bin uname "$@" ;; esac\n' "$m" > "$rh/opt/bloomery-bin/uname"
chmod +x "$rh/opt/bloomery-bin/uname"Replace the lock-case setup at lines 889–892 with:
local lr=$d/lockrem lb
fake_remote "$lr" nightly-xChecked
Duplicates: 0 new functions, types or constants; the new mapping duplicates the fixture owner.
Complexity: no Rust functions changed; one case added to the shell fixture setup.
Silent failure: the wildcard mirrors the synthetic fixture architecture; no error result is discarded.
Tests: shell syntax, the proposed replacement's syntax, and in-memory arm64/aarch64/x86_64 mappings pass. Mutation: drop the stub's -m arm at line 892; PREP returns 69 on aarch64 Linux, rejected at lines 900 and 904 (static trace).
Gates: no thresholds or host rejection rules changed; the PR includes FAIL-first output.
Escape catalog: C1–C4 do not match the changed code.
Notes
Full self-test not run. This diff has no Rust code for dryer or crapper.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
…s built for, so the self-test's lock cases pass on aarch64 Linux
a24ab58 to
e676ee2
Compare
There was a problem hiding this comment.
Verdict: CLEAN: The fixture reports the Mac architecture selected for its fake toolchain, and the real remote host check remains intact.
Checked
- Duplicates: no new functions, types or constants; one owner for the fake remote's uname stub serves both callers.
- Complexity: no Rust functions changed; the fixture adds one uname match arm.
- Silent failure: 0 new silent-failure sites; delegated uname calls preserve the command's exit status.
- Tests: shell syntax and in-memory checks of the mapping, generated stub and host guard passed for arm64, aarch64 and x86_64 inputs. Restoring
-mpassthrough at tools/mac-remote.sh:811 makes the guard reject Darwin aarch64 with rc 69; the existing lock assertions at lines 904 and 908 reject that result. - Gates: no thresholds, assertions or host-check clauses removed or relaxed; the PR includes failing and passing self-test output.
- Escape catalog: C1–C4 do not match the changed lines. The fallback's isolated PATH prevents recursive invocation of the stub.
- Performance: tools only; no inference hot path changed. Both fake_remote callers were checked.
Notes
The full self-test was not rerun; selected shell fragments were checked in memory.
🔨 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. |
What and why
tools/mac-remote.sh --self-testfails on aarch64 Linux, sojust check-recipes(andcontrib-check --tier t1)is red there. The lock cases run the preflight against a fake remote with a
unamestub that answersDarwinfor-sand passes-mto the realuname. On aarch64 Linux that readsaarch64, and the preflight's host check takesonly
Darwin arm64andDarwin x86_64:fake_remotenow writes theunamestub itself, and the stub answers-mtoo. It gives the Mac arch the faketoolchain was built for (
arm64on an arm64 host,x86_64otherwise), picked in the samecasethat names thetoolchain, so the two cannot disagree. The lock cases no longer write their own stub, and every case that uses
fake_remotegets the new one. The preflight and its host check are unchanged.Closes #110.
Code shape
fake_remoteand in the run script, which is separate code that runs on the remote Mac. This change removes one repeat, listed under Duplication below.Darwin arm64orDarwin x86_64.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up. No Rust touched.Duplication found or removed (
path:line), or "none": the arm64-else-x86_64 mapping stood in three places oftools/mac-remote.shonce the first version of this fix was in: the run script (line 516),fake_remote(line 804) and a stub in the lock cases (line 891). The stub now comes fromfake_remote, so the mapping stands in two places:fake_remoteand the run script (line 516), which runs on the remote Mac and cannot sharefake_remote's code.What I ran
On aarch64 Linux (DGX Spark),
bash tools/mac-remote.sh --self-testfrom the repository'stools/directory in a fresh git repository, ond90151edand then one676ee26:The next two blocks are from
a24ab58c, the earlier version of this fix, and I did not rerun them one676ee26.just check-recipeson the same machine, in a CUDA 13.3.1 container:The
check-recipes: okline and the exit code 0 are the evidence here, along with the mac-remote self-test. I did not run a full T1. The container image is not part of the repository and has norsync. The lock cases needrsyncon the test host (the preflight checks for it), and the T0 and T1 docs do not list it. I bind-mounted the host'srsyncinto the container. I also setRUSTUP_TOOLCHAIN=nightly-2026-08-28, astools/contrib-check.shdoes, sincejust check-recipesrun on its own does not. Both runs had the same setup. I make no claim about an unmodified container.On macOS (arm64), on
e676ee26,bash tools/mac-remote.sh --self-testgivesmac-remote: self-test ok,bash -n tools/mac-remote.shis clean andtools/check-comments.shis ok. The fake-remote flow runs there, so the new stub is exercised on macOS too: its-sand-manswers match what the realunamesays on that Mac, and any other argument passes to the realuname.shellcheckreports the same warnings before and after.just check-recipeson the Mac, run ona24ab58cand not rerun one676ee26, is red, and so it is ond90151ed. I ran it once on each, withCARGO_BUILD_JOBS=4 taskpolicy -bandRUSTUP_TOOLCHAIN=nightly-2026-08-28, one at a time, each commit in its own worktree. Both runs printmac-remote: self-test okandcheck-recipes: 52 tool self-tests ok, then end with rc 1 for the same reason:So this failure is not caused by the fix.
bash tools/gate-batch.sh --self-testrun alone passes on both commits (gate-batch self-test: 572 of 572 ok), andbash tools/ref/depth-serve.sh --self-testrun alone passes on both (52 checks ok). Insidecheck-recipes, the gate-batch parts ran slower than alone (part 13 took 481 s ona24ab58cand 533 s ond90151ed, against 193 s alone). The case that failed ended with rc 124, a time bound; I did not isolate why it is hit only insidecheck-recipes. Thedepth-serve.shself-test passed insidecheck-recipesin both of these runs. An earlier Mac run of the fix had also failed onedepth-serve.shcheck (0 servers started, 1 expected) that did not reproduce; I do not know why.Hardware (if the change is for a machine)
d90151edand one676ee26;just check-recipesin a CUDA 13.3.1 container, ond90151edand ona24ab58ctools/check-comments.shone676ee26;just check-recipes,gate-batch.sh --self-testanddepth-serve.sh --self-test, ond90151edand ona24ab58cAI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.