Repository navigation
borealis: take the SSBO address format from the descriptor generation - #561
RyanTheTide wants to merge 3 commits into
Conversation
spirv_to_nir builds SSBO derefs with hk_get_spirv_options()'s format, hk_nir_lower_descriptors() rewrites their resource indices and hk_lower_nir() lowers them with nir_lower_explicit_io(). The descriptor pass picked the _map formats (five address components) for descriptor generation 10, but the other two keyed the map word on agx_chip_g17_m5(), which leaves out the G18G. On the M6 the descriptor pass therefore produced five-component addresses for derefs that nir_lower_explicit_io then lowered as four-component ones, and lower_explicit_io_deref() asserted (addr->num_components == deref->def.num_components) on an MLX gather compute shader. Add hk_storage_address_has_map() / hk_ssbo_addr_format(), keyed on the descriptor generation the set layouts are built with, and use them in all three places, plus the buffer descriptor writer that fills the map word. Nothing changes on any chip but the G18G, where the three now agree. The M5 layered-store window had the same shape: the image view and the store lowering each spelled out G17G/G17S. Give that one name too, agx_chip_layered_store_is_3d(), and use it on both sides (no change). New unit test hk_ssbo_addr_format: for every chip with a known descriptor generation, the spirv_to_nir format equals the lowering format, and an SSBO load/store at a constant and a dynamic index goes through both lowerings and validates, with and without robustness. Closes: #560 Reported-by: Joshua Warren <joshuaswarren@users.noreply.github.com> Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
M4 Pro (J616s) no-change row. A = aurora-wip e7e9ef3, B = A + this PR (df8e991) + #559. Native release builds, user-space overlay, same kernel:
Still to run: M1 Pro (G13) and M2 (G14) rows, and the M6 row. |
|
M1 Pro (G13S) row. A = aurora-wip 173d51d, B = A + #561 + #559 + #562. Native release builds, user-space overlay, same kernel (7.3.0-aurora-fleet74):
|
|
M6 (G18G B1), stock J873g kernel
Logs (SHA-256): Ryan, which kernel commit or build do you expect us to pair with this ICD for the G18G row? |
|
Thanks for the row. Kernel to pair with: aurora-silicon/linux To keep 7.1.12-aurora-m6usb instead: the draft release now also has the base ICD, built with the same recipe: https://github.com/aurora-silicon/mesa/releases/tag/untagged-09937e7c4acbecac4e61
If the base ICD fails the same three The row that decides the PR is still the one on a matching kernel: |
|
Blockers: 1. The change itself is correct.
The M4 Pro and M1 Pro no-change rows are on df8e991, before 07c673e. The rebase changes the same lowering block, so the G17P row needs running again. HW row: rebased head with the Assisted-by: LLM (Claude:Opus 5.5) |
aurora-wip now lowers SSBO access in two places in hk_lower_nir(): early for chips without pre-lowering SSBO vectorization (G18G among them) and after vectorization for G17P and M5. Both take their address format from hk_ssbo_addr_format() and the descriptor generation, as the descriptor lowering does. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Branch updated with one merge of aurora-wip ( The draft-release ICDs for the M6 row are still the pre-merge head |
There was a problem hiding this comment.
Review at 7ae7c53. The descriptor writer, SPIR-V lowering and explicit-I/O lowering now select the same SSBO address shape, including the sparse map word. G14G stays on the non-map path. Please identify the exact head and case counts for the reported AGX2 sparse/robustness rows and confirm that dynamic SSBO offsets and linked pipeline libraries are both represented. These consume the shape through different call paths.
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal adversarial pre-PR checklist (§1–§6) review at 7ae7c53160928b97723fa50b34f7a4f76fbad0cb: REQUEST_CHANGES.
Status Summary
- Superseded? No — live
aurora-wip(efabab38502d) still keys SSBO address format onagx_chip_g17_m5()inhk_shader.c(lines 232, 3309, 3342) andhk_descriptor_set.c(line 548), whilehk_nir_lower_descriptors.c(line 2162) keys it onctx.descriptor_generation == 10. - Code & §1–§4 Assessment: The core fix is sound and aligns with §1: unifying
spirv_to_nir,hk_nir_lower_descriptors,nir_lower_explicit_io, andget_buffer_address()behindhk_storage_address_has_map()/hk_ssbo_addr_format()keyed onagx_chip_descriptor_generation(), plus consolidating the twoG17G || G17Slayered-store checks intoagx_chip_layered_store_is_3d(). Both commits (df8e991e7b44,7ae7c5316092) carry human author/committer + humanSigned-off-by:only, zero AI commit trailers.- (Minor non-blocking note) In
tests/test-hk-ssbo-addr-format.c:312,CHECK(map_chips == 4)hardcodes the current Gen-10 chip count and will break when another Gen-10 chip enum is added; consider checkingmap_chips >= 4or asserting equivalence againstagx_chip_descriptor_generation(c) == AGX_DESCRIPTOR_GENERATION_10.
- (Minor non-blocking note) In
Blockers
- Merge Conflicts against live
aurora-wip(CONFLICTING):src/asahi/lib/agx_chip.h(hunk at line 535):agx_chip_g17_m5()was rewritten viaagx_chip_info(chip)and relocated to lines 868–874 (precedingagx_chip_m5_paths()) by recentaurora-wiprefactors (90f9e2ec0843/#768,37e1939d960b/#576,bc7a7a70ca95/#579).src/asahi/vulkan/hk_shader.c(hunk at line 3237):hk_lower_nir()(lines 3283–3345) now trackslowered_desc/lowered_global_io/lowered_buf_io/lowered_pre_vec(f22506371498/#747) and usesagx_chip_g17p_or_m5(dev->dev.chip)at line 3303 (90f9e2ec0843/#768).- Fix: Rebase cleanly onto current
aurora-wip, converting bothnir_lower_explicit_io(nir_var_mem_ssbo, ...)sites (lines 3306 and 3339) while preserving thelowered_*tracking andagx_chip_g17p_or_m5()call.
- Live CI missing on head
7ae7c5316092:- Zero check runs / workflow runs exist on
7ae7c5316092. After rebasing onto currentaurora-wip,asahiandaurora-agent-policymust run green on the new head.
- Zero check runs / workflow runs exist on
- §5 Hardware Evidence incomplete:
- M6 (G18G) target hardware row not yet passing: The only M6 run (
joshuaswarrenondf8e991e7b44) hit kernelPayloadTail/EINVALrejections on7.1.12-aurora-m6usb-ARCHand executed 0 dEQP cases. A passing M6 row on a compatibleintegration/aurorakernel (MLXmx.takebf16/f16/f32 completing without thenir_lower_explicit_ioassert +dEQP-VK.ssbo.*androbustness.robustness2.*storage subsets with 0 Fail + regression counts) is required to prove the fix on the affected hardware. - Post-rebase no-change rows: The M4 Pro (G17P) and M1 Pro (G13S) rows were taken on
df8e991e7b44before the splithk_lower_nirSSBO lowering landed onaurora-wip, and M2 (G14G) has no row yet. Re-verify exact-head no-change rows on G17P and AGX2 (G13S/G14G) with explicit head SHAs, case counts (including dynamic SSBO offsets and linked pipeline libraries), and regression counts (0 SELinux denials / 0 failed units / 0 new kernel errors).
- M6 (G18G) target hardware row not yet passing: The only M6 run (
- §6 Naming (on rebase):
- Commit
df8e991e7b44still uses thehk:commit subject prefix (the PR title was updated toborealis:). When rebasing, rename the commit subject prefix toborealis:(existinghk_code symbols remain peraurora-silicon/mesa#591).
- Commit
Assisted-by: LLM (Gemini 4 Neon)
Keep the current vectorization and robustness ordering. Select the SSBO format from descriptor generation when lowering NIR and building tiled byte stencils. Preserve the live layered-image store handling and retain both branches’ test registrations. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
satchlj
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at b560cf7
Blockers:
- Target-hardware verification on G18G / M6 at
b560cf7dee1eis still pending (Not yetin the PR description). Code review and shared Gen-10 hardware verification have no blockers.
Checked: diff review, release build with asserts enabled, unit tests, live Vulkan CTS and dynamic-offset draw verification on Apple M5 Max
Evidence
- Audited all SSBO address-format and storage-descriptor lowering call sites in
src/asahi/vulkan/(hk_get_spirv_options,hk_nir_lower_descriptors,hk_lower_nir,hk_maybe_build_byte_stencil,get_buffer_address): every path consistently derives the SSBO address format and descriptor-map presence fromagx_chip_descriptor_generation(), and the newhk_ssbo_addr_formatunit test covers constant and dynamic descriptor indices with robustness off and on across every chip with a known descriptor generation. - Built
b560cf7dee1ewith-Dbuildtype=release -Db_ndebug=false(asahiGallium + Borealis Vulkan + tests): clean (2642/2642),meson test --suite asahi --suite poly: 207/207 OK (0failures, includinghk_ssbo_addr_formatandagx_tests). - Live shared-Gen-10 hardware regression row on Apple M5 Max (
T6050/J775c,G17C B1) withMESA_SHADER_CACHE_DISABLE=1(0GPU faults indmesg):dEQP-VK.ssbo.layout.single_basic_type.std430.*: 303/303 PASS (0fail)dEQP-VK.robustness.buffer_access.compute.*: 138/138 supported PASS (0fail,66not supported)dEQP-VK.robustness.robustness2.bind.notemplate.r32i.dontunroll.nonvolatile.storage_buffer.*: 128/128 supported PASS (0fail,64not supported)dEQP-VK.sparse_resources.buffer.ssbo.*: 31/31 supported PASS (0fail,38not supported)dEQP-VK.pipeline.pipeline_library.graphics_library.misc.other.*: 15/15 supported PASS (0fail,7not supported)vulkan-dynamic-offset-draws(1024 draws/pass,dyn/fixed/fsdyn/push): PASS (0GPU faults)
|
Verdict: CLOSE (superseded by #1006) at Checked: The merged #1006 uses the descriptor generation for SPIR-V translation, descriptor lowering, explicit NIR I/O and tiled byte stencils on G18G. The selector is present on EvidenceThe earlier draft’s descriptor write cleanup was prospective for G18G residency maps. The runtime fix and regression test are in #1006, merged at |
What: Borealis uses the descriptor generation to choose the SSBO address format in every compiler path. On G18G, an MLX gather shader could assert because its SPIR-V and explicit-I/O paths built an address without the map word that descriptor lowering expected. Joshua Warren reported and diagnosed the mismatch in #560.
Tested: Native x86-64 Fedora build at
b560cf7dee1ewith assertions enabled. The SSBO address-format, byte stencil, binding base, aligned saturating add, and layered-store window tests passed 5/5. The affected Mac and shared Mac regression rows are pending.Risk: two-way door · G18G SSBO shaders and shared storage-buffer compiler paths on other Macs.
Not yet: Exact G18G M6 MLX gather and Vulkan SSBO/robustness on a kernel with compatible G18 compute submission. Exact G13, G14, J616s and Neo regression rows.
Details
hk_ssbo_addr_format()takes the descriptor generation for SPIR-V translation, descriptor lowering, explicit NIR I/O and tiled byte stencils. Buffer descriptor writes use the same capability. The forward merge preserved the target branch's shared pre-lowering vectorization, per-buffer robustness selection and test registrations. Layered-image store handling follows the current target branch. The layer-operand capability is tracked in #362.Evidence
Tested tree
396aaec35727191c74d75c434e74142864fd391e, based onaurora-wip43beb2fc9e41. The SSBO test runs constant and dynamic descriptor indices with robustness enabled and disabled and validates NIR after both lowerings. The old M6 run was on an incompatible submission ABI and did not complete dEQP. See #560 for the original address-format diagnosis and #611 for the kernel/driver pairing.