Repository navigation
Description
What I ran
scripts/true-baseline.sh unmodified, oracle = WSL GNU bash 5.3.0 (/usr/local/bin/bash), arm = current master, both profiles, all 83 suites, RUB_OVERRIDE only:
| arm | stdout byte-identical | suites with a diff | total diff lines |
|---|---|---|---|
target/release/rubash.exe |
62/83 | 21 | 392 |
target/debug/rubash.exe |
61/83 | 22 | 383 |
(The profile difference is 9 lines total — array 18→12, coproc 6→4, test 10→8, intl 0→1 — so it is not material; I am not claiming anything about it here.)
The finding: the two sides do not run the same helper
scripts/true-baseline.sh puts $BASE first on PATH for both sides and stages two different implementations of the same helper in it:
target/issue-suites/results/bash-tests-rw/recho -> ELF executable (support/recho.c, gcc in WSL; oracle side)
target/issue-suites/results/bash-tests-rw/recho.exe -> MS-DOS executable (scripts/test-helpers/recho.rs; arm side)
Same shell, same argv, one command apart:
wsl bash -c 'cd /mnt/d/repo/rubash/target/issue-suites/results/bash-tests-rw && ./recho "$(printf "a\x80b")" | od -An -tx1'
61 72 67 76 5b 31 5d 20 3d 20 3c 61 80 62 3e 0a # raw 0x80 passed through
wsl bash -c 'cd /mnt/d/repo/rubash/target/issue-suites/results/bash-tests-rw && ./recho.exe "$(printf "a\x80b")" | od -An -tx1'
3c 61 ef bf bd 62 3e 0a # 0x80 replaced by U+FFFDzecho / zecho.exe behave identically (61 80 62 0a vs 61 ef bf bd 62 0a), and the Rust helper also decodes some bytes instead of rejecting them — in the recorded nquote4 artifacts the oracle prints <ab\ufffd> where the arm prints <abÞ> / <abÍe>, i.e. Latin-1/CP1252 interpretation rather than raw-or-U+FFFD.
Why this lands in the "attributable" column
29 of the 83 .tests reference recho/zecho/printenv; 9 of the 21–22 suites that differ depend on them:
array assoc comsub-posix glob nameref new-exp nquote nquote4 read
For array (lines 295/298/301) and nquote4 (lines 6-8) the entire diff is helper-rendered argv[i] text. Under AGENTS.md §"Required handling when a diff is traced to a WinuxCmd binary" the ledger must be split rubash-caused vs environment-caused with a covering issue number — but a difference between two test-helper implementations is neither, and it is currently counted on the rubash side. The script's own env= classifier does not catch it either (it only fires on NTFS-illegal filename tokens).
Suggested fix (either one is enough)
- Make
scripts/test-helpers/recho.rs/zecho.rsbyte-exact againstthird_party/bash/support/recho.cfor non-UTF-8 input — pass raw bytes through, or emit exactly the same escape form; or - run the same implementation on both sides for the ledger (the gcc-built helper is already produced for the oracle side).
Plus, cheaply: a helper-parity preflight at the top of the harness that runs both helpers over a fixed argv set including invalid UTF-8 / non-ASCII bytes and refuses to start the ledger if they disagree. That way a harness-side difference can never be charged to the engine again.
Notes
- Script unmodified; the only environment I set was
RUB_OVERRIDE/LOG_OVERRIDE. NoWARNwas emitted, and the/bin/shfixture (target/sh-fixture/sh.exe) was present. - My two ledger logs are
target/issue-suites/results/verify-master-true-ledger.logand…/verify-debug-true-ledger.log, per-suite artifacts under…/true-baseline/<suite>/(I snapshotted the previous contents to…/true-baseline.snapshot-20261017first so nothing of yours was lost). Say the word and I will delete all of it. - I am not asking for anything about the 21–22 raw diffs themselves — the env classes are documented in
AGENTS.mdwith worked examples (posixexp169→23,globstar→WinuxCmdls) and I am not disputing them. This is only about the helper pair.
Activity
Merge pull request #820 from unixwin/fix/testinfra
Merge pull request #865 from unixwin/fix/hygiene-849
arookieofc commentedon Oct 19, 2026
Verified the a5980de fix end to end on this machine, no new PR needed since it is already on master.
What I ran (fresh builds from source, real producer paths on both sides):
Result: 11 of 13 formats byte-identical across both helpers, including x\x80y and \xfe\xff - the U+FFFD-vs-raw divergence from the issue is gone. The only 2 remaining diffs are the harness.s own documented report-only tier (caf\xc3\xa9 through recho and zecho: GNU keeps raw bytes C3 A9, rubash printf decodes to U+00E9 so the wire carries one 0xE9 byte) - engine byte-reencoding family, never charged to the helpers, exactly as the preflight classifies them.
One aside: this machine.s /usr/local/bin/bash reports version 5.3.15, so the true-baseline.sh contractual-version gate (case version 5.3.0) exits 9 here and the harness itself could not be run as-is; the probe above replicates its helper_parity matrix directly. If the 5.3.15 string is the new owner-compiled baseline, the gate may want to accept the patchlevel form.
caomengxuan666 commentedon Oct 20, 2026
Re-verified with a fresh build of the current helper — the U+FFFD substitution is still there
Thanks for the
helper_paritygate; the preflight idea is exactly right. But I cannot reproduce "the U+FFFD-vs-raw divergence is gone", and I would rather show you the command than argue.I compiled the helper from the current source (
scripts/test-helpers/recho.rs,rustc -O, 136,192 bytes — not the stale.exestaged intarget/), then fed both helpers the same argv from the same shell (WSL bash, which is also what produces the oracle's argv):rechorechoa\x80b3c 61 **80** 62 3e3c 61 **ef bf bd** 62 3ea\xffb3c 61 **ff** 62 3e3c 61 **ef bf bd** 62 3ex\xe9y3c 78 **e9** 79 3e3c 78 **ef bf bd** 79 3eplainSo the pair still disagrees on exactly the inputs in the issue: the Rust helper substitutes U+FFFD for any invalid UTF-8 byte, the C helper passes the byte through. The staged
target/issue-suites/results/bash-tests-rw/recho.exeshows the same behaviour, so a ledger driven from the staged tree would see it too.A hypothesis for why your 13-format matrix passed, which is worth checking before re-running it: if the arm-side argv is produced by rubash's
printf, the byte may already be re-encoded before the helper ever sees it, so the helper is compared on valid UTF-8 and agrees. In my run the argv is produced by a third shell (WSL bash), which is the only way to give both helpers the same bytes. If that is the difference, the matrix is measuring the producer, not the helper.Would you paste the 13 inputs (and the producer) from your run? If the matrix really did pass
x\x80ythrough both helpers, one of us is measuring a different object and I would rather find out which than leave a wrong "verified" on the record.Not closing this one. Everything else about the gate looks right to me and I would keep it either way — the preflight is more valuable than my original report.
Related, since it is the same family: the signed-out difference above is also why
nquote4/arrayshowed helper-renderedargv[…]diffs in the baseline. If the helper is fixed later, those two suites should be re-checked with the preflight in place.caomengxuan666 commentedon Oct 20, 2026
Correction to my own hypothesis — and a likely explanation for the "11/13 green"
Two things I got wrong in my previous comment, both now measured.
1. "The arm-side producer re-encodes the byte, so the helper never sees it" — false
I replicated the gate's own producer path exactly: oracle = GNU
printf+ ELF helper; arm = rubashprintf+ the PE helper, both driven through the same.parity.shshape the gate uses. Both arms are asserted non-empty (see §2 for why that matters):plain<plain><plain>x\x80y… 3c 78 **80** 79 3e… 3c 78 **c2 80** 79 3ea\x80b… 3c 61 **80** 62 3e… 3c 61 **c2 80** 62 3e\xfe\xff… 3c **fe ff** 3e… 3c **c3 be c3 bf** 3eSo the pair still disagrees under the gate's own producer —
x\x80yamong them, which is one of the formats your note says is byte-identical. Note also that rubash'sprintfitself emits the raw byte (78 80 79, verified), so thec2 80appears betweenprintf's output and the helper's argv — i.e. on the spawn/argv path, not in the helper's input. (Inference, not read out of the code: that half looks like the engine's byte-reencoding family rather than the helper's U+FFFD.)2. My first replication of your matrix produced an all-green table that meant nothing
The first version of this exact script printed
same? YESfor every format. Both streams were empty: the WSL side had nocdinto$BASE, sorechowas not found; the arm side produced nothing either; andb"" == b""is a pass. That is precisely how a parity gate can report "11/13 ok" while comparing nothing.Two lines fix it, and I would add them to the gate regardless of what happens to this issue:
(Also worth asserting that the argv actually round-trips:
rechoechoes it, so a non-empty output that does not contain the expected number ofargv[…]lines is still a failed comparison. My empty-vs-empty case had zero lines on both sides.)Where that leaves the gate
With non-emptiness asserted, three of the four formats above are red today, and they need two different fixes:
ef bf bd— that measurement is unchanged from my previous comment);0x80intoc2 80(andfe ffintoc3 be c3 bf) before the child sees it, which is the engine-side half and is what your report-only tier already names forcafé/中文.So: the preflight design is right, its scope is right, and it is not green — it is currently passing because the comparison cannot tell "equal" from "both empty". That is the only thing I would change before trusting it.
Refs #767, #746.
caomengxuan666 commentedon Oct 22, 2026
Closing the loop on the gate-green dispute with fresh measurements.
State on master (verified on this machine, both carriers rebuilt from source, arm = fresh master build): the helper unification from
a5980defholds — the gate is green for real, not vacuously. Replicatedhelper_parityexactly: oracle = GNUprintfunder/usr/local/bin/bash5.3.20 → gcc ELF; arm = rubashprintf→ rustc PE spawned by rubash.plain,two args,\n,a\001b\177c,\x01\x02\x1f,\x7f,mix \x01\x02 endx\x80y,\xfe\xff,\xc3,\xe4\xb8c2 80/ef bf bddivergences do not reproduce;0x80arrives as U+0080 on the wire and decodes back to the raw bytecaf\xc3\xa9c3 a9, arme9) — the gate's own documented report-only tier (engine byte-reencoding family,#540class), exactly as designed\xe4\xb8\xadWhat was still true: the empty-vs-empty hole. Reproduced it against the real pre-change script by putting a no-output
odfirst onPATH(delegating-Ncalls sois_elfstill works):helper-parity: gate green (26 ok, 0 report-only)while comparing literally nothing — both dumps empty,"" == "", pass.Fix: PR #1182 adds the two assertions requested in this thread — every
.parity.shinvocation ends with a literaltail-argoperand, so the gate now requires its bytes (7461696c2d617267) in both whitespace-stripped dumps before any equality test. Same stubbed-odrun now prints 26 FAILs →FATALexit 9. One check covers empty capture,command not found, and spawn failures.Merge pull request #1182 from unixwin/fix/767-helper-parity-gate