refactor(adr7): extract the address-strategy seam from the merger (path-H inc 1)#359
Conversation
…th-H inc 1) Executes ADR-7 path-H, increment 1: extract the per-module address/memory strategy resolution out of Merger::merge into a dedicated address_strategy module, behavior-preservingly. This is the pluggable seam the decided architecture hangs off — the shared-rebase strategy lives here now; multi-memory resolves to an empty plan; static-base PIC (#353) and the per-boundary call-lowering seam come in later increments. - address_strategy.rs: AddressPlan + resolve_address_plan — the full decision + validation (path-F MissingRelocMetadata, memory64 reject, #351 MisalignedReloc backstop). has_direct_memory_access passed as a closure to keep the original lazy short-circuit exactly. - merger.rs: the ~50-line reloc-consumption block replaced with one call. - 4 unit tests (rebasing-off/base-0/no-reloc-direct-fail/bulk-only + laziness). No behavior change: canonical gating fixtures (test_326_reloc_const_rebasing, test_address_rebasing) + drop_realloc + full meld-core suite all green; fmt/clippy clean. Refs #354 (ADR-7) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mythos delta-pass requiredThis PR modifies one or more Tier-5 source files (per Before merge, run the Mythos discover protocol on the
Why this gate exists: LS-A-10 The gate check on this PR will pass once the label is |
Mythos delta-pass — findingClean-room adversarial pass focused on the one thing that matters for a Verdict: CLEAN — behavior-identical, verified branch-by-branch against the
No divergent input exists → no oracle can fail → nothing reported. Gating fixtures Adding |
Mythos delta-pass (auto)✅ NO FINDINGS across 1 Tier-5 file(s)
Auto-run via |
LS-N verification gate✅ 59/59 approved LS entries verified
Approved Failed LS entries(none) Missing regression tests(none) Updated automatically by |
|
Good question — short answer: no, nothing about the generic multi-memory + FACT path is stopped or changed. "Empty plan" is a no-op, not a disablement. Let me be precise about the wording.
pub struct AddressPlan {
pub code_addr_relocs: Option<HashSet<u32>>, // code sites to rebase
pub data_addr_relocs: Vec<RelocEntry>, // data pointers to rebase
}Multi-memory has no addresses to rebase — each component keeps its own linear memory at its own base, so no absolute address ever collides with another component. There's simply nothing to shift → an empty plan. That's exactly what multi-memory did before this PR; the refactor just gives that "no rebasing needed" case a name. FACT is a separate subsystem and is completely untouched. This refactor has zero references to Verified: the multi-memory test suite is green (6/6), and the whole change is Mythos-reviewed as behaviour-identical to the pre-refactor block (it's a pure extraction). Bigger picture (ADR-7 / #354): the decided architecture deliberately keeps multi-memory + canonical FACT as the first-class, universal path — it's the |
…abled A colleague reading #359 read "multi-memory resolves to an empty plan" as "multi-memory + FACT fusion is stopped". It is not: an AddressPlan carries only which reloc sites to shift for a shared-memory base. An empty plan means no address rebasing is needed (multi-memory keeps each component's memory at its own base) — it does not touch cross-component adapter (FACT) generation, which runs identically. Spell that out in the module doc so the seam can't be misread. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Fixed the misleading phrasing in both places — the module doc (
So to answer directly: no, multi-memory + FACT fusion into a core module is not stopped. That path is unchanged by this seam ( |
Executes ADR-7 path-H, increment 1 (#354): extract the per-module
address/memory strategy resolution out of
Merger::mergeinto a dedicatedaddress_strategymodule — behavior-preservingly. This is the pluggable seamthe decided architecture hangs off.
What
address_strategy.rs—AddressPlan+resolve_address_plan, holding the fulldecision + validation (ADR-6 path-F
MissingRelocMetadata, memory64 reject,the meld --memory shared --address-rebase skips R_WASM_MEMORY_ADDR_SLEB relocations: a rebased module's i32.const data pointer stays stale -> silent cross-component aliasing (gap in #340) #351
MisalignedRelocbackstop).has_direct_memory_accessis passed as aclosure so the original lazy short-circuit (only a non-zero-base, no-reloc
module pays the probe) is preserved exactly.
merger.rs— the ~50-line reloc-consumption block replaced with one call.bulk-only → empty, plus closure-laziness).
Scope of
AddressPlan(does not affect multi-memory + FACT fusion)An
AddressPlancarries only which relocation sites to shift for a non-zeroshared-memory base — nothing else. Under multi-memory, each component keeps
its own linear memory at its own base, so there are no sites to shift and the
plan is empty. An empty plan means "no address rebasing needed here" — it
is not a disablement of fusion, and it does not touch cross-component
adapter (FACT) generation, transcoding, or any other part of the merge. Those
run identically regardless of what this seam resolves. Multi-memory + FACT stays
the generic, first-class fusion path (ADR-7's canonical /
openprofile);multi_memoryfixtures remain green (6/6).The shared-rebase strategy now lives here. Static-base PIC (#353) and the
per-boundary call-lowering seam are the next increments — they plug in here
without touching the merger's hot path.
No behavior change
Canonical gating fixtures (
test_326_reloc_const_rebasing_end_to_end,test_address_rebasing_end_to_end) +drop_realloc+ fullmeld-coresuite allgreen; fmt + clippy clean. Pure structural extraction.
Tier-5 (merger.rs + new fusion-critical module) → Mythos discover pass to follow.
Refs #354 (ADR-7)