perf(agc): draws that only store to a buffer continue one render pass #7340
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7340"
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 teepean on 2026-10-18T01:08:49Z.
What
A guest buffer the recompiler classifies as only stored to (
bufferWritten, notbufferRead, notbufferAtomic), which no other allocation of the draw overlaps, is now a write-only range of the draw (PassAccess::writeOnly). It conflicts with every read and every other write of the open render pass, but not with the write-only stores of other draws to the same range. The guest GPU leaves stores of different draws to such a buffer unordered as well, since no barrier separates them.Before, such a buffer counted as both read and written, so consecutive draws storing to it each began a new render pass with two full barriers. Unreal Engine 4 stores virtual texture feedback from every base-pass material that samples a virtual texture into one buffer per frame. In Stray (PPSA02100) this change takes the render passes begun from 33.8 % to 7.5 % of draws.
PassHazards: a write-only range conflicts with reads (read after write), with read-write uses (write after write) and with unknown reads or writes, in both directions; write-only ranges of different draws over the same bytes do not conflict.PassHazards::SealWriteOnly()(throughVulkanDevice::SealPassWriteOnlyandRecorder::SealPassWriteOnly) moves the open pass's write-only ranges into its writes, so a later write-only store to the same bytes begins a new pass. While the draw pipeline has draws in flight, the seal is queued behind them.ShaderResourcesmarks a written guest buffer allocation write-only when its binding element is stored to, neither read nor atomic, and no other allocation of the build overlaps it (WriteOnlyRanges).Draw.cpptakes those ranges out of the draw's own buffer reads and writes that it hands toPassHazards, and passes them as the draw's write-only ranges, unless the draw has unknown memory accesses. Indirect argument ranges and any other read added to the pass reads stay reads.APS5_NO_WRITE_ONLY_PASSES=1restores the previous behaviour (listed indocs/dev/ENVIRONMENT.md).agc_pass_hazards_testscovers write-only stores continuing the pass, and a read, a read-write use, unknown reads and unknown writes after them, in either order. For the seal, it checks that a write-only store over sealed write-only stores is a write after write, that write-only stores elsewhere still continue the pass, and thatClearremoves the seal.Based on
main0bc3003f8, which has #7184 (a draw that only reads through the BDA table continues its pass); the two changes share thePassAccessline ofrecordDraw. The rebase fromf1af6c591had one conflict, next to the packet counter that #6012 added afterlandPendingWaitsinPacketExecution.cpp; both lines stay. A draw with unknown memory accesses, BDA reads included, keeps its stored buffers as read and written, as before, and unknown reads conflict with write-only ranges in either order. No open PR changesPassHazards.tools/pr_overlap.pyat this head finds changed lines shared with #5431 (two lines ofDraw.cppnext to the pass hazard check), #6566 (thepassReadsline ofDraw.cpp) and #7618 (two lines ofShaderResources.cpp). #7618 stages write-only buffer elements of sweeping dispatches; it doesn't touch render passes orPassHazards. It couldn't compare 60 open PRs that share the changed files, because they conflict withmain; none of them implements write-only passes or a flush seal. #6175 adds in-place draw inputs to the pass reads; they stay reads with this change.Tested
Linux (CachyOS, kernel 7.2.10), Ryzen 9 9950X, RTX 3090 (NVIDIA 615.78.08), GCC 16.2.1, Release, 3840x2160.
agc_pass_hazards_testspasses at12d720f74(onmain0bc3003f8; the head,d840b10d2, only adds thedocs/dev/ENVIRONMENT.mdrow), and so do 721 of the 723agc_tests (ctest -R '^agc_';agc_driver_stencil_ref_exportis skipped;agc_driver_bda_deviceloses the device with an NVIDIA Xid 109 here, and does the same onmain0bc3003f8without this change, while it passed onf1af6c591(#7584, from #5859'sd422c760c; #7571 fixes it)).tools/check_conventions.py --base origin/mainpasses.mainf1af6c591.engine.ini, one run at a time withmainand this change alternating, after one warm-up run of each build. Trace summaries withAPS5_TRACE_SECONDS=185:20and no otherAPS5_TRACE_*/APS5_PROFILE_*variables; the runner redirects the log to a file. Queue worker 0's event buffer fills after 4 to 5 s in every run (trace_dropped); the totals are complete.On
mainf1af6c591with the scx_lavd scheduler, in two batches:mainagainst 95e731421 (the head before the seal, with two builds of other PRs in the same rotation), then 95e731421 against this head.mainf1af6c591, scx_lavdmainAll builds are slower on
f1af6c591than onb51c65dd1here,mainincluded. That comes from #6632's hand-off spin on this machine, not from this change: in alternating runs,mainf1af6c591took 201.0 ms with the spin and 165.8 ms withAPS5_HANDOFF_SPIN_US=0, andmainb51c65dd1167.2 ms.Earlier runs, from before the last rebase: this change at 64dd0ed1d on
mainb51c65dd1with the scx_lavd scheduler, and at 8250eec36 onmain864729dc0with the EEVDF scheduler. 95e731421 differs from 64dd0ed1d only by the rebase and by keeping the indirect argument ranges as reads.mainb51c65dd1, scx_lavdmainmain864729dc0, EEVDFmainLeft out: runs that hit the #5372 import race (about 1 fps for the whole window: one run of 95e731421 and one of this head on
f1af6c591, onemainrun onb51c65dd1, and one run of each build on864729dc0), and the warm-up runs (onf1af6c591main188.7 ms / 92.5 ms, 95e731421 175.3 / 62.0 and this head 214.1 / 70.6;main157.4 / 89.5 and this change 165.1 / 64.8 onb51c65dd1; 164.0 / 115.1 and 152.5 / 69.5 on864729dc0). Stray is CPU-bound in this scene (queue worker 0 is 97 to 98 % busy in every run), so the GPU busy time per present falls by about a third while the frame time falls by 1 to 3 %, which is close to the spread between runs.Render passes, from one more run of each with
APS5_PROFILE_DRAW=1onb51c65dd1(mean of the last 8 windows of 10 s):mainbegan a pass for 76,058 of 224,986 draws per 10 s (33.8 %), this change for 17,200 of 228,238 (7.5 %). Onf1af6c591(mean of the windows in the scene):main66,978 of 197,656 (33.9 %), 95e731421 15,990 of 212,286 (7.5 %), this head 15,688 of 206,704 (7.6 %). In this title the seal begins no extra pass: a build with counters (not part of this PR) found no write-only stores in the open pass at any of the about 54,000 seals per 10 s in the scene.Frame dumps (
APS5_DUMP_FRAMES=40 APS5_DUMP_FRAMES_EVERY=104, 960x540, 30 frames per run) from one run ofmainb51c65dd1, one of this change (64dd0ed1d) and a second one ofmain: this change and the secondmainrun differ by 0.15 per 8-bit channel on average over frames 5 to 29, and by at most 0.86 in one frame, spread over edges and lights like TAA noise. The firstmainrun reached the scene earlier, so its frames differ from both of the others by much more.Traces, summaries and digests: https://github.com/teepean/AnyPS5/releases/tag/perf-write-only-passes-20261018 (each run's trace,
aps5-summary.jsonlanddigest.md, the[draws]lines of the profiled runs, and frame 28 of the dumps with its difference image; thef1af6c591runs are insummaries-f1af.zip). Thetools/trace_digest.pyoutput, with its summary line, for the first scored run ofmainf1af6c591and for d92108270 in the second batch (the traces areaps5-trace-f1af6c591588-1386863.json.gzandaps5-trace-d92108270794-1494022.json.gzon the release):`main`
f1af6c591(run xm1)seconds 185:20 from present 2772: 105 presents, frame p50 205.5 / p90 220.7 / p99 247.1 / max 255.6 ms, GPU busy 91.9 ms per present
NVIDIA GeForce RTX 3090, NVIDIA 615.78.08, Linux 7.2.10-1-cachyos, 3840x2160, commit
f1af6c5915, dropped: yesSlowest frames (largest slices inside each, inclusive)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): Driver.Packet 218.3, Driver.Packet.memory_wait 188.1, batch 91.8, Driver.Packet.draw 24.4, Driver.Draw 24.3, Driver.Draw.shader_compile_and_link 12.0, Shader.DrawStage 7.2, Driver.Present 4.8, VideoOut.Flip 4.8, VideoOut.Flip.present 4.8
Longest waits
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
d92108270, this change before the rebase (run ss1)
seconds 185:20 from present 3322: 102 presents, frame p50 205.2 / p90 233.6 / p99 261.4 / max 272.3 ms, GPU busy 68.5 ms per present
NVIDIA GeForce RTX 3090, NVIDIA 615.78.08, Linux 7.2.10-1-cachyos, 3840x2160, commit d92108270794, dropped: yes
Slowest frames (largest slices inside each, inclusive)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): Driver.Packet 226.4, Driver.Packet.memory_wait 193.7, batch 68.4, Driver.Packet.draw 24.3, Driver.Draw 24.1, Driver.Draw.shader_compile_and_link 12.5, Shader.DrawStage 7.5, Driver.Present 5.8, VideoOut.Flip 5.8, VideoOut.Flip.present 5.7
Longest waits
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-18T01:20:44Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppL1963core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppL18core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppL592Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppdocs/dev/ENVIRONMENT.mdcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppdocs/dev/ENVIRONMENT.mdcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppdocs/dev/ENVIRONMENT.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppdocs/dev/ENVIRONMENT.mdcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppdocs/dev/ENVIRONMENT.mddocs/dev/ENVIRONMENT.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppdocs/dev/ENVIRONMENT.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppdocs/dev/ENVIRONMENT.mdcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppdocs/dev/ENVIRONMENT.mddocs/dev/ENVIRONMENT.mdcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppdocs/dev/ENVIRONMENT.mdcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppcore/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppdocs/dev/ENVIRONMENT.mdcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppdocs/dev/ENVIRONMENT.mdcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/include/VulkanDevice.hppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppdocs/dev/ENVIRONMENT.mdImported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-18T01:50:50Z.
Thanks, the tracker change itself looks right. Write-only still conflicts with reads, read-write uses and unknown accesses in both directions, and the classification leaves out atomic and read bindings and ranges shared with other allocations.
agc_pass_hazardspasses here on the merge with current main.One ordering case needs handling before this can go in. On this driver, guest sync packets never reach the recorder.
Driver::executeskips EVENT_WRITE (0x46) and ACQUIRE_MEM (0x58), and nothing ends the open render pass on them. The pass hazard tracker is the only thing that orders two draws inside one pass. So with this change: draw A stores to a buffer, the guest issues PS_PARTIAL_FLUSH (or ACQUIRE_MEM), and draw B stores to the same bytes. Today that splits the pass, because both count as read-write, and B's values win. With this change, both stay in one Vulkan pass with no barrier, and the final bytes are undefined. Without a flush between them, the GPU doesn't order the two draws either, so your case (VT feedback) is fine. It's the flushed case that changes.Could you seal the pass's write-only set when queue 0 sees a partial or cache flush EVENT_WRITE or an ACQUIRE_MEM while a pass is open? Any later write-only store to those ranges would then be a WriteAfterWrite. For example, a
PassHazards::SealWriteOnly()called from the 0x46/0x58 branch. Please add atestWriteOnlycase: Add(write-only), seal, then Check of the same write-only range returns WriteAfterWrite, and after Clear it returns None.If you have it, a pass-count or write-only-draw counter (or the frame numbers from the UE4 title) would also show how often this triggers.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-18T21:54:30Z.
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 teepean on 2026-10-18T21:56:40Z.
@oneandonlydean thanks, done in
12d720f74. The branch is rebased ontomain0bc3003f8; onf1af6c591the same commit was d92108270, which the runs below use.d840b10d2adds theAPS5_NO_WRITE_ONLY_PASSESrow todocs/dev/ENVIRONMENT.md, which the conventions check now asks for.PassHazards::SealWriteOnly()moves the open pass's write-only ranges into its writes. A later write-only store to them is then a WriteAfterWrite and begins a new pass, as a read-write store would; write-only stores elsewhere still continue the pass.VulkanDevice::SealPassWriteOnly→Recorder::SealPassWriteOnly) at ACQUIRE_MEM and at the EVENT_WRITE types thatPm4::Validateaccepts as partial flushes (0x07, 0x0f, 0x10) or cache flushes (0x16, 0x2a, 0x2c, 0x2e, 0x31). It seals once per run of such packets after a draw. While the draw pipeline has draws in flight, the seal is queued behind them; otherwise it is made at once under the GPU mutex.testWriteOnlyhas the case you asked for: Add (write-only), seal, then Check of the same range → WriteAfterWrite, and after Clear → None. It also checks that a write-only range elsewhere after the seal continues the pass.12d720f74(agc_driver_stencil_ref_exportis skipped;agc_driver_bda_deviceloses the device with an NVIDIA Xid 109 here, and does the same onmain0bc3003f8without this change, while it passed onf1af6c591(#7584, from #5859'sd422c760c; #7571 fixes it)), andtools/check_conventions.py --base origin/mainpasses.How often it triggers, Stray (PPSA02100) on
mainf1af6c591, standing still at the same save, oneAPS5_PROFILE_DRAW=1run each, mean of the windows of 10 s in the scene: with the seal (d92108270), 15,688 of 206,704 draws per 10 s began a pass (7.6 %, 8 windows); without it (95e731421), 15,990 of 212,286 (7.5 %, 6 windows; that run reached the scene later). A build with counters (local only, not part of this PR) shows why it changes nothing there. In the scene, queue 0 gets about 82,500 sealing packets per 10 s: ACQUIRE_MEM 64,000, CS and PS partial flushes 6,600 each, EVENT_WRITE 0x2e 3,900 and 0x2c 1,350. About 54,000 of them follow a draw, so they seal the open pass. None of those passes held write-only stores at the seal, and no later write-only store hit a sealed range, so the seal began no extra pass. In the whole 240 s run, 387 seals found write-only stores, all while the scene was loading.Frame p50, alternating runs on the same save (
APS5_TRACE_SECONDS=185:20only): d92108270 205.2 and 196.9 ms, 95e731421 211.7, 224.2 and 186.0 ms (one run of d92108270 hit the #5372 import race and is left out). That is within the spread. The traces and summaries of these runs are now on the release linked in the description, and the description has the trace digests, with their summary lines, of amainrun and a d92108270 run.AI-assisted: yes (implementation, analysis and text with Claude Code; the runs are from my machine).
Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-19T08:53:54Z.
Rebase handoff — rebased onto current
main(all three commits, authorship unchanged). Two conflicts:Draw.cppkeepsmain'sThreadOwnedpass-reads form with your device-reads size capture, andShaderResources.cppkeepsmain's extent-awareaddGuestBuffercall with yourwriteOnlyclassification layered after it.Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds; conventions pass; full suite green apart from the four knownmainregressions (#5444 Mesa, #7584 BDA, #7766, #7784), none from this PR.To pick it up:
Head is
bab5c1ab0.Imported from boykopovar/AnyPS5. Originally posted by teepean on 2026-10-19T22:05:23Z.
@blawesom thanks for the rebase and the full suite run. @oneandonlydean merged
maininto the branch in the meantime (8a77927), and it's mergeable again, so I'll keep that head rather than force-push over it.AI-assisted: yes (text with Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by teepean on 2026-10-20T13:00:19Z.
A data point at the stock settings, since this has been open for a few days. On my local stack (
main64e2a810a9plus my other local changes, all of them onshowcase/stray-stack), turning this change off withAPS5_NO_WRITE_ONLY_PASSES=1takes Stray from 16.25 to 12.40 FPS, and the GPU goes from ~56 % to ~76 % busy. With the change, render passes are begun for 7.4 % of draws, against 33.8 % without it in the runs in the description. Setup: the start of the Dead City chapter, Linux, Ryzen 9 9950X, RTX 3090, stockengine.ini(4K), four rounds per build in alternating order. The gain at these settings is larger than with the lowered settings of my first runs.The branch still merges with
main. Is anything else needed from my side?AI-assisted: yes (text with Claude Code; the runs are from my machine).