Skip to content

hk: three CTS fixes (transform feedback counters, depth/stencil clear in an empty render, exact index range) - #56

Merged
RyanTheTide merged 3 commits into
aurora-silicon:aurora-wipfrom
jgoyvaerts:pr/hk-small-fixes
Oct 24, 2026
Merged

RyanTheTide merged 3 commits into
aurora-silicon:aurora-wipfrom
jgoyvaerts:pr/hk-small-fixes

Conversation

@jgoyvaerts

Copy link
Copy Markdown

Three small Honeykrisp fixes found with the Vulkan CTS on the M4 Pro (G17P path, #55). Each is independent of #55 and applies to aurora-wip on its own.

  • hk: accept a NULL pCounterBuffers in transform feedback begin/end. vkCmdBegin/EndTransformFeedbackEXT may pass pCounterBuffers = NULL with a non-zero count (no counter buffers); the loop dereferenced it and crashed dEQP-VK.transform_feedback.simple_optimized_gpl.resume_1_131072_null_counter_buffers.
  • hk: clear every aspect of a depth/stencil attachment in an empty render. The empty-render clear replacement took the aspects and format from the view, but a render pass depth/stencil attachment ignores the view's aspect mask: a depth-only view of a D32_SFLOAT_S8_UINT image bound as the stencil attachment left its stencil uncleared (dEQP-VK.renderpasses.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d32_sfloat_s8_uint.depth_min_stencil_none_testing_stencil_ignore_depth_aspect read the previous test's stencil).
  • hk: bind the exact index-buffer range. hk_CmdBindIndexBuffer2KHR rounded the bound range up to 4 bytes, which hid overreads into the padding of 8- and 16-bit index buffers from agx_direct_draw_overreads_indices() (dEQP-VK.robustness.bind_index_buffer2.type.*). Every encoder already rounds where the hardware needs it.

Hardware tested on: Apple MacBook Pro (16-inch, M4 Pro, 2024), J616s / T6040, macOS 26.6.2 firmware, kernel 7.3.0-m4.14 (aurora integration/aurora 1aa2857509d + #406, #408-#413).

How tested: Built as a system Mesa (aurora's mesa-aurora options: asahi, zink, softpipe Gallium; asahi Vulkan) and run on the M4 Pro with deqp-runner (vk-gl-cts main mustpass), 6 jobs. The cases these fixes name (807: robustness.bind_index_buffer2.*, the transform_feedback.simple, simple_fast_gpl and simple_optimized_gpl resume_* cases, renderpasses.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d32_sfloat_s8_uint.* and query_pool.occlusion_query.*):

pass fail crash skip
aurora-wip 76155824 + #55 757 9 18 23
+ these fixes (with the rest of our series) 784 0 0 23

The 18 crashes are the null_counter_buffers and null_ptrs_end_xfb resume cases; the failures are 7 bind_index_buffer2 cases and 2 depth_stencil_resolve *_ignore_*_aspect cases. An image-heavy dEQP-VK sample (image, copy_and_blit, renderpass, pipeline image/MSAA/blend, texture, compute.pipeline; 20,116 cases) gives 8,886 pass, 0 fail, and no GPU recovery in the kernel log.

🤖 Generated with Claude Code

vkCmdBegin/EndTransformFeedbackEXT may pass pCounterBuffers = NULL with a
non-zero counterBufferCount, meaning no counter buffers. The loop read
pCounterBuffers[i] anyway and crashed
dEQP-VK.transform_feedback.simple_optimized_gpl.resume_1_131072_null_counter_buffers.
All 42 resume cases and the 4990 supported transform_feedback.simple cases
pass with the check.

Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
Assisted-by: LLM
An empty render's load-op clears are replaced with image clears. The
replacement cleared an aspect only if the attachment's view had it, and
took the format from the view. For a render pass depth/stencil
attachment the view's aspect mask is ignored, so a depth-only view of a
D32_SFLOAT_S8_UINT image bound as the stencil attachment must still get
its stencil cleared; its view format (D32_SFLOAT) has no stencil part.
The skipped clear left whatever the memory held:
dEQP-VK.renderpasses.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d32_sfloat_s8_uint.depth_min_stencil_none_testing_stencil_ignore_depth_aspect
read the stencil of the previous test's image (1, expected 0).

For depth and stencil, take the aspects and the format from the image.
Colour keeps the view format, in which the clear value is expressed.

Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
Assisted-by: LLM
hk_CmdBindIndexBuffer2KHR rounded the bound range up to 4 bytes. Every
encoder already rounds the range to dwords where the hardware needs it
(agx_vdm_draw and the indirect size word in libagx_dgc.h, and the HAL200
encoders), but the rounded value also fed
agx_direct_draw_overreads_indices(), which then missed overreads into
the padding of 8- and 16-bit index buffers whose binding does not end on
a dword (CTS dEQP-VK.robustness.bind_index_buffer2.type.* on G17P).

Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
Assisted-by: LLM

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the first two commits look good and test clean. The third one ("hk: bind the exact index-buffer range") regresses GL through zink on the A18 Pro, so I'm holding this PR for now.

On the Neo (73t), with the same kit on aurora-wip 7615582 and on 7615582 + #55..#60, every dEQP-GLES3.functional.buffer.map.{write,read_write}.render_as_index_array.* case (32) goes from Pass to Fail under zink, 3 of 3 runs, with "Image comparison failed". Reverting only b944aac on top of the series brings all 32 back to Pass. Native GL and all the Vulkan groups we ran are unaffected:

  • main776, stride50;
  • transform_feedback, renderpass2 depth_stencil_resolve, bind_index_buffer2, index_access, indexed_draw, query_pool, image_clearing;
  • 281,580 names on the Neo and 605,583 on the M1 Pro and M2, 0 changes.

These tests draw GL_UNSIGNED_BYTE indices straight out of a mapped buffer. So some consumer of the bound range still relies on it being whole dwords, even though the HAL200 direct-draw encoder rounds its own size word. The bind_index_buffer2 cases also pass on the Neo without this commit, so the failures you saw may be specific to the M4 Pro.

Could you split the range change into its own PR, with the GLES3 group above in the test list? We'd take the transform feedback and depth/stencil clear fixes on their own straight away.

@RyanTheTide

Copy link
Copy Markdown

Landed in #64 with your three commits unchanged and your authorship kept, plus one fixup for the index-buffer range. The exact range was right. The hardware index window starts at the dword holding the first index, though, and the encoders counted from the first index itself, so a draw starting mid-dword that ran to the end of a range ending mid-dword lost its last indices. That was the zink render_as_index_array failure. The fixup counts the windows from that dword, so the exact range stays. GitHub marked this PR merged because its commits came in with #64. Thanks for these!

@jgoyvaerts
jgoyvaerts deleted the pr/hk-small-fixes branch October 24, 2026 16:34
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.

2 participants