Skip to content

#1488 wave4a - #1576

Merged
caomengxuan666 merged 10 commits into
mainfrom
rust2/wave4a
Nov 12, 2026
Merged

caomengxuan666 merged 10 commits into
mainfrom
rust2/wave4a

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

rust2 wave4a: head / tail / cut / tr / od / sum / mktemp / nice (#1488 命令库化)

8 个命令的 rust2 库函数 + 差分门。形状契约与 wave1-3 一致(注入式 IO、显式 env/cwd、返回状态码、零依赖 std-only)。

差分账本(全量 55 命令 run,2026-11-12)

  • 本批 8 命令 230 用例:GNU-gated 全部 GREEN(WSL coreutils 9.4 逐字节);win-gated 全部 GREEN。
  • 全仓 1529 用例:GNU-gated 1384 PASS / 0 FAIL;win-only 145 PASS / 0 FAIL。
  • 用例表进 gate/gen-cases.py(每命令 ≥20,生成式),三方门 Rust / GNU / 本树 Debug C++ 对照。

本批锁定的 GNU 语义(全部 WSL 9.4 实测)

  • head/tail:+K/-K 不对称(tail 的 -K≡K,-n -0 空、-n +0 全)、b/kB/K 后缀、多文件头格式
  • cut:strtol 列表解析(1 3 两个 spec)、-d ''=NUL、输出记录无条件带终止符
  • tr:字节集文法(class 按字节序展开 A-Za-z、[c*n] 八进制计数、-c 翻译取 SET2 末字符)、C-locale 字节表
  • od:shortest-round-trip 浮点显示(4.8e-322)、-tx1z ASCII 列定位 16*(w+1)+2、-t o/x 缺省 4 字节
  • sum:SysV 16-bit 折叠(1500 b → 15930)、隐式 stdin 不打印名字
  • mktemp:X-run 规则(≥3、大小写敏感、--suffix 必须以 X 结尾、-q 仅静默创建失败)
  • nice:xstrtol adjustment(rc 125 无 try-tail)、CREATE_SUSPENDED + SetPriorityClass + 线程恢复(nice: a failed priority change is silently ignored (GNU warns and continues) #1359)

文档化子集(诚实边界)

  • tail -f/-F/--retry 不跟随(输出后 rc 1);od --traditional/-S/fL 拒绝;nice 子进程继承进程 stdio(与 timeout.rs 同形状);mktemp 创建名/nice niceness 平台绑定只比 rc。

每命令 Rust 单测(全仓 414+21 green)、cargo fmt 干净。10 commits(8 命令各一 + TSV 对齐 + 报告)。

… rows strict, #1488)

The committed gen-cases.py has gated --help/--version rows against the
probed oracle bytes since fe45489, but these fourteen tables were left
stale from before that change. Regenerated; no case semantics change.
…EEN, #1488)

head/tail/cut/tr/od/sum/mktemp/nice: 230 new gate cases, all GREEN
against WSL coreutils 9.4. Full 55-command run: GNU-gated 1384 PASS /
0 FAIL, win-gated 145 PASS / 0 FAIL. The wave1 table reflects the
committed generator (chmod/chown tables regenerated to their current
case lists; help/version rows strict).
@caomengxuan666
caomengxuan666 merged commit e30adb3 into main Nov 12, 2026
9 of 10 checks passed
@caomengxuan666
caomengxuan666 deleted the rust2/wave4a branch November 18, 2026 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant