# WinuxCmd 2.0 wave1 — differential gate report (#1488 pilot) Oracle sides: **Rust** driver (`rust2/target/debug/winuxcmd-driver.exe`), **GNU** coreutils 9.4 under WSL (`env `, native ext4 scratch), **C++** 1.x dispatcher (`build-vs/usr/bin/winuxcmd.exe`, Debug). Gate rules per case (`gate/cases/.tsv`, generated by `gate/gen-cases.py`): - `strict` — stdout bytes AND exit status must equal GNU (byte-for-byte). - `exit` — exit status must equal GNU; stdout is platform-form-bound (POSIX vs Windows path shapes) and is recorded, not gated. - `win` — no GNU comparison possible (platform-inherent output); Rust vs C++ exit status gated, stdout recorded. - `note` — record-only: cases where the 1.x C++ applet itself deviates from GNU; the Rust pilot follows GNU and the C++ divergence is inherited-not-fixed, so the case never gates. - stderr wording is NEVER gated (GNU uses Unicode quotes); first divergences are recorded under `target/gate/gnu-stderr-samples.txt`. Numbers below come from `bash gate/run-gate.sh`; regenerate this file with `bash gate/make-report.sh`. | command | cases | strict | exit | win | note | GNU-gated result | C++ parity (rc+stdout) | |---|---|---|---|---|---|---|---| | true | 20 | 19 | 0 | 1 | 0 | GREEN | 19/20 | | false | 20 | 19 | 0 | 1 | 0 | GREEN | 19/20 | | test | 45 | 42 | 0 | 2 | 1 | GREEN | 44/45 | | bracket | 26 | 25 | 0 | 1 | 0 | GREEN | 26/26 | | basename | 30 | 30 | 0 | 0 | 0 | GREEN | 30/30 | | dirname | 22 | 22 | 0 | 0 | 0 | GREEN | 22/22 | | printenv | 21 | 15 | 3 | 3 | 0 | GREEN | 17/21 | | pwd | 12 | 0 | 2 | 10 | 0 | GREEN | 1/12 | | mkdir | 22 | 22 | 0 | 0 | 0 | GREEN | 22/22 | | rmdir | 22 | 22 | 0 | 0 | 0 | GREEN | 22/22 | | readlink | 24 | 8 | 16 | 0 | 0 | GREEN | 10/24 | | realpath | 22 | 6 | 15 | 1 | 0 | GREEN | 9/22 | | chmod | 22 | 21 | 1 | 0 | 0 | GREEN | 22/22 | | chown | 16 | 12 | 0 | 4 | 0 | GREEN | 9/16 | | df | 36 | 15 | 10 | 9 | 2 | GREEN | 13/36 | **Wave1 table scope: 360 cases (regenerated from the committed generator). Whole-ledger totals (all 55 commands, full run 2026-11-12): 1529 cases — GNU-gated 1384 PASS / 0 FAIL; win-only 145 PASS / 0 FAIL.** C++ 1.x parity summary: 285/360 cases byte/rc-equal to the Rust pilot; 75 diverge (path forms, verbose message prefixes, false --help/--version handling, rmdir -p trailing slash, chmod --reference behavior, df drive paths). These are recorded per case in `target/gate/ledger.tsv` (column `r=c:no`) and are inherited 1.x behaviors the 2.0 replacement intentionally re-derives from GNU. ## Wave2 (#1488, second batch) 15 commands: `whoami nproc unlink sleep base64 base32 b2sum sha224sum sha384sum tac truncate uname id hostname getconf`. Digest bytes are platform-independent (sha224sum/sha384sum/b2sum gate mostly strict); whoami/nproc/uname/id/hostname/getconf carry the Windows value model of the 1.x C++ applets, so their value cases gate Rust-vs-C++ rc (win) while rc-only error cases still gate against GNU. Known GNU-vs-C++ divergences (hostname net-tools options, getconf -a table, nproc affinity counts) are the documented 1.x behavior the Rust side follows. | command | cases | strict | exit | win | note | GNU-gated result | C++ parity (rc+stdout) | |---|---|---|---|---|---|---|---| | whoami | 20 | 2 | 6 | 12 | 0 | GREEN | 18/20 | | nproc | 22 | 8 | 4 | 10 | 0 | GREEN | 20/22 | | unlink | 22 | 22 | 0 | 0 | 0 | GREEN | 22/22 | | sleep | 24 | 12 | 12 | 0 | 0 | GREEN | 24/24 | | base64 | 30 | 30 | 0 | 0 | 0 | GREEN | 28/30 | | base32 | 24 | 24 | 0 | 0 | 0 | GREEN | 22/24 | | b2sum | 34 | 33 | 1 | 0 | 0 | GREEN | 32/34 | | sha224sum | 50 | 49 | 1 | 0 | 0 | GREEN | 48/50 | | sha384sum | 28 | 27 | 1 | 0 | 0 | GREEN | 26/28 | | tac | 27 | 27 | 0 | 0 | 0 | GREEN | 21/27 | | truncate | 30 | 30 | 0 | 0 | 0 | GREEN | 29/30 | | uname | 22 | 0 | 4 | 18 | 0 | GREEN | 20/22 | | id | 22 | 8 | 0 | 14 | 0 | GREEN | 20/22 | | hostname | 22 | 0 | 5 | 17 | 0 | GREEN | 20/22 | | getconf | 23 | 5 | 0 | 18 | 0 | GREEN | 19/23 | **Wave2 total cases: 348; GNU-gated + win-gated: all GREEN; C++ parity: 320/348.** ## Wave2b wiring refresh (#1488, second-batch wiring) The seven wave2 Rust applets (base64 base32 b2sum sha224sum sha384sum tac truncate) are wired into the product (handlers are one `winux::rust2::run_command[_with_stdin]` call; the C++ bodies are deleted). The rows below supersede the Wave2 rows for these commands: sole `--help`/`--version` moved strict -> win (the dispatcher's branded interception owns them, nproc np10/np21 precedent) and cross-shape rows were added (bogus `-w`/`-l` vs missing file / extra operand / decode mode; bogus `-l` vs `--tag --check`) locking the getopt-position validation order probed on WSL 9.4. The C++ parity column compares the rust2 DRIVER against the 1.x dispatcher, so the win help/version rows show r=c:no on stdout text (GNU text vs WinuxCmd branding); product-level old-vs-new byte equality is carried by `gate/wire/cmd-matrix.sh` ledgers under `target/issue-suites/results/wire-wave2b/` (rc+stdout 100%, four explained stderr/rc rows where the 1.x body itself deviated from GNU: basenc missing-file wording, truncate `-s 1kB` grammar, b2sum `-t/-b` last-wins, tac directory-open wording). | command | cases | strict | exit | win | note | GNU-gated result | C++ parity (rc+stdout) | |---|---|---|---|---|---|---|---| | base64 | 30 | 28 | 0 | 2 | 0 | GREEN | 28/30 | | base32 | 24 | 22 | 0 | 2 | 0 | GREEN | 22/24 | | b2sum | 34 | 31 | 1 | 2 | 0 | GREEN | 32/34 | | sha224sum | 50 | 47 | 1 | 2 | 0 | GREEN | 48/50 | | sha384sum | 28 | 25 | 1 | 2 | 0 | GREEN | 26/28 | | tac | 27 | 25 | 0 | 2 | 0 | GREEN | 25/27 | | truncate | 30 | 30 | 0 | 0 | 0 | GREEN | 30/30 | **Wave2b refresh: 223 cases; GNU-gated + win-gated: all GREEN.** ## Wave3a (#1488, third batch) 8 commands: `seq fold paste tee fmt stat touch ln` (240 cases). All five text commands gate strictly against GNU coreutils 9.4 byte-for-byte (seq's arbitrary-precision integer fast path + f64 long-double path, fold.c's byte/column algorithm, paste.c's parallel/serial delbuf algorithm, tee.c's EPIPE-silent failure model, fmt.c's full cost DP). stat renders GNU's exact default/terse/-c format shapes over the Windows value model of the 1.x applets (uid 0x30000+RID, POSIX-shaped mode words, volume-serial device), so its value cases gate Rust-vs-C++ rc (win) while rc-only and platform-neutral stdout cases stay strict against GNU. touch sets times through SetFileTime with a DST-aware TzSpecificLocalTime conversion (no CRT timezone touch) and a probed GNU parse-datetime subset (-d ISO/@epoch/time-only/-t [[CC]YY]MMDDhhmm[.ss]). ln uses CreateHardLinkW and CreateSymbolicLinkW (unprivileged flag; the 1.x C++ lacks it, so symlink-creation cases are `note`: GNU rc 0, Rust rc 0, C++ rc 1). Known GNU-vs-C++ divergences the Rust side follows GNU on: `stat -c %C` rc (GNU 0, C++ 1), `ln -i` decline rc (GNU 1, C++ 0 observed as no-op), tee fold trailing-space (fold C++ drops it). Documented subset: touch relative dates ("next monday") are rejected like GNU rejects unparseable dates; seq f64 vs 80-bit long double only differs >16 significant digits; fmt buffers whole paragraphs (GNU flushes at 5000 chars / 1000 words). | command | cases | strict | exit | win | note | GNU-gated result | C++ parity (rc+stdout) | |---|---|---|---|---|---|---|---| | seq | 50 | 50 | 0 | 0 | 0 | GREEN | 46/50 | | fold | 26 | 26 | 0 | 0 | 0 | GREEN | 26/26 | | paste | 38 | 37 | 0 | 1 | 0 | GREEN | 38/38 | | tee | 24 | 21 | 1 | 2 | 0 | GREEN | 22/24 | | fmt | 26 | 25 | 0 | 1 | 0 | GREEN | 25/26 | | stat | 22 | 9 | 1 | 11 | 1 | GREEN | 14/22 | | touch | 29 | 28 | 0 | 1 | 0 | GREEN | 27/29 | | ln | 25 | 19 | 1 | 2 | 3 | GREEN | 21/25 | **Wave3a total: 240 cases; GNU-gated + win-gated: all GREEN; notes: 4 (st10 %C rc, ln22/ln24/ln25 unprivileged symlink creation). C++ parity: 219/240.** C++ 1.x parity summary: 270/338 cases byte/rc-equal to the Rust pilot; 68 diverge (path forms, verbose message prefixes, sole `--version` text, rmdir -p trailing slash, chmod --reference behavior, df drive paths). These are recorded per case in `target/gate/ledger.tsv` (column `r=c:no`) and are inherited 1.x behaviors the 2.0 replacement intentionally re-derives from GNU. **Refresh (#1488 wiring wave, true/false):** the pilot's `true`/`false` honored `--help`/`--version` in any position and returned 0 for `false --help`/`--version`; GNU (true.c, `argc == 2`, EXIT_STATUS kept) honors them only as the sole argument and `false` keeps status 1. truefalse.rs now follows the sole-argument rule, so t06/t14/f06/f14 were promoted to `strict` and f07 became `win` (branded version text, like t07). Rows re-measured with `bash gate/run-gate.sh true false`: 38 GNU-gated + 2 win, all green. The three former `note` rows were the pilot diverging, not the C++ applet. **Refresh (#1488 rust2 wave1 deepening, chmod/chown/df):** the pilot's platform-subset commands were pushed to "everything Windows can honestly do", GNU semantics per coreutils 9.4 probed under WSL: - `chmod` — full GNU modechange grammar in `modemap.rs`: multi-op clauses (`u+r-w`), omitted-who umask exclusion (`=w` on 044/umask 022 -> 0200), `X` on dirs/pre-executable files only, copy forms (`u=g`, `u+g`), special bits (`s`->u/g, `t`->o, misplaced silently no-op like GNU `g+t`), `=` replacing the affected who's special bits, octal values fitting 0o7777 (`00000644` ok, `077777` invalid). `-R` keeps GNU fts preorder, skips symlinks, refuses filesystem roots (upstream default preserve-root; the WSL oracle build has it disabled — never aim `-R` at `/` in the gate). `-v`/`-c` follow GNU wording (`mode of 'f' changed from 0644 (rw-r--r--) to 0755 (rwxr-xr-x)`), `-f` suppresses diagnostics. NTFS persistence stays the documented subset: read-only attribute tracks owner-write; x/s/t bits live in the in-memory model only. Cases 22 -> 45 (strict 21 -> 41). - `chown` — real ownership changes via advapi32 SetNamedSecurityInfoW: owner-to-self and owner+group apply where the OS grants WRITE_OWNER; the unprivileged desktop denial maps to GNU's `changing ownership of 'f': Operation not permitted` rc 1 (probed: even same-group GROUP_SECURITY_INFORMATION is rc 5 ERROR_ACCESS_DENIED without SeRestorePrivilege). Numeric uid/gid stay validated no-ops (no Windows model); `owner:` trailing colon follows GNU (`root:` ok, `1234:` invalid spec), `--from` filters by SID, `--reference` copies both SIDs, `-v`/`-c` follow GNU describe_change wording. Cases 16 -> 37 (strict 12 -> 22; 4 notes: OS-denied group set, cpp pilot diverges). - `df` — GNU 12-column `--output` model (source,fstype,itotal,iused, iavail,ipcent,size,used,avail,pcent,file) with GNU's field-error wordings, `-t`/`-x` exact fstype filters, `--total` summary row, `-i`, `-B`/`--block-size` with SI/binary suffixes and ceil division, dynamic column widths, `df ` mount-point resolution with same-fs dedup, fstype from GetVolumeInformationW, bounded probe for remote drives. Inode columns report 0 with `IUse%` `-` (no NTFS inode counts — documented deviation); source column is the drive letter / UNC share (value model). Cases 15 -> 35. Rows re-measured with `bash gate/run-gate.sh chmod chown df` (45 + 37 + 35 = 117 cases): GNU-gated strict/exit 73 + win 18, all green; C++ parity 76/117 (the C++ 1.x applets lack the new option surfaces). Pre-existing main-side gap noticed while re-running the full gate: `uname`/`id`/`hostname`/`getconf` modules exist on main but are not in `lib.rs` `registry()`, so their 88 gate cases exit 127 — wiring lane scope. ## Wiring wave1 remainder (#1488, third batch) 10 command entries wired into winuxcmd.exe and their C++ bodies deleted: `pwd printenv basename dirname readlink realpath mkdir rmdir test [ sync` (`test` and `[` share the rust2 test_cmd). Product-side gates per command harness (RUST_BIN = build-vs exe, CPP_BIN = baseline exe) + argument matrix (gate/wire/cmd-matrix.sh, one shared cwd; old vs new byte parity on rc/stdout/stderr) + the command's ctest slice. Library-side: full `gate/run-gate.sh` with the driver stays at the four pre-existing unregistered-command failures (getconf/hostname/id/uname: their registry entries were never merged to main, 88 rows rc=127 "unknown command"; out of this wave's scope). Library fixes surfaced by the wiring gates (each GNU-probed, own commit): pwd $PWD dot/dotdot rejection; printenv -0/--null + getopt("+") operand stop + NAME=VALUE full dump; argopt getopt_long unambiguous abbreviation (fake alias entries deleted from six tables); basename -s any-value-implies-multiple; readlink -q/-s spellings, last-wins verbosity, -n over -z, '/'-separator canonicalize output; realpath -E extension, mode-word last-wins, ENAMETOOLONG/ENOTDIR walks, trailing separators, base validation, below-only --relative-base, native -m spellings, resolver operand folds (#1145/#1172/#1231/#1246/#1283); mkdir -Z no-op, operand-drive fold, -m leaf-only with -p, symbolic modes against the a=rwx base; rmdir --path alias; test "-a"/"-o"/"==" binops with GNU precedence, 2-argument GNU wording, -p/-f kFifoMarker recognition; sync as a new library module (FlushFileBuffers semantics, no operand globbing). Case-table changes: test.ts43-help-flag strict -> note (the wired exe prints the WinuxCmd-branded sole-argument help; GNU test prints nothing; r=c parity holds — the dispatcher contract the 1.x applet shipped). sync.tsv added (22 cases). Matrix rows added for the wave in gate/wire/cmd-matrix.sh (one deliberate stdout divergence recorded per command where the 1.x applet stripped '\' and GNU treats it as data). **Refresh (#1488 help-surface wave, 2026-11-11):** the 13 driver-surface commands printed nothing for `--help`/`--version` (the QC win audit's structural black hole, WIN-AUDIT.md from PR #1555). Each now prints the probed WSL-oracle text byte-for-byte — coreutils 9.4 for b2sum base32 base64 sha224sum sha384sum id nproc printenv tac uname whoami, glibc 2.39 for getconf, Debian hostname 3.23 (whose `--help` exits 255) — via the shared gnuhelp.rs footer/version builders; the first flag in argv wins, like getopt_long. Their help/version rows were promoted win -> strict (printenv keeps win: the wired product exe shows the branded dispatcher text — true/false precedent), with new version rows for b2sum/tac/getconf/printenv. The four wave2 modules that shipped unregistered on main (getconf/hostname/id/uname — the "88 rows rc=127" gap noted above) are now in registry(). df operands the oracle cannot stat — Windows drive-letter forms (`C:\`, `C:\Windows` are not POSIX paths; df.c stats each operand as given) — take the GNU missing-path branch: quotef'd stderr, empty stdout, rc 1 (quotef shared from digestsum). df07/df09/df13/df15 and the audited df12 scenario (new row df36) gate strict; the stale df12-output-subset/df13-drive-path note rows (ids that predate the wave1-deepening table) are gone and the remaining df notes df24/df33 are documented in note-registry.tsv. Full gate re-run: 932 GNU-gated + 134 win cases, all green. **Wiring refresh (#1488 wiring wave3a, touch/ln/stat/seq/tee/paste/fold/fmt):** all eight handlers moved to the rust2 bridge (rust2/wire-wave3a) and the case rows were re-measured with the wired exe as the rust side and the e4668086 1.x build as the C++ side (baseline exe kept at target/gate/wire/baseline/winuxcmd.exe; baseline full-ctest fail set saved at target/gate/wire/baseline-ctest-fails.txt, 20 pre-existing failures — the final wired build reproduces exactly that fail set): | command | cases | strict | exit | win | note | GNU-gated result | C++ parity (rc+stdout) | |---|---|---|---|---|---|---|---| | touch | 29 | 28 | 0 | 1 | 0 | GREEN | 28/29 | | ln | 25 | 19 | 1 | 1 | 4 | GREEN | 25/25 | | stat | 22 | 9 | 1 | 11 | 1 | GREEN | 17/22 | | seq | 50 | 50 | 0 | 0 | 0 | GREEN | 46/50 | | tee | 24 | 21 | 1 | 2 | 0 | GREEN | 24/24 | | paste | 38 | 37 | 0 | 1 | 0 | GREEN | 38/38 | | fold | 26 | 26 | 0 | 0 | 0 | GREEN | 26/26 | | fmt | 26 | 25 | 0 | 1 | 0 | GREEN | 26/26 | **Wiring total: 240 cases; GNU-gated + win-gated: all GREEN; C++ parity 230/240.** cmd-matrix.sh + compare.sh ran the old exe vs the wired exe in isolated per-side scratch cwds against a WSL GNU rc ledger per command (touch 26, ln 25, stat 28, seq 25, tee 19, paste 21, fold 20, fmt 22 rows). Every old-vs-new divergent row is an old-side deviation the replacement corrects, each GNU-probed (w3a/probe/*.sh, 2026-11-11): touch -d "YYYY-MM-DD HH:MM:SS" (space form, rows 07/18) accepted by GNU and rejected by the 1.x build; the -t .99 stamp the 1.x accepted (gate a row to28); seq's spurious "Try 'seq --help'" tail on the unknown-%! diagnostic; fold -c and the fmt -m/-P/-X/-x/-T extensions GNU rejects (invalid option, rc 1). stat rows 01/02 differ only in the run-instant fields (Inode file index, Change/Birth of the freshly recreated fixture) — an OLD-vs-OLD rerun shows the same 26/28, so the fields are unstable identically on both sides. ln -s rows match the 1.x refusal byte-for-byte on this non-Developer-Mode host (25/25 byte-equal) and stay note-recorded; where the capability exists the rust2 ALLOW_UNPRIVILEGED_CREATE retry matches GNU rc 0 (recorded behavior change vs the 1.x refusal). Corpus (gate b) realignments, each probed: tee's open-failure diagnostic carries GNU's unquoted quotef name (the 1.x always-quoted spelling diverged); fold's two -c tests and fmt's five -m/-P/-X/-x/-T tests are the 1.x extensions GNU rejects. All other corpus regressions were fixed on the rust2 side (GNU parse-datetime grammar and the operand contract for touch; ln drive-dialect/#1491/readonly-remove; stat operand boundary, glob, last-wins -c/--printf/--format slot, octal/hex --printf escapes; paste/fold directory EISDIR mapping; fmt directory bare read-error line; the bridge close_stdout contract for seq's #1368; the NUL device pass-through in api_path). ## Wave3b (#1488, third batch) 8 commands: `join tsort hostid users timeout expand unexpand numfmt`. join/tsort/expand/unexpand/numfmt gate byte-for-byte against GNU on stdout+rc (strict); timeout gates exit status only (the child set is platform-specific: sleep/ping-vs-sleep.exe/cmd.exe); hostid and users carry the Windows value model (win) with GNU-shape rc errors gated. Known inherited 1.x divergences are recorded, not fixed: tsort -w (C++ accepts, GNU 9.4 rejects), hostid/users -h (C++ rejects, GNU and Rust accept), numfmt --unit-separator/-M/-l and ZYRQ unit suffixes (C++ accepts, GNU 9.4 rejects, Rust follows GNU). | command | cases | strict | exit | win | note | GNU-gated result | C++ parity (rc+stdout) | |---|---|---|---|---|---|---|---| | join | 51 | 36 | 15 | 0 | 0 | GREEN | 51/51 | | tsort | 25 | 17 | 6 | 2 | 0 | GREEN | 23/25 | | hostid | 20 | 0 | 12 | 7 | 1 | GREEN | 12/20 | | users | 20 | 0 | 15 | 4 | 1 | GREEN | 8/20 | | timeout | 30 | 0 | 30 | 0 | 0 | GREEN | 28/30 | | expand | 30 | 19 | 11 | 0 | 0 | GREEN | 28/30 | | unexpand | 26 | 21 | 5 | 0 | 0 | GREEN | 24/26 | | numfmt | 74 | 49 | 25 | 0 | 0 | GREEN | 66/74 | **Wave3b total cases: 276; GNU-gated + win-gated: all GREEN; C++ parity: 240/276.** Wiring follow-up (wave3b, 2026-11-11): expand/unexpand/numfmt/join/tsort/ hostid/users/timeout handlers are now one `winux::rust2::run_command` call each. The wiring gates re-ran the tables with the wired product exe as the rust side: 130/130 GNU-gated GREEN for expand+unexpand+numfmt. Two rows flipped from C++-parity to explained `r=c:no` (`expand/ex10`, `unexpand/ue16`): the 1.x dispatcher's option pre-parser rejected the GNU obsolescent comma lists `-4,8` / `-4,8,12` with "invalid option -- ','" before the handler ran; the wired product now follows GNU — expand.c:48 optstring `it:0::1::...9::` (digits take optional arguments, expand.c:204 `parse_tab_stops(optarg - 1)` consumes digit + whole rest of the token) and unexpand.c:272 optstring `,0123456789at:` (digits and comma are plain per-character option chars). The generic cluster rule is disabled for these two commands via `OptionParsePolicy::digit_led_short_tokens_as_positionals`. **Wiring wave2a (#1488, 2026-11-11):** `whoami nproc unlink sleep hostname uname id getconf` moved from the 1.x C++ bodies to the rust2 staticlib (one handler = one `winux::rust2::run_command` call, C++ body deleted). Case-table changes from the wired product surface: hn19-help/hn20-version (un17/un18, id18/id22, gc19/gc23 likewise) demoted strict -> win — the dispatcher's branded sole `--help`/`--version` interception runs before the handler and is byte-identical old vs new (the printenv/true-false precedent). hostname gained the dispatcher canonicalization on the Rust side: a registered long spelling (`--short`) sets ctx.has("-s") too, so the net-tools rejection reports the short-form message scanned in the C++ unsupported[] table order. unlink gained the 1.x Windows failure-text chain (describe_unlink_failure + win32_posix_error_text invalid_name_as_missing, trailing separators stripped before probes per #1052; `unlink ""` -> ENOENT without touching the cwd). Per-command product gates (RUST_BIN=wired exe vs CPP_BIN=baseline exe, plus gate/wire/cmd-matrix.sh old-vs-new): run-gate.sh unlink 22/22, sleep 24/24, hostname 22/22, uname 22/22, id 22/22, getconf 23/23 — all green. Matrix old-vs-new byte parity: unlink 21/21, sleep 17/17, hostname 29/29, uname 24/24, id 25/25, getconf 26 rc/stderr + 23 stdout (rows 10/ 12/13 drift in AVPHYS_PAGES between any two runs — GlobalMemoryStatus volatile; the old exe drifts the same way; all other table lines byte-identical). GNU rc oracle holds every row except the documented Windows-value-model classes (hostname net-tools/set-operand [DIFFERS], id USER operand, getconf Windows table + pathconf existence check). ## Wave4a (#1488, fourth batch) 8 commands: `head tail cut tr od sum mktemp nice`. Ledger (full run 2026-11-12): 1529 cases total across all 55 commands — GNU-gated 1384 PASS / 0 FAIL, win-gated 145 PASS / 0 FAIL. Per-command rows for this batch (strict/exit/win/note, GNU-direct %, C++ parity): | command | cases | strict | exit | win | note | GNU direct | C++ parity | gate | |---|---|---|---|---|---|---|---|---| | head | 29 | 29 | 0 | 0 | 0 | 100% | 27/29 | GREEN | | tail | 27 | 27 | 0 | 0 | 0 | 100% | 25/27 | GREEN | | cut | 33 | 33 | 0 | 0 | 0 | 100% | 31/33 | GREEN | | tr | 37 | 37 | 0 | 0 | 0 | 100% | 33/37 | GREEN | | od | 36 | 36 | 0 | 0 | 0 | 100% | 33/36 | GREEN | | sum | 20 | 20 | 0 | 0 | 0 | 100% | 18/20 | GREEN | | mktemp | 27 | 14 | 13 | 0 | 0 | 52% | 11/27 | GREEN | | nice | 21 | 14 | 7 | 0 | 0 | 67% | 12/21 | GREEN | Probed semantics locked by this batch: head/tail count grammar (+K/-K asymmetry, `-n -0` everything-vs-nothing, b/kB/K suffixes), cut's strtol-list parser ("1 3" selects two specs) and the unconditional output-record terminator, tr's byte-set grammar (class byte order A-Za-z, `[c*n]` octal counts, `-c` translate -> SET2 last char) with C-locale byte tables, od's shortest-round-trip float display (`4.8e-322`) and the `-tx1z` ascii column at 16*(w+1)+2, sum's SysV 16-bit fold (1500 'b' -> 15930), mktemp's X-run rules (min run 3, case-sensitive, --suffix must-end-in-X) and the silent -q create-failure path, nice's xstrtol adjustment (rc 125, no try-tail) and the suspended-child priority mapping (#1359). Documented subsets: tail -f/-F/--retry do not follow (dumps then rc 1); od --traditional/-S and fL are rejected; nice children inherit process stdio (same shape as timeout.rs). mktemp creations and nice child runs gate on exit status only (names and niceness are platform-bound). ## Borrow-algo: seq exact decimal + numfmt field reassembly (#1488, uutils audit action items) Two "borrow uutils algorithms" items from `DOCS/2.0-uutils-audit.md` (PR #1562 audit): seq float-path precision and numfmt --field line reassembly. Both root causes are cited to the GNU C source and were probed byte-for-byte against WSL GNU coreutils 9.4 before the fix (evidence: `rust2/target/borrow-algo/{seq,numfmt}-probe{,.before,.after}.txt`, 33 seq cases + 21 numfmt cases, GNU-vs-RUST paired). ### seq — exact fixed-point stepping (was: f64 long-decimal drift) - Root cause: the generation path past the integer fast paths computed `first + i*step` in f64 (GNU uses 80-bit long double, seq.c print_numbers lines 300-364), so >17-significant-digit decimal operands rounded at parse and sub-f64-ulp steps made the loop never terminate (`seq 0.9999999999999999999 0.0000000000000000001 1.0000000000000000002` printed `1.0000000000000000000` forever; audit case `seq 0.9999999999999999999 1.0000000000000000002` printed `1.0000000000000000000` instead of GNU's `0.9999999999999999999`). - Fix (`seq.rs`): uutils-borrowed exact-decimal path, std-only. When no -f was given and every operand is a finite fixed-point decimal, operands parse as (i128 mantissa, decimal scale) pairs (`parse_exact_decimal`), the loop steps on the common 10^-scale grid (`ExactRun::print` mirrors print_numbers' structure; the seq.c rounding fixup at lines 340-356 is dead here — the value just past LAST sits on the 10^-prec grid so its exact rendering never reparses to LAST), and output formats from the scaled integers only (`render_exact`, digits sliced from the decimal string, %0.f zero-pad rules preserved). The default-format derivation (get_default_format, seq.c lines 373-406) and scan_arg width/precision are reused unchanged. A parity guard admits only magnitudes below the long-double 64-bit-mantissa grid (< 2^64 units of 10^-prec over first/last/|last-first|): probed boundary — `0.9999999999999999999` (9.99e18 units) is in, `0.99999999999999999999` (9.99e19 units, GNU long double parses to 1.0) stays on the float path so those bytes keep matching. The scientific integer fast attempt renders endpoints from the exact mantissa instead of `{:.0}` of f64 (GNU prints "%0.Lf" of the long double, seq.c lines 686-695; `seq 1e23 1e23` was `99999999999999991611392`, now `100000000000000000000000`). - Residual (documented in the module comment): past the long-double mantissa GNU itself prints float artifacts — `seq 2 1e-19 2.0000000000000000005` duplicates lines, `seq -1.5 0.9999999999999999999 1.5` drifts a final ulp — we now print exact decimals there (uutils-equivalent behavior); those shapes are outside the gate. ### numfmt — --field reassembly keeps the original field width - Root cause: under auto-padding, the per-field pad width ignored GNU's `1 < field` rule (numfmt.c process_suffixed_number line 1360: `padding_width = text < p || 1 < field ? mbswidth (text) : 0`), so a converted field past the first was emitted at its new width and the line collapsed to single spaces: `echo 'plain 1048576 line' | numfmt --field 2 --to=iec` gave `plain 1.0M line` instead of GNU's `plain 1.0M line`. - Fix (`numfmt.rs`): one invariant correction — auto-padding now uses the full field-text width whenever the field carries leading blanks or is past the first, so the converted number is padded back to the original field width and trailing fields keep their columns. Byte length stands in for mbswidth (ASCII = gate domain agrees; wide multibyte display width is a documented divergence, matching GNU's strlen fallback for unprintable bytes). Explicit --padding and --delimiter still disable auto-padding (GNU: `auto_padding = padding_width == 0 && delimiter == NULL`, numfmt.c line 1687). - Gate cases added (all strict): nf75-nf86 cover --field 1/2/3/-/2-3/1,3/4 over aligned multi-space lines, tab separators, invalid=warn, wider output (no pad), delimiter/padding opt-outs, suffix/format-suffix width interaction. sq51-sq60 cover the audit case + -w, sub-ulp stepping (was an infinite loop), 1e23 endpoints, 1000-step no-drift, 18/19-digit grids, negative zero, and both long-double boundary shapes. ### Before/after (same case tables, same harness) - gate seq numfmt before: **134/146 pass, 12 fail** — seq sq51 sq52 sq53 sq54 (audit case x2, sub-ulp hang, 1e23) + numfmt nf75 nf76 nf77 nf78 nf79 nf80 nf85 nf86 (field-width collapse family). - gate seq numfmt after: **146/146 pass, 0 fail** (C++ parity recorded, not gated; unchanged rows keep their recorded C++ columns). - cargo test winux-cmds: 358 passed / 0 failed (3 new tests: exact_decimal_long_fractions, exact_decimal_no_drift, field_alignment_preserved). rustfmt clean on both files. ### Gate harness finding (flagged, not fixed here) The case tables' stdin column is fed with `printf %s` (run-gate.sh run_case) — the `\n` escape is NOT decoded, so the literal two bytes `\` `n` land in the input. Any case whose included field is the last one therefore converts nothing on either side: both GNU and Rust report `invalid suffix` (rc 2) and the row passes vacuously. This predates the wave (single-value rows nf01-nf28 are all in this class); it does not produce wrong GREENs (both sides see identical bytes), but those rows exercise the error path instead of the conversion. Suggested follow-up: decode `\n` in run_case stdin (or `%b`), then re-audit the affected rows' expected outputs before trusting their strict columns. ## Wave4b: sort — library-form GNU sort.c port (#1488) `crates/winux-cmds/src/sort.rs`: a direct port of GNU sort.c (coreutils 9.4, vendored spec copy under `rust2/target/sort-spec/` together with the gnulib helpers it delegates to: `strnumcmp-in.h` for -n and `filevercmp.c` for -V), probed case-by-case against the WSL coreutils 9.4 oracle (`rust2/target/sort-probe/p1..p6.sh`) before coding. | section | status | |---|---| | core sort (byte order, -b/-d/-f/-i/-M/-h/-n/-R/-r/-u/-s, +POS1[-POS2] obsolescent keys, --sort=WORD, global-flag inheritance incl. the no-inheritance-when-key-has-flags rule) | done, GNU-exact | | field syntax (-k F[.C][OPTS][,F[.C][OPTS]] full grammar, per-key b/d/f/g/h/i/M/n/R/r/V, -t byte separator incl. `-t '\0'`, begfield/limfield literal port, missing-field/empty-key rules, keyparse errors byte-exact) | done, GNU-exact | | numeric family (-n gnulib strnumcmp byte algorithm, -g strtold-shaped incl. hex float + inf/nan ordering, -h unit_order K..Q then strnumcmp, -M 3-letter month prefix table) | done, GNU-exact | | merge & output (-m stable k-way with -u first-of-run, multiple inputs concatenated, -z, -o incl. input-is-output safety, missing-eol supply per file) | done, GNU-exact | | check (-c/-C rc 1 semantics, first-disorder diagnostic `sort: FILE:LINE: disorder: LINE`, -u strict ordering, -r/-s/-k participation, -c -m checks, -c two-operands/-o rc 2) | done, GNU-exact | | diagnostics (cannot read / open failed / read failed / write failed, rc 2; empty tab, multi-character tab, incompatible tabs, field-spec wording, argmatch invalid/ambiguous rc 1, -S/-–batch-size/--parallel validation) | done, GNU-exact | | performance (64 MiB three-way below) | beats 1.x C++ 12x plain / 2.1x -n | Gate: `bash gate/run-gate.sh sort` — **84 cases (83 strict + 1 win), all GREEN on the first run**; zero vacuous rows. C++ parity 78/84; the 6 divergences are inherited 1.x gaps the Rust side does not follow (1.x rejects `+1 -1`, `-S100k`, `-y100` which GNU accepts, prints branded help/version text, and -R output order is per-run random there): recorded per row in `target/gate/ledger.tsv`, not gated. ### 64 MiB timing (three-way) 口径: fixture `t64m.txt` 67,108,885 bytes / 1,359,683 lines, md5-identical on NTFS (`rust2/target/sort-perf/`) and WSL ext4 (`/tmp/sortperf/`), `md5 4b980acf…`; LC_ALL=C everywhere; each side writes its output to a local file (`-o`) — Rust and 1.x C++ on NTFS, GNU on ext4, so GNU's column is platform-inclusive (NTFS+Defender vs ext4+parallel external merge is the same caveat PERF-BASELINE.md records for the 72x family). 1 warmup + 5 timed runs per side, median wall clock (`TIMEFORMAT=%R`). Correctness anchor: the 64 MiB outputs are md5-identical across all three engines for BOTH workloads (plain `488aa0ed…`, `-n` `60d89287…`). | workload | rust2 sort (Release, NTFS) | 1.x C++ sort (Release, NTFS) | GNU sort 9.4 (WSL, ext4) | |---|---|---|---| | plain | **1.648 s** | 19.759 s | 0.425 s | | -n | **2.179 s** | 4.484 s | 0.549 s | Rust vs 1.x C++ (like-for-like NTFS): **12.0x faster plain, 2.1x faster -n**. vs GNU: 0.26x plain / 0.40x — GNU's parallel external merge on ext4 stays ahead, the accepted platform gap (single-threaded in-memory v1; `--parallel` is accepted-and-ignored). The first measurement iteration exposed an unbuffered per-line output write (1.36M `write_all` syscalls); wrapping the sink in a 1 MiB BufWriter took rust-plain 5.03 -> 1.65 s — GNU's stdio buffering enjoys the same, which is why the fix is semantic parity, not tuning. ### Documented deviations (diff ledger) - `-R`: GNU shuffles per run with an MD5 of random-source bytes; rust2 sorts by a fixed FNV-1a-64 of the (filtered) key — deterministic across runs, identical keys stay grouped, but the ORDER differs from GNU by design (gate `win` row so80; `--random-source` is still validated eagerly like GNU). Any hash-collision tie falls back to byte compare. - `-g` uses f64, not x87 long double (ordering identical for ordinary magnitudes; extreme-tail precision may differ). - `--parallel`/`--batch-size`/`-S`/`-T`/`--compress-program`/`-y` are accepted-and-ignored (validated where GNU validates: 0-parallel, batch-size < 2, -S suffix grammar); the in-memory pipeline has no temp files to compress or size-limit. - `--files0-from` is not implemented (absent from the option table -> GNU's unrecognized-option usage error, rc 2); `--debug` is accepted but prints no key annotation (and stays incompatible with -c/-o like GNU). - POSIX2_VERSION / POSIXLY_CORRECT parsing variants are out of scope (traditional +POS1 keys are always on, matching the default host). cargo test winux-cmds: 454 passed / 0 failed (43 new sort tests). gate harness note: the sort corpus is immune to the known stdin-column `\n` limitation — every multi-line row ships its input through the setup column; the four --dup-check WARNs are pre-existing (test/whoami/base64/ numfmt), none from sort. ## Wave4b (#1488, fourth batch) 8 commands: `factor pathchk ptx shuf csplit nohup groups who`. factor and csplit gate byte-for-byte against GNU on stdout+rc (strict, 100%); shuf's `--random-source` rows are GNU-strict through the entropy-recycling randint port (37/40 strict — the deterministic path reproduces GNU 9.4's permutations byte-for-byte, probed then gated); pathchk gates GNU rc strictly on every POSIX-check row, with the Windows subject-side rules (reserved device names, invalid characters) win-classified against the C++ value model. ptx implements the C++ subset data flow: default/roff/tex formats, macro renames and error paths are GNU-strict for single-line short inputs; GNU's circular-context grid, -G traditional layout, -w narrow grids and the -C extension are win/note-classified divergences documented in the module. nohup resolves children through the extracted childproc module (PATH-only + PATHEXT + COMSPEC batches) and reproduces GNU's `+` optstring (leading-options-only parsing, probed); the terminal faces (nohup.out append, /dev/null stdin) are a documented deferral — the library cannot observe console-ness through injected IO, and the gate harness runs both sides under pipes where GNU takes the same no-redirect path. groups/who carry the Windows value models (NetUserGetGroups / WTS sessions) and gate `win` against the C++ Debug exe, with every GNU-shaped rc error strict-gated. Harness changes this wave (run-gate.sh): `MSYS_NO_PATHCONV=1` and the C++ package bin dir (`$(dirname $CPP_BIN)`, the /usr/bin analog) are exported inside both Windows-side run.sh scripts, so pattern operands reach the library raw and child-spawning commands resolve the same siblings on both sides. The full 55-table suite re-ran green after the change (1335 GNU-gated + 190 win-gated, 0 fail). | command | cases | strict | exit | win | note | GNU-gated result | C++ parity (rc+stdout) | |---|---|---|---|---|---|---|---| | factor | 26 | 25 | 0 | 1 | 0 | GREEN | 24/26 | | pathchk | 30 | 27 | 0 | 3 | 0 | GREEN | 28/30 | | ptx | 28 | 19 | 0 | 9 | 0 | GREEN | 26/28 | | shuf | 40 | 37 | 1 | 2 | 0 | GREEN | 37/40 | | csplit | 32 | 32 | 0 | 0 | 0 | GREEN | 32/32 | | nohup | 24 | 18 | 0 | 6 | 0 | GREEN | 19/24 | | groups | 20 | 16 | 0 | 4 | 0 | GREEN | 16/20 | | who | 26 | 6 | 0 | 20 | 0 | GREEN | 24/26 | **Wave4b total cases: 226; GNU-gated + win-gated: all GREEN; C++ parity: 206/226.** Parity gaps are the documented surfaces: factor/pathchk/who --help/--version rows carry the GNU-branded text the driver prints (the 1.x dispatcher prints WinuxCmd branding); nohup's strict rows run children GNU resolves on Linux (`true`/`false` have no standalone Windows images, so the Windows sides share rc 127 and stdout-parity drops out); ptx's win rows are the subset-vs-GNU layout deviations above. Deferred / documented for the wiring wave: - nohup terminal faces — must come from a driver-side console probe (REPLACEMENT-RECIPE follow-up); the injected-IO library cannot see them. - factor operand size — rho needs ~sqrt(p) iterations; operands whose smallest prime factor approaches 2^65 (Fermat F7) exceed the gate's 10 s envelope (GNU's optimized MP factors them instantly). - ptx circular-context default grid, -G traditional output format, -S/-W regexp word/sentence delimiting — subset deviations carried from the C++ value model, win/note rows pin them. - shuf infinite -r output without -n — untestable in the bounded harness; the 256-record chunk loop matches GNU/C++ behavior by construction. ## Wave6 (#1488, sixth batch) 9 commands: `md5sum sha1sum sha256sum sha512sum echo rev factor arch groups`. The four digest applets complete the `*sum` family on the wave2 digestsum machinery; md5 (RFC 1321) and sha1 (FIPS 180-1) are new in-tree streaming primitives with every unit vector cross-checked against WSL coreutils 9.4. echo is a port of coreutils src/echo.c's hand-rolled option scan (the POSIXLY_CORRECT allow_options rule is echo.c's exact `argv[1] == "-n"` match, probed); rev ports util-linux rev 2.39.3 (the WSL oracle — `-0` is accepted though undocumented, `-` is not stdin, locale decides byte vs UTF-8 unit reversal through the injected env). factor is exact for 0..=u64::MAX (trial division + deterministic Miller-Rabin + Pollard-Brent rho; probed GNU worst cases match); arch/groups carry the 1.x C++ value model (win rows) with GNU rc-gated grammar rows. | command | cases | strict | exit | win | note | GNU-gated result | C++ parity (rc+stdout) | |---|---|---|---|---|---|---|---| | md5sum | 33 | 31 | 2 | 0 | 0 | GREEN | 31/33 | | sha1sum | 33 | 31 | 2 | 0 | 0 | GREEN | 31/33 | | sha256sum | 33 | 31 | 2 | 0 | 0 | GREEN | 31/33 | | sha512sum | 33 | 31 | 2 | 0 | 0 | GREEN | 31/33 | | echo | 40 | 40 | 0 | 0 | 0 | GREEN | 38/40 | | rev | 25 | 23 | 2 | 0 | 0 | GREEN | 19/25 | | factor | 37 | 32 | 4 | 0 | 1 | GREEN | 32/37 | | arch | 22 | 9 | 9 | 2 | 2 | GREEN | 11/22 | | groups | 22 | 5 | 10 | 6 | 1 | GREEN | 16/22 | **Wave6 total cases: 278; GNU-gated 270 PASS / 0 FAIL, win-gated 8 PASS / 0 FAIL (full 64-command run 2026-11-12: GNU-gated 1676 PASS / 0 FAIL, win-only 153 PASS / 0 FAIL, 1829 cases).** ## Wave6 wiring (#1488, sixth batch wired to the product) 6 commands wired to the rust2 staticlib: `md5sum sha1sum sha256sum sha512sum echo rev`. The digest family keeps the digestsum --check machinery on the ABI v1 whole-buffer stdin entry (the streaming v2 swap the b2sum/sha224sum/sha384sum adoption made stays a later optimization); the stdin shape (no FILE operand, or a `-` operand) is detected by the registration exactly like fold's, and every other shape keeps the pass-nothing contract. rev's stdin shape is the no-operand invocation only (`-` is opened literally, not stdin). Rust component fixes gate b surfaced during the wiring (own commit): - digestsum: `!` marker operands rendezvous through the fs_win #1038 named-pipe bridge (the paste.rs precedent; a plain open read the marker's 7 bytes and stranded the tee writer — mkfifo.md5sum_hashes_writer_bytes pins it). - File operands stay LITERAL (the b2sum_wildcard digest-family pin): the wired product does not glob — the shell does (GNU digest.c / util-linux rev receive shell-expanded operands). The 1.x md5sum and rev bodies glob-expanded, a GNU deviation the port does not carry, so the 1.x-pinned ctests (md5sum.md5sum_wildcard, sha512sum.sha512sum_wildcard, rev.rev_expands_wildcard_file_operands, integration.md5sum_wildcard_pipe_sort) moved to the literal-operand contract in the wiring commits, exactly like b2sum's stream-wave update. Dispatcher-side plumbing retired with the 1.x echo body (echo.c never calls getopt): the rewrite hook that guarded data-looking tokens behind a "--" is gone, echo's --help/--version interception narrowed to the sole-argument rule the library implements (echo.c argc == 2), and the generic parser turned permissive for echo (unknown shorts and every long token pass through as data; the declared -n/-e/-E still parse for occurrence bookkeeping the handler never reads). The -u/--upper and -r/--repeat spellings retire with the C++ body — GNU echo treats them as data, and the rust2 body is GNU-exact. rev got the permissive unknown-shorts policy so `-h`/`-V` reach the util-linux-shaped body. Three gates (build-vs exe vs the pre-wiring baseline exe vs WSL coreutils 9.4 / util-linux 2.39.3, 2026-11-14): - gate a, run-gate.sh tables with RUST_BIN=the wired product: 184 GNU-gated rows GREEN (digest 4x33, echo 40, rev 25 minus the flips below) + 13 win rows GREEN. The dispatcher-intercepted help/version shapes flipped to win in gen-cases.py (the product prints the WinuxCmd-branded metadata text, the suite-wide help surface); rev `-h`/`-V` stayed strict — the permissive-shorts policy classifies them as operands, the body prints the probed util-linux bytes (ledger r=c:no there records the 1.x parse-error deviation). - gate c byte matrix (target/issue-suites/results/wave6-wiring/ matrix.sh, 157 rows over rc+stdout+stderr): 147 byte-equal old vs new; 10 rows move to GNU — 4x digest empty-operand quoting (`md5sum: '': No such file or directory`), 3x echo retired -u/--upper/-r extensions printed as data, 3x rev `-h`/`-V` util-linux text where the 1.x exe answered a C++ parse error (rc 1) / the WinuxCmd version block. GNU rc parity 156/157 (the one miss, `echo -r x`, is the declared-retired -r corner where the 1.x exe returned the same rc 1 — parse still rejects value-carrying -r spellings ahead of the handler). - gate b: full ctest failing set == the pre-wiring baseline set (the 24 environment-bound rows incl. the 4 rust2-stream Not-Run lanes); two ctest updates pin the replaced contracts (echo -u/-r retired extensions; rev locale-model default-C byte reversal). Deferred: the digest family's streaming-stdin swap (the v1 slurp is the documented whole-buffer price). Pre-wave6 wiring predates the product-exe help-row convention: sha224sum/sha384sum/b2sum/tac still carry strict driver-era --help rows in their tables. ## Wave5 (#1488, fifth batch) 10 commands: `tty mkfifo mknod chcon runcon cksum chgrp du date pinky`. Provenance note (2026-11-13): the first session's eight commits (tty, mkfifo, mknod, chcon/runcon, cksum, chgrp, date, du) were orphaned by a branch reset to origin/main and recovered verbatim by cherry-pick; the "wave5 first-session partial" stash was verified against WSL coreutils 9.4 probes (target/issue-suites/results/wave5/gnu-help.txt) and applied on top. The interrupted session had left four unfinished faces, finished in this wave: date/chcon/du help-version bodies moved to the GNU 9.4 oracle verbatim; du gained --files0-from (probed probe-du-f0f*.sh), optional-argument --time (new argopt::extract_optional_long_values — the mkfifo --context pre-scan promoted to the shared parser), and the process-wide already-counted hash with the corrected BY_HANDLE_FILE_INFORMATION layout (the first session read the write time as the file index, so same-tick files collided); chgrp's --preserve-root failsafe now actually fires on '/' and volume roots. pinky is the new port (GNU pinky.c 9.4, no long options — argopt short-only specs), over the who/users WTS session model; `link` is absent from the WinuxCmd inventory and the C++ tree, so there is no three-way anchor for it and it stays out. mkfifo/mknod keep the #1038 `!` marker contract (Rust-created markers carry SYSTEM|ARCHIVE and are bridged by the 1.x file_io layer — cross-checked by driving the C++ readers against a Rust-created marker); gate rows never read a fifo operand. Documented boundaries: chgrp numeric-group mapped-SID no-op (cg21 note — the 1.x applet rejects numeric, GNU accepts), date -s refusal on the Windows sides vs the root WSL oracle accepting it (dt38 note), du directory own-allocation on NTFS (win rows), pinky heading When-width 12 (C++ C-locale face) vs the oracle host's hard-locale width-16 ISO (win rows), SELinux surfaces for chcon/runcon (win rows). Fixtures for time-bearing rows use absolute-epoch `touch -d @seconds`: GNU touch -t reads local time and the 1.x touch UTC, so a -t fixture lands 8h apart across sides (dt39, du25/du26). | command | cases | strict | exit | win | note | GNU-gated result | C++ parity (rc+stdout) | |---|---|---|---|---|---|---|---| | tty | 22 | 22 | 0 | 0 | 0 | GREEN | 18/22 | | mkfifo | 24 | 24 | 0 | 0 | 0 | GREEN | 21/24 | | mknod | 24 | 19 | 0 | 5 | 0 | GREEN | 22/24 | | chcon | 22 | 20 | 0 | 2 | 0 | GREEN | 17/22 | | runcon | 22 | 20 | 0 | 2 | 0 | GREEN | 5/22 | | cksum | 46 | 45 | 1 | 0 | 0 | GREEN | 42/46 | | chgrp | 24 | 21 | 0 | 2 | 1 | GREEN | 17/24 | | du | 43 | 39 | 1 | 3 | 0 | GREEN | 36/43 | | date | 43 | 42 | 0 | 0 | 1 | GREEN | 36/43 | | pinky | 35 | 24 | 1 | 10 | 0 | GREEN | 26/35 | **Wave5 total cases: 305; GNU-gated 281 PASS / 0 FAIL, win-gated 24 PASS / 0 FAIL (final full-wave5 run 2026-11-13, ledger target/gate/ledger.tsv; 82-command coverage 2444 cases).** ## find — GNU findutils 4.9 (#1488 find lane) Oracle: WSL `find (GNU findutils) 4.9.0` (native ext4 scratch, runs as root). Table: `gate/gen-cases.py` `find_rows` -> `gate/cases/find.tsv`. New harness mode **`sorted`**: strict on rc AND stdout, but stdout lines are compared after `LC_ALL=C sort` on both sides — GNU prints readdir order (ext4 hash order), NTFS enumerates in case-insensitive B-tree order, so every multi-entry walk is order-insensitive by construction (the walk itself, pre/post-order, is pinned by single-chain strict rows fd094/fd095/fd099 and unit tests). Junction rows: the GNU side makes a symlink, the Windows sides a directory junction (`New-Item -ItemType Junction`; the gate host has no symlink privilege) — both are `-type l` links. Fixture names avoid `?`, `|` and case-only twins (not representable on NTFS). | command | cases | strict | sorted | exit | win | note | GNU-gated result | C++ parity (rc+stdout) | |---|---|---|---|---|---|---|---|---| | find | 317 | 183 | 119 | 4 | 10 | 1 | GREEN (307/0) | — | **find: GNU-gated 307 PASS / 0 FAIL, win-gated 10 PASS / 0 FAIL (2026-11-14 review round; ledger copy `target/gate/ledger-find.tsv`).** Review round additions (fd350–fd363, +13 rows over the 304 shipped earlier): the dangling-link family — GNU symlink to a missing target vs Windows junction via `cmd /c mklink /J` (PowerShell `New-Item -ItemType Junction` refuses a missing target, measured) — pins the lstat-fallback visits `-H/-L dang`, `-L . -type l`, `%y %Y` = `l N`, and `-delete` on the link itself; plus `-path` matching the start point, `-iname` bracket casefold, `-perm -000`, uppercase-Y `-ok` reply, `-exec {} +` with no matches, multi-root `-quit`, and `-type l,f`. All 13 measured GREEN against WSL GNU 4.9. A 14th probe row (`-fprint /dev/stdout`) was dropped: the gate host's niubash bash rewrites the literal `/dev/stdout` operand to `CONOUT$` in native-child argv (MSYS_NO_PATHCONV ineffective, measured), so the spelling can not be transported by this harness; pin it with a unit test instead. Harness fix shipped with this lane: `run_case` read its arguments with `local args=("$@")`, and the gate host's msys bash 5.3 strips backslashes inside a compound `local` assignment (measured `a\*b` -> `a*b`) — every backslash-bearing argument of every table reached all three sides already rewritten (find's `\n` printf escapes arrived as `n`, `-name '\*'` as `-name '*'`). Now `local -a args; args=("$@")`. The other tables that carry backslash arguments were re-run under the fix (see the per-command line below). ### r=c:no rows (Rust == GNU, the 1.x C++ applet differs) All 53 are rows where the Rust side matches GNU (strict/sorted/exit verdict green) or a `win` row whose stdout is platform-inherent: * help/version/debug surface (fd001-fd006): C++ has no `--help`/ `--version` predicate (dispatcher-only), a branded `-version`, no `-D help`; * option parsing the C++ applet skips or accepts (fd015 `--` ends the leading options, fd030 duplicate `-type` letter, fd039 empty `-user`, fd044/fd045 `%` / `%{` format errors, fd047 two `{}` with `+`, fd071 posix-extended leading `*`, fd144/fd153 posix-basic `a**`, fd336 `-ok ... +`, fd342 zero-length -files0-from name is an error); * path text: C++ normalizes the starting point (`t/` -> `t`, `t//` -> `t`) where GNU keeps it verbatim (fd082, fd084, fd119, fd251), and prints nothing for the `/dev/null` operand (fd347); fd254 is the GNU `%h` one-character-dirname quirk (`a/` -> `a`); * regex dialects: C++ translates emacs syntax to ERE incompletely (`+` literal, `\+` operator, char classes accepted: fd131, fd132, fd135, fd146, fd152) and has no posix-minimal-basic (fd151); * glob classes `[[:digit:]]` (fd120), `-L -type l` (fd167: GNU/Rust report no links when following), `-cnewer` / `-used` / `-perm /a+X` value models (fd202, fd220, fd239), `-newermt '... UTC'` (fd216, C++ cannot parse), `-quit -print` (fd312: C++ prints before quitting), `.` with `-delete` (fd316: GNU never deletes `.`), `-nogroup` (fd291); * printf: `%#m` (fd257), `%5%` and other unknown directives (fd259, fd266), the strftime-style `%Tk` family and `%T+` (fd261, fd262), TZ honored for `%t %a %TH` (fd263, fd265 — C++ uses the system zone), `%Z` (fd293: GNU prints empty + exit 1 with SELinux off); * `win` rows (platform-inherent, rc gated): uid/gid numbers use the shared SID formula of rust2 `id`/`stat` (0x30000+RID) where the C++ find used the bare RID (fd280); file index / allocation / `%S` differ per fixture instance (fd281, fd282, fd285, fd286); `-ls` uses the GNU listfile.c column widths (fd284); `%l` of a junction strips the `\??\` NT prefix (fd287). ### Benchmark (200,000 files + 2,201 dirs; NTFS vs ext4) `rust2-driver` = release `winuxcmd-driver find`, `C++` = release 1.x `winuxcmd find` (`scripts/build-with-vs.ps1 -Configuration Release`), both `hyperfine -N --warmup 2 --runs 7` on the same NTFS tree; `GNU` = WSL find 4.9 on the equivalent ext4 tree (mean of 5). | expression | rust2 | C++ 1.x | GNU (ext4) | |---|---|---|---| | `-name '*.rs'` | 293 ms | 527 ms | 144 ms | | `-type f -size +10k` | 266 ms | 7042 ms | 392 ms | | `-printf '%s %p\n'` | 366 ms | 5017 ms | 451 ms | | `-regex '.*/f0[0-4][0-9]\.rs'` | 916 ms | 5699 ms | 313 ms | | `-regex 'tree/d00.*\.rs'` | 556 ms | 635 ms | 116 ms | The walk enumerates with `FindFirstFileExW(FindExInfoBasic, LARGE_FETCH)` and answers `-type/-size/-mtime/-newer/%s/%t` from the enumeration record (the C++ applet opens every file for size/time); `-regex` splits a leading `.*` into first-byte-filtered suffix attempts (7.77 s before the split). ## sed wiring (#1488, sed lane wired to the product) `sed` moved from the C++ body to `rust2/crates/winux-cmds/src/sed.rs` (the GNU sed 4.9 port with `sed/compile.rs` + `sed/exec.rs`) with the mechanical-replacement recipe: the handler is one `winux::rust2::run_command_with_stdin_streaming("sed", ctx.raw_args)` call (ABI v2: the pull callback stays lazy, so file-operand invocations never touch fd 0), `src/commands/sed.cpp` keeps only `REGISTER_COMMAND` metadata, and `WINUXCMD_RUST2_COMMANDS` carries `sed`. Argument language: `option_policy_for_command("sed")` sets the new `OptionParsePolicy::all_args_are_positionals`, so the generic parser, dispatcher abbreviation pass and the `--help`/`--version` interceptors all stand down: sed.c's own getopt_long run (in the library) owns `-e`/`-f` order, `-i[SUF]`, `--posix`, unknown/ambiguous long options and `-e` with no argument. Consequence: `sed --help` / `sed --version` print the GNU sed 4.9 blocks (not the WinuxCmd metadata/banner); the argv[0] is `sed` through the multicall entry, matching the GNU program name. Gate (2026-11-14, `RUST_BIN=build-vs/winuxcmd.exe`, `CPP_BIN=<09df368d baseline copy>`, WSL sed 4.9): **379 rows — GNU-gated 378 PASS / 0 FAIL, win 1 PASS / 0 FAIL** (`sd055-help` stays strict because the library prints the GNU usage block). Byte-equality matrix (`gate/wire/sed-matrix.sh`, 28 groups: read/print, `-n`, address ranges, hold space, `-e` multi-script, `-f`, `-i`/`-i.bak`, `-s`, `-z`, `-E`, `-l`, `N`, `y`, `b`, `w /dev/stdout`, `r`, `-u`, `--posix`, stdin shapes, `--`): * GNU vs wired exe: **28/28 rows equal in rc + stdout + stderr + file-tree hash**. * pre-wiring exe vs wired exe: **27/28**; the one difference is `s///w /dev/stdout`, where the 1.x body lost the `w` copy (GNU and the wired exe both emit it). Rust-side fixes carried by the wiring (GNU parity found by the C++ unit suite): `q`/`Q` status masked to 8 bits (`2q300` -> 44), and `fsutil::resolve` now routes literal trailing-dot/space components through the `\\?\` spelling (#1282/#1332) for every wired command that shares the resolver. ctest (isolated sed slice, `ctest -R "^sed\.|^integration\.sed_"`, 144 tests): baseline failing set and wired failing set are the same single pre-existing case, `sed.nul_txt_reads_file_issue1333` (the TempDir helper cannot create the `NUL.txt` on-disk name). The other 18 former failures either pinned 1.x deviations the GNU port removes (wildcard expansion, `r`/`R` missing-file diagnostics, `--debug` annotation, `s///e` execution, sandbox/POSIX error wording, `w`-failure status 2 -> 4) or were test-side math on the `-z` text terminators; all were re-pinned to the WSL sed 4.9 behaviour. ## xargs (#1488, GNU findutils 4.9 port) `xargs` lands as a library-form port of findutils 4.9.0 `xargs.c` / `buildcmd.c` (`crates/winux-cmds/src/xargs.rs`), gated against WSL `xargs (GNU findutils) 4.9.0` (C.UTF-8). It reuses the shared `childproc.rs` resolver/spawner chain (PATH-only execvp shape, PATHEXT, `.cmd`/`.bat` through COMSPEC, `#!` scripts through their interpreter) — no childproc changes were needed. Input is read lazily (a 16 KiB getc buffer; `-n`/`-L` batches exec as soon as they are full), the default command (no COMMAND) runs the library `echo` in-process through `io.stdout`, and the Windows command-line budget (32767 UTF-16 units, 8191 for the cmd.exe route) splits batches independently of the GNU `-s` byte accounting. The C++ side of this run was the `wc-pa1/build-vs` Debug dispatcher (`CPP_BIN=`), which carries the 1.x xargs applet unchanged. | command | cases | strict | exit | win | note | GNU-gated result | C++ parity (rc+stdout) | |---|---|---|---|---|---|---|---| | xargs | 141 | 134 | 5 | 2 | 0 | GREEN | 115/141 | **xargs: GNU-gated 139 PASS / 0 FAIL, win-gated 2 PASS / 0 FAIL (`bash gate/run-gate.sh xargs`, 2026-11-14).** Three strict rows compare rc 127 on both sides on purpose (xa66, xa108, xa111 — the command under test is xargs, which runs and reports "xargs: CMD: No such file or directory"; the Rust stderr was checked, these are not dispatch misses). Child-command convention (as timeout/nohup): the default command, `echo` and `printf` (WinuxCmd images on the Windows PATH, coreutils on WSL) and `sh -c` (niubash sh / dash) for exit statuses. Multi-line inputs come from setup files read with `-a`. `-p` rows are limited to paths that never prompt: the harness gives the GNU side a controlling tty, so a real prompt would block both sides; prompting is covered by unit tests with a scripted tty. Non-strict rows: - xa115-xa117 (`exit`): `-P` runs; output order is scheduling-dependent on both platforms, rc gated. - xa140/xa141 (`exit`): 40000 items; GNU fills 128 KiB per command, Windows 30719 bytes (the CreateProcess-derived maximum), so the batch COUNT differs (8 vs 2 lines) while every item runs once (verified: 40000 tokens on the Rust side). - xa137 (`win`): `sh -c 'kill -9 $$'` — GNU 125 "terminated by signal 9"; an MSYS self-kill ends with a plain exit code on Windows (no signals), so Rust and C++ both report a failed child (123). - xa139 (`win`): a text file with no launch format — glibc execvp retries it through /bin/sh (GNU 123 from the shell), the Windows chain reports 126 "Exec format error" (childproc.rs documented boundary), equal to the C++ applet. `r=c:no` rows (26; every one is the 1.x C++ applet diverging from GNU — the Rust side matches GNU byte-for-byte on all of them): | rows | 1.x C++ behavior (GNU in parentheses) | |---|---| | xa07, xa08, xa09 | slurps and parses all input before running anything, so an unmatched quote prints nothing (GNU runs the batch gathered so far: `a`) | | xa15 | errors on a lone quote at EOF (GNU drops it silently, rc 0) | | xa16 | passes a NUL byte through into the argument (GNU warns and truncates at the NUL) | | xa18 | keeps leading `\f\v\r` in the first item (GNU skips leading isspace) | | xa31, xa36 | checks the EOF string against whole lines only (GNU checks every item, quotes removed) | | xa46 | `-d '\x'` is not NUL (GNU strtoul of an empty hex run = 0) | | xa54 | ignores -L under -d (GNU counts each delimiter as a line) | | xa64 | `-I{}` with no command echoes the item (GNU runs `echo` with no args: empty lines) | | xa65 | `-I ''` substitutes nothing and runs (GNU: "command too long", rc 1) | | xa69, xa75 | splits instead of failing under -x / the -x implied by -L (GNU: "argument list too long", rc 1) | | xa73 | `-s0` runs (GNU clamps to 1, then "cannot fit single argument", rc 1) | | xa84, xa85 | rejects `+1` and saturating values for -n (GNU strtol accepts both) | | xa88 | accepts `-P 99999999999` (GNU: should be <= 2147483647, rc 1) | | xa96, xa97, xa98 | WinuxCmd-branded --help/--version text (GNU findutils text) | | xa123 | `-a -` opens a file named `-` (GNU reads stdin) | | xa124 | `-a DIR` fails "Is a directory" (GNU reads it as empty input, rc 0) | | xa138 | a `#!/bin/sh` script child is 126 (GNU and the shared childproc chain run it through its interpreter) | | xa140, xa141 | 40000-item input exceeds the 10 s harness timeout (rc 124) | Documented gaps (module doc of xargs.rs): no SIGUSR1/SIGUSR2 -P resizing (no Windows signal to listen to); `--show-limits` omits GNU's "Execution of xargs will continue now..." notice (it needs isatty(stdin), and the library never touches process stdio); `-p`/`-o` open `CONIN$` unconditionally like GNU opens /dev/tty (an unattended console blocks like an unattended pty); `-o` without a console prints GNU's child diagnostic and counts as a failed child (GNU 4.9 also trips an assertion in the forked child, signal 6); NTSTATUS-shaped child exit codes map to the POSIX signal of the same class for the 125 diagnostic; a spawned child writing into a closed pipe exits with a plain failure code on Windows (no SIGPIPE), so only the in-process default echo reproduces GNU's 125 stop; arguments reach `cmd /c` children with std's Win32 quoting (the 1.x applet's caret escaping of `cmd /C` tails is not reproduced); non-UTF-8 input bytes reach children through lossy conversion (CreateProcessW is UTF-16). Evidence: probe scripts and transcripts `rust2/target/probes/xargs/p1.sh`..`p8.sh`, ledger `rust2/target/gate/ledger.tsv`, run log `rust2/target/gate-xargs.log` (gitignored artifacts). ## grep wiring — split-engine wire: rust2 face + retained C++ PCRE2 face (#1488, 2026-11-14) `grep` / `egrep` / `fgrep` are wired to the product as a split-engine replacement (PR #1631's rust2 grep library is the non-Perl face; the retained C++ body is the PCRE2 face). The split point lives at dispatch, before either body runs: the C++ handlers call `winux::rust2::grep_uses_perl(ctx.raw_args)` — the rust2 library's getopt-shaped routing query, exported through the additive FFI `winuxcmd_grep_uses_perl` (grep/mod.rs `uses_perl_with`; POSIXLY_CORRECT presence passed by the bridge from the process env, the same source the run entries snapshot into the injected env). `grep -P`/`--perl-regexp` shapes keep the C++ face (DOCS/2.0-regex-engine-decision.md §6 owner point 2); every other shape is the mechanical replacement: `run_command_with_stdin_streaming` — grep is a genuinely-streaming stdin reader (REPLACEMENT-RECIPE.md §5), so `-q`/`-m` early stops no longer drain a pipeline producer. `egrep`/`fgrep` route UNCONDITIONALLY to the library: upstream grep 3.11 ships them as `exec grep -E/-F "$@"` wrappers, so `egrep -P` is `grep -E -P` — a fatal "conflicting matchers specified", never Perl; the 1.x body ran Perl there (gate row eg02: r=g:yes rc 2 after the wire, r=c:no — the 1.x divergence retires). egrep_cmd/fgrep_cmd add the obsolescent-warning stderr line (upstream script semantics; stdout/status unaffected). The replaced C++ machinery (~720 lines) is deleted in the same change: the -F FixedMatcher Aho-Corasick family, the ERE literal/class fast paths, the fixed scan fast path and the BRE/ERE compile branches — everything the -P face cannot reach (a -F/-E/-G co-occurrence is a matcher conflict build_config rejects before compiling). The retained body keeps the full scan/print/color/walk/binary pipeline plus the Perl matcher. grep.cpp stays in the build with rust2 ON (three REGISTER_COMMANDs, branded help/man surface); CMakeLists adds `grep` to WINUXCMD_RUST2_COMMANDS (one set() line; the OFF filter drops all three applets with the shared source — no dual track). Rust/bridge fixes the wiring surfaced (each GNU-probed): - grep/scan.rs prtext: the leading-context walk lost grep.c:1612's `beg > bufbeg` bound — a saturating `-B`/`-C` (context_length_arg clamps to INTMAX_MAX, grep.c:826) counted an empty loop 9.2e18 times where gcc dead-loop elimination makes GNU instant. Bounded like the sibling fillbuf-side loop; pinned by grep.saturating_before_context_terminates. - rust2_bridge drain_result: the closed-fd-1 write-error status is per-command — grep/egrep/fgrep keep GNU's EXIT_TROUBLE 2 (probed: `grep x a.txt b.txt >&-` → rc 2 + "grep: write error: Bad file descriptor"), the generic drain stays 1 (#1368 family). Case-table changes from the wired product surface: gp121-help/gp122- version/gp123-V/eg05-help/eg06-version/fg04-help/fg05-version demoted strict -> win — the dispatcher's branded `--help`/`--version` interception runs before the handler and is byte-identical old vs new (the hn19/nproc np10 precedent). Three gates (build-vs wired exe as RUST_BIN, the pre-wiring wc-grep2 build as CPP_BIN, WSL GNU grep 3.11 oracle, 2026-11-14): - gate a: run-gate.sh grep/egrep/fgrep with the wired product — GNU-gated 155 PASS / 0 FAIL + win 7 PASS / 0 FAIL (162 ledger rows; pre-wire driver run was 162/0 with 13 r=c:no rows). r=c:no rows shrink 13 -> 8 and every one is carried from the review ledger: 5 rows where the 1.x exe deviated from GNU and the wire aligns (gp40 -x-empty, gp98 --color-bogus, gp99 -d-bogus, gp131 -o with -A1, gp134 -c -Z multifile) + the 3 wrapper matcher-conflict rows (eg02/eg04/fg02, same class as eg05 above). No new r=c:no rows. - gate c: rust2/gate/wire/cmd-matrix.sh grep-family tables added (60 cases x grep/egrep/fgrep, rc+stdout+stderr hashes, old vs new exe). grep: rc 60/60, stdout 54/60, stderr 59/60. Every diff classified with WSL probes: 6 recursion rows move to readdir/enumeration order (the rust2 walk visits directories in directory order, like fts; the 1.x explicit stack processed them LIFO — GNU itself is readdir order, gate rows were order-insensitive), and 1 stderr row moves to GNU (`grep x ''` on an empty operand: GNU "No such file or directory", the rust2 walk reports "Is a directory" — walk.rs operand classification of "" resolves to the cwd; a rust2 walk lane item, recorded here, not a wire regression). egrep/fgrep: rc 58/60 and 57/60 (the -E/-F+P/-G/-F conflict rows align with GNU, r=c:no as above), stdout diffs are the recursion order + conflict rows, stderr diffs are the obsolescent warning (upstream wrapper semantics). Harness note: cmd-matrix.sh sha224sum block had lost its `;;` (the digest stream wave) — repaired while adding the grep tables. - gate b: grep/egrep/fgrep ctest filter (154 tests, --timeout 90): wired failing set == pre-wiring baseline failing set (grep.nul_txt_reads_file_issue1333, environment-bound, fails on the unmodified rust2/grep-impl build too). Ten ctest pins moved to the replaced GNU contracts in the wiring change (the e7ddc432 style): 6 operand-glob pins (grep_wildcard_files, grep_wildcard_char_class_in_parent_directory_segment, grep_char_class_prefers_glob_over_same_spelling_literal_path, grep_recursive_wildcard_directory_operands_recurse, grep_wildcard_pattern, integration.grep_char_class_range, grep_exclude_from_file, grep_repeated_exclude_from_files_all_apply — operands stay literal, the shell globs; each asserted against the probed ENOENT + rc 2) and 2 Windows text-encoding pins (grep_strips_utf8_bom, grep_decodes_utf16le_input — GNU reads bytes; probed rc 1 silent). Two product fixes ride the same change (scan.rs bound, bridge write-error status), each with its own probe above. - `-P` face: 10/10 smoke cases byte-equal old vs new (PCRE2 backreference `(\d+)-\1`, `(a+)b+\1`, `-o`, `-c`, `-n`, `-v`, `-inP` cluster, invalid-class error) — both sides run the retained C++ body byte-for-byte (target/wire-i18n/psmoke/). I18N: extraction (scripts/i18n_batch.py extract) is byte-identical before/after the wire (3598 keys; the deleted C++ machinery carried no extracted literals — its prints were variable-argument; registrations stay). The branch's only drift-gate growth vs the published catalogs (zh-CN missing command.echo.option.repeat) predates this work: the catalog dropped the key with WinuxCmd#1621 while this branch still carries the pre-#1624 echo registration — it resolves when the branch merges current main. The tr!/i18n::text seam for grep's walk/regerror/ binary messages is NOT added here: this branch's base (68d2917c) has no Rust i18n runtime (no tr! macro, no catalog plumbing in winux-core, no Rust recognition in the extractor) — that infra belongs to the unmerged stream-abi lane; Rust output drains through the bridge's raw writers without catalog lookup. Recorded as a dependency, not skipped. --- ## wave-W2 wire — `cut`, `tr`, `od`, `sum` (#1488, worktree `D:/repo/wc-w2`) Four text-surface applets replaced by their rust2 library bodies; the 1.x record/expansion/format pipelines are deleted, `REGISTER_COMMAND` keeps the help/man metadata, and each handler is one ABI v2 **streaming** call (`run_command_with_stdin_streaming`) so fd 0 stays untouched for file-operand shapes and stdin arrives in segments. ### Library work the wire required (probed against WSL coreutils 9.4) `cut` - the LIST selector: a second list in ANY combination (`-b 1 -c 1`, `-f 1 -f 2`) is "only one list may be specified"; an empty LIST element (`1,,2`, `,2`, `''`) is GNU's numbered-from-1 fatal. - `--output-delimiter` is legal in byte/character mode and marks each range start (`cut -b 1-2,3 --output-delimiter='|'` -> `ab|c`); set-fields merges only OVERLAPPING ranges, so adjacent specs stay separate. - `--output-delimiter=` means NUL. - the `-z -d ''` shape (field delimiter == record delimiter) implements cut.c `cut_fields` (#1511): the input is one record, a trailing delimiter terminates it, `-s` suppresses undelimited input. `tr` - `-A` is GNU's undocumented no-op (was rejected by the library). - reverse ranges print `range-endpoints of 'z-a' are in reverse collating sequence order` with tr.c `make_printable_char` endpoints (`'\200-@'`). - an escaped range endpoint forms a range (`\200-\100`). - unquote warnings restored: `an unescaped backslash at end of string is not portable`, and the ambiguous-octal note (`\400` -> `\040` + `0`, third digit NOT consumed). - `[=c=]` in string2 while translating is the tr.c validate() fatal. `od` - `-j/-N` print addresses in the combined-input coordinate space (the library printed 0-based). - `-S/--strings` (bare `--strings` = 3, `-S` requires a value, `-N` bound, spelling-carrying diagnostics) and the old-style operand form `[FILE] [[+]OFFSET[.] [b]] [[+]LABEL]` with the parenthesised pseudo-address column and the `-A n` bare-paren address. - obsolescent `CASE_OLD_ARG` letters `D e F H I L O B h X` plus clusters (`-bc`, `-D -e -H -O`); multi-spec fields use od.c's width_per_block/pad distribution, and the `z` trailer belongs to the spec it is spelled on. - a dump with NO openable operand prints nothing (od.c main() skips dump()). - `-S` with a type is the "no type may be specified" fatal. `sum` - the LAST of `-r/-s` wins in any spelling (`-sr` = BSD, `-rs` = SysV) — the library used mere presence. - operand opens route through the #1038 `!` marker bridge (fsutil::open_read_operand; cut/od/sum), so `mkfifo` rendezvous rows read the payload, not the marker. ### Gates - **gate a (GNU oracle, RUST_BIN = wired `build-vs/winuxcmd.exe`)** `bash gate/run-gate.sh cut tr od sum`: **170/170 GNU rows PASS, 8/8 win** (the 8 = the four `--help`/`--version` rows, `win` because the dispatcher keeps the WinuxCmd-branded interception). Tables grew from 33+37+36+20 to 48+46+56+28 rows (cut ct34-48, tr tr38-46, od od37-56, sum sm21-28), every row GNU-probed first. Oracle: Ubuntu 24.04.4 LTS / coreutils 9.4 / C.UTF-8. - **gate b (ctest, full run, `--timeout 200 -j8`)**: failing set identical to the pre-wire baseline (26 = 22 pre-existing + 4 `rust2-stream-*` "Not Run" that the default target does not build). The one test the wire invalidates was re-pinned to the GNU/ABI contract: `cut.cut_streams_yes_through_head_exits_early_on_closed_pipe` -> `cut.cut_pipeline_drains_bounded_stream_after_consumer_closes` (see the ABI note below); `od.od_width` re-pinned to GNU's attached `-w4` plus a new separated-`-w 4` pin; three `tr` quote/wording pins moved to GNU 9.4's curly-quoted text. - **gate c (old vs new exe, `wire/cmd-matrix.sh` + `compare.sh`, 30/30/33/30 rows)**: cut 30/30 rc + 30/30 stdout (2 stderr diffs = GNU alignment: curly-quoted list diagnostics, the two-line `-s` refusal); tr 30/30/30; sum 30/30/30; od 29/33 rc (the 4 rc diffs are 1.x deviations now GNU-aligned: `-j` past end, `of 2`/`--traditional 2 of` old-style operands) and 29/33 stdout (same rows). New-vs-GNU rc on the same matrices: cut 30/30, od 33/33. - **differential corpus** (`WINUXCMD_BIN=build-vs/usr/bin runner.sh`): cut 6/6, tr 7/7, sum 1/1, od 4/5 + 1 pre-existing `KNOWN_DIFF` (`corpus/od/01-invalid-utf8-operand`, whitelisted). ### ABI note (streaming stdin, buffered stdout) All four use the v2 streaming **input** entry. Output stays the ABI's buffered `CBuf` drained after the call (REPLACEMENT-RECIPE §5 "Output side"), so an INFINITE producer cannot observe a consumer's close: that is the same trade #1376 accepted for `seq`. cut's `yes | cut | head` test is re-pinned to a bounded producer past the 64 KiB flush scale; the early-exit termination returns with a streaming-write callback. ### I18N 48 new stable keys (`command.cut.error.*` 16, `command.od.error.*` 19, `command.tr.error/warn.*` 11, `command.sum.error.*` 2) with GNU's `error()` wording as the English fallback (curly quotes where GNU quotes). `scripts/i18n_batch.py extract` -> 3835 keys; the retired C++ bodies drop 9 `legacy.*` digests (plus pre-existing catalog drift from other lanes). `command.tr.error.invalid_repeat_count` keeps its C++ key with the corrected curly spelling (annotation added to `scripts/i18n_rust.py`). `validate` passes against the merged zh-CN file; the patch + delta live in `catalog/` (`zh-CN-w2-patch.json`, `w2-delta.json`, `w2-new-keys.txt`) and the shared I18N repository needs its `VERSION` bump (0.6.42 -> 0.6.43). ## Wave-W4 wiring — mkfifo / mknod, the device/FIFO family (#1488, 2026-11-14) Both applets are wired to the rust2 staticlib (`src/commands/.cpp` is the `REGISTER_COMMAND` shell + one `winux::rust2::run_command` call; the C++ mode evaluator, `--context` pre-scan, MAJOR/MINOR parse, quotef helper and `create_winux_fifo_w` pipeline are deleted). CMake union gained `mkfifo;mknod`. Oracle: WSL coreutils 9.4, probed from a script file (`rust2/target/probe/w4-mkfifo-mknod.sh`, 685 lines of rc/stdout/stderr+ on-disk node type). The GNU side runs as root on ext4 and creates REAL fifos and device nodes (`stat` rdev=1:3 et al.); the Windows sides create the #1038 `!` marker or report EPERM for device types — that is why the device rows are `win`, never `strict`. | command | cases | strict | exit | win | note | GNU-gated result | C++ parity (rc+stdout) | |---|---|---|---|---|---|---|---| | mkfifo | 33 | 31 | 0 | 2 | 0 | GREEN (59 GNU-gated rows both tables) | 32/33 | | mknod | 38 | 28 | 0 | 10 | 0 | GREEN | 37/38 | Table growth (24 -> 33/38) is all probed: empty NAME (ENOENT, not "the cwd"), `--context=` (empty PRESENT optarg warns) vs bare `--context` (silent), getopt_long abbreviation `--con=`/`--c`, `-m` last-wins, `--mode=`, combined symbolic mode, empty `-m` value, empty MAJOR/MINOR (`invalid ... ''`), `+1`/`0x1`/`0o` device numbers, exists-directory, TYPE-first-character (`pz`/`pp` fifo, `bz` block) and the operand-count before TYPE-validation order. `mf20/mf21`/`mn20/mn21` are `win` because the wired product answers sole `--help`/`--version` with the WinuxCmd-branded dispatcher surface (wave6 convention); the GNU help bodies stay pinned by the rust2 unit test `help_version_surface`. **Gate a** (`RUST_BIN=build-vs/winuxcmd.exe`, CPP_BIN=pre-wire exe): 59 GNU-gated rows PASS / 0 FAIL, 12 win rows PASS. Ledger `r=c:no`: one row, `mf17-Z-attached-invalid` (1.x accepted `-Zctx2` silently rc 0; GNU and the wired body answer `invalid option -- 'c'` rc 1) — the inherited 1.x deviation the wire fixes. **Gate c** (old exe vs new exe, rc+stdout+stderr; `gate/wire/cmd-matrix.sh` blocks added for both commands): mkfifo 33 rows — rc 32/33, stdout 33/33, stderr 31/33; mknod 36 rows — rc 36/36, stdout 36/36, stderr 26/36. Every delta is the new side moving to GNU, none regress: * mkfifo `--context=` — 1.x silent, GNU/new warn (and still create). * mkfifo `-Zctx2` — 1.x rc 0 silent, GNU/new `invalid option -- 'c'` rc 1. * mkfifo `-m 1777`/`4755`/bogus and empty NAME — byte-equal already. * mknod `nodir/x p`, device types `c/b/u/0x/0o`/`bz` — 1.x wrapped the name in quotes unconditionally; GNU quotef leaves plain names unquoted (`mknod: w4c1: Operation not permitted`); new matches GNU's shape. * mknod empty MAJOR/MINOR — 1.x `missing major device number`; GNU/new `invalid major device number ''` (xstrtoumax on "" fails, it is not a missing operand). * mknod two-operand bogus TYPE (`mknod w4t2 x`) — 1.x validated the type first (`invalid device type 'x'`); GNU checks the operand count first (`missing operand after 'x'` + special-files note); new matches GNU. The same check order means TYPE is classified by its FIRST character (`pz`/`pp` are fifos, `bz`/`cx`/`uz` special files) — the wave5 Rust port's exact-match was a regression against both GNU and the 1.x body, fixed in this wire. * The matrix GNU side runs on DrvFs (device rows answer ENOTSUP there); GNU's root-creation semantics come from the ext4 run-gate oracle, which is why those rows are win. **Gate b**: full ctest failing set is IDENTICAL to the pre-wire baseline (26 = 22 Failed + 4 rust2-stream Not Run); the 35 C++ mkfifo/mknod unit tests pass (23 mkfifo + 12 mknod), including the #1038 bridge family (`md5sum_hashes_writer_bytes`, `reader_without_writer_blocks_like_gnu`, `wc_c_counts_bridged_bytes_not_marker_size`, `paste_joins_two_fifos`, `od_reads_fifo_payload_not_marker_bytes`, `hexdump_dumps_fifo_payload`) and the #1235 drive-dialect rows. One ctest was **re-pinned** to the GNU contract: `mknod.mknod_invalid_type_fails` used the two-operand shape (`mknod node1 x`), where GNU reports "missing operand after 'x'" first; it now uses NAME TYPE MAJOR MINOR, and `mknod_bogus_type_two_operands_is_missing_operand` + `mknod_type_trailing_characters_are_ignored` pin the probed order and first-character rule. Differential runner: mkfifo 3/3 PASS, mknod 2/2 PASS. **#1038 bridge status (honest).** The marker format is unchanged and byte/attr-compatible. The bridge exists in TWO places: the C++ `file_io` layer (all 1.x applets) and `rust2/crates/winux-cmds/src/fs_win.rs` (`open_fifo_read`/`open_fifo_write`, the wired commands that open operand files: digestsum, paste, tee, stat, find). Cross-side rendezvous was measured in all four directions (`bash gate/wire/fifo-bridge-check.sh`, 4/4 PASS with `CPP_BIN` = the pre-wire exe; 4/4 PASS again with both sides on the local build-vs tree): Rust-created marker -> C++ reader/writer, C++-created marker -> Rust md5sum reader + Rust tee writer, Rust/Rust, C++ reader + Rust writer. Remaining gap, explicit: there is no transparent interception below the command layer, so any NEW wired command that opens operand files must call the fs_win helpers (a plain `std::fs` open reads the 7 marker bytes and strands the writer); non-WinuxCmd tools always see a 7-byte marker file, not a pipe. mkfifo/mknod themselves only create. **I18N**: 15 new stable keys (mkfifo 4, mknod 11: `error.*` + `warning.*`), 12 orphan `legacy.` keys from the deleted C++ bodies; patch in `catalog/w4-mkfifo-mknod-*.json`, `i18n_batch.py validate` = `valid` (placeholders equal, option tokens untouched). Registration description/option/synopsis keys are unchanged. Builds: default and full editions build clean (see the wiring report). ## wave-W3 — wiring wave: du, mktemp, nice (#1488 wire-W3, 2026-11-14) Lane scope: `date du mktemp nice nohup`. **Wired in this wave: `du`, `mktemp`, `nice`.** `date` and `nohup` stop at the recipe's precondition (see "Blocked" below) — wiring them now would regress 1.x behavior, so the C++ bodies stay in place for those two. ### Wired commands | command | cases | strict | exit | win | note | GNU-gated result | old-vs-new matrix | |---|---|---|---|---|---|---|---| | du | 52 | 43 | 3 | 6 | 0 | GREEN (38 GNU-gated + 5 win PASS, 0 FAIL; 9 symlink rows SKIP) | 52 rows: rc 52/52, stdout 47/52, stderr 51/52 | | mktemp | 27 | 12 | 13 | 2 | 0 | GREEN (25 GNU-gated + 2 win PASS, 0 FAIL) | 28 rows: rc 27/28, stdout 27/28, stderr 27/28 | | nice | 21 | 12 | 7 | 2 | 0 | GREEN (19 GNU-gated + 2 win PASS, 0 FAIL) | 26 rows: 26/26/26 | Gate a (RUST_BIN = wired `build-vs/winuxcmd.exe`, CPP_BIN = pre-wiring baseline exe, artifact dir `target/gate-wired`): 82 GNU-gated PASS / 0 FAIL, 9 win PASS / 0 FAIL, 6 skipped — the new `-L/-H` symlink rows (du41–du46, plus the #1670 rows du47–du49) need `SeCreateSymbolicLinkPrivilege`, which this host lacks (`ln -s` EPERM; the `find` lane made the same measurement in reverse). They stay in the table for CI runners that have Developer Mode. Their behavior is covered locally by `du`'s Rust unit tests plus a hand-run junction probe (`cmd /c mklink /J` needs no privilege): old and new agree on `-L/-H` over a live junction (4\tjunc, 4\tjunc/inner.txt with `-a`) and on the dangling case (`du: cannot access 'dangle'`, rc 1). Case-table changes: `mk26/mk27`, `nc19/nc20`, `du28/du29` (--help/--version) flipped `strict`→`win` for the product-exe help-row convention (the wired exe answers with the WinuxCmd-branded registration text; same precedent as the wave6 `hn19/hn20` flip). du gained du41–du46 (see above). No row was deleted. ### Library fixes the wiring surfaced (du.rs / mktemp.rs, own commit) These were latent Rust-port bugs that the product path would have exposed; each is pinned by an existing ctest that the wired exe now runs: - `du -L ` printed ONE row: the child-directory test negated the dereference clause, so every real subdirectory was treated as a file under `-L`. `-H` likewise never descended into a command-line link. - `du --time` printed the directory's own stamp instead of the subtree's latest; `--time=access/status` (and their GNU words use/ctime) were rejected; `--block-size=human-readable` / `=si` were not recognized. - The size options were applied in a fixed order instead of GNU's sequential state, so `-h -B1` stayed human-readable and `-B1 -m` kept bytes. argopt gained an argv-ordered `events` list (`OptEvent`) for this and future state-machine options. - Bare-suffix block sizes printed no unit (`-BM` gave "2", GNU prints "2M"), and the invalid-value diagnostic always said `--block-size` even for `-B`. - `human_size` always printed one decimal ("19.6k"); GNU prints an integer once the value reaches 10 units ("20k"). - `-a -d0` still printed child files. - Hardlink dedupe ran only in allocated-size mode, so `--apparent-size` double-counted links; `--inodes` now dedupes too. - Operand display: a POSIX drive spelling (`/c/...`) printed as the POSIX text instead of the resolved native path (#1174/#1364 contract), and `src//` printed `src///bin`. - `mktemp /x.XXXXXX` printed a bare name (the join tested the stripped component), `--suffix` on a template whose X-run sits before a suffix appended `XXXXXX` instead of replacing the run, and the default directory printed the environment's backslashes ("C:\...\Temp/tmp.x") where the product prints forward slashes. ### Old-vs-new matrix classifications (gate c) Harness: `gate/wire/cmd-matrix.sh` + `compare.sh`, ledgers kept in `target/wire-w3/`. `mktemp`'s random X-run is normalized in the ledger hash only (`normalize_out`; raw `.out` bytes are the evidence) — the recipe's "mktemp gates on exit status only" rule, extended to the path SHAPE. | row | diff | verdict | |---|---|---| | du 25 `--time` | old 08:00, new 00:00 under TZ=UTC | Rust matches GNU; 1.x `--time` used FileTimeToLocalFileTime and ignored TZ | | du 33 `-lb d d` | old printed the tree once | Rust matches GNU (probed: `-l` re-counts and re-prints repeated operands) | | du 36 `--block-size=bogus` | stderr wording | Rust matches GNU ("--block-size"); 1.x always said "-B" | | du 44 `-b ` | old descended, new prints the link row | platform value model: a junction without -L is a link entry (GNU counts the link, never the target) | | mktemp 23 `--tmpdir q.XXXXXX` | old treated the template as --tmpdir's DIR (rc 1) | Rust matches GNU: bare --tmpdir is an optional argument | | du 51 `-L -l -s dujunc dud` | old printed one row | Rust matches GNU: `-l` bypasses the visited dedupe (#1670 / PR #1730) | | du 52 `-P -s dujunc dud` | old walked the junction as the directory and printed one row | Rust matches GNU: `-P` counts the link entry and the real directory separately (#1670) | All other rows are byte-identical (rc + stdout + normalized stdout + stderr). ### Gate b `ctest` (excluding the host-hanging `lsof.*` family, see below) failing set == the pre-wiring baseline set; the du/mktemp/nice families specifically are 7/7 identical (the pre-existing `du.issue_1288...`, `mktemp.mktemp_dash_p_bare_slash...`, two `nice.nice_huge_*` and three `nohup.nohup_*` rows). Validation: `build-vs/tests/winuxcmd-tests.exe --gtest_filter='du.*:mktemp.*:nice.*:nohup.*'` → 119 tests, 112 passed, 7 failed = the baseline 7. After the #1670 port the du family is fully green: `--gtest_filter='du.*'` → **71 passed / 0 failed** (the pre-existing `du.issue_1288_same_deep_directory_two_spellings_counted_once` is fixed by the lexical/identity visited set). ### I18N 26 new stable keys — `command.du.error.*` (10) plus `command.du.warning.inodes_with_apparent`, `command.mktemp.error.*` (10) and `command.nice.error.*` (6); the English fallbacks are the byte-identical pre-wiring strings, so the wired output did not move. `scripts/i18n_batch.py extract` (3783 keys) / `validate` pass. Catalog patch, new-key list, removed-key list and delta live under `catalog/` (`zh-CN-w3-patch.json`, `w3-new-keys.txt`, `w3-removed-keys.json`, `w3-delta.json`); the shared `unixwin/winuxcmd-i18n` repository was not touched by this lane. ### #1670 on the Rust du (same-wave follow-up, PR #1730 parity) The C++ `du.cpp` fix merged as PR #1730 (`3b2d6e6a`) after this lane started; wiring `du` to rust2 would have bypassed it, so the same semantics were ported into `du.rs`: - **Directory identity dedup.** The visited set is keyed by the FOLLOWED target's `(volume serial, file index)` under `-L`/`-H` (`followed_dir_key`) and by the lexical spelling otherwise (`lexical_dir_key`: `.`/`..` folded, separators normalized, case folded, and no filesystem resolution so a link spelling never collapses onto its target). The key is registered before descending for tree children (Savannah #10397) and before walking an operand; a repeated key is skipped entirely, so the row prints once under the spelling that arrived first. - **DrvFs LX links.** `CreateFileW` cannot open them, so `followed_dir_key` falls back to `read_lx_symlink_target` + `resolve_symlink_target` and reads the identity of the resolved target. The operand's directory classification also follows the resolved `walk_path` (a live LX directory link is a directory, not a zero-size file), matching #1730's `attrs_path` change. - **`-P` keeps link and directory distinct.** An unfollowed link entry is hashed by the LINK's own identity via the new `imp::link_handle` (FILE_FLAG_OPEN_REPARSE_POINT), never by the target's; the operand classification marks such an operand as a link entry so it is counted, not walked. - **`-l` bypasses both sets**, exactly GNU's `! opt_count_all` guard (du.c:546-549). Evidence: 1. **Rust unit tests (4 new, in `du::files0_from_tests`)**: LX link created with `FSCTL_SET_REPARSE_POINT` (tag 0xA000001D, version 2 — the object `ln -s` writes on a Windows volume; no SeCreateSymbolicLinkPrivilege needed) and a junction via `cmd /c mklink /J`. Covered shapes: `-L/-H -s dirlink dir` → one row, first spelling (and reversed); `-P` keeps both; `-l` keeps both. `cargo test -p winux-cmds --lib` → **882 passed / 0 failed** (was 878; +4). Both fixture constructors SUCCEED on this host (no SKIP lines under `--nocapture`). 2. **The #1730 C++ tests run against the wired exe**: temporarily copied `tests/unit/du/du_unit_test.cpp` from `origin/main` (the only delta is those 160 lines) into the build tree, rebuilt, and ran `--gtest_filter='du.issue1670*'` → **4 passed / 0 failed**; the file was then restored (it is not part of this lane's diff). 3. **GNU 9.4 oracle** (`/usr/bin/du`, WSL): `du -L -s lxlink lxdir` → `12lxlink` (one row) and `du -L -s lxdir lxlink` → `12lxdir`; `-H` the same; `-P` → `0lxlink` + `12lxdir`; `-L -l` → both rows. With file links the same shapes give `4flink` / `4f` / both under `-l`. 4. **Same shapes through the wired exe on real WSL LX links** (`rust2/target/wire-w3/lxprobe`, links made by WSL's `ln -s` on DrvFs): old vs new byte-equal for `-L -s flink f`, `-L -s f flink`, `-L -l -s flink f`, `-P -s flink f`, `-H -s flink f` (dedupe one row, first spelling; `-l` two rows; `-P` link + target). 5. **Gate rows du47–du49** (`-L -s flink f`, reversed, `-L -l -s flink f`) are strict GNU rows; they SKIP on this no-privilege host and run on CI (same class as du41–du46). 6. **Old-vs-new matrix** gained du49–du53 (junction fixture): du49/du50/ du53 byte-equal; du51 (`-L -l`) and du52 (`-P`) now differ because the wired du follows GNU — the pre-wiring exe printed one row in both cases. Full du matrix after this round: **52 rows, rc 52/52, stdout 47/52, stderr 51/52**, every diff classified. ### Blocked: date and nohup (recipe precondition) **nohup** — the Rust port deliberately runs with the terminal faces OFF (`nohup.rs` module head): stdin→NUL, stdout→`nohup.out` and stderr→stdout need `isatty` facts for three streams, and the ABI has no channel for them (REPLACEMENT-RECIPE §8 "Host metadata channel"; §5.M host_v4 is still unruled). The 1.x C++ body implements those faces. Wiring now would drop interactive redirection, so the body stays and the inventory row stays `rust2-ready`. **date** — the Rust port is gate-green on the 43-row table but is a strict subset of the 1.x body. Missing, probed surfaces (old exe vs library driver, 2026-11-14): `--debug` gnulib parse annotations (stderr lines), `--resolution` (old prints `0.000000100`), the `--universal`/`--uct`/ `--rfc-822` aliases (argopt would reject them), `-f -` stdin, `-f` blank lines (GNU parses them as "today") and the `read error: Is a directory` arm, the mutual-exclusion / multiple-format / extra-operand diagnostics, `-s` and the POSIX `MMDDhhmm[[CC]YY][.ss]` set-clock path (old attempts `SetSystemTime` and reports "cannot set date: ..."), and `-r`'s shell-quote diagnostic. Wiring today would regress all of them, so the C++ body stays. Follow-up: a `date` library-deepening lane (port the option contract + `--resolution` + `-f`, and decide `--debug`), then wire. ### Host note (gate b operational) Four `lsof.*` ctest rows hang indefinitely on this host (they passed in the baseline run; the applet source is untouched by this wave). The full re-run was therefore made with `ctest -E '^lsof\.'`; every other row ran, and the lsof family is excluded from the comparison, not from the product. ## cp wire — GNU coreutils 9.4 semantics on the product path (#1488, 2026-11-14) Lane scope: `cp`. **Wired:** the 1.x C++ copy pipeline is deleted (`src/commands/cp.cpp` 2449 -> 207 lines; only `REGISTER_COMMAND`, help and the option table stay); the handler is `run_command_with_stdin_streaming("cp", ctx.raw_args)` so `-i` reads stdin on demand while non-interactive runs never touch fd 0. `cp` joins `WINUXCMD_RUST2_COMMANDS` (the effective union at CMakeLists.txt:81). The #1700/#1732 C++ fixes are carried in the Rust library before wiring (own commit on this branch): destination-inside-ancestors through a directory link, dangling link sources as `cannot stat`, WSL/LX reparse-tag dereference (`0xA000001D`, relative targets resolved against the link directory), `-r -H` command-line-only dereference, the >MAX_PATH `\\?\` verbatim path form, `-i` decline/EOF rc 1, and the GNU-shaped self-copy diagnostic. ### Gate a/c (run-gate.sh, RUST_BIN = wired exe, CPP_BIN = pre-wiring exe) Case table 98 -> **107** rows (`cp99-cp107`): dangling junction deref, junction into itself, `-rH` command-line/nested/verbose, and four genuine LX rows built with `wsl.exe ln -s` on the exe side. The harness `setup_needs_symlink()` now recognises that `mklink /J` and `wsl.exe ln -s` need no `SeCreateSymbolicLinkPrivilege`, so cp81-cp87/cp98 (junction rows, previously SKIP on this host) and the LX rows actually gate: total **105 GNU-gated PASS / 0 FAIL**, 2 skipped (cp88/cp89 file symlinks need Developer Mode), 0 win/note failures. `r=c:no` = **27/105**; every one has `r=g:yes` (the wired exe equals GNU and the pre-wiring exe is the side that diverges): | class | rows | pre-wiring C++ behavior / GNU + rust | |---|---|---| | verbose path shape | cp05/23/24/25/28/65/77/80/81/82/84/102/103 | C++ joined with `\` and printed only leaf files; GNU prints `/` and announces directories (`cp24`: `'s' -> 't'` + `'s/f' -> 't/f'`) | | junction recreation without privilege | cp19/20/36/81/82/85/86/87 | C++ used `CreateSymbolicLinkW` (rc 1, "required privilege"); rust recreates junctions with `FSCTL_SET_REPARSE_POINT` (rc 0 = GNU) | | retired 1.x parser quirks | cp45 (`--backup=bogus`), cp53 (`--preserve=`), cp93 (`--sparse=n`), cp97 (`-t` twice), cp69 (trailing slash) | C++ accepted `--sparse=n`, multiple `-t`, and stripped `file/`; GNU rejects them (rust = GNU) | | `-u` / `-n` state | cp36/37 (`-u` rc 0, C++ rc 1), cp39 (`-n --update=all` copies) | rust follows the argv-order state machine | | verbose extras | cp42 (`(backup: 'b~')`), cp75 (`(attributes only)` suffix) | GNU 9.4 prints the backup note and no attributes suffix; rust = GNU | | diagnostics | cp76 (just-created), cp98 (cyclic rc), cp33 (positions include `a directory`) | rust uses GNU copy.c wording and exit status | ### Gate c matrix (60 rows, old vs new vs GNU) `gate/wire/cmd-matrix.sh` gained a cp block (60 cases: `-i n/y/EOF`, `-n`, `-u`, `-r/-a/-L/-H/-P`, `-b/-S/--backup=`, `-l`, `-t/-T/--parents`, dangling junction/LX, LX `-d`/`-L`, self-copy, junction-into-itself, `>MAX_PATH` 310-char source, `/dev/null`, `NUL`, reflink/sparse/attributes, three-operand and last-wins rows). Ledgers under `target/wire-cp/`. * rc: new vs GNU **60/60**; old vs new **56/60** (old differs on cp19/20/36 junction recreation and cp30 `--strip-trailing-slashes`). * stdout old vs new 55/60; stderr 52/60. The 13 differing rows are exactly the verbose path-shape / backup-note / attributes-suffix / diagnostic classes above; each new-side output was compared with the GNU ledger (`target/wire-cp/gnu`). No unexplained row. ### Gate b `ctest -R '^cp\.'` = **83/83 PASS** with the wired exe; the full suite (excluding the host-hanging `lsof.*` family, see the wave-W3 note) has the same 25-row failing set as the pre-wiring baseline. Two `tail --follow` rows appeared once under parallel load and passed on re-run (timing flake, not cp). Three 1.x pins were re-pinned to the GNU contract (`cp_wildcard_sources_expand`, `cp_strip_trailing_slashes_allows_file_source_with_trailing_separator`, and the LX tree diagnostic separator); no test was deleted. The library gained tests for every repair (60 cp Rust tests, up from 54): LX deref/dangling/ `-H`, destination-link self-copy, dangling junction, `-rH`, literal wildcards, self `--force --backup`, `/dev/null`/`NUL`, `-s` relative rule, default-sparse reflink, long path. ### Editions `WINUXCMD_PACKAGE_EDITION=default` and `=full` both build (`build-vs`, `build-vs-full`) with cp on the rust2 union. The full-edition exe re-ran the 60-row matrix: 60/60 rc, stdout, stderr identical to the default wired exe, and `run-gate.sh cp` full-edition = **105 PASS / 0 FAIL, 2 skipped** — the edition only changes which entry links are materialized. ### I18N 47 runtime keys (`command.cp.error.*` 44, `prompt.*` 1, `warning.*` 2); the wiring wave added one (`relative_symlink_outside_cwd`), the other 46 came with #1715. `scripts/i18n_batch.py extract` (3806 keys) and `catalog/make-cp-patch.py` -> `validate` = `valid`; patch, filtered base and the key list live under `catalog/`. The shared `unixwin/winuxcmd-i18n` repository was not touched by this lane.