Skip to content

Commit 911e173

Browse files
committed
docs: W25 §5.3 pre-Step-B baseline result — drift UNDETECTED (PASS)
Per W25 spec §5.3 + theologian [chat 2026-04-22 19:29Z] acceptance flip: pre-Step-B baseline PASSES when BUILD_EXIT=0 (drift surface empirically confirmed real). Captured by testkeeper [chat L2154] at HEAD 2ed74a9. EMPIRICAL FINDING: Mutation: hir_c_insert_before +3rd arg in BOTH .h:726 + .cpp:2349 Build cmd: scripts/build_phoenix.sh BUILD_EXIT=0 (zero hir_c_insert_before-related errors/warnings) → drift undetected at compile time → §1b drift surface CONFIRMED real INTERPRETATION: hir_c_api.cpp compiles (header + impl agree on new sig) §1b TUs (licm_c.c + pass_output_type_c.c) local externs stay 2-arg §1b callers compile against stale local extern (2 args) Linker resolves 'hir_c_insert_before' by name → finds 3-arg impl Runtime UB at call site (impl reads garbage 3rd arg from stack) This is exactly the W25 §1b drift surface Step B is designed to close. POST-STEP-B PREDICTED OUTCOME (deferred until Step B lands): Same dual-mutation procedure should yield BUILD_EXIT≠0 with compile errors at licm_c.c + pass_output_type_c.c call sites — local externs deleted in Step B, canonical 3-arg sig now visible via #include "hir_c_api.h", 2-arg callers fail at compile time. If POST-STEP-B BUILD_EXIT=0: Step B did NOT close the drift surface (regression — investigate which §1b TU still has local extern OR which include path didn't apply). If POST-STEP-B BUILD_EXIT≠0 at expected sites: §5.3 falsification PASSES end-to-end, lint gate (Step C) makes the closure permanent. BONUS PRE-EXISTING DRIFT FINDING (no mutation needed): pass_output_type_c.c local externs use 'void *block' for hir_bb_* functions; canonical hir_c_api.h post-Step-A uses 'struct HirBasicBlock *block'. The void* and struct-ptr are ABI- compatible at 8 bytes, so this drift silently links today. Step B cleanup will surface this signature mismatch at compile time — another empirical case the lint gate would catch. Authorship: testkeeper executed procedure; generalist commits artifact per role boundary. Authorization chain: - W25 spec §5.3: theologian L2017 - Procedure (after 2 corrections): 2ed74a9 docs/w25-step-b-mutation-test.md - Testkeeper baseline run + result: chat L2154 - Acceptance flip: theologian L2148, codified in §5 of procedure doc
1 parent 2ed74a9 commit 911e173

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
=== BASELINE (pre-Step-B, dual-mutation .h+.cpp at HEAD 2ed74a92a8840b2f87d470740de44bd665872baf) ===
2+
Mutation: hir_c_insert_before added 3rd arg (void *unused_drift_param) in BOTH .h (line 726) and .cpp (line 2349)
3+
4+
BUILD_EXIT=0 ← DRIFT UNDETECTED at compile time = §1b drift surface CONFIRMED
5+
6+
Pre-Step-B reality:
7+
- hir_c_api.cpp compiles fine (header + impl agree on new sig)
8+
- §1b TUs (licm_c.c + pass_output_type_c.c) use local extern decls (still 2-arg signature)
9+
- Their callers compile fine against the local extern
10+
- Linker resolves 'hir_c_insert_before' by name → finds 3-arg impl
11+
- Result: silent runtime UB if these call sites execute (extra arg never passed; impl reads garbage)
12+
13+
Per theologian [chat 19:29Z] acceptance flip: BUILD_EXIT=0 = baseline PASS
14+
15+
Bonus pre-existing drift (no mutation needed): pass_output_type_c.c local externs use 'void *block' for hir_bb_*; canonical hir_c_api.h post-Step-A uses 'struct HirBasicBlock *block'. ABI-compat at 8 bytes silently links today.

0 commit comments

Comments
 (0)