Repository navigation
perf(agc): reuse readonly fallback copies - #5469
Closed
Sanjaysrinivas wants to merge 1 commit into
Closed
Sanjaysrinivas wants to merge 1 commit into
Sanjaysrinivas wants to merge 1 commit into
Conversation
Sanjaysrinivas
marked this pull request as ready for review
October 13, 2026 20:37
Collaborator
|
Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line. |
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
Retain immutable raw copies of tracked read-only fallback buffer regions through the recorder's existing storage-snapshot cache. Unchanged readers can bind the same buffer; writes are flushed and freshly collected before lookup so a CPU store within the same collection epoch cannot serve stale bytes. The existing cache supplies its entry/byte budgets and preserves buffers held by older consumers.
Reuse is limited to uploads holding the GPU mutex, using the active recorder on the same device, with a nonzero write-watch generation and a fully committed, live, non-addressable region that no descriptor writes. Writers, sparse regions, untracked memory and unlocked preparation keep separate copies.
APS5_NO_READONLY_FALLBACK_REUSE=1disables reuse for comparison;APS5_PROFILE_DRAWreports avoided logical copy footprints.Related open #1364 includes immutable buffer reuse alongside upload batching and shader-data streaming. This is a draft alternative for the reuse portion using current main's existing cache, with no batching or streaming redesign. Ordering with #1364 has not been agreed and needs maintainer/author coordination before this becomes ready for review. The checklist explicitly records that overlap rather than asserting its absence. No title FPS or frame-time improvement is claimed by this PR.
Tested
Fresh Release build against main
a0f5916a293067ca840e835e58a8a55a0b764b4b, Windows 11 Pro / MinGW-w64, SPIRV-Tools disabled, native NVIDIA Vulkan with Khronos validation and shader cache disabled.The new native fixture passes (0.556 s): unchanged-handle reuse, a CPU overwrite within one explicitly established collect epoch, queued GPU consumers retaining old bytes, writer bypass, a real GPU fill published before the next reader, generation-zero bypass, unlocked preparation, cache eviction with a live consumer, private recommit, shared-section CPU writes/remap at the same virtual address, and sparse descriptor clipping/bypass. Mapping changes use the existing allocation invalidation callback without registering the fallback memory for import. Disabling reuse in the identical binary fails at the expected unchanged-handle assertion (0.460 s).
CTest: 5/5 passed, covering the new fixture, unchanged CPU stamps, written-buffer ordering, copied-direct ordering and the draw snapshot cap (3.74 s total, each test below 1 s). The dedicated draw descriptor writes and snapshot override check also passed (0.450 s). No cases skipped or Vulkan validation errors reported. Linux/lavapipe and other hardware vendors have not been tested.
Checklist
main; open-PR overlap reviewed and disclosed: perf(agc): reuse immutable buffer copies and batch uploads #1364 (draft alternative; ordering remains pending as described above).mdfiles or images added to the repository