Repository navigation
borealis: G17P: relocate every unlinked vertex program's varyings - #446
Conversation
|
Heads-up for the rebase after #443: besides the |
|
Since #443 landed this branch conflicts on The one failure is the new The full validation output is in the merge-train notes, and I'm happy to share it here if useful. |
a0d42c2 to
ce64210
Compare
|
Rebased onto aurora-wip 4596393, new head ce64210. Thanks for running the merge. The validation failure wasn't an interaction with #443. It was in this commit, and you get it with Test: Checked on the M4 Pro with a debugoptimized build (asserts on), guarded, 0 recoveries:
Yes please on the A18 Pro and M4 Pro rows on ce64210. |
Merge train (batch 1): independent reviewVerdict: CLEAN WITH NITS. Independent code-only review (Opus 5.5, xhigh). No blocker or major. One question for you, @jgoyvaerts, before or after the merge:
Reach: Train: batch 1. The Neo (G17P) row runs |
|
Merge-train status (02:4x): held for its Neo (G17P) row. The independent review is clean with nits, posted above. This PR reaches the A18 Pro (G17P), so per the train's rule it merges only after both of these:
The Neo has been offline since about 02:04 (it idle-suspended and needs a physical wake), so its row can't run until it is back. Everything else for this PR will be ready by then. G17P owners' rows (A18 Pro / M4 Pro / M4 Max) on the head above would unblock it sooner. |
|
Thanks @DjDeveloperr. Head is still ce64210; nothing changed, so no push. MINOR: not reachable through hk. Your packer analysis is right: if
I checked this on the M4 Pro with a small
All three also create and render exactly on base 4596393. As a positive control, the unit test under the same gdb script hits the indirect breakpoint 4 times. In hk, NITs
M4 Pro G17P row on head ce64210 against base 4596393. Debugoptimized builds with asserts on, so NIR validation also ran on real pipelines; 0 GPU recoveries. 916,579 cases: the 125
The 5 crashes fail the same way on both sides; they are mesh/task shader-object creation cases, |
RyanTheTide
left a comment
There was a problem hiding this comment.
No blockers. Our earlier comments are addressed. The rebase onto #443 has the five-argument agx_nir_lower_uvs(). The NIR validation failure in the relocatable test was this commit's misplaced nir_imm_int(0), now built before the branch ladder (agx_nir_lower_uvs.c:198). The test now also covers the layer-zero root flag. I re-read the diff on ce64210. The removal of the canonical layout is complete: flat_copy is gone from the linker and from hk_g17p_smooth_varyings_supported_uncached(), and the binary version moves to 44. The answer to the earlier indirect-store question (outputs go to temporaries in hk_preprocess_nir_internal(), and indirect derefs become if-ladders for a VS) matches the code. The evidence is a full M4 Pro row on the unlinked-path groups, base against head, with asserts on.
-
src/asahi/lib/agx_nir_lower_uvs.c:187-213: since no hk producer reacheslower_indirect_varying()today, anassertor a comment saying it guards future producers, and that the G17P packer would refuse its output (stores outside the last block), would keep it from being taken for a tested path. The follow-up you offered is fine. -
Naming nit: the commit subject starts with
hk:. Our Vulkan driver is Borealis in prose, soborealis:as in the PR title.
Hardware row: Neo (A18 Pro, G17P) on ce64210 against base 4596393: pipeline.fast_linked_library, pipeline.shader_object_unlinked_*, shader_object, tessellation, geometry, clipping, transform_feedback. Pass: identical case-for-case results and 0 GPU recoveries, as on the M4 Pro.
Assisted-by: LLM (Claude:Opus 5.5)
ce64210 to
cdca75c
Compare
|
Merge train: rebased onto aurora-wip afcc08b (conflict-free; authorship kept). Head ce64210 -> cdca75c.
|
A G17P vertex program compiled without its fragment shader got the canonical layout: every varying written twice in location order, a smooth copy and then a flat copy. Linear (noperspective) inputs read the smooth copy. The clipper interpolates the words of a range by that range's mode, so on a clipped primitive a noperspective input read values interpolated perspective-correctly at the clip points. All 36 dEQP-VK.fragment_shading_barycentric.fast_linked_library.weights.* line_strip*.noperspective cases render their reference image, a plain noperspective colour from a fast-linked vertex shader, up to 125 of 255 off in every channel. Their pipeline_library and monolithic forms pass. The relocatable layout that larger shaders already use is exact: one copy of each varying at a placeholder index, re-encoded at link for the fragment shader's smooth, flat and linear inputs. Use it for every unlinked vertex program and drop the canonical layout. A varying stored at an index computed at run time cannot be relocated, so store it at each constant index of its array under a test of the computed one. Each varying is then written once instead of twice. The new unit test asahi-uvs-relocatable lowers an unlinked vertex shader with a run-time-indexed array, alone and with the layer written as a varying and its fixed-function copy sent to zero by the root table flag, and checks that every store is at a constant index and the shader validates. The layout's flags change, so bump the AGX3 shader binary version. Signed-off-by: Jonathan Goyvaerts <jonathan.goyvaerts@gmail.com>
cdca75c to
66eb873
Compare
|
Merge train: rebased onto aurora-wip 7ba2957 (#595, the CI fix that installs the GLVND EGL dispatcher, so the asahi job's EGL priority tests pass), conflict-free, every commit identical, authorship kept. New head 66eb873. A mirror |
66eb873 to
d56b317
Compare
|
Commit messages only, for the pre-PR checklist: the commits no longer carry Assisted-by: LLM (Claude:Opus 5.5) |
|
M4 Pro (J616s, G17P) no-regression row. A = aurora-wip
Still to run here: the A18 Pro (Neo) row, when the Neo is back. |
|
M1 Pro (G13S) no-regression row. A = aurora-wip
|
|
T8140 (MacBook Neo J700, A18 Pro, G17P B1) merge-train batch 2 row ( Setup:
Results:
Assisted-by: LLM (Google:Gemini 4 Neon) |
|
Merged into M5 Pro (J714s, G17S B1) verification row
Assisted-by: LLM (Google:Gemini 4 Neon) |
|
A18 Pro (Neo, G17P) no-regression row. A = aurora-wip
With the M4 Pro row above, both G17P parts are done. |
What
A G17P vertex program compiled without its fragment shader (graphics pipeline library pre-rasterization stages, unlinked shader objects) gets the canonical UVS layout from 2c262a8: every varying written twice in location order, a smooth copy and then a flat copy. Noperspective inputs read the smooth copy. The clipper interpolates the words of each range by that range's mode, so on a clipped primitive a noperspective input gets values interpolated perspective-correctly at the clip points, then interpolated linearly.
dEQP-VK.fragment_shading_barycentric.fast_linked_library.weights.*.line_strip*.noperspectiveshows it (36 cases, once Borealis exposes VK_KHR_fragment_shader_barycentric): their reference image is a plainnoperspective in vec3colour from a fast-linked vertex shader, and comes out up to 125/255 off on the lines that run off the viewport. Thepipeline_libraryand monolithic forms of the same cases pass. The bug itself needs no barycentrics: any noperspective varying of an unlinked vertex program on a clipped primitive hits it.The relocatable layout from 402c85f, which shaders over 62 varying components already use, is exact: one copy of each varying at a placeholder index, which the link re-encodes for the fragment shader's smooth, flat and linear inputs. This uses it for every unlinked vertex program and removes the canonical layout. A varying stored at an index computed at run time cannot be relocated, so it is stored at each constant index of its array under a test of the computed one; such shaders previously fell back to run-time UVS indices. Each varying is now written once instead of twice.
New unit test
asahi-uvs-relocatable: an unlinked vertex shader with a run-time-indexed array is relocatable, writes every varying at a constant index, and its relocation map puts a flat and a noperspective varying in their ranges. A second case writes the layer as a varying with the layer-zero root flag from #443 on (layer_zero_root_offset >= 0) and checks the flag load and the packed layer/viewport store. Under NIR validation (any build with asserts) both cases must validate. It fails without this change.The layout's flags change, so the AGX3 shader binary version goes to 44.
Testing
Rebased onto aurora-wip 4596393 (after #443), M4 Pro (J616s, G17P), kernel 7.3.0-m4.173, debugoptimized build with asserts (NIR validation on), guarded, 0 GPU recoveries:
--suite asahi208/208; gallium asahi and Borealis build.asahi-uvs-relocatableaborts in nir_validate without this change.render_to_image.*.huge): 6,805 Pass, 4,269 NotSupported, 0 Fail, the same case for case as aurora-wip 4596393 alone.Before the rebase (aurora-wip 57df4db), kernel 7.3.0-m4.166/167, release builds, guarded runs, 0 GPU recoveries:
--suite asahi --suite vulkan200/200.dEQP-VK.fragment_shading_barycentricgroup gives 16,563 Pass, 4,428 NotSupported (shaderFloat64), 0 Fail.Assisted-by: LLM (Claude:Opus 5.5)