Repository navigation
hk: fix ray tracing hit attributes and hit kinds - #139
Merged
RyanTheTide merged 3 commits intoNov 2, 2026
Merged
Conversation
A hit object recorded from a query took the hit kind and attributes the application passed. Those only describe a generated hit: a triangle has its own, from the facing bit and the barycentrics, whatever the application supplied. Choose by the committed intersection type. Fixes the ser.builtin_var query_hitkind_tri case. Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com> Assisted-by: LLM
The operands after the query are SBT Record Index, Hit Object Attributes and an optional Hit Kind. vtn took word 4 as the hit kind when the optional operand was missing, and took the attributes only when it was present, so the common three-operand form passed a pointer as the hit kind and lost the attributes. Fixes dEQP-VK.ray_tracing_pipeline.ser.builtin_var cases that record a procedural hit from a query: record_from_query_procedural_attribs, its _loc1 variant and multi_attrib_locations. Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com> Assisted-by: LLM
The intersection stage writes hit attributes straight into the ray's frame, whether or not the candidate is then committed. With native traversal a later candidate that is rejected, or that reports no hit at all, overwrites the attributes of the closest hit, and the closest-hit shader reads the wrong values. Copy the attributes aside when a report commits and put them back in the frame when traversal ends on a generated hit. The software and M5 traversal paths are not changed here and have not been checked for the same gap. Fixes dEQP-VK.ray_tracing_pipeline.misc.hitattribute_closest_hit_correctness. Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com> Assisted-by: LLM
|
Merged into aurora-wip with the rest of the tested G17P set (130, 111, 112, 117, 119, 120, 134, 136, 139). The resulting aurora-wip tree, b15472e, is byte-identical to the test merge that was tested.
|
RyanTheTide
pushed a commit
to aurora-silicon/linux
that referenced
this pull request
Nov 3, 2026
Ray-traversal work is refused on the M4 Pro's 25G83 firmware because a stalled traversal was thought to wedge the GPU with no firmware recovery. That does not reproduce. A BLAS overwritten with a node cycle got a firmware reason-0 recovery in 1.76 s from a compute shader and 0.12 s from a fragment shader, with no MMU fault, and the GPU worked afterwards. Valid traversals are not cut off: one ray that must visit every leaf ran correctly for 31 s in compute and 14 s in fragment, and 16,384 of them finished in a 5 s fragment job. A compute job stops at the driver's own 38 s limit in timeout.rs, and only that client fails. The Vulkan ray tracing CTS lists, 74,833 cases, gave 49,711 Pass, 25,122 NotSupported, 0 Fail and 0 GPU recoveries with the Mesa fixes in aurora-silicon/mesa#139. Two limits remain. A recovery can still fail a running render of another client, as with any GPU hang. And all render work waits behind a fragment job, so a fragment traversal of many seconds freezes the desktop, and past about 24 s the compositor fails with ETIMEDOUT. Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com> Assisted-by: LLM
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.
Three fixes to ray tracing hit state. They take the Vulkan ray tracing CTS lists on the M4 Pro from 5 failures to 0.
1. hk: give a hit object recorded from a triangle its own hit kind. A hit object recorded from a query took the hit kind and attributes the application passed. Those only describe a generated hit. A triangle now takes its own, from the facing bit and the barycentrics. This comes first so that no commit leaves a triangle with the application's attributes.
2. spirv: read
OpHitObjectRecordFromQueryEXToperands in spec order. The grammar is Hit Object, Ray Query, SBT Record Index, Hit Object Attributes, then an optional Hit Kind. When the optional operand was missing, vtn took word 4 as the hit kind and dropped the attributes. Word 4 is the attributes pointer.3. hk: keep the committed attributes of a generated hit on G17P. The intersection stage writes attributes straight into the ray's frame, whether or not the candidate is committed. A later candidate that is rejected overwrites the closest hit's attributes, so the closest-hit shader reads the wrong values. The attributes are now copied aside when a report commits, and put back in the frame when traversal ends on a generated hit. Any application with procedural geometry can hit this one.
Fixes
dEQP-VK.ray_tracing_pipeline.misc.hitattribute_closest_hit_correctnessdEQP-VK.ray_tracing_pipeline.ser.builtin_var:record_from_query_procedural_attribs, its_loc1variant,multi_attrib_locationsandquery_hitkind_triTesting, M4 Pro (J616s, T6040), firmware 25G83
ray-query,ray-tracing-pipelineand the acceleration structure cases ofbinding-modelandapi, 74,833 cases: before 49,706 Pass, 25,122 NotSupported, 5 Fail. With these fixes 49,711 Pass, 25,122 NotSupported, 0 Fail, 0 GPU recoveries. Only those 5 cases changed. The sweep ran onaurora-wip9fe179d plus our other commits, with the two fixes applied as one change.aurora-wip8990cdb, with a kernel that accepts ray traversal: the 5 cases above and 86 ray query cases, 91 of 91 Pass.LowerVa,LogicalQueues,ComputeReserve). Every case affected passes alone, and it does not depend on these fixes.Not checked
hk_g17p_rt_enabledkeeps ray tracing hidden on the M4 Pro, so these fixes change nothing there.vtn_hit_object_attribute_derefaccepts only 32-bit scalars and vectors, as for the other record instructions. The three-operand form used to skip that check because it dropped the attributes, so a struct there now fails at compile time.