Skip to content

borealis: share nested command buffers, depth clip control, and primitives-generated queries - #928

Merged
DjDeveloperr merged 1 commit into
aurora-wipfrom
feat/borealis-shared-vk-extensions
Nov 24, 2026
Merged

DjDeveloperr merged 1 commit into
aurora-wipfrom
feat/borealis-shared-vk-extensions

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 24, 2026 •

Copy link
Copy Markdown

Problem

Several Borealis Vulkan extensions whose implementations are shared across generations remained gated to G17P or M5 only after initial qualification:

  • VK_EXT_nested_command_buffer is pure software secondary command-buffer replay in hk_CmdExecuteCommands().
  • VK_EXT_depth_clip_control and extendedDynamicState3DepthClipNegativeOneToOne are lowered in NIR (agx_nir_lower_clip_m1_1) through the shared root table across AGX2 and native AGX3 (HAL300/M5 PPP admission currently rejects negative-one depth clip at hk_cmd_draw.c:9962).
  • VK_EXT_primitives_generated_query is counted by the shared pre-graphics helpers across all generations.
  • A dead G16G-only robustImageAccess / robustImageAccess2 override in hk_get_device_features() duplicated the unconditional true initializers in the same function.

Change

  • Enable VK_EXT_nested_command_buffer and VK_EXT_primitives_generated_query unconditionally across all Borealis generations (G13-G17).
  • Enable VK_EXT_depth_clip_control (depthClipControl and extendedDynamicState3DepthClipNegativeOneToOne) on all non-HAL300 paths (!agx_chip_hal300_path(dev->chip), i.e. G13-G17P), keeping HAL300/M5 gated until M5 PPP admission supports negative-one depth clip.
  • Remove the redundant dev->chip == AGX_CHIP_G16G robustImageAccess{,2} block.
  • Part of the Borealis share-down series (no new chip gates, zero overlap with #824, #810, #812, #813, #416, #456).

Testing

Exact head 24701906cc34 (arm64 ICD libvulkan_asahi.so sha256 a756b96daa2794af... vs aurora-wip 912c9e4cc7e sha256 18224556d3f83964..., userspace-only via VK_DRIVER_FILES, 0 GPU faults, 0 new AVCs, Enforcing, 0 failed units):

  • Host unit tests: meson test --suite asahi 245/245 PASS.
  • J413 (M2 Air, G14G AGX2, fleet87): nested 12 -> 24/24 Pass, depth_clip 0 -> 37/72 Pass (35 NS), primitives 0 -> 72/72 Pass (+121 NS -> Pass, 0 Fail), control 87/96 identical.
  • J713 (M4 Air, G16G AGX3, fleet85): nested 12 -> 24/24 Pass, depth_clip 0 -> 37/72 Pass (35 NS), primitives 0 -> 72/72 Pass (+121 NS -> Pass, 0 Fail), control (excluding pre-existing baseline MSAA depth submit EINVAL) 95/95 identical.
  • Neo (A18 Pro, G17P regression, fleet87): nested 24/24, depth_clip 46/72 (26 NS), primitives 72/72, control 96/96 — 100% identical, 0 regressions.

Still to run

  • G13 (J316s M1 Pro) and G15 (J615 M3 Air) exact-head CTS rows are queued on lab hardware and will be posted as a PR comment once their current locks clear.
  • M5 (HAL300) VK_EXT_depth_clip_control remains intentionally gated until M5 PPP admission accepts depth_clip_negative_one_to_one.
Exact-head CTS matrix & environment receipts (2470190)
Machine SoC / Gen Kernel Arm nested (24) depth_clip (72) primitives (72) control GPU faults / New AVCs
J413 (M2 Air) G14G (AGX2) 7.3.0-aurora-fleet87 base (912c9e4cc7e) 12/24 Pass, 0 Fail, 12 NS 0/72 Pass, 0 Fail, 72 NS 0/72 Pass, 0 Fail, 72 NS 87/96 Pass, 0 Fail 0 / 0
J413 (M2 Air) G14G (AGX2) 7.3.0-aurora-fleet87 b1 (24701906cc3) 24/24 Pass, 0 Fail, 0 NS 37/72 Pass, 0 Fail, 35 NS 72/72 Pass, 0 Fail, 0 NS 87/96 Pass, 0 Fail 0 / 0
J713 (M4 Air) G16G (AGX3) 7.3.0-aurora-fleet85 base (912c9e4cc7e) 12/24 Pass, 0 Fail, 12 NS 0/72 Pass, 0 Fail, 72 NS 0/72 Pass, 0 Fail, 72 NS 95/95 Pass, 0 Fail* 0 / 0
J713 (M4 Air) G16G (AGX3) 7.3.0-aurora-fleet85 b1 (24701906cc3) 24/24 Pass, 0 Fail, 0 NS 37/72 Pass, 0 Fail, 35 NS 72/72 Pass, 0 Fail, 0 NS 95/95 Pass, 0 Fail* 0 / 0
Neo G17P (AGX3) 7.3.0-aurora-fleet87 base (912c9e4cc7e) 24/24 Pass, 0 Fail, 0 NS 46/72 Pass, 0 Fail, 26 NS 72/72 Pass, 0 Fail, 0 NS 96/96 Pass, 0 Fail 0 / 0
Neo G17P (AGX3) 7.3.0-aurora-fleet87 b1 (24701906cc3) 24/24 Pass, 0 Fail, 0 NS 46/72 Pass, 0 Fail, 26 NS 72/72 Pass, 0 Fail, 0 NS 96/96 Pass, 0 Fail 0 / 0

*J713 fleet85 has one pre-existing baseline MSAA depth submit EINVAL (std_sample_locations.draw.depth), identical across base and b1; all other 95/95 control cases pass.

ICD SHA-256:

  • base (912c9e4cc7e): 18224556d3f839649cc03e525696211342944e49dc5b3b3d3efc8686a5d37797
  • b1 (24701906cc343dc320cb46d2fb159c1814974755): a756b96daa2794af3c5a8c6559c8134de4ae24bdaff6ac11851eb58a62681360

…tives-generated queries

Remove qualification-only chip gates for shared Vulkan extensions whose
implementations are common across Borealis generations:

- VK_EXT_nested_command_buffer: pure software secondary command-buffer
  replay in hk_CmdExecuteCommands() across all generations (G13-G17).
- VK_EXT_depth_clip_control and extendedDynamicState3DepthClipNegativeOneToOne:
  lowered in NIR (agx_nir_lower_clip_m1_1) through the shared root table on
  AGX2 (G13/G14) and native AGX3 (G15/G16/G17P); kept off HAL300 until M5
  PPP profile admission accepts negative-one depth clip.
- VK_EXT_primitives_generated_query: counted in the shared pre-graphics
  helpers across all generations (G13-G17).
- Drop the redundant G16G robustImageAccess override, already unconditionally
  enabled in hk_get_device_features().

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Author

Exact-head 24701906cc34 (libvulkan_asahi.so sha256 a756b96daa2794af3c5a8c6559c8134de4ae24bdaff6ac11851eb58a62681360) CTS receipt on J316s (M1 Pro, G13X AGX2, 7.3.0-aurora-fleet87):

Arm nested (24) depth_clip (72) primitives (72) control (96)
base (912c9e4cc7e) 12/24 Pass, 0 Fail, 12 NS 0/72 Pass, 0 Fail, 72 NS 0/72 Pass, 0 Fail, 72 NS 87/96 Pass, 0 Fail
b1 (24701906cc34) 24/24 Pass, 0 Fail, 0 NS 37/72 Pass, 0 Fail, 35 NS 72/72 Pass, 0 Fail, 0 NS 87/96 Pass, 0 Fail

+121 NS -> Pass, 0 Fail, 0 GPU faults, 0 AVCs, SELinux Enforcing, 0 failed units.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Source review of exact head 24701906cc34. No defect.

Checked.

  • nestedCommandBuffer* and primitivesGeneratedQuery* (including WithNonZeroStreams) follow the extension bits.
  • geometryStreams and transformFeedback are true on every path that now gets the query, so non-zero streams are valid there.
  • depthClipControl and extendedDynamicState3DepthClipNegativeOneToOne now follow EXT_depth_clip_control, so the extension and its features can no longer disagree.
  • The removed G16G block was dead code. robustImageAccess and robustImageAccess2 are initialized to true in the same function, and nothing clears them in between.
  • Removing the late EXT_primitives_generated_query override in hk_create_drm_physical_device() leaves a single source of truth.

Notes, not blocking:

  1. EXT_primitives_generated_query and EXT_nested_command_buffer are now also advertised on G18G, which is on the HAL300 path and is admitted. It shares the M5 pre-graphics helpers, so this is probably fine, but no row covers it. The PR body lists G13-G17. If G18G is meant to be included, say so; otherwise keep it out until it has a run.
  2. The G13 (J316s) and G15 (J615) exact-head rows listed under Still to run are the ones that cover the AGX2-only and G15 paths of agx_nir_lower_clip_m1_1. J413 covers G14 only.

@DjDeveloperr DjDeveloperr 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.

Code review of exact head 24701906cc343dc320cb46d2fb159c1814974755 (OPEN, merges cleanly onto current aurora-wip with no overlap against #824). Code changes are clean with no correctness, safety, or policy defects; holding approval only for the remaining G15 exact-head hardware receipt.

Checklist Summary

  • §1 No model gating: Pass. Removes qualification-only chip gates for VK_EXT_nested_command_buffer and VK_EXT_primitives_generated_query, drops the dead AGX_CHIP_G16G override, and scopes VK_EXT_depth_clip_control to !agx_chip_hal300_path(dev->chip) where HAL300 PPP admission (src/asahi/vulkan/hk_cmd_draw.c:9962) still rejects depth_clip_negative_one_to_one.
  • §2 Production-ready: Pass. Feature flags (depthClipControl, extendedDynamicState3DepthClipNegativeOneToOne, nestedCommandBuffer*, primitivesGeneratedQuery*) all track their corresponding supported_extensions->EXT_* bits cleanly, and removing the late EXT_primitives_generated_query override in hk_create_drm_physical_device() leaves one source of truth. The deleted AGX_CHIP_G16G robustImageAccess{,2} block was dead code (both are initialized to true unconditionally at hk_physical_device.c:608 and :923 and never cleared afterwards).
  • §3 Safety & correctness: Pass.
    • Nested command buffers: Pure software replay via vk_cmd_queue_execute() in hk_CmdExecuteCommands() (hk_cmd_buffer.c:522) with conditional rendering save/restore and full graphics/compute state invalidation (while preserving active queries and render pass state).
    • Depth clip control: Lowered in NIR via agx_nir_lower_clip_m1_1 from hk_lower_hw_vs() (hk_shader.c:4192, called for VS/TES at :5495 and GS raster at :8042), fed by clip_z_coeff in the shared root table (hk_nir_lower_descriptors.c:924, updated on the shared slow path at hk_cmd_draw.c:11508; hk_g17p_flush_dynamic_state_fast() bails on any dirty dynamic state). Shader object cache/serialization (hk_shader.c:908,937,7528,9138,9659) and full-frame scissor elision (hk_cmd_draw.c:8988) are consistent across AGX2 and native AGX3.
    • Primitives-generated queries: Handled across both AGX2 and native AGX3 query reset/begin/end/copy paths (hk_query_pool.c), direct/indirect/restart IA helpers (hk_ia_update using the unconditionally mapped RW AGX_SCRATCH_PAGE_ADDRESS from agx_device.c:1534), tessellation (libagx_prefix_sum_tess, with tess_batch disabled when active), and multi-stream geometry shaders (poly_pre_gs in src/poly/cl/geometry.cl:289). hk_g17p_indirect_records_eligible() (hk_cmd_draw.c:14345) bails when active, hk_rast_discard() does not bypass counting, and hk_cmd_invalidate_graphics_state() preserves active prims_generated_query bindings across secondary replay.
  • §4 Clean-room & attribution: Pass. Single commit with human author and Signed-off-by: only; no prohibited trailers or third-party material.
  • §5 Evidence & CI (at 24701906cc343dc320cb46d2fb159c1814974755):
    • CI: statusCheckRollup on aurora-silicon/mesa#928 is empty; mirror CI on DjDeveloperr/mesa (ci/train-pr928, exact head 24701906cc34) passed both aurora-agent-policy (run 45384823239) and asahi build-test (run 45384823323).
    • Hardware verified: G13 (J316s M1 Pro), G14 (J413 M2 Air), G16 (J713 M4 Air), and G17P (Neo regression) all pass with +121 NS -> Pass on G13/G14/G16, 0 Fail, 0 regressions, 0 GPU faults, 0 new AVCs.
    • Remaining for approval: The queued G15 (J615 M3 Air) exact-head CTS receipt covering the G15 command-stream generation.
  • §6 Naming: Pass. Borealis naming used consistently throughout commit message and PR description.

Non-blocking Note

  • Setting .EXT_nested_command_buffer = true and .EXT_primitives_generated_query = true unconditionally also exposes both extensions on AGX_CHIP_G18G (while EXT_depth_clip_control remains gated off by !agx_chip_hal300_path(dev->chip)). Worth noting in the PR/commit summary if G18G is intentionally included alongside G13–G17.

@RyanTheTide

Copy link
Copy Markdown
Author

Exact-head 24701906cc34 (libvulkan_asahi.so sha256 a756b96daa2794af3c5a8c6559c8134de4ae24bdaff6ac11851eb58a62681360) CTS receipt on J615 (M3 Air, G15G AGX3, 7.3.0-aurora-fleet85):

Arm nested (24) depth_clip (72) primitives (46, excl. known G15 GS-xfb baseline) control (96)
base (912c9e4cc7e) 12 Pass / 0 Fail / 12 NS 0 Pass / 0 Fail / 72 NS 0 Pass / 0 Fail / 46 NS 96 Pass / 0 Fail
b1 (24701906cc34) 24 Pass / 0 Fail / 0 NS 37 Pass / 0 Fail / 35 NS 46 Pass / 0 Fail / 0 NS 96 Pass / 0 Fail
  • Delta: +95 NS -> Pass, 0 Fail (nested 12->24, depth_clip 0->37, primitives 0->46).
  • Health: 0 GPU faults, 0 new AVCs, SELinux Enforcing, 0 failed units.
  • All 5 generations (G13X J316s, G14G J413, G15G J615, G16G J713, G17P Neo regression) now have exact-head 24701906cc34 PASS receipts.
  • Evidence: traces/gpu/20261124-neon-gpu-features/j615-g15g/.

@DjDeveloperr DjDeveloperr 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.

Promoting to APPROVE at exact head 24701906cc343dc320cb46d2fb159c1814974755.

All §1–§6 criteria are now satisfied:

  • Code & safety (§1–§4, §6): Verified clean in the prior review at this exact head (zero code/policy blockers, merges cleanly onto aurora-wip).
  • Exact-head CI (§5): Mirror aurora-agent-policy (45384823239) and asahi build-test (45384823323) both PASS on 24701906cc343dc320cb46d2fb159c1814974755.
  • Exact-head hardware (§5): J615 (M3 Air, G15G) receipt posted (+95 NS -> Pass, 0 Fail, 0 GPU faults, 0 new AVCs, SELinux Enforcing, 0 failed units), completing exact-head PASS coverage across all five generations (G13X J316s, G14G J413, G15G J615, G16G J713, G17P Neo).

@DjDeveloperr
DjDeveloperr merged commit 43f1a91 into aurora-wip Nov 24, 2026
@DjDeveloperr

Copy link
Copy Markdown

Merged into aurora-wip at exact head 24701906cc343dc320cb46d2fb159c1814974755.

  • Review: Approved at exact head by @DjDeveloperr; source review by @RyanTheTide found no defects.
  • CI: Mirror asahi (45384823323) and aurora-agent-policy (45384823239) both PASS; local policy check clean, 1/1 Signed-off-by:.
  • Hardware verification: Exact-head Borealis CTS PASS across G13X, G14G, G15G, G16G, and G17P with 0 failures and 0 GPU faults.

RyanTheTide added a commit that referenced this pull request Nov 24, 2026
Resolve conflict in hk_physical_device.c after #928 and #930 merged.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide deleted the feat/borealis-shared-vk-extensions branch November 27, 2026 13:20
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