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
Copy file name to clipboardExpand all lines: AI/ROADMAP.md
+90-8Lines changed: 90 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1175,9 +1175,84 @@ Build the audio subsystem as a real temporal part of the hardware, integrated wi
1175
1175
1176
1176
---
1177
1177
1178
-
### Phase 8 — Block AP: final DMG hardening, differential validation, and closure
1178
+
### Phase 8 — Full emulator save states and global serialization strategy
1179
+
1180
+
38.**Whole-machine snapshot contract and ownership**
1181
+
39.**Global serialization envelope, versioning, and metadata**
1182
+
40.**Core save/load restore path and validation**
1183
+
1184
+
#### Goal
1185
+
1186
+
Establish one explicit full-emulator save-state system, separate from cartridge persistence, only after the hardware subsystems already own their live runtime state and before final DMG closure depends on save/load determinism.
1187
+
1188
+
#### Modules involved
1189
+
1190
+
-`scheduler/`
1191
+
-`cpu/`
1192
+
-`bus/`
1193
+
-`ppu/`
1194
+
-`dma/`
1195
+
-`timer/`
1196
+
-`apu/`
1197
+
-`joypad/`
1198
+
-`serial/`
1199
+
-`cartridge/`
1200
+
-`boot/`
1201
+
-`debugger/`
1202
+
- frontend/tooling persistence adapters
1203
+
1204
+
#### Deliverables
1205
+
1206
+
- typed whole-machine save-state contracts with explicit ownership by subsystem
1207
+
- explicit capture and restore of hidden temporal state such as scheduler phase, CPU internal execution state, DMA lifecycle, PPU pipeline state, timer hidden counters, serial in-flight transfer state, and APU frame-sequencer / channel / HPF state
1208
+
- cartridge runtime snapshot integration for continued execution, kept distinct from cartridge-local persistent-storage payloads
1209
+
- one global versioned serialization envelope with mandatory model, execution mode, active override, and compatibility metadata
1210
+
- portable core-facing save/load API boundaries that do not couple `gb-core` to disk, desktop, web, or tool-specific storage APIs
1211
+
- debugger and tooling hooks for capture, restore, and structured snapshot inspection
1212
+
- automated round-trip and continuation validation for full-machine save/load
1213
+
1214
+
#### Done criteria
1215
+
1216
+
- every subsystem that owns live machine state exposes an explicit save/restore contract rather than relying on ad hoc debugger dumps or MMIO readback reconstruction
1217
+
- restoring a save state recreates in-flight temporal state coherently instead of replaying writes to rebuild hidden state from visible registers alone
1218
+
- whole-machine save states remain clearly separate from cartridge persistence, with cartridge runtime state included only through cartridge-owned snapshot semantics
1219
+
- save-state metadata records execution mode and active overrides, and mismatched-mode restore is rejected by default
1220
+
- the serialization contract is versioned and portable across CLI, desktop, web, tests, and tooling without moving host storage policy into the emulation core
1221
+
- tests cover exact round-trip restore plus save/load continuation versus uninterrupted execution, including at least one timing-sensitive mid-run restore case
1222
+
- debugger and tooling capture or load states through the same core-owned contract instead of through parallel bespoke snapshot paths
1223
+
1224
+
#### Recommended sequencing inside Phase 8
1225
+
1226
+
1. Define the whole-machine snapshot boundary and invariants.
1227
+
Scope: separation between emulator save states, cartridge persistence, debugger snapshots, and later replay metadata, plus required metadata such as model, execution mode, overrides, and startup context.
1228
+
Acceptance criteria: ownership of every saved field is assigned to one subsystem, save states are explicitly distinct from battery persistence, and no host-storage concern leaks into subsystem snapshot semantics.
1229
+
2. Add typed subsystem snapshot contracts.
1230
+
Scope: scheduler, CPU, bus-visible mapping, memory, DMA, PPU pipeline, timer hidden state, APU internals, joypad, serial, boot/startup context, and cartridge runtime state needed for continued execution.
1231
+
Acceptance criteria: subsystems export and import explicit typed state, in-flight temporal details are preserved, and restore does not depend on replaying MMIO writes to reconstruct hidden state.
1232
+
3. Define the global serialization envelope.
1233
+
Scope: versioned schema, canonical metadata for execution mode and overrides, and room for future compatibility evolution without silent breakage.
1234
+
Acceptance criteria: incompatible versions fail clearly, mode and override metadata are mandatory, and the format remains suitable for disk, in-memory, and web backends without changing core semantics.
1235
+
4. Implement capture and restore through the core boundary.
1236
+
Scope: one authoritative save/load API, compatibility validation for model, cartridge, and mode metadata, and integration points for debugger and frontends.
1237
+
Acceptance criteria: save/load goes through one authoritative path, mismatched-mode restore is rejected by default, and restore resumes the shared T-cycle timeline from the recorded point rather than from a reconstructed approximation.
1238
+
5. Lock round-trip and continuation validation.
1239
+
Scope: focused restore tests per subsystem, integration tests for continued execution equivalence, and at least one strict-mode end-to-end save/load case with banked-cartridge and active timing-sensitive subsystem coverage.
1240
+
Acceptance criteria: exact round-trip invariants are checked automatically, save/load continuation matches uninterrupted execution in covered scenarios, and failures retain enough metadata or snapshots to localize the first divergence quickly.
1241
+
1242
+
#### Risks if delayed or underspecified
1243
+
1244
+
- final hardening work lacks a stable save/load foundation
1245
+
- frontend-specific storage decisions leak into core semantics
1246
+
- restore paths reconstruct only visible registers and lose hidden temporal state
1247
+
- cartridge persistence and whole-machine save states become conflated
1248
+
- debugger or replay tooling grows a second incompatible serialization path
1249
+
1250
+
---
1251
+
1252
+
### Phase 9 — Final DMG hardening, differential validation, and closure
1179
1253
1180
1254
This phase is the roadmap home for the final DMG closure work. Parts of it should begin earlier, but the block only closes once the project can justify DMG correctness through layered evidence on the shared T-cycle model rather than through informal game compatibility.
1255
+
It assumes the dedicated save-state and serialization infrastructure from Phase 8 already exists and uses it as part of closure evidence.
1181
1256
1182
1257
#### Goal
1183
1258
@@ -1201,7 +1276,7 @@ Close the DMG core with a formal validation matrix, strong differential and dete
1. Formalize the DMG hardening matrix and closure severity policy.
1207
1282
Scope: define layers `A/B/C/D/E`, `must-pass` versus non-blocking categories, minimum DMG closure suites, and the rule that no single layer substitutes for another.
@@ -1283,11 +1358,14 @@ Close the DMG core with a formal validation matrix, strong differential and dete
1283
1358
35. APU channel 3
1284
1359
36. APU channel 4
1285
1360
37. Mixing, output, DACs, power control, and audio edge cases
1286
-
38. Formal DMG hardening matrix, severity classes, and closure checklist
1287
-
39. Automated external ROM harness and minimum closure suites
1288
-
40. Differential comparison against SameBoy and Gambatte
1289
-
41. Deterministic replay, save/load determinism, and soak coverage
1290
-
42. Final DMG closure and regression-retention pass
1361
+
38. Whole-machine snapshot contract and ownership
1362
+
39. Global serialization envelope, versioning, and metadata
1363
+
40. Core save/load restore path and validation
1364
+
41. Formal DMG hardening matrix, severity classes, and closure checklist
1365
+
42. Automated external ROM harness and minimum closure suites
1366
+
43. Differential comparison against SameBoy and Gambatte
1367
+
44. Deterministic replay, save/load determinism, and soak coverage
1368
+
45. Final DMG closure and regression-retention pass
1291
1369
1292
1370
---
1293
1371
@@ -1337,7 +1415,11 @@ Suggested entry style:
1337
1415
1338
1416
- None currently.
1339
1417
1340
-
### Phase 8 — Block AP: final DMG hardening, differential validation, and closure
1418
+
### Phase 8 — Full emulator save states and global serialization strategy
1419
+
1420
+
- None currently.
1421
+
1422
+
### Phase 9 — Final DMG hardening, differential validation, and closure
0 commit comments