feat(studio): integrate memcard persistence and headless controls
Test / Tests and coverage
Intrepid/Prometeu/Studio/pipeline/pr-master This commit looks good

Persist cartridge identity and slot configuration, add MemcardBoot and the MemcardBuffer SDK, and consume the runtime's negotiated memcard host controls with protected teardown.

Qualify save/reopen and version upgrades through distinct configured runtime processes. Include specs, examples, regression evidence and the consolidated discussion lesson.
This commit is contained in:
2026-10-30 11:01:02 +00:00
parent 3a3417eb44
commit 1d8b8c2101
110 changed files with 6502 additions and 85 deletions
+49
View File
@@ -3,6 +3,55 @@
Owner: compiler/general. This harness uses the production runtime loader and VM;
it does not implement a Java approximation of runtime admission.
## PBS memcard and MemcardBuffer qualification
Generate the production PBS corpus and the actual installed-JAR example, then run
both runtime profiles without modifying the runtime checkout:
```sh
./gradlew test :prometeu-app:installedKnowledgeTest --console=plain
CARGO_TARGET_DIR=/tmp/studio-pbx-memcard-target python3 tools/pbx-conformance/run.py --runtime ../runtime --memcard-only
CARGO_TARGET_DIR=/tmp/studio-pbx-memcard-target python3 tools/pbx-conformance/run.py --runtime ../runtime --memcard-only --release
```
The dedicated carrier has concrete Array<Int32> storage, capacity 0..4096, zero
initialization, checked byte access and reference aliasing. Ordinary PBS arrays
keep vacancy/optional semantics. The corpus checks all 14 native imports, both
producer optimizer variants, typed source boundaries and origin protection;
source aliases and canonical imported/reexported hooks; named evaluation order;
exact four-byte save/remount and no resave; 4096-byte transfers; 64-slot admission;
clear/commit; retained requests and BUSY; memory-only/pause/resume; public title,
format-version and 32x32 icon publication; absent/read-only/corrupt media; controlled
FAILURE/INDETERMINATE; hook refusal/trap/fuel; capacity/index/value/transfer traps.
The status-first facade forwards native calls without an intermediate typed RET,
so failed-domain Null payloads reach the caller's status check unchanged.
`memcard.rs` executes the production Firmware/SystemOS, VM, FileMemcard and its
shared worker. Fault storage distinguishes pre-publication failure from uncertain
metadata publication. The installed-JAR source fixture is also executed natively.
This is **native production-host evidence**. Multiple Firmware instances and a
file remount in this process do not establish save/reopen through the configured
installed runtime CLI/JSONL protocol. The separate process gate below consumes
the now-published provider surface for storage and explicit choices.
No alternative process protocol or physical power-cut qualification is claimed.
The separate Studio process gate now consumes the published protocol 1.1 memcard
extension through HeadlessProcessGateway and the configured installation:
```sh
./gradlew :prometeu-app:memcardProcessTest -PstudioRuntimeInstall=/absolute/extracted/installation
```
It builds actual PBS through the compiler and Studio shipper, requires a native
terminal commit SUCCESS, terminates the writer, then starts separate readers for
versions 1 and 2 with identical uint32 app_id. Both optimizer variants are required.
The reader's reachable entry/role graph contains no saving or presentation calls;
it validates exactly 00 7f 80 ff before rendering its observed oracle. Each read
leaves the complete image byte-identical and no native request submitted. A second
case proves missing-file open does not create, memory-only is explicit and dirty
shutdown refusal preserves the channel until explicit discard. Runtime dev/release
binary layouts and an extracted distribution are identified separately in evidence.
## PBS Map and Keyval qualification
Generate the mandatory Map corpus and actual installed-JAR example, then execute