feat(libScePad): record and replay the controller states a title reads #20310

Merged
talha-devp merged 3 commits from upstream-pr/20310 into main 2026-11-16 03:10:47 +00:00
talha-devp commented 2026-11-15 01:01:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by talha-devp on 2026-11-15T01:01:25Z.


What

Adds APS5_PAD_RECORD and APS5_PAD_REPLAY to libScePad.

  • APS5_PAD_RECORD=<file> writes every change of the buttons, sticks and analog triggers the title reads from controller port 0, whatever device produced them, in milliseconds from the title's first controller read.
  • APS5_PAD_REPLAY=<file> feeds those states back at the same times from that run's first read, without a device. It replaces port 0's buttons, sticks and analog triggers at every scePadReadState and scePadRead; after the last change it keeps the last state.

The file is the line APS5_PAD_RECORDING 1, then one line per change: <ms> <buttons hex> <lx> <ly> <rx> <ry> <l2> <r2>. A record path that cannot be written, or a replay file that cannot be read or is not in this format, stops the title at its first controller read with an error naming the variable.

Why: a speed claim needs summaries of main and of the change "from the same machine and scene". A menu can be measured idle, but a gameplay scene needs the same input on every run, and nobody plays the same fight twice by hand. APS5_PAD_INPUT_FILE timelines are written by hand and are limited to 4096 events and 5 s holds. A recording is played once and replayed on every arm; the Hades II session below is 218 changes over 137 s.

Limitation: a replay follows the recorded times, not the title's frames. A run that loads more slowly, runs at another frame rate, or a title that draws different random numbers drifts from the recorded session. Two earlier replays of the same Hades II recording on different builds were about 20 s apart by the end. A state shorter than the title's read interval in the replay run can be skipped (3 of 218 below). Compare runs by scene, not by second. docs/user/INPUT_MAPPING.md says so.

Changes: PadRecording.hpp (writer, player, parser), hooks in Pad::ReadState and Pad::Read for port 0, the pad_recording and guest_pad_recording tests, docs/user/INPUT_MAPPING.md and two rows in docs/dev/ENVIRONMENT.md.

Tested

Windows 10 22H2 (19045), RTX 4060 (NVIDIA 621.14), Ryzen 5 5600, MSYS2 UCRT64 GCC 16.2.0, Release. The Hades II runs below used d675ca1458 on main ee774087d2, the feature commit of this branch before it was squashed and rebased onto 2f6d40f29b; none of the 20 newer main commits touch its files. The tests were built on this branch's head.

Tests. ctest -R "^(guest_pad_recording|pad_recording|pad_command_file)$" -V on this branch's head: 3 of 3 pass. pad_recording writes and reads back a recording (one line per change, times from the first read, CRLF accepted), replays each state at its time and holds the last one, refuses a missing header, another version, a missing or extra field, a value past 255 and out-of-order times, and stops on a missing replay file and an unwritable record path. It fails when the missing-file error is removed. guest_pad_recording replays and records through scePadReadState and scePadRead: the replayed state replaces the live and latched input on port 0 only, the change recorded at 150 ms applies after it, the record file holds each read change once, and a missing replay file or an unwritable record path stops the read. With the three ApplyRecording calls in PadState.cpp removed it fails: guest_pad_recording: a missing APS5_PAD_REPLAY file did not stop the controller read.

Hades II (PPSA36082 01.006.000). A session played by hand (main menu, then combat from about 40 s) replayed with APS5_PAD_REPLAY, APS5_NO_PAD_INPUT=1 and a fresh APS5_PAD_RECORD in the same run: tools/title_run.py --runs 1 --seconds 160, through a local wrapper that also relinks the title's own modules. It rendered with no FATAL in stderr. Presents per second over 10 s windows:

s 0–10 10–20 20–30 30–40 40–50 50–60 60–70 70–80 80–90 90–100 100–110 110–120 120–130 130–140 140–150
FPS 54.4 90.4 119.9 119.9 24.2 30.9 28.8 30.4 25.6 37.5 52.9 50.1 51.3 57.1 64.5

The menu and then the fight are reached, as in the session that was recorded.

Re-recording against the input:

  • Every one of the 214 re-recorded states is the input's state at the same time: 0 mismatches.
  • 214 of the 218 input changes were read. Delay from the recorded time: mean 17.3 ms; 41 ms or less for all but one; the worst was 359 ms, in a window with a 908 ms frame.
  • The other 4 were never read: 3 states that lasted 75, 40 and 1 ms while the title did not read its controller, and one return to the state already read before such a gap.

Unusable files. Three 40 s Hades II runs, each stopping at the first controller read with the error on stderr:

  • APS5_PAD_REPLAY naming a missing file: APS5_PAD_REPLAY: cannot read '<path>'
  • APS5_PAD_REPLAY naming a file without the header: APS5_PAD_REPLAY: '<path>' is not a recording: it needs the line 'APS5_PAD_RECORDING 1', then one line '<ms> <buttons hex> <lx> <ly> <rx> <ry> <l2> <r2>' per change in time order
  • APS5_PAD_RECORD in a missing directory: APS5_PAD_RECORD: cannot write '<path>'

python tools/check_conventions.py --base origin/main: all checks pass. python tools/pr_overlap.py --branch feat/pad-record-replay: no overlap found. It exits failed-closed because 62 open PRs that conflict with main share docs/dev/ENVIRONMENT.md, CMakeLists.txt or docs/user/INPUT_MAPPING.md and could not be compared. I checked their diffs by hand: none of them edits lines next to the ones this branch changes (the libScePad rows of ENVIRONMENT.md, the pad_command_file test lines of CMakeLists.txt, the new section of INPUT_MAPPING.md). The pr-overlap bot later flagged #17420, which adds its test block where this branch's guest_pad_recording block sat in core/libs/prx/libScePad/CMakeLists.txt. 7953d4d145 registers the recording test after the trigger effects test instead. main with both pull requests now merges in either order without a conflict, and all libScePad tests pass on that merge, including guest_pad_recording and #17420's guest_pad_vibration.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5318096860 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20310). Originally posted by [talha-devp](https://github.com/talha-devp) on 2026-11-15T01:01:25Z. --- ### What Adds `APS5_PAD_RECORD` and `APS5_PAD_REPLAY` to libScePad. - `APS5_PAD_RECORD=<file>` writes every change of the buttons, sticks and analog triggers the title reads from controller port 0, whatever device produced them, in milliseconds from the title's first controller read. - `APS5_PAD_REPLAY=<file>` feeds those states back at the same times from that run's first read, without a device. It replaces port 0's buttons, sticks and analog triggers at every `scePadReadState` and `scePadRead`; after the last change it keeps the last state. The file is the line `APS5_PAD_RECORDING 1`, then one line per change: `<ms> <buttons hex> <lx> <ly> <rx> <ry> <l2> <r2>`. A record path that cannot be written, or a replay file that cannot be read or is not in this format, stops the title at its first controller read with an error naming the variable. Why: a speed claim needs summaries of `main` and of the change "from the same machine and scene". A menu can be measured idle, but a gameplay scene needs the same input on every run, and nobody plays the same fight twice by hand. `APS5_PAD_INPUT_FILE` timelines are written by hand and are limited to 4096 events and 5 s holds. A recording is played once and replayed on every arm; the Hades II session below is 218 changes over 137 s. Limitation: a replay follows the recorded times, not the title's frames. A run that loads more slowly, runs at another frame rate, or a title that draws different random numbers drifts from the recorded session. Two earlier replays of the same Hades II recording on different builds were about 20 s apart by the end. A state shorter than the title's read interval in the replay run can be skipped (3 of 218 below). Compare runs by scene, not by second. `docs/user/INPUT_MAPPING.md` says so. Changes: `PadRecording.hpp` (writer, player, parser), hooks in `Pad::ReadState` and `Pad::Read` for port 0, the `pad_recording` and `guest_pad_recording` tests, `docs/user/INPUT_MAPPING.md` and two rows in `docs/dev/ENVIRONMENT.md`. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Windows 10 22H2 (19045), RTX 4060 (NVIDIA 621.14), Ryzen 5 5600, MSYS2 UCRT64 GCC 16.2.0, Release. The Hades II runs below used `d675ca1458` on `main` `ee774087d2`, the feature commit of this branch before it was squashed and rebased onto `2f6d40f29b`; none of the 20 newer `main` commits touch its files. The tests were built on this branch's head. **Tests.** `ctest -R "^(guest_pad_recording|pad_recording|pad_command_file)$" -V` on this branch's head: 3 of 3 pass. `pad_recording` writes and reads back a recording (one line per change, times from the first read, CRLF accepted), replays each state at its time and holds the last one, refuses a missing header, another version, a missing or extra field, a value past 255 and out-of-order times, and stops on a missing replay file and an unwritable record path. It fails when the missing-file error is removed. `guest_pad_recording` replays and records through `scePadReadState` and `scePadRead`: the replayed state replaces the live and latched input on port 0 only, the change recorded at 150 ms applies after it, the record file holds each read change once, and a missing replay file or an unwritable record path stops the read. With the three `ApplyRecording` calls in `PadState.cpp` removed it fails: `guest_pad_recording: a missing APS5_PAD_REPLAY file did not stop the controller read`. **Hades II (PPSA36082 01.006.000).** A session played by hand (main menu, then combat from about 40 s) replayed with `APS5_PAD_REPLAY`, `APS5_NO_PAD_INPUT=1` and a fresh `APS5_PAD_RECORD` in the same run: `tools/title_run.py --runs 1 --seconds 160`, through a local wrapper that also relinks the title's own modules. It rendered with no `FATAL` in stderr. Presents per second over 10 s windows: | s | 0–10 | 10–20 | 20–30 | 30–40 | 40–50 | 50–60 | 60–70 | 70–80 | 80–90 | 90–100 | 100–110 | 110–120 | 120–130 | 130–140 | 140–150 | |---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| | FPS | 54.4 | 90.4 | 119.9 | 119.9 | 24.2 | 30.9 | 28.8 | 30.4 | 25.6 | 37.5 | 52.9 | 50.1 | 51.3 | 57.1 | 64.5 | The menu and then the fight are reached, as in the session that was recorded. Re-recording against the input: - Every one of the 214 re-recorded states is the input's state at the same time: 0 mismatches. - 214 of the 218 input changes were read. Delay from the recorded time: mean 17.3 ms; 41 ms or less for all but one; the worst was 359 ms, in a window with a 908 ms frame. - The other 4 were never read: 3 states that lasted 75, 40 and 1 ms while the title did not read its controller, and one return to the state already read before such a gap. **Unusable files.** Three 40 s Hades II runs, each stopping at the first controller read with the error on stderr: - `APS5_PAD_REPLAY` naming a missing file: `APS5_PAD_REPLAY: cannot read '<path>'` - `APS5_PAD_REPLAY` naming a file without the header: `APS5_PAD_REPLAY: '<path>' is not a recording: it needs the line 'APS5_PAD_RECORDING 1', then one line '<ms> <buttons hex> <lx> <ly> <rx> <ry> <l2> <r2>' per change in time order` - `APS5_PAD_RECORD` in a missing directory: `APS5_PAD_RECORD: cannot write '<path>'` `python tools/check_conventions.py --base origin/main`: all checks pass. `python tools/pr_overlap.py --branch feat/pad-record-replay`: no overlap found. It exits failed-closed because 62 open PRs that conflict with `main` share `docs/dev/ENVIRONMENT.md`, `CMakeLists.txt` or `docs/user/INPUT_MAPPING.md` and could not be compared. I checked their diffs by hand: none of them edits lines next to the ones this branch changes (the libScePad rows of `ENVIRONMENT.md`, the `pad_command_file` test lines of `CMakeLists.txt`, the new section of `INPUT_MAPPING.md`). The pr-overlap bot later flagged #17420, which adds its test block where this branch's `guest_pad_recording` block sat in `core/libs/prx/libScePad/CMakeLists.txt`. `7953d4d145` registers the recording test after the trigger effects test instead. `main` with both pull requests now merges in either order without a conflict, and all libScePad tests pass on that merge, including `guest_pad_recording` and #17420's `guest_pad_vibration`. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
PrivacyOnion commented 2026-11-15 01:06:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T01:06:13Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 98b780e0b9:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: pad_recording_tests built cleanly.
  • CTest (pad_recording):
    1/1 Test #6: pad_recording ....................   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 1
    
  • Negative control: the tests still pass with the change reverted, so they do not cover it
  • Code reading:
    • core/libs/prx/libScePad/include/PadRecording.hpp: Verified FormatRecordedSample buffer sizing (96 bytes) and ParseRecording validation (CRLF stripping, header verification, hex/dec field conversion via std::from_chars, 8-field bounds, uint8_t stick/trigger limits, and timestamp monotonicity).
    • core/libs/prx/libScePad/include/PadRecording.hpp: Verified RecordingPlayer::At binary search semantics via std::upper_bound, confirming correct t=0 baseline handling, exact timestamp transitions, and holding the final recorded state after session end.
    • core/libs/prx/libScePad/src/PadState.cpp: Verified cross-platform environment variable querying in EnvironmentPath (_wgetenv on Windows, std::getenv on Linux) and verified that inactive paths safely no-op without mutating PadData.
    • core/libs/prx/libScePad/src/PadState.cpp: Verified ApplyRecording hooks in Pad::ReadState and Pad::Read, ensuring recording/replaying is gated strictly to port 0 and operates safely under stateMutex.
    • core/libs/prx/libScePad/tests/PadRecording.cpp & CMakeLists.txt: Verified unit test coverage for round-trip serialization, timing offsets, error handling on corrupt/missing/unwritable files, and registration in CMake with standard timeouts.
    • Repository rules (AGENTS.md): Verified zero code comments in modified C++ sources, no unnecessary files or debt fragments, and correct documentation updates in docs/dev/ENVIRONMENT.md and docs/user/INPUT_MAPPING.md.
  • Minor: please drop the Generated with footer from the description; the AI-assisted checkbox can stay.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5908339989 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20310#pullrequestreview-5908339989). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-15T01:06:13Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `98b780e0b9`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `pad_recording_tests` built cleanly. - **CTest** (`pad_recording`): ``` 1/1 Test #6: pad_recording .................... Passed 0.01 sec 100% tests passed, 0 tests failed out of 1 ``` - **Negative control**: the tests still pass with the change reverted, so they do not cover it - **Code reading**: - core/libs/prx/libScePad/include/PadRecording.hpp: Verified FormatRecordedSample buffer sizing (96 bytes) and ParseRecording validation (CRLF stripping, header verification, hex/dec field conversion via std::from_chars, 8-field bounds, uint8_t stick/trigger limits, and timestamp monotonicity). - core/libs/prx/libScePad/include/PadRecording.hpp: Verified RecordingPlayer::At binary search semantics via std::upper_bound, confirming correct t=0 baseline handling, exact timestamp transitions, and holding the final recorded state after session end. - core/libs/prx/libScePad/src/PadState.cpp: Verified cross-platform environment variable querying in EnvironmentPath (_wgetenv on Windows, std::getenv on Linux) and verified that inactive paths safely no-op without mutating PadData. - core/libs/prx/libScePad/src/PadState.cpp: Verified ApplyRecording hooks in Pad::ReadState and Pad::Read, ensuring recording/replaying is gated strictly to port 0 and operates safely under stateMutex. - core/libs/prx/libScePad/tests/PadRecording.cpp & CMakeLists.txt: Verified unit test coverage for round-trip serialization, timing offsets, error handling on corrupt/missing/unwritable files, and registration in CMake with standard timeouts. - Repository rules (AGENTS.md): Verified zero code comments in modified C++ sources, no unnecessary files or debt fragments, and correct documentation updates in docs/dev/ENVIRONMENT.md and docs/user/INPUT_MAPPING.md. - Minor: please drop the `Generated with` footer from the description; the AI-assisted checkbox can stay. Requesting changes for the points above.
MarcZX10 commented 2026-11-15 01:13:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T01:13:41Z.

Review: COMMENTED


Reviewed — no blocking findings

The changed code is internally consistent on static review, but I did not run the checks, so I cannot make a formal approval decision.

What I ran

Reviewed head 98b780e0b9095044c8fb020ae86c1f6be6e1f793 using repo_read.py through the review reader. No commands or tests were run. No merged-preview check was performed. The author reports unit and Hades II runs in the PR description; I did not verify those results.

Results

Check Result Note
Changed code review passed All changed files read
Unit tests not run Author reports two tests passed
Runtime replay not run Author reports a Hades II run
Negative control not run Author reports removing an error makes a test fail

Negative control

Not run by me. The author reports that the missing-file test fails when its error is removed.

Findings

Blocking

None.

Non-blocking

None.

Sources

Not verified

I read all six changed files listed in the manifest: CMakeLists.txt, core/libs/prx/libScePad/include/PadRecording.hpp, core/libs/prx/libScePad/src/PadState.cpp, core/libs/prx/libScePad/tests/PadRecording.cpp, docs/dev/ENVIRONMENT.md, and docs/user/INPUT_MAPPING.md. The prepared file listing showed all six included and no excluded changed files. I did not run tests, inspect author-provided traces, or verify physical-console behavior.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5908366002 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20310#pullrequestreview-5908366002). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-15T01:13:41Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The changed code is internally consistent on static review, but I did not run the checks, so I cannot make a formal approval decision. ## What I ran Reviewed head `98b780e0b9095044c8fb020ae86c1f6be6e1f793` using `repo_read.py` through the review reader. No commands or tests were run. No merged-preview check was performed. The author reports unit and Hades II runs in the PR description; I did not verify those results. ## Results | Check | Result | Note | |---|---|---| | Changed code review | passed | All changed files read | | Unit tests | not run | Author reports two tests passed | | Runtime replay | not run | Author reports a Hades II run | | Negative control | not run | Author reports removing an error makes a test fail | ## Negative control Not run by me. The author reports that the missing-file test fails when its error is removed. ## Findings ### Blocking None. ### Non-blocking None. ## Sources - [PadRecording.hpp at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/98b780e0b9095044c8fb020ae86c1f6be6e1f793/core/libs/prx/libScePad/include/PadRecording.hpp#L43-L146) — parses recording files and implements recording and replay timing. - [PadState.cpp at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/98b780e0b9095044c8fb020ae86c1f6be6e1f793/core/libs/prx/libScePad/src/PadState.cpp#L326-L405) — applies recording and replay on port 0 reads. ## Not verified I read all six changed files listed in the manifest: `CMakeLists.txt`, `core/libs/prx/libScePad/include/PadRecording.hpp`, `core/libs/prx/libScePad/src/PadState.cpp`, `core/libs/prx/libScePad/tests/PadRecording.cpp`, `docs/dev/ENVIRONMENT.md`, and `docs/user/INPUT_MAPPING.md`. The prepared file listing showed all six included and no excluded changed files. I did not run tests, inspect author-provided traces, or verify physical-console behavior. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-15 04:19:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T04:19:49Z.

Review: APPROVED


Reviewed — looks good

The recording and replay paths are implemented consistently with the documented port 0 behavior, and the inspected code supports merging.

What I ran

Reviewed head fbad8a40d087170bd7e1c0597ddcdb8c26f3be12 using the prepared diff and pinned repository reader (repo_read.py). No commands or tests were run.

Results

Check Result Note
Diff and changed code passed Inspected all changed lines
Tests not run Author-reported runs only

Findings

Blocking

None.

Non-blocking

None.

Not verified

The reported CTest, Hades II, conventions, and overlap checks were not run by this review. All changed files listed in the manifest were read; none were excluded.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5908996129 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20310#pullrequestreview-5908996129). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-15T04:19:49Z. **Review:** APPROVED --- # Reviewed — looks good The recording and replay paths are implemented consistently with the documented port 0 behavior, and the inspected code supports merging. ## What I ran Reviewed head `fbad8a40d087170bd7e1c0597ddcdb8c26f3be12` using the prepared diff and pinned repository reader (`repo_read.py`). No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Diff and changed code | passed | Inspected all changed lines | | Tests | not run | Author-reported runs only | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The reported CTest, Hades II, conventions, and overlap checks were not run by this review. All changed files listed in the manifest were read; none were excluded. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-15 17:37:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T17:37:04Z.

Review: COMMENTED


Reviewed — no blocking findings

The PR contents could not be inspected because the repository reader and review-folder tools are unavailable in this session; no merge recommendation is justified.

What I ran

Not run. No reader command could be run in this session.

Results

Check Result Note
Review of PR diff not run Review data unavailable

Findings

Blocking

None verified.

Non-blocking

None.

Not verified

Description, commits, diff, manifest, changed file contents, and repository context were not read. No tests or checks were run. Files read: none. Files reviewed: none.

To get this to a good state

Provide access to the prepared review data and pinned-head reader so the change can be reviewed.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5911969905 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20310#pullrequestreview-5911969905). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-15T17:37:04Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The PR contents could not be inspected because the repository reader and review-folder tools are unavailable in this session; no merge recommendation is justified. ## What I ran Not run. No reader command could be run in this session. ## Results | Check | Result | Note | |---|---|---| | Review of PR diff | not run | Review data unavailable | ## Findings ### Blocking None verified. ### Non-blocking None. ## Not verified Description, commits, diff, manifest, changed file contents, and repository context were not read. No tests or checks were run. Files read: none. Files reviewed: none. ## To get this to a good state Provide access to the prepared review data and pinned-head reader so the change can be reviewed.
PrivacyOnion commented 2026-11-15 21:00:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T21:00:35Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 7953d4d145:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_pad_recording_tests, pad_recording_tests built cleanly.
  • CTest (pad_recording, guest_pad_recording):
    1/2 Test    #6: pad_recording ....................   Passed    0.03 sec
    2/2 Test #4431: guest_pad_recording ..............   Passed    0.33 sec
    100% tests passed, 0 tests failed out of 2
    
  • Negative control: with core/libs/prx/libScePad/src/PadState.cpp reverted to main and the new tests kept, the suite fails:
    1/2 Test    #6: pad_recording ....................   Passed    0.02 sec
    2/2 Test #4431: guest_pad_recording ..............***Failed    0.03 sec
    50% tests passed, 1 tests failed out of 2
    
    Restoring the change makes it pass again.
  • Code reading:
    • Verified core/libs/prx/libScePad/include/PadRecording.hpp FormatRecordedSample and ParseRecording for buffer bounds (96 bytes suffices for max uint64_t decimal + uint32_t hex + 6 uint8_t decimals), strict field range validation (buttons <= 0xffffffffu, sticks/triggers <= 255u), non-decreasing timestamp ordering, and trailing character rejection.
    • Verified RecordingWriter and RecordingPlayer in core/libs/prx/libScePad/include/PadRecording.hpp for file open/write/read error handling, proper std::runtime_error messages naming APS5_PAD_RECORD and APS5_PAD_REPLAY, initial startUs capture, state deduplication on write, and std::upper_bound lookup on replay.
    • Verified ApplyRecording, Pad::ReadState, and Pad::Read in core/libs/prx/libScePad/src/PadState.cpp for thread safety under the existing state mutex, port 0 and !withdrawn gating, and cross-platform environment variable retrieval via _wgetenv on Windows and std::getenv on POSIX.
    • Verified CMakeLists.txt and core/libs/prx/libScePad/CMakeLists.txt test registration for pad_recording_tests and guest_pad_recording_tests, plus documentation updates in docs/dev/ENVIRONMENT.md and docs/user/INPUT_MAPPING.md.
    • Checked AGENTS.md compliance, LP64/LLP64 type portability (explicit unsigned long long cast in snprintf, std::uint64_t/std::uint32_t/std::uint8_t types), and confirmed all mechanical gates and CTest suites pass.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5912911665 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20310#pullrequestreview-5912911665). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-15T21:00:35Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `7953d4d145`: - **Conventions**: `tools/check_conventions.py` passed; `git diff --check` clean. - **Build**: `guest_pad_recording_tests`, `pad_recording_tests` built cleanly. - **CTest** (`pad_recording`, `guest_pad_recording`): ``` 1/2 Test #6: pad_recording .................... Passed 0.03 sec 2/2 Test #4431: guest_pad_recording .............. Passed 0.33 sec 100% tests passed, 0 tests failed out of 2 ``` - **Negative control**: with `core/libs/prx/libScePad/src/PadState.cpp` reverted to `main` and the new tests kept, the suite fails: ``` 1/2 Test #6: pad_recording .................... Passed 0.02 sec 2/2 Test #4431: guest_pad_recording ..............***Failed 0.03 sec 50% tests passed, 1 tests failed out of 2 ``` Restoring the change makes it pass again. - **Code reading**: - Verified core/libs/prx/libScePad/include/PadRecording.hpp FormatRecordedSample and ParseRecording for buffer bounds (96 bytes suffices for max uint64_t decimal + uint32_t hex + 6 uint8_t decimals), strict field range validation (buttons <= 0xffffffffu, sticks/triggers <= 255u), non-decreasing timestamp ordering, and trailing character rejection. - Verified RecordingWriter and RecordingPlayer in core/libs/prx/libScePad/include/PadRecording.hpp for file open/write/read error handling, proper std::runtime_error messages naming APS5_PAD_RECORD and APS5_PAD_REPLAY, initial startUs capture, state deduplication on write, and std::upper_bound lookup on replay. - Verified ApplyRecording, Pad::ReadState, and Pad::Read in core/libs/prx/libScePad/src/PadState.cpp for thread safety under the existing state mutex, port 0 and !withdrawn gating, and cross-platform environment variable retrieval via _wgetenv on Windows and std::getenv on POSIX. - Verified CMakeLists.txt and core/libs/prx/libScePad/CMakeLists.txt test registration for pad_recording_tests and guest_pad_recording_tests, plus documentation updates in docs/dev/ENVIRONMENT.md and docs/user/INPUT_MAPPING.md. - Checked AGENTS.md compliance, LP64/LLP64 type portability (explicit unsigned long long cast in snprintf, std::uint64_t/std::uint32_t/std::uint8_t types), and confirmed all mechanical gates and CTest suites pass. Looks Good To Me
MarcZX10 commented 2026-11-16 01:18:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T01:18:36Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; I reviewed all changed files included in the bundle, and no verified blocking defect was found.

What I ran

Reviewed head 3236022daa752fbffe79196e1b206b9e7cf545b5 using the prepared diff and repository reader. No tests or builds were run.

Results

Check Result Note
Changed files passed All 8 included files read
Tests and build not run No local execution available
Excluded files not applicable None listed

Findings

Blocking

None.

Non-blocking

None.

Not verified

The reported test runs and Windows Hades II behavior were supplied in the PR description and were not independently run. The reviewed files were CMakeLists.txt, core/libs/prx/libScePad/CMakeLists.txt, core/libs/prx/libScePad/include/PadRecording.hpp, core/libs/prx/libScePad/src/PadState.cpp, core/libs/prx/libScePad/tests/PadRecording.cpp, core/libs/tests/GuestPadRecording.cpp, docs/dev/ENVIRONMENT.md, and docs/user/INPUT_MAPPING.md. No changed files were excluded by the bundle manifest.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5914005653 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20310#pullrequestreview-5914005653). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-16T01:18:36Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; I reviewed all changed files included in the bundle, and no verified blocking defect was found. ## What I ran Reviewed head `3236022daa752fbffe79196e1b206b9e7cf545b5` using the prepared diff and repository reader. No tests or builds were run. ## Results | Check | Result | Note | |---|---|---| | Changed files | passed | All 8 included files read | | Tests and build | not run | No local execution available | | Excluded files | not applicable | None listed | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The reported test runs and Windows Hades II behavior were supplied in the PR description and were not independently run. The reviewed files were `CMakeLists.txt`, `core/libs/prx/libScePad/CMakeLists.txt`, `core/libs/prx/libScePad/include/PadRecording.hpp`, `core/libs/prx/libScePad/src/PadState.cpp`, `core/libs/prx/libScePad/tests/PadRecording.cpp`, `core/libs/tests/GuestPadRecording.cpp`, `docs/dev/ENVIRONMENT.md`, and `docs/user/INPUT_MAPPING.md`. No changed files were excluded by the bundle manifest. ## To get this to a good state Nothing is required.
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
boykopovar/AnyPS5!20310
No description provided.