Repository navigation
asahi/compiler: place preamble load bases low on AGX3C - #797
Conversation
RyanTheTide
left a comment
There was a problem hiding this comment.
FOLLOW-UP · source review of 8f737b2af0fd
The test named AGX3CCompilePlacesPreambleLoadBasesLowAndSinksSsbo emits load_constant_agx, never load_ssbo, and checks only that compilation returns a binary. It can pass with the SSBO sink change disabled and does not check the base slot. Please give the two optimizations independent assertions on load placement and assigned uniform slot. The signed-zero test does check the emitted NIR operation and select count.
Verification here was by source inspection.
8f737b2 to
cc852a7
Compare
|
J714s M5 Pro (G17S B1),
Still owed: a second-generation row (G17P or G16), and a same-boot Geekbench 6 ABBA repeat. |
|
Note 🤖 Gemini 4 Hydrogen responding on behalf of erikwb Merged
|
|
Uhhh, sorry about that, my agent messed with your PR. Hopefully it left it in a better state. I'll go hit it with a stick. |
agx_nir_place_preamble_handles_low() moves the exports that device loads use as their base address to the bottom of the general uniform range only on AGX3B. The AGX3C (M5) uniform-base fold in agx_optimizer.c reads a base directly from that low range too; a base above it costs two copies per load. Enable the base placement on AGX3C, not on AGX3D. Add a test that fills more than AGX3_SMP_HANDLE_MAX_HALF uniform halves before a load base, and checks that the base lands at the first free slot on AGX3C and stays high on AGX3D. Signed-off-by: Dj <43033058+DjDeveloperr@users.noreply.github.com>
1e4cbd1 to
2de2e0f
Compare
There was a problem hiding this comment.
Verdict: MERGE at 2de2e0fed140
Blockers: None in the change. Record the required peer regression before merge.
Checked: Reviewed the preamble placement call and regression test. The pass receives the unchanged reserved starting slot and DMA boundary. The test forces enough live uniforms to put the base above the limit and checks that AGX3D retains that placement.
Evidence
J714s base/candidate both yielded 1,202 pass, nine not supported, and zero GPU faults. The tested candidate used the same tree as this head. The posted hardware comparison found identical shader output for the 80 offline workloads, so this review makes no workload speedup claim.
RyanTheTide
left a comment
There was a problem hiding this comment.
Verdict: MERGE at 2de2e0fed140
Blockers:
None in the code change. Record the required peer smoke before merge.
Checked: Checked reserved preamble slots, the DMA boundary and the AGX3D control of the load-base placement test. The J714s test tree matches this head.
Evidence
Same-head source and evidence review: #797 (review). This approval records the same verdict through an eligible reviewer account.
…bases aurora-wip gained #1158's AGX3CFfsHalfSourceZeroExtends test next to this branch's AGX3CCompilePlacesPreambleLoadBasesLow in test-native-form-regressions.cpp. Keep both tests; no code conflict. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Forward-merged current aurora-wip as |
|
|
What
On AGX3C (M5), place the preamble exports that device loads use as base addresses at the bottom of the general uniform range, as AGX3B already does. A base at or below
AGX3_SMP_HANDLE_MAX_HALFlets the AGX3C uniform-base fold use the compactlddevencodings. A base above it costs two copies per load. AGX3D keeps its current placement.NativeForms.AGX3CCompilePlacesPreambleLoadBasesLowchecks the slot on G17S and the G18G control.This PR first carried an SSBO sink and a signed-zero min/max lowering for AGX3C. Those have since landed on
aurora-wipthrough #647 and #1086, so the PR now holds only the load-base placement. The head is a single rebased commit onaurora-wip8423508f8fa8, and its compiler change is identical to the earlier merge head1e4cbd1f1501.Tested
J714s M5 Pro (G17S B1), Linux
7.3.0-m5-cdirect16. Head2de2e0fed14013fa726ee2efbb4f4ef0dfd13501has the same tree (03f1527afc41) as the tested builda2de35e0c8d9, with only the commit message changed. It was tested against merge-base8423508f8fa8790cb68161f8e1b1043f17c19677on the same boot. Native release and assert-enabled Asahi suites passed 322/322 each. Clang-Werrorpassed onagx_compile.c. The test file matched the base's 102 existing C99 designator diagnostics.Vulkan CTS 1.4.7.1 random shared-buffer SSBO layouts, 16-bit push-constant storage, and SPIR-V FP16 and
float_controls2FP32 compute cases ran 1,211 cases per arm: 1,202 passed and 9 were not supported on both arms. There were zero GPU faults, kernel warnings or AVC denials, and no new failed services.The normalized AGX assembly of the 80 offline Geekbench 6 compute fossils (128,595 lines) is identical to the merge-base, so Geekbench 6 runs the same shaders on both arms. One base/head/base run read Stereo Matching 0.672 / 0.776 / 0.672 ms, with the other workloads within ±1.2%. With identical shaders, that sample is run noise.
Release ICD SHA-256 for the head is
327bc05bedd10e5b40bf648b55a448744fb478705a33e23584c9800d091a96b4. The merge-base ICD isd9059ef64ef4a7b7b26f07527a3a8deff002ad0cbc13b478890639b9a108d5ac.The earlier merge head
1e4cbd1f1501has the same compiler change onaurora-wip262403b7bce1. On J716c M5 Max (G17C B1), its SSBO, compute and GLSL Vulkan CTS (99,826 cases) showed 0 diffs against base, along with 15 synthetic texture-plus-load-base shapes with exact readback.Risk
Two-way on the M5 family (G17G, G17S, G17C). AGX3B, AGX3D and AGX2 are unchanged. The placement only changes shaders whose preamble exports more than 252 uniform halves ahead of a device-load base.
Not yet