Skip to content

feat: add deterministic input replay - #9478

Draft
scarf005 wants to merge 3 commits into
cataclysmbn:mainfrom
scarf005:feat/deterministic-rng-replay
Draft

feat: add deterministic input replay#9478
scarf005 wants to merge 3 commits into
cataclysmbn:mainfrom
scarf005:feat/deterministic-rng-replay

Conversation

@scarf005

@scarf005 scarf005 commented Jun 14, 2026

Copy link
Copy Markdown
Member

Purpose of change (The Why)

Add deterministic JSONL input replay for debugging and regression reproduction while keeping concurrent game work enabled.

Describe the solution (The How)

  • Add --replay-record <jsonl path> and --replay-play <jsonl path> for user input events only.
  • Move replay/RNG helpers under src/replay/ and src/random/.
  • Use stable replay seed keys for thread-pool tasks and per-index parallel_for RNG scopes, without changing chunking to one task per item.
  • Cover replay playback determinism with multithreaded scheduled work.

Testing

  • cmake --build --preset linux-full --target format
  • cmake --build --preset linux-full --target cataclysm-bn-tiles cata_test-tiles -j 8
  • timeout 120 ./out/build/linux-full/tests/cata_test-tiles "[rng][thread_pool],[replay][input],[replay][rng][thread_pool]"
  • ./out/build/linux-full/src/cataclysm-bn-tiles --help | rg -n "replay"

Checklist

Mandatory

Optional

PR opened by gpt-5.5 high on pi

Build Artifacts

PR build for commit 5dbc35a (style(autofix.ci): automated formatting) on 2026-07-02 14:46:17

@github-actions github-actions Bot added src changes related to source code. tests changes related to tests labels Jun 14, 2026
@scarf005
scarf005 force-pushed the feat/deterministic-rng-replay branch from d215b1d to 4117310 Compare June 14, 2026 16:50
@github-actions github-actions Bot added the lua PRs and issues related to Lua scripting label Jun 14, 2026
@scarf005
scarf005 force-pushed the feat/deterministic-rng-replay branch from 4117310 to fbe0658 Compare June 26, 2026 11:29
scarf005 and others added 2 commits July 2, 2026 20:04
Assisted-by: pi:gpt-5.5
Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
Assisted-by: pi:gpt-5.5
Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
@scarf005
scarf005 force-pushed the feat/deterministic-rng-replay branch from fbe0658 to 910dad8 Compare July 2, 2026 11:27
@autofix-ci

autofix-ci Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Autofix has formatted code style violation in this PR.

I edit commits locally (e.g: git, github desktop) and want to keep autofix
  1. Run git pull. this will merge the automated commit into your local copy of the PR branch.
  2. Continue working.
I do not want the automated commit
  1. Format your code locally, then commit it.
  2. Run git push --force to force push your branch. This will overwrite the automated commit on remote with your local one.
  3. Continue working.

If you don't do this, your following commits will be based on the old commit, and cause MERGE CONFLICT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lua PRs and issues related to Lua scripting src changes related to source code. tests changes related to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant