Extract RollerRuntime replay stepping - #284
Conversation
Design spec (planning artifact)Moved out of the branch and attached here for review context. RollerRuntime extraction designRollerRuntime extraction design
GoalExtract the game loop toward a reusable The first useful milestone is not arbitrary high-level input. It is a replay-driven runtime path that can run the existing snapshot harness. Replay loading/parsing stays outside Non-goals for the first milestone
Design principlesFinal interface first, minimal implementation firstCreate the Runtime and rendering remain separate modules
Framebuffer production belongs to renderer consumers. Existing Existing snapshot PNGs are the baselineThe current VCS-managed snapshot PNGs remain authoritative. A runtime-driven snapshot path should write the same baseline files and use the existing git-diff workflow to detect pixel drift. Target architectureflowchart LR
subgraph Inputs[Input sources]
Replay[Replay files]
Scripted[Future high-level actions]
Host[Future external host input]
end
ReplaySource[Replay input source]
Runtime[RollerRuntime SDL-free interface]
Adapter[Runtime adapter legacy-compatible implementation]
StateView[Renderer-facing runtime state view]
subgraph Legacy[Existing engine internals]
Setup[Direct and replay setup]
Tick[Existing tick path]
State[Authoritative simulation state]
end
subgraph Renderers[Renderer consumers]
GameRender[game_render]
SceneRender[scene_render]
Snapshot[Snapshot adapter]
end
Baselines[VCS-managed snapshot PNG baselines]
Telemetry[Future stable telemetry]
Replay --> ReplaySource
ReplaySource --> Runtime
Scripted -. milestone 2 .-> Runtime
Host -. later .-> Runtime
Runtime --> Adapter
Adapter --> Setup
Adapter --> Tick
Tick --> State
State --> StateView
StateView --> GameRender
StateView --> SceneRender
GameRender --> Snapshot
SceneRender --> Snapshot
Snapshot --> Baselines
Runtime -. later .-> Telemetry
Public
|
Architecture diagram (planning artifact)Moved out of the branch and attached here for review context. flowchart LR
subgraph Inputs[Input sources]
Replay[Replay files]
Scripted[Future high-level actions]
Host[Future external host input]
end
ReplaySource[Replay input source]
Runtime[RollerRuntime SDL-free interface]
Adapter[Runtime adapter legacy-compatible implementation]
StateView[Renderer-facing runtime state view]
subgraph Legacy[Existing engine internals]
Setup[Direct and replay setup]
Tick[Existing tick path]
State[Authoritative simulation state]
end
subgraph Renderers[Renderer consumers]
GameRender[game_render]
SceneRender[scene_render]
Snapshot[Snapshot adapter]
end
Baselines[VCS-managed snapshot PNG baselines]
Telemetry[Future stable telemetry]
Replay --> ReplaySource
ReplaySource --> Runtime
Scripted -. milestone 2 .-> Runtime
Host -. later .-> Runtime
Runtime --> Adapter
Adapter --> Setup
Adapter --> Tick
Tick --> State
State --> StateView
StateView --> GameRender
StateView --> SceneRender
GameRender --> Snapshot
SceneRender --> Snapshot
Snapshot --> Baselines
Runtime -. later .-> Telemetry
|
Implementation plan (planning artifact)Moved out of the branch and attached here for review context. Full implementation planRollerRuntime Replay Snapshot Implementation Plan
Goal: Add the first replay-driven Architecture: Introduce a small SDL-free public runtime interface that owns stepping, not replay file loading. Replay loading/parsing remains outside runtime; the first snapshot integration composes existing replay setup with Tech Stack: C11, Zig build system, existing SDL-linked legacy engine internals, existing snapshot PNG baseline workflow. Global Constraints
File Structure
Task 1: Add SDL-free
|
|
ROLLER browser preview: https://worktree-green-forest-0a1b.roller-web.pages.dev Updated for commit 0acf76d. |
Summary
RollerRuntimeC API for fixed-step simulation ownershipRollerRuntimebehind--runtime-snapshotzig build test-runtime-snapshotsas a parallel replay snapshot gateNew/Deleteconvenience APIsValidation
zig build test-roller-runtime-api test-roller-runtime-steppython3 tools/check_roller_core_manifest.pyNotes
This PR intentionally keeps normal interactive gameplay on the existing loop. The runtime is currently wired into the replay snapshot harness only.
Non-scratch snapshot gates still need canonical reference-host verification. On this Linux host, checked-in PNG baselines produce host-dependent diffs; those PNG changes were not committed.
Design/spec and implementation-plan artifacts are attached as PR comments rather than kept in the branch.