Repository navigation
borealis: trim compute root descriptor uploads to shader demand - #593
Conversation
RyanTheTide
left a comment
There was a problem hiding this comment.
No hard blockers, but the trim needs a correctness run on M5, and the predicate should be a single helper.
-
Correctness on M5 (
hk_cmd_upload.c:30,hk_shader.c:5362). Uploading only the measured prefix is safe only if nothing reads pastroot_descriptor_size. That includes the M5-specific lowering (the M5 preamble and uniform paths in the compiler differ from G17P's), internal and meta compute shaders, and indirect dispatch fields that the driver writes into the root table. A missed reader does not fault. It reads stale root data from the previous upload, so a fault-free Cyberpunk run does not exercise it. Please rundEQP-VK.compute.*,dEQP-VK.binding_model.*anddEQP-VK.descriptor_indexing.*on M5, base against this commit. Pass: no new failures. -
One predicate for both cache directions.
G17P || agx_chip_g17_m5()is now written in five places, includinghk_shader_serialize()(hk_shader.c:9137) andhk_deserialize_shader()(:8518). If a later change updates one side and not the other, every cached shader on that chip is misparsed. Please put it in one helper (for examplehk_trims_compute_root(dev)) and use it in all five places. Ideally key it on the compiler capability the measurement depends on rather than a chip list. -
Cache format. On M5 the serialized shader gains a
uint32. Please confirm thatpipelineCacheUUIDand the disk-cache key change with this build, so that blobs written by an older driver are rejected rather than read with the new layout. -
Evidence: "up to 48.68 FPS" has no baseline and no measure of the upload saved. Please give an A/B on the same build, FPS or
hk-cpu-upload-benchbytes per dispatch on M5. -
Disclosure: please move "Developed with Neon." from the commit message to an
Assisted-by: LLM (<Vendor>:<Model>)line at the end of the pull request description. The commit should carry only your identity.
HW row: M5 only (your J716c); our lab Macs do not take the new path. On Neo (G17P), dEQP-VK.compute.* with a warm shader cache from the base build. Pass: no new failures, and cached shaders still load.
Assisted-by: LLM (Claude:Opus 5.5)
|
Thanks for this. One more point on top of the earlier review, about how the trim is selected. The trim is gated on Could the five sites use one helper that is true wherever the compiler reports the footprint (i.e. every generation), so the serialize and deserialize sides can't drift? If a generation does read root data past the measured size, a code comment citing that reader keeps it excluded. If you make it the default, we can run |
9840c1f to
fa56667
Compare
|
Thanks. Following your second comment, the trim is now the default on every generation. Point by point: 2 + the follow-up: one predicate, every generation. I looked for a reader that uses root bytes past the measured prefix on any generation and found none. What I checked:
So the five checks are gone. All generations measure, serialize and trim, and the serialize and deserialize sides can't drift. 3. Cache format.
1. Correctness on M5 (J716c, G17C).
4. What it buys, same build with and without the commit.
None of the other generations were run here. Your offered runs on the M1 Pro, M2, M4 Pro and A18 Pro would cover them, and the Neo with a warm cache from the base build is the G17P check you listed. Its first head pass on that cache tests isolation and recompilation (the build identity changes); a second head pass in the same directory tests loading the head's entries. |
RyanTheTide
left a comment
There was a problem hiding this comment.
Thanks for the re-push. I compared 9840c1ff47 with fa5666793c and read your replies. All five earlier points are resolved, and I found nothing new that blocks.
- 1 (stale root reads): resolved for M5. The
compute.*,binding_model.*anddescriptor_indexing.*results match base on the J716c, both on a base-filled cache and on the head's own cache. - 2 (one predicate): resolved by removing the gate. The serialize and deserialize sides (
hk_shader.c:8521,:9139) now always agree, andhk_cpu_upload_bench.cchecks the trim and the unmeasured fallback on every chip. - 3 (cache format): resolved. The UUIDs come from the build-id, the J716c reports a different
pipelineCacheUUID, and all three binary versions are bumped. G17P's payload didn't change, so its bump to 44 only costs one recompile. That is fine. - 4 (baseline): resolved. Root upload drops from 1192 to 832 bytes per dispatch, with no measurable CPU, GPU or FPS change, and the description says so plainly.
- 5 (disclosure): resolved.
What's left is the generations this push newly puts on the path. G17P already had the trim, so A18 Pro and M4 Pro only see the version bump. G13 and G14 (the AGX2 preload) are new, as are G15/G16. We will run the M1 Pro and M2 rows below and post the results here. Please don't merge before those are in.
HW rows:
- M1 Pro (G13S) and M2 (G14G):
dEQP-VK.compute.*,dEQP-VK.binding_model.*anddEQP-VK.descriptor_indexing.*, base against head. Run each head pass twice on one cache directory that base filled. Pass: no new failures, no GPU fault lines in dmesg, and the second head pass writes almost no new cache entries. - Neo (A18 Pro, G17P):
dEQP-VK.compute.*on a cache warmed by base. Pass: no new failures; old entries are not reused.
Assisted-by: LLM (Claude:Opus 5.5)
fa56667 to
0c78e2e
Compare
|
Rebased onto
Ready for the lab runs on M1 Pro (G13S), M2 (G14G), and Neo (G17P); holding merge until those results are in. |
|
Re-review of 0c78e2e. The only change since fa56667 is the rebase over #446: the AGX3 binary version moves to 45 ( Rows at this head: we will run M1 Pro and M2 ( Assisted-by: LLM (Claude:Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Review of 0c78e2ef: 0 code, attribution, or policy blockers remain.
Verification
- Unconditional across generations (
hk_cmd_upload.c:31-36,hk_shader.c:5384-5392,:8553,:9170): removing all five G17P-only gates ensureshk_shader_serialize()andhk_deserialize_shader()cannot drift. - Footprint safety (
hk_nir_root_size.c,hk_shader.c:5386,hk_cmd_upload.c:56-74):hk_nir_root_size()runs afterhk_lower_uvs_indexand beforelower_uniforms, conservatively falling back tosizeof(struct hk_root_descriptor_table)on unrecognized uses, non-constant offsets, or self-pointer reads (offset < 8), and always retainsoffsetof(sets) + set_count * 8(covering AGX2 USC root uniform and AGX3 Ioto root range preloads).hk_cmd_buffer_upload_root()checksdesc->uploaded_root_size == root_sizeon reuse, falls back to the full table whenroot_descriptor_size == 0, and all compute dispatch paths bind the dispatched shader incmd->state.cs.shaderwhile graphics-on-CDM stages usecmd->state.gfx.root. - Binary version bumps & tests (
hk_agx3_vdm_decode.h:36-39,test-hk-execution-allowance.c,hk_cpu_upload_bench.c): cleanly rebased over #446 with versions bumped to AGX3 45 / AGX2 37 / classic 35;hk_cpu_upload_bench.ctests both trimmed and unmeasured (0) compute root uploads across every chip enum. Hostmeson test --suite asahi(154/154) and aarch64 Borealis cross-build are green. - Attribution & naming: single human-signed commit (no AI trailers in commit), Borealis naming, and
Assisted-by:in PR body.
Remaining before APPROVE (§5 HW evidence on 0c78e2ef)
Holding for the multi-generation lab runs at this head (as noted by both author and @RyanTheTide):
- M1 Pro (G13S / AGX2) and M2 (G14G / AGX2):
dEQP-VK.compute.*,binding_model.*,descriptor_indexing.*(base vs head, two head passes on a base-warmed shader cache; 0 new failures, 0 GPU faults, second pass reuses head cache entries). - M4 Air (G16G / classic payload v35): covers the classic binary version bump and trim.
- Neo (A18 Pro / G17P / AGX3 payload v45):
dEQP-VK.compute.*on a base-warmed cache (0 new failures, version isolation confirmed).
Assisted-by: LLM (Gemini 4 Neon)
|
A18 Pro (
3-pass single
Also verified on
GPU faults: Assisted-by: LLM (Antigravity:Gemini 4 Neon) |
Native HAL200 (G16G / G17P) records each compute shader's root descriptor table footprint in shader->root_descriptor_size, persists it in the shader cache, and uploads only that prefix of the table at dispatch. Nothing about compute root trimming is specific to HAL200: the footprint comes from the shader's own root loads before uniform lowering, and every other reader of a compute root stays inside it. A compute launch preloads only the root address and the set bases (the AGX2 USC root uniform and the AGX3 root range alike), which the measured size always covers; root-backed uniform DMA spans come from measured loads; the indirect grid helper uploads a full root of its own; graphics stages dispatched on CDM keep the whole table. Measure, serialize and trim compute roots on every generation instead of gating compute measurement, upload and cache serialization on agx_chip_native_hal200(), so the cache writer and reader cannot disagree while keeping HAL200 graphics root trimming intact. The serialized payload changes on every non-HAL200 chip, so bump the shader binary versions (AGX3 44 -> 45, classic 34 -> 35, AGX2 36 -> 37); pipelineCacheUUID and the disk cache key already change with the driver build. Signed-off-by: Erik Bourget <erik@ebourget.net>
0c78e2e to
69fb5f5
Compare
|
Rebased cleanly onto
|
RyanTheTide
left a comment
There was a problem hiding this comment.
Independent source review at 69fb5f502522. The compute upload now uses the measured prefix on AGX2 as well. The shader ABI version bump protects the old serialized layout. Please run J413 compute, descriptor indexing and binding tests from a cold cache and again from a cache populated by the candidate, including a dynamic descriptor and push constants at the end of the used prefix.
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal pre-PR checklist (§1–§6) re-review at 69fb5f5025228f89641cdfb498f899ddd0f45cb0 (base aurora-wip, live tip efabab38502d).
Code, Superseded & Policy Audit (§1–§4, §6) — PASS
- Not superseded:
aurora-wip(efabab38502d) still gates compute root measurement/upload/serialization onagx_chip_native_hal200()and keeps shader binary versions at 44/34/36. - Descriptor layout & upload safety (
hk_cmd_upload.c,hk_shader.c,hk_agx3_vdm_decode.h):- Cleanly preserves #706 (
6eaea736177) HAL200 graphics root trimming while enabling compute root trimming unconditionally on every generation and removing the serialization gate sohk_shader_serialize()andhk_deserialize_shader()cannot drift. - Verified all compute dispatch paths (
hk_cmd_buffer.c:4037,hk_cmd_dispatch.c:1837,2122,2600) callhk_cmd_buffer_upload_root(cmd, VK_PIPELINE_BIND_POINT_COMPUTE), and root reuse checksdesc->uploaded_root_size == root_size, preventing stale short-root reuse when a later compute shader needs a larger prefix. hk_nir_root_size()fails closed tofull_sizeon unknown uses, non-constant offsets, depth > 8, or self-pointer reads (offset < 8), andhk_shader_root_descriptor_size()floors atoffsetof(sets) + set_count * 8(covering AGX2 USC root uniform and AGX3 Ioto root range preloads) rounded to 16 B.- All three shader binary versions bump cleanly (AGX3
44 -> 45, classic34 -> 35, AGX236 -> 37), withtest-hk-execution-allowance.candhk_cpu_upload_bench.cupdated across everyenum agx_chip.
- Cleanly preserves #706 (
- §1–§4, §6: Removes model/generation gating on compute root trim; production-ready; human author/committer + human
Signed-off-by:only on69fb5f502522(zero AI trailers); PR body uses Borealis naming and ends withAssisted-by:.
Actionable Blockers (§5 Multi-Generation & Live-Head Hardware Evidence)
Zero code blockers remain, but §5 hardware verification is still incomplete for the newly enabled paths and rebased head:
- AGX2 (
G13S/ M1 Pro,G14G/ M2 — binary version36 -> 37) hardware coverage missing: Zero hardware runs exist on AGX2 (where AGX2 USC root preload, compute root trimming, and the v36→37 cache format bump are newly active). RundEQP-VK.compute.*,dEQP-VK.binding_model.*, anddEQP-VK.descriptor_indexing.*(base vs head, cold cache + candidate-populated warm cache, covering dynamic descriptors and push constants at the end of the used prefix) with 0 new failures, 0 GPU faults, and clean system health. - Classic payload (
G16G/ M4 Air — binary version34 -> 35) hardware coverage missing: Zero hardware runs cover the classic v34→35 serialization bump and compute root trim. - No hardware run on exact live head
69fb5f502522: ExistingJ716c(fa5666793c06) andG17P(0c78e2ef7780) runs both predate the #706 (6eaea736177) rebase touching the samehk_cmd_upload.c/hk_shader.cblocks; confirm hardware rows against69fb5f502522(or a freshly rebased head) before merge.
Assisted-by: LLM (Gemini 4 Neon)
|
We do not have a J413 ( Source and host checks at
|
…pute-root-trim Bump shader binary versions past aurora-wip (AGX3 49 -> 50, classic 37 -> 38, AGX2 38 -> 39) and update test-hk-execution-allowance to match. Signed-off-by: Erik Bourget <erik@ebourget.net>
Compute dispatches that select an alternate variant (identity_copy4, im2col_vec4, or byte_stencil) kept reading the primary bound shader's root_descriptor_size via hk_only_variant(cmd->state.cs.shader). Pass the dispatched shader variant directly from each compute dispatch path via hk_cmd_buffer_upload_compute_root() so alternate variants use their own measured prefix. Signed-off-by: Erik Bourget <erik@ebourget.net>
…pute-root-trim Keep origin/aurora-wip's compute-pair state at AGX3 v50, bump shader binary versions past it (AGX3 50 -> 51, classic 37 -> 38, AGX2 38 -> 39), and update test-hk-execution-allowance to match. Signed-off-by: Erik Bourget <erik@ebourget.net>
…oads Record the uploaded compute root prefix size on compute-pair dispatches and require fused shaders to fit within that uploaded prefix in hk_fused_compute_shader_eligible(). Extend hk_cpu_upload_bench to cover depthwise_vec4 alternate root uploads and fused root-size rejection. Signed-off-by: Erik Bourget <erik@ebourget.net>
|
Merged live
|
satchlj
left a comment
There was a problem hiding this comment.
Verdict at f31f44f41f48
Approve. Follow-up commits (104da570ab4c, 8a87c4523221, f31f44f41f48) cleanly resolve the prior review findings: compute root trimming now measures and uploads the actually dispatched shader variant's root_descriptor_size across all compute dispatch paths, guards compute-pair fusion when the uploaded root prefix is smaller than the fused shader's demand, bumps all three shader binary versions past aurora-wip (AGX3 50 -> 51, classic 37 -> 38, AGX2 38 -> 39), and extends unit test coverage for depthwise_vec4 alternate uploads and fusion rejection.
Blockers
None.
Checked
- Audited all 10 changed files (
hk_agx3_vdm_decode.h,hk_cmd_buffer.{c,h},hk_cmd_dispatch.c,hk_cmd_upload.c,hk_compute_pair.h,hk_shader.{c,h},tests/hk_cpu_upload_bench.c,tests/test-hk-execution-allowance.c) and commit history/trailers (Signed-off-bypresent across all 5 commits). - Verified
hk_cmd_buffer_upload_compute_root(cmd, s)uploads the dispatched variant's measured prefix on all four compute dispatch paths (hk_dispatch_m5_native,hk_dispatch_g17p_native,hk_dispatch_g17g_native,hk_upload_usc_words_internal),hk_record_compute_pair()recordsdesc->uploaded_root_sizeintorecord.root_size, andhk_fused_compute_shader_eligible()rejects fusion wheneverp->root_size < required_root(with0interpreted as fullsizeof(struct hk_root_descriptor_table)). - Built Borealis from
f31f44f41f48with-Dbuildtype=debugoptimized -Db_ndebug=falseon Linux 7.3 (Apple M5 Max) and ran Meson suites:meson test --suite asahi:288/288 OK,0 Fail(includingmesa:hk_cpu_upload,mesa:hk_execution_allowance,mesa:hk_compute_pair,mesa:hk_root_size,mesa:hk_root_only_flush,mesa:hk_root_fragment).meson test --suite poly:5/5 OK,0 Fail.
- Ran live Vulkan CTS on Apple M5 Max (
dEQP-VK.compute.pipeline.*,22,533cases):5,086 Pass,17,447 NotSupported,0 Fail,0GPU faults. - Verified cold and warm shader disk cache serialization/deserialization (
400passing compute cases):400/400 Passcold (1,679cache files written),400/400 Passwarm,0GPU faults. - Untested scope: Live GPU execution on classic AGX / AGX2 / non-M5 AGX3 silicon (verified via unit tests across all
enum agx_chipvalues inmesa:hk_cpu_upload), and full-suite Vulkan CTS beyond the compute pipeline slice.
Evidence
- Guard:
OPEN|false|MERGEABLE|f31f44f41f48 - Build:
-Dbuildtype=debugoptimized -Db_ndebug=false - Meson:
asahi288/288 OK, 0 Fail;poly5/5 OK, 0 Fail - Live Vulkan CTS (
Apple M5 Max,dEQP-VK.compute.pipeline.*):total 22533 {'NotSupported': 17447, 'Pass': 5086},GPU_FAULTS=0 - Cold/warm shader cache (
400compute cases,MESA_SHADER_CACHE_DISABLE=false): cold400/400 Pass(1679files), warm400/400 Pass,CACHE_GPU_FAULTS=0
|
Added exact-head J713 (M4 Air,
Updated the PR body's |
…pute-root-trim Keep origin/aurora-wip's compute shader binary versions at AGX3 52 / classic 40 / AGX2 38 and bump past them for unconditional compute root prefix serialization (AGX3 53, classic 41, AGX2 39), updating test-hk-execution-allowance to match. Adapt to changes landed on origin/aurora-wip: - Preserve internal graphics-root selection in hk_dispatch_g17g_native() while passing the dispatched compute shader variant to hk_cmd_buffer_upload_compute_root(). - Record desc->uploaded_root_size on HK_COMPUTE_PAIR_FADD dispatches in hk_record_copy4_pair(), and use sizeof(struct hk_root_descriptor_table) when hk_pack_runs() allocates a full root table for needs_root fusions. - Initialize p->root_size in test-hk-fused-cprog and use alt_kind in hk_cpu_upload_bench. Signed-off-by: Erik Bourget <erik@ebourget.net>
|
Merged
|
Signed-off-by: Erik Bourget <erik@ebourget.net>
Signed-off-by: Erik Bourget <erik@ebourget.net>
Signed-off-by: Erik Bourget <erik@ebourget.net>
Signed-off-by: Erik Bourget <erik@ebourget.net>
Compute shader objects now serialize and trim root_descriptor_size on every GPU generation, so pass --expect-root-size for g13g alongside g17s and g17p in src/asahi/meson.build. Signed-off-by: Erik Bourget <erik@ebourget.net>
|
Merged
|
There was a problem hiding this comment.
Verdict: FINISH, then merge at e9a554a5
Blockers:
- Branch is
CONFLICTING(DIRTY) withaurora-wip; forward-mergeaurora-wip(no force push) and verify host tests pass on the merged head.
Checked:
dfdeeef3(root_sizeinitialization incheck_fused_m5_dispatch()) ande9a554a5(--expect-root-sizeenforcement for G13G) look sound; only theaurora-wipconflict blocks merge.- Checked for Apple material, tool attribution, private serials, and Borealis naming: clean.
Evidence
- Head:
e9a554a5b787(base: aurora-wip,mergeable: CONFLICTING,+145/-48across 14 files).
Bump shader binary versions past aurora-wip (AGX3 56->57, classic 43->44, AGX2 40->41). Signed-off-by: Erik Bourget <erik@ebourget.net>
|
Forward-merged |
There was a problem hiding this comment.
Verdict: MERGE at f60e0fa4 (note: prior DjDeveloperr CHANGES_REQUESTED at 69fb5f50 is superseded by follow-up fixes, satchlj approval at f31f44f4, and this clean aurora-wip merge).
Blockers: none.
Checked: Forward-merge resolution onto aurora-wip at f60e0fa4a69, shader binary version bumps (hk_agx3_vdm_decode.h, test-hk-execution-allowance.c), full 14-file diff (hk_cmd_upload.c, hk_cmd_buffer.{c,h}, hk_cmd_dispatch.c, hk_compute_pair.h, hk_queue.c, hk_shader.{c,h}, src/asahi/meson.build, and tests), and exact-head 265/265 asahi suite verification.
Evidence
- Merge resolution (
e9a554a5 -> f60e0fa4):- Resolves the sole prior blocker (
CONFLICTING->MERGEABLEonaurora-wip). - Bumps shader binary versions cleanly past
aurora-wip:HK_AGX3_SHADER_BINARY_VERSION56 -> 57,HK_CLASSIC_SHADER_BINARY_VERSION43 -> 44,HK_AGX2_SHADER_BINARY_VERSION40 -> 41, with matching assertions intest-hk-execution-allowance.c. - Preserves
hk_cmd_buffer_upload_compute_root()across AGX2, G17P, G17G, and M5 dispatch paths,root_sizefusion guards inhk_queue.c, unconditionalroot_descriptor_sizeserialization inhk_shader.c, and--expect-root-sizeforg13ginsrc/asahi/meson.build.
- Resolves the sole prior blocker (
- Verification:
meson test --suite asahipasses265/265(0failures,-Dbuildtype=release -Db_ndebug=false) at exact headf60e0fa4a69, alongside multi-generation J716c (1,247,208case executions,0diffs,0faults) and J713 hardware CTS rows on unchanged compute-root runtime code.
The AGX2 coverage is now recorded on J313 and on the current integration preview e2df2316e171 (J413 cold and warm compute readback). The unchanged compute-root path also has J713 and J716c CTS coverage, and the App verified the new binary-version bump and 265/265 host tests at the current head. f60e0fa
What: Measure, serialize, and trim compute root descriptor table uploads to each shader's measured demand on every GPU generation (including alternate compute variants via
hk_cmd_buffer_upload_compute_root()and submit-time compute-pair fusion bounds), while keeping HAL200/M5 graphics root trimming intact and removing the generation gate betweenhk_shader_serialize()andhk_deserialize_shader().Tested:
x86_64) ate9a554a5b787(merged withorigin/aurora-wipef132f590b25):hk_compute_pair_cache,hk_root_size,hk_cpu_upload,hk_execution_allowance,hk_fused_cprog,hk_compute_pair,hk_pack,hk-g13g-shader-binary-rootwith--expect-root-size,hk-g17p-shader-binary-root,hk-g17s-shader-binary-root): 10/10 passed (0failed).dfdeeef3fd9, before thesrc/asahi/meson.build--expect-root-sizeflag commite9a554a5b787) fullmeson test -C _build --suite asahi --suite poly: 340/341 passed (agx_tests1,719tests across153suites passed; the sole failure ishk_sync_stampsattest-hk-sync-stamps.c:1232, an unrelatedorigin/aurora-wipregression inhk_sync.c, untouched by this PR).e9a554a5b787vsef132f590b25(Linux 7.3.0, Borealis release builds;dEQP-VK.compute.*+binding_model.*+descriptor_indexing.*=207,868cases, 3 passes x 2 arms on one shared on-disk shader cache per Mac):J716c(M5 Max/G17C B1): per pass131,145 Pass / 76,722 NotSupported / 1 Fail(the onedescriptorset_randomcase fails on both arms in every pass),0diffs between arms and across the 3 passes (1,247,208case executions); shared cache892 -> 984 MiB,+0files on pass 3;0GPU faults.J713(M4 Air/G16G B0):compute.*anddescriptor_indexing.*0failures on both arms; at 2 workers1,899graphics cases (binding_model.shader_access.{primary,secondary}_cmd_buf,mutable_descriptor.*) failed intermittently on both arms at the same rate (base-vs-PR status diffs569 / 822 / 610per pass, against573-763base-vs-base and596-685PR-vs-PR across passes), and a single-worker rerun of all1,899passed on both arms in every pass (1,899/1,899,0diffs);0GPU faults. The CTS build here is not J313's (see Evidence).J313(M1 Air/G13G B1): full unstridedbinding_model.*; per run101,620 Pass / 106,236 NotSupported / 6 DeviceLost / 6 Crashidentical on all 6 runs (the 12 are pre-existingdescriptor_buffer.traditional_buffer.robust.null_descriptor.graphics_geom_*cases),0diffs, shared cache0 -> 179 -> 318 MBand flat after pass 2;0GPU faults/timeouts/resets.origin/aurora-wipmerge5fc79c28c89,dfdeeef3fd9, ande9a554a5b787):J713(M4 Air/G16G B0) atcd36f059a005vs262403b7bce1:dEQP-VK.compute.*+binding_model.*+descriptor_indexing.*(207,868cases:123,537Pass /84,331NotSupported /0Fail) across 6 passes on one shared cache,0diffs,0GPU faults.J716c(M5 Max/G17C B1) atcd36f059a005vs262403b7bce1:dEQP-VK.compute.*+binding_model.*+descriptor_indexing.*(207,868cases:127,222Pass /80,646NotSupported /0Fail) across 3 passes on one shared cache,0diffs,0GPU errors; earlierfa5666793c06run also checked4,096push-constant dispatches (1192 -> 832root bytes/dispatch) and Cyberpunk T2 (28.11 -> 28.30FPS).J313(M1 Air/G13G B1) atcd36f059a005vs262403b7bce1:compute.*+descriptor_indexing.*full (60,948cases:13,190Pass /47,758NotSupported) andbinding_model.*stride 5 (29,384of146,920cases:13,716Pass /11,689NotSupported /2,318DeviceLost /1,661Fail identical on both arms), 3 passes on one shared cache,0diffs,0GPU faults.A18 Pro(G17P B1) at0c78e2ef7780vs8e288e5dbc3b:67,553dEQP-VK.compute.*cases (12,607Pass /54,946NotSupported /0Fail) across 3 passes,0diffs,0GPU faults.Risk: two-way door · all Macs running Borealis (M1–M6/
G18Gand Neo — enables compute root upload trimming across all generations and bumps shader binary versions on AGX238 -> 39and classic40 -> 41, while AGX3 stays at53)Not yet:
depthwise_vec4,HK_COMPUTE_PAIR_FADD, andneeds_rootcompute-pair fusion on hardware (currently covered by host unit tests only), and the push-constant root-bytes microbenchmark and Cyberpunk 2077 T2 A/B (last measured atfa5666793c06, not repeated ate9a554a5b787).J413(M2 Air,G14G/ AGX2 v39),M1 Pro(G13S/ AGX2 v39),A18 Pro(G17P/ AGX3 v53), andG18G(M6/ classic v41).Details
Borealis on
origin/aurora-wip(da93fbdb) already trims compute and graphics root uploads on HAL200 (G16G/G17P) and M5 (agx_chip_g17_m5()), while leaving AGX2 (G13*/G14*),G15*, andG18Guploading the fullstruct hk_root_descriptor_tableon every compute dispatch and gatingroot_descriptor_sizeserialization separately from deserialization.hk_shader.c,hk_shader.h):hk_compile_nir()measureshk_shader_root_descriptor_size()for allMESA_SHADER_COMPUTEshaders across every chip generation (while preserving HAL200/M5 VS/FS graphics trimming), andhk_shader_serialize()/hk_deserialize_shader()unconditionally write and readroot_descriptor_size(including alternate compute variants compiled viahk_compile_compute_alt_nir()such asdepthwise_vec4), validated byhk_deserialized_root_valid().hk_nir_root_size()walksload_root_agxuses before uniform lowering and fails closed tosizeof(struct hk_root_descriptor_table)on unrecognized uses, non-constant offsets, depth > 8, orroot_desc_addrreflection reads (offset < 8).hk_shader_root_descriptor_size()floors atoffsetof(sets) + set_count * 8(rounded to 16 B), covering both AGX2 USC root uniforms (hk_agx2_upload_usc_words()) and AGX3 Ioto root ranges.hk_cmd_upload.c,hk_cmd_buffer.c,hk_cmd_dispatch.c):hk_cmd_buffer_upload_compute_root(cmd, s)uses the actually dispatched shader variants->root_descriptor_sizeacross all compute dispatch paths (hk_dispatch_m5_native(),hk_dispatch_g17p_native(),hk_dispatch_g17g_native(), andhk_agx2_upload_usc_words()), preservingcmd->state.gfx.rootfor internal graphics dispatches on CDM (internal). Reuse requiresdesc->uploaded_root_size == root_size.hk_compute_pair.h,hk_cmd_dispatch.c,hk_queue.c):hk_record_compute_pair()andhk_record_copy4_pair()(HK_COMPUTE_PAIR_FADD) recorddesc->uploaded_root_sizeintorecord.root_size, andhk_fused_compute_shader_eligible_ranges()rejects fusion if the fused shader's required root prefix exceedsp->root_size. Whenhk_pack_runs()allocates a fresh fullstruct hk_root_descriptor_tableforneeds_rootfusions (dual != HK_COMPUTE_PAIR_DUAL_NONE || has_im2col || has_dw_a), both the eligibility check (eff_p.root_size) andtmp_disp.root_sizeusesizeof(struct hk_root_descriptor_table).cmd->state.gfx.root) and the indirect grid helper keep their existing full/graphics root behavior.hk_agx3_vdm_decode.h,src/asahi/meson.build,test-hk-execution-allowance.c,test-hk-compute-pair-cache.c): Keepsorigin/aurora-wip's AGX3 v53 (which already carriesroot_descriptor_sizeon G17P and M5) and bumps classic40 -> 41and AGX238 -> 39for unconditional compute root prefix serialization across all chips. Enables--expect-root-sizeonhk-g13g-shader-binary-rootalongsideg17sandg17pinsrc/asahi/meson.build(the flag requires the root-size field to be present in the binary; it does not by itself require a trimmed value), and initializesp.root_size = sizeof(struct hk_root_descriptor_table)incheck_fused_m5_dispatch()(test-hk-compute-pair-cache.c) andinit_base_fixture()(test-hk-fused-cprog.c).Evidence
Host verification at
e9a554a5b787(merged withorigin/aurora-wipef132f590b25)meson setup _build -Dgallium-drivers=asahi -Dvulkan-drivers=asahi -Dtools=drm-shim -Dbuild-tests=true -Doptimization=2 -Ddebug=false -Db_ndebug=falsee9a554a5b787(meson test -C _build -v hk_compute_pair_cache hk_root_size hk_cpu_upload hk_execution_allowance hk_fused_cprog hk_compute_pair hk_pack hk-g13g-shader-binary-root hk-g17p-shader-binary-root hk-g17s-shader-binary-root): 10/10 passed,0failed (hk-g13g-shader-binary-rootran with--expect-root-size, which requires the serialized root-size field to be present but accepts any prefix from 16 B to the full table; it printed trimmed compute root prefixes of176/2216B and832/2216B onG13G, which is the evidence that the compiler trims).dfdeeef3fd9) full build & suite (ninja -C _build src/egl/libEGL_mesa.so.0.0.0 src/gallium/targets/dri/libgallium-26.3.0-devel.so src/asahi/vulkan/libvulkan_asahi.soandmeson test -C _build --suite asahi --suite poly): 340/341 passed,1failed (agx_tests1,719tests across153suites passed;hk_sync_stampsfailed attest-hk-sync-stamps.c:1232due to unrelatedorigin/aurora-wiphk_sync.cchanges in7617c835cd8/ef132f590b25).Exact-head hardware at
e9a554a5b787vsef132f590b25(Linux 7.3.0)Each Mac:
dEQP-VK.compute.*60,838+dEQP-VK.binding_model.*146,920(full, unstrided) +dEQP-VK.descriptor_indexing.*110=207,868cases per run, 3 passes x 2 arms, one shared on-diskMESA_SHADER_CACHE_DIRper Mac.J716c (
M5 Max/G17C B1)libvulkan_asahi.sosha25650e9d0a2361d...base,1c033af7d47c226485759a4fd8a79cf9dd8d812cb9108e760aa794511a233afchead. Shared cache capped at4G, 4 shards.compute.*binding_model.*descriptorset_random.sets8.runtimesize.noubo.nosbo.nosampledimg.storageimghigh.iublimitlow.uab.mesh.noia.0, identical on both arms in every pass)descriptor_indexing.*0per-case diffs between593and base in each of the 3 passes, and0across passes for both arms (1,247,208case executions);0GPUdmesglines.166,059files (892 MiB) after pass 1,174,488files (984 MiB) after pass 2,+0new entries on pass 3 (warm reuse, no cross-arm corruption).J713 (
M4 Air/G16G B0)VK_DRIVER_FILES:libvulkan_asahi.sosha256prefixes1335dbdeee54base,1f39641ad11fhead. The Vulkan CTS is a different build from J313's (copied from the J716c's CTS build,7ba03cd; the207,868case count matches), driven by a chunked runner (2,000 cases perdeqp-vkprocess, crash/timeout resume, results parsed from the.qpalogs). 3 interleaved passes, 2 workers, cache and results on disk.593593593binding_model.shader_access.{primary,secondary}_cmd_buf(1,892) andbinding_model.mutable_descriptor.*(7),1,899distinct cases;compute.*anddescriptor_indexing.*had0failures. Base-vs-593status diffs were569 / 822 / 610per pass, base-vs-base across passes573-763and593-vs-593596-685, so the arms are indistinguishable under concurrency.1,899/1,899each time),0diffs.0GPU fault, timeout or recovery lines;0low-memory aborts in the final run (minimumMemAvailableabout5.8 GB).J313 (
M1 Air/G13G B1)-Doptimization=2 -Ddebug=false -Db_ndebug=false), Vulkan CTSvulkan-cts-1.4.6.2-4-gcbe875d1aa08,Apple M1 (G13G B1). Run order base,PR / PR,base / base,PR across the 3 passes on one shared on-disk cache (0 -> 179 -> 318 MB, flat after pass 2).binding_model.*(146,920cases, not strided):101,620 Pass / 106,236 NotSupported / 6 DeviceLost / 6 Crashidentical on all 6 runs; the 12DeviceLost/Crashcases are the pre-existingdescriptor_buffer.traditional_buffer.robust.null_descriptor.graphics_geom_*cases.0diffs across all 6 runs;0GPU faults, timeouts or resets.Earlier-head hardware verification (superseded by the exact-head rows above; predates
5fc79c28c89/dfdeeef3fd9/e9a554a5b787)J713(M4 Air,Apple M4 (G16G B0),Linux 7.3.0, CTSvulkan-cts-1.4.6.2-4-gcbe875d1aa087) atcd36f059a005vs262403b7bce1:MESA_SHADER_CACHE_DIR(4 GiBcap, 6 shards),207,868vk-defaultmustpass cases (dEQP-VK.compute.*60,838,dEQP-VK.binding_model.*146,920,dEQP-VK.descriptor_indexing.*110:123,537Pass /84,331NotSupported /0other,0diffs across all 6 passes); base (+63,528) and PR (+63,527) cache keys isolated;0GPU faults,0failed units.J716c(M5 Max,Apple M5 Max (G17C B1),Linux 7.3.0, CTS7ba03cd) atcd36f059a005vs262403b7bce1:MESA_SHADER_CACHE_DIR(4 GiBcap, 6 shards),207,868vk-defaultmustpass cases (127,222Pass /80,646NotSupported /0other,0diffs); base (+63,177) and PR (+63,176) cache keys isolated;0GPU-error lines.J313(M1 Air,Apple M1 (G13G B1),Linux 7.3.0, CTSvulkan-cts-1.4.6.2-4-gcbe875d1aa087) atcd36f059a005vs262403b7bce1:MESA_SHADER_CACHE_DIR(4 GBcap, 6 shards):compute.*+descriptor_indexing.*full (60,948cases:13,190Pass /47,758NotSupported) andbinding_model.*stride 5 (29,384of146,920cases:13,716Pass /11,689NotSupported /2,318DeviceLost /1,661Fail identical on both arms);0diffs; base (+23,220) and PR (+23,219, then+0) cache keys isolated;0GPU faults.A18 Pro(G17P B1, MacBook Neo,Linux 7.3.0-41.fc44.aurora.aarch64) at0c78e2ef7780vs8e288e5dbc3b:MESA_SHADER_CACHE_DIRon fulldEQP-VK.compute.*(67,553cases:12,607Pass /54,946NotSupported /0Fail /0diffs, cache0 -> 4,343 -> 8,685 -> 8,685),dEQP-VK.compute.pipeline.basic.*(79Pass /2NotSupported /0Fail /0diffs), andgpubench-vk compute.light(depth 1–64 within0.26%);kfault_delta=0,avc_delta=0.J716c(M5 Max,G17C) atfa5666793c06:1192 -> 832, recording time0.09–0.12 µsand GPU time unchanged; Cyberpunk 2077 (tier T2, 3 alternating passes): base mean28.11FPS vs head mean28.30FPS.