Skip to content

agx: rotate AGX3B integer-ALU compute loops and interleave IC/SCIB pipes - #1302

Merged
DjDeveloperr merged 2 commits into
aurora-wipfrom
perf/agx3b-uber-latch
Nov 28, 2026
Merged

DjDeveloperr merged 2 commits into
aurora-wipfrom
perf/agx3b-uber-latch

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 28, 2026 •

Copy link
Copy Markdown

What

Two strictly AGX3B-scoped (agx3_is_agx3b(), covering G15/G16/G17P) compute compiler optimizations targeting narrow integer-ALU loops (compute.uber), leaving all graphics shaders, non-integer compute loops (compute.fp16, compute.heavy, compute.stereo, compute.conv2d), and non-AGX3B targets (AGX2 / G13G, AGX3C / G17S) 100% bit-identical to aurora-wip:

  1. c454fa1d77a4 — agx: rotate AGX3B compute exact-tail integer-ALU unrolled main loops

    • Adds agx_nir_unroll_runtime_loops_ex() with a rotate_main option enabled for AGX3B compute shaders.
    • When unrolling an exact-tail bottom-tested pure integer-ALU counted loop (exact_tail && loop_is_int_alu_only(loop)), guards entry once outside the unrolled main loop and preserves the bottom-tested else-break latch form.
    • Exposes the full unrolled integer loop body as a single header block for bounded-pressure IC/SCIB scheduling while preserving early loop-compare placement without register-cache interference, keeping FP16/FP32 and memory-bound compute loops bit-identical.
  2. e4c9d1dff6f4 — agx: interleave AGX3B IC/SCIB integer pipes with bounded loop ALU pressure

    • Splits integer ops in agx_ilp_schedule() into ILP_PIPE_SCIB (IADD, BITOP, ICMPSEL; throughput 1) and ILP_PIPE_IC (IMAD, BFI, BFEIL, EXTR, ASR; throughput 2), enforcing 2-cycle IC issue spacing when interleave_alu is active on AGX3B.
    • Adds agx_ilp_agx3b_compute_granule_cap(signed peak) reserving AGX_ILP_M5_OCCUPANCY_MARGIN (8 halves) below 48 halves (-> 40), 96 halves (-> 88), and every higher agx_occupancy_for_register_count() step (104->96, 112->104, 128->120, 136->128, 144->136, 160->152, 184->176), returning 0 whenever peak <= 0 || peak > 256 || peak + 8 > top, and aligning budget to budget - 8.
    • Adds bool strict_cap to ilp_schedule_block() (false at all other call sites) enforcing the strict conjunction of BOTH the granule cap AND the <= peak + 8 growth bound (after > before + slack || (cap > 0 && live_past_end + after > cap)), preventing even +1/+2 half boundary crossings inside the 8-half RA margin.
    • Eliminates RAW back-to-back stalls in G16G compute.uber narrow inner loops (128 -> 0 on >> 9 loops, 192 -> 3 on << 7 loops) and keeps consecutive IC ops <= 2 without crossing any granule/occupancy step or changing GPRs, threads, or spills.

Tested

Offline verification (e4c9d1dff6f4 on live aurora-wip @ 702dd0165bd0, fedora x86_64 -Db_ndebug=false)

  • meson test --suite asahi: 263 / 263 PASS, 0 fail, 0 timeout:
    • M5RuntimeLoops.BottomTestedRotateMainKeepsBottomTest (memory-load and FP-loop negative controls).
    • FmWave2IlpSchedule.Agx3bComputeIntLoopPreserves48And96HalfGranules (actual agx_ra() sweep across all 9 boundaries {48, 96, 104, 112, 128, 136, 144, 160, 184} with scalars + 3 live vec3s, 0 boundary crossings; confirmed failing on pre-fix 0b084210df63 where 48 -> 50).
    • FmWave2IlpSchedule.Agx3bComputeIntLoopEnforces8HalfGrowthBound and updated Agx3bComputeLoopRespectsOccupancyTierCapAndHighPressure.
  • 5-chip x 14-row noop drm-shim matrix (g16g, g17p, g15s, g17s, g13g, with ASAHI_SHIM_VALIDATE_G17P_STREAM=1 on AGX3B) + heavy_alu + stereo: 70 / 70 PASS (0 refusals, 0 asserts, 0 rejections):
    • g17s (AGX3C) and g13g (AGX2): 14 / 14 100% bit-identical to 702dd0165bd0.
    • g16g (M4): ONLY compute.uber (uniform and divergent) changes, and BOTH binaries are 100% bit-identical to 0b084210df63 (uniform sha256 eb7d5d0a8220323e9ac20d4cb5ce3eb24dab3bda12778ba376ebee9456a5fd03, divergent sha256 4f4ba43b8ceee58c1c5348fb280ffabb70c95c6b5fc5e9b733f4952902433921); compute.fp16, compute.heavy, compute.stereo, compute.conv2d, and all graphics rows are 100% bit-identical to 702dd0165bd0.

Apple Silicon hardware (Mac mini J773g, T8132 / G16G B0, stock kernel 7.3.0-ARCH-m4mainefed1ae3, SLC ON 2 planes, gpubench @ ae90a40f11b9)

  • Mirrored AB (702dd0165bd0 vs 0b084210df63, bit-identical compute.uber binaries to e4c9d1dff6f4, 30 launches & 130 samples per arm, 18/18 gate CRCs, 78/78 timed CRCs, 0 GPU faults/recoveries/hang kills/quarantine):
Workload BASE submit (us) HEAD submit (us) Submit delta BASE GPU (us) HEAD GPU (us) GPU delta CRC
compute.uber uniform d4 185.53 178.09 -4.01% (4/4 pairs: -3.92..-4.01%) 185.31 177.76 -4.08% (4/4 pairs: -3.98..-4.12%) b022fbaf
compute.uber uniform d1 396.83 397.22 +0.10% 184.00 177.44 -3.57% (4/4 pairs: -3.44..-3.64%) b022fbaf
compute.uber divergent d4 477.90 470.04 -1.65% (4/4 pairs: -1.41..-1.88%) 601.28 578.75 -3.75% (mixed pairs) 9963f56c
compute.uber divergent d1 709.23 704.23 -0.71% (3/4 faster) 494.06 482.92 -2.26% (4/4 pairs: -2.22..-2.75%) 9963f56c
compute.fp16 alu_mix d1 (bit-identical) 613.82 614.35 +0.09% 391.94 393.19 +0.32% 5166a42c
compute.heavy alu d1 (bit-identical) 769.23 769.23 0.00% 546.10 546.10 0.00% status ok
compute.stereo d1 / d2 (bit-identical) 3750.00 / 3673.47 3750.00 / 3673.47 0.00% / 0.00% 3530.38 / 3530.34 3530.52 / 3530.44 0.00% / 0.00% c62aadf9
compute.conv2d gaussian d4 (bit-identical) 481.93 481.93 0.00% 481.75 481.56 -0.04% 2d55a14d
  • Targeted Vulkan CTS (--jobs 1, 0b084210df63): 624 Pass / 0 NotSupported / 0 Fail / 0 Crash (0 GPU faults, SLC ON 2 planes; exact-head e4c9d1dff6f4 J773g smoke PASS (git-e4c9d1dff6, 6/6 CRCs, 0 faults, SLC ON 2 planes): matched-protocol compute.uber uniform d4 178.0944 us/submit / 177.791 us GPU, uniform d1 177.46 us GPU, divergent d4 469.49 us/submit, divergent d1 482.92 us GPU, fp16 alu_mix d1 391.88 us GPU, conv2d gaussian d4 481.75 us GPU).

Risk

Two-way door. Strictly AGX3B-scoped (agx3_is_agx3b(), covering G15/G16/G17P) compute compiler optimization with no UAPI, ABI, or kernel impact; AGX2, AGX3C, all graphics shaders, and all non-integer compute loops are verified 100% bit-identical.

Not yet

  • Second-generation AGX3B hardware confirmation on MacBook Pro J516s (G15S / M3 Pro) via Frontier.

Rebase & Review-Blocker Fixes (10ebf8db4b5eaee582bd7b9edab6af16906aed08)

Rebased onto aurora-wip @ 5b64e3c144d1 (git merge-tree --write-tree clean vs live origin/aurora-wip @ 3c22d09094c0) and addressed both #6098808902 review findings:

  1. Allocator-compatible RA demand + 8-half growth bound: Added ilp_ra_reserved_halves() (ALIGN_POT(agx_reserved_registers(ctx), 2)), ilp_order_ra_demand(), and ilp_block_ra_demand() accounting for power-of-two vector rounding (util_next_power_of_two(agx_index_size_16(dest))), preload/export floors, and exact late-kill overlaps, with a 4-half RA margin in agx_ilp_agx3b_compute_granule_cap() and strict strict_ra_cap acceptance. Verified 0 crossings across all 9 AGX3B granule boundaries (48..184) across G15S/G16G/G17P with 0/1/3/7 32-bit vec3s (Agx3bComputeIntLoopPreserves48And96HalfGranules) plus revert-proofed <= ra_peak + 8 enforcement (Agx3bComputeIntLoopEnforces8HalfGrowthBound).
  2. Scoped split_int_pipes gating: Strictly gated ILP_PIPE_IC/ILP_PIPE_SCIB pipe split and ic_ready = best_t + 2 pacing behind bool split_int_pipes (safe int_alu_loop compute blocks only), verified by Agx3bPipeSplitAndIcPacingDoNotLeakOutsideComputeIntLoops (vertex, fragment, and mixed FP/int compute loops unchanged).
  3. Offline verification (10ebf8db4b5e): compute.uber uniform (7a4c00e4...) and divergent (8ed928db...) G16G binaries 100% bit-identical to e4c9d1dff6f4 / 0b084210df63; meson test --suite asahi (-Db_ndebug=false) 263/263 PASS; 5-chip drm-shim matrix 70/70 PASS.

Rebase onto #1298 & Complete Pure-Int Whitelist (a78fb0e5363a442c86447bf5895bf62744098933)

  • Cleanly rebased onto aurora-wip @ 3c22d09094c0 (#1298 + #1299 + #1306, clean git merge-tree vs live origin/aurora-wip @ 878ddc0cc649).
  • Replaced the narrow FP-op check with a complete pure-integer opcode whitelist (ilp_is_pure_int_loop_op()) so no FP, SFU (RCP, RSQRT, SRSQRT, FLOOR, CEIL, TRUNC, FCMPSEL, LOG2, EXP2, SIN_PT_*, SINC_AGX3, PERSP_RCP_AGX3, CONVERT, etc.), matrix, subgroup, or memory op can enable split_int_pipes.
  • Upgraded Agx3bPipeSplitAndIcPacingDoNotLeakOutsideComputeIntLoops to non-vacuous 9-int-op mixed fixtures (FADD, RCP, FCMPSEL each with 7 BFEIL + 2 IADD), revert-verified to fail all 3 cases if the whitelist is removed.
  • Replaced all 8 mixed positional/designated initializers in BottomTestedRotateMainKeepsBottomTest (test-m5-runtime-loops.cpp) with nir_intrinsic_set_* for 0 Clang -Wc99-designator warnings.
  • Verified on a78fb0e5363a (-Db_ndebug=false): meson test --suite asahi 263/263 PASS; compute.uber uniform/divergent G16G binaries 100% bit-identical to e4c9d1dff6f4, and dt4/sh_alpha/pf4 100% bit-identical to 3c22d09094c0.

Final Whitelist Fix (ed74eed35557b21290ed8f177702310370e6844e)

  • Removed AGX_OPCODE_BITTEST_SELECT_AGX3 (float32 select) from ilp_is_pure_int_loop_op() in src/asahi/compiler/agx_pressure_schedule.c; verified zero float/SFU opcodes remain in the whitelist against src/asahi/compiler/agx_opcodes.py.
  • Added MIXED_BITTEST_SELECT (7 BFEIL + 2 IADD + live BITTEST_SELECT_AGX3) to FmWave2IlpSchedule.Agx3bPipeSplitAndIcPacingDoNotLeakOutsideComputeIntLoops (revert-verified to fail when BITTEST_SELECT_AGX3 is allowed).
  • Verified on ed74eed35557 (-Db_ndebug=false): meson test --suite asahi -t 3 263/263 PASS; G16G compute.uber uniform and divergent binaries remain 100% bit-identical to a78fb0e5363a / e4c9d1dff6f4.

Exact-Head J773g Smoke (ed74eed35557b21290ed8f177702310370e6844e)

  • J773g (T8132, G16G B0, 7.3.0-ARCH-m4mainefed1ae3, SLC ON 2 planes) PASS:
    • Native commit ed74eed35557b21290ed8f177702310370e6844e (tree 875b59a41dc84e511226b03296f332314a950b00), loaded Borealis git-ed74eed355, driver SHA-256 0750fff0ba60958408091c150aea3cf1dab3368e0d36e01d8eb02ad2db7cc4b6.
    • Vulkan GPUBench ae90a40f11b9ce22542fe55dabdb60033859fd13 (--warmup-ms 150 --runs 3 --run-ms 200):
      • compute.uber uniform d4: 168.35 µs submit / 175.65 µs GPU (CRC b022fbaf)
      • compute.uber divergent d4: 470.59 µs submit / 636.96 µs GPU (CRC 9963f56c)
      • render.deferred tile MSAA4 d2: 285.71 µs submit / 297.38 µs GPU (CRC 6dc74b48)
      • render.shadow alpha-test d2: 892.86 µs submit / 892.00 µs GPU (CRC 7be9463a)
    • 4/4 exact CRCs, all GPU medians positive, active display, 0 GPU faults / client errors / recoveries / hang kills / quarantined owners.

@DjDeveloperr
DjDeveloperr requested review from a team as code owners November 28, 2026 13:17

@aurora-silicon-review aurora-silicon-review Bot 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.

Verdict: MERGE at 0b084210

Blockers: none (second-generation J516s / G15S confirmation is queued)

Checked: no Apple material, no AI attribution, human DCO Signed-off-by on both commits, Borealis naming clean, strictly scoped to AGX3B (agx3_is_agx3b() / AGX_ISA_ENCODING_AGX3B) compute integer-ALU loops leaving AGX2, AGX3C, all graphics shaders, and all FP/memory compute loops 100% bit-identical (70/70 5-chip drm-shim matrix verified), agx_nir_unroll_runtime_loops_ex() guards rotation to cl->bottom && exact_tail && loop_is_int_alu_only(loop) (rejecting nested loops, float ALU, tex/deref, and non-reg intrinsics), agx_ilp_schedule() splits ILP_PIPE_SCIB vs ILP_PIPE_IC with 2-cycle IC issue spacing and caps bounded loop ALU lookahead strictly within the current occupancy tier (peak > 0 && peak <= 256 guarding agx_occupancy_for_register_count(), max_registers - 8, budget - 8, program_peak), 263/263 meson test --suite asahi PASS (including new rotation + IC/SCIB + occupancy-tier/high-pressure tests), exact-head J773g (G16G) mirrored AB PASS (compute.uber uniform d4 -4.08%, d1 -3.57%, divergent d1 -2.26%, 0 faults, all CRCs exact) and targeted Vulkan CTS 624/624 Pass, PR body has Tested: and Risk: Two-way door, branch is MERGEABLE against aurora-wip.

Evidence
  • Inspected full diff (+671/-63 across agx_compile.c, agx_nir.h, agx_nir_unroll_runtime_loops.c, agx_pressure_schedule.c, test-agx3-fm-wave2.cpp, test-m5-runtime-loops.cpp):
    • loop_is_int_alu_only(): rejects nested loops, any float ALU input/output, tex/deref, and any intrinsic other than load_reg/store_reg, and requires int_ops > 0.
    • unroll_loop() rotation branch: guards entry once outside main_loop, repeats body factor times (<= 16), and places bottom latch if (!b_cont) break, keeping agx_nir_unroll_runtime_loops() callers unchanged (rotate_main = false).
    • agx_ilp_schedule() (agx_pressure_schedule.c:2566-2615): requires dynamic && size16 && ctx->stage == MESA_SHADER_COMPUTE && ctx->key->dev.encoding == AGX_ISA_ENCODING_AGX3B && int_ops >= 8 && fp_ops == 0, checks peak > 0 && peak <= 256 before calling agx_occupancy_for_register_count(), and only widens alu_slack (max 8) when peak + 2 <= max_cap.
  • Offline & hardware verification at 0b084210: 263/263 unit tests, 70/70 5-chip drm-shim, 624/624 targeted Vulkan CTS, exact-head J773g mirrored AB with -2.26% to -4.08% GPU wins on compute.uber and bit-identical non-target workloads.

@aurora-silicon-review aurora-silicon-review Bot 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.

The new IC issue spacing and split SCIB/IC pipe preference are keyed on interleave_alu, not the new int_alu_loop predicate. The shared no-memory loop call still passes is_agx3 && !m5 for interleave_alu even when int_alu_loop is false, so mixed FP/integer loops and other callers enabling that flag can change scheduling. Please separate the new split/spacing enable from the legacy interleave flag, preserve the old INT bucket for non-target callers, and add a mixed loop negative control whose scheduling order can distinguish the pipes.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HOLD at e4c9d1dff6f43b9430b53b27273dc353652d47b5.

  1. src/asahi/compiler/agx_pressure_schedule.c:2619 picks the tier from unrounded SSA pressure. On G16G, the estimate stays within its 152-half cap while actual allocation rises from 159 to 162 halves, crossing 160. The sweep found 72 crossings in 103,032 pairs at 104, 136, 160 and 184, with 24 per chip on G15S, G16G and G17P. The same sweep with the live-base scheduler had zero crossings. Use allocator-compatible widths and liveness for the guard, and validate physical placement across the boundaries.
  2. src/asahi/compiler/agx_pressure_schedule.c:2640 gives the shared ALU interleaver the new IC spacing and split pipe preference even when int_alu_loop is false. A G16G vertex or fragment loop with two independent BFEILs and one IADD changes from BFEIL BFEIL IADD to BFEIL IADD BFEIL. With a live FADD in a compute loop, the order changes from BFEIL FADD BFEIL IADD to BFEIL IADD BFEIL FADD. Gate the new pipe split and pacing on the intended compute predicate and retain the legacy integer bucket for other callers.
Reproduction and checks
  • For the 160-half crossing, adapt the CFG in Agx3bComputeIntLoopPreserves48And96HalfGranules. Set any_cf = true, preload at half index 2 and keep three 32-bit vec3s and 108 scalar halves live across the loop. Use 24 extra scalar halves on the alternate path and four integer chains with a BFEIL in place of the first shifted IADD. Compare pressure-only and pressure-then-ILP through agx_ra() using max_reg + 1. Estimated peak goes 146 to 152 and allocated halves go 159 to 162. With seven vec3s and 20 scalar halves the same shape goes 103 to 106, crossing 104. The scheduler charges six halves per vec3. RA rounds it to eight and also accounts for reserved registers and late kills.
  • The sweep covered all nine tracked boundaries with scalar, vec2, vec3 and vec4 values and SCIB-only and mixed IC/SCIB chains. Every allocation succeeded.
  • Both new gtests passed at the reviewed head. With the scheduler restored to 0b084210df63 and the new tests retained, the granule test reproduced 48 to 50 halves. The 8-half growth test passed in both configurations, and needs a fixture that fails with the guard reverted.
  • The NIR rotation requires AGX3B compute and an exact-tail bottom-tested loop. The entry guard and latch evaluate the legacy comparison on the state at each unrolled group boundary. The matcher rejects extra jumps and nested loop bodies. The rotation admits only register intrinsics, and the exact-tail check restricts live-outs to shared back-edge values or rematerializable invariants.
  • Clean merge onto live aurora-wip at b156422890b2, clean diff check, and matching human DCO sign-offs on both commits.
  • Fedora 44 full Asahi suite with DRM shim on the clean merge had 343 passes and 3 failures with each of -Db_ndebug=false and -Db_ndebug=true. The three known EGL priority cases failed at dlopen("libEGL.so.1") because the container lacks that library. The compiler suite passed in both modes.
  • The PR body records exact-head J773g smoke with 6/6 CRCs and zero faults. The second-generation AGX3B row on J700 or J516s is pending.

@aurora-silicon-review aurora-silicon-review Bot 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.

Verdict: FINISH, then merge at 10ebf8db

Blockers:

  1. Branch is CONFLICTING (DIRTY) against aurora-wip; rebase or forward-merge onto current aurora-wip (no force push if merging) and confirm host tests and binary/hardware checks on the resulting head.

Checked:

  • Both code blockers from e4c9d1df are cleanly resolved (0 code blockers remain):
    • src/asahi/compiler/agx_pressure_schedule.c: verified ilp_ra_reserved_halves(), ilp_order_ra_demand(), and ilp_block_ra_demand() match agx_calc_register_demand() semantics (power-of-two ra_size16, aligned reserved low halves, PRELOAD/EXPORT floors, deduped killed sources, and unread destination overlap) with a 4-half margin in agx_ilp_agx3b_compute_granule_cap() and strict_ra_cap enforcing both ra_after <= ra_before + slack and ra_after <= cap. Fallback when already inside the margin sets alu_slack = 0, strict_ra_cap = true, and split_int_pipes = false.
    • split_int_pipes gating: verified every ilp_schedule_block() call site passes false except safe AGX3B compute int_alu_loop blocks (int_ops >= 8 && fp_ops == 0 with ra_peak <= max_cap), keeping IMAD/BFI/BFEIL/EXTR/ASR in the single legacy integer pipe with no ic_ready pacing on all other stages and mixed FP/int loops.
    • src/asahi/compiler/agx_nir_unroll_runtime_loops.c: verified rotate_main is strictly gated to AGX3B compute cl->bottom && exact_tail && loop_is_int_alu_only(loop) (no nested loops, float ALU, tex/deref, or non-reg intrinsics).
    • Unit tests (test-agx3-fm-wave2.cpp, test-m5-runtime-loops.cpp): verified coverage of all 9 AGX3B boundaries (48..184) across G15S/G16G/G17P, revert-proofed <= ra_peak + 8 enforcement, non-leakage on vertex/fragment/mixed-FP loops, and rotated bottom-tested loops.
Evidence
  • Head: 10ebf8db (mergeable: CONFLICTING, mergeStateStatus: DIRTY, +1347/-88 across 5 files).
  • Author verification at 10ebf8db: compute.uber G16G binaries bit-identical to e4c9d1df / 0b084210, meson test --suite asahi (-Db_ndebug=false) 263/263 PASS, 5-chip drm-shim 70/70 PASS.
  • Note (non-code): second-generation AGX3B confirmation on J516s (G15S) remains listed under Not yet.

Add agx_nir_unroll_runtime_loops_ex() with a rotate_main option and enable
it for AGX3B compute shaders. When unrolling an exact-tail bottom-tested
pure integer-ALU counted loop, guard entry once outside the unrolled main
loop and keep the loop bottom-tested with the else-break latch form.

Restricting rotation to exact-tail pure integer-ALU loops keeps FP16/FP32
and memory-bound compute loops bit-identical while preserving early loop
compare placement (without register-cache interference on the early loop
compare) and exposing the full unrolled integer loop body as a single header
block for bounded-pressure IC/SCIB ILP scheduling. AGX3C, AGX2, and
non-compute stages remain unchanged.

Signed-off-by: DjDeveloperr <hey@djdev.me>

@aurora-silicon-review aurora-silicon-review Bot 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.

Verdict: MERGE at a78fb0e5

Blockers: none

Checked:

  • Mergeability: a78fb0e5 resolves the 10ebf8db conflict cleanly (MERGEABLE on aurora-wip).
  • src/asahi/compiler/agx_pressure_schedule.c: verified ilp_is_pure_int_loop_op() strictly whitelists pure integer ALU, SSA glue, and integer control-flow opcodes (no FP, SFU, conversion, matrix, subgroup, or memory op can qualify for split_int_pipes), alongside the previously verified allocator-compatible RA demand (ilp_ra_reserved_halves(), ilp_order_ra_demand(), ilp_block_ra_demand(), 4-half margin, strict_ra_cap) and split_int_pipes gating.
  • src/asahi/compiler/test/test-agx3-fm-wave2.cpp and test-m5-runtime-loops.cpp: verified the upgraded non-vacuous 9-int-op mixed fixtures (FADD, RCP, FCMPSEL) and nir_intrinsic_set_* initializer cleanup.
Evidence
  • Head: a78fb0e5 (MERGEABLE on aurora-wip).
  • Author verification at a78fb0e5: meson test --suite asahi (-Db_ndebug=false) 263/263 PASS; compute.uber uniform/divergent G16G binaries bit-identical to e4c9d1df; dt4/sh_alpha/pf4 bit-identical to 3c22d09094c0; 0 Clang -Wc99-designator warnings.
  • Note: second-generation AGX3B confirmation on J516s (G15S) remains listed under Not yet.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHANGES-NEEDED at a78fb0e5363a442c86447bf5895bf62744098933.

Blocker

src/asahi/compiler/agx_pressure_schedule.c:1408 admits BITTEST_SELECT_AGX3 to the pure-integer whitelist. It is a floating-point select with float32 inputs and output. In a G16G compute loop with seven BFEIL instructions, two IADD instructions and a live BITTEST_SELECT_AGX3, the first two scheduled operations are BFEIL, IADD. Removing just this whitelist entry restores BFEIL, BFEIL and the probe passes. Exclude the opcode and cover it in the mixed-loop regression.

Checked

  • Clean merge onto 878ddc0cc649, clean diff check and matching DCO sign-offs on both commits. The tile-load pinning and fragment SFU scheduler arguments from #1298 and #1299 are preserved.
  • Fedora 44 aarch64 Clang 22.1.8 Asahi suite passed 346/346 in each assertion mode with zero new warnings. Both compute.uber variants passed on all five DRM-shim chip profiles.
  • Physical RA showed 0 crossings in 103,032 pairs across all nine boundaries from 48 through 184 halves. Restoring unrounded demand reproduced 72 crossings.
Negative controls

Removing the whitelist made the FADD, RCP and FCMPSEL mixed-loop cases fail. Removing the rotation purity guard failed the floating-point and memory fixtures. An independent pure-integer, non-exact-tail loop passed with the guard and hit a NIR assertion when the exact-tail guard was removed. Disabling rotation failed the bottom-latch checks. Removing the 8-half growth limit let the independent test run grow from 56 to 68 halves and fail.

@DjDeveloperr

Copy link
Copy Markdown
Author

J700 second-generation confirmation. J700 / G17P B1, Aurora Fedora Remix release 44 aarch64, kernel 7.3.0-41.fc44.aurora.aarch64. SLC was enabled on all four MCC planes throughout.

PR head a78fb0e5363a442c86447bf5895bf62744098933 tested as clean merge 5bcd0f2e57df68faee474a617c887fd8c77a9452 on baseline 878ddc0cc649e271b9cb36adf564111fa4a416bf.

Vulkan CTS 1.4.7.1 passed 988/988 on each arm (120 compute, 624 loops, 4 spirv-integer, 120 ssbo, 120 subgroups), with 0 failures, crashes, timeouts or skips.

GPUBench ABBA then BAAB, four captures per arm. All 48/48 captures matched their CPU reference CRC bit for bit. Times are medians of capture medians in µs. Brackets show the four-capture GPU range for each arm.

Workload Submit A → B GPU A → B [range] Δ GPU
compute.uber uniform d1 524.80 → 519.57 421.19 [383.62–421.54] → 407.23 [403.25–420.85] -3.31%
compute.uber divergent d1 1343.36 → 1369.00 1163.19 [1059.42–1163.83] → 1167.80 [1165.67–1221.08] +0.40%
compute.uber uniform d4 458.64 → 455.18 446.69 [384.79–481.96] → 466.17 [427.75–467.58] +4.36%
compute.uber divergent d4 1208.11 → 1241.62 1218.39 [1061.08–1219.04] → 1223.57 [1221.67–1267.19] +0.43%
compute.fp16 alu_mix d4 882.37 → 875.96 910.17 [828.88–910.29] → 910.02 [829.54–910.33] -0.02%
compute.stereo d2 9473.68 → 9473.68 9527.86 [8652.50–9604.83] → 9452.52 [9159.08–9643.52] -0.79%

The kernel journal, dmesg and audit logs recorded zero GPU faults, recoveries, hang kills, quarantines, kernel WARN/BUG/Oops or SELinux AVCs. The temporary ICD overlay was removed, stock boot and Mesa checks matched, and neohw was released.

On AGX3B compute integer-ALU loops, bounded ALU lookahead separates the
2-cycle IC pipe (IMAD/BFI/BFEIL/EXTR/ASR) from the 1-cycle SCIB pipe
(IADD/BITOP/ICMPSEL) with 2-cycle IC pacing so integer ALU chains issue
without stalling on back-to-back IC ops.

Gate both the IC/SCIB pipe split and 2-cycle IC pacing strictly to pure
integer AGX3B compute loops (explicit pure-integer/control/SSA opcode
whitelist so no FP, SFU, conversion, matrix, subgroup, or memory op can
qualify), keeping vertex, fragment, and mixed FP/SFU compute loops on
legacy single-bucket integer scheduling.

Size the per-block granule/occupancy cap and acceptance check from
allocator-compatible register demand (power-of-two vector widths,
aligned reserved low registers, preload/export floors, and late-kill
source overlaps) with a 4-half RA margin and strict <= ra_peak + 8
growth bound so bounded lookahead never crosses a 48-half, 96-half, or
occupancy register boundary on any AGX3B chip.

Signed-off-by: DjDeveloperr <hey@djdev.me>

@aurora-silicon-review aurora-silicon-review Bot 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.

Verdict: MERGE at ed74eed after hosted checks and hardware validation.

Checked: BITTEST_SELECT_AGX3 is excluded from the pure-integer whitelist and has a live mixed-loop regression with nine integer instructions, so the integer-count gate does not make the check vacuous. The prior J700 run remains tied to its tested commit. Keep hardware validation on the revised head.

@DjDeveloperr

Copy link
Copy Markdown
Author

J700 second-generation confirmation. J700 / G17P B1, Aurora Fedora Remix release 44 aarch64, kernel 7.3.0-41.fc44.aurora.aarch64. SLC was enabled on all four MCC planes throughout.

PR head ed74eed35557b21290ed8f177702310370e6844e tested as clean merge 21473333330d87c4782e775b2dd960fe4c933b54 on baseline 878ddc0cc649e271b9cb36adf564111fa4a416bf.

The run finished before aurora-wip advanced to e48e57fa8b7ff156b50e4c4e402974ef84e7561a. A clean merge onto that tip produced the same PR patch ID, and the base advance touched none of the files changed by this PR.

Vulkan CTS 1.4.7.1 passed 988/988 on each arm (120 compute, 624 loops, 4 spirv-integer, 120 ssbo, 120 subgroups), with 0 failures, crashes, timeouts or skips.

GPUBench ABBA then BAAB, four captures per arm. All 48/48 captures matched their CPU reference CRC bit for bit. Times are medians of capture medians in µs. Brackets show the four-capture GPU range for each arm.

Workload Submit A → B GPU A → B [range] Δ GPU
compute.uber uniform d1 513.58 → 502.89 419.84 [383.54–420.83] → 404.35 [369.04–406.12] -3.69%
compute.uber divergent d1 1313.94 → 1328.58 1122.25 [1059.46–1162.88] → 1156.38 [1062.92–1167.62] +3.04%
compute.uber uniform d4 439.64 → 436.51 442.25 [384.25–443.96] → 432.59 [407.17–466.33] -2.18%
compute.uber divergent d4 1165.16 → 1188.44 1165.33 [1060.08–1196.25] → 1195.44 [1167.56–1223.46] +2.58%
compute.fp16 alu_mix d4 861.26 → 847.29 860.94 [828.88–909.83] → 839.85 [829.00–910.04] -2.45%
compute.stereo d2 9000.00 → 9000.00 9282.53 [8096.19–9449.77] → 9141.78 [8654.54–9452.21] -1.52%

The uniform d4 GPU median changed by -2.18% on this head and +4.36% on the preceding head. The two arms' ranges overlapped in both runs and for all six workloads in this run.

The kernel journal, dmesg and audit logs recorded zero GPU faults, recoveries, hang kills, quarantines, kernel WARN/BUG/Oops or SELinux AVCs. The temporary ICD overlay was removed, and the stock boot and Mesa checks matched before and after the run.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict at ed74eed35557b21290ed8f177702310370e6844e FINISH, then merge.

Blockers None in the software review. Hardware results have separate rows.

Checked Removing BITTEST_SELECT_AGX3 resolves the mixed-loop scheduling issue. Restoring that one entry changes the second instruction from BFEIL to IADD in both the submitted regression and a probe with three 32-bit register inputs and mask 1. Both pass with the fixed whitelist.

Evidence
  • Clean merge onto live aurora-wip at e48e57fa8b7f (tree 006db34b95a6). Preceding commit 939509e3e8bf is unchanged and both commits are signed off.
  • Fedora 44 aarch64 Clang 22.1.8 passed 347 Asahi and 5 Poly tests in each assertion mode, with zero new compiler warnings.
  • compute.uber uniform, divergent and ILP machine code matched the previous candidate across five DRM-shim profiles.
  • The remaining whitelist covers integer, bitwise, control flow and SSA operations. ICMPSEL uses integer comparisons and forwards selected payload bits unchanged.

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.

1 participant