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_infowrapper consumed byelement_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 oriscripts/intel-query.sh --human callers realize_rc_reuse --repo oriscripts/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_reuseentry 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 acrosscompiler_repo/compiler/ori_arc/src/aims/realize/{mod.rs, walk.rs, walk_dec.rs, emit_unified.rs, burden_elim.rs}andcompiler_repo/compiler/ori_arc/src/aims/emit_rc/dead_cleanup/emission_site.rs. §06.1 rewrites the lowering siterealize/mod.rsand 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 per00-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_annotationsPhase 2 post-merge perarc.md §PipelineStep 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), THENreconcile_burden_ledger+burden_mirror.rs+burden_mirror/tests.rs+BURDEN_MIRROR_DISABLED+ORI_DISABLE_BURDEN_MIRRORdeleted; 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 withincompiler_repo/compiler/ori_arc/src/aims/realize/mod.rs(the rewritten lowering site); grep-enforced at section close. SCOPE NARROWED torealize/mod.rs(not the wholerealize/dir): the §09-retiring predicate definitions + call-sites intentionally REMAIN insiderealize/atwalk_dec.rs+walk.rs+emit_unified.rs+emit_rc/dead_cleanup/emission_site.rsper00-overview.md absorbed_bugs[BUG-04-118]until §09 wholesale-retires them — a grep over the wholerealize/dir CANNOT return zero pre-§09 and would make this gate unsatisfiable.realize/mod.rsis 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.rsreturns 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_balanceempty) + 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_annotationsStep-10 site (realize/decide.rs:decide_cow→CowMode; 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_annotationsPhase 2 post-merge (realize/decide.rs:decide_drop_hint, unchanged location peraims-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.ownershippopulated at Step 2apply_aims_ownership(pipeline/aims_pipeline/batch.rs) fromMemoryContract; call-sitearg_ownershippopulated at Step-4b-preludeemit_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 pertests.md §Anti-patterns):- COW:
decide_cowdecision 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_reusecandidacy pins (realize/tests.rs, DP-6 × Shape × Uniqueness) +emit_reusedetect/dynamic/planner + AOTrealize_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_hintmatrix (realize/tests.rs, Uniqueness × collection-shape × borrowed-param × rc-incremented, semantic + negative pairing). - arg-ownership:
arg_ownership/tests.rs(ArgOwnership::Owned/Borrowedat indirect calls, mono-name merge) +apply_aims_ownershipexercised pipeline-wide.ArcParam.ownershippopulation verified atapply_ownershipStep 2.
- COW:
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
RcAtomicityenum per codex Finding 2 BEFORE atomic-vs-non-atomic dispatch: variants{ Atomic, NonAtomic }incompiler_repo/compiler/ori_arc/src/ir/instr.rs(carrier onRcInc/RcDecArcInstrvariants). DONE (2026-06-02 a10):RcInc/RcDeccarryatomicity: RcAtomicity; every construction site setsRcAtomicity::default_atomic()(=Atomic), reproducing the shipped unconditionally-atomic runtime RC primitives bit-for-bit. Exported fromir/mod.rs+ crate root. TheNonAtomic-SELECTING dispatch (RL-19/20/21 thread-locality derived fromLocality+ call-graph perRL-18a) is RELOCATED toplans/repr-opt/section-10-thread-local-arc.md §10.2perrouting.md §4— that section owns the thread-escape analysis (§10.1) + non-atomic runtime (§10.2) the dispatch requires. -
RcAtomicityrepresentation (discriminant placement / layout for the carrier on loweredRcInc/RcDec, perRL-18/RL-19) incompiler_repo/compiler/ori_arc/src/ir/repr.rsalongside the existingRcStrategyrepr — this is the in-body rationale for their/repr.rsentry intouches:. DONE (2026-06-02 a10):RcAtomicityenum +default_atomic()+is_atomic()+fmt_atomicity_suffix()(renders""for Atomic — byte-identical AIMS-snapshot output —" [non-atomic]"for NonAtomic) inir/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 toplans/repr-opt/section-10-thread-local-arc.md §10.2perrouting.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.3RcAtomicitycarrier” + 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#skipcompanion (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 Rulesemantic + 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-reviewcovering 06.1-06.3. Map the/tpr-reviewexit 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/resolvedadvance the subsection;cap_reached_with_substantive/cap_reached_cleanroute 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.rsPendingRccarries no atomicity field; flush hardcodesdefault_atomic(), latent miscompile once §10.2 populatesNonAtomic(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 thecoalesce/mod.rsPendingRcatomicity-mismatch-flush requirement + a mixed-atomicity coalesce-window FileCheck pin. -
[TPR-06-2-opencode][Minor]Round 2 —doc_sync.synced_after_last_content_change: falsewhilecontent_hash == last_sync_sha(content unchanged since last sync → flag should be true). CURED viapython -m scripts.plan_corpus.doc_sync mark-synced(truthful:compute_section_hashconfirms no review-relevant content drift; freshlast_sync_sha). -
[TPR-06-3-codex][high]Round 3 — trampoline / release-cleanup detection predicates (project_escape.rs:follow_jump_chain;tail_call/mod.rsx2) matched onlyRcDec, so faithful-emission release blocks now carrying a pairedBurdenDec([RcDec, BurdenDec]) were misclassified — wrong successor-param resolution (correctness) + silently-rejected TRMC/tail-call detection (lost optimization). CURED: extracted SSOT helperArcInstr::is_release_cleanup_instr(RcDec | BurdenDec, grounded in whole-varrelease_with_burdenemission) applied at all 3 sites + 8 matrix pins (semantic + negative; reverting the helper fails the 3 positive pins).ori_arc1539/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 citationaims-rules.mdin publiccompiler_reposource 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 citationSpec: Annex E §AIMS RL-19/20/21.
06.N Completion Checklist
-
/tpr-reviewpassed (final);/impl-hygiene-reviewpassed. /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.rsfor class_alive_after / pin4_class_emits_dec_set / pin6_any_ancestor_will_cover / class_payload_of / canonical_rep / syntactic-liveness — zero matches. Narrowed torealize/mod.rsper §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 st4600 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 tgreen; 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-speccargo st4600/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.mdORI_DISABLE_BURDEN_MIRROR/ORI_DUMP_AFTER_BURDENdebug 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 --applystripped 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-commentper \`` +/// 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.rslines 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.rsdoc-ref +compiler/ori_arc/src/ir/tests.rssibling — 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). Addedrelease_with_burden/release_with_burden_edge/release_with_burden_into_blockfamily (coexistence handshake). Anchor: opportunistic-split-when-next-touched per impl-hygiene.md §File Organization; extractrelease_burden.rssibling 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; extractemit_terminator.rssibling. (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 toinstr/methods.rsif 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:311—analyze_function_terminates_on_back_edge_loopruns 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:3460—compute_project_alias_sources_cross_block_letghost 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:5283—negative_pin_no_synthetic_context_hole_typeid_minting_pathway_existsghost 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:49—unresolved_type_var_is_copyghost 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.rslines 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_roadmapfield (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)returnsOption<&MemoryContract>;Noneis 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_inforeturn 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 revertis 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-toolingcomment-aware refinement (add a suppression-comment parser to the swallowed-error detector). Non-blocking; informational.
HISTORY
- 2026-06-02 a10 — §06.3
RcAtomicitycarrier SITE landed; RL-19/20/21 NonAtomic-selecting dispatch relocated torepr-opt/section-10perrouting.md §4. Grounding §06.3 against actual code established the SITE-vs-ACTIVATION split for the atomicity carrier: (1) the shipped runtime RC primitivesori_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, NOemit_rc_inc/emit_rc_decatomicity branch inori_llvm, and NO thread-escape analysis inori_arc. RL-19/20/21 are entirely target-only. SITE delivered NOW (carrier + default-Atomic, observably a no-op):RcAtomicity { Atomic, NonAtomic }enum onRcInc/RcDecArcInstrvariants (ir/instr.rs); repr +default_atomic()+is_atomic()+fmt_atomicity_suffix()(ir/repr.rs+ir/format/mod.rs); exported fromir/mod.rs+ crate root; every construction site acrossaims/emit_rc/{mod,forward_walk,coalesce},aims/emit_reuse/dynamic,aims/realize/{walk,walk_dec,emit_unified,project_escape,mod}setsRcAtomicity::default_atomic()(= Atomic), reproducing today’s all-atomic emission bit-for-bit.atomic_rc_dechelper extracted inwalk_dec.rs(DRY + restores the 100-lineemit_defined_deadcap). 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 toplans/repr-opt/section-10-thread-local-arc.md §10.2perrouting.md §4: the RL-19/20/21 dispatch that POPULATESNonAtomicrequires §10.1’sThreadLocalitythread-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). PopulatingNonAtomicin §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.3RcAtomicity”); §10.2 POPULATES theNonAtomicvalue. 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#skipcompanion (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-targetsGREEN ori_arc+ori_llvm debug+release;cargo test -p ori_arc --lib1527/0 debug + 1523/0 release; clippy clean ori_arc+ori_llvm; VF-1=0 distinct corpus-wide (diagnostics/burden-balance.shover 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 ONLYvar/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 byaims-rules.mdInvariant-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.ownershipat Step 2apply_aims_ownership(pipeline/aims_pipeline/batch.rs) + call-sitearg_ownershipat Step-4b-preludeemit_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.rsconsumesCowModefor real in-place-vs-copy;Reset/Reusereal; 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-cellrealize/tests.rsdecision 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 pertests.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 --lib1527/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). Perrouting.md §4MOVE-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.rstouch. §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.3RcAtomicitydefined 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 peraims-rules.md PL-5with plan-frontmatter goal-line drift flagged for §08 sync (agy 1); success_criterion 4 extendselement_fn_gento includeinstr_dispatchas second cross-crate compute_drop_info consumer (agy 2). - 2026-06-02 — Stale
review_pipeline:marker cleared by /continue-roadmap orchestrator: marker carriedstage: ?,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 inscripts/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_ledgerneutralization 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); addedir/instr.rs(RcAtomicity carrier) +ir/repr.rs(atomic-vs-non-atomic representation per RL-18/19) totouches:for orchestrator conflict-detection + locked-design guards (opencode-F2); added §06.2 design-intent block stating Phase 7realize_rc_reusedoes only whole-var mapping (no compound code), compound COW/reuse/drop-hint stays at Step 10realize_annotations, arg-ownership at Step 4b-prelude (opencode-F3); narrowed the §06.1 verify-zero gate from wholerealize/dir torealize/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#skipchannel-send companion anchored to E2040 resolution (agy-F2); addedtimeout 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 tocompiler/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 releaseRcDecco-emits a faithful pairedBurdenDecgated oncarries_burden— “one SSOT, two emitters” (Invariant-5-clean, no parallel pass; grounded RL-2/RL-4/RL-5).ORI_DISABLE_BURDEN_MIRROR=1bisection flag added atpipeline/aims_pipeline/mod.rs+ documented inarc.md/compiler-ops.md. Build green (ori_arc + ori_llvm--all-targets, debug + release).cargo stmirror-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-1verify_burden_balance656→0 measurement via the AOT/LLVM path (the eval spec harness does not surface the debug-assert warn) → gated Step Breconcile_burden_ledgerremoval (ONLY after VF-1=0, per LEDGER §B.2 spurious-RC-after-lowering hazard) → Step C mechanical BurdenInc→RcInc/BurdenDec→RcDec verification inrealize/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) inburden_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 (perORI_DUMP_AFTER_BURDEN=1+ORI_LOG=ori_arc::aims::verify::burden_balance=debugper-block deltas): a FRESH heap value passed at a BORROWEDInvoke/InvokeIndirectarg position (theassert_*message-string family dominates; 319/324 files importstd.testing) gets a terminator-last-useBurdenDecfrom the burden walk AND a scope-exit releaseBurdenDecfrom the predicate-stack edge cleanup (release_with_burden) → double-count → net -1 per terminal path. THREE EMISSION FIXES LANDED incompiler/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 fromowned_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 throughLet { Var }MOVE-alias chains (src used once) to a fixpoint, suppressing the move source’s last-use dec + symmetric inc (curesid<T>(x)=xowned-param-returned-via-alias orphan dec); (iii)invoke_terminator_borrowed_args(emit.rs) — THE dominant fix (345→25) — suppresses the terminator-last-useBurdenDecfor a value at a borrowedInvoke/InvokeIndirectarg position (value survives the borrowed call; released at the successor by the predicate-stack edge cleanup whoserelease_with_burdenco-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-targetsGREEN ori_arc+ori_llvm debug+release;cargo test -p ori_arc --lib1530/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. theaims_burden_alias::test_burden_alias_inner_survives_result_destructurepin, 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 whererelease_with_burdenover-pairs aburden_decon 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)): gaterelease_with_burden’scarries_burdenso the predicate-stack edge/scope-exit release does NOT pair aburden_decfor a var transferred OUT at an ownedInvoke/InvokeIndirectarg position; secondary: a project-escape-awareProject-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 newdiagnostics/burden-balance.shis 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 theverify_burden_balanceimbalance trace,binc/bdecintrace_phase_snapshot, per-blockburden_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 aBurdenDecon the unwind/dead edge for a var transferred OUT at an OWNEDInvoke/InvokeIndirectarg — 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 atedge_cleanup.rs apply_edge_decs+trampoline.rs) suppresses the pairedBurdenDec(keepsRcDec) 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 3dead_cleanupemit_dead_at_entry_decssites) — successor-keyed companion suppressing the block-entryBurdenDecfor an owned-transfer Invoke arg’s successor block; (iii)compute_borrowed_terminator_invoke_args(burden_lower/mod.rs→inc_suppressed_vars) suppresses the FRESH-siteBurdenIncfor 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-targetsGREEN ori_arc+ori_llvm debug+release;cargo test -p ori_arc --lib1530/0 debug + 1526/0 release; clippy clean (fixed one pre-existing detached-doc warning inburden_elim.rslitter-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.shwidth_tests_spec+width_tests_comprehensive(ori_fmt) fail on the untrackedtests/spec/traits/index_set/updated_method.oriline 88 (>60 chars) — a dirty-tree artifact from a parallel session staged BEFORE this session (I touched noori_fmt/.orifiles); 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, whichORI_DUMP_AFTER_ARCconfirms balanced for the same functions) —comparablefind_max/find_min,cow/{substring,string_cow,matrix_string},option_str,index/definition,debug/escape(a single-inc value receiving aBurdenDecon >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-blockverify_burden_balancedeltas):detect_last_usesinlower/burden_lower/mod.rsis purely PER-BLOCK — it registers a “last use” (and thus aBurdenDec) 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%0aliased in bb0 AND bb1;cow::shared_substring/debug::escapeFRESH 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. PerSpec: 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 toowned_vars_needing_rc(gen/kill mirrorsliveness::compute_liveness, keyed on the burden walk’s own owned-RC set — no parallel ownership tracker); threaded intoBurdenAnalysisCtx.live_out_per_blockand consumed at BOTHemit_last_use_decs(instruction-position) andemit_terminator_burden_decs(terminator-position) inemit.rsto SUPPRESS the in-block last-useBurdenDecfor any var live-out of the block. STEP B (mirror removal) DONE:reconcile_burden_ledgercall +BURDEN_MIRROR_DISABLEDstatic +ORI_DISABLE_BURDEN_MIRRORflag removed frompipeline/aims_pipeline/mod.rs;aims/realize/burden_mirror.rs+burden_mirror/tests.rsdeleted;mod burden_mirror+pub(crate) use reconcile_burden_ledgerremoved fromrealize/mod.rs;ORI_DISABLE_BURDEN_MIRRORdebug_flags.rsentry +arc.md/compiler-ops.md/diagnostic.mddoc lines +burden_delta.rscomment scrubbed;burden-balance.shupdated (mirror flag dropped — faithful emission is the sole RC path, script KEPT). Zeroreconcile_burden_ledger/burden_mirror/BURDEN_MIRROR_DISABLED/ORI_DISABLE_BURDEN_MIRRORreferences corpus-wide;check-debug-flags.shclean (0 stale/orphan/undocumented). VF-1=0 holds mirror-REMOVED corpus-wide. STEP C grep-zero DONE (site established):realize/mod.rsverified 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 realRcInc/RcDec(in the §09-retiringwalk_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.rsis 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_balanceempty 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-targetsGREEN ori_arc+ori_llvm debug+release; clippy clean (splitcompute_live_out_owned+ extractedcompute_use_counts_and_dup_aliasesfor the 100-line cap; fixed a litter-pickup decorative-banner in tests.rs);cargo test -p ori_arc --lib1527/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 (localitydivergent_pendingnon-fatal); prose-lint clean (docs + touched .rs). test-all.sh residual NON-mine failures: 2ori_fmtwidth_tests (parallel-sessionindex_set/updated_method.oridirty 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.orireports “1 RC allocation not freed” — PROVEN pre-existing predicate-stack (not mine): persists IDENTICALLY withORI_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).