100%

Section 06: Phase 7 Mechanical Lowering

Goal: Phase 7 has no predicate stack. The decision where to emit each RC op was made at Phase 5 from BurdenSpec and refined at Phase 6; Phase 7 emits what the prior phases authored.

Context: Per proposal §Design — Phase 7 (Realization) — Mechanical Lowering. realize_rc_reuse becomes thin pass; realize_annotations (Phase 2 post-merge) stays where it is.

Reference implementations: Existing realize_rc_reuse for shape; existing realize_annotations for COW/reuse/drop-hint/arg-ownership.

DAG predecessor (frontmatter depends_on: ["05"]): §05 — the single immediately-prior section in the §05 → §06 → §07 → §09 chain, per the INV-19 linear-DAG single-predecessor invariant.

Consumes outputs from (transitively available through the §05 linear-chain predecessor — INPUTS §06 reads, NOT additional DAG predecessors; declaring them in depends_on: would form a diamond and violate INV-19):

  • §03 (BurdenInc/BurdenDec ops emitted at Phase 5 — the instruction surface §06 mechanically lowers).
  • §04A (minimal lattice adaptation — Phase 6 burden-op elimination consumer surface §06.2 compound instruction lowering reads from).
  • §05.2 (Phase 6 lattice rewrite produces the optimized burden baseline with DP-2/DP-3 annotations).
  • §02 (compute_drop_info wrapper consumed by element_fn_gen + instr_dispatch).

Predecessor gate — §04B Prototype Gate: Per codex Finding 1 + §04B.N decision table: any §04B criterion FAIL halts the cascade §05 → §06 → §07-§10. §06 is conditional on §04B.N decision = PASS. If §04B.N flips FAIL, §06 voids alongside §05 and the proposal-rescope branch (direct Perceus per 00-overview.md §Alternative 1) supersedes this section.


Intelligence Reconnaissance

Queries:

  • scripts/intel-query.sh --human file-symbols "compiler_repo/compiler/ori_arc/src/aims/realize" --repo ori
  • scripts/intel-query.sh --human callers realize_rc_reuse --repo ori
  • scripts/intel-query.sh --human callers class_alive_after --repo ori — confirm zero callers post-§09

Queried: 2026-05-08.

Results summary [ori] — concrete symbol inventory grounding §06 implementation:

  • realize_rc_reuse entry point: compiler_repo/compiler/ori_arc/src/aims/realize/mod.rs (per arc.md §Pipeline Step 5).
  • Predicate-stack query sites to be eliminated in §06.1 (per §00-overview Mission paragraph identifying class_alive_after, pin4_class_emits_dec_set, pin6_any_ancestor_will_cover, class_payload_of, ssa_alias_classes-driven emission): currently resident across compiler_repo/compiler/ori_arc/src/aims/realize/{mod.rs, walk.rs, walk_dec.rs, emit_unified.rs, burden_elim.rs} and compiler_repo/compiler/ori_arc/src/aims/emit_rc/dead_cleanup/emission_site.rs. §06.1 rewrites the lowering site realize/mod.rs and grep-enforces zero residual call sites THERE post-rewrite. The §09-retiring sibling files (walk.rs, walk_dec.rs, emit_unified.rs, emit_rc/dead_cleanup/emission_site.rs) retain their predicate definitions + call-sites in-tree until §09 wholesale-retires them per 00-overview.md absorbed_bugs[BUG-04-118]; the whole-realize/-dir zero-reference assertion is the §09 close-gate, NOT the §06 gate (a §06 grep over the whole dir would be unsatisfiable pre-§09).
  • BurdenInc/BurdenDec instruction surface §06 lowers: defined under compiler_repo/compiler/ori_arc/src/ir/instr.rs (per agy Finding 1 evidence) and emitted at §03 sites per §03 outcome HISTORY.
  • Compound-instruction lowering sites stay in realize_annotations Phase 2 post-merge per arc.md §Pipeline Step 10 + aims-rules.md §7 PL-4.

No parallel paths, no shadow trackers — extension within the unified model per missions.md §AIMS invariant 5.

06.1 realize_rc_reuse mechanical rewrite

  • Remove/neutralize compiler_repo/compiler/ori_arc/src/aims/realize/burden_mirror.rs::reconcile_burden_ledger (the coexistence-only masking balancer) BEFORE whole-var BurdenInc→RcInc / BurdenDec→RcDec lowering lands — per §03A.3a forward-anchor. Its padding (inc-injection / terminal-dec / merge-equalize beyond the consensus dec-mirror) is safe TODAY only because whole-var burden ops are codegen no-ops (instr_dispatch.rs:509); once they lower to real RC the padding becomes SPURIOUS RcInc/RcDec → reintroduced double-frees (unless Phase-6 DP-2/DP-3 prunes the adjacent pairs first). Sequencing gate: mirror neutralized + VF-1 still clean via faithful Phase-5 emission BEFORE the mechanical mapping below. DONE (2026-06-02 a08): VF-1=0 corpus-wide via faithful Phase-5 emission (RL-4 live-out fix), THEN reconcile_burden_ledger + burden_mirror.rs + burden_mirror/tests.rs + BURDEN_MIRROR_DISABLED + ORI_DISABLE_BURDEN_MIRROR deleted; zero references corpus-wide.
  • Verify zero references to class_alive_after, pin4_class_emits_dec_set, pin6_any_ancestor_will_cover, class_payload_of, canonical_rep_for, var_emits_dec_in_block, syntactic-liveness fallback within compiler_repo/compiler/ori_arc/src/aims/realize/mod.rs (the rewritten lowering site); grep-enforced at section close. SCOPE NARROWED to realize/mod.rs (not the whole realize/ dir): the §09-retiring predicate definitions + call-sites intentionally REMAIN inside realize/ at walk_dec.rs + walk.rs + emit_unified.rs + emit_rc/dead_cleanup/emission_site.rs per 00-overview.md absorbed_bugs[BUG-04-118] until §09 wholesale-retires them — a grep over the whole realize/ dir CANNOT return zero pre-§09 and would make this gate unsatisfiable. realize/mod.rs is verified clean of all six predicates today; the §06.1 rewrite preserves that. (The whole-realize/-dir zero-reference assertion IS the §09 close-gate, not the §06 close-gate.) DONE (2026-06-02 a08): grep -nE 'class_alive_after|pin4_class_emits_dec_set|pin6_any_ancestor_will_cover|class_payload_of|canonical_rep_for|var_emits_dec_in_block' realize/mod.rs returns zero.
  • DELIVERED (RL-4 live-out BurdenDec-placement matrix, burden_lower/tests.rs): conditional-transfer (owned param live-out, Branch), multi-block live-out (FRESH, Jump) net-0, dead-out-keeps-dec narrowness pin. Semantic (verify_burden_balance empty) + negative (per-block dec count) pairing — pins the faithful Phase-5 emission §06.1 shipped (the lowering SITE deliverable). This IS the §06.1 test deliverable; the real-RC FileCheck-on-RcDec pins moved to §09.2 with the real-RC activation.

§06.1 delivers the clean lowering SITE only. realize/mod.rs is established as the thin dispatcher verified zero of the 6 predicates; faithful Phase-5 emission (VF-1=0) + mirror removal + grep-zero are DONE. The real-RC ACTIVATION (BurdenInc→RcInc / BurdenDec→RcDec flipping from codegen no-ops to real RcInc/RcDec) is NOT a §06.1 deliverable: while the predicate stack (walk_dec.rs/emit_unified.rs) still emits its own RcInc/RcDec, flipping burden ops to real RC double-emits → double-frees (LEDGER §B.2). The activation is the sole-RC-emitter outcome of §09.2’s predicate-stack retirement — relocated to §09.2 per routing.md §4 (move the item to its owning section, NOT a <!-- blocked-by --> annotation). See §09.2 checkboxes “BurdenInc→RcInc / BurdenDec→RcDec mechanical mapping” + its real-RC FileCheck pins.

Subsection close-out (06.1) per protocol.


06.2 Compound instruction lowering (COW / reuse / drop-hint / arg-ownership)

Design intent — WHICH phase emits WHAT (resolves the Phase-6-annotation vs Phase-7-lowering site ambiguity): Phase 7 = realize_rc_reuse (pipeline Step 5, pre-merge per arc.md §Pipeline) does ONLY the whole-var mechanical mapping (BurdenInc→RcInc / BurdenDec→RcDec, §06.1). It emits NO compound COW/reuse/drop-hint instruction code. The compound-instruction realization stays at its existing sites; those sites read the CONVERGED Phase-6 lattice DIMENSIONS (Uniqueness, Shape) for the value and lower COW/reuse/drop-hint in place — unchanged location. arg-ownership is a third site (Step 4b-prelude, see the arg-ownership checkbox below) — not Step 5, not Step 10.

SITE-vs-ACTIVATION + annotation-surface correction (2026-06-02, a09 — see §06 HISTORY): the original §06.2 design intent assumed Phase 6 lands distinct “COW/reuse/drop-hint MARKERS on surviving burden ops” and §06.2 wires a Step-10 consumer to read those markers. The actual proven AIMS architecture carries NO such surface and MUST NOT: the burden-op variants (BurdenInc/BurdenDec/BurdenDecPartial/BurdenDecField/BurdenDecVariant at ir/instr.rs) carry ONLY var/field/base — adding a compound-annotation field would be a parallel SoT / shadow uniqueness tracker, banned by aims-rules.md Invariant-5. COW/reuse/drop-hint are NOT marked on burden ops; they are read from the converged lattice DIMENSIONS at the realize sites (DP-4/DP-5/DP-6/DP-9; RL-7/RL-9/RL-11/RL-11a/RL-12). §05.2’s dimension-wiring audit established exactly this (“each consumer reads the converged lattice dimension… burden-transparent. Role survives the emission→elimination shift”). The §06.2 SITE deliverable is therefore the consumers reading converged dimensions at the correct sites — which are wired + active TODAY, not a new annotation-reader. NO §09.2 RELOCATION applies to §06.2: the compound instructions (COW Set/IsShared/copy via cow_annotations, Reset/Reuse, drop-hints) are the long-standing dimension-driven realizations that emit REAL LLVM instructions today (ori_llvm/.../arc_emitter/emitter_utils.rs consumes CowMode for real in-place-vs-copy emission). They were NEVER burden-op codegen no-ops, so flipping them carries NO double-emit hazard against the live predicate stack — the LEDGER §B.2 double-emit hazard that relocated the §06.1 whole-var BurdenInc→RcInc flip to §09.2 applies ONLY to the whole-var burden ops, NOT to these compound realizations.

  • COW SITE consumer reads converged Uniqueness (+ borrow-disjointness) at the existing realize_annotations Step-10 site (realize/decide.rs:decide_cowCowMode; DP-9 + RL-7/RL-8; RL-9 compound contraction at codegen) — verified wired + active today; the consumer is NOT reading a burden-op marker.
  • Reuse SITE consumer reads converged Shape+Uniqueness at the existing Step-5 realize site (realize/decide.rs:decide_reuse + emit_reuse/{detect,dynamic,planner}.rs; DP-6 + RL-11/RL-11a/RL-12) — verified wired + active today.
  • Drop-hint SITE consumer reads converged Uniqueness+collection-shape at realize_annotations Phase 2 post-merge (realize/decide.rs:decide_drop_hint, unchanged location per aims-rules.md §7 PL-4) — verified wired + active today.
  • arg-ownership placement per aims-rules.md §7 PL-5 + §3 TF-11 IC-3: ArcParam.ownership populated at Step 2 apply_aims_ownership (pipeline/aims_pipeline/batch.rs) from MemoryContract; call-site arg_ownership populated at Step-4b-prelude emit_arg_ownership (pipeline/aims_pipeline/mod.rs) — NOT colocated with COW/reuse/drop-hint at Step 10. Verified wired + active today. Plan-frontmatter goal-line phrasing collapsing “arg-ownership emission” into “stay in realize_annotations Phase 2 post-merge” is an inherited drift; §08 rule-file sync section closes the goal-line drift at plan close-out.
  • Tests: SITE-consumer pins per aims-rules.md §9 VF-1+VF-2+VF-3 + tests.md §Matrix Testing Rule — the compound-realization SITE is pinned by existing matrix coverage (no new annotation-reader to pin; pinning a non-existent marker-reader would be test-inflation per tests.md §Anti-patterns):
    • COW: decide_cow decision matrix (realize/tests.rs, DP-9 × Uniqueness × borrow-disjointness, semantic + negative pairing) + FileCheck codegen (ori_llvm/tests/codegen/cow/{unique_mutation_no_copy,shared_mutation_triggers_copy,mutation_triggers_store_ops}.ori + cow_is_shared_check.ori, RL-9 contraction) + tests/spec/collections/cow/ corpus (eval+LLVM parity, ORI_CHECK_LEAKS=1).
    • Reuse: decide_reuse candidacy pins (realize/tests.rs, DP-6 × Shape × Uniqueness) + emit_reuse detect/dynamic/planner + AOT realize_rc_reuse.rs (RL-11 same-block / RL-11a dynamic). Cross-block RL-12 emission is exercised by the AOT corpus; an explicit cross-block FileCheck pin is the remaining additive coverage if a gap surfaces at §06 close-gate.
    • Drop-hint: decide_drop_hint matrix (realize/tests.rs, Uniqueness × collection-shape × borrowed-param × rc-incremented, semantic + negative pairing).
    • arg-ownership: arg_ownership/tests.rs (ArgOwnership::Owned/Borrowed at indirect calls, mono-name merge) + apply_aims_ownership exercised pipeline-wide. ArcParam.ownership population verified at apply_ownership Step 2.

Subsection close-out (06.2) per protocol.


06.3 Atomic vs non-atomic realization

SITE-vs-ACTIVATION + cross-plan-relocation correction (2026-06-02, a10 — see §06 HISTORY): §06.3 delivers the RcAtomicity CARRIER SITE only. Grounding the original §06.3 design against actual code established that the RL-19/20/21 dispatch that POPULATES NonAtomic cannot land here: the shipped runtime RC primitives (ori_rc_inc/ori_rc_dec at compiler/ori_rt/src/rc/mod.rs) are unconditionally atomic (AtomicI64::fetch_add/fetch_sub); there is NO non-atomic runtime path, NO emit_rc_inc/emit_rc_dec atomicity branch, and NO thread-escape analysis in ori_arc (RL-19/20/21 are target-only per aims-rules.md RL-19 “Future Locality extension… planned but not required”). The thread-escape analysis (ThreadLocality in compiler/ori_repr/src/escape/thread.rs), the non-atomic runtime (ori_rc_inc_nonatomic/ori_rc_dec_nonatomic), the whole-program RL-21 optimization, AND the atomic-vs-non-atomic codegen selection are ALL owned by plans/repr-opt/section-10-thread-local-arc.md (§10.1 + §10.2). Populating NonAtomic in §06.3 without §10’s backend would be an inert no-op deliverable (the carrier ignored by the unconditionally-atomic codegen) — a worse violation than the §09.2 double-emit hazard. Per routing.md §4 MOVE-the-item discipline, the NonAtomic-selecting dispatch + its NonAtomic-selection tests RELOCATED to plans/repr-opt/section-10-thread-local-arc.md §10.2 (the section that owns the selecting backend). §06.3’s residue is the SITE deliverable: the RcAtomicity carrier defined + default-Atomic at every construction site (observably identical to today’s all-atomic emission, confirmed VF-1=0 + AIMS-snapshot byte-identical for the atomic suffix). NOT a §09.2 relocation — §09.2 consumes this carrier when it flips burden-op no-ops to real RC (per §09.2 line referencing “atomicity carrier per §06.3 RcAtomicity”); §10.2 populates this carrier’s NonAtomic value when its thread-escape analysis + non-atomic runtime land.

  • Define RcAtomicity enum per codex Finding 2 BEFORE atomic-vs-non-atomic dispatch: variants { Atomic, NonAtomic } in compiler_repo/compiler/ori_arc/src/ir/instr.rs (carrier on RcInc/RcDec ArcInstr variants). DONE (2026-06-02 a10): RcInc/RcDec carry atomicity: RcAtomicity; every construction site sets RcAtomicity::default_atomic() (= Atomic), reproducing the shipped unconditionally-atomic runtime RC primitives bit-for-bit. Exported from ir/mod.rs + crate root. The NonAtomic-SELECTING dispatch (RL-19/20/21 thread-locality derived from Locality + call-graph per RL-18a) is RELOCATED to plans/repr-opt/section-10-thread-local-arc.md §10.2 per routing.md §4 — that section owns the thread-escape analysis (§10.1) + non-atomic runtime (§10.2) the dispatch requires.

  • RcAtomicity representation (discriminant placement / layout for the carrier on lowered RcInc/RcDec, per RL-18/RL-19) in compiler_repo/compiler/ori_arc/src/ir/repr.rs alongside the existing RcStrategy repr — this is the in-body rationale for the ir/repr.rs entry in touches:. DONE (2026-06-02 a10): RcAtomicity enum + default_atomic() + is_atomic() + fmt_atomicity_suffix() (renders "" for Atomic — byte-identical AIMS-snapshot output — " [non-atomic]" for NonAtomic) in ir/repr.rs + ir/format/mod.rs.

  • The atomic-vs-non-atomic ACTIVATION (RL-19/20/21 dispatch populating NonAtomic + the non-atomic runtime path it selects) is RELOCATED to plans/repr-opt/section-10-thread-local-arc.md §10.2 per routing.md §4 (move the item to its owning section). §10.2 already carries the codegen selection (emit_atomic_rc / emit_nonatomic_rc), the non-atomic runtime (ori_rc_inc_nonatomic), and §10.1 carries the thread-escape analysis the dispatch consumes. §06.3 delivers the carrier SITE; §10.2 populates it. See §10.2 relocated checkbox “RL-19/20/21 dispatch populates the §06.3 RcAtomicity carrier” + its 3 relocated NonAtomic-selection tests (cross-thread-escape FFI-export → Atomic; intra-thread Sendable → NonAtomic; whole-program RL-21 → all NonAtomic). The channel-send #skip companion (blocked by E2040, tracked as BUG-02-037) relocates with those tests.

  • Tests (SITE pins — carrier definition + default; the NonAtomic-SELECTION tests relocated to §10.2 with the dispatch): per tests.md §Matrix Testing Rule semantic + negative pairing — compiler/ori_arc/src/ir/repr/tests.rs: rc_atomicity_default_is_atomic (semantic pin — default_atomic() == Atomic; reverting the default to NonAtomic fails it, guarding against silent non-atomic emission before the §10.2 runtime exists), rc_atomicity_is_atomic_distinguishes_variants, rc_atomicity_atomic_renders_no_suffix (Atomic dumps byte-identically — AIMS snapshots depend on it), rc_atomicity_non_atomic_renders_suffix (negative-space pin — the dimension IS observable once §10.2 selects NonAtomic). The realize-path all-Atomic invariant is pinned corpus-wide by the AIMS snapshot suite (any realize site emitting NonAtomic would surface the [non-atomic] suffix in a baseline).

  • TPR checkpoint/tpr-review covering 06.1-06.3. Map the /tpr-review exit reasons per the decisions/31 Option C exit-reason table (plans/completed/scripts-first-workflow-architecture/_archive/2026-05-15-pre-fold/skill-ecosystem-coherence/decisions/31-step-6-exit-reason-table-source.md): clean / resolved advance the subsection; cap_reached_with_substantive / cap_reached_clean route per that table rather than stalling the autopilot state-machine on an unclassified exit.

Subsection close-out (06.3) per protocol.


06.R Third Party Review Findings

3-round /tpr-review --skill review-plan --autonomous (exit_reason cap_reached_with_substantive); all findings CURED INLINE this session — zero open, zero deferred.

  • [TPR-06-1-codex+adjudicator][Major] Round 1 — coalesce/mod.rs PendingRc carries no atomicity field; flush hardcodes default_atomic(), latent miscompile once §10.2 populates NonAtomic (a NonAtomic op silently flattens to Atomic in the coalesce window). NOT a §06 defect (§06.3 default-Atomic is the correct emission-neutral SITE). CURED: owner is repr-opt §10.2 (the NonAtomic-population site) — its RL-19/20/21 dispatch checkbox now enumerates the coalesce/mod.rs PendingRc atomicity-mismatch-flush requirement + a mixed-atomicity coalesce-window FileCheck pin.
  • [TPR-06-2-opencode][Minor] Round 2 — doc_sync.synced_after_last_content_change: false while content_hash == last_sync_sha (content unchanged since last sync → flag should be true). CURED via python -m scripts.plan_corpus.doc_sync mark-synced (truthful: compute_section_hash confirms no review-relevant content drift; fresh last_sync_sha).
  • [TPR-06-3-codex][high] Round 3 — trampoline / release-cleanup detection predicates (project_escape.rs:follow_jump_chain; tail_call/mod.rs x2) matched only RcDec, so faithful-emission release blocks now carrying a paired BurdenDec ([RcDec, BurdenDec]) were misclassified — wrong successor-param resolution (correctness) + silently-rejected TRMC/tail-call detection (lost optimization). CURED: extracted SSOT helper ArcInstr::is_release_cleanup_instr (RcDec | BurdenDec, grounded in whole-var release_with_burden emission) applied at all 3 sites + 8 matrix pins (semantic + negative; reverting the helper fails the 3 positive pins). ori_arc 1539/0 debug + 1535/0 release; AOT 2322/16 baseline zero-new; VF-1=0.
  • [TPR-06-4-codex][high] Round 3 — wrapper-private rule-file citation aims-rules.md in public compiler_repo source doc-comments (Public Repo Hygiene). CURED: all 4 occurrences (ir/instr.rs:96+108, ir/repr.rs:176, aims/realize/walk_dec.rs:47) replaced with the public spec citation Spec: Annex E §AIMS RL-19/20/21.

06.N Completion Checklist

  • /tpr-review passed (final); /impl-hygiene-review passed. /tpr-review: §06.3 checkpoint 3-round cap_reached_with_substantive, third_party_review.status=resolved, 4 findings cured. /impl-hygiene-review: ran 2026-06-03 (run impl-hygiene-ori_lang-qmsMg2rF), all 4 load-bearing invariants clean (Invariant-5/RcAtomicity/is_release_cleanup_instr/RL-4), 1 §06-attributable Major P3-F1 fixed (10 ephemeral test renames), residual BLOAT+cross-scope recorded additively to §06.R.H, zero open Critical/Major §06-attributable.
  • Phase 7 has zero predicate-stack queries. Mechanical lowering only. (2026-06-03 re-verify: grep-zero on realize/mod.rs for class_alive_after / pin4_class_emits_dec_set / pin6_any_ancestor_will_cover / class_payload_of / canonical_rep / syntactic-liveness — zero matches. Narrowed to realize/mod.rs per §06.1 opencode-F1; §09-retiring sibling files keep predicate sites until §09.)
  • eval + LLVM dual-execution parity preserved. (2026-06-03 re-verify: eval cargo st 4600 passed / 45 failed / 51 skipped AND LLVM AOT 2322 passed / 16 failed — BOTH at documented baseline, zero §06-attributable divergence. §06 touches the ori_arc→ori_llvm realization path only; both backends sit at baseline so no §06-introduced eval-vs-LLVM divergence. The 45 eval failures are the pre-existing type-error-blocked frontend baseline; the 16 AOT failures are the §09-coupled cohort — neither is §06 burden/RC.)
  • cargo t green; debug + release. (2026-06-03 re-verify: ori_arc lib 1539 passed / 0 failed; ori_llvm AOT debug 2322/16 AND release 2322/16 — byte-identical FastISel parity, zero NEW failures in either profile.)
  • timeout 150 ./test-all.sh — full backend-spec + LLVM gate, scoped to NO-NEW-failures-beyond-baseline per LEDGER §B.3 (the §06/§09-coupled baseline is AOT 2284/19 = 17 BUG-04-123 predicate-stack double-frees + 2 VF-1 loop residuals BUG-04-121, ALL coupled to §06 whole-var lowering + §09 retirement). §06 close requires zero NEW failures; the 19 baseline failures DISSOLVE at §09 (predicate-stack retirement) + §10/§12 verify, NOT at §06 close. A NEW failure introduced by §06 lowering blocks close per CLAUDE.md §Failing Tests Mid-Work. (2026-06-03 re-verify, run as components because the monolithic harness exceeds the 150s test cap and the AOT target needs LLVM-21 on PATH: full backend-spec cargo st 4600/45/51 baseline + LLVM AOT debug+release 2322/16 — zero NEW failures vs the §06-a08 2322/16 baseline. Relative to the original 2284/19 baseline, AOT passes rose +38 and failures dropped −3: §06 is strictly better, never regressive.)
  • Plan annotation cleanup. (2026-06-03: §06 body carries no stale <!-- blocked-by --> / TODO / FIXME / placeholder annotations; the only blocked-by mentions are HISTORY-prose documentation of the §06.1→§09.2 real-RC-activation relocation, a permitted-prose surface.)
  • Plan sync done; mission criterion-9 flip is §09.2’s deliverable, NOT §06’s. (2026-06-03: 00-overview criterion 9 (line 106) already routes SITE→§06 / ACTIVATION→§09.2 and states “Flips [x] at §09.2 close, NOT §06 close”; §06’s compiler-derived doc surfaces — arc.md ORI_DISABLE_BURDEN_MIRROR / ORI_DUMP_AFTER_BURDEN debug entries + the burden-balance diagnostic — landed with the §06 work in commit f2d078ff4. The full aims-rules.md / canon.md §7.1 / missions.md §AIMS sync is §08’s deliverable per 00-overview line 108. §06 does NOT flip criterion 9 — flipping it here would prematurely claim the real-RC ACTIVATION done before §09.2 retires the predicate stack.)

06.R.H — Hygiene Findings

Already resolved this review run

  • RESOLVED: [BLOAT:decorative-banner — 22 instances] compiler/ori_arc/src/aims/verify/burden_balance/tests.rs — hygiene-lint --fix --apply stripped 22 decorative comment banners. Auto-fixed in Phase 0.
  • RESOLVED: [STRUCTURE:co-evolution — postprocess.rs:75] compiler/ori_arc/src/pipeline/aims_pipeline/postprocess.rs:75 — mangled doc-comment per \`` + /// Surface` Layer 1` dangling-backtick fragment (C-B13 non-spec-pointer leak). Rewrote to self-contained present-tense description of verify/debug_assertions gating. Fixed in Phase 0.5.
  • RESOLVED: [STRUCTURE:removal-trail — project_escape.rs:70] compiler/ori_arc/src/aims/realize/project_escape.rs:70 — C-B3 change-trail // Previously this used a single parent->project_dst map … Now each arg gets its own RcInc. Rewrote to present-tense WHAT-only. Fixed in Phase 0.5.
  • RESOLVED: [LEAK:swallowed-error — emit_unified.rs:590] compiler/ori_arc/src/aims/realize/emit_unified.rs:590.unwrap_or_default() mechanical match. Documented-invariant cure: added // INVARIANT: comment (legitimate contract-absence per IC-5/TF-6 CONSERVATIVE default; NOT lossy fallback). Fixed in Phase 0.5.
  • RESOLVED: [LEAK:swallowed-error — emit_unified.rs:611] compiler/ori_arc/src/aims/realize/emit_unified.rs:611.unwrap_or_default() mechanical match. Same documented-invariant cure as :590. Fixed in Phase 0.5.
  • RESOLVED: [NAMING:provenance-leak — burden_lower/tests.rs — 10 sites] compiler/ori_arc/src/lower/burden_lower/tests.rs lines 510, 602, 1921, 2547, 3669, 433, 1942, 1991, 2040, 2074 — 10 test function names carrying ephemeral plan-section/pair-cycle IDs (_per_03_4_cycle_50b, _cycle_42, _cycle_46, _per_03_3_rule_5, etc.) banned per impl-hygiene.md §Test Function Naming. Renamed in-place; provenance moved to /// doc comments. test-naming-lint clean, 57 tests green. Fixed post-Phase-3 (commit 6ba573306). (P3-F1)
  • RESOLVED: [NAMING:litter-pickup — closure_drop.rs + ir/tests.rs] compiler/ori_llvm/src/codegen/function_compiler/closure_drop.rs doc-ref + compiler/ori_arc/src/ir/tests.rs sibling — two litter-pickup renames alongside P3-F1 cure. Fixed post-Phase-3. (P3-F1 litter-pickup)

Open — §06-attributable BLOAT (additive, opportunistic split when next touched)

  • DEFERRED (anchored): [BLOAT:file-length — walk_dec.rs] compiler/ori_arc/src/aims/realize/walk_dec.rs — 960 lines (+460 in f2d078ff4). PIN-4/PIN-5/PIN-6 SSA-alias-class dec-suppression flow + §06 Burden* pass-through arm. Anchor: this file is owned by §09 retirement; split anchor = §09 retire-file close-gate (extract PIN-4/PIN-5 class-suppression filter into sibling submodule at §09 retirement). Opportunistic until §09. (P3-F3)
  • DEFERRED (anchored): [BLOAT:file-length — edge_cleanup.rs] compiler/ori_arc/src/aims/emit_rc/edge_cleanup.rs — 804 lines (+304 in f2d078ff4). Added release_with_burden / release_with_burden_edge / release_with_burden_into_block family (coexistence handshake). Anchor: opportunistic-split-when-next-touched per impl-hygiene.md §File Organization; extract release_burden.rs sibling for the three helpers. (P3-F11)
  • DEFERRED (anchored): [BLOAT:file-length — burden_lower/mod.rs] compiler/ori_arc/src/lower/burden_lower/mod.rs — 788 lines (+288 in f2d078ff4). Suppression-set helpers + RL-4 liveness pair. Anchor: opportunistic-split-when-next-touched; extract suppression helpers → suppression.rs, RL-4 liveness pair → live_out.rs. (P3-F2)
  • DEFERRED (anchored): [BLOAT:file-length — emit_unified.rs] compiler/ori_arc/src/aims/realize/emit_unified.rs — 778 lines (+278 in f2d078ff4). §09-retiring file. Anchor: §09 retirement; file retired wholesale at §09, split not required pre-§09. Opportunistic until §09. (P3-F4)
  • DEFERRED (anchored): [BLOAT:file-length — dead_cleanup/mod.rs] compiler/ori_arc/src/aims/emit_rc/dead_cleanup/mod.rs — 629 lines (+129 in f2d078ff4). §06 touched the dead-cleanup path for burden-paired release. Anchor: opportunistic-split-when-next-touched. (P3-F10)
  • DEFERRED (anchored): [BLOAT:file-length — walk.rs] compiler/ori_arc/src/aims/realize/walk.rs — 733 lines (+233 in f2d078ff4). §09-retiring file. Anchor: §09 retirement. Opportunistic until §09. (P3-F5)
  • DEFERRED (anchored): [BLOAT:file-length — burden_lower/emit.rs] compiler/ori_arc/src/lower/burden_lower/emit.rs — 559 lines (+59 in f2d078ff4). Per-instr + per-terminator burden emission. Anchor: opportunistic-split-when-next-touched; extract emit_terminator.rs sibling. (P3-F6)
  • DEFERRED (anchored): [BLOAT:file-length — ir/instr.rs] compiler/ori_arc/src/ir/instr.rs — 543 lines (+43 in f2d078ff4). §06 added Burden* variants + helpers. Anchor: opportunistic-split-when-next-touched; methods could move to instr/methods.rs if growth continues. (P3-F7)
  • DEFERRED (anchored): [BLOAT:file-length — ir/mod.rs] compiler/ori_arc/src/ir/mod.rs — 513 lines (+13 in f2d078ff4). Marginally over cap. Anchor: opportunistic-split-when-next-touched. (P3-F8)
  • DEFERRED (anchored): [BLOAT:file-length — realize/decide.rs] compiler/ori_arc/src/aims/realize/decide.rs — 512 lines (+12 in f2d078ff4). Marginally over cap. Anchor: opportunistic-split-when-next-touched. (P3-F9)

Open — cross-scope record-only (owned by concurrent parallel-session AIMS work; NOT §06 close-blockers)

  • CROSS-SCOPE (parallel-session-owned): [INVERTED-TDD:ghost-test — Critical — intraprocedural/tests.rs:311] compiler/ori_arc/src/aims/intraprocedural/tests.rs:311analyze_function_terminates_on_back_edge_loop runs but assertion never checked. file NOT touched by f2d078ff4; owned by the concurrent parallel-session AIMS work, NOT §06’s deliverable. Owning session must add missing assertion or remove ghost test. NOT a §06 close-blocker.
  • CROSS-SCOPE (parallel-session-owned): [INVERTED-TDD:ghost-test — Critical — intraprocedural/tests.rs:3460] compiler/ori_arc/src/aims/intraprocedural/tests.rs:3460compute_project_alias_sources_cross_block_let ghost test. same cross-scope owner as above. NOT a §06 close-blocker.
  • CROSS-SCOPE (parallel-session-owned): [INVERTED-TDD:ghost-test — Critical — intraprocedural/tests.rs:5283] compiler/ori_arc/src/aims/intraprocedural/tests.rs:5283negative_pin_no_synthetic_context_hole_typeid_minting_pathway_exists ghost test. same cross-scope owner. NOT a §06 close-blocker.
  • CROSS-SCOPE (parallel-session-owned): [INVERTED-TDD:ghost-test — Critical — ir/validate/tests.rs:49] compiler/ori_arc/src/ir/validate/tests.rs:49unresolved_type_var_is_copy ghost test. file NOT touched by f2d078ff4; cross-scope parallel-session owner. NOT a §06 close-blocker.
  • CROSS-SCOPE (parallel-session-owned): [LEAK:catch-all-arms — Major — operators/mod.rs:159,339] compiler/ori_llvm/src/codegen/arc_emitter/operators/mod.rs lines 159 + 339 — two _ => unreachable!() catch-all arms (float unary op; Lt/Gt/LtEq/GtEq comparison). file NOT in §06 commit; cross-scope parallel-session owner. NOT a §06 close-blocker.
  • CROSS-SCOPE (parallel-session-owned): [LEAK:swallowed-error — Major — 5 cross-scope sites] compiler/ori_arc/src/aims/intraprocedural/block.rs:142, intraprocedural/post_convergence.rs:70, compiler/ori_llvm/src/codegen/arc_emitter/construction.rs:120, arc_emitter/drop_enum.rs:397, arc_emitter/rc_helpers.rs:455 — five .unwrap_or_default() sites NOT in f2d078ff4; unverified (may be legitimate-absence or genuine lossy-fallback). cross-scope parallel-session owner must classify each. NOT a §06 close-blocker.
  • CROSS-SCOPE (parallel-session-owned): [PLAN_ROUTING_DRIFT:stale-plan-annotation — Minor — generics.rs] compiler/ori_llvm/tests/aot/generics.rs — 6 stale-resolved TPR annotations (TPR-04-002/003/007) referencing repr-opt §04. file NOT in §06 commit; cross-scope (repr-opt §04 owner). NOT a §06 close-blocker.
  • CROSS-SCOPE (parallel-session-owned): [PLAN_DELIVERY_DRIFT:MISSING_PROPAGATION — Minor — bug-tracker/plans/completed/] 16 closed bug plans missing delivered_to_roadmap field (Phase 0 delivery-drift). pre-existing cross-scope issue; no §06 bug plans closed in f2d078ff4; tracker-maintenance owner. NOT a §06 close-blocker.

Informational (non-blocking; no action required)

  • NOTE [emit_unified.rs:590,611] Two .unwrap_or_default() hygiene-lint hits are mechanical false positives: contracts.get(&func.name) returns Option<&MemoryContract>; None is legitimate absence (TF-5/TF-6 CONSERVATIVE default for absent contract per IC-5). The // INVARIANT: comments (Phase 0.5 cure) are architecturally correct; residual lint hit is a comment-unaware syntactic detector. No action. (P3-F12)
  • NOTE [walk.rs:82,426] BurdenInc/BurdenDec pass-through in Phase-7 realize walk is correct §06 SITE-establishment (markers preserved verbatim; codegen no-op at instr_dispatch.rs:519). Real-RC activation relocated to §09.2 per LEDGER §B.2 double-emit hazard. NOT a GAP. (P3-F13)
  • NOTE [instr_dispatch.rs:556,606] debug_assert!(false) arms guarding BurdenDecPartial-on-non-struct and BurdenDecVariant-on-non-enum are sound cross-crate defense-in-depth (not impossible-state WASTE): compute_drop_info return shape is not statically guaranteed to match the burden-op variant at the codegen site. (P3-F14)
  • NOTE [postprocess.rs:75,88-89] Phase 0.5 co-evolution cure (mangled doc-comment) verified clean post-fix. No action. (P3-F15)
  • NOTE [project_escape.rs:70] Phase 0.5 removal-trail cure verified clean post-fix (present-tense WHAT-only). No action. (P3-F16)
  • NOTE [burden_elim/tests.rs:1186] Semantic-pin doc comment STRICTLY SHRINKS … This pin FAILS on revert is testing-discipline vocabulary (tests.md §Matrix Clamping), not a C-B3 change-trail. Mechanical detector false-fired; left unchanged correctly. No action. (P3-F17)
  • NOTE [tooling-gap] Hygiene-lint swallowed-error check lacks comment-awareness: documented-invariant .unwrap_or_default() sites re-fire perpetually despite adjacent // INVARIANT: comments. Candidate for /improve-tooling comment-aware refinement (add a suppression-comment parser to the swallowed-error detector). Non-blocking; informational.

HISTORY

  • 2026-06-02 a10 — §06.3 RcAtomicity carrier SITE landed; RL-19/20/21 NonAtomic-selecting dispatch relocated to repr-opt/section-10 per routing.md §4. Grounding §06.3 against actual code established the SITE-vs-ACTIVATION split for the atomicity carrier: (1) the shipped runtime RC primitives ori_rc_inc/ori_rc_dec (compiler/ori_rt/src/rc/mod.rs) are UNCONDITIONALLY atomic (AtomicI64::fetch_add/fetch_sub); there is NO non-atomic runtime, NO emit_rc_inc/emit_rc_dec atomicity branch in ori_llvm, and NO thread-escape analysis in ori_arc. RL-19/20/21 are entirely target-only. SITE delivered NOW (carrier + default-Atomic, observably a no-op): RcAtomicity { Atomic, NonAtomic } enum on RcInc/RcDec ArcInstr variants (ir/instr.rs); repr + default_atomic() + is_atomic() + fmt_atomicity_suffix() (ir/repr.rs + ir/format/mod.rs); exported from ir/mod.rs + crate root; every construction site across aims/emit_rc/{mod,forward_walk,coalesce}, aims/emit_reuse/dynamic, aims/realize/{walk,walk_dec,emit_unified,project_escape,mod} sets RcAtomicity::default_atomic() (= Atomic), reproducing today’s all-atomic emission bit-for-bit. atomic_rc_dec helper extracted in walk_dec.rs (DRY + restores the 100-line emit_defined_dead cap). The atomicity formatter suffix is empty for Atomic, so AIMS-snapshot output is byte-identical for the carrier (the 2 realize_rc_reuse snapshots re-blessed in this session changed ONLY for the pre-existing uncommitted §06.1 a08 faithful-emission RL-4 delta — +RcDec %2, -burden_inc/dec — NOT the atomicity carrier; verified zero [non-atomic] lines in the bless diff). ACTIVATION relocated to plans/repr-opt/section-10-thread-local-arc.md §10.2 per routing.md §4: the RL-19/20/21 dispatch that POPULATES NonAtomic requires §10.1’s ThreadLocality thread-escape analysis (compiler/ori_repr/src/escape/thread.rs) + §10.2’s non-atomic runtime (ori_rc_inc_nonatomic/ori_rc_dec_nonatomic) + §10.2’s atomic-vs-non-atomic codegen selection (emit_atomic_rc/emit_nonatomic_rc) — all already owned by §10 (status: not-started). Populating NonAtomic in §06.3 without §10’s backend would be an inert no-op deliverable (carrier ignored by unconditionally-atomic codegen). NOT a §09.2 relocation — §09.2 CONSUMES this carrier (its line references “atomicity carrier per §06.3 RcAtomicity”); §10.2 POPULATES the NonAtomic value. SITE tests landed (ir/repr/tests.rs: 4 RcAtomicity pins, semantic + negative). The 3 NonAtomic-SELECTION tests (cross-thread-escape FFI-export → Atomic; intra-thread Sendable → NonAtomic; whole-program RL-21 → all NonAtomic) + the channel-send #skip companion (blocked by E2040 → BUG-02-037, filed this session) relocated to §10.2 with the dispatch — they require §10’s selecting backend to exercise. §06.3 checkboxes 1+2 flipped [x] (carrier + repr DONE); the SITE tests checkbox flipped [x]. GATES: LLVM_SYS_211_PREFIX=/usr/lib/llvm-21 cargo build --all-targets GREEN ori_arc+ori_llvm debug+release; cargo test -p ori_arc --lib 1527/0 debug + 1523/0 release; clippy clean ori_arc+ori_llvm; VF-1=0 distinct corpus-wide (diagnostics/burden-balance.sh over all 459 spec files, before AND after — carrier is emission-neutral); AIMS snapshot suite green (2 re-blessed for the pre-existing faithful-emission delta). §10 frontmatter gains the relocated dispatch + tests. Working tree carries the carrier + plan edits + BUG-02-037 uncommitted (no git commit per charter).
  • 2026-06-02 a09 — §06.2 compound-instruction SITE: annotation-surface premise corrected; consumers wired+active today; ZERO §09.2 relocation. Grounding the §06.2 design intent against actual code surfaced that the premise — “Phase 6 lands COW/reuse/drop-hint MARKERS on surviving burden ops; §06.2 wires a Step-10 consumer to READ those markers” — does not match the proven AIMS architecture and MUST NOT. The burden-op variants (BurdenInc/BurdenDec/BurdenDecPartial/BurdenDecField/BurdenDecVariant, compiler/ori_arc/src/ir/instr.rs) carry ONLY var/field/base — no annotation field. Phase 6 (realize/burden_elim.rs:eliminate_burden_ops) is pure DP-2/DP-3 removal; it does not (and a removal-only census guard asserts it MUST not) construct or annotate burden ops. Adding a compound-annotation field to a burden op would be a parallel SoT / shadow uniqueness tracker, banned by aims-rules.md Invariant-5. The architecturally-correct (and shipped) mechanism: COW/reuse/drop-hint are read from the CONVERGED lattice DIMENSIONS (Uniqueness, Shape) at the realize sites — realize/decide.rs:decide_cow (DP-9, RL-7/RL-8), decide_reuse + emit_reuse/{detect,dynamic,planner}.rs (DP-6, RL-11/RL-11a/RL-12), decide_drop_hint (PL-4 post-merge) — exactly as §05.2’s dimension-wiring audit established (“each consumer reads the converged lattice dimension… burden-transparent. Role survives the emission→elimination shift”). arg-ownership: ArcParam.ownership at Step 2 apply_aims_ownership (pipeline/aims_pipeline/batch.rs) + call-site arg_ownership at Step-4b-prelude emit_arg_ownership (pipeline/aims_pipeline/mod.rs), per PL-5 + TF-11 IC-3. ALL FOUR SITE consumers are wired + active TODAY. No §05.2 dependency gap: §05.2 (status: complete) delivered the converged-dimension reads, NOT markers; the §06.2 dependency is satisfied. ZERO §09.2 relocation for §06.2: the compound instructions emit REAL LLVM instructions today (ori_llvm/.../arc_emitter/emitter_utils.rs consumes CowMode for real in-place-vs-copy; Reset/Reuse real; drop-hints real) — they were NEVER burden-op codegen no-ops, so flipping carries NO double-emit hazard against the live predicate stack. The LEDGER §B.2 double-emit hazard that relocated the §06.1 whole-var BurdenInc→RcInc flip to §09.2 applies ONLY to whole-var burden ops, NOT to these dimension-driven compound realizations. SITE-consumer test coverage is the existing matrix (77-cell realize/tests.rs decision matrix for COW/reuse/drop-hint + COW FileCheck codegen + cow spec corpus + arg_ownership/tests.rs); fabricating a marker-reader test would be test-inflation per tests.md §Anti-patterns (no marker-reader exists to pin). GATES: dev binary rebuilt; VF-1=0 distinct corpus-wide (diagnostics/burden-balance.sh) BEFORE and AFTER (no code change — plan-doc-only edit); cargo test -p ori_arc --lib 1527/0 debug; clippy clean ori_arc. §06.2 body design-intent + checkboxes reworded SITE-vs-activation; NO §09 plan edit (no activation relocated).
  • 2026-06-02 — Linear-execution-blocked auto-cure: real-RC activation relocated §06.1 → §09.2 (routing.md §4): §06.1’s two §09-coupled [ ] items (the BurdenInc→RcInc / BurdenDec→RcDec REAL-RC mechanical-mapping checkbox + its real-RC FileCheck-on-RcDec test pins) carried banned <!-- blocked-by: §09 --> annotations (routing.md §4 prohibits the annotation as a long-term cure; INV-19 forbids §06.1 carrying a forward-dependency on downstream §09). Per routing.md §4 MOVE-the-item discipline, the real-RC ACTIVATION was relocated to §09.2 (predicate-stack retirement) where the burden ops become the sole RC emitter and the flip is safe (LEDGER §B.2 double-emit hazard dissolves WITH the predicate-stack removal). §06.1’s residue is the SITE deliverable only (faithful Phase-5 emission VF-1=0 + mirror removal + grep-zero + RL-4 live-out matrix — all DONE), plus a non-checkbox citation pointing to §09.2; the §09-coupled items are no longer actionable-[ ] in §06.1. success_criterion 3 reworded SITE-vs-activation; §09 frontmatter gains the activation success-criterion + realize/mod.rs touch. §06.1 now closes on its actual SITE deliverable.
  • 2026-05-22 — Autopilot auto-cure: phantom_ids=[§05]; per decisions/10-target-self-drift-cure.md 2026-05-11 autopilot carve-out
  • 2026-05-22 — /review-plan Step 5 editor cycle: applied surgical edits per /tp-help reviewer findings (claude-ds Findings 1-3 + codex Findings 1-3 + agy Findings 1-2). Concretely: depends_on extended ["05", "02"]["03", "04A", "05", "02"] (claude-ds 3); success_criterion 6 rewritten from auto-suggest placeholder to concrete §05.2/§03/§02 dep statement (claude-ds 2); Intel recon block replaced boilerplate with concrete symbol inventory (claude-ds 1); §06.1/§06.2/§06.3 Tests bullets tightened to matrix-test + semantic-pin + parity + leak-check rigor (codex 3); §06.3 RcAtomicity defined as carrier-on-ArcInstr before atomic-vs-non-atomic dispatch (codex 2); body Depends on: section adds §04B Prototype Gate predecessor + rescope-on-FAIL branch (codex 1); §06.2 arg-ownership resolved to Step 4b-prelude per aims-rules.md PL-5 with plan-frontmatter goal-line drift flagged for §08 sync (agy 1); success_criterion 4 extends element_fn_gen to include instr_dispatch as second cross-crate compute_drop_info consumer (agy 2).
  • 2026-06-02 — Stale review_pipeline: marker cleared by /continue-roadmap orchestrator: marker carried stage: ?, next_step: ?, updated: ?. Per /review-plan SKILL.md §Step 1a stale-marker rule (reviewed: false + marker present → STALE by definition), marker invalid; prior diagnosis preserved here for traceability. Cure rooted in scripts/plan_orchestrator/markers.py:clear_stale_marker_if_unreviewed.
  • 2026-06-02 — /review-plan Step 5 editor cycle (pre-implementation plan-shape review): applied surgical edits per agy + opencode reviewer findings (codex returned skeleton-only; survivor-mode 2-of-3). Concretely: promoted burden_mirror reconcile_burden_ledger neutralization sequencing to a section-level ORDERING-GATE success_criterion (was §06.1 checkbox only) — mirror neutralized AND VF-1 clean BEFORE any whole-var BurdenInc→RcInc / BurdenDec→RcDec lowering, per LEDGER §B.2 spurious-RC-after-lowering risk (opencode-F1, Major); added ir/instr.rs (RcAtomicity carrier) + ir/repr.rs (atomic-vs-non-atomic representation per RL-18/19) to touches: for orchestrator conflict-detection + locked-design guards (opencode-F2); added §06.2 design-intent block stating Phase 7 realize_rc_reuse does only whole-var mapping (no compound code), compound COW/reuse/drop-hint stays at Step 10 realize_annotations, arg-ownership at Step 4b-prelude (opencode-F3); narrowed the §06.1 verify-zero gate from whole realize/ dir to realize/mod.rs (the rewritten site) — the §09-retiring sibling files keep predicate sites until §09, so a whole-dir grep is unsatisfiable pre-§09; reconciled the Intel-recon block to match (audit gap-1); mapped the §06.3 TPR checkpoint exit reasons to decisions/31 Option C to avoid autopilot state-machine stalls (agy-F1); re-pathed the §06.3 cross-thread atomic-RC test to an FFI-pointer-export exercise with a #skip channel-send companion anchored to E2040 resolution (agy-F2); added timeout 150 ./test-all.sh (no-NEW-failures-beyond-baseline per LEDGER §B.3, baseline AOT 2284/19) to the §06.N close-gate (agy-F3); added §02-under-enumeration provenance note to success_criterion 4 so the two-consumer superset reads as deliberate (cohesion gap-2).
  • 2026-06-02 — §06.1 Step A (faithful Phase-5 burden emission) landed; ORDERING-GATE Steps B/C pending AOT-path verification: release_with_burden(func, var, strategy) + carries_burden(func, var) added to compiler/ori_arc/src/aims/emit_rc/mod.rs, wired into predicate-stack release sites (emit_rc/trampoline.rs, emit_rc/edge_cleanup.rs, emit_rc/dead_cleanup/mod.rs) so every release RcDec co-emits a faithful paired BurdenDec gated on carries_burden — “one SSOT, two emitters” (Invariant-5-clean, no parallel pass; grounded RL-2/RL-4/RL-5). ORI_DISABLE_BURDEN_MIRROR=1 bisection flag added at pipeline/aims_pipeline/mod.rs + documented in arc.md/compiler-ops.md. Build green (ori_arc + ori_llvm --all-targets, debug + release). cargo st mirror-ON ≡ mirror-OFF (4600 passed / 45 failed / 51 skipped, byte-identical) — Step A introduced ZERO spec regressions; the 45 failures are the pre-existing type-error-blocked frontend baseline (fmt declarations / http caller), NOT §06 burden/RC. ORDERING-GATE remainder pending: conclusive VF-1 verify_burden_balance 656→0 measurement via the AOT/LLVM path (the eval spec harness does not surface the debug-assert warn) → gated Step B reconcile_burden_ledger removal (ONLY after VF-1=0, per LEDGER §B.2 spurious-RC-after-lowering hazard) → Step C mechanical BurdenInc→RcInc/BurdenDec→RcDec verification in realize/mod.rs → matrix tests. Verification + B/C continuation is code-authoring chartered to an Opus agent, transiently server-rate-limited across three consecutive dispatches; next autopilot firing retries when the rate-limit clears.
  • 2026-06-02 follow-up — §06.1 faithful-emission redesign: VF-1 350→25 via 3 RL-2-grounded emission fixes; ORDERING GATE still OPEN (25≠0), Steps B/C NOT attempted. MEASUREMENT CORRECTION: the staged working tree already carries the prior session’s eliminate_whole_function (function-wide Phase-6 elim) in burden_elim.rs, so the true AOT-path VF-1 baseline is 350 / 93 files (all net=-1/-2 orphan decs), NOT the LEDGER §B.2 “656”. DOMINANT GAP re-localized (per ORI_DUMP_AFTER_BURDEN=1 + ORI_LOG=ori_arc::aims::verify::burden_balance=debug per-block deltas): a FRESH heap value passed at a BORROWED Invoke/InvokeIndirect arg position (the assert_* message-string family dominates; 319/324 files import std.testing) gets a terminator-last-use BurdenDec from the burden walk AND a scope-exit release BurdenDec from the predicate-stack edge cleanup (release_with_burden) → double-count → net -1 per terminal path. THREE EMISSION FIXES LANDED in compiler/ori_arc/src/lower/burden_lower/ (all RL-2-grounded, no parallel path, Invariant-5-clean): (i) compute_borrowed_alias_vars (mod.rs) excludes Let-Var aliases of borrowed params from owned_vars_needing_rc (a borrow’s alias is a borrow per TF-2/TF-4 → no burden ops; cures §B.2 gap (b)); (ii) compute_transfer_via_move_alias (mod.rs) backward-propagates terminator/owned-position transfer through Let { Var } MOVE-alias chains (src used once) to a fixpoint, suppressing the move source’s last-use dec + symmetric inc (cures id<T>(x)=x owned-param-returned-via-alias orphan dec); (iii) invoke_terminator_borrowed_args (emit.rs) — THE dominant fix (345→25) — suppresses the terminator-last-use BurdenDec for a value at a borrowed Invoke/InvokeIndirect arg position (value survives the borrowed call; released at the successor by the predicate-stack edge cleanup whose release_with_burden co-emits the paired scope-exit dec; emitting the terminator dec too double-counts). GATE STATUS: LLVM_SYS_211_PREFIX=/usr/lib/llvm-21 cargo build --all-targets GREEN ori_arc+ori_llvm debug+release; cargo test -p ori_arc --lib 1530/0 green (debug + release 1526/0); AOT suite 2322 passed / 16 failed — the 16 failures are IDENTICAL with-vs-without my changes (verified by restoring the staged baseline and re-running) = PRE-EXISTING dirty-tree state (incl. the aims_burden_alias::test_burden_alias_inner_survives_result_destructure pin, which fails at the staged baseline too), ZERO new failures from my edits; VF-1 = 25 (was 350 staged baseline). 3 NEW dead-ends + 1 untried-risky candidate recorded in LEDGER §B.2 (Step-4b unwind-edge pass INERT/972, block-local-pair elim guard 2433, dec-only-retention guard 3055, Apply-body borrowed-call deferral 475). RESIDUAL 25 / 15 files (the §06.1 checkbox is NOT satisfiable until 0): diverse Step-A coexistence-pairing long-tail — dominant = owned-param-to-Invoke-OWNED-arg transfer where release_with_burden over-pairs a burden_dec on the transferred-out var (the callee consumes it; the predicate-stack unwind-edge release double-counts against the burden ledger). NEXT SURFACE to reach 0 (the inverse of fix (iii)): gate release_with_burden’s carries_burden so the predicate-stack edge/scope-exit release does NOT pair a burden_dec for a var transferred OUT at an owned Invoke/InvokeIndirect arg position; secondary: a project-escape-aware Project-dst borrow exclusion (a blanket Project-dst exclusion is UNSAFE — project-escape RL-15a adds incs); plus niche-Option<str> payload, Never-propagation, TRMC residuals. Steps B (mirror removal) + C (mechanical lowering + grep-zero) + matrix tests REMAIN GATED on VF-1=0. Working tree left with the 3 emission fixes uncommitted (per charter: no git commit).
  • 2026-06-02 a07 — §06.1 faithful-emission: VF-1 19→10 via 3 RL-grounded fixes + permanent burden-op diagnostics; ORDERING GATE still OPEN (10≠0), Steps B/C NOT attempted. MEASUREMENT CORRECTION: prior “25/15” is a raw-grep over-count; the DISTINCT (var, exit_block) baseline via the new diagnostics/burden-balance.sh is 19 / 15 files. Built permanent burden-op-aware diagnostics (the dump-correlation gap that made this hard): diagnostics/burden-balance.sh (distinct-imbalance corpus measurement, stale-binary-aware), burden_sites= in the verify_burden_balance imbalance trace, binc/bdec in trace_phase_snapshot, per-block burden_sites= in the AIMS pipeline-checkpoint INFO log, function-name in the imbalance WARN. DOMINANT net=-1 localized: the predicate-stack edge/dead-at-entry cleanup co-emitted a BurdenDec on the unwind/dead edge for a var transferred OUT at an OWNED Invoke/InvokeIndirect arg — already balanced at the transfer point, so the edge dec double-counts. 3 FIXES LANDED (RL-2/RL-4/RL-5-grounded, Invariant-5-clean, no parallel path): (i) release_with_burden_edge (emit_rc/mod.rs; wired at edge_cleanup.rs apply_edge_decs + trampoline.rs) suppresses the paired BurdenDec (keeps RcDec) for an owned-transfer arg of the PRED terminator — inverse of a06 fix (iii); (ii) release_with_burden_into_block (same SSOT; wired at the 3 dead_cleanup emit_dead_at_entry_decs sites) — successor-keyed companion suppressing the block-entry BurdenDec for an owned-transfer Invoke arg’s successor block; (iii) compute_borrowed_terminator_invoke_args (burden_lower/mod.rsinc_suppressed_vars) suppresses the FRESH-site BurdenInc for a FRESH value passed at a BORROWED terminator Invoke arg (callee stores it into its result; a06 fix (iii) already suppresses its terminator dec, so the var ends carrying NO burden ops → fully predicate-stack-managed). GATE STATUS: cargo build --all-targets GREEN ori_arc+ori_llvm debug+release; cargo test -p ori_arc --lib 1530/0 debug + 1526/0 release; clippy clean (fixed one pre-existing detached-doc warning in burden_elim.rs litter-pickup); AOT suite 2322 passed / 16 failed = IDENTICAL to the charter baseline (the 16 = BUG-04-123 predicate-stack double-frees + BUG-04-121 VF-1 loop residuals: aims_burden_alias/borrow_independence/for_yield_option/generics/higher_order/match_alias/tagless_enum), ZERO new AOT failures from my edits. test-all.sh width_tests_spec + width_tests_comprehensive (ori_fmt) fail on the untracked tests/spec/traits/index_set/updated_method.ori line 88 (>60 chars) — a dirty-tree artifact from a parallel session staged BEFORE this session (I touched no ori_fmt / .ori files); NOT a burden regression. 1 NEW dead-end recorded in LEDGER §B.2 (FRESH-borrowed terminator-dec retention → 12→190). RESIDUAL 10 / 7 files: all net=-1/-2 ORPHAN-DEC, all in the JIT/eval conservative-contract realization path (NOT the AOT codegen path, which ORI_DUMP_AFTER_ARC confirms balanced for the same functions) — comparable find_max/find_min, cow/{substring,string_cow,matrix_string}, option_str, index/definition, debug/escape (a single-inc value receiving a BurdenDec on >1 CFG branch). Next surface: contract-precision analysis of why the conservative-contract JIT realization emits per-branch decs for a single-inc value. Steps B (mirror removal) + C (mechanical lowering + grep-zero) + matrix tests REMAIN GATED on VF-1=0. Working tree carries the 3 emission fixes + permanent diagnostics uncommitted (no git commit per charter).
  • 2026-06-02 a08 — §06.1 VF-1 10→0 (ORDERING GATE MET) + Step B mirror removal; Step C real-RC flip is §09-coupled (blocker, NOT defer). VF-1 10→0 in ONE RL-4-grounded fix (the entire residual was one bug class). ROOT (per a07 localization, confirmed via ORI_DUMP_AFTER_BURDEN + per-block verify_burden_balance deltas): detect_last_uses in lower/burden_lower/mod.rs is purely PER-BLOCK — it registers a “last use” (and thus a BurdenDec) in EVERY block where a var appears, with no cross-block liveness. For a var live-OUT of a block (used in a reachable successor — comparable::find_max %0 aliased in bb0 AND bb1; cow::shared_substring/debug::escape FRESH str aliased across bb0→bb1), the in-block last-use dec is SPURIOUS: the value lives on, so emitting a dec there releases a reference still needed downstream → VF-1 net=-1/-2 on the live-out path. Per Spec: Annex E §AIMS RL-4 (edge-specific decs: a var live at block exit but dead at successor entry releases on the dying CFG EDGE, not unconditionally in the block), the genuine releases are (a) the dead-OUT block’s own last-use dec (kept) and (b) the predicate-stack edge / dead-at-entry cleanup (release_with_burden_*) on the dying edges (already emitted by realize). FIX (RL-4-grounded, Invariant-5-clean, no parallel path): compute_live_out_owned (lower/burden_lower/mod.rs) — standard backward liveness restricted to owned_vars_needing_rc (gen/kill mirrors liveness::compute_liveness, keyed on the burden walk’s own owned-RC set — no parallel ownership tracker); threaded into BurdenAnalysisCtx.live_out_per_block and consumed at BOTH emit_last_use_decs (instruction-position) and emit_terminator_burden_decs (terminator-position) in emit.rs to SUPPRESS the in-block last-use BurdenDec for any var live-out of the block. STEP B (mirror removal) DONE: reconcile_burden_ledger call + BURDEN_MIRROR_DISABLED static + ORI_DISABLE_BURDEN_MIRROR flag removed from pipeline/aims_pipeline/mod.rs; aims/realize/burden_mirror.rs + burden_mirror/tests.rs deleted; mod burden_mirror + pub(crate) use reconcile_burden_ledger removed from realize/mod.rs; ORI_DISABLE_BURDEN_MIRROR debug_flags.rs entry + arc.md/compiler-ops.md/diagnostic.md doc lines + burden_delta.rs comment scrubbed; burden-balance.sh updated (mirror flag dropped — faithful emission is the sole RC path, script KEPT). Zero reconcile_burden_ledger/burden_mirror/BURDEN_MIRROR_DISABLED/ORI_DISABLE_BURDEN_MIRROR references corpus-wide; check-debug-flags.sh clean (0 stale/orphan/undocumented). VF-1=0 holds mirror-REMOVED corpus-wide. STEP C grep-zero DONE (site established): realize/mod.rs verified zero of the 6 predicates (class_alive_after/pin4_class_emits_dec_set/pin6_any_ancestor_will_cover/class_payload_of/canonical_rep_for/var_emits_dec_in_block) — it is a thin dispatcher; the predicates live in the §09-retiring siblings (walk_dec.rs/walk.rs/emit_unified.rs) per line 144 scope. STEP C real-RC flip (checkbox 2 + success-criterion 3) BLOCKED on §09, NOT deferred: burden ops are codegen no-ops (instr_dispatch.rs:509); the predicate stack STILL emits the real RcInc/RcDec (in the §09-retiring walk_dec.rs/emit_unified.rs). Flipping BurdenInc→RcInc to REAL RC NOW would DOUBLE-emit RC alongside the live predicate stack → double-frees — exactly the LEDGER §B.2 / success-criterion-1 ORDERING-GATE hazard (line 20-22). The architecturally-correct path per The One Rule is to NOT reintroduce double-frees; the no-op→real-RC activation is structurally coupled to §09 removing the parallel predicate emission (the whole-realize/-dir zero-reference assertion IS the §09 close-gate per line 144). realize/mod.rs is established as the clean lowering site; §09 flips the activation. MATRIX TESTS DELIVERED (lower/burden_lower/tests.rs, 3 RL-4 semantic+negative pins): owned_param_live_out_of_block_gets_no_in_block_last_use_dec (conditional-transfer Branch), fresh_value_live_across_blocks_nets_burden_balance_zero (multi-block Jump; verify_burden_balance empty semantic pin), dead_out_value_keeps_its_single_block_last_use_dec (narrowness negative-space — suppression fires ONLY for live-out, not dead-out). Reverting RL-4 → bb0-dec reappears → VF-1 imbalance (negative pin via per-block dec count). GATE: cargo build --all-targets GREEN ori_arc+ori_llvm debug+release; clippy clean (split compute_live_out_owned + extracted compute_use_counts_and_dup_aliases for the 100-line cap; fixed a litter-pickup decorative-banner in tests.rs); cargo test -p ori_arc --lib 1527/0 (was 1524 post-mirror-test-removal + 3 RL-4 = 1527); AOT suite 2322 passed / 16 failed = IDENTICAL charter baseline (16 = BUG-04-123/121, enumerated above), ZERO new AOT failures; aims-proof check 172/0 regressions (locality divergent_pending non-fatal); prose-lint clean (docs + touched .rs). test-all.sh residual NON-mine failures: 2 ori_fmt width_tests (parallel-session index_set/updated_method.ori dirty artifact), 45 interpreter (no method 'updated' ×18 parallel-session index_set feature + blocked by type errors ×26 + eq on Point ×1 frontend baseline) — none RC/burden. LEAK NOTE: tests/valgrind/cow/cow_list_set.ori reports “1 RC allocation not freed” — PROVEN pre-existing predicate-stack (not mine): persists IDENTICALLY with ORI_DISABLE_BURDEN_OPS=1 (all burden emission off → pre-§04A baseline); burden ops + mirror are codegen no-ops so CANNOT alter real RC codegen. §09-retirement / BUG-04-123 class, outside §06.1 burden-emission scope. ORDERING GATE (mirror-neutralized + VF-1-clean) MET; checkbox-2 real-RC flip §09-coupled. Working tree carries the RL-4 fix + Step B/C + matrix tests + diagnostics uncommitted (no git commit per charter).