Repository navigation
hk: dispatch ray tracing continuations through balanced searches - #321
Merged
Merged
Conversation
Continuation mode mapped a shader binding table handle to its entry with one compare-and-select per group, a chain that sits in a single block, and ran the parts behind one compare each. A pipeline whose raygen calls one of 4096 callables then compiled for 90 to 300 seconds on G17P, against 5 seconds for the inlined megakernel. Search the sorted handles and the consecutive part numbers with balanced trees instead: log2(n) compares per lookup and no block grows with the number of groups. Signed-off-by: Diljit Singh <hey@djdev.me>
Author
|
Landing this as step 4 of a tree-checked batch merge (batch 6). The batch is gated on the G17P Neo:
The hk meta-stages fix (#329) lands first. Without it, mesh-by-default made 14 shader_object 8-attachment rendering cases fail at vkEndCommandBuffer; with it, all of them pass on hardware. The expected tree after this merge is fb207e385504. |
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.
Follow-up to #278. Continuation mode (ray tracing pipelines deeper than 3 on G17P) mapped a shader binding table handle to its stage entry with one compare-and-select per shader group. That chain sits in a single basic block. It also ran the scheduler's parts behind one compare each.
For a pipeline with thousands of groups this made compilation superlinear. With continuation mode forced,
dEQP-VK.ray_tracing_pipeline.large_shader_set.*.4096(one raygen calling one of 4,096 callables) compiled in 86-307 s, against 2.5-5 s for the inlined megakernel. A deep pipeline with that many hit or callable groups would hit the same cost.Change
hk_callable_pc) is untouched, so pipelines up to depth 3 compile exactly as before.Tests
test-hk-rt-cache-controlnow also builds depth-4 pipelines with 8 and 48 callable groups and requires the same largest basic block for both. On the host it measures 102 instructions for both; with the old chain the block grows with the group count. The existing continuation checks are unchanged (no calls, code size independent of depth, linear stack).large_shader_set.*cases pass under a 90 s per-case cap, *.4096 included, with no GPU kernel log lines. Run on a second J700, branchrtrec/r4-ryan(this change on hk: run deep ray tracing pipelines as continuations on G17P (maxRayRecursionDepth 3 -> 31) #278).🤖 Generated with Claude Code