
Rhythm Fruit Shop — Native C++ Core
Context
A rhythm game is a real-time system with an unforgiving spec: judgment windows are tens of milliseconds wide, so every layer between the audio hardware and the player's input must be accounted for. I built this native C++20 core to work through timing, determinism, and memory discipline from first principles — without an engine doing the hard parts for me.
Decision
Song time derives from the audio backend's PCM cursor through an EMA-smoothed, re-anchoring clock — never from frame deltas. Input events carry host-monotonic timestamps reverse-mapped into song time, treating input-to-judgment as a clock-domain-crossing problem. The session core is fully headless, which makes determinism testable: CI replays a recorded run and asserts agreement with an independent Q16 fixed-point scoring oracle. Memory discipline is enforced, not promised — a custom operator-new AllocationGuard fails the build on any steady-state hot-path allocation, and CMake dependency guards make the layering provable (the core links no windowing or audio libraries).
Outcome
Deterministic record & replay validated in CI against an independent fixed-point oracle; a zero-allocation gameplay hot path and architectural layering verified by the headless CI workflow — engineering contracts the build cannot silently break.