Skip to content

borealis: expose single-texel buffer offsets on every M5 part - #450

Merged
DjDeveloperr merged 1 commit into
aurora-wipfrom
j716c/single-texel
Nov 22, 2026
Merged

DjDeveloperr merged 1 commit into
aurora-wipfrom
j716c/single-texel

Conversation

@erikwb

@erikwb erikwb commented Nov 18, 2026 •

Copy link
Copy Markdown

Problem

On M5 GPUs (G17G, G17S, G17C), Borealis did not advertise uniformTexelBufferOffsetSingleTexelAlignment or storageTexelBufferOffsetSingleTexelAlignment, causing vkd3d-proton to reject the adapter during alignment checks.

Change

Native AGX3 and every M5 part (G17G, G17S, G17C) view texel buffers through the 2D texture/PBE descriptor with the software alignment tail in src/asahi/vulkan/hk_buffer_view.c, and the lowering paths consume that metadata for fetches, loads and stores.

In src/asahi/vulkan/hk_physical_device.c, include agx_chip_g17_m5(dev->chip) alongside agx_chip_native_agx3(dev->chip) in agx3_texel_buffer_tail so every M5 part:

  • advertises uniformTexelBufferOffsetSingleTexelAlignment and storageTexelBufferOffsetSingleTexelAlignment, and
  • reserves the worst-case 15 R8 texels of alignment tail in maxTexelBufferElements (AGX_TEXTURE_BUFFER_MAX_SIZE - 15 = 268,435,441) so a maximally sized view at a single-texel offset still fits the native 2D descriptor.

G18G stays excluded because it takes the legacy buffer-view path, which has no software tail, and keeps its 16-byte alignment. G13–G16 and G17P limits are unchanged.

Testing

  • Host: meson test --suite asahi passes 140/140 (0 fail); aarch64 Borealis cross-build succeeds.
  • J716c (M5 Max, G17C B1, kernel 7.3.0-ewb270+) — base afcc08b710 vs head d48f3d02203:
    • vulkaninfo: maxTexelBufferElements 268435456 → 268435441; uniformTexelBufferOffsetSingleTexelAlignment and storageTexelBufferOffsetSingleTexelAlignment false → true.
    • Native Vulkan compute probe (15/15 exact, 0 GPU faults in dmesg): R8 uniform offsets 1, 7 and 15 at 513 texels and at maximum view size (268,435,441 texels); R32 and RGB32 uniform component-aligned offsets 4, 8 and 12; R32 storage buffer-view read/write at offsets 4, 8 and 12.
    • Vulkan CTS A/B (0 GPU faults or new kernel errors in dmesg):
      • dEQP-VK.api.buffer_view.*: 656 Pass, 348 NotSupported, 0 Fail on both (0 diffs).
      • dEQP-VK.api.info.{vulkan1p3_limits_validation,device_properties,instance_extensions,get_physical_device_properties2}.*: 1288 Pass, 920 NotSupported, 0 Fail on both (0 diffs).
    • Previously verified: Cyberpunk 2077 benchmark completed through ARM64EC on Borealis with this change.
  • J713 (M4, G16G B0, kernel 7.3.0-1-40-ARCH, unchanged path regression check):
    • vulkaninfo unchanged (maxTexelBufferElements = 268435441, uniform and storage single-texel alignment true).
    • Native Vulkan compute probe (15/15 exact, including R8 offsets 1, 7 and 15 at 268,435,441 texels), 0 GPU faults or new kernel errors in dmesg.

Still to run

  • M5 (G17G) and M5 Pro (G17S): not available in our lab (only J716c M5 Max / G17C and J713 M4 / G16G were tested). Needs a base-vs-head run of dEQP-VK.api.buffer_view.*, dEQP-VK.api.info.*, texel-buffer CTS cases, and the R8 offset 1/7/15 max-size (268,435,441) readback check on G17G and/or G17S with 0 GPU faults.
  • Full dEQP-VK.api.info.* and binding_model / robustness texel-buffer CTS groups on G17C.

Assisted-by: LLM (OpenAI:GPT-6.2, Anthropic:Claude Opus 5.5, Google:Gemini 4 Neon)

@RyanTheTide

Copy link
Copy Markdown

Thanks for this; getting vkd3d-proton past the alignment check is a real fix.

We select behaviour by a hardware property rather than by the chip it was tested on. The texel-buffer tail is enabled for one M5 part:

  • src/asahi/vulkan/hk_physical_device.c:1121-1122 const bool agx3_texel_buffer_tail = agx_chip_native_agx3(dev->chip) || dev->chip == AGX_CHIP_G17C;

The comment you updated says the reason is the AGX3 texture/PBE including the alignment tail in its height, which G17G and G17S share with G17C. Could the test be agx_chip_native_agx3(dev->chip) || agx_chip_g17_m5(dev->chip) (or the descriptor generation that has the tail), so every M5 part reports the same limits? If G17G or G17S differ, a short comment with that reason is enough.

Happy to run rows on our M1 Pro, M2, M4 Pro and A18 Pro if that helps.

@DjDeveloperr

Copy link
Copy Markdown

Merge train: independent review (code only, Opus 5.5 xhigh)

Verdict: CLEAN WITH NITS. No blocker or major. Only G17C's reported device limits change (single-texel alignment plus the reserved 15-element R8 tail); there's no codegen or layout change on any chip.

  • Widening: the property gate RyanTheTide suggests (agx_chip_native_agx3 || agx_chip_g17_m5) is correct as written, because all M5 parts share the buffer-view tail path. G18G is not safe: it takes the legacy buffer-view path.
  • NIT: the comment's "AGX3" overstates the scope.

Train: held only on the open property-gate request (owner decision pending on merging G17C-gated PRs as-is). If widened to G17G/G17S, the M5 Pro (G17S) gate would cover it (dEQP-VK.texel_buffer., api.info., api.buffer_view.).

@RyanTheTide RyanTheTide changed the title hk: expose single-texel buffer offsets on G17C borealis: expose single-texel buffer offsets on G17C Nov 20, 2026
@erikwb
erikwb force-pushed the j716c/single-texel branch from a28eac4 to d333b20 Compare November 21, 2026 00:30
@erikwb erikwb changed the title borealis: expose single-texel buffer offsets on G17C borealis: expose single-texel buffer offsets on every M5 part Nov 21, 2026
@erikwb

erikwb commented Nov 21, 2026

Copy link
Copy Markdown
Author

Note

🤖 Claude Opus 5.5 responding on behalf of erikwb

The tail is now reported on every M5 part: agx_chip_native_agx3(dev->chip) || agx_chip_g17_m5(dev->chip) (d333b20), with the comment saying why G18G stays out (it takes the legacy buffer-view path, which has no tail).

G17G, G17S and G17C share the buffer-view path that writes the software tail and counts it in both descriptor heights (hk_buffer_view.c), and the lowering that reads that metadata for fetches, loads and stores. @DjDeveloperr's comment nit is fixed: it now says "native AGX3 and M5". G17G and G17S are untested; an M5 Pro row with dEQP-VK.texel_buffer.*, api.info.* and api.buffer_view.* would cover them.

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

No blockers. Re-review of d333b20: the tail is now selected by agx_chip_native_agx3() || agx_chip_g17_m5(), with the G18G reason in a comment. That matches the buffer-view and PBE paths in hk_buffer_view.c, which take the tail on the same set. Our point is resolved. Limits on G13-G17P are unchanged. The one gap is the G17G/G17S row you already named (dEQP-VK.texel_buffer.*, api.info.*, api.buffer_view.*).

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown

Looks good; approve once the commit message is fixed and the G17G/G17S row is in.

  1. Commit d333b20 has "Developed with Claude Code." in its message, and the PR body ends with "Created with Codex." A commit should carry only the human author and the Signed-off-by. Please drop that line from the commit and make the body's last line Assisted-by: LLM (<Vendor>:<Model>).

I re-checked the reach at head. agx3_texel_buffer_tail (src/asahi/vulkan/hk_physical_device.c:1124-1127, :1199) covers the same chip set as the buffer-view path that writes the tail: agx_native_graphics() || agx_chip_g17_m5() at src/asahi/vulkan/hk_buffer_view.c:106-107 and the PBE branch at :270. agx_native_graphics() is agx_chip_native_agx3() (src/asahi/lib/agx_device.h:566), so the advertised limits and the descriptors agree on every chip. G18G is in neither set, and nothing changes on G13-G16 or G17P. No other blocker.

HW row: an M5 or M5 Pro (G17G/G17S) on head d333b20. Run dEQP-VK.texel_buffer.*, dEQP-VK.api.info.* and dEQP-VK.api.buffer_view.*, base vs head: no new failures, 0 GPU faults. Also run your R8 offset 1/7/15 readback at the maximum view size.

Assisted-by: LLM (Claude:Opus 5.5)

Native AGX3 and every M5 part (G17G, G17S, G17C) view texel buffers
through the 2D texture/PBE descriptor, and the buffer view and lowering
paths handle the sub-16-byte alignment tail. Report the single-texel
alignment to Vulkan clients on all of them, and reserve room for the
worst-case 15 R8 texels of that tail at the maximum view size.

G18G takes the legacy buffer-view path, which has no tail, and keeps its
16-byte alignment.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb
erikwb force-pushed the j716c/single-texel branch from d333b20 to d48f3d0 Compare November 22, 2026 00:48
@erikwb

erikwb commented Nov 22, 2026

Copy link
Copy Markdown
Author

Note

🤖 Gemini 4 Neon responding on behalf of erikwb

Updated commit attribution and the PR body at d48f3d02203:

  • Dropped Developed with Claude Code. from the commit message (human author/committer and Signed-off-by: Erik Bourget <erik@ebourget.net> only).
  • Rewrote the PR body to the standard sections with Borealis naming and the single Assisted-by: LLM (...) last line.
  • Re-verified on J716c (M5 Max, G17C B1, 7.3.0-ewb270+) and J713 (M4, G16G B0, 7.3.0-1-40-ARCH, unchanged path):
    • Host meson test --suite asahi: 140/140 pass; aarch64 Borealis cross-build clean.
    • J716c (G17C): vulkaninfo reports 268435441 and single-texel uniform/storage true (vs 268435456 / false at afcc08b710); 15/15 compute probe cases exact including R8 offsets 1/7/15 at max view size (268,435,441); CTS A/B (afcc08b710 vs d48f3d02203) has 0 diffs on dEQP-VK.api.buffer_view.* (656 Pass, 348 NotSupported, 0 Fail) and 0 diffs on the 2,208-case dEQP-VK.api.info limits/properties subset (1288 Pass, 920 NotSupported, 0 Fail), 0 GPU faults in dmesg.
    • J713 (G16G): vulkaninfo limits unchanged (268435441, single-texel true), 15/15 compute probe cases exact, 0 GPU faults in dmesg.

We do not have an M5 (G17G) or M5 Pro (G17S) Mac in our lab, so the G17G/G17S hardware row (dEQP-VK.api.buffer_view.*, dEQP-VK.api.info.*, texel-buffer CTS, and R8 offset 1/7/15 max-size readback) remains listed in Still to run for someone with G17G/G17S hardware.

@RyanTheTide

Copy link
Copy Markdown

Re-checked d48f3d0. The commit message is fixed (author and Signed-off-by only), and the code is the same as d333b20, which we already cleared: agx3_texel_buffer_tail (src/asahi/vulkan/hk_physical_device.c:1124-1127, :1199) covers the same chips as the tail paths in hk_buffer_view.c:106-107,269-270. The J716c A/B at this head shows no new failures. No blockers from us. The only open item is the G17G/G17S row already listed under Still to run.

Assisted-by: LLM (Claude:Opus 5.5)

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

Reviewed at d48f3d02203a against the pre-PR checklist. 0 code, attribution, or policy blockers; leaving as COMMENT only because G17G/G17S hardware evidence (and remaining CTS groups) is still owed.

Code & checklist audit

  • Descriptor/property parity (src/asahi/vulkan/hk_physical_device.c:1124-1129, 1196-1199):
    • agx3_texel_buffer_tail (agx_chip_native_agx3(dev->chip) || agx_chip_g17_m5(dev->chip)) matches the exact chip set using the 2D texture/PBE software alignment tail in src/asahi/vulkan/hk_buffer_view.c:105,203-227,267-278 and src/asahi/vulkan/hk_shader.c:3475 (agx_chip_native_or_m5()). (Optional non-blocking nit: agx_chip_native_or_m5(dev->chip) can be used directly.)
    • Reserving 15 R8 texels in maxTexelBufferElements (AGX_TEXTURE_BUFFER_MAX_SIZE - 15 = 268,435,441) keeps elements + tail_offset_el within the 2D descriptor height limit at any single-texel offset.
    • G18G stays properly excluded with a clear hardware comment (legacy buffer-view path, no software tail).
  • Checklist §1, §2, §4, §6: covers all M5 parts without a single-chip gate; no hacks/env vars; commit d48f3d02203a has human author/committer + human Signed-off-by: only; PR body uses Borealis naming and ends with Assisted-by:.
  • Build & tested hardware (§5): no GitHub CI checks are configured; host --suite asahi (140/140), aarch64 Borealis cross-build, J716c (M5 Max, G17C) vulkaninfo + 15/15 compute probe (including R8 offsets 1/7/15 at max size 268,435,441) + api.buffer_view.* & api.info subset A/B (0 diffs, 0 GPU faults), and J713 (M4, G16G) unchanged-path check are reported at this head.

Remaining §5 HW evidence before approval

  • M5 (G17G) and/or M5 Pro (G17S): base-vs-head run of dEQP-VK.api.buffer_view.*, dEQP-VK.api.info.*, texel-buffer CTS (dEQP-VK.texel_buffer.* / binding_model / robustness), and the R8 offset 1/7/15 max-size (268,435,441) readback check with 0 GPU faults.
  • Complete the remaining dEQP-VK.api.info.* and texel-buffer CTS groups listed in Still to run on G17C (and note §5 regression health: SELinux / failed units / kernel errors).

Assisted-by: LLM (Gemini 4 Neon)

@DjDeveloperr

Copy link
Copy Markdown

Verified on Apple M5 Pro (J714s / G17S B1 / AGX3C) at exact head d48f3d02203a (Linux 7.3.0-m5-slc1, MESA_SHADER_CACHE_DISABLE=1, ASAHI_M5_BRINGUP=1):

Check Result
meson test --suite asahi 140/140 PASS
VkPhysicalDeviceTexelBufferAlignmentProperties + maxTexelBufferElements minAlign=16, maxTexelBufferElements=268435441, storageSingle=1, uniformSingle=1
Max-size odd-offset R8_UINT texel buffer readback (268,435,441 texels, head + tail) PASS — offsets 1 (errs=0), 7 (errs=0), 15 (errs=0)
dEQP-VK.api.buffer_view.* (full suite, 1,004 cases) 656 PASS, 0 FAIL (348 NS)
dEQP-VK.api.info.* (419 properties + strided subset) 277 PASS, 0 FAIL (142 NS)
Kernel dmesg GPU/MMU faults 0

Ready to merge from G17S B1 side.

@DjDeveloperr
DjDeveloperr merged commit 67fc1d5 into aurora-wip Nov 22, 2026
@DjDeveloperr

Copy link
Copy Markdown

Merged into aurora-wip at 67fc1d5f92015569bf3fee8e5457c968521e0ef0 (tree 68266ca01e58a8a1be03410b70b1158ec333831e).

Verification summary on d48f3d02203a:

Assisted-by: LLM (Google:Gemini 4 Neon)

@RyanTheTide
RyanTheTide deleted the j716c/single-texel 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.

3 participants