Repository navigation
wire wave2b (#1488) - #1568
Merged
Merged
wire wave2b (#1488)#1568
Conversation
caomengxuan666
force-pushed
the
rust2/wire-wave2b
branch
from
November 11, 2026 16:26
0eb28bc to
2f43217
Compare
Member
Author
|
Rebased onto origin/main (31 commits: #1555/#1559/#1560/#1563/#1564/#1565/#1567 incl. wave2a sync + wave3a/wave3b wiring). Union resolutions: CMakeLists rust2-command list (main's hostid..numfmt + wave2b's seven), cmd-matrix.sh fixtures/case tables (both waves), rust2_bridge.cppm (main's kRust2StdinCommands allowlist contract preserved verbatim inside run_command; wave2b's caller-decided run_command_with_stdin kept as a separate entry; shared RAW-writer drain body). Verified post-rebase: clean-env ctest slice base64..truncate+timeout/expand/unexpand/numfmt/join/tsort = 369/369; rust2 run-gate spot check 115 GNU-gated + 6 win GREEN. The two red checks:
|
Gate-driven fixes on the wave2 Rust applets before wiring them into the
product; every shape probed byte-for-byte on WSL coreutils 9.4 AND MSYS
(target/wc2b-probe cross-probe.sh / unit-probe.sh / trailing-probe.sh),
where both GNU platforms agree:
- basenc/digestsum: validate -w/--wrap and -l/--length at their getopt
position, before the extra-operand check, the input read and the
post-getopt combination checks (basenc.c:1106-1113 xstrtoimax at the
option case; digest.c GETOPT_LENGTH xdectoumax) — the 1.x bodies
validated in build_config the same way, so 'base64 -w bogus missing',
'base64 -d -w bogus mf', 'base64 -w bogus mf extra' and
'b2sum --tag --check -l bogus' report the option error like GNU and
the pre-wiring exe, not the file/extra-operand/tag error.
- digestsum: -b/-t last wins (GNU digest.c toggles binary_mode per
getopt occurrence; 'b2sum -t -b' prints the ' *-' marker).
- fsutil: gnu_open_reason() reconstructs GNU's strerror for literal
operands Windows-native opens reject (empty name ENOENT, trailing
slash ENOTDIR-on-existing-file / EISDIR-under-O_CREAT, invalid-name
'*.txt' ENOENT, existing-directory EISDIR), plus shared quotef().
- basenc/tac/digestsum/truncate: open failures report GNU's shapes
(basenc 'read error: Is a directory' with no operand; tac
'{file}: read error: Is a directory'; digest -c checkfile
'{prog}: checkdir: read error'; truncate O_CREAT
'cannot open name/ for writing: Is a directory|Not a directory'),
quotef-quoting names that need it ('*.txt', '').
- tac: an empty separator is the tac.c:540 NUL sentinel — compare
against the NUL byte so 'printf a\0b\0c\0 | tac -s ""' reverses
to c\0b\0a\0 (was: echoed verbatim); record-write failures print
'tac: write error: <strerror>' (tac.c:474 write_error site) instead
of exiting silently.
cargo test 266/266, cargo fmt clean; rust2 gate GREEN for all seven
commands after the fixes (211 GNU-gated + 12 win-only).
Mechanical replacement: registration metadata byte-identical, handler is one rust2 call (stdin shapes route through run_command_with_stdin like base64), C++ body deleted. Gate tsv help/version strict -> win. Gates: run-gate.sh base32 GREEN (22 strict + 2 win); cmd-matrix old-vs-new 28/28 rc + stdout, stderr 27/28 (same explained 1.x missing-file wording row as base64); unit tests re-pointed at the wired GNU shapes (bare-path missing wording, directory read-error, literal '*.txt' operand — the shell globs, the program does not, unlink.c:94 precedent). # Conflicts: # CMakeLists.txt
Mechanical replacement: registration metadata byte-identical, handler
is one rust2 call ('-' operands and a missing FILE operand slurp fd 0
via run_command_with_stdin — the digest.c rule), C++ body deleted
(including the 1.x SHA core; the self-contained digest core lives in
rust2 digest.rs/digestsum.rs with the full --check machinery).
Gates: run-gate.sh b2sum GREEN (31 strict + 1 exit + 2 win) with the
--check OK/FAILED/bad-line/missing/garbage paths gated against GNU;
cmd-matrix old-vs-new 34/34 rc + stdout + stderr byte-identical
(including every --check shape); unit tests re-pointed at the wired
GNU shapes (literal '*.txt' operand).
# Conflicts:
# CMakeLists.txt
Mechanical replacement: registration metadata byte-identical, handler is one rust2 call (digest.c stdin rule via run_command_with_stdin), C++ body deleted. Gate tsv help/version strict -> win. Gates: run-gate.sh sha224sum GREEN (47 strict + 1 exit + 2 win) with the --check OK/FAILED/bad-line/missing/garbage paths gated against GNU; cmd-matrix old-vs-new 27/27 rc + stdout + stderr byte-identical; unit tests re-pointed at the wired GNU shapes (literal '*.txt' operand; the check-directory test already asserted GNU's 'checkdir: read error' shape, which the rust2 side now reproduces). # Conflicts: # CMakeLists.txt
Mechanical replacement: registration metadata byte-identical, handler is one rust2 call (digest.c stdin rule via run_command_with_stdin), C++ body deleted. Gate tsv help/version strict -> win. Gates: run-gate.sh sha384sum GREEN (25 strict + 1 exit + 2 win); cmd-matrix old-vs-new 27/27 rc + stdout + stderr byte-identical; unit tests re-pointed at the wired GNU shapes (literal '*.txt' operand). # Conflicts: # CMakeLists.txt
Mechanical replacement: registration metadata byte-identical, handler is one rust2 call (stdin operand rule via run_command_with_stdin), C++ body deleted (glob expansion of operands went with it — GNU tac.c takes operands literally). Gate tsv help/version strict -> win. Gates: run-gate.sh tac GREEN (25 strict + 2 win, incl. -r/-s regex shapes and the NUL-separator sentinel rows); cmd-matrix old-vs-new 24/24 rc + stdout + stderr byte-identical; unit tests re-pointed at the wired GNU shapes (directory operand 'tac: indir: read error: Is a directory'; trailing-slash ENOTDIR; the NUL-sentinel empty-separator test passes against the fixed rust side). issue1368's closed-stdout write-error diagnostic is unreachable under the ABI v1 buffered output — the host drain observes fd 1, not the command — so the test documents the v1 price and the GNU diagnostic is deferred to the streaming ABI wave (recipe section 5). # Conflicts: # CMakeLists.txt
Mechanical replacement: registration metadata byte-identical, handler is one rust2 call (GNU truncate.c never reads stdin, so the plain bridge entry — a v1 slurp would block where GNU returns), C++ body deleted (the 1.x operand glob expansion went with it — truncate.c takes FILE operands literally). No gate tsv rows change: the truncate table already gated strict-only and stayed green. Gates: run-gate.sh truncate GREEN (30 strict, incl. the -o I/O-block, --reference relative-only and the SIZE-grammar rows); cmd-matrix old-vs-new 26/26 stdout, rc 25/26 and stderr 25/26 — the one row is '-s 1kB', which GNU accepts as 1000 bytes (truncate.c unit table, probed WSL 9.4) and the 1.x body rejected as Invalid number; the wired side follows GNU. Unit tests re-pointed at the wired GNU shapes: 'cannot open name/ for writing' EISDIR/ENOTDIR trailing-slash wording (replacing the 1.x 'cannot resize') and the literal '*.txt' operand (GNU would create it; Windows rejects the name — the platform-inherent shape is asserted, no existing file touched). # Conflicts: # CMakeLists.txt
Supersede the wave2 rows for the seven wired commands (help/version strict -> win, cross-shape rows added), record the 1.x-vs-GNU gaps the wiring surfaced (basenc missing-file wording, truncate -s 1kB grammar, b2sum -b/-t last-wins, tac directory-open wording) and where the product-level old-vs-new ledgers live.
Deleting the seven wave2b C++ bodies (base64 base32 b2sum sha224sum sha384sum tac truncate) orphaned their legacy-catalog source strings: 16 new legacy.* extra entries in zh-CN, all introduced by this PR (merge-base b055b48 checks clean). Same deliberate-growth precedent as #1547/#1561 and wave3b's numfmt wiring; the catalogs sync on the next reviewed i18n batch. # Conflicts: # scripts/i18n-drift-baseline.json
caomengxuan666
force-pushed
the
rust2/wire-wave2b
branch
from
November 11, 2026 17:50
5b92f6e to
1ba86b6
Compare
caomengxuan666
added a commit
that referenced
this pull request
Nov 12, 2026
… the help-surface sweep (#1488 QC round 2) - cpp_bin(): the default resolved into rust2/build-vs/... (build-vs is a TREE-root sibling, not under rust2/) — every QC-script cpp side degraded to 'missing exe' -> rc None until CPP_BIN was exported. Found by the round-2 NOTE-QC sweep; the env override still wins. - rust_bin_for(): the wave2 lane-driver split is retired - #1566/#1568/ #1570 wired every wave2/3 command to main, so one driver covers all 47 tables; RUST_BIN_W2 stays only as an override. provenance() now prints a single rust= line (splits only when overridden). - to_mnt() helper extracted from run_gnu_side's inline path mapping. - qc_note_audit/qc_win_audit re-run templates no longer require RUST_BIN_W2. - NEW gate/qc_help_surface.py -> HELP-SURFACE.md: standing sweep of every implemented command (47 gen-cases tables) x --help/--version/-h/--bogus, rust2 driver vs GNU 9.4 (batched per-command WSL scratch, /tmp/winuxcmd-gate-qc-help). Round-2 sweep verdicts (188 probes): 15 commands fully ALIGNED on --help/--version (the #1563 13 + test/bracket), 61 EMPTY-HELP + 19 RC-ONLY findings - all on the LIBRARY/driver surface; the product exe's help face is covered by dispatcher metadata (verified basename/ mkdir/seq/join/expand/numfmt/tsort/timeout/stat print usage). RC-ONLY headliners: hostname --bogus rc 1 vs GNU 255 (Debian hostname contract), getconf --bogus rc 1 vs GNU 2, and -h treated silently rc 0 vs GNU invalid-option rc 1 on the argopt-era commands (same class as the hostid ho12 / users us17 notes).
caomengxuan666
added a commit
that referenced
this pull request
Nov 13, 2026
… the help-surface sweep (#1488 QC round 2) - cpp_bin(): the default resolved into rust2/build-vs/... (build-vs is a TREE-root sibling, not under rust2/) — every QC-script cpp side degraded to 'missing exe' -> rc None until CPP_BIN was exported. Found by the round-2 NOTE-QC sweep; the env override still wins. - rust_bin_for(): the wave2 lane-driver split is retired - #1566/#1568/ #1570 wired every wave2/3 command to main, so one driver covers all 47 tables; RUST_BIN_W2 stays only as an override. provenance() now prints a single rust= line (splits only when overridden). - to_mnt() helper extracted from run_gnu_side's inline path mapping. - qc_note_audit/qc_win_audit re-run templates no longer require RUST_BIN_W2. - NEW gate/qc_help_surface.py -> HELP-SURFACE.md: standing sweep of every implemented command (47 gen-cases tables) x --help/--version/-h/--bogus, rust2 driver vs GNU 9.4 (batched per-command WSL scratch, /tmp/winuxcmd-gate-qc-help). Round-2 sweep verdicts (188 probes): 15 commands fully ALIGNED on --help/--version (the #1563 13 + test/bracket), 61 EMPTY-HELP + 19 RC-ONLY findings - all on the LIBRARY/driver surface; the product exe's help face is covered by dispatcher metadata (verified basename/ mkdir/seq/join/expand/numfmt/tsort/timeout/stat print usage). RC-ONLY headliners: hostname --bogus rc 1 vs GNU 255 (Debian hostname contract), getconf --bogus rc 1 vs GNU 2, and -h treated silently rc 0 vs GNU invalid-option rc 1 on the argopt-era commands (same class as the hostid ho12 / users us17 notes).
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.
Mechanical replacement per rust2/REPLACEMENT-RECIPE.md for the wave2b applets: base64 base32 b2sum sha224sum sha384sum tac truncate — each REGISTER_COMMAND keeps its metadata byte-identical, the handler body becomes one
winux::rust2::run_command[_with_stdin]call, and the C++ implementation is deleted in the same change (no dual track).Shared bridge change (rides with the base64 commit):
run_command_with_stdin()adopts the ABI v1 whole-buffer stdin; the CALLER applies each command's own GNU operand rule (basenc/digest/tac read fd 0 only when no FILE operand stands or an operand is "-"), sobase64 FILEat an interactive console never blocks on a slurp GNU would never do. Deliberately NOT the streaming v2 ABI (recipe §5, later wave).gate/wire/cmd-matrix.shgains the wave2b fixture + case tables (24-34 cases per command, incl. --check OK/FAILED/bad-line/missing/garbage for the digest family).Commits (one per command, plus one Rust-side fix and one docs commit):
4b0f520frust2 wave2b GNU-shape fixes ahead of wiring, all probed byte-identical on WSL 9.4 + MSYS:-w/-lat the getopt position before extra-operand/read/combo checks (basenc.c:1106-1113, digest.c GETOPT_LENGTH) —base64 -w bogus missing,base64 -d -w bogus mf,b2sum --tag --check -l bogusnow match GNU and the pre-wiring exe;-b/-tlast-wins (b2sum -t -bprints*-);gnu_open_reason()+quotef(): recover GNU strerror for literal operands Windows-native opens reject (empty → ENOENT, trailing "/" → ENOTDIR-on-file / EISDIR-under-O_CREAT,*.txt→ ENOENT, dir → EISDIR);base64: read error: Is a directory,tac: indir: read error: Is a directory,b2sum: checkdir: read error, truncate O_CREATcannot open name/ for writing);printf 'a\0b\0c\0' | tac -s ''→c\0b\0a\0, was echoed verbatim); record-write failures printtac: write error: ...instead of exiting silently.62b26261base64 (+bridge+matrix harness),6db00550base32,91921af4b2sum,29b16829sha224sum,43fa73d3sha384sum,11f4a63ftac,120ed268truncate,0eb28bc7docs(GATE-REPORT)Three gates per command:
-s 1kBgrammar (GNU accepts =1000 bytes, 1.x rejected), tac directory-open wording (covered in b), digest -b/-t last-wins (covered in the fix commit).Raw artifacts: target/issue-suites/results/wire-wave2b/ (mx-gnu/mx-old/mx-new ledgers + per-case .out/.err for all 7 commands, ctest-wired-clean-final.log, ctest-baseline-clean-final.log, wsl-diff-*). CI oracle job: savannah/WSL flakiness is known infra (#1538/#1548/#1551/#1563) — no retry loop needed.