perf(agc): read APS5_NO_QUEUED_DRAW_READ_ORDER once in the held-read check #9490
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9490"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-21T23:19:14Z.
What
DrawPipeline::HeldReadslooked upAPS5_NO_QUEUED_DRAW_READ_ORDERfor each nonempty range query. It now caches whether the option is present once per process, asWaitMemory.cppalready does for this option. The range checks and queued-read ordering remain intact.Independent Windows profiles in the earlier comments identify repeated
getenvcalls in this hot path. They motivate the change; they are not a new before/after frame-rate result.Tested
Refreshed as
29b6cc46afed2d6dadc6191986cb07ac6693eae1, one commit directly onmaine7e3e9c1984c293f06bff08428b8c89b7b932ac2, with no merge commits. The complete source file equals current main plus the original two-line lookup change.Fresh Linux qualification on AMD Radeon RX 6650 XT (RADV NAVI23), stock Mesa26.2.4, Arch Linux7.2.9, GCC/Release:
libs,relinkerand focused test builds pass for main and the change.VK_LAYER_KHRONOS_validationinsertion. The other9 are no-device regression paths.ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1and the requested layer are set for both arms; Mesa's shader cache is disabled.The earlier dirty-head trace pair remains excluded. The clean native pair below provides distinct-commit summaries/traces and digests, with no Linux speedup claim.
Download exact-head Linux builds, per-group logs/JUnit, source pins and reviewed patch. SHA-256
047c4840394a85c94ceeaf063fd0aa118c842802a37909c4f96755adf5fdb5cb.Clean native performance capture
Afterdream PPSA18391, content02.000.000, opening dialogue held after the same scripted Cross presses at20/45/70s. Same Linux machine/session, RX6650XT/RADV, 3840x2160 guest output in the same1536x864 window on DP-2. Both windows were inactive in all10 focus samples during the80-100s capture. Both scenes were run before capture to warm their private caches and restarted with empty private writable state. Converted app/module bytes are identical between arms; only current built libraries differ. Game logs stayed attached to a terminal. Only
APS5_TRACE_SECONDS=80:20and trace capacity were enabled, with no diagnostic GPU dumps/profiling and no concurrent builds.Distinct clean commits: main
e7e3e9c1984c293f06bff08428b8c89b7b932ac2and PR29b6cc46afed2d6dadc6191986cb07ac6693eae1. Both exit normally, restore configuration and report zero dropped trace events. The scene remains capped at about60FPS: p50 16.683ms on both arms, p99 16.705ms main /16.716ms change. This single pair shows no Linux FPS benefit. Estimated other-host CPU load averaged15.94% main /11.49% change, so it is not evidence of a CPU-cost improvement either. The independent Windows profiles above remain separate supporting evidence; our Windows host is user-paused.Summary lines, main then change:
Both clean traces, full
tools/trace_digest.pyoutputs, native reports, source pins and harness, SHA-25621635a6ab0611b7f58c6caa5e8954fe1393871b2523740f82c0e4f802c9de66c.Digest excerpts, main then change (full output in the archive):
seconds 80:20 from present 4759: 1199 presents, frame p50 16.7 / p90 16.7 / p99 16.7 / max 16.7 ms, GPU busy 10.6 ms per present
AMD Radeon RX 6650 XT (RADV NAVI23), radv Mesa 26.2.4-arch1.1, Linux 7.2.9-arch1-1, 3840x2160, commit
29b6cc46af, dropped: noImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T23:19:27Z.
This pull request is labeled
perf, so it needs the summary line of a capture onmainand one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste bothaps5-summary.jsonllines, attach the two traces and add the output oftools/trace_digest.py.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T23:26:00Z.
Review: CHANGES_REQUESTED
The report has useful comparative timing measurements, but it does not yet meet the repository-required evidence for a speed claim. CONTRIBUTING.md requires the
aps5-summary.jsonlsummary lines from main and the change for the same title, scene, and machine, with both traces attached and the output oftools/trace_digest.py. The PR explicitly says it has no trace pair or digest yet, and the automated report check requested those artifacts. Please add the required summaries, traces, and digest before this performance change is considered ready.Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T00:11:33Z.
@MarcZX10 Thanks, added to the description:
APS5_TRACE_SECONDS=80:20trace pairs onmain0c6a5bd59: p50 109.2/109.9 ms onmainagainst 108.2/108.0 ms with the change.trace_digest.pyheads are in the description.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T02:12:53Z.
Review: DISMISSED
The new report is much more complete: it includes same-machine Spirit of the Island traces, digests and multiple comparison pairs. Two repository-required checks are still missing. First, the shown main/change trace heads both identify
0c6a5bd59as dirty;CONTRIBUTING.mdrequires valid summary lines with different commits, and the automatedperf numbers missinglabel depends on that pair. Please capture main and this committed change from the same scene and machine with distinct commit IDs, and ensure the traces correspond to those summaries. Second, this modifies the AGC driver, so please add the same focused Vulkan tests on main and this change withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1, andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationon the same GPU, confirm the layer loaded in both logs, and compare for newVUID-lines. No local tests were run here; hosted product/relinker jobs are skipped.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T02:12:54Z.
The submitted trace archive and digest are useful. One detail blocks the required performance evidence: the displayed digest heads for both arms report commit
0c6a5bd59 (dirty), so they do not identify distinct main/change commits. Please attach a pair captured from distinct commits after the change is committed. Please also add the AGC main/change focused Vulkan validation-layer comparison described in CONTRIBUTING.md; the current report does not include those logs or layer/VUID checks.Imported from boykopovar/AnyPS5. Originally posted by SoRadGaming on 2026-10-22T14:48:26Z.
Another data point for this change, from ASTRO BOT (PPSA21564) in the Crash Site hub. Here the per-call
getenvcosts more than the 7.3 % above.Setup
main4777caca3plus local experiments (all switches identical in both arms), so this is not plainmain.libSceAgcDriver.prxdiffers. One is built withHeldReadsas onmain(per-callgetenv). The other reads the variable once into a static, the same change as this PR.Before profile: with the per-call version, a steady-state
APS5_SAMPLE_COMMITTERwindow put 16.3 % of the draw committer's samples inDrawPipeline::HeldReads, 14.8 % of them inucrtbaseunder it. Its callers wereStorageTexture::FlushPendingfromInPlaceDrawInput,CachedStorageSurface's refresh andcachedTexture's revalidation.Results: per-commit times come from the driver's own committer timer (mean of the last three 10 s windows).
getenv(main)Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T14:58:07Z.
@SoRadGaming thank you. A second title, a different GPU and a committer profile pinning the time on
getenvunderDrawPipeline::HeldReadsmake this much stronger than my single scene. I've linked your measurement from the description, noting that it's your data on a tree with local experiments in both arms, not plainmain.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-24T01:10:17Z.
Review: CHANGES_REQUESTED
The change itself looks right:
APS5_NO_QUEUED_DRAW_READ_ORDERis read once into a static inHeldReads, asWaitMemory.cppalready does, and the cost is confirmed by three independent profiles. The merge queue refused it only because @MarcZX10's CHANGES_REQUESTED is still open, and an approval from us doesn't clear another reviewer's request. Two things are left, as he asked:aps5-summary.jsonllines andtrace_digest.pyoutput, same title, scene and machine), captured after the change is committed. The pair in the description reports0c6a5bd59 (dirty)for both arms, and the one you said was pending on 2026-10-23 isn't posted yet.cfca4e5d4a: the 26/26 and 0 VUID you posted is for89e66ea537. Please post the logs for both arms showing the validation layer loaded (nowas not found but was requested by env var VK_INSTANCE_LAYERS), and theVUID-comparison.Once both are in the PR, @MarcZX10 can clear his review and this can go to the queue.