MeadowValley BackToEarth (SlateOne) 04 Recomp

Architecture Guide — MeadowValley BackToEarth (SlateOne) 04 Recomp

  • Last Updated: 2026-11-29 (Enhanced RC v0.5.0 -> v1.0.0 Confirmed Gold -> v2.0.0 Summit)
  • Solution & Workspace: Dev/HMBackToNatureRecomp.slnx (4 .NET 8.0 projects, Zero Warnings) · Local workspace path remains Personal/HMBackToNature-Recomp/
  • Ecosystem Stack (v0.5.0): Foundation v0.6.0 · reEngine v0.7.0 (reEngine.Host.dll, SDL3.dll) · reSlate v0.4.0 (reStation.{Contracts,Core} ABI preserved)
  • Extended Chapters: ARCHITECTURE.AotAndControls.md

1. Architectural Strategy & Static Recompilation Mandate

MeadowValley BackToEarth (SlateOne) 04 Recomp implements 100% Pure Simulation + Presentation Modernization for North American SLUS-01115: - Static Recompilation Non-Emulator Mandate: reEngine + reSlate operate strictly as an AOT-primary static recompilation stack (native <dataDir>\cache\<moduleId>\<cacheKey>\<moduleId>.Generated.dll primary; Tier 3 native CoreCLR RyuJIT / pre-decoded Zero-RWX ThreadedIrBackend secondary for unlifted/bring-up blocks via --jit-bringup). The clean-room interpreter (PsxInterpreter) stays quarantined strictly to explicit --execution-tier interpreterOracle differential checks. - Zero-Asset Day-1 Clean-Room Split: Zero *.g.cs files, *.Generated.dll binaries, retail disc images, extracted assets, or system ROMs are stored in Git or shipped in Builds\/Releases\. All *.g.cs lifting and compilation happen locally on the player's machine against user-supplied SLUS-01115 media. - Separate Native Port Boundary: Any future zero-emulation P0–P5 native rewrite lives in a completely independent repository (portProjectPath != recompProjectPath); this module remains strictly a slim .recomp layer on reEngine + reSlate.

Component Boundaries (Dev/src/)

Layer / Project Implemented (v0.5.0) Responsibilities Primary Files
Game Module (HMBackToNatureRecomp.Module) Clean-room IRecompGameModule, IModuleInputProfileProvider (7 ControlOptions incl. stickDeadzoneInnerPercent & stickDeadzoneOuterPercent, move* D-Pad defaults, IsGameplayContextActive), INativeGameActionHook (NativeGameActionContext.ModuleOptions -> ViewportPolicy + 360° radial deadzone ComputeRescaledAnalogVector 0x5C..0xA4), Slus01115HapticRumbleController (committed-tick 0x42–0x4D DualShock motor telemetry, 0 guest RAM writes), Slus01115PureStaticReadiness (14/14 resident + Slot A/B overlays + PsxCpu.EvaluatePureStaticReadiness(), jit=0, threadedIr=0, interp=0) & Slus01115TraceParityVerifier (4 oracle scenes incl. Year-3 credits), IRecompWidescreenProvider via SmartIsometricViewportPolicy (<= 320 px indoor clamp 256..640, 480i/fade/modal 4:3 fallback, centered 4:3 HudSafeRect), ISubTickFrameHook (Slus01115SubTickHook, MaxSubFramesPerTick = 8) + Slus01115EntityInterpBuffer + Slus01115SubTickRamGuard (4KB dirty-page bitmask rollback), Slus01115CutsceneSkipHook, HdTexturePackShield (<dataDir>\hdpacks\, p11_animl shield), SaveMigrationHelper (--save-dir fail-closed bu00:/bu10: .mcr + .rst routing), IRecompQuickSaveProvider ("OVLY"), TextScopedOverlayModuleAdapter, DualSlotOverlayTracker, Part9SoundbankInspector, & SettingsMigrator + SettingsMigrator.Helpers.cs (4 backends, isRumbleEnabled, cddaVolume, padPort1Type, padPort2Type, stickDeadzoneInnerPercent, stickDeadzoneOuterPercent, UTF-8 no-op fast-path). HMBackToNatureGameModule.cs, Slus01115PureStaticReadiness.cs, Slus01115TraceParityVerifier.cs, Slus01115HapticRumbleController.cs, SmartIsometricViewportPolicy.cs, SaveMigrationHelper.cs
Thin Launcher (HMBackToNatureRecomp.Launcher) Fail-closed AppEnvironment containment (APP_ISOLATED_TEST=1 & --save-dir), side-by-side reSlate v0.4.0 (0.4.x/0.3.x) + .ready discovery with LauncherSemVerHelper, warm-launch .7z skip (~2.72s), --open, --rumble/--no-rumble, --cdda-volume, --pad1-type, --pad2-type, --fullscreen/--window, --overscan, --audio-driver, --promote-profile (--profile), --require-pure-static (--execution-tier staticAotOnly, conflicts with --jit-bringup -> ExitCode = 2), --aspect-mode / --fast-forward / --hd-packs pass-through, <dataDir>\config\settings.json + non-destructive .mcr/.rst remap, recursive data\rom\ discovery, & Release --automation-port fail-closed (ExitCode = 2). Program.cs, LauncherCliAndContainment.cs, LauncherLoggerAndRunner.cs, LauncherSemVerHelper.cs
Setup Installer (HMBackToNatureRecomp.Installer) Foundation.Installer v0.6.0 pure Win32 offline 4-pillar wizard (WizardControl / InstallerWizardForm.RunDialog() + MessageBoxW, AllowAutoStart = false; System.Windows.Forms / Foundation.UI / Foundation.Automation stripped from Release PE), InstallerPathResolver suite-first resolution + Wizard two-way auto-sort + umbrella deduplication + LastInstallBaseDir self-repair, misnested legacy self-healing & --confirm-legacy-cleanup, synchronous --uninstall, Debug-only WizardAutomationSurfaceTarget + InstallerAutomationHook, & offline reEngine v0.7.0 + reSlate v0.4.0 bundles (InstallerBootstrapHelper). Program.cs, InstallerPathResolver.cs, InstallerBootstrapHelper.cs
Automated Verification (HMBackToNatureRecomp.Tests) 131/131 synthetic xUnit tests passing in Release and Debug (/p:TreatWarningsAsErrors=true, 0 warnings, 0 retail assets, <= 180/200/220/400 line caps across .cs/.ps1 under Dev\) covering pure-static 14/14 readiness, 4-scene trace parity, 360° radial deadzone + zero-RAM rumble, --save-dir dual-slot isolation, uStation CLI parity, Release IL purity (MetadataReader), 10/10 certification fixtures across opengl/vulkan/parallelCpu, Stage 2 T5 CLI + Win32 Wizard E2E (PASS, 0 open reports). V050PureStaticAndRumbleTests.cs, V050SavesCliAndCertificationTests.cs, V040EnhancementsAndQolTests.cs, ArchitectureAndHygieneTests.cs

2. SLUS-01115 Guest Memory, Overlay Slots & v0.3.0 AOT Optimizations

  • Resident Executable (SLUS_011.15, ExeId = 0): loadAddress = 0x80010000, textSizeBytes = 0x4E800 (0x80010000–0x8005E800), pc0 = 0x80011278.
  • 0x8002C5B8 Boot Fallback Fix (v0.3.0): aot-recipe.json (14 EXEs, 4,334 unique sorted entries) merges upstream MeadowValley-BackToEarth-SlateOne-04.decomp (v0.2.1, 52 D4a modules) and explicitly seeds resident entry 0x8002C5B8 (2147665336), eliminating live-boot fallbacks.
  • 0x800129E8 Assert Stub: 0x800129E8 executes break 0x400 on non-zero $a0; guarded via static handling and --jit-bringup (ExitCode = 5).
  • Dual-Slot Overlay Residency & .text-Scoped Adapter (v0.3.0 Hot-Path Optimization):
  • Slot A (0x800B7E20, 11 overlays anchored by gameplay OvlPart11Id06 & title OvlPart27Id0c) + co-resident Slot B (0x8012DDE8, OvlPart15Id10 & OvlPart30Id0f).
  • .data/.bss Thrash Bottleneck: aot-recipe.json registers full partition sizes (483,328 B for Part 11; 57,344 B for Part 27), spanning mutable .data/.bss (0x80126FE0, 0x8012D52C, 0x800C4A24, and the 56-B Part 11 .bss overlap 0x8012DDE8..0x8012DE20). Any guest write bumps CurrentGeneration in PsxCpu and triggers full-partition SHA-256 re-hashing that fails to match ContentSha256Hex, kicking Part 11/27 out of AOT into Tier 3 JIT.
  • Module Fix (TextScopedOverlayModuleAdapter + v0.3.3 ITextScopedOverlayRecompModule): Wraps each compiled IOverlayRecompModule in Slus01115MediaAndAotHelper and implements ITextScopedOverlayRecompModule (VerifiedTextStart, VerifiedTextSizeBytes, TextSha256Hex) alongside legacy LoadRamAddress, ContentSizeBytes, and ContentSha256Hex from Slus01115ModuleConstants.Binaries (Part 11 .text 0x800BBC34, 416,588 B; Part 27 .text 0x800B7EEC, 11,636 B), while reSlate v0.3.0-hf.3 MipsLifter loop/call MidEntries keep post-QuickLoad execution inside AOT instead of falling back per block (~644 ms -> < 20 ms).
  • Upstream .decomp Consumption (MeadowValley-BackToEarth-SlateOne-04.decomp v0.2.1):
  • Clean-room 68-entry archive (1.29 MB) containing module.decomp.json, 52 cohesive D4a warning-free C modules (Dev/schemas/d4_rewrites/*.json), functions_catalog.json (2,575 game funcs), clusters.json (3,828 funcs / 23 domains), globals_map.json, standalone_integrity.json, and d4_build_report.json (12/12 Q12 GTE/sim parity). Consumed read-only in relift_slus01115.ps1 -DecompBundle without ever copying Corpus\ downstream.
  • Open Upstream Optimization Proposal (filed to reStation\Dev\docs\reports\): Optional ContainerOffsetBytes (converting PlayerMediaResolver warm/cold 133.9 MB A_FILE.BIN brute-force sector scans from O(N) multi-GB hashing to O(1) < 20 ms), per-EXE EntryAddresses preservation for overlapping Slot A/Slot B seeds, and reSlate.Compiler.runtimeconfig.json framework-dependent fix.

3. Tracked Failure Mode Matrix (FM-HMB-01 – FM-HMB-14)

ID Failure Mode & Empirical Anchor Target Gate Mitigation
FM-HMB-01 Retail media / historical v0.1.1 *.g.cs commits (869 files) / Builds\v0.1.1\*.Generated.dll leak v0.3.0 Purge Builds\v0.1.1\, Archive\pre-scrub-v0.3.0.7z + git-filter-repo, Assert-CleanRoomTree (RETAIL_LEAK_COUNT = 0)
FM-HMB-02 Part 11 .bss (0x8012DDE8..0x8012DE20, 56 B) + mutable .data writes thrash AOT overlay SHA-256 v0.3.0 TextScopedOverlayModuleAdapter (.text-only hash bounds) + "HMOV" v1 "OVLY" QuickSave tests
FM-HMB-03 0x0E sprite / 480i VRAM collisions or <= 320 px compact indoor room void bleed in widescreen v0.4.0 SmartIsometricViewportPolicy clamps <= 320 px rooms, 480i, fades, and modals to 4:3, pins 4:3 HudSafeRect, & HdTexturePackShield protects p11_animl (x >= 0x140 / texPage >= 5)
FM-HMB-04 Part 9 pBAV/pQES or M2F2 STR/01..04.XA underruns / fade desync (0 Redbook tracks on SLUS-01115) v0.3.0 / v0.4.0 reSlate v0.3.3 60 Hz SPU lock (735 samples/VBlank), 0x180..0x1AA XA fade checks (xaDrops == 0 under 4x Fast-Forward), 0 B/frame cached telemetry
FM-HMB-05 Sub-tick RAM mutation, OT scratch overwrite, ReStationHost.ForwardSubTickHook double-entry, or 480i shimmer v0.3.0 / v0.4.0 Slus01115SubTickHook (enableLiveSubTickExecution: true) + Slus01115SubTickRamGuard 4KB dirty-page bitmask rollback (0 violations), OT restore, 480i + Fast-Forward suppress
FM-HMB-06 Unlifted 0x8002C5B8 (5 boot hits) / 48 bringup hits prevent staticAotOnly v0.3.0 / v0.5.0 v0.3.0: lift 0x8002C5B8 (0 boot fallbacks); v0.5.0: Slus01115PureStaticReadiness certifies 14/14 binaries, jit=0, threadedIr=0, interp=0 (isPureStaticReady = true)
FM-HMB-07 HM-13 Continue memcard loop + moduleId cutover orphaning memcard_*_slot*.mcr, plus libmcrd async & ToT[10] snapshot loss v0.3.0 / v0.3.4 reSlate v0.3.2+ SIO0 0x81/_new_card + BIOS A0:0x1A strncpy (BASLUS-01115-FARM0..3), async libmcrd / ToT[10] snapshot restore + .mcr/.rst migration
FM-HMB-08 HM-14 Original + targetFps=30 runs 60 Hz, < 64-cycle TryAdvanceToNextVBlank(), CdlGetlocP rollover seek loop, QuickLoad black VRAM, & sub-tick camera/actor jitter v0.3.3 / v0.4.0 reSlate v0.3.3 CdlGetlocP 0x11, OpenGL _vramFbo readback, ITextScopedOverlayRecompModule + loop MidEntries, & v0.4.0 Slus01115EntityInterpBuffer 60–240+ Hz camera/farmer/coop/barn smoothing
FM-HMB-09 HM-15 doubled menu inputs, Esc dual bind, 0x80 analog clobber, hidden map PadSelect leak on D-Pad Left, & missing 1:1 controller binds v0.3.0 / v0.3.2 Single-edge reSlate + 3-tier controller binds (controllerBindings, LT/RT, 0 clear) + Slus01115InputProfile / Slus01115NativeActionHook Menu vs Gameplay isolation
FM-HMB-10 Cold (71–81s) / Warm (23–39s) AOT startup stalls & redundant settings rewrites v0.3.4 / v0.4.0 BuildEffectiveForwardedArgs warm .7z skip (2.72s) + SettingsMigrator UTF-8 fast-path (0 [SETTINGS_MIGRATED] re-triggers); upstream ContainerOffsetBytes O(1) hint tracked
FM-HMB-11 Launcher/Installer fail to detect reSlate.exe / .ready or diverge on flat data\settings.json vs data\config\settings.json v0.3.0 Probe reSlate + .ready first (reStation fallback); migrate atomically to data\config\settings.json
FM-HMB-12 Trademark leaks, Builds\v<Ver>\AGENTS.md, or outer Installers\ directory in v0.3.0 Public Beta v0.3.0 Full MeadowValley-BackToEarth-SlateOne-04 cutover, stop Builds\*\AGENTS.md & Installers\, human-gated git-filter-repo
FM-HMB-13 Release Foundation.Automation / WinForms PE leak or missing 7-file Portable.zip & 4-drive Sandbox E2E v0.3.0 / v0.5.0 v0.3.0: conditional Debug-only Foundation.Automation; v0.5.0: pure Win32 Installer (UseWindowsForms / Foundation.UI stripped in Release), Assert-BinaryPurity / Assert-InstallerPurity + MetadataReader IL check, 4-drive E2E
FM-HMB-14 D4a vs D4b trace gap & multi-backend (opengl, vulkan, parallelCpu) divergence through Year-3 credits v0.5.0 / v1.0.0 v0.5.0: Slus01115TraceParityVerifier (4 scenes) + 10/10 tri-backend fixtures (opengl/vulkan/parallelCpu); v1.0.0: human Year-1..Year-3 playtest sign-off

4. Coded Identity Cutover Architecture (v0.3.0–v0.5.0 — Low-Churn Seam)

While keeping local workspace folder Personal/HMBackToNature-Recomp/, HMBackToNatureRecomp.slnx, and internal HMBackToNatureRecomp.* C# namespaces stable to avoid unnecessary Git churn, all public, contract, assembly-output, and installer identities cut over cleanly per SeriesMap.json: - Package / Module ID: meadowvalley-backtoearth-slateone-04 (LegacyModuleIds = ["hmbacktonature-recomp"]) - Output Assemblies & Cartridges: MeadowValley-BackToEarth-SlateOne-04.recomp.dll, MeadowValley-BackToEarth-SlateOne-04.exe, app\MeadowValley-BackToEarth-SlateOne-04.recomp, MeadowValley-BackToEarth-SlateOne-04-Setup-v0.5.0-win-x64.exe, MeadowValley-BackToEarth-SlateOne-04-v0.5.0-win-x64-Portable.zip - Engine Target: engineId: "reSlate", engineVersion: "0.4.0" (bundling reEngine v0.7.0, Foundation v0.6.0), compatibleEngineTrack: "0.4.x", supportedEngineTracks: ["0.4.x", "0.3.x"] (module.recomp.json at root Dev\ and Manifests\ kept byte-identical via unit test assertion).