audit: canonical-type-names milestone close (clean) + ratify post-23.3.3 compile baseline

This commit is contained in:
2026-05-11 10:27:19 +02:00
parent ef4eff3f8b
commit 0e6079d335
2 changed files with 91 additions and 25 deletions
+25 -25
View File
@@ -1,105 +1,105 @@
{
"version": 1,
"captured": "2026-05-09",
"captured": "2026-05-11",
"captured_via": "bench/compile_check.py",
"note": "Compile-time bench. `check_ms` is `ail check FILE`; `build_O0_ms` is `ail build --opt=-O0 FILE`. Wall-clock includes subprocess spawn (~5-10 ms on Linux) and, for build, the clang link step. Tolerances are tuned for noise on a quiet developer machine, not as the language correctness bar.",
"check_ms": {
"hello": {
"baseline_ms": 0.79,
"baseline_ms": 1.0,
"tolerance_pct": 25
},
"list_map_poly": {
"baseline_ms": 0.99,
"baseline_ms": 1.24,
"tolerance_pct": 25
},
"local_rec_capture": {
"baseline_ms": 0.84,
"baseline_ms": 1.09,
"tolerance_pct": 25
},
"borrow_own_demo": {
"baseline_ms": 0.95,
"baseline_ms": 1.09,
"tolerance_pct": 25
},
"nested_pat": {
"baseline_ms": 1.77,
"baseline_ms": 2.23,
"tolerance_pct": 25
},
"bench_list_sum": {
"baseline_ms": 0.99,
"baseline_ms": 1.19,
"tolerance_pct": 25
},
"bench_tree_walk": {
"baseline_ms": 1.08,
"baseline_ms": 1.24,
"tolerance_pct": 25
},
"bench_closure_chain": {
"baseline_ms": 0.86,
"baseline_ms": 1.27,
"tolerance_pct": 25
},
"bench_hof_pipeline": {
"baseline_ms": 0.99,
"baseline_ms": 1.35,
"tolerance_pct": 25
},
"bench_compute_intsum": {
"baseline_ms": 0.86,
"baseline_ms": 1.14,
"tolerance_pct": 25
},
"bench_compute_collatz": {
"baseline_ms": 0.94,
"baseline_ms": 1.17,
"tolerance_pct": 25
},
"bench_list_sum_explicit": {
"baseline_ms": 0.92,
"baseline_ms": 1.28,
"tolerance_pct": 25
}
},
"build_O0_ms": {
"hello": {
"baseline_ms": 63.52,
"baseline_ms": 84.24,
"tolerance_pct": 20
},
"list_map_poly": {
"baseline_ms": 66.12,
"baseline_ms": 87.47,
"tolerance_pct": 20
},
"local_rec_capture": {
"baseline_ms": 65.18,
"baseline_ms": 85.03,
"tolerance_pct": 20
},
"borrow_own_demo": {
"baseline_ms": 65.56,
"baseline_ms": 86.69,
"tolerance_pct": 20
},
"nested_pat": {
"baseline_ms": 68.26,
"baseline_ms": 88.91,
"tolerance_pct": 20
},
"bench_list_sum": {
"baseline_ms": 66.07,
"baseline_ms": 86.57,
"tolerance_pct": 20
},
"bench_tree_walk": {
"baseline_ms": 67.16,
"baseline_ms": 86.43,
"tolerance_pct": 20
},
"bench_closure_chain": {
"baseline_ms": 64.59,
"baseline_ms": 85.72,
"tolerance_pct": 20
},
"bench_hof_pipeline": {
"baseline_ms": 65.53,
"baseline_ms": 86.85,
"tolerance_pct": 20
},
"bench_compute_intsum": {
"baseline_ms": 63.1,
"baseline_ms": 85.48,
"tolerance_pct": 20
},
"bench_compute_collatz": {
"baseline_ms": 64.92,
"baseline_ms": 87.06,
"tolerance_pct": 20
},
"bench_list_sum_explicit": {
"baseline_ms": 64.76,
"baseline_ms": 84.19,
"tolerance_pct": 20
}
}
+66
View File
@@ -14506,3 +14506,69 @@ Workspace at iter-ct.4 close: full `cargo build --workspace`
and `cargo test --workspace` green (457 tests, 0 failed — net
+6 over ct.3's 451: 2 pin tests in hash.rs, 2 prose trim unit
tests, 1 prose snapshot, 1 E2E test).
## 2026-05-11 — Audit close: canonical-type-names milestone
Audit pipeline ran clean per skill protocol.
**Architect drift review:** zero items. DESIGN.md's Decision 2
amendment matches what the code enforces; the four obsolete
mechanisms in the ct.1 catalogue are all gone or correctly
narrowed; `qualify_local_types` is applied uniformly at all three
cross-module fn-lookup sites; the five remaining "bit-identical"
paragraphs in DESIGN.md refer to features orthogonal to the
canonical-form migration and remain factually correct. JOURNAL
test-count claim (457 at iter close) verified against
`cargo test --workspace`. Spec acceptance criteria 1-8 empirically
satisfied.
**Bench-regression check:** `bench/check.py` and `bench/cross_lang.py`
green at exit 0 (0 / 88 metrics regressed). `bench/compile_check.py`
initially reported 23 / 24 regressed (compile-time +27-44%
across every fixture). Bencher dispatched to localise; the
result refuted the initial hypothesis (validator-causes-regression)
with N=15 median measurements: validator's measured CPU
contribution is 0.01-0.07 ms per `ail check`, within noise.
Localised to **iter 23.3.3** (`12d9130``Ord extends Eq` + 3
Ord instances added to `examples/prelude.ail.json`). The prelude
grew from 18 to 223 lines between `3742583` and `12d9130`. The
cost is paid on every `load_workspace`: parse, canonicalise,
typecheck the prelude module, register its 6 instances. The
bench fixtures are tiny (hello = 4 defs); the prelude is now
larger than every user fixture in the corpus and dominates load
time. ct.1.* contributes a residual +0.05-0.15 ms on top — not
material against the ~+20 ms build floor.
**Resolution:** ratify. The prelude growth is a deliberate
post-iter-23.3 design state (Eq + Ord classes with three primitive
instances each are the canonical typeclass surface; the prelude
is auto-loaded for every workspace per iter 23.1.2). Constant
+17 ms per `ail build` invocation is the documented price of
the canonical typeclass prelude. Baseline rebased via
`bench/compile_check.py --update-baseline`; post-rebaseline run
is 24 / 24 stable.
Lesson logged: when a milestone closes and a bench script reports
broad regressions, the canonical move is to localise BEFORE
ratifying. Without the bisect, ratifying would have written
"canonical-type-names caused +30% compile time" into the
JOURNAL — a false attribution that would mislead future
archaeology.
**Rustdoc:** 20 pre-existing-pattern warnings (18 carried from
earlier, +2 introduced by ct.1.5a's `type_def_module` doc-link
and ct.3.2's `apply_per_module_types_overlay` rename). The
existing P2 roadmap entry "Rustdoc warning sweep" covers them;
not promoted to a tidy iteration on this audit.
**Audit verdict:** carry-on. Canonical-type-names milestone is
closed. Skill pipeline next step: `fieldtest`.
Follow-up not from this audit but worth flagging as a P3 idea:
optimising the prelude load path. A `OnceCell`-cached parsed
prelude (or a content-addressed disk cache) would recover most
of the ~17 ms per-invocation cost. Quantified by the bencher
above as worth doing only if the prelude-loading cost is judged
structurally permanent. Add to roadmap as P3 if the next
fieldtest surfaces it as friction.