Repository navigation
perf(agc): stage read and written buffer elements a dispatch sweeps - #2681
Merged
oneandonlydean merged 2 commits intoOct 10, 2026
Merged
Conversation
DescriptorBinding gains bufferRead next to bufferWritten and bufferAtomic, filled from the resource tracker's per-buffer read flag and kept in the shader disk cache (format 24).
A written V# element bound in place in a host import makes every load a PCIe round trip. A particle update that loads and stores a 10 MiB pool (2048x64 threads over 131072 records of 80 bytes), above the 2 MiB written window, took about 4.8 ms of GPU per frame. An element the shader also reads (DescriptorBinding::bufferRead), written by a direct dispatch whose threads times the V# stride cover at least half of it, now takes device-local staging up to 16 MiB: that dispatch drops to about 0.06 ms plus 0.9 ms of bulk copies. The coverage test keeps a kernel that updates about 12k records of a 16 MiB pool in place, where staging all of it would cost 1.3 ms of copies for a 0.08 ms kernel. Write-only elements, indirect dispatches and raw (stride 0) buffers keep the 2 MiB window.
9 tasks done
|
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.
|
9 tasks done
This was referenced Oct 10, 2026
10 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A written V# element bound in place in a host import makes every load a PCIe round trip. In one title's particle update, a kernel loads and stores a 10 MiB pool (2048x64 threads over 131072 records of 80 bytes). That is above the 2 MiB written window, so it stayed in place and took about 4.8 ms of GPU per frame.
Two commits:
feat(shader):DescriptorBindinggainsbufferReadnext tobufferWrittenandbufferAtomic, filled from the resource tracker's existing per-bufferreadflag. It is kept in the shader disk cache, which bumps the format to 24. No key or ABI change.perf(agc): an element is now staged in device-local memory up to 16 MiB when all of these hold:The coverage test keeps a kernel that updates about 12k records of a 16 MiB pool in place: staging all of it would cost about 1.3 ms of copies for a 0.08 ms kernel. Write-only elements, indirect dispatches and raw (stride 0) buffers keep the 2 MiB window.
Tested
BUILD_TESTING=ON:ctest -R "agc|shader"passes 320/321. The one failure,agc_driver_dcc_keys_first_write, fails the same way on currentmain.agc_shader_disk_cache_tests:bufferReadsurvives the disk cache round trip and the binding plan.agc_driver_recorder_tests, newreadWrittenStagingTests, run on its own on the RTX 4090 (the full binary stops earlier onmainwith a 60 s lease wait, unrelated):0x500779a00went from about 4.8 ms of GPU per frame to 0.06 ms plus about 0.9 ms of copies.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)