feat(tools): trace_digest lists the largest GPU batches with the CPU slices that recorded them #5047

Merged
parl0v merged 1 commit from upstream-pr/5047 into main 2026-10-14 12:40:56 +00:00
parl0v commented 2026-10-13 09:35:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-13T09:35:42Z.


What

tools/trace_digest.py gains a Largest GPU batches section, built on the batch ids of #5046. For the longest batch slices of the GPU track it lists the batch's GPU ranges (command classes, with APS5_PROFILE_GPU) and the CPU slices that recorded it (same batch id, any CPU thread, inclusive ms). --json carries the same data as largest_gpu_batches. Traces without batch ids are digested as before, without the section.

Tested

  • Windows 10 19045, Python 3. tools/tests/test_trace_digest.py: 10 tests pass, including test_largest_gpu_batches_with_their_recording (order by GPU time, ranges, recording slices, present) and test_no_batch_section_without_batch_ids.
  • On a PPSA25344 main-menu trace with batch ids, the section lists the five 16 ms batches, each recorded by ~1.6 ms of Driver.Packet.dispatch on queue worker 0x0.

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
  • 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: #5046
  • Unblocks: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4841262764 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5047). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-13T09:35:42Z. --- ### What `tools/trace_digest.py` gains a **Largest GPU batches** section, built on the batch ids of #5046. For the longest `batch` slices of the GPU track it lists the batch's GPU ranges (command classes, with `APS5_PROFILE_GPU`) and the CPU slices that recorded it (same batch id, any CPU thread, inclusive ms). `--json` carries the same data as `largest_gpu_batches`. Traces without batch ids are digested as before, without the section. ### Tested - Windows 10 19045, Python 3. `tools/tests/test_trace_digest.py`: 10 tests pass, including `test_largest_gpu_batches_with_their_recording` (order by GPU time, ranges, recording slices, present) and `test_no_batch_section_without_batch_ids`. - On a PPSA25344 main-menu trace with batch ids, the section lists the five 16 ms batches, each recorded by ~1.6 ms of `Driver.Packet.dispatch` on queue worker 0x0. ### Checklist - [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) - [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: #5046 - [x] Unblocks: none - [x] AI-assisted: yes
adriadam10 commented 2026-10-14 12:11:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T12:11:09Z.


#5046 is already on main (rebased), so I dropped its commit from this branch and rebased the rest: what is left is tools/trace_digest.py and its test. test_trace_digest.py passes (17 tests) and the new case fails without the change (KeyError: 'largest_gpu_batches'); the no-batch-ids case keeps the old output. Merging once the full Build is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6168030204 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5047#issuecomment-6168030204). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T12:11:09Z. --- #5046 is already on `main` (rebased), so I dropped its commit from this branch and rebased the rest: what is left is `tools/trace_digest.py` and its test. `test_trace_digest.py` passes (17 tests) and the new case fails without the change (`KeyError: 'largest_gpu_batches'`); the no-batch-ids case keeps the old output. Merging once the full Build is green.
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!5047
No description provided.