Skip to content

borealis: advertise meshAndTaskShaderDerivatives on M5 - #1342

Merged
RyanTheTide merged 1 commit into
aurora-silicon:aurora-wipfrom
m0d16l14n1:j815/m5-mesh-derivatives
Nov 29, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:aurora-wipfrom
m0d16l14n1:j815/m5-mesh-derivatives

Conversation

@m0d16l14n1

Copy link
Copy Markdown

What: Advertise meshAndTaskShaderDerivatives (VK_KHR_compute_shader_derivatives) on M5, as on G17P. Mesh and task derivatives use the same NIR lowering as compute derivatives (quad swaps, explicit-gradient samples), which is not chip specific; hk_shader.c already applies it whenever the property is set.
Tested: J815 MacBook Air 15" M5 (T8142, G17G), Borealis, kernel 7.3.0-aurora-j815-dev, at da406b6 vs base 8bad0a5: compute_shader_derivatives.mesh.* + .task.* (366 cases) 366 NotSupported -> 366 Pass; meson test --suite asahi 223/223; Godot TPS demo 1080p FSR2 voxel GI (FAST=1): 49.4 / 49.4 static, 57.4 route vs 49.5 / 49.7, 57.5 base (neutral). 0 GPU faults. Regression line: 0 SELinux denials (N/A on this image), 0 failed units, 0 new kernel errors.
Risk: two-way door · M5 (G17G/G17S/G17C) Macs with mesh shaders; property only.
Not yet: M5 Pro/Max (G17S/G17C) hardware; no game on this desktop uses mesh shader derivatives.

Details
  • hk_physical_device.c +2/-1: (dev->chip == AGX_CHIP_G17P || agx_chip_g17_m5(dev->chip)) && features->meshShader.
  • The lowering that makes derivatives work in compute already runs for mesh/task stages when the property is set; no compiler change.
Evidence

Commands (gpu-perf):

CASE_S=60 python3 tools/deqp-ab.py r3-mderiv deqp-lists/mesh-deriv-20261129.txt a=<base 8bad0a5741b ICD> b=<da406b66eff ICD>
CASE_S=60 python3 tools/deqp-ab.py r3-gate deqp-lists/gate-20261128.txt a=<base> b=<da406b66eff> (+ the other PR heads as further arms)
FAST=1 tools/mesa-ab.sh r3-tps a=<base> ... b=<da406b66eff> (one arm per PR head)

mesh-deriv-20261129.txt: every dEQP-VK.spirv_assembly.instruction.compute.compute_shader_derivatives.{mesh,task}.* case

caselist deqp-lists/mesh-deriv-20261129.txt (366 cases)
a (base) 0 s: {'NotSupported': 366} new GPU fault lines: 0
b (da406b6) 1 s: {'Pass': 366} new GPU fault lines: 0
b vs a: 366 diffs, 0 regressions, 366 fixes
   dEQP-VK.spirv_assembly.instruction.compute.compute_shader_derivatives.mesh.derivative_value.coarse.float32.linear.16_1_1: NotSupported -> Pass
   dEQP-VK.spirv_assembly.instruction.compute.compute_shader_derivatives.mesh.derivative_value.coarse.float32.linear.4_4_1: NotSupported -> Pass
   dEQP-VK.spirv_assembly.instruction.compute.compute_shader_derivatives.mesh.derivative_value.coarse.float32.quads.4_4_1: NotSupported -> Pass
   dEQP-VK.spirv_assembly.instruction.compute.compute_shader_derivatives.mesh.derivative_value.coarse.float32.quads.4_4_1_local_inv_index: NotSupported -> Pass
   ...

Gate (15,958, broad regression list):

caselist deqp-lists/gate-20261128.txt (15958 cases)
a (base) 128 s: {'Pass': 11230, 'NotSupported': 4728} new GPU fault lines: 0
b (da406b6) 128 s: {'Pass': 11230, 'NotSupported': 4728} new GPU fault lines: 0
b vs a: 0 diffs, 0 regressions, 0 fixes

Godot TPS demo, 1080p FSR2 voxel GI, FAST=1 (BENCH lines, a = base, b = this PR):

a BENCH view=1 frames=742 fps=49.5 ms_p50=20.15 ms_p95=22.44 ms_p99=24.37 ms_max=58.0 gpu_p50=19.95 gpu_p95=20.66 cpu_p50=4.06
a BENCH view=1 frames=100 fps=49.7 ms_p50=20.01 ms_p95=22.12 ms_p99=24.18 ms_max=24.2 gpu_p50=20.04 gpu_p95=20.70 cpu_p50=4.53
a BENCH view=play frames=1383 fps=57.5 ms_p50=17.34 ms_p95=20.48 ms_p99=21.85 ms_max=24.3 gpu_p50=17.05 gpu_p95=19.89 cpu_p50=2.15
b BENCH view=1 frames=741 fps=49.4 ms_p50=20.15 ms_p95=21.93 ms_p99=24.15 ms_max=53.9 gpu_p50=19.95 gpu_p95=20.63 cpu_p50=4.12
b BENCH view=1 frames=99 fps=49.4 ms_p50=20.09 ms_p95=21.84 ms_p99=24.08 ms_max=43.7 gpu_p50=20.03 gpu_p95=20.58 cpu_p50=4.40
b BENCH view=play frames=1380 fps=57.4 ms_p50=17.31 ms_p95=20.89 ms_p99=22.59 ms_max=37.9 gpu_p50=17.07 gpu_p95=19.94 cpu_p50=2.10

Mesh and task shader derivatives use the same NIR lowering as compute
derivatives (quad swaps and explicit-gradient samples), which is not
chip specific. hk_shader.c already applies it whenever the property is
set, so the M5 parts only need to report it, like G17P.

Signed-off-by: Nick <nekreshen@yandex.ru>
@m0d16l14n1
m0d16l14n1 requested review from a team and DjDeveloperr as code owners November 29, 2026 09:43

@aurora-silicon-review aurora-silicon-review Bot 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: MERGE at da406b66

Blockers: none.

Checked:

  • Audited src/asahi/vulkan/hk_physical_device.c (+2/-1): extends .meshAndTaskShaderDerivatives from dev->chip == AGX_CHIP_G17P to (dev->chip == AGX_CHIP_G17P || agx_chip_g17_m5(dev->chip)) && features->meshShader, reusing the existing chip-independent NIR derivative lowering in hk_shader.c.
  • Exact-head J815 M5 (G17G) Borealis A/B verification: compute_shader_derivatives.{mesh,task}.* (366 cases) 366 NotSupported -> 366 Pass (0 regressions), 15,958-case dEQP gate (11,230 = 11,230, 0 diffs), meson test --suite asahi 223/223, Godot TPS 1080p FSR2 neutral, 0 GPU faults.
  • DCO Signed-off-by: present; no Apple material or policy issues.
Evidence
  • Diff: src/asahi/vulkan/hk_physical_device.c (+2/-1).
  • Note (non-blocking): M5 Pro/Max (G17S/G17C) hardware not yet run; same agx_chip_g17_m5() mesh/task derivative lowering path.

@RyanTheTide

Copy link
Copy Markdown

@DjDeveloperr, code-owner heads-up: App approval at da406b66effc from a different lane. This PR goes into the merge train's next combined A/B (aurora-wip 8bad0a57 + #1330 #1336 #1337 #1339 #1341 #1342 #1343 #1345 #1346 #1347 #1348) on M1 Pro G13S + M4 G16G. If that row is clean, I plan to land it via --admin under the 6-point rule no earlier than one hour from now, unless you post a hold.

@RyanTheTide

Copy link
Copy Markdown

Merge-train landing at da406b66effc.

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

@RyanTheTide
RyanTheTide merged commit d4fd354 into aurora-silicon:aurora-wip Nov 29, 2026
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