sqlite/sqlite at f034d51 · static read-only analysis · why-not-rust method 2.0sqlite/sqlite @ f034d51 · 只读静态分析 · why-not-rust 方法 2.0
Repository: github.com/sqlite/sqlite at commit f034d51, shallow clone, 2,221 tracked files. Scope: the whole repository, with the core engine in src/ as the migration candidate. Sampling: tracked files only. src/ holds 47 test-harness files (44 .c translation units plus 3 headers); the 102 files left after excluding them carry 182,029 lines of core C. test/ carries 1,021,321 lines across 1,294 files, and ext/ carries 326,793. No build, test, benchmark or network call was run against the project. The proprietary TH3 harness behind the 100% MC/DC figure is not in this repository. That number and the 590× test-to-source ratio come from sqlite.org/testing.html and carry its 2023-onward release regime. Objective: remove the memory-unsafety class from SQL and database-file parsing without weakening the assurance level SQLite currently ships. User-supplied facts: none. No Amdahl calculation appears, because no performance requirement is asserted; treating a line share as a time share would be a method error, so D2 is recorded N/A. Gates 1 and 2 pass, gates 3 and 4 fail. The gates are non-compensatory, so a safety requirement that clears G1 and G2 still does not survive an option whose cost is the project's own assurance programme. The framework is a structured decision protocol, not a statistical predictor.仓库:github.com/sqlite/sqlite,提交 f034d51,浅克隆,2,221 个受控文件。范围:整个仓库,其中 src/ 里的核心引擎是迁移候选。采样:只统计受控文件。src/ 里有 47 个测试脚手架文件(44 个 .c 编译单元加 3 个头文件);排除之后剩下的 102 个文件是 182,029 行核心 C。test/ 是 1,294 个文件、1,021,321 行,ext/ 是 326,793 行。没有对项目执行任何构建、测试、基准或网络调用。产出 100% MC/DC 这个数字的闭源 TH3 脚手架不在本仓库里。那个数字和 590× 的测试源码比来自 sqlite.org/testing.html,口径是它 2023 年起的发布版本。目标:在不削弱 SQLite 现有保证水平的前提下,从 SQL 与数据库文件解析中消除内存不安全这一类缺陷。用户提供的事实:无。报告里没有 Amdahl 计算,因为没有提出性能要求;把行数占比当成时间占比是方法错误,所以 D2 记为 N/A。G1、G2 通过,G3、G4 不通过。四道门不可互相补偿,所以一个已经过了 G1 和 G2 的安全需求,仍然扛不住一个代价等于项目自身保证体系的方案。这套框架是结构化的决策协议,不是统计预测器。
| What we don't know证据缺口 | What it would change会改变什么 |
| Root-cause classification of SQLite's advisory historySQLite 历史安全公告的根因分类 | Without it, the share of past defects Rust would have eliminated by construction stays an argument rather than a measurement. It would move G1's strength. The G3 and G4 failures stand.没有这份分类,Rust 本可以从构造上消除掉多少历史缺陷,就只是个说法,不是测量结果。它会影响 G1 的证据强度。G3 和 G4 的失败照旧。 |
| Assurance level of any Rust challenger任何 Rust 挑战者的保证水平 | If a Rust engine publishes MC/DC-equivalent coverage on its own core and byte-identical on-disk behaviour, the adoption option strengthens for consumers. The extraction option becomes re-examinable.如果某个 Rust 引擎公布了自己内核上与 MC/DC 对等的覆盖率,以及字节级一致的磁盘行为,采用方案对使用方就更有说服力。抽取方案也值得重新看一遍。 |
| Cost of rebuilding coverage for one extracted component为抽出来的单个组件重建覆盖率要多少钱 | Unpriced. Until someone estimates it, the tokenizer/parser extraction stays retained-but-unselected rather than recommended.没人报过价。在有人估出来之前,词法/语法分析器的抽取方案只能保留待议,进不了推荐。 |