Platform & SDK Design Document: reCartOne
- Design Profile:
PLATFORM_SDK_ENGINE(ENGINE) - Current Shipped Baseline:
v0.1.4(Implemented) - Active Target Horizon:
v0.2.0(Locked for v0.2.0) - Charter & Roadmap Anchors: CHARTER.md · ROADMAP.md · ARCHITECTURE.md
1. Product Vision & Core Capabilities
Clean-room .NET 8.0 ahead-of-time static recompilation engine, 6502 -> C# lifter, and hardware-timed RP2A03 / RP2C02 (platformId: "nes") runtime for reEngine.
Shipped & Scoped Capability Pillars
- AOT-Primary Execution (
staticAotOnlyDefault): Clean-room 2-member recipe ([module.recomp.json, aot-recipe.json]including inline jump-table pointer lifting) and 3-member lifted.recompcartridges compile locally out-of-process on the player's machine into<dataDir>\cache\<moduleId>\<key>\<moduleId>.Generated.dllfrom user-supplieddata\rom\media (.nes,.prg,.zip, and.7z) verified by SHA-256 while the interactive SDL3 window opens immediately with live compilation progress, failing closed cleanly if an unlifted code address is encountered. - Unified
6502 -> Shared IR& Raw-Media Bring-Up (v0.2.0->v0.7.0): Tier 3 Collectible RyuJIT and Zero-RWX Threaded-IR (--jit-bringup, arriving inv0.2.0and hardened throughv0.7.0) share a single bank+RAM-epoch-keyed IR frontend that enables emergency fallback,bringup.profile.jsonprofiling, best-effort standalone.nes/.fdsJIT boot, and automated100%static AOT promotion — whileInterpreterOracleremains strictly quarantined behind--execution-tier interpreterOracle. - Two-Phase Aspect-Locked Video & Band-Limited Audio: Today
reCartdrives all 5reEngine.Host v0.6.2backends (OpenGL 3.3 Core,Vulkan 1.3,DirectX 12,ParallelCpu,Software) defaulting tonativePar(8:7NTSC PAR pillarboxed — never stretched to16:9) alongsidefourByThree,squareInteger,nativeFit, and opt-inhorPlus16By9. Thev0.3.0–v0.4.0backend upgrades add CPU-cycle Blip-buffer synthesis,PAL/Dendytimings, two-phase scanline-bandParallelCpu(1xbit-exact toSoftware), and native GPU sprite/tile/shader composition (>8sprites, 24-bit overrides,120–240 HzSubTick, CRT/colorblind filters). - Proving Ground #1: Designed alongside reSlate and verified with clean-room fixture IronFrame-OuterFortress-Cart-01-Recomp (
IronFrame OuterFortress (Cart) 01/ironframe-outerfortress-cart-01) at deterministic60.0988 Hztiming. - Hardware-Timed Core (
NTSC+ Mappers0/1/2/3): Cycle-stepped6502(RP2A03CPU: 56 official opcodes, zero BCD,JMP ($xxFF)page-wrap,$4016/$40170x40open-bus,513/514-cycleOAM DMA+DMCstalls), cycle-paced static AOT block dispatch, dot-stepped262-scanlineRP2C02PPU (256x240, odd-frame dot skip, Loopyv/t/x/wscroll, sprite-0 hit & NMI suppression), 5-channelRP2A03APU (Pulse 1/2,Triangle,Noise,DMC), and Mappers0–3(NROM,MMC1,UxRom,CNROM). Dedicated backend minors expand through Shared IR/JIT (v0.2.0), Blip-buffer DSP +PAL/Dendy(v0.3.0), two-phaseParallelCpu/GPU compositing (v0.4.0), commercial iNES/NES 2.0 mappers + peripherals + Dual-Installer (v0.5.0), clean-room disk-system HLE + 6 expansion audio chips +.re*packs (v0.6.0), and raw-media hardening + static AOT promoter + Research rail (v0.7.0) ->v1.0.0Going Gold. - Static
6502 -> C#Lifter, Jump Tables, Cold AOT Cache &reCart.Decomp: Emits and compiles clean-room 2-member recipe (module.recomp.json,aot-recipe.jsonwith inline jump-table scanning across fixed/switchable banks) and 3-member lifted (.cs,dispatch.meta.json).recompZIP archives (zero*.Generated.dllor retail ROMs bundled), builds.Generated.dlllocally out-of-process asynchronously behind the host compile overlay, and enforces clean-source verification with zero-warning builds.
2. Consumer Mental Model, Public Seams & Compatibility
- Thin Host + Composable Contracts: Exposes cohesive, strongly typed interfaces and shared runtime primitives so downstream applications avoid duplicating logging, persistence, UI shell, or installer plumbing.
- Backward-Compatible Evolution: Additive non-breaking minor/patch releases publish immutable versioned drops under
_SharedLibs/while keeping consumer tests deterministic. - Containment by Construction: Enforces explicit
--data-dir,--config,--log-dir, and sandbox environment overrides across every consumer boundary.
3. Data, Configuration & Failure-Mode Contracts
- Configuration Precedence: Explicit CLI flags (
--data-dir,--config,--log-dir,--port) override environment variables, which override local workspace defaults—ensuring automated tests never touch live production state. - Graceful Degradation: Missing optional inputs, offline endpoints, or corrupted local cache files surface clear recovery guidance rather than silent data loss or unhandled crashes.
4. Design Change Log
2026-11-30(v0.1.4->v0.2.0): Synthesized baseline living design specification from shipped architecture, feature registry, and roadmap horizons.