Skip to content

borealis: expose VK_EXT_texture_compression_astc_hdr on M5 - #1081

Merged
RyanTheTide merged 4 commits into
aurora-wipfrom
satchlj/m5-astc-hdr
Nov 28, 2026
Merged

RyanTheTide merged 4 commits into
aurora-wipfrom
satchlj/m5-astc-hdr

Conversation

@satchlj

@satchlj satchlj commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

What: Expose VK_EXT_texture_compression_astc_hdr and its textureCompressionASTC_HDR feature on M5 (G17G/G17S/G17C) via an explicit agx_chip_has_astc_hdr() capability predicate (!agx_chip_hal300_path(chip) || agx_chip_g17_m5(chip)), add unit coverage for the capability helper in test-native-feature-defaults.c, and add a Gen10 texture descriptor pack/unpack unit test covering all fourteen ASTC HDR channel layouts (AGX_CHANNELS_ASTC_4X4 through AGX_CHANNELS_ASTC_12X12 with AGX_TEXTURE_TYPE_FLOAT).

Tested: 77a197fdb173 (clean merge with aurora-wip 30df6feb98f) on Mac Studio M5 Max (J775c / G17C B1, Borealis overlay ICD, MESA_SHADER_CACHE_DISABLE=1, 0 GPU faults): 333/333 --suite asahi unit tests (MALLOC_PERTURB_=42, native GCC 16 release + -Db_ndebug=false -Dtools=asahi,drm-shim) and 2,376 PASS / 0 FAIL live ASTC HDR Vulkan CTS cases (monolithic.sampler 2D 1,036/1,036, host_image_copy 84/168, copy_and_blit 1,256/2,120), following the full 4,669 PASS / 0 FAIL 6-family sweep across all 14 VK_FORMAT_ASTC_*_SFLOAT_BLOCK formats at 4e697bff9ea7.

Not yet: Other HAL300 encodings such as AGX3D (G18G) stay off by default until qualified on their hardware. Direct hardware verification on a second AGX3C/HAL300 machine (such as J714s / G17S or G17G) is not yet recorded because only Mac Studio M5 Max (J775c / G17C B1) is available in this lab.

Risk: two-way · M5 family Macs (G17G/G17S/G17C) — reverting the agx_chip_has_astc_hdr() extension gate withdraws VK_EXT_texture_compression_astc_hdr on M5 without affecting AGX2, native AGX3, or AGX3D (G18G).

Evidence
  • All fourteen 2D ASTC HDR formats (VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK through VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK) already map to hardware AGX_CHANNELS_ASTC_* + AGX_TEXTURE_TYPE_FLOAT entries in ail_pixel_format[], pack into Gen10 texture descriptors in hk_pack_native_texture(), and route block copies through HK_G17P_BLOCK_FORMAT_ASTC_HDR.
  • agx_chip_has_astc_hdr(chip) keeps existing non-HAL300 exposure across AGX2 and native AGX3 (!agx_chip_hal300_path(chip)) and explicitly selects AGX3C/HAL300 via agx_chip_g17_m5(chip), failing closed on AGX3D (G18G) and any future HAL300 encodings until qualified.
  • Exact-head re-verification at 77a197fdb173 (merge of aurora-wip 30df6feb98f) on Mac Studio M5 Max (J775c / G17C B1):
    • Native GCC 16 build (-Dbuildtype=release -Db_ndebug=false -Dbuild-tests=true -Dtools=asahi,drm-shim): MALLOC_PERTURB_=42 meson test -C build --suite asahi --print-errorlogs -> 333/333 OK (0 FAIL).
    • vulkaninfo via isolated Borealis overlay ICD: VK_EXT_texture_compression_astc_hdr : extension revision 1, textureCompressionASTC_HDR = true.
    • Live Vulkan CTS (MESA_SHADER_CACHE_DISABLE=1, GPU_FAULT_DELTA=0):
      • dEQP-VK.pipeline.monolithic.sampler.view_type.2d.format.astc_*_sfloat_block.*: 1,036/1,036 PASS, 0 FAIL.
      • dEQP-VK.image.host_image_copy.simple*astc*sfloat_block*: 84/168 PASS, 0 FAIL, 84 NotSupported.
      • dEQP-VK.api.copy_and_blit.core*astc*sfloat*: 1,256/2,120 PASS, 0 FAIL, 864 NotSupported.
  • Full 6-family sweep at 4e697bff9ea7 on Mac Studio M5 Max (J775c / G17C B1, MESA_SHADER_CACHE_DISABLE=1, GPU_FAULT_DELTA=0):
    • dEQP-VK.api.info.get_physical_device_properties2.features.*: 192/192 PASS, 0 FAIL.
    • dEQP-VK.api.device_init.create_device_unsupported_features*: 225/225 PASS, 0 FAIL.
    • dEQP-VK.pipeline.monolithic.sampler*astc*sfloat_block*: 1,456/2,816 PASS, 0 FAIL, 1,360 NotSupported.
    • dEQP-VK.pipeline.shader_object_unlinked_spirv.sampler*astc*sfloat_block*: 1,456/2,816 PASS, 0 FAIL, 1,360 NotSupported.
    • dEQP-VK.image.host_image_copy.simple*astc*sfloat_block*: 84/168 PASS, 0 FAIL, 84 NotSupported.
    • dEQP-VK.api.copy_and_blit.core*astc*sfloat*: 1,256/2,120 PASS, 0 FAIL, 864 NotSupported.
    • dEQP-VK.image.astc_decode_mode.*sfloat*: 0/68 PASS, 0 FAIL, 68 NotSupported (VK_EXT_astc_decode_mode not advertised).

All fourteen 2D ASTC HDR formats (VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK
through VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK) already map to hardware
AGX_CHANNELS_ASTC_* + AGX_TEXTURE_TYPE_FLOAT entries in ail_pixel_format[],
pack cleanly into Gen10 texture descriptors, and use the shared
HK_G17P_BLOCK_FORMAT_ASTC_HDR block copy path.

Expose VK_EXT_texture_compression_astc_hdr and its corresponding
textureCompressionASTC_HDR feature on M5 (G17G/G17S/G17C), keeping
only G18G gated until qualified on M6 hardware, and add a Gen10
descriptor pack/unpack unit test covering all fourteen ASTC HDR
channel layouts.

Signed-off-by: Satya Benson <satya@benson.earth>
@satchlj
satchlj requested review from a team and DjDeveloperr as code owners November 25, 2026 19:35

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

LGTM — clean 2-file change widening EXT_texture_compression_astc_hdr (and textureCompressionASTC_HDR) across M5 (dev->chip != AGX_CHIP_G18G, matching EXT_sample_locations) plus Gen10 pack/unpack/repack unit coverage across all 14 ASTC HDR channel layouts, backed by 322/322 Asahi unit tests and 4,671 PASS / 0 FAIL Vulkan CTS on Mac Studio M5 Max.

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

Verdict: FINISH, then merge at 19eb79e69994.

Blockers:

  1. src/asahi/vulkan/hk_physical_device.c:374 uses dev->chip != AGX_CHIP_G18G. This advertises the feature on any future HAL300 device as soon as it is admitted, even if it lacks the qualified ASTC HDR path. Keep existing non-HAL300 exposure and select the added paths by the existing AGX3C/HAL300 capability or an ASTC HDR descriptor capability. Document where the other encoding remains unsupported. Preserve the J775c positive result and add an exact shared positive row on J714s or another AGX3C/HAL300 device.

Checked: The two-file diff, the 14 descriptor formats, the existing HAL300 and encoding selectors, and the exact J775c run of 4,671 cases without failures or faults.

Evidence

The tested cases exercise the Gen10 ASTC HDR packing and copy path. The existing agx_chip_g17_m5() already matches ISA encoding and command-stream generation. The new expression uses one chip ID and would enable subsequent HAL300 variants without checking either.

Replace the negative single-chip exclusion (dev->chip != AGX_CHIP_G18G)
with agx_chip_has_astc_hdr() = !agx_chip_hal300_path(chip) ||
agx_chip_g17_m5(chip), preserving existing non-HAL300 exposure across AGX2
and native AGX3 while explicitly selecting AGX3C/HAL300 (M5) and failing
closed on AGX3D (G18G) and any future HAL300 encodings until qualified.

Add unit coverage for agx_chip_has_astc_hdr() in
test-native-feature-defaults.c.

Signed-off-by: Satya Benson <satya@benson.earth>
@satchlj

satchlj commented Nov 25, 2026

Copy link
Copy Markdown
Member Author

Addressed in 4e697bff9ea7:

  • Replaced the single-chip exclusion (dev->chip != AGX_CHIP_G18G) with an explicit capability helper agx_chip_has_astc_hdr(chip) (!agx_chip_hal300_path(chip) || agx_chip_g17_m5(chip)) in src/asahi/lib/agx_chip.h, keeping existing non-HAL300 exposure on AGX2/native AGX3, explicitly selecting AGX3C/HAL300 (M5), and failing closed on AGX3D (G18G) and any future HAL300 encodings until qualified.
  • Documented the non-AGX3C HAL300 boundary in agx_chip.h and hk_physical_device.c, and added unit assertions for agx_chip_has_astc_hdr() in src/asahi/vulkan/tests/test-native-feature-defaults.c.
  • Re-verified exact head 4e697bff9ea7 on Mac Studio M5 Max (J775c / G17C B1): 322/322 --suite asahi unit tests (MALLOC_PERTURB_=42) and 4,669 PASS / 0 FAIL live Vulkan CTS across all 14 VK_FORMAT_ASTC_*_SFLOAT_BLOCK formats (MESA_SHADER_CACHE_DISABLE=1, 0 GPU faults).
  • Only Mac Studio M5 Max (J775c) is available in this lab, so an additional AGX3C/HAL300 row (e.g. J714s) is noted under Not yet and welcome from a reviewer with M5 Pro hardware.

@RyanTheTide

Copy link
Copy Markdown

Depth clip control #1082 has landed and GitHub now reports a conflict at 4e697bff9ea7. Please merge the current aurora-wip into this branch normally, keeping both capability predicates and both sets of feature tests. The earlier chip-selection finding is resolved at this head. The remaining hardware result is the current-head J714s or equivalent ASTC HDR check.

Signed-off-by: Satya Benson <satya@benson.earth>
@satchlj

satchlj commented Nov 25, 2026

Copy link
Copy Markdown
Member Author

Merged aurora-wip (3001252fae9f) into satchlj/m5-astc-hdr at 67d5cc23db4d and pushed normally, keeping both agx_chip_has_depth_clip_control() and agx_chip_has_astc_hdr() in src/asahi/lib/agx_chip.h along with both test blocks in src/asahi/vulkan/tests/test-native-feature-defaults.c.

Re-verified at 67d5cc23db4d:

  • Native GCC 16 (-Dbuildtype=release -Db_ndebug=false): MALLOC_PERTURB_=42 meson test -C build --suite asahi -> 322/322 OK (0 failed).
  • Mac Studio M5 Max (J775c / G17C B1) live Vulkan CTS (dEQP-VK.pipeline.monolithic.sampler.view_type.2d.format.astc_*_sfloat_block.*, MESA_SHADER_CACHE_DISABLE=1): 1,036/1,036 PASS / 0 FAIL, 0 kernel GPU faults.

No J714s host is available here, so the requested J714s current-head ASTC HDR check remains open for a J714s machine.

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

Verdict: FINISH, then merge at 67d5cc23db4d

Blockers: none. The chip-ID finding from my review at 19eb79e6999 is fixed.

Checked: agx_chip_has_astc_hdr() (!agx_chip_hal300_path(chip) || agx_chip_g17_m5(chip)) replaces dev->chip != AGX_CHIP_G18G: non-HAL300 exposure is unchanged, M5 is selected through the existing encoding/command-stream predicate, and G18G plus any later HAL300 encoding stays off until qualified. The limit is documented in agx_chip.h and hk_physical_device.c, and test-native-feature-defaults.c asserts the helper. Your J775c row at this head (322/322 unit, 1,036/1,036 ASTC HDR sampler CTS) is on the PR.

Left to finish (not code blockers):

  1. GitHub reports a conflict again: merging current aurora-wip (d2e883ab2e3) conflicts in src/asahi/lib/agx_chip.h and src/asahi/vulkan/tests/test-native-feature-defaults.c (other capability helpers landed next to yours). Please merge aurora-wip into the branch again (a normal merge, as last time), keeping all helpers and test blocks.
  2. The second-M5 row (J714s or another AGX3C machine) at the merged head; we will ask for it.
Evidence
  • git diff $(git merge-base aurora-wip pr/1081) pr/1081: 4 files, +79/-3 (agx_chip.h, hk_physical_device.c, test-hk-native-descriptor.c, test-native-feature-defaults.c).
  • git merge-tree --write-tree origin/aurora-wip pr/1081 at d2e883ab2e3: conflicts in the two files above.

Signed-off-by: Satya Benson <satya@benson.earth>
@satchlj
satchlj requested review from a team as code owners November 27, 2026 13:16
@satchlj
satchlj requested a review from malik-na November 27, 2026 13:16
@satchlj

satchlj commented Nov 27, 2026 •

Copy link
Copy Markdown
Member Author

Merged aurora-wip (30df6feb98f) into satchlj/m5-astc-hdr at 77a197fdb173, preserving both agx_chip_has_packed_ycbcr / agx_chip_has_astc_hdr and both test blocks in test-native-feature-defaults.c.

@satchlj

satchlj commented Nov 27, 2026

Copy link
Copy Markdown
Member Author

Exact-head verification at 77a197fdb173 on Mac Studio M5 Max (J775c, G17C B1, kernel 7.3.0, Borealis overlay ICD, MESA_SHADER_CACHE_DISABLE=1):

  • Native GCC 16 (-Dbuildtype=release -Db_ndebug=false -Dbuild-tests=true -Dtools=asahi,drm-shim): MALLOC_PERTURB_=42 meson test -C build --suite asahi --print-errorlogs -> 333/333 OK, 0 FAIL.
  • vulkaninfo: VK_EXT_texture_compression_astc_hdr : extension revision 1, textureCompressionASTC_HDR = true.
  • dEQP-VK.pipeline.monolithic.sampler.view_type.2d.format.astc_*_sfloat_block.*: 1,036/1,036 PASS, 0 FAIL.
  • dEQP-VK.image.host_image_copy.simple*astc*sfloat_block*: 84/168 PASS, 0 FAIL, 84 NotSupported.
  • dEQP-VK.api.copy_and_blit.core*astc*sfloat*: 1,256/2,120 PASS, 0 FAIL, 864 NotSupported.
  • Kernel dmesg GPU fault / Oops / WARN delta: 0.

Ready for a second M5 machine (e.g. J714s / J716c) exact-head row and merge.

@RyanTheTide

Copy link
Copy Markdown

Merge-train landing at 77a197fdb173.

  • Review: DjDeveloperr APPROVE + RyanTheTide (review lane) APPROVE at 67d5cc2; the only later commit is an aurora-wip merge (non-author).
  • Feature row: the author's exact-head hardware row on this PR.
  • Regression: combined A/B overlay of aurora-wip plus this PR and the other queued PRs, user space, default kernel command line. M1 Pro (G13S, fleet89): 0 status changes. M4 Pro (G16S, fleet89): 0 regressions. The only flips there are 5 synchronization multi_queue timeouts under 4-job load; all 5 pass 3/3 alone on both arms, and the base arm shows the same flake. Each Mac ran 26,595 dEQP-VK + 8,153 dEQP-GLES cases, with 0 GPU firmware crashes, Enforcing, 0 failed units. Evidence traces/gpu/20261128-mergetrain-mesa.

Revert: git revert -m 1 <merge commit> on aurora-wip. A regression gets reverted first and fixed after.

@RyanTheTide
RyanTheTide merged commit 9c89a59 into aurora-wip Nov 28, 2026
@RyanTheTide
RyanTheTide deleted the satchlj/m5-astc-hdr branch November 28, 2026 05:58
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.

3 participants