feat(runtime): implement shared transactional memcard with async saves
Intrepid/Prometeu/Runtime/pipeline/pr-master This commit looks good

This commit is contained in:
2026-10-13 15:24:01 +01:00
parent 0af8b2b1fe
commit 6c2a07e579
65 changed files with 6222 additions and 985 deletions
+11
View File
@@ -35,6 +35,7 @@ The runtime currently expects the following manifest fields:
Additional manifest-supported fields include:
- `capabilities`
- `memcard_slots`: a count in 1..64, required exactly when the memcard capability is declared
## 3 Required Fields
@@ -63,6 +64,7 @@ The current loader validates:
- `cartridge_version == 1`
- manifest parse validity
- capability normalization
- memcard capability and slot-count consistency
- presence of `program.pbx`
- when `Asset` capability is declared, presence of valid `assets.pa` before asset bootstrap
@@ -88,6 +90,15 @@ This means:
- firmware/runtime loads the cartridge and starts execution from `func_id = 0`;
- nominal exports may exist for linking or introspection, but they do not hold boot authority.
A cartridge declaring memcard support also supplies the unique Registry role 3
`MemcardBoot(context: Int64) -> Int32` binding, with no captures and a nonzero
FunctionId. Its producer emits the explicit `mem.bootstrap` boundary after its
initialization and before its first frame. The runtime prepares the selected
persistent or memory-only snapshot and asset preload before this optional hook;
normal frame execution waits for successful bootstrap and registration. See
[Save Memory and Memcard](08-save-memory-and-memcard.md) for admission, the guest
contract, and publication semantics.
## 5.1 Runtime Profiles
`Game` and `System` are distinct runtime profiles.