uutils/coreutils at 0c8a3c7 · static read-only analysis · why-not-rust method 2.0uutils/coreutils 于 0c8a3c7 · 只读静态分析 · why-not-rust 方法 2.0
Repository: github.com/uutils/coreutils at commit 0c8a3c7, shallow clone, 1,967 tracked files. Scope: the whole Rust candidate repository, with one utility under src/uu/ as the unit of decision. The measurement target is the Rust candidate, not the incumbent. GNU coreutils was not cloned, so no claim is made about its internals, and that limit is why confidence is MEDIUM rather than HIGH. Sampling: 251,003 lines across 631 .rs files; src/uu/ 118,595 lines across 855 tracked files in 109 utility directories; src/uucore/ 34,778 lines across 82 files; tests/ 174,220 lines across 821 tracked paths; 212 .ftl localization files; 275 `unsafe {` blocks and 4 `unsafe fn` across *.rs; the GNU compatibility harness present as GNUmakefile with .github/workflows/GnuTests.yml and .github/workflows/GnuComment.yml. README.md:355 is the 'GNU test suite compatibility' heading and links the pass count out to external coverage documentation, so no in-repository pass count is quoted here. The roughly 500 of 600 figure is an announcement-time number from the skill's case library, not a current measurement. No build, test, benchmark or network call was run against the project. Objective: remove the memory-unsafety class from the default command-line userland without changing the observable behaviour scripts, Makefiles and installers depend on. User-supplied facts: none. No Amdahl calculation appears and none should. The objective is resilience and safety, not latency, so D2 is recorded N/A; converting a line share into a time share to fill it would be a method error, and the one measured performance fact runs against the migration rather than for it. Why the selected option is the smallest sufficient step: the module boundary here is a process boundary. 109 directories sit under src/uu/, of which 108 declare a [[bin]] target, so 108 shipping utilities are 108 separate binaries with 108 separate behavioural contracts. Per-utility promotion delivers the same class elimination as the simultaneous default flip, and it keeps rollback at one utility. External figures keep their URL and regime: the cksum, base64 and md5sum regressions are press coverage of the Ubuntu 25.10 release (https://www.phoronix.com/news/Ubuntu-Rust-Coreutils-Perf); Android's unsafe-line share is a vendor security-blog figure, and a line share rather than a block count. This framework compares explicit options through four non-compensatory gates. It is a structured decision protocol, not a statistical predictor.仓库:github.com/uutils/coreutils,commit 0c8a3c7,浅克隆,1,967 个受版本控制的文件。范围:整个 Rust 候选仓库,决策单位是 src/uu/ 下的一个工具。测量对象是 Rust 候选实现,不是现任实现。GNU coreutils 没有克隆,因此不对它的内部作任何断言;正是这个限制让置信度停在 MEDIUM 而不是 HIGH。采样:631 个 .rs 文件共 251,003 行;src/uu/ 下 109 个工具目录、855 个受控文件、118,595 行;src/uucore/ 82 个文件、34,778 行;tests/ 821 个受控路径、174,220 行;212 个 .ftl 本地化文件;*.rs 中 275 个 `unsafe {` 块和 4 个 `unsafe fn`;GNU 兼容测试套件以 GNUmakefile 加 .github/workflows/GnuTests.yml 和 .github/workflows/GnuComment.yml 的形式存在。README.md:355 是「GNU test suite compatibility」标题,把通过数链到外部覆盖率文档,因此这里不引用任何仓库内的通过数。大约 500 / 600 这个数字来自技能自带的案例库,是公告时点的数,不是当前测量值。没有对项目执行任何构建、测试、基准或网络调用。目标:把内存不安全这一类缺陷从默认命令行 userland 中移除,同时不改变脚本、Makefile 和安装程序依赖的可观测行为。用户提供的事实:无。报告里没有 Amdahl 计算,也不该有。目标是韧性与安全,不是延迟,所以 D2 记为 N/A;把行占比换算成时间占比来填这一格属于方法错误,而唯一一项实测的性能事实,方向是反对迁移而不是支持迁移。为什么推荐方案就是最小充分步骤:这里的模块边界就是进程边界。src/uu/ 下有 109 个目录,其中 108 个声明了 [[bin]] 目标,于是 108 个出货工具就是 108 个各自独立的二进制、108 份各自独立的行为契约。逐工具晋级带来的类消除,与整套默认值同时翻转完全一样,同时把回滚控制在一个工具的粒度上。外部数据保留其 URL 与口径:cksum、base64 和 md5sum 的回退来自对 Ubuntu 25.10 发布的媒体报道(https://www.phoronix.com/news/Ubuntu-Rust-Coreutils-Perf);Android 的 unsafe 行占比来自厂商安全博客,是行占比,不是块计数。这个框架通过四道非补偿性证据门比较明确列出的方案。它是一套结构化决策协议,不是统计预测器。
| What we don't know证据缺口 | What it would change会改变什么 |
| Per-utility acceptance records for the utilities already flipped已经翻过默认值的那些工具,缺逐工具验收记录 | Without them the residual risk of the shipped default is unknown per utility, and the gate cannot be applied retroactively without the byte-level diffs and throughput comparisons it needs.没有它们,已发布默认值的残余风险就无法按工具说清;而缺了所需的字节级 diff 和吞吐对比,这道门也没法事后补做。 |
| A GNU test pass count published per release按版本公布的 GNU 测试通过数 | README.md:355 links the coverage data out to external documentation, so a distributor reading the repository alone cannot see parity. Parity stays an announcement-time figure, and the parity-first option cannot even be evaluated.README.md:355 把覆盖率数据链到外部文档,只读仓库的发行方看不到 parity。parity 因此停留在公告时点的数字上,而「先等 parity」那个方案连评估都无从谈起。 |
| Per-invocation cost decomposition for either implementation两边实现都缺单次调用的开销拆分 | D5 stays UNKNOWN. A per-utility startup and throughput comparison is what turns a cksum-class regression from a field discovery into a pre-promotion gate.D5 保持 UNKNOWN。把 cksum 那类回退从「现场才发现」变成「晋级前就拦住」,靠的就是逐工具的启动与吞吐对比。 |
| A measured comparison against the incumbent与现任实现的实测对比 | GNU coreutils was not cloned or measured here, so the eliminated-class size rests on structural argument and the residual-risk side of the counterfactual is unquantified.这里没有克隆也没有测量 GNU coreutils,因此被消除那一类缺陷有多大只能靠结构性论证,反事实中残余风险那一侧也没有量化。 |