diff options
| author | romainveurrier <romain.veurrier@gmail.com> | 2026-11-22 14:40:35 +0100 |
|---|---|---|
| committer | romainveurrier <romain.veurrier@gmail.com> | 2026-11-22 14:41:25 +0100 |
| commit | fa2712e2b00f639906d4de63aa5ec326a1fa2b37 (patch) | |
| tree | a536e7ef955ed373df6154563d565411dd4012fb /docs | |
| parent | 6e8a1400ee22cbbf6346501117d46fc730254ffa (diff) | |
xdxr_build: one-workgroup sort for small builds, 256-element radix tiles
The radix sort's fixed latency dominated small builds (2,000 triangles: 0.81
ms with the sort, 0.08 ms without, on an RTX 2050; the 10k regression
@exhawk measured on #1572). Up to 1,024 keys are now sorted in one
workgroup's shared memory (bitonic, ties by element index: the stable
order; 8 KiB, within the 16 KiB minimum with the radix arrays), and the
radix tiles are 256 elements (4 chunks instead of 32 per workgroup).
RTX 2050: 1,000 triangles 0.24 ms, 2,000 0.28 ms (0.83), 10,000 0.38 ms
(0.81), 100,000 2.3 ms (2.5); 1M 21.9 ms (20.3, the larger scan).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/bvh.md | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/bvh.md b/docs/bvh.md index 23e046221..47322a88a 100644 --- a/docs/bvh.md +++ b/docs/bvh.md | |||
| @@ -339,8 +339,9 @@ the destination buffer: | |||
| 339 | 339 | ||
| 340 | 1. one thread per triangle (TRI0 leaves, remap `0x09`) or per instance (128-byte records, the world-to-object | 340 | 1. one thread per triangle (TRI0 leaves, remap `0x09`) or per instance (128-byte records, the world-to-object |
| 341 | inverse, the BLAS root and identity-rotation flag); | 341 | inverse, the BLAS root and identity-rotation flag); |
| 342 | 2. a 30-bit Morton key of each box centre, then a stable radix sort: 8 passes of 4-bit digits, 24 dispatches | 342 | 2. a 30-bit Morton key of each box centre, then a stable sort: up to 1,024 keys in one workgroup's shared memory |
| 343 | whatever the count, with no padding to a power of two; | 343 | (one dispatch), more with a radix sort of 8 passes of 4-bit digits over 256-element tiles (24 dispatches |
| 344 | whatever the count, no padding to a power of two); | ||
| 344 | 3. BOX32 nodes, built level by level from four consecutive sorted children, with the parent table and each | 345 | 3. BOX32 nodes, built level by level from four consecutive sorted children, with the parent table and each |
| 345 | instance's `ParentNode`; | 346 | instance's `ParentNode`; |
| 346 | 4. the header. | 347 | 4. the header. |