Repository navigation
#1488 gate QC layer - #1555
Merged
Merged
#1488 gate QC layer#1555
Conversation
All 26 bracket.tsv rows passed because BOTH sides were command-not-found: run-gate.sh invoked the case-table stem 'bracket', but no side has a program with that name — Rust dispatch registers '[' (winux-cmds lib.rs), the C++ dispatcher and GNU coreutils ship '[' as the program, so the GNU side's `env bracket ...` failed rc 127 like the driver. strict compared 127==127 and empty==empty: a green that tested nothing, for weeks. Fix: invocation_name() maps the TSV stem to the program name passed to all three sides (bracket -> '['); ledger keeps the stem as grouping label. Re-measured: bash gate/run-gate.sh bracket -> 26/26 with real Rust-vs-GNU comparisons, all green. Found by the #1488 QC sweep; systematic detection added to gen-cases.py --coverage (vacuous column).
Parses gate/cases/<cmd>.tsv with run-gate.sh's exact column contract (@empty@ empty args, comma-split env, tab-split preserving empty fields) and runs one case against any side: rust/cpp — native spawn in a per-case scratch dir, K=V child env, 10s timeout, setup snippet via bash gnu — WSL coreutils, native ext4 scratch under /tmp/winuxcmd-gate-qc (never touches the gate's own /tmp/winuxcmd-gate), artifacts mirrored back like run-gate.sh does Driver provenance: wave1 commands run through RUST_BIN (main build, carries the truefalse sole-argument fix), wave2 commands through RUST_BIN_W2 (their implementations are on the wave2 lanes, not main — the main-built driver exits 127 for them). QC reports disclose the binaries they used via provenance(). Tooling-only; no command code touched. Refs #1488.
note rows are record-only and never gate; that made them a blind spot. The `false --help` pilot bug (#1550) lived inside a note row until manual wiring checks caught it. This tool ends indefinite immunity: 1. inventory — every note-mode row with its expected-deviation claim from gate/note-registry.tsv (undocumented notes are a finding). 2. GNU re-check — each note case re-run against GNU (WSL), Rust, C++; verdicts: UPGRADE-STRICT Rust byte-matches GNU; the row can gate again (C++ divergence stays recorded via r=c:no) UPGRADE-EXIT rc matches GNU, stdout platform-form-bound MASKED-DIVERGENCE the note hides a live Rust-vs-GNU divergence — the exact #1550 class 3. upgrade-candidate list — promotion decisions owned by the command lane; this sweep only reports. First sweep (df wave1, real data): - df/df12-output-subset — UPGRADE-STRICT candidate (Rust rc+stdout byte-match GNU; C++ deviation inherited-not-fixed) - df/df13-drive-path — MASKED-DIVERGENCE: GNU rc=1 (no such file under WSL), Rust rc=0 prints a filesystem table (registered deviation: Rust follows the C++ drive model). Command lane must fix or re-justify; the registry claim documents it, the probe keeps it visible. Exit 1 when masked divergences exist (CI-wireable). Refs #1488, #1550.
….md)
win rows gate only Rust-vs-C++ exit status; stdout is recorded but never
compared anywhere, so 132 of 686 cases (19%) had bytes nobody looks at.
This audit diffs those bytes and classifies:
aligned byte-equal
wording equal after normalizing brand/path/drive-case/whitespace —
demote-to-note candidates (command lane decides)
structural normalized bodies still differ — human review
probe-fail harness error
First sweep (real data, per-lane drivers): 86 aligned / 5 wording / 41
structural / 0 probe-fail.
- wording (5): all df tables — Rust follows GNU column padding where
C++ pads differently; same structure, spacing only.
- structural clusters:
* wave2 --help/--version (13 commands): the Rust side prints EMPTY
where the C++ applet prints a full usage/version block (b2sum,
base32, base64, sha224sum, sha384sum, getconf, hostname, id,
nproc, printenv, tac, uname, whoami). rc matches, so the win gate
never saw it — exactly the black hole this audit exists to drain.
* true/t07 + false/f07 --version: C++ prints a 7-line 1.2.1 banner,
Rust prints a single brand line ("false (WinuxCmd) 0.1.0").
* pwd (11 rows): Windows vs POSIX path forms; realpath symlink;
printenv full-dump ordering; df -h/-H tables.
Tooling-only; no command code touched. Refs #1488.
caomengxuan666
force-pushed
the
rust2/gate-qc
branch
from
November 10, 2026 15:08
773f092 to
da19206
Compare
caomengxuan666
added a commit
that referenced
this pull request
Nov 11, 2026
…#1488) The QC win audit (WIN-AUDIT.md, PR #1555) found a structural black hole: b2sum base32 base64 sha224sum sha384sum getconf hostname id nproc printenv tac uname whoami returned rc 0 with EMPTY stdout for --help/--version. Each now prints the probed WSL-oracle text byte-for-byte: - coreutils 9.4 bodies + gnuhelp::footer / gnuhelp::coreutils_version (new shared module) for the ten coreutils commands; the first --help/--version flag in argv wins, like getopt_long. - getconf carries the glibc 2.39 help/version verbatim (Ubuntu GLIBC 2.39-0ubuntu8.9 oracle, incl. its own bug-report footer). - hostname carries the Debian 3.23 contract: --help/-h print the DEBIAN_USAGE block on stdout and exit 255; --version prints 'hostname 3.23' rc 0 (probed rc 255/0). - printenv (wired) keeps the dispatcher contract in the product exe and prints the oracle bytes on the driver/FFI surface; the --abi path shares dispatch, so it gains the text automatically. Also registers the four wave2 modules that shipped unregistered on main (getconf/hostname/id/uname) — their 88 gate rows ran rc 127 (GATE-REPORT 'wiring lane scope' gap). Unit tests per command lock the shape/rc; the strict gate rows added in the next commit keep the bytes honest against WSL GNU. Verification: driver --help/--version for all 13 byte-compared against fresh 'env <cmd> --help|--version' captures (26/26 equal, rc equal); cargo test green (279 incl. new surface tests).
This was referenced Nov 11, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
差分门 QC 层(#1488,工具层,不动命令代码)
#1550 打样的教训:
false --help返回 0 的 bug 藏在差分门的 note 类(「只记录不判定」)里一直没被抓到。note 免检、win 只看 rc,都是判定盲区。本 PR 给 gate 加 QC 层,把盲区变成有报表、有复核、有退出码的机制。机制(全部在
rust2/gate/,脚本层,cargo 无关)qc_note_audit.py+note-registry.tsv:note 清单(名字+预期差异描述)→ 每个 note 用例自动跑 GNU/Rust/C++ 三方探针(rc + stdout sha)→ NOTE-QC.md 输出「是否仍成立」:UPGRADE-STRICT(Rust 已与 GNU 字节一致,应升级 strict)/MASKED-DIVERGENCE(note 掩盖 Rust≠GNU,2.0 机械替换打样: true/false 接线 rust2 staticlib 并删除 C++ 实现 (#1488) #1550 类)。有 masked divergence 时退出码 1(可接 CI)。qc_win_audit.py→ WIN-AUDIT.md:win 类 132 例的 Rust vs C++ stdout 首次被 diff,分类 aligned / wording(品牌、路径分隔、空白归一后相同 → note 候选)/ structural(需人工)。gen-cases.py --coverage→ COVERAGE.md:每命令 strict/exit/win/note 分布、GNU 直测占比、C++ parity、gate 结果、vacuous 列(双侧 127 空输出的假绿,bracket 家族即此类,本次已修)。gen-cases.py --dup-check:命令内完全重复(exit 1)+ 设计内共享矩阵家族(≥50% 重叠)+ ≥5 键跨命令 review 清单。run-gate.sh:bracket 家族 26 例数周来双侧 127「假绿」(bracket不是任何一侧的程序名,Rust 注册的是[)。加 invocation_name 映射后 26/26 真比较全绿。首份真实数据(2026-11-10,646+686 用例全量跑,per-lane driver:wave1=main 构建、wave2=wave2 构建,报表内披露)
df/df12-output-subset(Rust 字节级 == GNU,C++ 偏差继承)→ 建议升 strict。df/df13-drive-path(GNU rc=1,Rust rc=0 输出文件系统表;registry 已登记为继承 C++ drive 模型,命令 lane 需修复或再论证)。--help/--versionRust 侧输出为空(b2sum/base32/base64/sha224sum/sha384sum/getconf/hostname/id/nproc/printenv/tac/uname/whoami)而 C++ 有完整文本——rc 相同所以 win 门从未发现。遗留
--help/--version空输出是命令 lane 工作项清单。Refs #1488, #1550