feat(tools): compare the graphics track between two summaries #18955

Merged
Ethan-Hainline merged 2 commits from upstream-pr/18955 into main 2026-11-13 07:06:41 +00:00
Ethan-Hainline commented 2026-11-12 16:05:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Ethan-Hainline on 2026-11-12T16:05:12Z.


What

tools/performance_compare.py now compares the graphics_track object that #18948 adds to aps5-summary.jsonl, so an A/B run can show whether a change moved the draw-path overhead in the direction it claims.

  • Validates graphics_track as a map of names to non-negative integers (summaries without it stay valid).
  • Compares these per present rates, using each capture's own present count: render passes, continued draws, barriers, merged barriers, copies, and copy MiB.
  • Prints a Graphics track (per present) table; a capture without the track shows n/a and its change is unavailable, and a note says a missing track is unknown, not zero.

When neither capture has a track, no table or note is added; the JSON output still carries a graphics_track object with null rates.

Tested

  • python -m unittest tools.tests.test_performance_compare: 40 tests pass, including:
    • per-present rates across different present counts (2.000 to 3.000 passes, 1.0 to 0.5 copy MiB);
    • a missing track stays unknown rather than zero;
    • a negative or non-integer value is rejected.
  • python tools/check_conventions.py --base upstream/main passes.

Depends on #18948 for the field itself; the n/a path keeps this safe to land in either order.

Checklist

  • Based on current main; one topic per PR
  • Depends on: #18948 (reads an optional field it adds)
  • Fixes: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5280801754 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18955). Originally posted by [Ethan-Hainline](https://github.com/Ethan-Hainline) on 2026-11-12T16:05:12Z. --- ### What `tools/performance_compare.py` now compares the `graphics_track` object that #18948 adds to `aps5-summary.jsonl`, so an A/B run can show whether a change moved the draw-path overhead in the direction it claims. - Validates `graphics_track` as a map of names to non-negative integers (summaries without it stay valid). - Compares these **per present** rates, using each capture's own present count: render passes, continued draws, barriers, merged barriers, copies, and copy MiB. - Prints a `Graphics track (per present)` table; a capture without the track shows `n/a` and its change is unavailable, and a note says a missing track is unknown, not zero. When neither capture has a track, no table or note is added; the JSON output still carries a `graphics_track` object with null rates. ### Tested - `python -m unittest tools.tests.test_performance_compare`: **40 tests pass**, including: - per-present rates across different present counts (`2.000` to `3.000` passes, `1.0` to `0.5` copy MiB); - a missing track stays unknown rather than zero; - a negative or non-integer value is rejected. - `python tools/check_conventions.py --base upstream/main` passes. Depends on #18948 for the field itself; the `n/a` path keeps this safe to land in either order. ### Checklist - [x] Based on current `main`; one topic per PR - [x] Depends on: #18948 (reads an optional field it adds) - [x] Fixes: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-12 16:11:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-12T16:11:06Z.

Review: COMMENTED


Reviewed the graphics track comparison — no blocking findings

Nothing blocks this; the points below are optional.

The head 4f5e185afd adds the graphics-track table to tools/performance_compare.py and its tests. The per-present arithmetic matches the test fixture, and I found no blocking defect.

What I ran

  • Head SHA: 4f5e185afd
  • Read the changed code at head with the repository reader, and the review folder files (description, commits, manifest, diff).
  • No test runner was available in this run. No builds, no tests executed.
Commands
python3 repo_read.py cat tools/performance_compare.py 1 280
python3 repo_read.py cat tools/performance_compare.py 200 280
python3 repo_read.py cat tools/tests/test_performance_compare.py 17 40
python3 repo_read.py search graphics_track
python3 repo_read.py search SUMMARY tools/tests/test_performance_compare.py
python3 repo_read.py search Graphics.RenderPass
python3 repo_read.py search BarrierMerged

The first cat returned lines 1–200 only (the reader's per-call limit); lines 200–280 came from the second call.

Results

Check Result Note
Changed code read at head passed tools/performance_compare.py, lines 1–280
Per-present arithmetic in tests passed Checked by hand against the fixture (presents is 4)
Unit tests (author says 40 pass) not run Author-reported; not run here
tools/check_conventions.py not run Author-reported; not run here

Findings

Blocking

None.

Non-blocking

  • tools/performance_compare.py:190 adds a note to every comparison, and tools/performance_compare.py:210 adds a graphics_track key to the JSON output, even when neither capture has a track. The description says "No effect on comparisons of older summaries beyond the new table being absent." That is not quite right: older summaries now get an extra note bullet and, in JSON, a graphics_track object with null values. Either the description should say so, or the note should be shown only when a track is present.
  • tools/tests/test_performance_compare.py:614 and tools/tests/test_performance_compare.py:616 assert only render_passes and copy_mib. The barrier, merged-barrier, copy and continued-draw sums (tools/performance_compare.py:148, tools/performance_compare.py:150, tools/performance_compare.py:151, tools/performance_compare.py:152) have no assertion. The prefix match that keeps Graphics.Barrier. from counting Graphics.BarrierMerged. is untested too. The fixture already has both names, so a few more assertions would cover it. For barriers the expected values are 20.000 and 30.000 per present.

Sources

Not verified

  • The 40-test run and tools/check_conventions.py are author-reported. I did not run them.
  • The field itself comes from #18948, which is not in this tree. Only Graphics.RenderPass was found as a literal at head. I searched for BarrierMerged and found it only in this PR's files. I did not check that the producer emits Graphics.Barrier.*, Graphics.Copy, Graphics.Copy.bytes or Graphics.RenderPass.Continued.
  • tools/tests/test_performance_compare.py was read only in its added hunk (from diff.patch) and in the head fixture at lines 17–40. The rest of the file was not read.

To get this to a good state

Nothing is required. The non-blocking points above are optional.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5877860540 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18955#pullrequestreview-5877860540). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-12T16:11:06Z. **Review:** COMMENTED --- # Reviewed the graphics track comparison — no blocking findings Nothing blocks this; the points below are optional. The head 4f5e185afd25ebadcd40ff44a49413ce7effd34c adds the graphics-track table to `tools/performance_compare.py` and its tests. The per-present arithmetic matches the test fixture, and I found no blocking defect. ## What I ran - Head SHA: 4f5e185afd25ebadcd40ff44a49413ce7effd34c - Read the changed code at head with the repository reader, and the review folder files (description, commits, manifest, diff). - No test runner was available in this run. No builds, no tests executed. <details> <summary>Commands</summary> ``` python3 repo_read.py cat tools/performance_compare.py 1 280 python3 repo_read.py cat tools/performance_compare.py 200 280 python3 repo_read.py cat tools/tests/test_performance_compare.py 17 40 python3 repo_read.py search graphics_track python3 repo_read.py search SUMMARY tools/tests/test_performance_compare.py python3 repo_read.py search Graphics.RenderPass python3 repo_read.py search BarrierMerged ``` The first `cat` returned lines 1–200 only (the reader's per-call limit); lines 200–280 came from the second call. </details> ## Results | Check | Result | Note | | --- | --- | --- | | Changed code read at head | passed | `tools/performance_compare.py`, lines 1–280 | | Per-present arithmetic in tests | passed | Checked by hand against the fixture (`presents` is 4) | | Unit tests (author says 40 pass) | not run | Author-reported; not run here | | `tools/check_conventions.py` | not run | Author-reported; not run here | ## Findings ### Blocking None. ### Non-blocking - `tools/performance_compare.py:190` adds a note to every comparison, and `tools/performance_compare.py:210` adds a `graphics_track` key to the JSON output, even when neither capture has a track. The description says "No effect on comparisons of older summaries beyond the new table being absent." That is not quite right: older summaries now get an extra note bullet and, in JSON, a `graphics_track` object with null values. Either the description should say so, or the note should be shown only when a track is present. - `tools/tests/test_performance_compare.py:614` and `tools/tests/test_performance_compare.py:616` assert only `render_passes` and `copy_mib`. The barrier, merged-barrier, copy and continued-draw sums (`tools/performance_compare.py:148`, `tools/performance_compare.py:150`, `tools/performance_compare.py:151`, `tools/performance_compare.py:152`) have no assertion. The prefix match that keeps `Graphics.Barrier.` from counting `Graphics.BarrierMerged.` is untested too. The fixture already has both names, so a few more assertions would cover it. For `barriers` the expected values are 20.000 and 30.000 per present. ## Sources - [performance_compare.py, note and JSON key](https://github.com/boykopovar/AnyPS5/blob/4f5e185afd25ebadcd40ff44a49413ce7effd34c/tools/performance_compare.py#L190-L210) - [test fixture](https://github.com/boykopovar/AnyPS5/blob/4f5e185afd25ebadcd40ff44a49413ce7effd34c/tools/tests/test_performance_compare.py#L17-L25) - [render pass scope in the trace header](https://github.com/boykopovar/AnyPS5/blob/4f5e185afd25ebadcd40ff44a49413ce7effd34c/core/libs/prx/libSceAgcDriver/Execution/include/PerformanceTrace.hpp#L874) ## Not verified - The 40-test run and `tools/check_conventions.py` are author-reported. I did not run them. - The field itself comes from #18948, which is not in this tree. Only `Graphics.RenderPass` was found as a literal at head. I searched for `BarrierMerged` and found it only in this PR's files. I did not check that the producer emits `Graphics.Barrier.*`, `Graphics.Copy`, `Graphics.Copy.bytes` or `Graphics.RenderPass.Continued`. - `tools/tests/test_performance_compare.py` was read only in its added hunk (from `diff.patch`) and in the head fixture at lines 17–40. The rest of the file was not read. ## To get this to a good state Nothing is required. The non-blocking points above are optional.
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!18955
No description provided.