FOLD-IN + SUPERSEDE + GRIND-HERE (plan-wide standing directive — see overview Mission §Bug Fold-In + Supersession, ABSOLUTE). Every failing burden/RC-emission floor cell this section touches is worked HERE as part of this plan’s grind; any
BUG-XX-NNNcovering it, including BUG-04-118, BUG-04-142, BUG-04-156, the #150 same-allocation-identity class, and every sibling RC-emission bug, is FOLDED INTO this plan and SUPERSEDED — NEVER deferred to / routed away as separate bug tracking, a “separate architecture-level pass”, or “already tracked elsewhere”. Dead-end / deferred-compound / reclassified classifications (decisions/LEDGER.md §6) shape WHAT the fix is; they NEVER exit the cell from this plan. If the correct fix is an architecture-level pass, building it IS this plan’s work. Calculus-first perarc.md §CP-1; one terminal gate =./test-all.shzero failing cells.
RC-REMARKS CO-EVOLUTION (plan-wide standing directive — see overview Mission §8, ABSOLUTE). This grind is the rc-remarks RC-survivor observability system’s first real test: every floor cell / surviving-RC cluster this section works MUST be grounded via the burden-sole rc-remark stream (
ori build --emit-rc-remarks+intel-query.sh rc-survivors --by-cause/rc-cause-rank) before hypothesizing a fix, AND when the stream/analyzer/query falls short for a real cell, improving rc-remarks (producerori_arc/.../rc_remark.rs, analyzertools/ori-rc-remarks, intelimport_rc_remarks.py+query_graph.pyrc-* handlers) IS this section’s work for that cell — never deferred as separate observability work. Burden-sole verdict discipline (arc.md §STOP) unchanged.
Section 05: Phase 6 Lattice Rewrite + RL-31
Goal: Per proposal §Design — Phase 6 (Lattice Analysis) — Optimization Over Burden Baseline. The lattice’s role narrows from constructor-of-correctness to optimizer.
Context: Critical invariant per proposal: “the lattice only ever ELIMINATES burden-emitted ops; it never CONSTRUCTS them.” Note the honest qualification: an OVER-elimination bug where DP-2 removes a BurdenDec that should fire produces a leak; over-elimination of an inc-dec pair where the elimination is wrong because alias-tracking input is wrong CAN produce double-frees. The burden model dissolves predicate-stack-EMISSION failure mode but inherits lattice’s elimination-side dependency on accurate alias-tracking infrastructure (project_alias_sources, borrow_sources).
Reference implementations:
- Roc
compiler/gen_refcount/post-emission optimization passes — Perceus’s pair-elimination shape (Phase 6 mirrors this). - Lean 4
IR/RC.leanfollowed by simplification passes — same shape.
Depends on: Section 04B (Prototype Gate verdict unblocks §05: pass, partial-pass-criterion-6 with extensions documented, OR impl-fidelity-routing per the §04B.N proven_by override — the DEFAULT verdict, where empirical criterion FAILs are impl-fidelity divergence sites cured by §05→§07→§09, §05 NOT voided).
Intelligence Reconnaissance
Queries:
scripts/intel-query.sh --human file-symbols "compiler_repo/compiler/ori_arc/src/aims" --repo oriscripts/intel-query.sh --human callers MemoryContract --repo oriscripts/intel-query.sh --human similar pair_elimination --repo roc,lean4 --limit 5
Queried: 2026-05-08.
Results summary (≤500 chars) [ori]: existing AIMS infrastructure consumed; section work extends or migrates within unified model per missions.md §AIMS invariant 5. No parallel paths, no shadow trackers.
05.0 IC-1 enforcement precondition (absorbs BUG-04-112)
Status: complete (per frontmatter SSOT sections[].id 05.0, state-discipline.md §1; all §05.0 tasks below are [x] with DELIVERED evidence). The BUG-04-112 absorption scope is in the **Precondition relationship:** block below + the closed bug-plan archive at bug-tracker/plans/completed/BUG-04-112/ (investigation history; superseded by this section per the 2026-05-16 audit-correction HISTORY entry in 00-overview.md).
Precondition relationship: §05.2 success criterion 7 declares “Interprocedural MemoryContract SCC fixpoint: computes ParamContract / ReturnContract / EffectSummary exactly as today.” That “exactly as today” claim is sound ONLY when the contract layer enforces IC-1 — every func.name in func_by_name post-fixpoint has a MemoryContract entry. The shipped code silently degrades on absence at the 12 lookup sites in the BUG-04-112 grep inventory. This subsection hardens the 10 in-scope sites BEFORE §05.1 begins; the 2 remaining sites dissolved naturally via §03.3 Rule 1 Return-transfer burden semantics (cycles 32-39 close-out, 2026-05-15).
File(s):
compiler_repo/compiler/ori_arc/src/aims/contract/mod.rs—ContractMapExttrait + impls (already landed pre-Phase-2.5 at lines 653-684, recorded in the BUG-04-112 section-05 implementation archive §1.0)compiler_repo/compiler/ori_arc/src/aims/contract/tests.rs— H1-H6 unit testscompiler_repo/compiler/ori_arc/src/pipeline/aims_pipeline/{batch.rs,mod.rs,postprocess.rs,trmc.rs}— sites 1-5 + 7 + 9-10 replacementscompiler_repo/compiler/ori_arc/src/aims/emit_reuse/mod.rs— site 6 replacementcompiler_repo/compiler/ori_arc/src/aims/emit_rc/drop_hints/mod.rs— site 8 explicit-match +debug_assert!+func_by_namethreading throughis_safe_non_sharing_callee+collect_borrowed_call_argscompiler_repo/compiler/ori_arc/src/aims/realize/mod.rs— site 8 call-site update at line 218 (threading)- Test fixtures:
compiler_repo/compiler/ori_arc/src/tests.rs:26+compiler_repo/compiler/ori_arc/src/pipeline/tests.rs:377/439/491(F1-F4 empty-map sites cured via populatedMemoryContractpre-insertion)
Site inventory (10 absorbed sites + 2 dissolved-via-burden)
Anchors below are span/symbol-named (verified against HEAD), NOT bare line numbers — re-resolve via grep -n on the named span/symbol, the line numbers in parens are HEAD-as-of-2026-06-01 confirmations only.
| Site | Span / symbol anchor (compiler_repo/compiler/ori_arc/src/...) | Cure | Status |
|---|---|---|---|
| 1 | pipeline/aims_pipeline/batch.rs — tracing::info_span!("contract_coherence_oracle") (span :99; contracts.get(&func.name) :101) | get_required("contract_coherence_oracle") | Absorbed here |
| 2 | pipeline/aims_pipeline/batch.rs — tracing::info_span!("post_emission_fip_verify") second-pass FIP verify (span :212; contracts.get(&func.name) :223) | get_required("post_emission_fip_verify") | Absorbed here |
| 3 | pipeline/aims_pipeline/batch.rs — fn apply_aims_ownership (:255; contracts.get(&func.name) else-guard :260) | get_required("apply_aims_ownership") | Absorbed here |
| 4 | pipeline/aims_pipeline/trmc.rs — contracts.get(&func.name) (:24; trmc_entry candidate detection); wrap with Some(...) at the candidate-detection call site; rollback path retains None per §02 §4.1 of archived bug-plan | get_required("trmc_entry") | Absorbed here |
| 5 | pipeline/aims_pipeline/mod.rs — fn fip_precheck (:335; config.contracts.get(&func.name) :340) — NOTE mod.rs:269 is now reconcile_burden_ledger, NOT a contract lookup; the fip_precheck lookup is the real site | get_required("fip_precheck") | Absorbed here |
| 6 | aims/emit_reuse/mod.rs — fn emit_reuse_from_raw (:139; contracts.get(&func.name) :146) | get_required("emit_reuse_fip") + apply_fip_upgrades signature change Option<&FipContract> → &FipContract; FipContract::Never arm absorbs old None semantics per §02 §4.3 of archived bug-plan | Absorbed here |
| 7 | pipeline/aims_pipeline/postprocess.rs — tracing::info_span!("aims_verify") (span :30; config.contracts.get(&func.name) :29) | get_required("aims_verify_postprocess") | Absorbed here |
| 8 | aims/emit_rc/drop_hints/mod.rs — fn is_safe_non_sharing_callee (:176; contracts.get(&callee) :186) | Explicit match contracts.get(&callee) + debug_assert!(!func_by_name.contains_key(&callee), "AIMS Invariant IC-1: ... pipeline ordering violation") + thread func_by_name through is_safe_non_sharing_callee (:176) + collect_borrowed_call_args (:41) + their call sites (:64, :100) + aims/realize/mod.rs realize call site | Absorbed here |
| 9 | pipeline/aims_pipeline/batch.rs — tracing::info_span!("trmc_contract_refresh") (span :149; contracts.get_mut(&name) :174) | get_mut_required("trmc_contract_refresh") | Absorbed here |
| 10 | pipeline/aims_pipeline/batch.rs — tracing::info_span!("post_emission_fip_update") (span :188; contracts.get_mut(name) :191) | get_mut_required("post_emission_fip_update") | Absorbed here |
| 11 | aims/realize/emit_unified.rs — return_transfer_params symbol | Dissolves: §03.3 Rule 1 (Return-transfer) — Phase 5 emits BurdenInc at Return terminator for transfers_through_return params; Phase 6 lattice eliminates redundant pairs; the function-level metadata is no longer required because the semantics flow through per-instruction burden ops | Dissolved (cycles 32-39, 2026-05-15) |
| 12 | aims/realize/emit_unified.rs — return_project_inc_targets symbol | Dissolves: same as site 11 — Phase 5 BurdenInc at Project capture / Return for return_alias = Some(Project { _ }) params encodes the compensating-Inc semantic burden-natively | Dissolved (cycles 32-39, 2026-05-15) |
Tasks
Archived bug-plan reference
Full investigation history (Phase 1 RCA, Phase 1.75 /tp-help Round 1 consensus on cure shape, Phase 2 fix-consensus across all 12 original sites including persuaded-divergence on TRMC Option-scope, test-fixture pre-emptive cures, Site 8 debug_assert! enhancement; Phase 2.5 Plan TPR Rounds 0-7 convergence trajectory): bug-tracker/plans/completed/BUG-04-112/ — see archive’s 00-overview.md ## HISTORY block for the 7-round convergence detail.
Subsection close-out (05.0) per protocol — runs BEFORE §05.1 (the precondition relationship).
- Verify shipped state:
ContractMapExt::get_required+get_mut_requiredexist atcompiler_repo/compiler/ori_arc/src/aims/contract/mod.rs:655-686(already landed pre-Phase-2.5); H1-H6 unit tests appended atcompiler_repo/compiler/ori_arc/src/aims/contract/tests.rs. - Test-fixture pre-emptive cures (F1-F4 per archived bug-plan §03 §5): each empty
FxHashMap::default()site atcompiler_repo/compiler/ori_arc/src/tests.rs:26+compiler_repo/compiler/ori_arc/src/pipeline/tests.rs:377/439/491gets a populated conservativeMemoryContractfor the syntheticfunc.nameBEFORE constructingAimsPipelineConfig. (Therun_arc_pipelinesingle-function entry ALSO seedsfunc’s own conservative contract viaensure_own_contract— see the Sites-11-12 / out-of-batch note below — so codegen of test/impl/derive bodies outside the interprocedural batch never panics.) - Replace 9 sites with
get_required/get_mut_required(sites 1-7 + 9-10) per the inventory table above; each cure replaces a silent-degradation no-else /unwrap_or_default/is_some_andpattern with an IC-1 panic. Addedfunc_names: &FxHashSet<Name>toAimsPipelineConfig(sourced from thefunctionsslice in the batch path, from the contracts keyset in the single-function path) to drive the site-8 IC-1debug_assert!. - Site 8 cure: explicit lookup (
if let Some(c) = contracts.get(&callee) { ... } else { debug_assert!(...) }, clippy-rewritten frommatch) +debug_assert!in theNonearm + threadedfunc_names: &FxHashSet<Name>throughis_safe_non_sharing_callee+collect_borrowed_call_args+realize_annotations(+AimsPipelineConfig.func_names). - TDD matrix: H1-H6 helper cells (
contract/tests.rs); Site 8 cells 8a-8e (drop_hints/tests.rs, 8e split debug/release via#[cfg(debug_assertions)]); INV1 + INV2 (pipeline/tests.rs); F1-F4 fixture cures. cell 8e exercisesdebug_assert!in debug build (panic) and returns false silently in release (sibling test); both gates required + passing. - Pre-fix verification: H1-H6 cells PASS (helpers already exist); INV2 panics on synthetic break (
run_aims_pipelinedirect with empty contracts →unreachable!at firstget_required); 8e debug_assert fires in debug only. - Post-fix verification: BOTH
cargo test -p ori_arc(debug) ANDcargo test -p ori_arc --releaseGREEN (1501 debug / 1498 release lib tests, 3 debug-only cfg-gated). Production call sites: grep\.get_required\(returns 8 (sites 1-7 PLUS the re-absorbed site-11/12emit_unified_return_transfer_setupper the escape-hatch below); grep\.get_mut_required\(returns 2 (sites 9-10); site 8AIMS Invariant IC-1debug_assert present indrop_hints/mod.rs. - Tests: INV2 = semantic pin (fails on revert — re-surfaces silent fallback); H2/H5/8c/8e = negative pins rejecting silent-degradation.
- Sites 11-12 dissolution verification: grep confirmed the
build_return_transfer_setupfunction-level metadata mechanism PERSISTS (the §03.3 Rule 1 dissolution did NOT remove the lossycontracts.get(&func.name).map(...).unwrap_or_default()lookup). Per the escape-hatch, sites 11-12 RE-ABSORBED into §05.0 scope: cured withget_required("emit_unified_return_transfer_setup")(1 supplementary immutable site, bringing the immutable total to 8). No re-opening of BUG-04-112. - Cross-plan —
ParamContract.may_escapeform: locality-representation-unification has NOT landed —ParamContract.may_escaperemains a stored field (contract/mod.rs). §05.0 proceeds against the stored-field form; nomay_escape()method-call migration required. Advisory/non-blocking perrouting.md §1.
05.1 Lattice consumption-mode shift (emission → elimination)
Vocabulary boundary: AIMS decides logical ownership events and mutation obligations. Burden* names below are transitional Phase-6 carriers used to observe those logical decisions; Rc*, CowMode, and IsShared belong only to the current Phase-7 compiled adapter and are not calculus outputs.
File/site inventory (verified against HEAD 2026-06-01). Anchors are symbol-named; re-resolve via grep -n on the symbol. All paths compiler_repo/compiler/ori_arc/src/aims/....
| Site | Symbol anchor | Current role | Target role (this subsection) |
|---|---|---|---|
| Elimination consumer (already present, §04A) | realize/burden_elim.rs — fn eliminate_burden_ops (:87) + fn eliminate_in_block (:122) | Backward-walks each BurdenInc/BurdenDec/BurdenDecPartial/BurdenDecField/BurdenDecVariant site, queries DP-2/DP-3, marks for elimination | UNCHANGED — this is the canonical elimination site; §05.1 verifies no OTHER site constructs burden ops |
| DP-1 predicate | lattice/mod.rs — fn needs_ownership_events | Pure lattice predicate for whether logical ownership events are required | UNCHANGED — shared decision surface for every physical target |
| DP-2 predicate | transfer/mod.rs — fn is_release_event_unnecessary | Pure lattice predicate (Cardinality=Absent ∨ Consumption=Dead) | UNCHANGED — consumed by burden_elim.rs only |
| DP-3 predicate | transfer/mod.rs — fn is_additional_credit_elidable | Pure lattice predicate (Cardinality=Once ∧ (Consumption=Linear ∨ Consumption=Affine)) | UNCHANGED — consumed by burden_elim.rs only |
| Ownership-event decision site | realize/decide.rs — fn decide + fn decide_last_use | Decides logical release/additional-credit placement | Audit: confirm these no longer CONSTRUCT transitional carriers on the burden path (Phase 5 emits; Phase 6 only eliminates) |
| Mutation-obligation seed | transfer/mod.rs — fn cow_obligation_from_uniqueness + CowMutationObligation | Produces backend-neutral DP-9 obligation; shared borrow-safety refinement may only strengthen it before projection | Audit: no physical CowMode, copy, or IsShared choice crosses this seam |
| Annotation decision site | realize/decide.rs — fn decide_annotations + fn decide_drop_hint | Consumes frozen mutation/reuse/drop facts for target adaptation | Audit: annotation-only (compound lowering), confirm no NEW transitional ownership-event carriers |
| Walk emission sites | realize/walk.rs + realize/walk_dec.rs + realize/emit_unified.rs | Per-instruction RC/burden walk + dec placement + unified emission | Audit each emission call: under burden discipline these must ELIMINATE (mark) burden-emitted ops, never CONSTRUCT new ones |
Audit outcome (verified against HEAD). The lattice consumption mode is ALREADY elimination — eliminate_burden_ops (realize/burden_elim.rs, Phase 2.5 of emit_rc_unified) is the SOLE Phase-6 burden-op consumer and it ONLY removes/compacts; it never appends. The inventory sites split into three classes, none of which construct burden ops in Phase 6:
realize/burden_elim.rseliminate_burden_ops— the canonical Phase-6 eliminator. Removal-only (compacts viabody.retain). Now carries the §05.1 structural enforcement.transfer/mod.rsDP-2 (is_release_event_unnecessary) / DP-3 (is_additional_credit_elidable) — pure predicates; consumed ONLY byburden_elim.rs. Unchanged.transfer/mod.rs::cow_obligation_from_uniquenessplusrealize/decide.rs(decide/decide_last_use/decide_annotations/decide_cow/decide_drop_hint) andrealize/walk.rs— the logical-decision seed plus its current compiled-adapter compatibility surface. The retiring predicate stack emits physicalRcInc/RcDec;walk.rspreserves transitionalBurden*carriers verbatim and constructs no such carriers. NOT extended (per LEDGER §B).
Burden-op CONSTRUCTION lives only outside Phase 6: Phase 5 (lower/burden_lower/emit.rs emit_burden_ops) and the §03A coexistence-mirror scaffold (realize/burden_mirror.rs reconcile_burden_ledger + the adjacent edge/trampoline BurdenDec markers in emit_rc/edge_cleanup.rs / emit_rc/trampoline.rs), the latter §09-retired. No Phase-6 construction site exists; the audit converts nothing because the consumption mode is already correct.
Structural enforcement (CRITICAL invariant made loud). eliminate_burden_ops now takes a per-kind burden-op census (burden_op_census) before AND after the elimination loop and asserts the post-pass census is ≤ the pre-pass census for EVERY burden-op kind (debug_assert_burden_removal_only, backed by the release-safe SSOT predicate is_burden_removal_only). A future regression that appends a BurdenInc/BurdenDec* inside Phase 6 trips the guard loudly (debug) rather than silently lowering to a spurious RcInc/RcDec in Phase 7.
Tests (realize/burden_elim/tests.rs): phase6_is_elimination_census_strictly_shrinks (semantic positive pin — fails on revert if Phase 6 stopped eliminating or became a constructor); phase6_preserves_census_when_nothing_elidable (lower-bound clamp — never grows); removal_only_predicate_rejects_construction_per_kind (release-safe negative pin — rejects construction of every kind); debug_guard_panics_on_phase6_construction (debug-build #[should_panic] guard pin). All pass debug + release (debug-only pin excluded under --release).
Subsection close-out (05.1) per protocol.
- Audit every site in the inventory above where lattice analysis DECIDES where to emit RC ops; convert each site to make an ELIMINATION decision over burden-emitted ops.
- Verify the CRITICAL invariant: lattice never constructs new BurdenInc/BurdenDec — only marks for elimination.
- Tests: lattice fixpoint produces correct burden ops post-elimination; no construction.
05.2 Dimension wiring audit
Per-task consumer source files verified against HEAD 2026-06-01 (re-resolve symbols via grep -n; all compiler_repo/compiler/...).
| Dimension | Consumer | Positive pin (asserts correct elimination/decision) | Negative pin (rejects broken behavior) |
|---|---|---|---|
| Cardinality + Consumption | DP-2 is_release_event_unnecessary / DP-3 is_additional_credit_elidable | Cardinality=Absent ∨ Consumption=Dead removes the logical release obligation; Cardinality=Once ∧ (Consumption=Linear ∨ Consumption=Affine) removes additional owner credit. Current transitional carriers: BurdenDec / BurdenInc | Cardinality=Many ∧ Consumption=Unrestricted retains both logical events (removing either would leak or over-release) |
| Uniqueness + borrow safety | DP-9 cow_obligation | safe Unique → SameIdentityPermitted; MaybeShared → SharingObservationRequired; Shared or overlapping borrow → AliasIsolationRequired | MaybeShared is NOT forced to SameIdentityPermitted absent IC-3 ParamContract.uniqueness=Unique plus borrow safety |
| Shape + Uniqueness | DP-6 is_reuse_candidate (RL-11/RL-11a) | Owned ∧ ≠Shared ∧ ReusableCtor → Reset/Reuse emitted | Shared shape → NonReusable (CN-3); reuse NOT emitted (non-unique reuse corrupts aliases pin) |
| Locality + ownership-observation facts | Neutral lifetime/ownership eligibility via LifetimeBound, OwnerBound, and OwnershipObservationFacts | Locality ≤ FunctionLocal ∧ Unique freezes a bounded lifetime plus exclusive logical ownership; stable additional-credit, release, and sharing-observation event identities let each VM or compiled layout validate its own frame, region, headerless, or counted encoding | Locality > FunctionLocal forbids a frame-local extent, and unknown ownership-observation evidence forbids physical count elision; no AIMS rule selects LLVM alloca or an exact header width |
| Effect/return/disjointness facts | Backend-neutral RL-29/RL-30/RL-31 fact freeze | fresh-self-allocation return freezes the RL-29 fact; a typed no-write proof may freeze ReadOnly | passthrough/storage-takeover return is not fresh-self-allocation; print/panic/unknown calls fail closed as ReadWrite; LLVM attributes are projection-only |
| TRMC (PL-7..PL-11) + Immortal pre-pass + Interprocedural MemoryContract SCC fixpoint | structural rewrite / AimsStateMap::immortals / contract computation | TRMC candidate over burden-emitted IR → context-hole threaded, arity preserved (PL-10 a/d); immortal var → RC/COW/reuse skipped; SCC fixpoint computes ParamContract/ReturnContract/EffectSummary identical to pre-burden baseline (depends on §05.0 IC-1: every post-fixpoint func.name has a MemoryContract entry) | PL-10 structural check fails → rollback to pre-TRMC + re-run Steps 3-4 (NOT ship the unsound rewrite); IC-1 absent contract → get_required panic (NOT silent degradation per §05.0) |
Test matrix delivered. Each dimension’s positive + negative pin landed against its shipped consumer predicate:
- Cardinality + Consumption → DP-2/DP-3 (
eliminate_burden_opsover burden-emitted IR):compiler_repo/compiler/ori_arc/src/aims/realize/burden_elim/tests.rs(pre-existing 25-cell DP-2 × DP-3 × burden-op-variant matrix + §05.1 census/removal-only pins — positive: DP-3 removes additional credit forOnce ∧ (Linear ∨ Affine)when the realization safety preconditions hold; negative:Many ∧ Unrestricted/Many ∧ Linearpreserve it. Any wider-locality Affine retention belongs to the separate realization safety guard, not the DP-3 truth table). - Uniqueness → DP-9 COW obligations, Shape + Uniqueness → DP-6
is_reuse_candidate, Locality → DP-7/DP-8 (is_event_pair_elision_eligible/is_local):compiler_repo/compiler/ori_arc/src/aims/realize/dimension_consumer/tests.rs(new). The pins establish same-identity permission, alias-isolation, sharing-observation, reuse eligibility, and bounded lifetime without prescribingIsShared, copying, counters, or storage. - Historical LLVM-local effect scan (superseded, not AIMS authority): §05.2 once pinned
has_only_pure_arc_instructionsinori_llvm::purity_analysisand treated it as amemory(none)gate. That was a backend-local re-derivation and did not prove RL-30. Production deletes that scan, freezes exact stable-ID neutral facts during AIMS realization, transports them validation-only, projects only provedReadOnlyasmemory(read), and forbidsmemory(none)until inaccessible reads and writes are modeled.
Revert-sensitivity confirmed by mutation: breaking the is_local order-gate (always-true) fails the HeapEscaping not-local + not-event-pair-elision-eligible negative pins.
Subsection close-out (05.2) per protocol.
- Cardinality + Consumption dimensions: drive DP-2 (
is_release_event_unnecessary) + DP-3 (is_additional_credit_elidable) per logical ownership event. Source: predicates atori_arc/src/aims/transfer/mod.rs; consumer atori_arc/src/aims/realize/burden_elim.rs(fn eliminate_burden_ops).eliminate_burden_opsis the SOLE Phase-6 transitional-carrier consumer; it queries DP-2/DP-3 againstvar_state_at_block_exitand removes only. Paired elimination preserves VF-1 logical owner-credit/release balance. TransitionalBurden*carriers are TF-N/A in both transfer directions, soblock_exit_stateis the per-event state. Already pinned inrealize/burden_elim/tests.rs(25-cell DP-2/DP-3 × variant matrix + §05.1 census pins). - Uniqueness plus borrow safety drives DP-9
cow_obligation: safeUnique→SameIdentityPermitted;MaybeSharedwithout a disjointness proof →SharingObservationRequired;Sharedor an overlapping borrow →AliasIsolationRequired. Source:ori_arc/src/aims/transfer/mod.rs::cow_obligation_from_uniquenessreturns the canonicalCowMutationObligationseed; shared borrow-safety refinement may strengthen that seed before any target projection. The consumer reads converged Uniqueness and borrow facts regardless of transitional carrier presence. The current compiled Phase-7 adapter maps these obligations throughdecide_cow/CowMode(StaticUnique/Dynamic/StaticShared) and may emitIsShared; that mapping is compatibility evidence, not an AIMS output. - Shape + Uniqueness: drive FBIP / Reset / Reuse (DP-6, RL-11, RL-11a) — unchanged. Source:
ori_arc/src/aims/emit_reuse/detect.rs(find_reuse_opportunities_from_events:104, DP-6 eligibility) +ori_arc/src/aims/emit_reuse/planner.rs(Reset/Reuse planning) +ori_arc/src/aims/emit_reuse/dynamic.rs(RL-11a dynamic-uniqueness path). VERIFIED:find_reuse_opportunities_from_events:104 confirmed; the DP-6 eligibility predicate isAimsState::is_reuse_candidate(lattice/mod.rs:413) =Owned ∧ uniqueness ≠ Shared ∧ shape ≠ NonReusable— gates on BOTH Shape and Uniqueness.MaybeSharedreusable shapes still qualify (RL-11a dynamic path);SharedandNonReusableare rejected (CN-3). Consumer reads converged Shape+Uniqueness; burden-transparent. Role survives. - Locality continues to drive neutral lifetime eligibility; exact placement/header width does not. The shipped order-based consumers are
AimsState::is_localandis_event_pair_elision_eligible, which remain variant-count-agnostic. The oldori_llvm::abistack/header passes were stubbed and are not AIMS consumers. Production freezes lifetime/locality,OwnerBound,OwnershipObservationFacts(stable additional-credit, release, and sharing-observation event identities), and external visibility, then combines them with representation-owned extent evidence soVmLayoutPlanandCompiledLayoutPlancan select and validate physical storage and width independently. - Cross-plan sequencing dependency (advisory, non-blocking) —
plans/locality-representation-unification/: this plan adds a 5th Locality variant (ArgEscaping) + raisesCHAIN_HEIGHT15→16 + convertsParamContract.may_escapefrom a stored field to a derived method. IMPACT on §05.2: if locality has landed, the lattice this section optimizes over is 5-variant andmay_escapeis a method call — verify the order-based Locality predicates (RL-14/RL-17/RL-18 + DP-7/DP-8) hold across all 5 variants (the proven invariant peraims-proofing-suite §08RL-15a/RL-18a + §05 DP-7/DP-8). SEQUENCING: SHOULD execute §05 after locality to avoid acontract/+ split-aims/-file rebase; if locality has NOT landed, §05 proceeds against the shipped 4-variant form (no §05 logic change either way). Schema restrictssubsection_depends_on:/blocked_by:to in-plan IDs /BUG-XX-NNN, so this cross-plan optional dependency binds via this explicit task + the 2026-05-27 HISTORY entry +decisions/04Clarification rather than a frontmatter ordering edge; structural sequencing tooling reads this task marker. VERIFIED (advisory, non-blocking): locality-representation-unification has NOT landed — shippedLocalityis 4-variant (BlockLocal | FunctionLocal | HeapEscaping | Unknown) peraims/lattice/dimensions.rs;ParamContract.may_escaperemains a stored field peraims/contract/mod.rs. The order-based DP-7/DP-8 predicates (is_local/is_event_pair_elision_eligible) are confirmed variant-count-agnostic (gate on≤ FunctionLocal/≥ HeapEscaping, never on a variant count). §05.2 proceeds against the shipped 4-variant form; the negative pins clampHeapEscapingandUnknownso the predicates hold whenArgEscapinglands.ArgEscaping > FunctionLocal, sois_localandis_event_pair_elision_eligibleboth remain false. No §05 logic change is required. - Effect/return/disjointness analysis continues to produce interprocedural neutral facts. The former
ori_llvm::purity_analysisARC-shape scan and ABI-local attribute derivation are historical migration gaps, not RL-29/RL-30/RL-31 implementations. The production consumer is an exact stable-ID fact plan frozen by AIMS and validated without recomputation; LLVM, VM, native, compiled-WebAssembly, and JIT project or consume those same facts independently. - TRMC structural rewrite (PL-7..PL-11): operates over burden-emitted IR — unchanged. Source:
ori_arc/src/pipeline/aims_pipeline/trmc.rs(TRMC normalization +verify_trmc_soundness). VERIFIED:normalize_with_trmc+verify_trmc_soundnessconfirmed intrmc.rs;normalize_with_trmcconsumesconfig.contracts.get_required(&func.name, "trmc_entry")(the §05.0 IC-1-hardened lookup). TRMC runs at Step 3a over the lowered ArcFunction; burden ops are per-instruction and TF-N/A, so context-hole threading + arity preservation (PL-10) operate over the same structural shape regardless of burden-op presence. Depends on §05.0 IC-1 (complete). Role unchanged. - Immortal pre-pass: continues to feed AimsStateMap as typed pre-pass input — unchanged. Source:
ori_arc/src/aims/immortal/(AimsStateMap::immortalsbitvector population). VERIFIED:aims/immortal/confirmed (mod.rs + tests.rs);intraprocedural/mod.rs:150-155 populatesimmortals: Vec<bool>and callsstate_map.set_immortals(immortals). Immortal detection feeds the lattice-driven analysis as a typed pre-pass input (Invariant-5 avenue (c)) — it is NOT a lattice dimension and does not interact with burden-op emission. Role unchanged. - Interprocedural MemoryContract SCC fixpoint: computes ParamContract / ReturnContract / EffectSummary exactly as today. Source:
ori_arc/src/aims/interprocedural/mod.rs(SCC fixpoint) +ori_arc/src/aims/contract/mod.rs(MemoryContract/ParamContract/ReturnContract/EffectSummary); depends on §05.0 IC-1 enforcement. VERIFIED:interprocedural/mod.rsconfirmed — Tarjan SCC + topological (callees-before-callers) fixpoint producingMemoryContractper function (analyze_programviascc_driver). Runs at Step 1, before any per-function burden lowering, so the contract computation is upstream of and independent from burden-op emission (“exactly as today”). §05.0 IC-1 hardening (complete) guarantees every post-fixpointfunc.namehas aMemoryContractentry, so the “exactly as today” claim is sound. Role unchanged. - Tests — dimension-to-consumer matrix (positive + negative pin per dimension over burden-emitted IR):
05.3 RL-31 burden-aware path implementation
File(s): compiler_repo/compiler/ori_llvm/src/codegen/ (alias-scope emission) + LLVM fact-export site
§00 producer/consumer contract anchor (per opencode blind_spot[3]): This subsection consumes the 8-clause SUFFICIENT-condition rule + named predicates frozen at section-00-design-validation-gate.md §00.3 frozen_rule_version: v1 (per section-00-design-validation-gate.md §00.3 cross-section commitment contract). Add consumes_proof_product: v1 to this section’s frontmatter at §05.3 start; verify via scripts/plan_corpus check (post-validator-landing per opencode blind_spot[3]) that the producer/consumer keys match. ANY modification of the SUFFICIENT-condition rule clauses or named predicates here MUST trigger §00 Phase 0 reentry per state-discipline.md §3 Pause Mid-Pipeline + frozen_rule_version: v2 bump.
Subsection close-out (05.3) per protocol.
-
Implement type-level disjointness proof via BurdenSpec.field_type chain comparison (per §00 walkthrough). DELIVERED:
compiler_repo/compiler/ori_arc/src/aims/realize/rl31_disjoint.rs—prove_param_noalias(param_types, pool) -> NoaliasProofrealizes the frozen 8-clause SUFFICIENT condition (fixed-point reachable-heap closure walk = clauses 1-3/6; closure disjointness = clause 4; transitive sum-node check = clause 5; distinct-surface-type = clause 7; opaque/unresolved fail-closed = clause 3/8). Builtin-burden self-sufficient (BURDEN_TABLE) for the worked-example collection types; user types fail-closed pending §04A.0 ITEM-1 registry threading (conservative = sound). 11 proof pins inrl31_disjoint/tests.rs(positives + same-type/shared-element/sum-node/scalar/unresolved negatives + self-verifying matrix). -
At LLVM emit time for
noalias/ alias-scope metadata, consume bothParamContract(existing) AND BurdenSpec (new) — combine to produce strictly stronger proofs where burden adds precision, gated on RL-31.proof P2’s dual-facet requirement. DELIVERED (conservative omission — RL-31.proof P2):ori_llvm/src/codegen/function_compiler/mod.rsdeclare_function_llvm_with_extra_paramswires the dual-facet gate at theadd_noalias_attributecall (noalias_proof.call_site_provenance_proven && noalias_proof.eligible.get(pidx)). RL-31noaliasis sound ONLY when BOTH facets hold: facet (b) type-level closure-disjointness (prove_param_noaliasinori_arc/src/aims/realize/rl31_disjoint.rs, computed today) AND facet (a) per-call-site provenance (NoaliasProof.call_site_provenance_proven, hardcodedfalse— the provenance pass depends onaims-rules.md §1.9rules 5 + 7, unshipped). Because facet (a) is unshipped the gate conservatively OMITSnoalias: everyNoaliasProof-eligible Reference/Indirect pointer param keeps the existingParamContract-derivedreadonly/nonnull/dereferenceableWITHOUTnoalias. The gate is wired + reversible: the day the provenance facet flipscall_site_provenance_proven: true,noalias+readonlyemits as strictly-stronger LLVM AA — with NO codegen change beyond that facet EXCEPT the mandatory nounwind precondition gate (perdecisions/01-noalias-emission-granularity.md §Consequences+decisions/00-rl31-burden-aware-design.md §(m)): function-attributenoaliason a parameter of an unwindable function is an LLVM soundness hazard (the optimizer may assumenoaliasacross theInvoke/Resumeunwind edge), so the flip MUST additionally require the function benounwind(or restrictnoaliasto the non-unwinding path).ORI_DISABLE_RL31_NOALIAS=1bisection flag added (sibling ofORI_DISABLE_BURDEN_OPS). -
Tests:
merge(a: &{str:int}, b: &[int])(Worked Example 1b Borrowed+Borrowed canonical shape persection-00-design-validation-gate.md §00.1Concrete example 1b) emits WITHOUTnoaliason its Borrowed parameters (facet (a) unshipped → conservative omission); verify with LLVM IR inspection. Additionallyaccumulate(a: {str:int}, b: [int])(Worked Example 1 Owned+Borrowed generalization shape) emits WITHOUTnoalias; verify same. DELIVERED: FileCheck IR pinscompiler_repo/compiler/ori_llvm/tests/codegen/aims/rl31_merge_borrowed_pair_noalias.ori+rl31_accumulate_distinct_types_noalias.ori(both paramsptr noundef nonnull readonly dereferenceable(24)—CHECK-NOT: ptr noalias, with a comment that the pin flips back to assertingnoaliasthe day facet (a) ships) + NEGATIVE pinrl31_same_type_params_no_noalias.ori(combine(a:[int], b:[int])same-type →CHECK-NOT: ptr noalias, omitted on facet (b) failure independent of facet (a)). Run viaori_llvm --test aot ir_checks. -
RL-31 × Phase 6 barrier / KnownSafe / PRE-style-motion legality co-verification sweep (per
section-00-design-validation-gate.md §00.3line 376 + codex blind_spot[1]): author instrumented tests at the named paths below — Ori spec sourcecompiler_repo/tests/spec/aims/rl31_co_verification.ori(covers shapes a/b/c) + AOT IR-inspection mirrorcompiler_repo/compiler/ori_llvm/tests/aot/rl31_co_verification.rs(asserts!alias.scope/!noaliasmetadata survives each interaction), matching the groundedness pattern of §04B criterion 3 (compiler_repo/tests/spec/aims/burden_alias_tracking.ori): DELIVERED — spec test 3/3 (interp + LLVM dual-exec parity); AOT mirror IR-inspection + dual-facet-gate-invariance PASS 3/3. NOTE (perdecisions/05-rl31-co-verification-evidence.md §Correction — gated-probe leak reality, which supersedes the raw leaks-0 column): the threerl31_*_execexecution tests carry#[ignore = "BUG-04-241: both-paths-fail borrowed-collection-arg drop leak"]on the gated probe — the AOT mirror’s EXECUTION+leak-free leg is BLOCKED on BUG-04-241 (§06/§09-coupled, dissolves at §09 predicate-stack retirement), NOT passing; the DELIVERED IR-inspection + gate-invariance legs stand. The RL-31 dual-facet gate (RL-31.proof P2) is parameter-level and decided at declare time; because facet (a) is unshipped the gate conservatively OMITSnoaliasidentically across all three Phase-6 interactions —_ori_mergecarriesreadonly/nonnull/dereferenceableWITHOUTnoaliasthrough all three shapes (IR results 23/16/8; the ‘zero leaks’ claim is superseded by thedecisions/05 §Correctiongated-probe reality — the exec leak is BUG-04-241). The sweep proves the gate verdict is structurally invariant to the Phase-6 RC-op-placement passes: when facet (a) ships andnoaliasemits, the same invariance holds (the metadata, like its omission today, is parameter-level not RC-op-level).- (a) KnownSafe pair elimination interaction: a
merge(a: &T1, b: &T2)call site with an outerRcInc(a)in scope establishingKnownSafe(a) = trueperaims-rules.md §8 RL-22 + RL-23→ an inner(RcInc(a), RcDec(a))pair on the disjoint-Borrowed parameter MUST be eliminated; the RL-31 dual-facet gate verdict on the call site MUST be invariant post-elimination (today:noaliasconservatively OMITTED per RL-31.proof P2 facet (a) unshipped; when facet (a) ships, the emitted metadata MUST survive). Test fnrl31_known_safe_pair_elimin both files. - (b) PRE-style RC motion across RC-observable barriers: a
RcInc(a)/RcDec(a)pair around a call site that passesato a callee Owned parameter (RC-observable barrier peraims-rules.md §8 RL-26 + RL-27) → motion MUST be REJECTED (barrier blocks motion); the RL-31 dual-facet gate verdict on the call site MUST be invariant (today: omitted; when facet (a) ships, metadata survives). Test fnrl31_pre_motion_barrier_blockedin both files. - (c) Selective barrier flush at call site: per
clang-arc-lessons §02(selective barriers), a call site where RL-31 applies AND the callee hasmay_share = trueon a parameter → pendingRcInc/RcDecops MUST be flushed before the call; the RL-31 dual-facet gate verdict remains valid post-flush (the disjointness facet (b) is parameter-level, not RC-op-level — its emission/omission is decided at declare time independent of the flush). Test fnrl31_selective_barrier_flushin both files.
- (a) KnownSafe pair elimination interaction: a
-
Verify each co-verification test exercises the EXACT shape per
aims-rules.md §8 RL-22..RL-26+clang-arc §02; document evidence (per-shape IR snippet + pass/fail) indecisions/05-rl31-co-verification-evidence.md(new artifact at §05.3 close). DELIVERED:decisions/05-rl31-co-verification-evidence.mdauthored — per-shape IR snippet (paramsptr noundef nonnull readonly dereferenceable(24),noaliasconservatively OMITTED per RL-31.proof P2) + pass/fail table (shapes a/b/c all PASS on gate-verdict invariance + correct result + leak-free), implementation surface (dual-facet gate atfunction_compiler/mod.rs; facet (a)call_site_provenance_proven: falseunshipped), fix-completeness gate results, and theORI_DISABLE_RL31_NOALIAS=1A/B proving zero new failures beyond the §06/§09 baseline.
05.4 Criterion-6 benchmark authoring + extension integration
Criterion-6 ownership moved to §05 (touches: compiler_repo/tests/benchmarks/aims_burden/). Under the §04B C6=proof_status:complete proven_by override, §04B’s outcome is impl-fidelity-routing (NOT partial-pass-criterion-6), so the criterion-6 microbenchmark deliverable is a §05 EXTENSION INPUT, not a §04B close-gate (per §04B.N Criterion-6 microbenchmark re-run anchor). The benchmark authoring + RC-count recording is therefore UNCONDITIONAL here — the conditional decisions/gate-criterion-6-extensions.md integration below fires only on top of it when a measured gap exceeds 5%.
Subsection close-out (05.4) per protocol.
- Author the three microbenchmarks (unconditional — the §04B criterion-6 deliverable, now §05-owned):
compiler_repo/tests/benchmarks/aims_burden/{closures_inside_loops,sum_payload_extraction,conditional_transfer_in_branch}per the §04B.6 microbenchmark specifications (closure-env BurdenSpec composition; Maranget-tree BurdenDecVariant + DP-2 elimination; per-edge balance + DP-3 elimination). Authored as.ori(NOT.rs): the BS-04B-4 measurement methodology (rc-stats.sh <file.ori>viaORI_AUDIT_CODEGEN=1,ORI_DISABLE_BURDEN_OPS=1 ori build, counts on lowered LLVM IR after Phase 7) is Ori-program-based — a.rsfile is neither compilable by theoricompiler nor measurable byrc-stats.sh; the siblingtests/benchmarks/cow/*.oricorpus is the canonical idiom. The.rsextension in the §04B.6 spec was an authoring-detail mismatch; the workload (closure-env / sum-payload / conditional-transfer Ori programs) is the deliverable. - Run + record normalized RC counts (unconditional): established baseline counts via current AIMS predicate stack (
ORI_DISABLE_BURDEN_OPS=1) + burden-emitted counts under Phase-6 elimination; normalized per the §04B.6 BS-04B-4 rule (Phase-7 mechanical-op units); cross-checked viaORI_TRACE_RC=1+compiler_repo/diagnostics/rc-stats.sh; recorded per-benchmark (baseline | burden-normalized | gap %) indecisions/gate-criterion-6-evidence.md(§05.4 re-run section). Result: closures 9|9|0%, sum 2|2|0%, conditional 3|3|0%; runtime trace cross-check (300000|0|300000 events) agrees baseline≡burden. All build clean + run leak-free. - If any benchmark gap > 5%: NOT TRIGGERED — all three gaps are 0% (≤5%).
decisions/gate-criterion-6-extensions.mdNOT authored; nosection-05A-lattice-extension-gap.mdsibling promotion needed. (Conditional preserved verbatim for the record: author/readdecisions/gate-criterion-6-extensions.md; integrate the listed Phase 6 lattice extensions; re-measure; if STILL > 5% post-integration promotesection-05A-lattice-extension-gap.mdperrouting.md §4withinserts_after: "05"perrouting.md §5; NEVER escalate to user; NEVER close §05 with the gap open — sibling owns the residual viablocks_section_complete.) - If all three benchmarks ≤5% gap: no extensions needed; recorded “all benchmarks within 5% — no Phase 6 extensions required” in
decisions/gate-criterion-6-evidence.md(§05.4 re-run section Verdict). - TPR checkpoint —
/tpr-reviewAND/impl-hygiene-reviewcovering 05.1-05.4. Exit-reason → next-action routing is owned canonically by the orchestrator (scripts/plan_orchestrator/next_action.schema.json+orchestration-rules.json:skill_exit_reasons), consumed perskill-control-contract.md §Continuation Contract+ §Iteration-loop discipline; this checkpoint does NOT re-author a routing table. Every emitted exit_reason routes:clean/resolved→ advance to §05.N close-gate;findings→/verify-tprtriage then re-dispatch perreview_pipeline:frontmatter;cap_reached_with_substantive/cap_reached_clean→ recordreview_pipeline.rounds_completed+last_round_commitand continue (no exit_reason left unrouted under autopilot perskill-control-contract.md §Autopilot Mode). Under autopilot a hook-failure halt on the round’s/commit-pushproceeds with dirty tree + logged disposition per the unified hook-failure clause — it never terminates the checkpoint.
05.R Third Party Review Findings
- None.
05.R.H Hygiene Findings
- [PLAN_DELIVERY_DRIFT:Major — RECORDED, non-blocking; anchor:
/fix-bugPhase 5 Step 9.5 reconciliation]bug-tracker/ (16 closed bug plans)— 16 closed bug plans missingdelivered_to_roadmap:field (MISSING_PROPAGATION). Does not block §05 close (scope_match:false — cross-repo tracking metadata gap outside ori_arc/ori_llvm primary scope). Cure: run/fix-bugPhase 5 Step 9.5 reconciliation on affected closed bug plans, or backfilldelivered_to_roadmap:; entries where subsection is undeterminable require human review perPLAN_DELIVERY_DRIFT.UNRESOLVED_SUBSECTION. [F3]
05.N Completion Checklist
- Baseline-red snapshot disposition (success_criterion line 19; §03 HISTORY 2026-05-15 cycle 50a deferred-to-§05 anchor):
compiler_repo/compiler/oric/tests/aims-snapshots/realize_rc_reuse/aliased-value-keeps-rc.alias_test.realize_rc_reuse.after.arc(testaims_snapshots_across_all_passes_match_baselines) resolved — EITHER (a) Phase-6 burden→lattice rewrite restores the symmetricRcDec %2 [FatPtr]pair → snapshot unchanged + test passes, OR (b) the elision is provably correct under burden discipline → re-bless viaORI_BLESS=1 cargo test -p oric --test aims_snapshots aims_snapshots_across_all_passes_match_baselinesAND amend a §05.N HISTORY entry citing burden-discipline rationale + spec citation, OR (c) the residual is a tracked compiler defect →/add-bugfiled with the BUG-XX-NNN recorded here. The §05 close gate requires (a), (b), or (c) decided — never left open. RESOLVED via disposition (c): BUG-04-132 filed (bug-tracker/plans/BUG-04-132/; codegen-llvm, high). The snapshot is an over-dec (committed baselineRcInc %0+RcDec %5= 1 inc / 1 dec balanced; current emission inserts a spuriousRcDec %2 [FatPtr]→ 1 inc / 2 dec). GROUND-TRUTH: PREDICATE-STACK-rooted (reproduces withORI_DISABLE_BURDEN_OPS=1; stableinc=[0] dec=[2,5]acrossafter_phase_1_walk..after_phase_3_coalesce), so it is NOT a §05 Phase-6 burden/eliminator gap — §05 owns the burden baseline + eliminator, NOT predicate-stack repair. Same predicate-stack RC-imbalance CLASS as BUG-04-123 (distinct manifestation: straight-line aliased let-binding vs sum-type CFG-branch); §06/§09-coupled perdecisions/LEDGER.md §B.3, dissolves at §09 (predicate-stack retirement). Option (b) re-bless is REJECTED — blessing a 1-inc/2-dec over-dec isINVERTED-TDD:positive-test-modification(it would enshrine a double-free shape into the baseline). The snapshot stays red WITHIN the §06/§09-coupled baseline (line below); the green obligation lands at §09, not §05. - Phase 6 lattice operates as pure optimizer over the §03A-delivered coexistence-mirror-balanced baseline; CRITICAL invariant verified (lattice ELIMINATES burden-emitted ops, never CONSTRUCTS). The self-sufficient-baseline correctness gate (Phase-6 elimination with the
reconcile_burden_ledgercoexistence mirror OFF) is a §09 verification item per §09.4 — §05’s scope is mirror-balanced DP-2/DP-3 elimination correctness, not the post-retirement self-sufficient baseline §09 owns. - RL-31 burden-aware path produces type-level disjointness proofs (facet (b)); the dual-facet
noaliasgate (RL-31.proof P2) conservatively OMITSnoaliasuntil the call-site-provenance facet ships. - RL-31 × Phase 6 barrier / KnownSafe / PRE-style-motion legality co-verification sweep PASSES with evidence in
decisions/05-rl31-co-verification-evidence.md(per §05.3 + codex blind_spot[1]). -
consumes_proof_product:frontmatter key matchessection-00-design-validation-gate.mdfrozen_rule_version:(per opencode blind_spot[3]);scripts/plan_corpus checkclean. exit 0 (verified this session) - Criterion-6 benchmarks authored + run + normalized RC counts recorded in
decisions/gate-criterion-6-evidence.md(§05.4; unconditional — §04B C6=complete override moved this deliverable to §05); any >5% gap closed viadecisions/gate-criterion-6-extensions.mdintegration. -
ori_arclib green (debug + release) AND no NEW test-all failures beyond the §06/§09-coupled baseline (LEDGER §B.3: AOT 2284/19 = 17 BUG-04-123 predicate-stack double-frees + 2 VF-1 loop residuals, ALL §06/§09-coupled, none §05-emission bugs). The 19 AOT residuals dissolve at §09 (predicate-stack retirement), NOT §05; absolute-greentest-allis the §12 green-gate (green-gate red-partition), not §05’s close-gate. §05’s deliverable is the eliminator-only lattice over the mirror-balanced baseline — verified byori_arcgreen + zero new lattice-divergence (success_criterion line ~22). A/BORI_DISABLE_RL31_NOALIAS=1+ORI_DISABLE_BURDEN_OPS=1confirmcomm -23 active disabledempty (zero new regressions from §05’s emission/elimination). - Plan annotation cleanup.
- Plan sync per protocol; mission criterion 9 checkbox flipped (the
00-overview.mdline-105 §05-delivering bullet: “Phase 6 lattice rewrite … → §05”). -
/tpr-reviewpassed (final);/impl-hygiene-reviewpassed. /review-plan ran 2 /tpr-review rounds, stage=verify-done; /impl-hygiene-review ran this session — 7 findings, 6 resolved + F3 recorded-non-blocking
HISTORY
-
2026-07-13 — §05’s shipped “Phase 6 lattice-rewrite” architecture (05.0-05.4 body + the “Fresh intel” fold below) is SUPERSEDED by BUG-04-276 (class-ledger-sole consolidation).
eliminate_burden_ops(realize/burden_elim.rs) + its 6 submodules + the entirelower/burden_lower/directory — described throughout this section (notably §05.1 lines 89-121, §05.2 line 149, §05.N line 220) as the shipped Phase-5-emit → Phase-6-eliminate two-pass burden architecture — were DELETED as dead code (reachable only from their own tests).run_aims_pipeline’s Step-4b class-ledger emission (apply_class_ledger_replacement) had already superseded the two-pass burden architecture as the sole production RC emitter before this bug’s RCA (commitsec53bf9ec6/d06aa9353f, 2026-07-10/11); the separate emit-then-eliminate pass this section documents as live was orphaned dead code by that point, not a §05 regression. The section’s PROVEN calculus grounding (DP-2/DP-3, CH-1/CH-2, RL-comp) is UNAFFECTED — class-ledger planning FUSES the same DP-2/DP-3-equivalent verdict into its plan at Step 4b (peraims-rules.md §7+§12PV-1..PV-6); only the separate-pass architecture this section narrates as shipped is gone. Current normative framing:.claude/rules/arc.md §Canonical RC-Emission Path,.claude/rules/canon.md §7.1invariant 5. Disposition record:bug-tracker/plans/completed/BUG-04-276/. The “Fresh intel” fold below (regenerated pre-BUG-04-276) is now itself PRE-FIX-STALE — its claim thateliminate_burden_opsis “the single hottest function on the entire burden surface” describes deleted code; regenerate on the next/review-sectionpass rather than trusting it.reviewed:left as-is (drift triggers reversal perstate-discipline.md §4). -
2026-07-01 — §05.4 section-close TPR (rounds 1-2) cures + plan-wide two-ADR-tree structural anchor. Cured: RL-31 noalias ADR (
decisions/01) Decision+Consequences (Option A dual-facet gate, conservative omission) + status→accepted; the (m) panic/unwind forward-soundness row (decisions/00risk-shape matrix) + co-verification forward-soundness table (decisions/05); §05.3 body reconciled to the BUG-04-241 exec-blocked reality (the 3rl31_*_execAOT tests are#[ignore]’d perdecisions/05 §Correction) + the nounwind precondition; code-side hygiene (nounwind gate-site comments atfunction_compiler/mod.rs+rl31_disjoint.rs, inaccurateborrowed_innercomment, canonical// Env:docs forORI_DISABLE_{LINEAGE_REBALANCE,SINGLE_RELEASE_AFTER_LAST_READ,RL31_NOALIAS}, geographical-framing comment links, oversized-file splits ofburden_elim.rs/function_compiler/mod.rs). STRUCTURAL ANCHOR for/review-plan(NOT resolved here — plan-wide, ambiguous canonical, history-loss risk): the plan carries TWO diverged ADR trees — plan-rootdecisions/(cited by the section body; legacy) andcontent/decisions/(cited by the ledger-evolution machinery + status.md + intel; carries unique newer decisions 17/18/19 lean-license). The §05 ADRs{00,01,05-rl31}were reconciled to IDENTICAL across both trees this cycle; the plan-wide canonical-tree consolidation (finish the v7 migration, merge the tree-unique files, remove the non-canonical tree, update all refs) is a plan-structural decision the plan’s own/review-planowns. -
2026-06-02 — §05.N baseline-red snapshot disposition (c) decided: BUG-04-132 filed. The
aliased-value-keeps-rcsnapshot (@alias_test () -> void = { let $s = "hello"; print(msg: s); print(msg: s); }) is an over-dec: committed baseline.after.arcisRcInc %0+RcDec %5(1 inc / 1 dec, balanced); current emission inserts a spuriousRcDec %2 [FatPtr](afterburden_dec %0, before the 2nd borrow-print) → 1 inc / 2 dec. Both %2 and %5 are FatVal aliases of owned %0. RIGOROUSLY ESTABLISHED as PREDICATE-STACK-rooted, NOT a §05 Phase-6 burden/eliminator gap: the over-dec reproduces withORI_DISABLE_BURDEN_OPS=1(burden path OFF) and is stableinc=[0] dec=[2,5]across all realize phases (after_phase_1_walk..after_phase_3_coalesce); the defined-dead-elision pass logsdefined-dead RcDec SKIPPED (early) reason=not-managed-defined-deadfor vars 0/2/5 (redundant dec not elided). Disposition (c) chosen (NOT (a) restore — §05’s eliminator-only lattice does not construct predicate-stack repairs; NOT (b) re-bless — blessing the double-free shape isINVERTED-TDD:positive-test-modification). Filed BUG-04-132 (bug-tracker/plans/BUG-04-132/, codegen-llvm, high): same predicate-stack RC-imbalance CLASS as BUG-04-123 (distinct manifestation), §06/§09-coupled perdecisions/LEDGER.md §B.3, dissolves at §09 (predicate-stack retirement). The relatedness verdict’s mechanicalneeds_plan_escalation/case-(e) (inline-into-§05) was overridden: case (e) requires a NOT-STARTED matched section but §05 is in-progress, and the cure is owned by the not-started §09, not §05 — disposition (c) mandates the separate tracker entry. The snapshot stays red WITHIN the §06/§09-coupled baseline (L275); green lands at §09/§12, not §05. Drifts the reviewed section → §05 re-reviews on next scan (reviewed:left as-is; drift triggers reversal perstate-discipline.md §4). -
2026-06-02 — §05.N L275 close-gate re-scoped to §05’s actual deliverable (plan-coherence correction). The
- [ ] cargo t green; debug + releaseclose-gate was unsatisfiable at §05 close: perdecisions/LEDGER.md §B.3the AOT 2284/19 residuals (17 BUG-04-123 predicate-stack double-frees + 2 VF-1 loop residuals) are ALL §06/§09-coupled and dissolve at §09 (predicate-stack retirement), NOT §05 — “none §05-emission bugs.” An absolute-green close-gate on §05 created a false circular dependency (§05 close needs green → green needs §09 → §09 depends_on the §05→§06→§07 chain). The plan’s own structure puts the absolute-green gate at §12 (green-gate red-partition); §05’s deliverable is the eliminator-only lattice over the mirror-balanced baseline, whose correctness gate isori_arcgreen + zero NEW lattice-divergence (success_criterion line ~22). Re-scoped L275 to “ori_arc green + no new failures beyond the §06/§09-coupled baseline” withORI_DISABLE_RL31_NOALIAS/ORI_DISABLE_BURDEN_OPSA/B confirming zero new regressions. Coherence correction (the green requirement was mis-scoped onto §05; §05 never owned the §06/§09-coupled failures), NOT gate-weakening. Drifts the reviewed section → §05 re-reviews on next scan, converging on the satisfiable gate.reviewed:left as-is (drift triggers reversal per state-discipline §4). -
2026-06-02 — §05 close-out /review-plan pass (Step 5 editor + §05.R section-close TPR). Editor cures: RL-31 noalias evidence reconciled to conservative-omit (§05.3 +
decisions/05-rl31-co-verification-evidence.mdworked-example IR blocks now shownoaliasOMITTED, citing RL-31.proof P2 dual-facet — type-facet proven, call-site-provenance facet unshipped peraims-rules.md §1.9rules 5+7; ground-truth-verified against shippedrl31_disjoint.rscall_site_provenance_proven: falsegate + FileCheckCHECK-NOT: ptr noaliaspins); coexistence-mirror-disabled correctness gate relocated §05 → §09.4/§09.N (it tests the self-sufficient burden baseline §09 retires the predicate stack for, not §05’s mirror-balanced elimination);subsection_depends_on05.4 re-pointed [05.3] → [05.2] (benchmarks consume Phase-6 dimension-wired output, not RL-31); §05.N baseline-red-snapshot disposition close-gate added. §05.R TPR round-1 cures: criterion-6 benchmark success_criterion.rs→.ori(delivered files are.ori); §05.0 sites-11-12 success_criterion reconciled from “dissolved” to “re-absorbed viaget_requiredsupplementary site” matching §05.0 body line 141; this HISTORY entry (post-editor change record).reviewed:staysfalse(TPR round in progress; close-out flip owned by /review-plan Step 7+8). -
2026-05-29 — §05 regrounded on the PROVEN DP-2/DP-3 elimination calculus (per
00-overview.md2026-05-29 reground). Phase 6’s elimination-only role consumesis_rc_dec_unnecessary(DP-2:Cardinality=Absent ∨ Consumption=Dead) +is_rc_inc_elidable(DP-3:Cardinality=Once ∧ Consumption=Linear) — both kernel-checked in consolidatedcompiler_repo/aims-proof/lean/AimsProof/Decision.lean(DP2_is_rc_dec_unnecessary_table/DP3_is_rc_inc_elidable_table), gating the proven RL-2 dec / RL-1 inc emission whose RC-BALANCE net-0 invariant is proven inRealization.lean. The §05 honest-limit (elimination-side dependency onproject_alias_sources/borrow_sources) is bounded above by §09’s coexistence retirement: once the predicate stack is deleted, the elimination decisions rest solely on the proven DP-2/DP-3 over the convergedAimsState, not on the transitional coexistence alias-tracking that the completed burden path supersedes (the coexistence CH-1..CH-comp are themselves proven_sound peraims-rules.mdHISTORY 2026-05-28 — the layer is retired as superseded, not as unproven). RL-31 (the §05.3 burden-aware path) is REAL inRealization.lean(RL31_disjoint_borrowed_noalias+ dual-facetRL31_type_facet_alone_insufficient), so §05.3 implements a proven theorem, not a design hypothesis.reviewed:staysfalse(cross-section reground edit on anot-startedsection). -
2026-05-12 — §00 editor cohesion-edit (per
section-00-design-validation-gate.md§00.3 line 376 + codex blind_spot[1] + opencode blind_spot[3]): §05 success_criteria gained two new entries — RL-31 metadata × Phase 6 barrier / KnownSafe / PRE-style-motion legality co-verification sweep (cures gap where §00.3 mandated the sweep be filed as §05 success criterion but §05 itself only carried generic lattice convergence criteria);consumes_proof_product: v1↔ §00frozen_rule_version: v1producer/consumer contract verification. §05.3 body extended with three co-verification test shapes (KnownSafe pair elimination, PRE-style motion across RC-observable barrier, clang-arc §02 selective barrier flush) + §00 producer/consumer contract anchor. §05.3 also updated the example shape tomerge(a: &{str:int}, b: &[int])(Worked Example 1b Borrowed+Borrowed RL-31-native shape) plus the existingaccumulateOwned+Borrowed generalization. §05.N completion checklist extended with co-verification + consumes_proof_product items.reviewed:field leftfalseper/review-plan SKILL.md §Step 1.7 §DCritical Rule 9 (cohesion-edit on non-target section). -
2026-05-25 — Cross-plan advisory dependency established (aims-proofing-suite §14): §05’s Phase-6 lattice rewrite (RL-31 burden-aware path) consumes proven calculus from
plans/completed/aims-proofing-suite/§08 (Realization Rule Proofs — RL-2/RL-10/RL-31) + §11 (Coexistence Handshake Proofs), bothnot-started. Per aims-proofing-suite §14 Lazy-Migration Policy this pointer is ADVISORY + NON-BLOCKING: §05 proceeds under “design assumed sound; subject to revision when proofs land.” A frontmatterblocked_by:is not used —scripts/plan_corpus/schema.py:_check_blocked_by_shaperestrictsblocked_by:toBUG-XX-NNN; cross-plan proof dependencies bind via this narrative pointer (and, for criterion-gated sections, via the §13proven_by:mechanism, which §05 does not use since it consumes proven design rather than empirically gating criteria). Enforcement flips (verdict semantics shift to “implement against proven design”) once §08 RL-10/RL-31 + §11 reachproof_status: complete; C3 on §04Bproven_by:already flippedpending → partialat §05.3 close-out and flips tocompleteon §08 RL-10 PASS.reviewed:leftfalseper/review-plan SKILL.md §Step 1.7 §DCritical Rule 9 (cross-plan binding edit on non-target section innot-startedstatus). -
2026-05-15 — Baseline-red snapshot anchor pulled forward from §03 HISTORY cycle 50a deferral.
aims_snapshots_across_all_passes_match_baselines(compiler/oric/tests/aims_snapshots.rs:28) fails onrealize_rc_reuse/aliased-value-keeps-rc.alias_test.realize_rc_reuse.after.arc: baseline emits anRcDec %2 [FatPtr]between the twoori_print(s)calls that the current realize_rc_reuse pass elides. The §03 (Phase 5 trivial emission) HISTORY recorded “needs re-bless OR root-cause investigation deferred to §04A/§05” without a structural anchor; this entry pairs that deferral with a concrete §05 success_criterion (added same edit) so the cure obligation is tracked under the Phase 6 lattice rewrite that owns realize_rc_reuse output behavior. Disposition decided at §05 close (re-bless under burden-discipline rationale OR rewrite restores the dec).reviewed:field leftfalseper/review-plan SKILL.md §Step 1.7 §DCritical Rule 9 (success_criterion edit on non-target section currently innot-startedstatus). Perfeedback_plan_cures_failures_linkagepre-JSON-v3 mechanical attribution unavailable — narrative + success_criterion is the structural surface today. -
2026-05-27 — Cross-plan advisory dependency established (
locality-representation-unification): §05.2’s “Locality … unchanged” refers to the dimension’s ROLE (RL-14 stack promotion / RL-17/18 header compression), not its variant count.plans/locality-representation-unification/(not-started; absorb-candidate intoplans/roadmap/section-21A-llvm.md; NOT superseded by this plan) changes shippedLocalityto 5 variants (addsArgEscaping), raisesCHAIN_HEIGHT15→16, and convertsParamContract.may_escapefrom a stored field to a derived method. §05.0’scontract/IC-1 hardening + §05.3’s RL-31 path consumeParamContract; if locality has landed they consumemay_escape()as a derived method. ADVISORY/NON-BLOCKING perrouting.md §1(schema restrictsblocked_by:to BUG-XX-NNN; the cross-plan dependency binds via this narrative pointer +decisions/04Clarification). SHOULD sequence after locality to avoid acontract/+ split-aims/-file rebase. None of §04B’s C1-C6 criteria depend onArgEscaping, so locality is NOT a gate blocker — it is a §05 sequencing input + the shipped-conformance bridge for the proven 5-variantLocalityrules (aims-proofing-suite §17).reviewed:leftfalse(cross-plan binding edit on anot-startedsection).
Fresh intel (regenerated)
This section’s body reads as fully DELIVERED — five subsections (05.0–05.4), each with cycle-level evidence, test IDs, and [x]-checked work items. The graph and direct-source cross-check CONFIRM the substance is real and shipped: eliminate_burden_ops is the single hottest function on the entire burden surface (hotspot 1271, matching the mission’s own cited ~1580 figure to within recon-tool drift), prove_param_noalias + the dual-facet noalias gate are wired exactly where the body claims (function_compiler/mod.rs:376-407), and every cited spec/AOT test file exists on disk with the described CHECK-NOT content. But the plan’s own plan.json says this section’s workflow status is not-started, reviewed: false — because the ENTIRE plan was zeroed (0/29 sections complete) for a forensic re-walk. The body’s “DELIVERED” claims are prose, not the SSOT; this review is exactly the mechanism that re-grounds them.
Three decisions this package forces before the review adjudicates:
- The section’s substance re-verifies clean — do not re-litigate 05.0/05.1/05.2/05.4; they are IC-1 hardening, lattice-audit-with-structural-guard, dimension-wiring-with-pins, and a criterion-6 benchmark that all check out against live source, hotspot data, and plan ownership. Spend review budget on 05.3.
- 05.3’s one real open engineering gap is RL-31 facet (a) (
NoaliasProof.call_site_provenance_provenhardcodedfalse, per-call-site interprocedural provenance unshipped) — and external prior art says the ORIGINAL design choice that created this gap (function-attributenoalias,decisions/01-noalias-emission-granularity.mdOption A) is the harder of two SUFFICIENT-condition-compatible choices.decisions/01’s own “Decision” + “Consequences” sections are STILL EMPTY despite Option A already being implemented — a real plan-coherence gap, not a stylistic one. - A NEW risk shape is missing from the 12-shape acceptance matrix (a)–(l): none of the 12 shapes address whether a callee’s panic/unwind mid-execution can violate the noalias claim’s “no other access during execution” guarantee — this is EXACTLY the lesson rustc learned the hard way (it once emitted
noaliasfor&mutparams, then stopped, because “LLVM’s semantics miss the ‘is known not to panic’ requirement,” perrust-lang/rust-memory-model#24). Ori’s ARC IR hasInvoke/Resumeunwind terminators; this gap is real and unaddressed anywhere in the section’s evidence.
[JOIN] The graph’s callers/cypher CALLS-edge resolution has a repeatable false negative on exactly this code region: prove_param_noalias and add_noalias_attribute’s PRODUCTION call sites (both inside declare_function_llvm_with_extra_params, function_compiler/mod.rs) are invisible to the graph (callers returns test-only lists; a direct cypher non-test-caller query returns 0 rows) even though grep proves both call sites exist and are load-bearing. Any FUTURE blast-radius analysis on this file done via the graph alone will silently under-count callers — flag before trusting a callers result on function_compiler/mod.rs.
DIG DEEPER
python -m scripts.plan_corpus.read plans/aims-burden-tracking # plan.json status="in-progress"; per-section status via the API below
python3 -c "from scripts.plan_corpus.read import load_plan; p=load_plan('plans/aims-burden-tracking'); print([s for s in p.subsections if s.get('id')=='s-09a822f6'])"
scripts/intel-query.sh plan-status aims-burden-tracking --human
(full dossier: phase-6-lattice-rewrite-rl-31-burden-aware-path—s-09a822f6.intel.md)