fix(tools): avoid zeroing unlisted GPU program timings #13417

Merged
dr-hoseyn merged 2 commits from upstream-pr/13417 into main 2026-11-04 20:00:42 +00:00
dr-hoseyn commented 2026-10-30 14:08:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by dr-hoseyn on 2026-10-30T14:08:18Z.


What

The GPU timing report prints at most twelve program keys. When a requested key is absent from a full list, its time is unknown, but ab_split previously counted it as zero and produced a misleading phase comparison. Omit the phase metric when any report has an ambiguous full list, while preserving zero when the list is shorter. Document this behavior and test full and short lists.

Tested

Windows 11, Python 3.10: python tools/tests/test_ab_split.py (15 tests passed); git diff --check; python tools/check_conventions.py --base origin/main. No title, GPU or C++ build tested.

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: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5085697387 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13417). Originally posted by [dr-hoseyn](https://github.com/dr-hoseyn) on 2026-10-30T14:08:18Z. --- ### What The GPU timing report prints at most twelve program keys. When a requested key is absent from a full list, its time is unknown, but ab_split previously counted it as zero and produced a misleading phase comparison. Omit the phase metric when any report has an ambiguous full list, while preserving zero when the list is shorter. Document this behavior and test full and short lists. ### Tested Windows 11, Python 3.10: python tools/tests/test_ab_split.py (15 tests passed); git diff --check; python tools/check_conventions.py --base origin/main. No title, GPU or C++ build 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. --> ### 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) - [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 <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
malekaifa commented 2026-10-30 18:45:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by malekaifa on 2026-10-30T18:45:05Z.

Review: APPROVED


Reviewed exact head 859281675bf1d4aad78f035d869a89c026f4f97d independently on Windows 11 / Python 3.12.

The current head closes both correctness gaps in this PR, including the mixed draw/program top-list case raised on the previous head.

Independent red/green evidence:

  • current-main production + the new regressions: FAIL. An absent requested program is still emitted as 0.0 ms/present, and the draw-slot test has no programs_truncated state;
  • immediately previous PR production (HEAD^) + the draw-slot regression: FAIL because draw entries are not counted toward the 12-slot limit;
  • exact current head: full tools/tests/test_ab_split.py 16/16 PASS.

The previous-head failure is specifically report["programs_truncated"] == False for the mixed draw/program 12-entry list, so the new (?:draw )? count kills the reviewer-reported wrong implementation rather than only adding nominal coverage.

Additional checks: py_compile PASS; conventions PASS; git diff --check PASS; no newer-main changes to tools/ab_split.py or tools/tests/test_ab_split.py; merge-tree against current main has no textual conflicts. No title/GPU/C++ execution claimed.

AI-assisted review.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5717134162 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/13417#pullrequestreview-5717134162). Originally posted by [malekaifa](https://github.com/malekaifa) on 2026-10-30T18:45:05Z. **Review:** APPROVED --- Reviewed exact head `859281675bf1d4aad78f035d869a89c026f4f97d` independently on Windows 11 / Python 3.12. The current head closes both correctness gaps in this PR, including the mixed draw/program top-list case raised on the previous head. Independent red/green evidence: - current-main production + the new regressions: FAIL. An absent requested program is still emitted as `0.0 ms/present`, and the draw-slot test has no `programs_truncated` state; - immediately previous PR production (`HEAD^`) + the draw-slot regression: FAIL because draw entries are not counted toward the 12-slot limit; - exact current head: full `tools/tests/test_ab_split.py` 16/16 PASS. The previous-head failure is specifically `report["programs_truncated"] == False` for the mixed draw/program 12-entry list, so the new `(?:draw )?` count kills the reviewer-reported wrong implementation rather than only adding nominal coverage. Additional checks: `py_compile` PASS; conventions PASS; `git diff --check` PASS; no newer-main changes to `tools/ab_split.py` or `tools/tests/test_ab_split.py`; merge-tree against current main has no textual conflicts. No title/GPU/C++ execution claimed. AI-assisted review.
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!13417
No description provided.