Skip to content

agx: remove compiler probes and diagnostics - #498

Merged
RyanTheTide merged 1 commit into
aurora-wipfrom
hack/agx-probe-knobs
Nov 19, 2026
Merged

RyanTheTide merged 1 commit into
aurora-wipfrom
hack/agx-probe-knobs

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 19, 2026 •

Copy link
Copy Markdown

Problem

Mesh lowering, the G17P ray-query lowering, compute derivatives, the G17P graphics program and empty-fragment packing carried off-by-default probes and diagnostics read from the environment (ASAHI_MESH_CONTRACT_DEBUG, _PP_AUDIT, _MARKER_VA, _PP_AUDIT_FAN, _PP_PROBE, _PP_VIT_SOURCE, _NATIVE_PAGE_CARRIER, ASAHI_G17P_CAPTURE_SCS_INDEX, _RQ_LOWERING_DIAGNOSTIC, _COMPUTE_HW_DERIVATIVE_DIAGNOSTIC, _ZERO_COLOUR_RELEASE_DIAGNOSTIC, _EMPTY_FS_PIXEL_DIAGNOSTIC, ASAHI_M5_TILE_DATA_COPY_PROBE).

Change

Delete them with their code paths. ASAHI_MESH_NATIVE_PAGE_CARRIER's unset value (2 words) becomes PAGE_CARRIER_WORDS. Default code generation is unchanged on every chip.

Testing

  • x86 build (clang, release, asserts on) with -Dbuild-tests=true: meson test --suite asahi 138/138 pass, same as aurora-wip.

  • The precompiled libagx output (libagx.{h,cpp,spv}, libagx_shaders.{c,h}) is byte-identical to aurora-wip, so internal kernels for every target compile to the same code.

  • Merged with the other cleanup branches on top of current aurora-wip c55152d: clean merge, 138/138.

  • Combined with all HACK-MESA PRs on aurora-wip c55152d, M1 Pro (G13S, AGX2) overlay A/B against the tip built with the same toolchain: deqp-vk 195,000 common cases (mesh, multiview, ray query, compute, render passes, query pools, multisample), 46,267 Pass / 148,733 NotSupported in both arms, 0 changed; extension sets identical; glmark2 8672/8844 vs 8617/8746, vkmark 10805/10842 vs 10777 (noise); no kernel, GPU or firmware errors.

  • Combined with all HACK-MESA PRs on aurora-wip cc932aa, M4 Pro J616s (G17P) overlay A/B against the tip built with the same toolchain: deqp-vk 228,000 common cases, the only change is dEQP-VK.mesh_shader.ext.properties.max_view_index Pass -> Fail from hk: report the real maxMeshMultiviewViewCount #494 (CTS view-mask defect, CTS: mesh_shader max_view_index view mask overflows at 32 views (expected failure on G17P) #516; only layer 0 is drawn); extension sets identical; glmark2 12670/12542 vs 13244/13385, vkmark 11928/11958 vs 12116/12110 (single order, not claimed); no kernel, GPU or firmware errors. ray_query.stress was excluded from both arms after it crashed the GPU firmware in the baseline arm (G17P: GPU firmware crash with parallel dEQP-VK.ray_query.stress cases (M4 Pro) #543).

  • Same combined tree on the MacBook Neo (A18 Pro, G17P): deqp-vk 183,000 common cases, again only the expected max_view_index change; glcts subset 14,000 common, 0 changed; glmark2/vkmark measured in both orders, means within 0.7 % (noise); no kernel, GPU or firmware errors.

Still to run

  • Nothing.
Details

ASAHI_G17P_COMPUTE_IMPLICIT_LOD_DIAGNOSTIC stays for now because hk_nir_lower_descriptors.c also calls it; it goes in a joint follow-up. 9 files, +22 / -330.

Assisted-by: LLM (Claude:Opus 5.5)

These switches, all off by default, served bring-up of features that
are finished. Each makes the compiler emit code that is wrong for the
application (probe values in place of outputs, capture stores to a fixed
address, a different coefficient source, a missing lowering) or prints
refusal details through a separate ad-hoc variable. Remove them with
their code:

- ASAHI_G17P_EMPTY_FS_PIXEL_DIAGNOSTIC: pixel entry and release in an
  empty G17P fragment shader.
- ASAHI_M5_TILE_DATA_COPY_PROBE: copies of M5 multisample tile data
  before ST_TILE.
- ASAHI_MESH_PP_AUDIT, ASAHI_MESH_MARKER_VA and ASAHI_MESH_PP_AUDIT_FAN:
  capture stores of the mesh per-primitive records.
- ASAHI_MESH_PP_PROBE: storage addresses in place of the VAR0 output.
- ASAHI_MESH_NATIVE_PAGE_CARRIER: a one-word page carrier for the
  per-primitive storage address; the default two-word carrier is now
  the PAGE_CARRIER_WORDS constant.
- ASAHI_MESH_CONTRACT_DEBUG: refusal prints in the Gen1 mesh lowering.
- ASAHI_MESH_PP_VIT_SOURCE: override of the PrimitiveID coefficient
  source.
- ASAHI_G17P_CAPTURE_SCS_INDEX: capture store of the SCS thread index in
  ray-query kernels.
- ASAHI_G17P_RQ_LOWERING_DIAGNOSTIC: refusal print of the Gen1 ray-query
  lowering.
- ASAHI_G17P_COMPUTE_HW_DERIVATIVE_DIAGNOSTIC: skipping the compute
  derivative lowering.
- ASAHI_G17P_ZERO_COLOUR_RELEASE_DIAGNOSTIC: a zero colour release mask
  for G17P background and end-of-tile programs.

With no variable set the generated code is unchanged; every removed
branch was off by default. The precompiled libagx output is
byte-identical.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
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.

1 participant