You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Multi-memory structural isolation: lower N wasm memories to N distinct native bases (memidx-through-IR, cross-memory ops, expose base/size for MPU/PMP) #406
Committed lowering path for the dissolved-library-OS isolation model. Cross-repo decision: meld#300 commits to model 2 (multi-memory structural isolation) — meld preserves each component's memory as a distinct region (MemoryStrategy::MultiMemory, tested in meld-core/tests/multi_memory.rs) so the MPU/PMP boundary is the semantic boundary. synth is the remaining gate.
Today (the gap)
synth is single-memory: the memory index is dropped at the IR level (wasm_op.rs load/store variants carry no memory_index), cross-memory memory.copy/memory.fill are loud-skipped (#369-adjacent, wasm_decoder.rs non-zero dst_mem/src_mem → None), and the linear-memory base is a single hardcoded register (R11 = 0x20000000 / 0x20000100). MPU is config-only — mpu_allocator computes region base/size/permissions + init code but nothing is wired into the optimized codegen path (#377).
The work (staged, gated — byte-changing on the load/store path)
Carry memidx through the IR — add memory_index to the load/store/memory.* WasmOp variants; stop dropping it in wasm_decoder.rs.
Per-memory native bases — place memory[k] at a distinct base; common case pins the function's home memory base in R11 (≈ today's cost), cross-memory access resolves via a per-memory base/size table (synth_memory::MemoryTable, MAX_MEMORIES=8 already exists).
Cross-memory ops — emit memory.copy/memory.fill with distinct dst_mem/src_mem explicitly instead of loud-skipping.
Committed lowering path for the dissolved-library-OS isolation model. Cross-repo decision: meld#300 commits to model 2 (multi-memory structural isolation) — meld preserves each component's memory as a distinct region (
MemoryStrategy::MultiMemory, tested inmeld-core/tests/multi_memory.rs) so the MPU/PMP boundary is the semantic boundary. synth is the remaining gate.Today (the gap)
synth is single-memory: the memory index is dropped at the IR level (
wasm_op.rsload/store variants carry nomemory_index), cross-memorymemory.copy/memory.fillare loud-skipped (#369-adjacent,wasm_decoder.rsnon-zerodst_mem/src_mem→None), and the linear-memory base is a single hardcoded register (R11 = 0x20000000 / 0x20000100). MPU is config-only —mpu_allocatorcomputes region base/size/permissions + init code but nothing is wired into the optimized codegen path (#377).The work (staged, gated — byte-changing on the load/store path)
memidxthrough the IR — addmemory_indexto the load/store/memory.*WasmOpvariants; stop dropping it inwasm_decoder.rs.memory[k]at a distinct base; common case pins the function's home memory base in R11 (≈ today's cost), cross-memory access resolves via a per-memory base/size table (synth_memory::MemoryTable,MAX_MEMORIES=8already exists).memory.copy/memory.fillwith distinctdst_mem/src_memexplicitly instead of loud-skipping.mpu_allocatorregion machinery already computes base/size/perms; wire it from the per-memory layout — ties to --safety-bounds software/mpu are no-ops on the optimized codegen path (flight-safety: jess pins software for PX4) #377).Constraints / gating
MultiMemoryoutput stable as the lowering target; file against meld if synth hits a structure it can't consume.Tracked under the VCR-* north-star program (epic #242). Refs: gale#86, gale#404, meld#300, synth#377 (MPU runtime wiring), synth#369 (decoder loud-skip).