You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
audit:all fails on src/main.w: 129 violations (127 use-after-kill + 2 frozen-phase re-entries) — grown from 48; needs a dedicated drain #742
Found while verifying the D27 E1+E2 stage2-miscompile fix (#740, commit 16ceb0b): analyze src/main.w audit:all FAILS with 48 violations, and the sets are byte-identical between the shipped seed (v0.15.1-gc7dc28ce6) and current stage1 — so this is pre-existing, not E1/E2 fallout.
Breakdown:
46 × use-after-kill: a local is read after its reset-on-move blank zeroed it (the const-init lowering misplaces reset-on-move blank: Vec field zeroed before struct build when followed by HashMap move #719-family validator, dominance-proven). Distinct functions include Zcu.seed_decl_source_paths (_7 @ bb5), suspend_emit_no_suspend_error (_1 @ bb0), stackify_compute_preds (_6 @ bb4), Sema.substitute_method_return_for_generic_inst (_12 @ bb3), several ComptimeEvaluator.* / Codegen.* / CCodegen.* / conan/build-graph helpers — 46 total, one per function.
2 × frozen-phase mutable-Sema re-entry: Codegen.ast_static_type_expr -> Sema.struct_field_type_frozen_or_compute and Codegen.mir_project_field_sema_type -> Sema.struct_field_type_frozen_or_compute — codegen calling an _or_compute query that can mutate the type table after freeze.
Repro:
with analyze src/main.w audit:all # seed: violations=48 FAILED
./out/bootstrap/bin/with-stage1 analyze src/main.w audit:all # same 48
Each use-after-kill is a potential real read-of-blanked-storage miscompile in the compiler itself (the validator requires linear dominance before reporting, so false positives should be rare); the frozen-phase pair is the exact class audit:all was built to catch. Needs its own isolated batch (drop/blank scheduling → isolation rule applies). Not blocking the #740 battery per the D14/D19 tiers — the battery gates are build/fixpoint/test/move-audit/drop-audit — but audit:all cannot be part of any green claim until this is drained.
Current count on 830018d (v0.15.1.3 lineage, post-reseed): analyze src/main.w audit:all reports 129 violations (facts=2450842): 126 use-after-kill reads (was 46), 2 frozen-phase mutable-Sema re-entries (same two edges: Codegen.mir_project_field_sema_type and Codegen.ast_static_type_expr → Sema.struct_field_type_frozen_or_compute), and 1 effect edge not at fixpoint (sig 3189:3 -> 3079:0 missing=4, a category not present in the original report). The use-after-kill growth tracks the compiler source growth since 2026-07-29, not a specific regression — none of the newly flagged functions correspond to recent drop/ownership commits' touched code. Note the batch battery's audit:all gate runs against the deep-debug-tool-tests fixture, not src/main.w, so this count moves without tripping any gate.
Triage re-scope 2026-08-31: still failing and the set has GROWN — analyze src/main.w audit:all on v0.15.1.6-g6684d9c0e reports violations=129 FAILED (127 use-after-kill + the same 2 frozen-phase struct_field_type_frozen_or_compute re-entries; originally 48). Needs a dedicated drain in its own isolated batch (drop/blank isolation rule) before audit:all can join any green claim.
Update after be015f4 (reseeded): analyze src/main.w audit:all is down from 130 violations to 2.
All 128 use-after-kill findings were one validator bug, not compiler defects: validate_use_after_kill_body read rval_d0 as an operand for every rvalue kind, but for an aggregate that slot is the aggregate kind, for a binop the operator, and for a ref the borrow kind — so it looked up operand 0 of the body (a move-self function's self) and reported it read after its reset blank whenever such an rvalue followed the blank. The validator now enumerates each rvalue's value operands per kind (mir_rvalue_read_locals, the printer's layout as the contract). A minimal var owned = self; let pair = Pair { a: v, b: v } reproduced the false positive on a correct program and is now a deep-debug fixture expected to audit clean.
What remains here is exactly the two frozen-phase mutable-Sema re-entries:
2 frozen-phase re-entries (Codegen.ast_static_type_expr / mir_project_field_sema_type → Sema.struct_field_type_frozen_or_compute): fixed at the root in 20d9b3fd and the commit after it. Codegen now calls only the frozen read; the compute-on-miss twin is deleted. Removing it surfaced the case it had been repairing (behav_veciter_iter_sum trapped on VecIter[i32] with zero cached fields): both the visible and the "ambient" named-type lookups still filter by the current module's imports, so reflection on an inst reached through std.iter answered "no fields" during the eager cache passes. Reflection on an existing inst now resolves from registration truth when its base symbol has exactly one declared candidate, and the eager pass sweeps, after each pass, any generic inst whose template reflects fields now but whose caches were filled when it reflected none.
lib/std/build.w audits at 0 as well. Battery green (build, fixpoint, test), reseeded.
Correction: the two root-cause commits are 307ac4c (codegen reads the frozen cache) and b9d8149 (registration-truth reflection + eager-pass sweep); "20d9b3fd" in the close note was a typo.
Activity
ehartford commentedon Aug 18, 2026
Current count on 830018d (v0.15.1.3 lineage, post-reseed):
analyze src/main.w audit:allreports 129 violations (facts=2450842): 126 use-after-kill reads (was 46), 2 frozen-phase mutable-Sema re-entries (same two edges:Codegen.mir_project_field_sema_typeandCodegen.ast_static_type_expr→Sema.struct_field_type_frozen_or_compute), and 1 effect edge not at fixpoint (sig 3189:3 -> 3079:0 missing=4, a category not present in the original report). The use-after-kill growth tracks the compiler source growth since 2026-07-29, not a specific regression — none of the newly flagged functions correspond to recent drop/ownership commits' touched code. Note the batch battery's audit:all gate runs against the deep-debug-tool-tests fixture, not src/main.w, so this count moves without tripping any gate.ehartford commentedon Aug 31, 2026
Triage re-scope 2026-08-31: still failing and the set has GROWN —
analyze src/main.w audit:allon v0.15.1.6-g6684d9c0e reports violations=129 FAILED (127 use-after-kill + the same 2 frozen-phase struct_field_type_frozen_or_compute re-entries; originally 48). Needs a dedicated drain in its own isolated batch (drop/blank isolation rule) before audit:all can join any green claim.[-]audit:all reports 48 pre-existing violations on the shipped seed: 46 use-after-kill reads + 2 frozen-phase mutable-Sema re-entries[/-][+]audit:all fails on src/main.w: 129 violations (127 use-after-kill + 2 frozen-phase re-entries) — grown from 48; needs a dedicated drain[/+]Mir: use-after-kill validator decodes rvalue operands per kind (#927, #…
ehartford commentedon Sep 2, 2026
Update after be015f4 (reseeded):
analyze src/main.w audit:allis down from 130 violations to 2.All 128 use-after-kill findings were one validator bug, not compiler defects:
validate_use_after_kill_bodyreadrval_d0as an operand for every rvalue kind, but for an aggregate that slot is the aggregate kind, for a binop the operator, and for a ref the borrow kind — so it looked up operand 0 of the body (a move-self function'sself) and reported it read after its reset blank whenever such an rvalue followed the blank. The validator now enumerates each rvalue's value operands per kind (mir_rvalue_read_locals, the printer's layout as the contract). A minimalvar owned = self; let pair = Pair { a: v, b: v }reproduced the false positive on a correct program and is now a deep-debug fixture expected to audit clean.What remains here is exactly the two frozen-phase mutable-Sema re-entries:
Codegen.ast_static_type_expr -> Sema.struct_field_type_frozen_or_computeCodegen.mir_project_field_sema_type -> Sema.struct_field_type_frozen_or_computeThose are the real drain this issue is about; the "grown from 48 to 129" count was the validator, not growth.
Sema/Analysis: one effect-edge transfer rule for the fixpoint and aud…
Codegen: generic field projection reads the frozen Sema cache, never …
Sema: generic-inst reflection resolves from registration truth; eager…
ehartford commentedon Sep 2, 2026
Closed:
analyze src/main.w audit:allnow reports 0 violations (was 130 when the count was last taken this morning; 48 when filed).rval_d0read as an operand for every rvalue kind; see std.build audit:all reports use-after-kill in seven move-self builder fns (reset-on-move blank ordering) #927.Codegen.ast_static_type_expr/mir_project_field_sema_type→Sema.struct_field_type_frozen_or_compute): fixed at the root in 20d9b3fd and the commit after it. Codegen now calls only the frozen read; the compute-on-miss twin is deleted. Removing it surfaced the case it had been repairing (behav_veciter_iter_sumtrapped onVecIter[i32]with zero cached fields): both the visible and the "ambient" named-type lookups still filter by the current module's imports, so reflection on an inst reached throughstd.iteranswered "no fields" during the eager cache passes. Reflection on an existing inst now resolves from registration truth when its base symbol has exactly one declared candidate, and the eager pass sweeps, after each pass, any generic inst whose template reflects fields now but whose caches were filled when it reflected none.lib/std/build.waudits at 0 as well. Battery green (build, fixpoint, test), reseeded.ehartford commentedon Sep 2, 2026
Correction: the two root-cause commits are 307ac4c (codegen reads the frozen cache) and b9d8149 (registration-truth reflection + eager-pass sweep); "20d9b3fd" in the close note was a typo.