Repository navigation
perf(agc): draws that only update a buffer atomically continue one render pass - #9852
EdouardSence wants to merge 15 commits into
Conversation
|
Some 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.
|
|
@EdouardSence thanks, the hazard rules read correctly to us: only atomic-vs-atomic over the same bytes stops splitting the pass, a later plain read, write or write-only store still splits it both ways, indirect-argument reads still count, and a flush seals the atomics into writes. Guest buffer atomics are emitted at device scope, so updates from different draws in one pass don't race without a barrier. Two things before we run CI and the gate:
|
|
@oneandonlydean thanks for the review. Both points are in b683b2f. 1. A test on the draw path. New
2. CPU-copied regions. That case could not lose increments before this change either:
To make this explicit rather than implied, an atomic-only range now joins the pass's atomics only when every write of the draw over it lands in a host import bound in place. On the RX 9070 XT (RADV Mesa 26.2.4), with
Sky Garden with the new head still begins ~211 render passes per present ( Written by Claude (AI assistant) on a contributor's machine. |
|
This is a substantial, well-evidenced performance change: the diff includes the draw-path counter test, hazard cases, cache round-trip coverage, and same-machine traces. The tested baseline is |
…nder pass A guest buffer element the recompiler proves is only accessed through atomics (BufferResource::plain is false) and that no other allocation of the draw overlaps is passed to PassHazards as an atomic range. Atomic ranges of different draws over the same bytes do not conflict; they conflict with reads, read-write uses and write-only stores in both directions, and a flush packet seals them like write-only stores. APS5_NO_ATOMIC_PASSES=1 restores the previous behaviour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ting draws An atomic-only range joins the pass's atomics only when every write of the draw over it lands in a host import bound in place (GuestBufferMemory::WrittenInPlace). A copied region (a CPU copy, a GPU copy before its copy-back) keeps the previous behaviour. agc_driver_atomic_passes records two draws whose pixel shader adds 1 into one counter, once in a host import and once in a copied buffer, and checks the counter and how many draws continued a pass; agc_driver_atomic_passes_split runs it with APS5_NO_ATOMIC_PASSES=1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b683b2f to
106ffd2
Compare
|
@MarcZX10 thanks. The branch is rebased onto current Next I'll post, on 106ffd2 and on
Written by Claude (AI assistant) on a contributor's machine. |
|
Following up on the planned final-head evidence: the branch remains at |
|
I refreshed the comparison against current upstream |
|
Cache format review: this PR adds serialized fields ( |
…ing fields Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@MarcZX10 @oneandonlydean the final-head evidence is up, and the description now has it.
Tested and written by Claude (AI assistant) on a contributor's machine. |
|
@EdouardSence, a second GPU vendor for the final head 8c5ed65: NVIDIA on Windows, ASTRO BOT at Crash Site.
Medians: frame p50 172.9 ms on Reading (AI-assisted)
Summary lines, in run order{"commit":"944677990663","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"13312","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"150:5"},"gpu":"NVIDIA GeForce RTX 4070 Ti SUPER","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz","cpu_threads":16,"memory_mib":32599,"title_id":"PPSA21567","title":"ASTRO BOT","content_version":"01.019.000","resolution":"3840x2160","window":{"spec":"seconds 150:5","first_present":3198,"ms":5142.123},"presents":29,"frame_ms":{"p50":178.758,"p90":186.994,"p99":190.785,"max":190.785},"gpu_busy_ms_per_present":156.601,"worker_busy_pct":{"queue worker 0x0":98.685,"queue worker 0x40":98.147,"queue worker 0x48":94.295,"queue worker 0x46":9.694},"top_phases_ms_per_frame":{"Driver.Packet":532.940,"Driver.Packet.memory_wait":302.915,"Driver.Packet.draw":90.033,"Driver.Draw":89.217,"Graphics.Draw":83.601,"Graphics.Draw.draw_and_resource_release":66.371,"Driver.Packet.prepare_memory":61.761,"Driver.Packet.dispatch":56.382},"trace_dropped":false,"trace":"aps5-trace-944677990663-23796.json.gz"}
{"commit":"944677990663","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"13312","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"150:5"},"gpu":"NVIDIA GeForce RTX 4070 Ti SUPER","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz","cpu_threads":16,"memory_mib":32599,"title_id":"PPSA21567","title":"ASTRO BOT","content_version":"01.019.000","resolution":"3840x2160","window":{"spec":"seconds 150:5","first_present":2692,"ms":5033.119},"presents":29,"frame_ms":{"p50":173.898,"p90":181.812,"p99":183.157,"max":183.157},"gpu_busy_ms_per_present":154.584,"worker_busy_pct":{"queue worker 0x0":98.694,"queue worker 0x40":97.738,"queue worker 0x48":94.087,"queue worker 0x46":9.521},"top_phases_ms_per_frame":{"Driver.Packet":520.324,"Driver.Packet.memory_wait":298.244,"Driver.Packet.draw":85.116,"Driver.Draw":84.298,"Graphics.Draw":82.761,"Graphics.Draw.draw_and_resource_release":65.361,"Driver.Packet.dispatch":58.960,"Driver.Dispatch":56.107},"trace_dropped":false,"trace":"aps5-trace-944677990663-25244.json.gz"}
{"commit":"8c5ed656dcad","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"13312","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"150:5"},"gpu":"NVIDIA GeForce RTX 4070 Ti SUPER","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz","cpu_threads":16,"memory_mib":32599,"title_id":"PPSA21567","title":"ASTRO BOT","content_version":"01.019.000","resolution":"3840x2160","window":{"spec":"seconds 150:5","first_present":2672,"ms":5150.095},"presents":30,"frame_ms":{"p50":172.443,"p90":178.332,"p99":183.584,"max":183.584},"gpu_busy_ms_per_present":148.992,"worker_busy_pct":{"queue worker 0x0":98.781,"queue worker 0x40":98.023,"queue worker 0x48":94.232,"queue worker 0x46":8.258},"top_phases_ms_per_frame":{"Driver.Packet":513.378,"Driver.Packet.memory_wait":294.526,"Driver.Packet.draw":86.167,"Driver.Draw":85.372,"Graphics.Draw":82.629,"Graphics.Draw.draw_and_resource_release":65.616,"Driver.Packet.prepare_memory":61.068,"Driver.Packet.dispatch":50.906},"trace_dropped":false,"trace":"aps5-trace-8c5ed656dcad-29176.json.gz"}
{"commit":"8c5ed656dcad","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"13312","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"150:5"},"gpu":"NVIDIA GeForce RTX 4070 Ti SUPER","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz","cpu_threads":16,"memory_mib":32599,"title_id":"PPSA21567","title":"ASTRO BOT","content_version":"01.019.000","resolution":"3840x2160","window":{"spec":"seconds 150:5","first_present":2718,"ms":5054.761},"presents":29,"frame_ms":{"p50":174.365,"p90":185.160,"p99":199.627,"max":199.627},"gpu_busy_ms_per_present":151.325,"worker_busy_pct":{"queue worker 0x0":98.771,"queue worker 0x40":97.942,"queue worker 0x48":93.762,"queue worker 0x46":10.625},"top_phases_ms_per_frame":{"Driver.Packet":524.365,"Driver.Packet.memory_wait":296.043,"Driver.Packet.draw":90.060,"Driver.Draw":89.249,"Graphics.Draw":86.018,"Graphics.Draw.draw_and_resource_release":68.286,"Driver.Packet.prepare_memory":61.410,"Driver.Packet.dispatch":54.265},"trace_dropped":false,"trace":"aps5-trace-8c5ed656dcad-20056.json.gz"}
{"commit":"944677990663","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"13312","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"150:5"},"gpu":"NVIDIA GeForce RTX 4070 Ti SUPER","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz","cpu_threads":16,"memory_mib":32599,"title_id":"PPSA21567","title":"ASTRO BOT","content_version":"01.019.000","resolution":"3840x2160","window":{"spec":"seconds 150:5","first_present":2710,"ms":5131.521},"presents":30,"frame_ms":{"p50":171.941,"p90":179.736,"p99":182.330,"max":182.330},"gpu_busy_ms_per_present":160.779,"worker_busy_pct":{"queue worker 0x0":98.726,"queue worker 0x40":97.482,"queue worker 0x48":94.267,"queue worker 0x46":8.299},"top_phases_ms_per_frame":{"Driver.Packet":510.639,"Driver.Packet.memory_wait":290.265,"Driver.Packet.draw":86.535,"Driver.Draw":85.763,"Graphics.Draw":81.043,"Graphics.Draw.draw_and_resource_release":64.217,"Driver.Packet.prepare_memory":59.802,"Driver.Packet.dispatch":52.926},"trace_dropped":false,"trace":"aps5-trace-944677990663-19412.json.gz"}
{"commit":"944677990663","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"13312","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"150:5"},"gpu":"NVIDIA GeForce RTX 4070 Ti SUPER","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz","cpu_threads":16,"memory_mib":32599,"title_id":"PPSA21567","title":"ASTRO BOT","content_version":"01.019.000","resolution":"3840x2160","window":{"spec":"seconds 150:5","first_present":2704,"ms":5120.452},"presents":30,"frame_ms":{"p50":171.943,"p90":176.953,"p99":179.997,"max":179.997},"gpu_busy_ms_per_present":158.418,"worker_busy_pct":{"queue worker 0x0":98.739,"queue worker 0x40":98.034,"queue worker 0x48":87.583,"queue worker 0x46":6.669},"top_phases_ms_per_frame":{"Driver.Packet":496.334,"Driver.Packet.memory_wait":282.913,"Driver.Packet.draw":84.754,"Driver.Draw":83.972,"Graphics.Draw":82.834,"Graphics.Draw.draw_and_resource_release":65.745,"Driver.Packet.prepare_memory":56.050,"Driver.Packet.dispatch":51.747},"trace_dropped":false,"trace":"aps5-trace-944677990663-24896.json.gz"}
{"commit":"944677990663","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"13312","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"150:5"},"gpu":"NVIDIA GeForce RTX 4070 Ti SUPER","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz","cpu_threads":16,"memory_mib":32599,"title_id":"PPSA21567","title":"ASTRO BOT","content_version":"01.019.000","resolution":"3840x2160","window":{"spec":"seconds 150:5","first_present":3402,"ms":5172.917},"presents":29,"frame_ms":{"p50":179.097,"p90":192.011,"p99":193.560,"max":193.560},"gpu_busy_ms_per_present":157.542,"worker_busy_pct":{"queue worker 0x0":98.740,"queue worker 0x40":97.754,"queue worker 0x48":94.260,"queue worker 0x46":7.917},"top_phases_ms_per_frame":{"Driver.Packet":532.313,"Driver.Packet.memory_wait":307.415,"Driver.Packet.draw":89.067,"Driver.Draw":88.253,"Graphics.Draw":86.945,"Graphics.Draw.draw_and_resource_release":68.897,"Driver.Packet.prepare_memory":58.059,"Driver.Packet.dispatch":54.851},"trace_dropped":false,"trace":"aps5-trace-944677990663-15072.json.gz"}
{"commit":"944677990663","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"13312","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"150:5"},"gpu":"NVIDIA GeForce RTX 4070 Ti SUPER","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz","cpu_threads":16,"memory_mib":32599,"title_id":"PPSA21567","title":"ASTRO BOT","content_version":"01.019.000","resolution":"3840x2160","window":{"spec":"seconds 150:5","first_present":2621,"ms":5074.960},"presents":27,"frame_ms":{"p50":190.293,"p90":195.739,"p99":196.898,"max":196.898},"gpu_busy_ms_per_present":172.618,"worker_busy_pct":{"queue worker 0x0":98.861,"queue worker 0x40":97.732,"queue worker 0x48":93.647,"queue worker 0x46":10.834},"top_phases_ms_per_frame":{"Driver.Packet":565.507,"Driver.Packet.memory_wait":327.108,"Driver.Packet.draw":80.897,"Driver.Draw":80.149,"Graphics.Draw":80.004,"Driver.Packet.prepare_memory":70.996,"Driver.Packet.dispatch":65.897,"Graphics.Draw.draw_and_resource_release":63.589},"trace_dropped":false,"trace":"aps5-trace-944677990663-31540.json.gz"}
{"commit":"8c5ed656dcad","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"13312","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"150:5"},"gpu":"NVIDIA GeForce RTX 4070 Ti SUPER","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz","cpu_threads":16,"memory_mib":32599,"title_id":"PPSA21567","title":"ASTRO BOT","content_version":"01.019.000","resolution":"3840x2160","window":{"spec":"seconds 150:5","first_present":2793,"ms":5055.027},"presents":30,"frame_ms":{"p50":170.428,"p90":178.857,"p99":179.149,"max":179.149},"gpu_busy_ms_per_present":151.672,"worker_busy_pct":{"queue worker 0x0":98.803,"queue worker 0x40":97.727,"queue worker 0x48":94.687,"queue worker 0x46":9.367},"top_phases_ms_per_frame":{"Driver.Packet":506.082,"Driver.Packet.memory_wait":287.779,"Driver.Packet.draw":84.018,"Driver.Draw":83.239,"Graphics.Draw":80.956,"Graphics.Draw.draw_and_resource_release":64.441,"Driver.Packet.prepare_memory":56.746,"Driver.Packet.dispatch":55.098},"trace_dropped":false,"trace":"aps5-trace-8c5ed656dcad-19088.json.gz"}
{"commit":"8c5ed656dcad","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"13312","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"150:5"},"gpu":"NVIDIA GeForce RTX 4070 Ti SUPER","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz","cpu_threads":16,"memory_mib":32599,"title_id":"PPSA21567","title":"ASTRO BOT","content_version":"01.019.000","resolution":"3840x2160","window":{"spec":"seconds 150:5","first_present":2718,"ms":5042.722},"presents":31,"frame_ms":{"p50":162.730,"p90":168.773,"p99":172.661,"max":172.661},"gpu_busy_ms_per_present":153.234,"worker_busy_pct":{"queue worker 0x0":98.771,"queue worker 0x40":97.873,"queue worker 0x48":94.423,"queue worker 0x46":9.237},"top_phases_ms_per_frame":{"Driver.Packet":488.119,"Driver.Packet.memory_wait":281.595,"Graphics.Draw":78.884,"Driver.Packet.draw":78.269,"Driver.Draw":77.513,"Graphics.Draw.draw_and_resource_release":62.619,"Driver.Packet.prepare_memory":60.261,"Driver.Packet.dispatch":47.389},"trace_dropped":false,"trace":"aps5-trace-8c5ed656dcad-18140.json.gz"}
{"commit":"944677990663","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"13312","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"150:5"},"gpu":"NVIDIA GeForce RTX 4070 Ti SUPER","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz","cpu_threads":16,"memory_mib":32599,"title_id":"PPSA21567","title":"ASTRO BOT","content_version":"01.019.000","resolution":"3840x2160","window":{"spec":"seconds 150:5","first_present":2729,"ms":5012.057},"presents":31,"frame_ms":{"p50":162.567,"p90":168.915,"p99":171.193,"max":171.193},"gpu_busy_ms_per_present":144.935,"worker_busy_pct":{"queue worker 0x0":98.694,"queue worker 0x40":97.948,"queue worker 0x48":94.510,"queue worker 0x46":9.018},"top_phases_ms_per_frame":{"Driver.Packet":484.923,"Driver.Packet.memory_wait":279.318,"Driver.Packet.draw":80.994,"Driver.Draw":80.238,"Graphics.Draw":79.591,"Graphics.Draw.draw_and_resource_release":63.015,"Driver.Packet.prepare_memory":53.092,"Driver.Packet.dispatch":51.069},"trace_dropped":false,"trace":"aps5-trace-944677990663-28828.json.gz"}
{"commit":"944677990663","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"13312","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"150:5"},"gpu":"NVIDIA GeForce RTX 4070 Ti SUPER","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz","cpu_threads":16,"memory_mib":32599,"title_id":"PPSA21567","title":"ASTRO BOT","content_version":"01.019.000","resolution":"3840x2160","window":{"spec":"seconds 150:5","first_present":2694,"ms":5122.836},"presents":30,"frame_ms":{"p50":171.211,"p90":182.441,"p99":185.570,"max":185.570},"gpu_busy_ms_per_present":150.637,"worker_busy_pct":{"queue worker 0x0":98.756,"queue worker 0x40":97.649,"queue worker 0x48":94.176,"queue worker 0x46":9.117},"top_phases_ms_per_frame":{"Driver.Packet":511.344,"Driver.Packet.memory_wait":291.145,"Driver.Packet.draw":88.752,"Driver.Draw":87.947,"Graphics.Draw":85.544,"Graphics.Draw.draw_and_resource_release":68.698,"Driver.Packet.dispatch":56.937,"Driver.Dispatch":53.798},"trace_dropped":false,"trace":"aps5-trace-944677990663-16008.json.gz"}trace_digest.py, first line of each trace, in run orderThe traces follow in the next comment, one zip per round with that round's three traces and their summary lines. |
…p rule addGuestBuffer: main sweeps write-only elements of any record stride on discrete GPUs (the stride test is now Stride() != 0 and the 16-byte constant is gone). This change's in-place argument to AddWritable and its APS5_DRAW_ATOMIC_STAGING switch follow that line unchanged. Sweeping applies to compute dispatches and the in-place flag to draw builds, so the two do not meet. ShaderDiskCache: 13 BufferResource fields from this change and 51 ImageResource fields from main.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — comments
The changed hazard tracking and in-place atomic binding paths were inspected at head 353c2960b77db373b419f1ddb5989e8477536251; material parts of the change remain unverified because several changed files were too large to include in the review folder.
What I ran
No tests or build commands were run. I read the prepared description, commit list, manifest, diff, and targeted source ranges with repo_read.py.
Results
| Check | Result | Note |
|---|---|---|
| Diff and targeted code review | not run | Review remains incomplete |
| Tests and build | not run | Author reports focused tests; not independently verified |
Findings
Blocking
None verified in the code inspected.
Non-blocking
None.
Not verified
Full text was available and inspected selectively for GuestBufferMemory.hpp, PassHazards.hpp, ShaderResources.hpp, Draw.cpp, PassHazards.cpp, PassHazards.cpp tests, ShaderDiskCache.cpp tests, the atomic-pass CMake test, and the new AtomicPasses.cpp test. Targeted ranges were read for the excluded full-text files GuestBufferMemory.cpp, ShaderResources.cpp, and Recorder.cpp tests; their complete contents were not read. The remaining changed files listed in the manifest were not read. The reported test runs, performance results, other GPUs, and other titles were not independently verified.
To get this to a good state
Nothing is required. Optional: complete review of the remaining changed files and run the focused tests on this head before treating the review as approval.
|
I tried to test this on Cyberpunk 2077 on Linux (RTX 2080 Ti, NVIDIA 595.99.02) but it doesn't merge onto current |
Main added imageUintStorage to DescriptorBinding and moved the shader disk cache format to 88; this branch adds bufferAtomicOnly. Keep both flags in descriptorBindingBytes, set the DescriptorBinding size check to 976 (both sides had moved it from 864 to 920 for one flag each), and move the format to 89.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
The review artifacts and repository files could not be read in this environment, so the change is not verified and a formal decision is not justified.
What I ran
No repository reader command was available to run.
Results
| Check | Result | Note |
|---|---|---|
| Review artifact inspection | not run | Reader unavailable |
| Code audit | not run | Changed files not inspected |
Findings
Blocking
None verified.
Non-blocking
None.
Not verified
The change description, commits, diff, manifest, changed-file contents, and files reviewed count were not available for inspection.
To get this to a good state
Provide access to repo_read.py and the prepared review artifacts so the change can be reviewed.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this review; the behavior claims and relevant code paths inspected support merging.
What I ran
Reviewed head 5c77b5d421f36c8b1be491f73af00c96d826a59a through the pinned repo_read.py interface. No build or tests were run in this review; the focused test results in the PR description are author-reported.
Results
| Check | Result | Note |
|---|---|---|
| Prepared diff and metadata | passed | Claims align with the inspected change |
| Targeted source review | passed | Pass hazards and in-place binding traced |
| Build and tests | not run | Author reports focused tests |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full text of GuestBufferMemory.cpp, ShaderResources.cpp, and Recorder.cpp was not read; only relevant ranges and callers were inspected. The changed test files were not all read, and no tests were run. Performance measurements, other GPU vendors, and other titles were not independently verified. Files excluded by the prepared review manifest were GuestBufferMemory.cpp, ShaderResources.cpp, and Recorder.cpp as full-text artifacts; their relevant changed ranges were read via the pinned reader. All other changed files listed in the manifest were included in the review folder, but not every full file was read.
To get this to a good state
Nothing is required.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
The review is incomplete because the prepared review materials could not be read in this environment.
What I ran
No commands run. The required reader and review folder were unavailable through the available tools.
Results
| Check | Result | Note |
|---|---|---|
| Review materials | not run | Not accessible |
| Tests | not run | Not run |
Findings
Blocking
None verified.
Non-blocking
None.
Not verified
The PR description, commits, diff, manifest, changed files, and repository context were not read. No findings can be substantiated.
To get this to a good state
Nothing is required.
What
In ASTRO BOT's Sky Garden, one vertex shader that most draws use updates a 32-record counter buffer with buffer atomics. The recompiler counts an atomic element as both read and written, so every draw after the first saw a read-after-write hazard on the open render pass and began a new pass. Since #15887,
mainalso stages that counter through a device-local buffer for draws; the staged copy-in and copy-back each end the open pass (PassBreak::Command). Onmainf42d8b4a44, about 45K of the 265K to 275K draws per 10 s begin a render pass, 37K of them for a command; with this change about 10.7K of 290K to 300K draws, 2.1K for a command.This is the atomic counterpart of #7340, which left atomic buffers out on purpose.
BufferResource::plainrecords any non-atomic access of a buffer (Merge).DescriptorBinding::bufferAtomicOnlymarks an element whose every access is an atomic: atomic, not plain, and not aliased by an image (imageAlias). The shader disk cache stores both.bufferAtomicOnlyelements of host imports in place (Region::inPlace, checked byGuestBufferMemory::stagingWanted) instead of staging them. Dispatches keep staging them (the histogram kernels atomic staging was added for have no render pass), and an element a draw also loads or stores stays staged.APS5_DRAW_ATOMIC_STAGING=1restores staging for draws.ShaderResources::AtomicOnlyRanges(): the guest ranges of atomic-only elements that no other allocation of the draw overlaps, built likeWriteOnlyRanges().recordDrawkeeps only the ranges whose every write by the draw lands in a host import bound in place (GuestBufferMemory::WrittenInPlace). A CPU copy already makes the drawunknownMemory, and a GPU copy or a staged copy keeps the previous behaviour.recordDrawtakes the kept ranges out of the draw's hazard reads and writes and passes them asPassAccess::atomics. The recorder's write tracking (NoteAccess, pending writes) still sees them as written.PassHazards:SealWriteOnly()also moves the open pass's atomic ranges into its writes. A flush packet between two draws still orders their atomics.recordDrawalso keeps the device read count up to date after the write-only erase, so the atomic erase stays within the draw's own device reads.APS5_NO_ATOMIC_PASSES=1restores the previous hazard rule.Overlaps (textual only; whichever lands second adapts):
mainf42d8b4a44and currentmaine917850d23are at 68; this PR writes 69. An open PR that bumps the sameFormatVersionline takes the next free version after whichever lands first.git merge-treeof this head against currentmaine917850d23is clean.tools/pr_overlap.pylists open PRs that touch the same files (mostly thedocs/dev/ENVIRONMENT.mdtable); none implements the same change.Tested
Exact revisions: this PR at
a4e218f8cd. Themainside isf42d8b4a44, themainthat this head last merged (its merge-base withmain), so the two builds differ only by this PR.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest --test-dir build -R <pattern> -V:agc_driver_buffer_atomics,agc_driver_global_atomics,agc_driver_recorded_draw_staging,agc_driver_graphics,agc_driver_recorder,agc_pass_hazards,agc_shader_disk_cache. This branch addsagc_driver_atomic_passesandagc_driver_atomic_passes_split, which do not exist onmain.mainpasses 6 and this branch 8;agc_driver_recorded_draw_stagingskips on both (this device does not keep host imports write-watched). Neither log has aVUID-line orwas not found but was requested by env var VK_INSTANCE_LAYERS, and in both the loader loadsVkLayer_khronos_validation.json. Logs: main, this PR.agc_driver_atomic_passes(tests/execution/AtomicPasses.cpp): a pixel shader adds 1 into one counter withbuffer_atomic_add. One draw adds Width×Height. Two consecutive draws into a host-imported counter add twice that, and the second continues the first's pass. Two draws into a copied counter (not a guest allocation) add twice that, and the second begins a new pass.agc_driver_atomic_passes_splitruns the same withAPS5_NO_ATOMIC_PASSES=1, where no draw continues and both sums still match.agc_driver_recorder: a 64-byte atomic counter added as a draw's atomic-only element is bound in place andWrittenInPlacereports it; added as a plain atomic element it is staged.testAtomicsinagc_pass_hazardscovers each hazard pair and the seal.agc_shader_disk_cacheround-tripsbufferAtomicOnlyand checks it in the binding plan.-lvl underwater_aerial_garden), headless gamescope 3840×2160, title defaults, no input, 180 s per run.APS5_NO_SNAPSHOT_CHECK=1 APS5_HOST_IMPORT_MIB=11815 APS5_PROFILE_DRAW=1 APS5_TRACE_SUMMARY_EVERY=10 APS5_TRACE_EVENTS=4194304 APS5_TRACE_SECONDS=40:25on both sides.main, PR,main, PR.commandmainf42d8b4a44, round 1a4e218f8cd, round 1main, round 2The 25 s trace windows (
trace_digest.pyandperformance_compare.py):mainp50 / p90 ms, GPUThe PR's round 2 run took about 15 s longer to load, so its window starts with the level's first slow interval (155 ms GPU) and ends at 65 s; the 10 s intervals after it stay at 102 to 103 ms. Round 1's
mainwindow ends as that run's drop begins (one 3.4 s frame) and the PR's has one 5.2 s frame; p99 and max in those windows come from those single frames. No trace dropped events.Frame p50 drops by about 10 % and GPU time per present by about 29 %; render passes begun drop by about 76 %. The queue workers stay at ~99 % on both sides.
Artifacts for all four runs (release): traces,
aps5-summary.jsonl,trace_digest.pyoutput, and theperformance_compare.pyoutput of each round. Round 1 summary lines:{"commit":"f42d8b4a447f","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"11815","APS5_NO_SNAPSHOT_CHECK":"1","APS5_PROFILE_DRAW":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"40:25","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.5-arch3.1","os":"Linux 7.3.1-1-cachyos","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":31227,"title_id":"PPSA21567","title":"ASTRO BOT","content_version":"01.019.000","resolution":"3840x2160","window":{"spec":"seconds 40:25","first_present":502,"ms":25391.530},"presents":97,"frame_ms":{"p50":218.978,"p90":223.867,"p99":3449.562,"max":3449.562},"gpu_busy_ms_per_present":143.887,"worker_busy_pct":{"queue worker 0x0":98.617,"queue worker 0x48":87.305,"queue worker 0x40":98.323,"queue worker 0x46":0.352},"top_phases_ms_per_frame":{"Driver.Packet":743.569,"Driver.Packet.memory_wait":436.728,"Driver.Packet.draw":212.982,"Driver.Draw":211.468,"Graphics.Draw":165.893,"Graphics.Draw.draw_and_resource_release":144.631,"Driver.Draw.shader_compile_and_link":97.187,"Driver.Draw.draw_enqueued":94.765},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-f42d8b4a447f-339619.json.gz"} {"commit":"a4e218f8cdb4","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"11815","APS5_NO_SNAPSHOT_CHECK":"1","APS5_PROFILE_DRAW":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"40:25","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.5-arch3.1","os":"Linux 7.3.1-1-cachyos","cpu":"AMD Ryzen 7 7800X3D 8-Core Processor","cpu_threads":16,"memory_mib":31227,"title_id":"PPSA21567","title":"ASTRO BOT","content_version":"01.019.000","resolution":"3840x2160","window":{"spec":"seconds 40:25","first_present":466,"ms":26013.739},"presents":107,"frame_ms":{"p50":195.816,"p90":199.718,"p99":205.315,"max":5212.140},"gpu_busy_ms_per_present":101.648,"worker_busy_pct":{"queue worker 0x0":98.592,"queue worker 0x48":80.709,"queue worker 0x40":99.905,"queue worker 0x46":0.316},"top_phases_ms_per_frame":{"Driver.Packet":678.196,"Driver.Packet.memory_wait":425.483,"Driver.Packet.draw":195.238,"Driver.Draw":193.727,"Graphics.Draw":164.756,"Graphics.Draw.draw_and_resource_release":143.956,"Driver.Draw.shader_compile_and_link":95.814,"Shader.DrawStage":80.336},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-a4e218f8cdb4-343655.json.gz"}APS5_DRAW_ATOMIC_STAGING=1(in the conversation) shows the same direction: about a quarter of the render passes and ~100 against ~177 ms GPU per present.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)