fix(tools): count skipped frame replay bytes exactly #28844

Open
JJenkx wants to merge 1 commit from upstream-pr/28844 into main
JJenkx commented 2026-12-04 04:12:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-12-04T04:12:50Z.


What

Replay results now include the exact number of skipped bytes. A single skipped 4 KiB page rounds to 0.0 in the older skipped_mib field, so some incomplete runs could count as healthy. The report checks the exact count in new results and saved assessments. It retains the rounded field for older results.

Tested

  • Plyxen independently applied the diff to main 63b98e5bf8 on Windows 11. The Release replay tool built with no format warning, three replay CTests and 64 Python cases passed, and reverting the reporter reproduced the exact-count failures. The native CTests exercised the replay executable. Plyxen's test report

  • Baejoe ran both focused Python suites on Windows 11 x64 (MSYS2 UCRT64 Python 3.14.10) at 68697da8fa8f. All 42 tests passed, including the three Windows-only cases. In two saved bundles, exact zero stayed healthy and 4,096 skipped bytes were flagged by the PR reporter. Both reporters left the saved inputs unchanged. Baejoe's test report

  • Linux x86_64 Release build of agc_frame_replay.

  • The focused Python replay suite passed 39 tests with 3 skipped. Coverage includes a skipped 4 KiB page, a saved assessment with a skipped page, exact zero, legacy results and invalid exact counts.

  • Conventions check against e3cd13806921 passed.

Checklist

  • Based on current main and checked for overlapping open PRs
  • One topic per PR
  • Code follows the comment conventions
  • Unimplemented paths retain their existing behavior
  • No investigation files or images added
  • Third-party dependencies unchanged
  • Generic behavior
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a (replay diagnostics and report eligibility)
  • AI-assisted: yes

Summary by CodeRabbit

  • New Features
    • Replay summaries now include the exact number of skipped bytes alongside the existing MiB value.
  • Bug Fixes
    • Skipped-memory issues are consistently flagged in replay results and comparison reports, including results with exact byte counts.
  • Documentation
    • Clarified how reports handle exact skipped-byte counts and legacy results that only include rounded MiB values.
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5640065653 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28844). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-12-04T04:12:50Z. --- ### What Replay results now include the exact number of skipped bytes. A single skipped 4 KiB page rounds to `0.0` in the older `skipped_mib` field, so some incomplete runs could count as healthy. The report checks the exact count in new results and saved assessments. It retains the rounded field for older results. ### Tested - Plyxen independently applied the diff to `main` `63b98e5bf8` on Windows 11. The Release replay tool built with no format warning, three replay CTests and 64 Python cases passed, and reverting the reporter reproduced the exact-count failures. The native CTests exercised the replay executable. [Plyxen's test report](https://github.com/boykopovar/AnyPS5/pull/28844#pullrequestreview-6188795607) - Baejoe ran both focused Python suites on Windows 11 x64 (MSYS2 UCRT64 Python 3.14.10) at `68697da8fa8f`. All 42 tests passed, including the three Windows-only cases. In two saved bundles, exact zero stayed healthy and 4,096 skipped bytes were flagged by the PR reporter. Both reporters left the saved inputs unchanged. [Baejoe's test report](https://github.com/boykopovar/AnyPS5/pull/28844#issuecomment-7402881937) - Linux x86_64 Release build of `agc_frame_replay`. - The focused Python replay suite passed 39 tests with 3 skipped. Coverage includes a skipped 4 KiB page, a saved assessment with a skipped page, exact zero, legacy results and invalid exact counts. - Conventions check against `e3cd13806921` passed. ### Checklist - [x] Based on current `main` and checked for overlapping open PRs - [x] One topic per PR - [x] Code follows the comment conventions - [x] Unimplemented paths retain their existing behavior - [x] No investigation files or images added - [x] Third-party dependencies unchanged - [x] Generic behavior - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a (replay diagnostics and report eligibility) - [x] AI-assisted: yes <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Replay summaries now include the exact number of skipped bytes alongside the existing MiB value. * **Bug Fixes** * Skipped-memory issues are consistently flagged in replay results and comparison reports, including results with exact byte counts. * **Documentation** * Clarified how reports handle exact skipped-byte counts and legacy results that only include rounded MiB values. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
MarcZX10 commented 2026-12-04 05:05:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T05:05:44Z.

Review: COMMENTED


Reviewed — comments

Nothing blocks this; the points below are optional.

What I ran

Reviewed head 68697da8fa8fe295ef471668beb52ce62bed63e5 against base main (fd6e0ff2e13cb5b96092c98940231de6aa1ff9e3). No merged preview was run. I inspected the prepared diff and relevant Python and documentation ranges. The pinned reader could not read FrameReplay.cpp because it attempted to write its call log in the read-only run directory. I ran no tests or build; the test and build results in the PR description are author-reported.

Commands run:

find files -type f -maxdepth 3 -print
sed -n '1,180p' description.md
sed -n '1,180p' commits.md
cat manifest.json
cat files.json
sed -n '1,260p' diff.patch
python3 repo_read.py search '_record_skipped_memory' tools/frame_replay_report.py
python3 repo_read.py search 'skipped_bytes|skipped_mib' tools/frame_replay_report.py
sed -n '1,310p' files/tools/frame_replay_report.py
sed -n '430,510p' files/tools/frame_replay_report.py
sed -n '1,175p' files/tools/tests/test_frame_replay_report.py
sed -n '270,310p' files/docs/dev/BUILD.md

Results

Check Result Note
Diff and changed-line review passed All additions are visible in the diff.
Python and documentation context passed Relevant sections inspected.
Pinned C++ source context not run Reader logging was blocked by read-only storage.
Tests and build not run PR description reports them; I did not run them.

Negative control

Not run. I made no test changes and did not execute the reported Python suite.

Findings

Blocking

None verified in the inspected diff and Python/documentation context.

Non-blocking

None.

Sources

The parser validates skipped_bytes as a nonnegative unsigned 64-bit integer and flags a nonzero exact count or legacy skipped_mib value. Saved assessments receive the same skipped-memory check before trial health is computed. Parser at the reviewed head · Saved assessment handling

The added tests cover a skipped 4 KiB page, a saved assessment, exact zero, legacy results, and invalid exact counts. Tests at the reviewed head

Not verified

core/libs/prx/libSceAgcDriver/tools/FrameReplay.cpp was not present under files/, although the manifest marks it included, and the pinned reader could not access it because of the read-only log path. I therefore verified only the C++ JSON format and argument changes shown in the diff, not their surrounding types or callers. docs/dev/BUILD.md, tools/frame_replay_report.py, and tools/tests/test_frame_replay_report.py were inspected at the relevant changed and caller ranges; their full text was not read. files.json lists no rule-excluded files. No tests, build, hardware run, or conventions check were performed in this review.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6183645043 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28844#pullrequestreview-6183645043). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-12-04T05:05:44Z. **Review:** COMMENTED --- # Reviewed — comments Nothing blocks this; the points below are optional. ## What I ran Reviewed head `68697da8fa8fe295ef471668beb52ce62bed63e5` against base `main` (`fd6e0ff2e13cb5b96092c98940231de6aa1ff9e3`). No merged preview was run. I inspected the prepared diff and relevant Python and documentation ranges. The pinned reader could not read `FrameReplay.cpp` because it attempted to write its call log in the read-only run directory. I ran no tests or build; the test and build results in the PR description are author-reported. Commands run: ```text find files -type f -maxdepth 3 -print sed -n '1,180p' description.md sed -n '1,180p' commits.md cat manifest.json cat files.json sed -n '1,260p' diff.patch python3 repo_read.py search '_record_skipped_memory' tools/frame_replay_report.py python3 repo_read.py search 'skipped_bytes|skipped_mib' tools/frame_replay_report.py sed -n '1,310p' files/tools/frame_replay_report.py sed -n '430,510p' files/tools/frame_replay_report.py sed -n '1,175p' files/tools/tests/test_frame_replay_report.py sed -n '270,310p' files/docs/dev/BUILD.md ``` ## Results | Check | Result | Note | |---|---|---| | Diff and changed-line review | passed | All additions are visible in the diff. | | Python and documentation context | passed | Relevant sections inspected. | | Pinned C++ source context | not run | Reader logging was blocked by read-only storage. | | Tests and build | not run | PR description reports them; I did not run them. | ## Negative control Not run. I made no test changes and did not execute the reported Python suite. ## Findings ### Blocking None verified in the inspected diff and Python/documentation context. ### Non-blocking None. ## Sources The parser validates `skipped_bytes` as a nonnegative unsigned 64-bit integer and flags a nonzero exact count or legacy `skipped_mib` value. Saved assessments receive the same skipped-memory check before trial health is computed. [Parser at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/68697da8fa8fe295ef471668beb52ce62bed63e5/tools/frame_replay_report.py#L194) · [Saved assessment handling](https://github.com/boykopovar/AnyPS5/blob/68697da8fa8fe295ef471668beb52ce62bed63e5/tools/frame_replay_report.py#L457) The added tests cover a skipped 4 KiB page, a saved assessment, exact zero, legacy results, and invalid exact counts. [Tests at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/68697da8fa8fe295ef471668beb52ce62bed63e5/tools/tests/test_frame_replay_report.py#L118) ## Not verified `core/libs/prx/libSceAgcDriver/tools/FrameReplay.cpp` was not present under `files/`, although the manifest marks it included, and the pinned reader could not access it because of the read-only log path. I therefore verified only the C++ JSON format and argument changes shown in the diff, not their surrounding types or callers. `docs/dev/BUILD.md`, `tools/frame_replay_report.py`, and `tools/tests/test_frame_replay_report.py` were inspected at the relevant changed and caller ranges; their full text was not read. `files.json` lists no rule-excluded files. No tests, build, hardware run, or conventions check were performed in this review. ## To get this to a good state Nothing is required.
Plyxen commented 2026-12-04 12:20:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-04T12:20:17Z.

Review: APPROVED


Verified on Windows 11: Python 3.13.7 for the report tool, WinLibs GCC 15.2.0 r7 (Release) for agc_frame_replay. I applied the diff of 68697da8fa to main 63b98e5bf8.

  • test_frame_replay_report, test_frame_replay_compare and test_frame_capture_minimize_replay: 64 tests, OK.
  • Negative control, with only frame_replay_report.py reverted: test_exact_skipped_page_disqualifies_an_otherwise_healthy_run fails ([] != ['native replay skipped memory ranges'] for skipped_bytes=4096, skipped_mib=0.0), and so do the four invalid-count subtests of test_invalid_exact_skip_count_fails_native_result_validation.
  • agc_frame_replay builds with the new printf argument, with no format warning. agc_driver_frame_replay_submits, _shader_output and _run_report, which run the tool, pass.

Not run: Linux, a real replay with skipped ranges.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6188795607 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28844#pullrequestreview-6188795607). Originally posted by [Plyxen](https://github.com/Plyxen) on 2026-12-04T12:20:17Z. **Review:** APPROVED --- Verified on Windows 11: Python 3.13.7 for the report tool, WinLibs GCC 15.2.0 r7 (Release) for `agc_frame_replay`. I applied the diff of `68697da8fa` to `main` `63b98e5bf8`. - `test_frame_replay_report`, `test_frame_replay_compare` and `test_frame_capture_minimize_replay`: 64 tests, OK. - Negative control, with only `frame_replay_report.py` reverted: `test_exact_skipped_page_disqualifies_an_otherwise_healthy_run` fails (`[] != ['native replay skipped memory ranges']` for `skipped_bytes=4096, skipped_mib=0.0`), and so do the four invalid-count subtests of `test_invalid_exact_skip_count_fails_native_result_validation`. - `agc_frame_replay` builds with the new `printf` argument, with no format warning. `agc_driver_frame_replay_submits`, `_shader_output` and `_run_report`, which run the tool, pass. Not run: Linux, a real replay with skipped ranges. AI-assisted: yes (Claude Code)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/28844:upstream-pr/28844'
git switch 'upstream-pr/28844'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/28844'
git switch 'upstream-pr/28844'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/28844'
git switch 'upstream-pr/28844'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/28844'
git switch 'main'
git merge --squash 'upstream-pr/28844'
git switch 'main'
git merge --ff-only 'upstream-pr/28844'
git switch 'main'
git merge 'upstream-pr/28844'
git push origin 'main'
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!28844
No description provided.