Skip to content

fix(radix-sort): OneSweep on NVIDIA, indirect bind fix, GSplat bit alignment#8657

Merged
mvaligursky merged 1 commit into
mainfrom
mv-radix-sort-nvidia-onesweep
Apr 28, 2026
Merged

fix(radix-sort): OneSweep on NVIDIA, indirect bind fix, GSplat bit alignment#8657
mvaligursky merged 1 commit into
mainfrom
mv-radix-sort-nvidia-onesweep

Conversation

@mvaligursky
Copy link
Copy Markdown
Contributor

Summary

Improves automatic OneSweep selection on NVIDIA WebGPU, fixes indirect OneSweep bind group creation, aligns GSplat GPU radix sort key bit counts with the active sorter radix width, and updates the indirect radix sort example so it matches production prepareIndirect / multi-slot behaviour.

Changes

  • compute-radix-sort.js: _canUseOneSweep no longer rejects NVIDIA when the adapter reports a high maxSubgroupSize (D3D12 ceiling) or omits subgroup size (minSubgroupSize 0). Only refuses when minSubgroupSize > 32, which would break 32-bit subgroup ballot masks in the binning shader. Clarified Debug.warnOnce for explicit RADIX_SORT_ONESWEEP on non-validated hardware.
  • compute-radix-sort-onesweep.js: Constructor assert aligned with the same minSubgroupSize policy. Indirect bind groups: use three separate BindStorageBufferFormat('b_sortElementCount') instances so BindGroupFormat slot assignment is not overwritten across histogram / scan / binning layouts (fixes WebGPU binding index 7 not present validation errors).
  • gsplat-manager.js: In sortGpu, round numBits with gpuSorter.radixBits instead of hardcoded 4 so OneSweep receives a multiple of 8. JSDoc for dispatchGpuSort updated accordingly.
  • radix-sort-indirect-compute.example.mjs: ComputeRadixSort constructed with { indirect: true }; prepare pass uses prepareIndirect() metadata, reserves slotCount dispatch slots, and writes per-slot workgroup counts with correct granularities; UI bit options filtered by radixSort.radixBits.

Testing

  • ESLint on the four changed files.
  • WebGPU NVIDIA: run radix-sort-indirect-compute example — no bind validation errors, no device hang.
  • GSplat GPU sort path: sort key bit count valid for both multipass (4) and OneSweep (8).

Public API

None.

…ignment

Select OneSweep under RADIX_SORT_AUTO when subgroup min size allows 32-lane
ballots; fix shared BindStorageBufferFormat slot corruption in indirect
OneSweep; align GSplat GPU sort key bits to gpuSorter.radixBits; update the
indirect radix sort example for multi-slot prepareIndirect.
@mvaligursky mvaligursky self-assigned this Apr 28, 2026
@mvaligursky mvaligursky merged commit 950bccc into main Apr 28, 2026
8 checks passed
@mvaligursky mvaligursky deleted the mv-radix-sort-nvidia-onesweep branch April 28, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant