Repository navigation
Conversation
natevm
force-pushed
the
fix/sort-descriptor-lifetime
branch
from
October 10, 2026 14:13
4c805de to
1da86fa
Compare
natevm
marked this pull request as ready for review
October 10, 2026 14:16
natevm
commented
Oct 10, 2026
natevm
force-pushed
the
fix/sort-descriptor-lifetime
branch
from
October 10, 2026 23:40
212ae82 to
2854fa0
Compare
natevm
force-pushed
the
fix/sort-descriptor-lifetime
branch
from
October 11, 2026 03:22
2854fa0 to
ef4bece
Compare
This branch has not been deployed
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.
Sort calls update shared descriptor sets that earlier compute submissions may still use. Pass buffer device addresses through push constants so each recorded dispatch retains its addresses.
Remove all sort descriptor sets, their pool, and their layouts. The shared host/shader structure contains six device addresses and the existing sort parameters in 80 bytes. The shader's radix-sort algorithm is unchanged. Memory barriers order the sort stages and reuse of scratch on the same queue.
Remove
lastSortSubmissionandwaitForSort; buffer resize and destruction have no sort-specific state or waits. Callers use the existing synchronization APIs before host access, resizing, destruction, or access from another queue. Growing an existing scratch allocation and releasing internally allocated scratch useContext::synchronizeCompute(). Sufficient caller-provided scratch retains its size and device address, and those sorts remain asynchronous.Validation after rebasing onto master
2c6ee03: Windows Release sort, buffer-resize, and context-destruction tests pass on AMD Radeon AI PRO R9700 with synchronization validation enabled and no reported Vulkan validation errors. The sort test checks CPU-matched keys and payloads for 1, 511, 1024, 2049, and 524289 elements, including duplicates, high-bit keys, UINT64_MAX, partial workgroups, repeated submissions across command-buffer reuse, shared scratch, scratch growth, and omitted scratch for both APIs. It explicitly synchronizes before resizing or destroying caller-owned buffers.An additional AMD run matches a CPU reference for 1,048,576, 8,388,608, and 100,000,000 64-bit keys, both with and without payloads, with synchronization validation enabled and no reported Vulkan validation errors. The installed NVIDIA 582.16 driver lacks
VK_KHR_maintenance11, now required by master, so the rebased build cannot run there. Earlier NVIDIA runs passed both sort modes through 8,388,608 elements; the sort shader and shared parameter layout are unchanged since those runs.spirv-val --target-env vulkan1.2passes. SPIR-V inspection confirms the host/shader offsets and zero descriptor bindings. Linux, shared-library builds, and timeout injection were not tested in this revision.Performance comparison against
1da86fa: identical Release builds, validation disabled, preallocated scratch, GPU timestamps around the sort command buffer, and separate CPU submission timing. Before/after/after/before runs collected 50 samples per revision for random inputs and 200 for repeatedly sorted inputs. Both GPUs passed all correctness checks. NVIDIA GPU time improved in seven of eight cases in each dataset. AMD results were mixed with substantial timing variability.Steady-state GPU medians in milliseconds; negative deltas mean less time:
CPU submission time decreased in 15 of 16 steady-state cases across the GPUs. For NVIDIA's 8,388,608-element payload case, it fell from 0.1256 to 0.1101 ms. The same case's GPU time increased by 1.0% with random inputs. These measurements cover the full revision, including barrier changes; they do not isolate the effect of device-address loads. GPU clocks were not locked.