Add ADR-014: Event journal (recording and replay) - #32
Merged
Conversation
Proposes options for a recording/replay capability, prompted by comparing frame's event bus to a classic id Software engine diagram's Event Journal. Speculative, not need-driven: no ideas.md TODO is blocked on this. Covers four approaches (input-only + re-simulation, full event log + playback, periodic snapshots, deferring) with pros/cons, and recommends deferring for now since the most valuable option depends on a determinism audit this codebase hasn't done (flags view/camera/shake.go's unseeded RNG as the concrete example) — falling back to a full-event-log recorder if a real trigger (bug repro, highlight capture) shows up before that audit.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Proposes
docs/adr/ADR_014_event_journal.md: options and tradeoffs for a recording/replaycapability, prompted by comparing frame's event bus architecture to a classic id Software
(Quake III Arena-style) engine diagram —
Input -> Event Queue -> {Server, Client}, with anEvent Journal hanging off the queue for demo recording/replay.
Why this is worth writing down now, even though nothing needs it yet
This ADR is explicit about being speculative — no
games/metalslug_demo/ideas.mdTODO isblocked on it. It exists because the architecture comparison exposed a real gap (frame has zero
recording/replay capability today), the same way ADR-010 opened from "we want visibility" rather
than a blocking bug. The point of writing it now is so a future concrete trigger (a
hard-to-reproduce bug, wanting a highlight-clip feature, or actually starting ADR-004's
peer-to-peer networking) picks from an already-considered set of options instead of re-litigating
from scratch under time pressure.
What's inside
Four approaches, each with a pros/cons table, following the same format ADR-010 uses:
smallest recordings, doubles as ADR-004's peer-to-peer networking foundation, but requires the
simulation to be bit-for-bit deterministic — which isn't currently true:
frameengine/view/camera/shake.gocallsrand.Float64()from Go's default, unseeded globalsource. Cosmetic today, but it's live proof nothing here guarantees reproducible randomness.
immediately with no determinism dependency; good for bug-repro, useless for netcode.
world-state save/restore that doesn't exist yet; heaviest by far.
Recommendation: defer (Approach 4) for now, since there's no concrete trigger and Approach
1 — the option actually worth building deliberately — is gated on a determinism audit that isn't
even scoped yet. Fall back to Approach 2 as the pragmatic first cut if a real need shows up
before that audit happens; revisit Approach 1 specifically once ADR-004's networking work is
actually pursued, since the audit becomes a hard requirement there anyway.
Also includes a comparison table, Open Questions (hook point, always-on ring buffer vs.
explicit start/stop, serialization format, WASM support), Consequences, and References back to
ADR-002 (event bus), ADR-004 (networking), ADR-006 (constraints), ADR-007 (precedent for
deferring speculative infrastructure), and ADR-010 (sibling options/tradeoffs ADR this follows
the format of).
Scope
Docs-only (one new file); no code changes. Branches from
main, no dependency on any other openPR.
Generated by Claude Code