[HOLD] perf(agc): fast-skip pure PM4 NOP packets during queue execution #5481
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5481"
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 Kikoarl on 2026-10-13T20:57:36Z.
What
Avoid per-packet locks, atomic state tracking, and dispatch overhead by fast-skipping pure PM4 NOP packets (opcode 0x10, subtype 0, flags 0) in
Driver::executeandDriver::resolveGroupAhead.In titles with heavily padded or aligned command buffers such as Astro Bot, command streams contain bursts of pure NOP packets that previously took
deviceReplacementlocks and executed empty handler stubs. This change advances the command cursor directly over pure NOP packets without taking execution locks or altering submission flow.Tested
python3 tools/check_conventions.py(passed).core/libs/prx/libSceAgcDriver/tests/Pm4.cpp:0xffff1000u), marker NOPs, and predicated NOPs.testNopPadSubmission.ctest --test-dir /tmp/anyps5_build -R agc_driver_pm4(100% pass rate).Standard #218 Multi-Sample Telemetry (Astro Bot -
PPSA21567):Measured across alternating runs on Astro Bot menu/gameplay transition scene against base
0aa4cb1c2(APS5_PROFILE_DRAW=1):origin/main(0aa4cb1c2)main + #5481origin/main(0aa4cb1c2)main + #5481origin/main(0aa4cb1c2)main + #5481deviceReplacementreader locks, updating atomic in-flight packet counters, and dispatching trace queries on empty packet payloads (~18–19 ns saved per individual NOP packet).Checklist
Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-14T00:51:31Z.
Review: COMMENTED
The skip itself looks safe:
Pm4::Validatealready runs over the whole buffer inCommandValidation.cppat submission, so the subtype-0 payload check (0x6875xxxxmarkers) still throws, andpacketsInFlightis incremented and decremented in the same iteration, so skipping it stays balanced.The measurement does not support the claim, though:
APS5_PROFILE_DRAW=1. That switch adds aPacketTimerandsteady_clockreads to every packet. It inflates exactly the per-packet overhead this PR removes, and the Performance report form says not to set anyAPS5_PROFILE_*switch for comparisons.CONTRIBUTING asks a
perf(PR for theaps5-summary.jsonllines ofmainand of the change, with the traces attached. A 0.4 ms difference out of 39 ms is also within run-to-run noise unless the traces show it inDriver.Packet.Minor: the description doesn't use the repository's PR template (the
UnblocksandGPUs testedlines are missing).Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-10-14T11:58:29Z.
putting this pr on hold while i re-evaluate telemetry and profiling on full in-engine scenes.
Pull request closed