Validate GameInput replay tapes #3444

Open
github-bot wants to merge 3 commits from github-bot/gh-3444 into main AGit
Owner

@⁠LucaruluDev on GitHub · 2026-11-29 23:25 UTC · original
LucaruluDev:fix/padtape-replay-validation → main · +302 −51 · 1 files · 3 commits · open

What it changes

Validate the entire VICTORY_INPUT_REPLAY tape before applying any pad state. Skip blank lines. Accept complete hexadecimal pad states and explicit disconnect rows for slots 0–3, plus standalone wait directives. Wrong field counts, invalid hexadecimal, out-of-range slots, unreadable files and tapes with no steps reject the replay. The diagnostic reports the path and reason once, with the first invalid line number for a format error.

When replay is rejected, live input remains available and recording is disabled for that run. This protects the rejected tape when VICTORY_INPUT_RECORD points to it and also leaves a separate recording destination untouched. Recording still works when replay is unset. Valid recordings retain their existing format and wait holds the last readings until <tape>.go exists, then rebases subsequent timestamps.

For unattended benchmarks, check for replayed from a file: N steps with the expected step count. A successful process exit can also come from live-input fallback. Replay covers pad state. Separately configured live keyboard and mouse routes can still contribute input.

How it was tested

  • GPU and profile: N/A. Windows 11 with Rust 1.98.1, synthetic tapes and isolated temporary files. No game or physical-controller test was run.
  • Before: main silently skips malformed rows, treats an incomplete pad state as a disconnect, accepts an empty tape and can fall through to recording after a read error. These baseline behaviours were verified by inspecting the parser and initialisation path.
  • After: The focused tests cover whole-tape rejection, byte-for-byte preservation of both shared and separate record paths, replay precedence, normal recording and wait/.go.
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A.
  • cargo test passed for the crates it touches: the focused GameInput suite passed. The full crate and workspace suites were not run on this merge.

Published head 80b8bbcae0cd4836826149200b625d1201cc73ff. Tested in the clean local merge d94860677a0328e41e0d9d3cda3d1f14f2fffef8 with main at 5fabb46eaf6ed8771321787f8871051abde69b9b:

Command Result
cargo test --locked -j 2 -p victory-hle --lib modules::gameinput:: -- --test-threads=2 108 passed, including 12 padtape tests, 0 failed, 3 ignored. The padtape child entry point is invoked by the parent tests.
cargo clippy --locked -j 1 -p victory-hle --all-targets --no-deps -- -D warnings Passed.
cargo clippy --workspace --all-targets --locked -j 2 -- -D warnings Exit 101 on both the local merge and its main base.
cargo clippy --workspace --all-targets --all-features --locked -j 2 -- -D warnings Exit 101 on both the local merge and its main base.

The PR's recorded check predates #4297 and stopped at the pre-existing unused victory-loader::crash::unwind_copy, since removed upstream. On the current base, the local merge reproduces the same five findings as main after #4635: two too_many_arguments in host/font.rs, one manual_is_multiple_of in host/menu.rs, and two collapsible_if in host/panel.rs. Both open fixes address all five. PR check · Current main check · #4680 · #4708

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. No replay-validation duplicate found. Related: #4662 touches GameInput's force-feedback API. The merged input-routing changes #2583, #2734 and #2225 leave the replay validation path compatible.

OpenAI Codex assisted with implementation, regression tests and documentation. Claude Code contributed an independent audit and review.

**@⁠LucaruluDev** on GitHub · 2026-11-29 23:25 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3444) `LucaruluDev:fix/padtape-replay-validation` → `main` · +302 −51 · 1 files · 3 commits · open ## What it changes Validate the entire `VICTORY_INPUT_REPLAY` tape before applying any pad state. Skip blank lines. Accept complete hexadecimal pad states and explicit disconnect rows for slots 0–3, plus standalone `wait` directives. Wrong field counts, invalid hexadecimal, out-of-range slots, unreadable files and tapes with no steps reject the replay. The diagnostic reports the path and reason once, with the first invalid line number for a format error. When replay is rejected, live input remains available and recording is disabled for that run. This protects the rejected tape when `VICTORY_INPUT_RECORD` points to it and also leaves a separate recording destination untouched. Recording still works when replay is unset. Valid recordings retain their existing format and `wait` holds the last readings until `<tape>.go` exists, then rebases subsequent timestamps. For unattended benchmarks, check for `replayed from a file: N steps` with the expected step count. A successful process exit can also come from live-input fallback. Replay covers pad state. Separately configured live keyboard and mouse routes can still contribute input. ## How it was tested - GPU and profile: N/A. Windows 11 with Rust 1.98.1, synthetic tapes and isolated temporary files. No game or physical-controller test was run. - Before: `main` silently skips malformed rows, treats an incomplete pad state as a disconnect, accepts an empty tape and can fall through to recording after a read error. These baseline behaviours were verified by inspecting the parser and initialisation path. - After: The focused tests cover whole-tape rejection, byte-for-byte preservation of both shared and separate record paths, replay precedence, normal recording and `wait/.go`. - For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A. - `cargo test` passed for the crates it touches: the focused GameInput suite passed. The full crate and workspace suites were not run on this merge. Published head `80b8bbcae0cd4836826149200b625d1201cc73ff`. Tested in the clean local merge `d94860677a0328e41e0d9d3cda3d1f14f2fffef8` with `main` at `5fabb46eaf6ed8771321787f8871051abde69b9b`: | Command | Result | | --- | --- | | `cargo test --locked -j 2 -p victory-hle --lib modules::gameinput:: -- --test-threads=2` | 108 passed, including 12 padtape tests, 0 failed, 3 ignored. The padtape child entry point is invoked by the parent tests. | | `cargo clippy --locked -j 1 -p victory-hle --all-targets --no-deps -- -D warnings` | Passed. | | `cargo clippy --workspace --all-targets --locked -j 2 -- -D warnings` | Exit 101 on both the local merge and its `main` base. | | `cargo clippy --workspace --all-targets --all-features --locked -j 2 -- -D warnings` | Exit 101 on both the local merge and its `main` base. | The PR's recorded check predates #4297 and stopped at the pre-existing unused `victory-loader::crash::unwind_copy`, since removed upstream. On the current base, the local merge reproduces the same five findings as `main` after #4635: two `too_many_arguments` in `host/font.rs`, one `manual_is_multiple_of` in `host/menu.rs`, and two `collapsible_if` in `host/panel.rs`. Both open fixes address all five. [PR check](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46323205756/job/141535886770) · [Current main check](https://github.com/trustno1-coder/VIctory-NVIDIA/actions/runs/46563306780/job/142355972539) · [#4680](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/4680) · [#4708](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/4708) ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. No replay-validation duplicate found. Related: #4662 touches GameInput's force-feedback API. The merged input-routing changes #2583, #2734 and #2225 leave the replay validation path compatible. OpenAI Codex assisted with implementation, regression tests and documentation. Claude Code contributed an independent audit and review.
Reject malformed tapes before applying any pad changes. Report the
file and reason when replay falls back to live input.

Co-authored-by: OpenAI Codex <215057067+openai-codex[bot]@users.noreply.github.com>
Keep live pad input after a replay error and skip the recorder.
A rejected tape can also be the configured recording destination.

Co-authored-by: OpenAI Codex <215057067+openai-codex[bot]@users.noreply.github.com>
Co-authored-by: OpenAI Codex <215057067+openai-codex[bot]@users.noreply.github.com>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 23:27:18 +00:00
Author
Owner

@⁠LucaruluDev on GitHub · 2026-11-30 08:38 UTC · original

I reproduced the exact CI Clippy command on both current upstream main (41adb551) and this run's merge commit (634f5de3). Both fail because -D warnings promotes the existing unused unwind_copy function in victory-loader/src/crash.rs:804 to an error. That file is identical in both trees.

A separate Clippy run scoped to victory-hle completed on both trees and reported the same existing warnings outside the padtape diff. This PR remains at 80b8bbca. The diagnostics and test steps in this CI run were skipped after Clippy failed.

**@⁠LucaruluDev** on GitHub · 2026-11-30 08:38 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3444#issuecomment-7273162621) I reproduced the exact CI Clippy command on both current upstream main (`41adb551`) and this run's merge commit (`634f5de3`). Both fail because `-D warnings` promotes the existing unused `unwind_copy` function in `victory-loader/src/crash.rs:804` to an error. That file is identical in both trees. A separate Clippy run scoped to `victory-hle` completed on both trees and reported the same existing warnings outside the padtape diff. This PR remains at `80b8bbca`. The diagnostics and test steps in this CI run were skipped after Clippy failed.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3444/head:github-bot/gh-3444'
git switch 'github-bot/gh-3444'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3444'
git switch 'github-bot/gh-3444'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3444'
git switch 'github-bot/gh-3444'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3444'
git switch 'main'
git merge --squash 'github-bot/gh-3444'
git switch 'main'
git merge --ff-only 'github-bot/gh-3444'
git switch 'main'
git merge 'github-bot/gh-3444'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!3444
No description provided.