Repository navigation
#1488 uutils audit: rust2 self-developed vs uu_* per-command comparison (keep 45 / borrow 2 / adopt 0) - #1562
Merged
Merged
Conversation
44+-command per-row comparison of the rust2 hand-written implementations against upstream uutils/coreutils @ 156d715, WSL GNU coreutils 9.4 as the oracle, plus a three-way empirical sample (seq/numfmt/b2sum) compiled and run on MSVC. Verdict: keep self-developed (45 keep / 2 borrow-algorithm / 0 adopt). - uu_* fails the #1488 explicit-IO contract: uumain writes process stdio (stdout().lock() in uu_seq; show_error! macros) and exits via uucore::bin!; library-ization is an open upstream topic (discussion #6103, issue #5088). - uutils Windows feature tree excludes chmod/chown/id/stat/users (feat_require_unix_core / utmpx); getconf does not exist upstream — exactly the C++ value-model parity surface. - Dependency footprint measured with cargo tree --edges normal: baseline 53 crates per utility (clap+fluent+uucore), b2sum 128, seq 93, numfmt 92; union of the 40 buildable crates = 220 vs our 0. - Licenses clean: MIT, no copyleft transitive (self_cell dual Apache-2.0 OR GPL-2.0, Apache branch applies). Empirical samples (three-way, stdout bytes + rc): - seq: uutils 7/7 vs GNU, ours 6/7 (documented f64 vs 80-bit long double; uutils' exact-decimal strategy closes it — borrow). - numfmt: uutils 14/14, ours 13/14 — NEW gap found: --field line reconstruction collapses blanks instead of padding to the original field width (GNU numfmt.c semantics) — borrow + add gate case. - b2sum: 13/13 three-way byte-identical incl. -l 8/256/512, --tag, -z, stdin, -c pass/tampered/quiet. Ticket's "--check deferred" is stale; it is implemented. Also recorded: main-branch registry drift (uname/id/hostname/getconf implemented but unregistered; wave3b registers them but lacks sync). Raw artifacts under target/uutils-audit/ (not committed).
This was referenced Nov 12, 2026
aphrody-labs Bot
pushed a commit
to aphrody-labs/WinuxCmd
that referenced
this pull request
Nov 15, 2026
…nixwin#1488) Owner-directed follow-up to unixwin#1562 (which covered only the coreutils monorepo): audit the four uutils SIBLING repos that own our 2.0 big unimplemented commands. Method: shallow clones (target/uutils-siblings/, HEADs 2026-11-10..12), three-party semantic sampling (WSL GNU 5.3.20 / our C++ build-1496 / uutils debug builds), 8 cases per command, raw output in target/uutils-siblings/sampling/threeway_all.txt. Key findings: - All four repos outsource regex: grep+findutils delegate to Oniguruma C (onig/onig_sys); sed = bre_to_ere translation -> regex crate with fancy-regex fallback for backrefs; diffutils ships a 360-line BRE translator over the regex crate. NO repo has a portable std-only Rust POSIX engine -> regex decision A (port portable_regex) stands; sed's bre_to_ere + diffutils bre.rs become cross-check corpora. - IO: all four are process-level stdio; unixwin#1488 explicit-IO contract would require rewriting each repo's output layer (grep worst, diffutils lib layer best). - Deps: 119-167 transitive packages per repo incl. a C library (onig_sys) -> route C (adopt crates) conflicts with std-only policy. - Sampling: grep 8/8, sed 8/8, find 6/8 (uu walks print backslash paths while -printf prints forward slashes; localized -newer error), diff 7/8 for uu (missing -i) — and two OUR-side 1.x divergences found: cmp says "char 7" vs GNU/uu "byte 7"; diff -r recursion header prints redundant "diff diff -r ..." full args. Recommendation: route B (borrow algorithms, unixwin#1575 precedent) as the mainline with A carrying the engine; per-command table in the doc.
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.
Read-only audit for #1488 comparing our rust2 implementations (47 command names, main ∪ wave3b) against upstream uutils/coreutils @ 156d715, with WSL GNU coreutils 9.4 as oracle. No command implementation code touched — docs only.
Full report:
DOCS/2.0-uutils-audit.mdVerdict: keep self-developed + borrow-algorithm lane
Three hard facts behind the verdict (all measured, not assumed):
uumain(args) -> UResult<()>writing process stdio (stdout().lock()in seq; uucoreshow_error!) andprocess::exitviauucore::bin!. Upstream library-ization is an open topic only (discussion #6103, issue #5088).feat_require_unix_core,feat_require_unix_utmpx) excludes chmod/chown/id/stat/users; getconf doesn't exist upstream. That is exactly our C++ parity surface.cargo tree --edges normal— baseline 53 transitive crates per utility (clap+fluent+uucore), b2sum 128, seq 93, numfmt 92, test 97; 40 buildable crates union = 220. Ours: 0.Empirical three-way (uutils native Windows builds vs our driver vs GNU 9.4)
--fieldreconstruction collapses blanks; GNU/uutils pad the converted field to the original field width (numfmt.c semantics). Gate's 74 numfmt cases missed this shape → borrow + add case-l 8/256/512,--tag,-z, stdin,-cpass/tampered/quiet. Ticket's "--check deferred" is stale — it is implemented and greenLicenses: MIT, no copyleft transitive (180 deps scanned; only dual-lic edge is self_cell, Apache branch applies).
Bonus findings recorded in the report: main-branch registry drift (uname/id/hostname/getconf implemented but unregistered on main; wave3b registers them but lacks sync), and uutils native Windows binaries work well as a second oracle (34/34 vs GNU on the sample) for the gate's
win-class cases.