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
with analyze audit:resolution — every MIR callee/place/binding/effect and every codegen passing mode must agree with its one authoritative producer (D65) #1647
D65 (decisions.md) makes it a rule: each semantic fact has one authoritative producer (Sema: resolved declaration, type, place/value/view category, origin, operation effect, capture semantics, call target; MIR: CFG, storage, path-sensitive move/init state, drop points, cleanup edges; ABI/codegen: layout, PassMode, calling convention, LLVM representation). Downstream stages may propagate, materialize and verify a fact; they may not reconstruct it from syntax or representation. This issue is the executable half: a with analyze lane, audit:resolution, included in audit:all, red on:
a MIR place lowered from a source expression that does not correspond to Sema's resolved place/origin for that node (field index, autoderef, alias/view origin);
a MIR move/borrow/capture classification that disagrees with Sema's effect summary for that operation (D62/D63 closure captures; consuming calls);
a codegen marshalling decision taken from an LLVM type inspection rather than an explicit PassMode (the &fn marshalling crash: marshal_ref_addr passed a bare function item's code pointer because "the value is already a pointer").
The facts already exist on both sides (resolved_call_sigs, typed_expr_types, expr_view_param_origins, effect summaries, MIR call/place/argument facts, codegen marshalling facts with analysis_last_marshal_strategy); the lane joins them per node, like audit:calls/audit:mir do today. Violations are compiler failures (with build :dev and the battery run audit:all over the fixture corpus). Build it incrementally: (1) callee agreement first (would have caught #1635), (2) codegen mode provenance (would have caught the &fn crash), (3) places, (4) effects. Deferred large cleanup of MirLower's AST-first lookups until after STC (docs/stdlib_sourcing_plan.md); every bug fixed from now on moves its answer to the owner instead of adding a second derivation.
Phase 2 — codegen mode provenance: not done.CodegenDispatch.w:marshal_ref_addr still decides by wl_get_type_kind(val_ty) == wl_pointer_type_kind() (the "already a pointer" branch), and the same LLVM-type test decides marshalling at ~10 more sites in CodegenDispatch.w (lines 1201, 1215, 1318, 1401, 1423, 1574, 1599, 1627, 1699, 1912). No type-inspection reason is recorded or audited.
Phase 3 — places/origins: not done.src/AnalysisResolution.w header: "Places/origins (phase 3) and effects (phase 4) follow."
Phase 4 — effects: not done (same).
Phase 5 — MirLower cleanup: not started (sequenced after STC per §5).
Acceptance §6 is therefore 1 of 4 categories. Leaving open.
Phases 2–4 landed in 0f0d76b (#2012): codegen passing modes from FnAbi (8 sites, audit:codegen red→0); MIR field places / let bindings / call-argument transfers judged against Sema (0 violations over src/main.w, planted cases prove each lane fires). Remaining unconverted sites (mir_try_place_ptr_for_ref, mir_operand_local_holds_pointer, view origins and index/field projections by name, closure capture modes, LLVM-path sizeof from the AST, non-generic struct field types) are in progress on wave-d65b.
Activity
D65: one authoritative producer per semantic fact (Sema what / MIR wh…
analyze: audit:resolution phase 1 — every MIR callee and argument cou…
test/internals: planted fixtures for audit:resolution and the unknown…
docs: audit:resolution in deep-debugging-tools and the analyzer reque…
fixup! analyze: audit:resolution phase 1 — every MIR callee and argum…
MIR states the calls it materializes without a call fact, and audit:r…
analyze: audit:resolution phase 1 — every MIR callee and argument cou…
test/internals: planted fixtures for audit:resolution and the unknown…
docs: audit:resolution in deep-debugging-tools and the analyzer reque…
MIR states the calls it materializes without a call fact, and audit:r…
analyze: audit:resolution phase 1 — every MIR callee agrees with Sema…
ehartford commentedon Oct 2, 2026
Status on main (30f89aa), per
docs/spec/implementation/mir-sema-hardening.md§4:audit:resolutionexists, is inaudit:all, checks every MIR callee and argument count against Sema's resolution;--validate-allrefuses a signature-lessconst fncallee (validate-all is silent on a direct call to an unresolvable CK_FN symbol with the source arguments dropped (#1635's MIR passed as ok) #1639).CodegenDispatch.w:marshal_ref_addrstill decides bywl_get_type_kind(val_ty) == wl_pointer_type_kind()(the "already a pointer" branch), and the same LLVM-type test decides marshalling at ~10 more sites inCodegenDispatch.w(lines 1201, 1215, 1318, 1401, 1423, 1574, 1599, 1627, 1699, 1912). Notype-inspectionreason is recorded or audited.src/AnalysisResolution.wheader: "Places/origins (phase 3) and effects (phase 4) follow."Acceptance §6 is therefore 1 of 4 categories. Leaving open.
D65: methods and trait impls of same-named types are their declaratio…
ehartford commentedon Oct 3, 2026
Phases 2–4 landed in 0f0d76b (#2012): codegen passing modes from FnAbi (8 sites, audit:codegen red→0); MIR field places / let bindings / call-argument transfers judged against Sema (0 violations over src/main.w, planted cases prove each lane fires). Remaining unconverted sites (mir_try_place_ptr_for_ref, mir_operand_local_holds_pointer, view origins and index/field projections by name, closure capture modes, LLVM-path sizeof from the AST, non-generic struct field types) are in progress on wave-d65b.
19 remaining items
A user generic struct instance is laid out from Sema's instance recor…
deep-debug-tool-tests audits the per-instance and gen-push fixtures; …
A declared function's LLVM return type is its Sema signature's, not a…
TypeLayout lays out a generic instance from its own declaration, neve…
Re-record docs/with-abi.sha256 for TypeLayout's declaration fix (#1647)
#1647 phases 2–4 completion: owner facts in codegen, per-instance Sem…
ehartford commentedon Oct 3, 2026
Phases 1–4 complete on main 74e3001 (stack #2032, battery GREEN): codegen reads FnAbi/TypeLayout/Sema for pointer-holding, sizeof/alignof, field types and indexes, closure captures; Sema records per-instance index/field facts; MIR projections carry Sema's declaration index; monomorphize_struct_nodes' LLVM-layout path deleted; audit:all on src/main.w = 0 violations. Phase 5 continues as #2043.
A call whose callee is a name lowers by Sema's record of what the nam…
A call whose callee is a name lowers by Sema's record of what the nam…
A call whose callee is a name lowers by Sema's record of what the nam…
A call whose callee is a name lowers by Sema's record of what the nam…
A call whose callee is a name lowers by Sema's record of what the nam…
A call whose callee is a name lowers by Sema's record of what the nam…
#2043: name-callee calls lower by Sema's resolved kind; sym_is_generi…