Repository navigation
#1488 wave3b: join/tsort/hostid/users/timeout/expand/unexpand/numfmt - #1559
Merged
10 commits merged intoNov 11, 2026
Merged
10 commits merged into
10 commits merged into
Conversation
…nd/numfmt; getopt_long invariants in argopt
GNU coreutils 9.4 semantics, every case probed against WSL (target/probes/
p_join*.sh): sequential merge with per-file order checks (default warns once
an unpairable was seen and exits 'input is not in sorted order'; --check-order
fatal; --nocheck-order last-wins), xstrtol field numbers ('01' is 1, huge
clamps keyless), one-byte -t ('' means newline whole-line records, '\0'
means NUL, multi-byte UTF-8 tabs rejected), -o item lists with empty items
fatal and 'auto' built from the first lines, keyless lines never pair but
print as unpaired with an empty key, case-folded -i keys.
51 gate cases (36 strict + 15 exit), all green vs GNU 9.4; C++ parity 51/51.
Ref: #1488 (wave3b)
GNU coreutils 9.4 semantics (probed): whitespace token pairs, odd token
count fatal with the input-name prefix, duplicate edges silent, self-pairs
register the node without a loop, ready queue is FIFO seeded in node order
and successors join in reverse recording order ('m a' 'm z' emits m z a),
cycles break at the earliest-mentioned remaining node with the GNU
'input contains a loop:' + member report on stderr and rc 1, empty input
prints nothing. -w diverges: GNU 9.4 rejects it (the 1.x C++ accepts —
recorded, Rust follows GNU).
25 gate cases (17 strict + 6 exit + 2 win), green; C++ parity 23/25.
Ref: #1488 (wave3b)
…alue model GNU hostid shape (8 lowercase hex digits, extra operand rejected with the try-help line, rc 1; -h/-v/-V accepted). The 1.x C++ applet hashes the MachineGuid registry value with MSVC std::hash; the library form keeps the same value model — a stable per-machine 32-bit quantity — sourced from the COMPUTERNAME environment via FNV-1a 64 (registry access is not reachable from the std-only crate), so the printed VALUE differs from the 1.x exe and is recorded (win-mode gates rc only). 20 gate cases (12 exit + 7 win + 1 note), green. Ref: #1488 (wave3b)
GNU users.c: sorted space-separated login names on one line, at most one operand, extra operand is a usage error, unknown options are usage errors, --help/--version win. GNU 9.4 probed: an unreadable FILE operand simply yields zero entries (rc 0) — mirrored here. The 1.x C++ applet reads the WTS session table and falls back to GetUserNameW; the library form follows that model with the environment face (USERNAME) as the session source, so the printed VALUE diverges from GNU's empty utmp and is recorded (win). 20 gate cases (15 exit + 4 win + 1 note), green. Ref: #1488 (wave3b)
…ocess GNU coreutils 9.4 semantics (probed p_timeout/p_misc): DURATION parses like strtod in the C locale (hex floats, inf/infs, leading whitespace and '+', one lowercase s/m/h/d suffix — '1m30s' and '5S' are invalid, NaN and negatives rejected, errors exit 125); Linux signal names/numbers with 32/33 reserved and RTMIN+n/RTMAX-n; optstring carries the leading '+' so nothing after COMMAND is parsed as an option. Status contract on the Windows mapping (TerminateProcess): timed out 124, --preserve-status 128+signal, KILL death 137 either way, 127 not found / 126 not invokable; missing COMMAND prints only the try-help line and exits 125; --kill-after defers the KILL phase and -s0 stays a probe. PATH-only child resolution with the .exe-first Windows preference; the =C: environment pseudo-vars are skipped at spawn. 30 gate cases (exit mode; children are sleep/ping under WSL and sleep.exe/cmd.exe on Windows), green; C++ parity 28/30. Ref: #1488 (wave3b)
…nt -NUM
GNU coreutils 9.4 semantics (probed p_expand*.sh): all -t and -NUM specs
join into ONE list in argv order ('-t 4 -t 8' accumulates, '-8 -t 4' is
the fatal descending {8,4}, '-4,8 -t 2' fatal {4,8,2}), repeat forms /N
(every multiple) and +N (anchored at the last stop), a repeat value of 0
silently ignored ('-t /0' runs at the default 8), GNU diagnostics for
zero/descending/invalid-char/too-large/misplaced-specifier lists, -i
converts only before the first non-blank, backspace rewinds the column,
padding runs stream through a bounded buffer (expand -t 99999999999 must
really write the spaces without materializing them), open failures report
'expand: FILE: <reason>' and rc 1 while later files continue.
30 gate cases (19 strict + 11 exit), green; C++ parity 28/30.
Ref: #1488 (wave3b)
GNU coreutils 9.4 semantics (probed): only leading blanks convert by
default; -a converts every run; --first-only cancels -a in either argv
order; -t/-NUM imply whole-line conversion (probed: a mid-line run converts
under '-8 -t 4' with no -a); tab stops validate PER STOP at add time —
unlike expand, the obsolescent -NUM digits accumulate into a pending value
flushed after the -t stops ('-t 8 -t 4' is the fatal descending {8,4} while
'-8 -t 4' adds {4} then 8 ascending), a comma flushes the pending digits
immediately, repeat values of 0 are ignored; the pending-blank conversion
loop is the GNU algorithm verbatim including the EOF flush of trailing
blanks on unterminated final lines.
26 gate cases (21 strict + 5 exit), green; C++ parity 24/26.
Ref: #1488 (wave3b)
GNU coreutils 9.4 semantics, probed across four probe batches (p_numfmt*.sh): --from none/auto/si/iec/iec-i and --to none/si/iec/iec-i with UPPERCASE-only KMGTPEZYRQ suffixes (lowercase k is an invalid suffix), simple_strtod_human parsing (no exponent, no '+', '5.' rejected, one blank may precede the suffix, missing-'i' and suffix-tail diagnostics), --round from-zero default with the 999.95 -> 1.0K rescale, 18-digit scale-none print limit with %g diagnostics, cut-style --field ranges with second-spec and try-help errors, --invalid abort/fail/warn/ignore exit statuses, locale-driven grouping (the C locale groups nothing even with %'f), --header stdin-only with --header=0 invalid, line terminators kept only when the input line had one. 9.4 differences from the 1.x C++ applet are taken from GNU (recorded): no --unit-separator/-M/-l, unit sizes accept only K/M/G/T/P/E(+Ki), --debug only carries the no-conversion-option warning. 19-digit integers print exactly via a raw-text path (GNU uses long double; f64 loses the 19th digit). 74 gate cases (49 strict + 25 exit), green; C++ parity 66/74. Ref: #1488 (wave3b)
caomengxuan666
force-pushed
the
rust2/wave3b
branch
from
November 10, 2026 14:45
ab06320 to
ea53c38
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ref #1488 (wave3b, 8 commands).
What lands
rust2/crates/winux-cmds:join,tsort,hostid,users,timeout,expand,unexpand,numfmt— each a plainfn run(args, io, ctx) -> CmdResult, std-only, with per-command unit tests (196 total, green) and GNU coreutils 9.4 as the measured oracle (probe scripts underrust2/target/probes/p_*.sh, WSL coreutils 9.4).gate/gen-cases.py, generated TSVs): join 51, tsort 25, hostid 20, users 20, timeout 30, expand 30, unexpand 26, numfmt 74. Three-way gate (Rust driver / WSL GNU 9.4 / Debug C++ winuxcmd.exe): 285 GNU-gated + 79 win + 3 note, all GREEN; full-suite gate re-run green (817 GNU-gated + 145 win, includes all wave1/wave2 tables).target/gate/ledger.tsvand are inherited 1.x behaviors re-derived from GNU (users WTS value model, hostid hash input, tsort -w accepted by C++ but rejected by GNU 9.4, numfmt 9.4 option-set cuts like --unit-separator/-M/-l and ZYRQ unit suffixes, expand/unexpand message wording).Notes for review