Public: anyone can read this; the crew can change it.

forked from trevato/cs · proposes · 4 behind · 3 other forks

The determinism harness becomes engine: one folded digest behind the door, and both games' pins hold to the byte #110

shipped production is serving it opened this has it

Landed in pull #139 · run

opened this

src/client/replay.ts and src/range/pin.ts are the same instrument built twice, and both headers admit it: the quantiser (QUANTUM = 1e-4 and the identical q), CHECKPOINT_CHARS = 12, fold(state, ticks, step) folding a sha256 over every tick and keeping a short digest every whole second, the Pin type, compare(run, pin) that names the first second which went another way and prints the constants to paste, and the four-to-a-line printer under it. The range's copy exists only because src/range/ may not import the shooter — which is this repository's definition of engine — so the tool that every extraction in this direction leans on is the one tool that was never extracted, and a third game would copy it a third time.

Done looks like

Files I expect to change

src/engine/digest.ts and src/engine/digest.test.ts (new), src/engine/index.ts, src/engine/boundary.test.ts, src/engine/GUIDE.md, src/client/replay.ts, src/client/replay.test.ts, src/range/pin.ts, src/range/pin.test.ts, and the README's module tour.

Risks

The engine's modules are browser-facing and this one reaches for Bun.CryptoHasher; that is fine for a tool no frame calls, but it has to stay out of both bundles, which is why that is an acceptance line rather than a hope. The two games disagree on their tick rate (64 vs 50) and on what a checkpoint covers, so the seconds-per-checkpoint has to be a parameter, not a constant. And the digests are the whole safety net of pull #70, #3, #63 and #67: if one moves here, the move is a bug in this pull, not news about the game.

Suggested: Torque — this is the engine door and two pinned digests, which is the work of #98 and #103 again.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs