docs(multi-memory): publish stable MultiMemory lowering contract (#300)#310
Merged
Conversation
synth builds its differential oracle + frozen fixtures against meld's MultiMemory output as the stable lowering target (synth#404), but that contract lived only implicitly in meld-core/tests/multi_memory.rs + code + scattered #300 prose. Publish it as a citable artifact so model-2 lowering work (synth#404, synth#369) and gale's MPU-region embedder design (gale#86) have a frozen target to pin to. Contract (all grounded in code/tests, cited): - C1 N memories preserved 1:1, no collapse (multi_memory.rs N=2,3 tests) - C2 deterministic per-memory->component identity via export naming (`name${comp_idx}` on collision, merger.rs:1992) - C3 authoritative memory_index_map relation (merger.rs:95) - C4 cross-memory ops emitted with explicit distinct memidx, never dropped (rewriter.rs:423 remap, p3_bridge.rs shims, result-copy adapter) - C5 per-memory size in section; native base is synth's - C6 multi + address-rebase is a hard error (lib.rs:2913) Change policy: C1-C6 frozen as the model-2 target; changes announced on #300. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
LS-N verification gate✅ 57/57 approved LS entries verified
Approved Failed LS entries(none) Missing regression tests(none) Updated automatically by |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
synth (synth#404) committed to building its model-2 lowering — carry
memidxthrough the IR, distinct native bases, explicit cross-memory ops (synth#369), per-memory base/size export — against meld'sMultiMemoryoutput as the stable target, staged behind its "frozen-fixture re-freeze + differential oracle" discipline.But that target was never published: the contract lived only implicitly in
meld-core/tests/multi_memory.rs, the source, and scattered #300 prose. You can't freeze a differential oracle against an unwritten contract — every meld output churn would silently invalidate synth's fixtures.This publishes
docs/multi-memory-lowering-contract.mdas the citable, frozen model-2 lowering target.Contract (C1–C6, all grounded in code/tests, cited inline)
multi_memory.rsN=2 and N=3 testsname${comp_idx}on collision,merger.rs:1992) — the relation an embedder uses to assign MPU/PMP regionsmemory_index_maprelation (merger.rs:95)memory.copy/memory.fillemitted with explicit distinct memidx, never dropped (rewriter.rs:423remap asserts src 1→8/dst 0→2;p3_bridge.rsstream shims; result-copy adapter) — the shape synth#369 must lower instead of loud-skipping--memory multi+--address-rebaseis a hard error (lib.rs:2913) — rebasing is the shared-collapse path, mutually exclusive with structural isolationChange policy
C1–C6 are frozen as the model-2 lowering target (meld#300 / ADR-4). A change is a contract change announced on #300 with a synth heads-up; synth files against meld if it hits a MultiMemory structure it cannot consume (per synth#404).
Docs-only; no code change. Refs #300, synth#404, synth#369, gale#86.
🤖 Generated with Claude Code