33%

Goal

Preserve the lookup_static &‘static str + Name byte-identity contract across the 50-plan blast radius

Implementation Sketch

See the work items below; each is the bounded deliverable.

Spec References

  • ledger evolution ev14 (eligible) in plans/benchmark-grind-lexer (the hypothesis + kill_criterion).

  • compiler_repo/compiler/ori_ir/src/interner/mod.rs (the InternShard surface).

Work Items

  • Audit + preserve every lookup_static() -> &‘static str / Cow<‘static,str> consumer across the 50-plan + aims-burden blast radius: the &‘static str contract stays stable (chunk-pool-backed), Name (shard 4b | local 28b) encoding byte-identical (respects BUG-04-053 / BUG-02-026). No new workspace dependency (no hashbrown); single-process (no lock-free dep).

Items

  • Verify (do not re-implement) that the fused chunk-pool InternShard landed in s-d483addc preserves the lookup_static() -> &‘static str / lookup() -> &str / try_lookup() -> Option<&str> contract for every consumer across the 50-plan + aims-burden blast radius (30 direct / 101 transitive lookup_static/lookup callers per the s-d483addc intel dossier): confirm zero call-site signature changes outside compiler/ori_ir/src/interner/ via git diff —stat against the pre-work baseline, run ./test-all.sh with no new failure over the 1803 floor (the section’s owned probe, sc-ed3c6f1f), and re-run the BUG-04-053 / BUG-02-026 regression pins specifically to confirm Name (shard 4b | local 28b) encoding stays byte-identical. Per the dossier’s Recombine finding + ledger attempt 3’s generalizes_to lesson, the design deliberately requires zero downstream call-site changes — this section is a verification gate against that claim, not a call-site rewrite pass.
  • Verify (do not re-implement) that the fused chunk-pool InternShard landed in s-d483addc preserves the lookup_static() -> &‘static str / lookup() -> &str / try_lookup() -> Option<&str> contract for every consumer across the 50-plan + aims-burden blast radius (30 direct / 101 transitive lookup_static/lookup callers per the s-d483addc intel dossier): confirm zero call-site signature changes outside compiler/ori_ir/src/interner/ via git diff —stat against the pre-work baseline, run ./test-all.sh with no new failure over the 1803 floor (the section’s owned probe, sc-ed3c6f1f), and re-run the BUG-04-053 / BUG-02-026 regression pins specifically to confirm Name (shard 4b | local 28b) encoding stays byte-identical. Per the dossier’s Recombine finding + ledger attempt 3’s generalizes_to lesson, the design deliberately requires zero downstream call-site changes — this section is a verification gate against that claim, not a call-site rewrite pass.

Fresh intel (regenerated)

The section’s charter (“audit + preserve every lookup_static() consumer across the 50-plan + aims-burden blast radius”) reads like a wide, open-ended refactor-safety sweep. The graph and source recon together show the OPPOSITE: the real code-level blast radius is small, already closed by a sibling section’s completed work, and largely self-verifying via cargo build.

Five convergent findings, in order of decisiveness:

  1. The graph’s raw call-count for lookup_static is a call-resolution artifact — do not trust it. callers lookup_static --repo ori returns 97 hits across 5 crates; direct source verification shows the true production-only lookup_static() call count is 3 (2 in ori_eval, 1 in ori_llvm), plus 1 wrapper (FunctionCompiler::lookup_name) with 18 further call sites. The other ~94 “callers” are .lookup(/.try_lookup( calls the extractor mis-resolved onto the same-prefixed lookup_static symbol (verified against three sampled sites: ori_types::infer::accessors::lookup_name, ori_parse::grammar::attr::skip_backend::parse_skip_backend_param, ori_arc::rc_insert::annotate::compute_arg_ownership — all call .lookup( or .try_lookup(, none call .lookup_static(). Classic literature-documented call-graph over-approximation (§7).
  2. The sibling section already closed the loop. fused-interner-ev14/s-d483addc (status: completed) landed a 3-cycle ledger (implement chunk-pool -> attempt lock-guard resolve -> REVERT -> retreat to safe chunk-pool) whose KEPT/CONFIRMED cycle-3 clause is verbatim: “Preserve the existing public seam and prove the new storage via local tests at the owning layer.” The live compiler/ori_ir/src/interner/{mod.rs,shard.rs} at HEAD confirms this: lookup, try_lookup, lookup_static keep their EXACT pre-rewrite signatures. Name’s shard(4b)/local(28b) bit layout (ori_ir/src/name/mod.rs) was never touched.
  3. Byte-identity across chunk growth is already pinned. ori_ir/src/interner/tests.rs carries test_lookup_static_after_chunk_growth (128 long idents forcing multiple key_remaining chunk allocations; asserts both lookup and lookup_static return the correct bytes post-growth) and test_lookup_static_does_not_depend_on_map_probe (proves lookup_static resolves via the spans index, not a live map re-probe, so it survives even a map-entry removal). Two more tests prove neither lookup nor try_lookup retain the shard RwLock across return.
  4. Zero new dependencies. cargo tree -p ori_ir shows only parking_lot + rustc-hash (both pre-existing); no hashbrown in the tree. Cargo.toml/Cargo.lock show no interner-related edits in recent history. The “no new workspace dependency” clause in the section’s own goal text is already satisfied by construction.
  5. [JOIN] External prior art independently corroborates the parent plan’s own dead-end. rustc’s real production issue #118205 (“deadlock detected… collecting exported symbols for crate”) is an INDEPENDENT confirmation that lock-held symbol/interner infrastructure is a genuine deadlock class in mature compilers — validating why THIS plan’s own ledger cycle 2 (REVERTED, lock-returning InternedStr guard, real ori_arc/ori_eval hangs) was correctly killed, not over-cautious.

Decisions this package forces before work starts:

  • Do NOT re-derive a consumer list from scripts/intel-query.sh callers lookup_static alone — it is ~97% call-resolution noise for this specific symbol (finding 1). Ground every consumer claim in a literal grep -rn "\.lookup_static(\|\.lookup_name(" pass, then verify each hit’s actual call text.
  • The section’s ACTUAL remaining deliverable is narrower than its charter text implies: (a) a written enumeration of the true consumer set (this dossier’s §2/§3.1 is that enumeration), (b) confirming cargo build --workspace + cargo test -p ori_ir -p ori_eval -p ori_llvm are clean against the sibling section’s committed rewrite, (c) the FULL layer matrix (./test-all.sh, dual-exec parity, ORI_CHECK_LEAKS=1) — which is the SAME gate the sibling not-started section s-24059b3f (measure-and-record-ev14) also needs before it can trust its A/B throughput measurement. Sequence s-1c07f0ca before s-24059b3f even though the plan lists them as siblings with no explicit depends_on (§6) — measuring throughput of an interner rewrite is meaningless before consumer-safety is confirmed.
  • constrained-symbols is [] (§9) — no genuine pre-existing EXTERNAL do-not-touch hazard surfaced. The fragile invariant surface (InternShard::append_key, span_str) is the PLAN’S OWN delivered subject (built by sibling section s-d483addc), excluded per the work-subject rule.

DIG DEEPER

scripts/intel-query.sh plan-status fused-interner-ev14 --human
python -m scripts.plan_corpus.ledger show plans/fused-interner-ev14 --rank --all
cd compiler_repo && git log --oneline -5 -- compiler/ori_ir/src/interner/

(full dossier: blast-radius-consumers—s-1c07f0ca.intel.md)