Skip to content

drm/asahi: g16: share one compute UMA descriptor and pool per VM - #3287

Merged
RyanTheTide merged 5 commits into
mainfrom
perf/g16-compute-shared-uma
Nov 29, 2026
Merged

RyanTheTide merged 5 commits into
mainfrom
perf/g16-compute-shared-uma

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What: share one compute UMA manager descriptor, monotonic submission counter, 32 MiB backing pool, and hardware UMA slot (allocated across compute UMA slots 1..=32) across all non-SCS compute units of a VM on G16, matching macOS 26B123.

Previously, every non-SCS compute unit owned a separate UMA descriptor, submission counter, 32 MiB pool, and fixed hardware UMA slot (1..=24). Because each unit holds at most one command in flight, every completing dispatch saw *counter == COMPLETED, forcing firmware to take its global UMA locks and tear down and rebind the hardware UMA slot on every dispatch. It also allocated up to 768 MiB of UMA pools per compute VM and locked two-pipe heavy compute dispatches into phase lock.

With one shared compute UMA descriptor per VM:

  • While any compute command of the VM remains queued or active on any pipe, *counter > COMPLETED keeps firmware on its fast-path UMA bind and unbind checks without global lock teardown/rebind.
  • Memory footprint for non-SCS compute drops from up to 768 MiB (24 x 32 MiB) to a single 32 MiB pool per compute VM.
  • Live open VM occupancy is tracked per hardware compute UMA slot (compute_uma_slot_users sized from hw::sizes::COMPUTE_UMA_SLOTS): new compute VMs always allocate from unoccupied, unquarantined slots first and only fall back to least-loaded healthy slot sharing when more than COMPUTE_UMA_SLOTS - quarantined live compute VMs are open concurrently.
  • ComputeSlot is decoupled from SharedComputeUma (retaining private_uma only for SCS units), and Slots pins quarantined shared UMA pools until reboot. If a VM's hardware compute UMA slot is quarantined, Cache::prepare() rebuilds SharedComputeUma on a fresh unquarantined slot in the next disjoint client VA window so both innocent sharing VMs and continuing work recover without sticky EIO.
  • Cross-VM compute sharing the same hardware UMA slot serializes via compute_uma_conflict while disjoint VMs continue to overlap across compute pipes.
  • Out-of-order multi-pipe retirement verifies monotonic COMPLETED progress and enforces exact COMPLETED == counter conservation when the VM drains idle; SCS/ray-query compute units keep private per-unit UMA pools.

Tested:

  • Host selftests (tools/testing/selftests/drivers/gpu/asahi-m4/run-host-tests.py) at 078f963c: 26/26 passed, including:
    • live-VM slot occupancy avoiding collisions across short-lived VM churn and balanced sharing above COMPUTE_UMA_SLOTS (test-resources.py),
    • quarantine pinning and live migration of an innocent sharing VM onto a fresh unquarantined slot in a disjoint client VA window (test-resources.py),
    • real can_queue_behind_with_ta() and needs_engine_drain() cross-VM UMA conflict and quarantine gating (test-publication.py; mutation-verified),
    • real extracted Prepared::compute_uma_retired() out-of-order retirement and idle COMPLETED == counter conservation (test-stamp-wrap.py; mutation-verified).
  • scripts/checkpatch.pl --strict on 078f963c: 0 errors, 0 warnings, 0 checks (two >100-column test lines wrapped; earlier commit 70c8451d had one 76-character commit-message line).
  • J773g (M4 Mac mini, T8132, G16G B0, 26B123 firmware) 4-boot ABBA (main b14959b819cfa / suma 70c8451d42be4 / suma / main), 264/264 ok, 0 kernel findings, 0 GPU faults/recoveries/hangs (~1.37M jobs per suma boot):
benchmark main (us) suma (us) delta Metal 4 (us) vs Metal
compute.light d=4 46.41 41.84 -9.84% 37.31 +12.14%
compute.light d=8 35.51 30.65 -13.68% 27.72 +10.58%
compute.light d=16 28.95 24.43 -15.63% 23.89 +2.25%
compute.light d=32 28.60 23.38 -18.26% 21.90 +6.75%
compute.light d=64 28.89 24.05 -16.76% 21.46 +12.07%
compute.light procs d=16 43.70 42.71 -2.28% 32.38 +31.88%
compute.heavy alu d=1 759.31 757.58 -0.23% 827.81 -8.48%
compute.heavy alu d=2 639.39 537.06 -16.00% 538.79 -0.32%
compute.heavy alu d=4 537.64 537.06 -0.11% 538.79 -0.32%
compute.heavy alu queues d=2 623.77 537.06 -13.90% 538.79 -0.32%
compute.heavy alu procs d=2 603.93 612.13 +1.36% — —
compute.heavy bw d=1 1501.54 1501.52 0.00% 1773.05 -15.31%
compute.heavy bw d=2 880.30 1257.87 +42.89% 1436.78 -12.45%
compute.heavy bw d=4 1139.02 1257.87 +10.43% 1436.78 -12.45%
sync.signal binary d=2 31.03 26.78 -13.69% 25.00 +7.13%
sync.signal timeline d=2 30.96 26.92 -13.04% 25.28 +6.51%
sync.signal host d=1 167.85 165.61 -1.34% 156.00 +6.16%
concurrent.cr light interleave d=4 67.04 63.83 -4.78% 57.10 +11.78%
concurrent.cr heavy queues d=4 1.15x 1.03x -10.99% 1.00x +2.14%
render.light tri d=16 59.47 58.69 -1.31% 48.29 +21.53%
compute.uber ilp d=4 393.08 401.12 +2.05% 353.11 +13.60%
compute.uber uniform d=4 178.16 180.18 +1.14% 168.24 +7.10%
  • Note on compute.heavy bw d=2/4: bw.comp copies one 64 MiB s[] to one 64 MiB d[] (134.22 MB read+write per dispatch) on M4 LPDDR5X (120 GB/s peak, 1,118.5 us DRAM floor). main's 880.30 us at d=2 corresponds to 152.5 GB/s — above the 120 GB/s DRAM peak — which is only possible because main's per-command UMA teardown global locks forced both CDM pipes into tight 0-degree phase lock (~74% start overlap, gpu_us = 735.65 us, gpu_gap_us = -545.80 us) over the exact same s[] buffer so both waves shared the 8 MiB SLC and halved DRAM reads. Breaking that 2-wave lockstep at d=4 dropped main to 1,139.02 us (117.8 GB/s), and the same global lock regressed compute.heavy alu d=2 by +19.1% (639.39 vs 537.06 us) and concurrent.cr heavy queues (1.15x vs 1.03x). With shared UMA, bw runs steady-state pipeline overlap at 1,257.87 us at both d=2 and d=4 (106.7 GB/s, 89% of DRAM peak, zero idle gap), still 12.45% ahead of Metal 4 (1,436.78 us, 93.4 GB/s).
  • J773g re-gate at 078f963c:
    • Shared-binary-semaphore sync CTS repeat (dEQP-VK.synchronization.signal_order.shared_binary_semaphore.write_ssbo_vertex_read_copy_buffer_to_image.buffer_262144_opaque_fd): stock main (7.3.0-ARCH-m4mainefed1ae3) 20/20 Pass (0 Fail); 078f963c 20/20 Pass (0 Fail).
    • Compute and sync sanity rows at 078f963c: compute.light d=4/8/16/32/64 = 42.55 / 30.93 / 24.60 / 23.66 / 23.62 us, procs d=16 = 43.71 us, compute.heavy alu d=2 / queues d=2 / procs d=2 = 537.63 / 537.63 / 606.80 us, concurrent.cr interleave = 63.71 us, queues = 1.02x.
    • 35-VM concurrent live Vulkan compute stress (vk-uma-quarantine, 35 simultaneous open VkDevices > 32 hardware compute UMA slots + fresh 36th VM): clean run 35/35 pre + 35/35 post + fresh VM passed with exact readback and 0 faults/recoveries; post-wake unmapped BDA write run 35/35 pre + 34/34 post + fresh VM passed with 0 kernel findings (AGX soft-fault absorbed the unmapped BDA write without triggering a firmware abort-and-quarantine handshake; an infinite-loop compute shader hits the 5 s host g16_compute_deadline_ms deadline before firmware's CDM watchdog, so the quarantine-migration path itself is verified by the host selftest).
    • VK-GL-CTS compute + synchronization subsets (--jobs 1, excluding drm/asahi g16: dEQP-VK.synchronization*multi_queue* faults the GPU and fail-stops it on J773g (main 61c7b88a) #3201 multi_queue / cross_instance, 15,000 cases recorded within the short slot window): 7,393 Pass / 7,607 NotSupported / 0 Fail, 0 GPU faults/recoveries/hangs.
    • s2idle suspend/resume: woke cleanly after 13 s (S2IDLE_POST success=1 fail=0, DELTA_ERR=0), post-wake render+compute+CRC suite 7/7 passed (182,449 jobs / 319,576 commands, 0 kernel findings).
  • Prior J773g full gate boot at 70c8451d (1.46M jobs / 1.73M commands, 0 kernel findings, 0 GPU faults/recoveries/hangs): concurrent.cr x10 (20/20 ok), compute.light/procs/heavy/queues x5 (25/25 ok), VK-GL-CTS 34,810 cases (17,982 Pass / 16,827 NotSupported / 1 Fail on the shared-semaphore case confirmed 20/20 Pass on both main and 078f963c above), s2idle 14 s (DELTA_ERR=0, post-wake 7/7).
  • Verified clean merge with origin/main (git merge-tree --write-tree).

Risk: two-way · Macs on the g16 backend (M4 G16G; M3 G15S and G15G). A plain revert undoes it.

  • Sharing one compute UMA descriptor across pipes changes firmware UMA refcount behavior from always-teardown (*counter == COMPLETED) to idle-only teardown (*counter > COMPLETED while any pipe is active). Mitigated by preserving strict service-stamp retirement, verifying monotonic COMPLETED progress on out-of-order multi-pipe retirement, enforcing COMPLETED == counter on VM idle, tracking live-VM slot occupancy, serializing cross-VM hardware slot reuse with compute_uma_conflict, and migrating VMs to fresh unquarantined slots on quarantine.
  • compute.heavy bw d=2 moves from main's 880.30 us (152.5 GB/s, above M4's 120 GB/s DRAM peak due to phase-locked SLC sharing from per-command UMA teardown locks) to 1,257.87 us (106.7 GB/s, 89% of peak, steady-state overlap at both d=2 and d=4, still 12.45% ahead of Metal 4's 1,436.78 us); compute.heavy alu procs d=2 shifts by +1.36% (603.93 -> 612.13 us, 606.80 us on 078f963c), and compute.uber shifts by +1.1% to +2.1%.

Not yet:

  • Re-measuring stacked with drm/asahi: g16: map the compute notifier records ASC-cached #3285 (cached compute notifier) on clean commits — in lab testing the two combined brought compute.light d=16 to 23.54 us (ahead of Metal 4's 23.89 us) and compute.light d=64 to 22.78 us.
  • Widening COMPUTE_UNITS beyond 24 (now feasible since units no longer allocate per-unit 32 MiB UMA pools or hardware UMA slots) to eliminate the 16-process saturation seen on compute.light procs d=16.
  • A J516s (M3 Pro, G15S) row is owed, because this is shared g16 code.

Every non-SCS compute unit previously owned a separate UMA manager
descriptor, submission counter, 32 MiB backing pool, and hardware UMA
slot (1..24). Because each unit holds at most one command in flight at a
time, every completing command observed *counter == COMPLETED, forcing
firmware to acquire its global UMA locks and tear down and rebind the
hardware UMA slot on every dispatch. It also allocated up to 768 MiB of
UMA pools per compute VM and serialized two-pipe heavy compute dispatches
into phase lock.

Match macOS 26B123 by sharing one compute UMA manager descriptor,
monotonic submission counter, 32 MiB backing pool, and hardware UMA slot
(rotating across the 32 compute UMA slots 1..=32) across all non-SCS
compute units of a VM:

- While any command of the VM remains queued or active on any compute
  pipe, *counter > COMPLETED keeps firmware on its fast-path UMA bind
  and unbind checks without locks or hardware slot teardown.
- Cross-VM reuse of the same hardware compute UMA slot (when >32 compute
  VMs are open concurrently) is serialized by `compute_uma_conflict`,
  and `Slots` retains each slot's VM-free `FwLease` in `retained_uma[0..32]`
  and tracks quarantined hardware UMA slots across hangs.
- Retirement keeps strict service-stamp and per-unit timestamp checks,
  verifies shared `COMPLETED >= retired + count` for out-of-order
  multi-pipe completions, and enforces exact `COMPLETED == counter`
  conservation when a VM drains idle.
- SCS/ray-query compute units retain their existing per-unit UMA pools.

Signed-off-by: DjDeveloperr <[email protected]>
@DjDeveloperr
DjDeveloperr requested review from a team as code owners November 26, 2026 17:55
@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot) labels Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Merge readiness at 6b13f413: not ready yet

Check Detail
CI at head no failing: apple-build, KUnit ane-boot, KUnit ane-pm, KUnit dcp-fabric, KUnit dcp-topology
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head no no line with the head SHA 6b13f413, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: two-way · Macs on the g16 backend (M4 G16G; M3 G15S and G15G). A plain revert undoes it. - Sharing one compute UMA descriptor across pipes changes firmware UMA refcount behavior from always-teardown (*counter == COMPLETED) to idle-only teardown (*counter > COMPLETED while any pipe is active). Mitigated by preserving strict service-stamp retirement, verifying monotonic COMPLETED progress on out-of-order multi-pipe retirement, enforcing COMPLETED == counter on VM idle, tracking live-VM slot occupancy, serializing cross-VM hardware slot reuse with compute_uma_conflict, and migrating VMs to fresh unquarantined slots on quarantine. - compute.heavy bw d=2 moves from main's 880.30 us (152.5 GB/s, above M4's 120 GB/s DRAM peak due to phase-locked SLC sharing from per-command UMA teardown locks) to 1,257.87 us (106.7 GB/s, 89% of peak, steady-state overlap at both d=2 and d=4, still 12.45% ahead of Metal 4's 1,436.78 us); compute.heavy alu procs d=2 shifts by +1.36% (603.93 -> 612.13 us, 606.80 us on 078f963c), and compute.uber shifts by +1.1% to +2.1%.

Areas: area:gpu

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Nov 26, 2026
@DjDeveloperr

DjDeveloperr commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Verdict at 078f963c8b97: ready (code). Hardware rows at this head are still owed; see below.

Blockers: none.

My blocker at 70c8451d42be is fixed. One aborted compute flight quarantined its hardware UMA slot, and every live VM on that slot then lost compute (EIO) for good. Now:

  • Slots by live occupancy. pick_compute_uma_slot() takes a free, healthy slot whenever one exists. Each open VM holds a ComputeUmaOccupancy (released on close, drop or migration), so live VMs share a slot only when more than 32 minus the quarantined ones are open.
  • Migration on quarantine. Cache::prepare() sees the VM's slot in quarantined_compute_uma_mask and builds a new SharedComputeUma on a healthy slot. It uses the next unused client VA window, so the quarantined backing stays mapped and pinned in Slots::quarantined_shared_uma[slot].
  • Units follow. Units no longer keep UMA references, so they follow the VM's new descriptor. claim_compute_for_pipe() forces a full work write when a unit's last slot differs (owner_uma_slot).

Checked

  • Occupancy accounting. It is taken only after SharedComputeUma::new() succeeds. It is released on close(), on Ready drop and on replacement, and the count is per slot.
  • Migration path.
    • The new window's pool, freelist and list sit at compute_state(va_idx), which shared-mode units don't use there (they keep only preempt, context and aux), so nothing overlaps.
    • An aborted flight's lease goes to retained_uma[slot] and its shared backing to quarantined_shared_uma[slot].
    • release() and retire() reset pending_uma_slot to "unset", so a stale value can't quarantine slot 0.
    • compute_exhausted() now masks to the 32 valid slots.
  • SCS units. They keep a private UMA (private_uma), and every per-unit access now goes through private_uma()?, which returns EINVAL on shared units instead of reading the wrong descriptor.
  • Tests.
    • The asahi-m4 host suite passes 26/26 at this head.
    • My two earlier mutations are now caught: dropping !uma_conflict from can_queue_behind_with_ta() fails test-publication, and dropping the idle completed == counter check fails test-stamp-wrap.
    • Ignoring occupancy in pick_compute_uma_slot() fails test-resources.
  • checkpatch. --strict on the new commit gives 0/0/0.
  • Earlier findings that still hold:
    • per-VM isolation of the shared buffers;
    • serialized prefix build and publish;
    • stamp-gated retirement on both pipes;
    • extension units always sharing the VM's UMA;
    • the ABBA table matching its raw data (at 70c8451d).

Before merge

  1. A J773g row at this head. The ABBA and gate evidence in the PR are from 70c8451d. This commit changes slot assignment and migration, and when the shared pool is freed. Main keeps a unit's pool alive in arena[k] until a later owner displaces it, and the first revision did the same through the arena's _shared_uma. Now a cleanly retired VM's shared pool is freed when the VM closes, and only retained_uma[slot] (the descriptor and counter) is kept. That's fine as long as the firmware never touches a torn-down slot's pool. A run that opens and closes many compute VMs (for example compute.light procs repeated), plus the CTS subsets, would show it.
  2. The J516s (G15S) row. The PR already lists it, since this is shared g16 code.
  3. The one CTS fail from the gate boot. It is signal_order.shared_binary_semaphore.write_ssbo_vertex_read_copy_buffer_to_image.buffer_262144_opaque_fd ("Memory contents don't match"). It should be run repeatedly on main and on this head.
  4. PR text, which still describes 70c8451d:
    • Tested should say which head each row ran on.
    • Risk still says slots are shared "when more than 32 compute VMs are open concurrently", which is now true but by occupancy, and it doesn't mention migration.
    • The measured compute.heavy alu procs d=2 regression (+1.36%) is still missing from the table.
    • The checkpatch line should note that the first commit keeps one long commit-message line.

Notes, not blocking

  • Migration isn't tested. Turning off the trigger in prepare() (treating a quarantined slot as healthy) still passes all host tests. The new "quarantine … migrates sharing VMs" test exercises pick_compute_uma_slot() and the pinning in Slots, not the decision in Cache::prepare().
  • Jobs already prepared still fail once. Jobs prepared against the old slot before the quarantine still fail with EIO once, at publish. Recovery applies to submissions prepared after it.
  • Migration limit. A VM can move to a new window at most 23 times (compute_uma_va_idx < COMPUTE_UNITS); after that, prepare() returns EIO.
Evidence
078f963c8b973999641acd2fc39c133a543e0114 (fast-forward on 70c8451d42be), merges cleanly with main
run-host-tests.py                                   -> 26 ok
checkpatch --strict HEAD~2..HEAD                    -> 70c8451d: 0 errors, 3 warnings; 078f963c: 0/0/0

Mutations at 078f963c (host suite: test-publication / test-resources / test-stamp-wrap):
  drop "&& !uma_conflict" in can_queue_behind_with_ta   -> test-publication FAILED (86 passed, 1 failed)
  drop idle "completed == counter"                      -> test-stamp-wrap FAILED (27 passed, 1 failed)
  pick_compute_uma_slot ignores occupancy               -> test-resources FAILED (74 passed, 1 failed)
  prepare(): quarantined slot treated as healthy        -> all pass (87 / 75 / 28): not covered

At 70c8451d (previous round):
  ABBA recomputed from raw JSONL (median of 6 per arm), 264/264 ok; matches the table;
    compute.heavy alu procs d=2: main 603.93, suma 612.13 (+1.36 %), not in the table
  Gate boot 7.3.0-ARCH-m4cisuma-70c8451d: CTS Pass 17982 / Fail 1 / recoveries 0; s2idle success=1; 0 kernel findings

Track live open VM occupancy per hardware compute UMA slot so new
non-SCS compute VMs always allocate from free, unquarantined slots
before falling back to least-loaded sharing when more than
COMPUTE_UMA_SLOTS live compute VMs are open concurrently.

Decouple ComputeSlot from SharedComputeUma references (keeping
private_uma only for SCS units) and retain quarantined shared UMA
backing in Slots until reboot. When a VM's shared UMA slot is
quarantined, Cache::prepare() rebuilds SharedComputeUma on a fresh
unquarantined slot in the next disjoint client VA window so both
innocent sharing VMs and continuing work recover without EIO.

Add host tests covering live-VM slot occupancy, 33+ concurrent VM
sharing, quarantine pinning and migration, real can_queue_behind_with_ta
cross-VM UMA conflict gating, and real Prepared::compute_uma_retired
idle conservation. Wrap two over-100-column test lines.

Signed-off-by: DjDeveloperr <[email protected]>
@github-actions github-actions Bot added blast:m3 Macs affected, from Merge risk (bot) blast:m4 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) and removed ci-failing A check failed at the PR head (bot) needs-template PR body lacks Tested or Risk (bot) needs-hw-row No hardware row at the PR head (bot) labels Nov 26, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

J516s (MacBook Pro 16" M3 Pro, G15S) row at 078f963c8b97: PASS. One-shot boot of the exact head (main b14959b819cf + this PR), default cmdline, the head's own DTB in Stage 2.

  • GPU health: 0 GPU faults, 0 recoveries or hang kills, no completion-stamp lines, 0 failed units, and no new kernel errors beyond this Mac's per-boot MTP HID line.
  • CTS (one process, multi_queue and cross_instance excluded): compute and synchronization subsets (basic, smoke, timeline_semaphore, op.single_queue, signal_order, implicit, compute), 467 cases, 374 Pass, 93 NotSupported, 0 Fail.
  • gpubench-vk (aurora-wip 69179743d9ae, run-suite.sh plans, 2 passes on the head). The base is the median of 8 boots of b14959b819cf today with the same kit:
    • compute.light queue d4 27.6 → 24.2 µs (+14 %), d16 17.7 → 14.5 µs (+22 %), d64 20.6 → 16.6 µs (+24 %);
    • sync.signal queue d2, binary 19.6 → 16.7 µs (+18 %), timeline 19.7 → 16.7 µs (+18 %);
    • compute.heavy alu d2 349 → 352 µs (−0.8 %);
    • compute.heavy bw d2 984/988 µs, inside the base's own two-mode range of 698–1,008 µs;
    • concurrent.cr interleave d4 46.3/41.5 µs, inside the base's range of 41.7–47.6 µs; the queues overlap is unchanged.
  • Suspend: s2idle is refused at prepare on this Mac (pre-existing on main), so no sleep was tested.
  • Restored to stock.

Keep the cross-VM compute UMA slot check alongside main's multisample
render admission check, and exercise both in the publication fixture.

Signed-off-by: DjDeveloperr <[email protected]>
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

J773g (M4 mini, G16G) passed at c4ecf0a078a8297842c53780e06b726a68e74e09. The shared binary semaphore CTS case that previously failed passed 20/20 repetitions. All 35 live VMs completed compute before and after the clean UMA exercise, and a fresh VM completed compute afterward.

After s2idle, the host observed wake at 14 s (1 successful suspend, 0 failures). All seven post-wake GPU tests passed, including matching CRCs for postfx, array compression and MDI. The kernel log showed zero GPU faults. The driver reported zero recoveries, hang kills and quarantined owners.

Workload Mode Depth Median µs/submit
compute.light queue 4 42.44
compute.light queue 16 25.04
compute.light queue 64 23.86
compute.light procs 16 43.39
compute.heavy (ALU) queues 2 536.48

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

J516s (MacBook Pro 16" M3 Pro, G15S) row at c4ecf0a078a8: PASS. One-shot boot of the exact head (this PR with main 9e38a276dcb4 merged), default cmdline, the head's own J516s DTB, 27.2 firmware.

  • GPU health: 0 GPU faults, 0 recoveries or hang kills, no completion-stamp lines, 0 failed units, about 3.55 million jobs. No new kernel errors from the GPU; the only new lines are this Mac's per-boot MTP HID line and a Wi-Fi ring line at 12 s, before any GPU work, also seen on earlier rows.

  • CTS (one process, multi_queue and cross_instance excluded): compute and synchronization subsets (basic, smoke, timeline_semaphore, op, signal_order, implicit, compute), 1,188 cases, 914 Pass, 274 NotSupported, 0 Fail.

  • The shared binary semaphore case (signal_order.shared_binary_semaphore.write_ssbo_vertex_read_copy_buffer_to_image.buffer_262144_opaque_fd): 20/20 Pass.

  • gpubench-vk (same aurora-wip 69179743d9ae kit as the 078f963c row; compute.light, compute.heavy, sync.signal, concurrent.cr; 2 passes): 78/78 rows ok. Against the 078f963c row, every row is within 2 % except:

    • compute.light queue d1 88.2 → 84.1 µs and d2 46.5 → 40.8 µs (faster; d2 is a two-mode row on this Mac);
    • compute.light queue d4 24.2 → 27.0 µs (slower; its samples spread from 24.8 to 30.7 µs, and it is still under the 27.6 µs main base from that row);
    • sync.signal host d1 105 → 109 µs.

    There was no main boot at 9e38a276dcb4 in this window, so these differences are not attributed to the PR.

  • Restored to stock.

@github-actions github-actions Bot removed the merge-conflict Conflicts with the base branch (bot) label Nov 27, 2026

@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 c4ecf0a0

Blockers: none.

Checked:

  • drivers/gpu/drm/asahi/g16/resources.rs, slots.rs, engine.rs, poll.rs, encode/compute.rs, hw.rs, mod.rs, queue.rs: verified one SharedComputeUma (descriptor, counter, 32 MiB pool, hardware slot 1..=32) per non-SCS compute VM while SCS compute units retain PrivateComputeUma.
  • Verified compute_uma_conflict() serializes only cross-VM flights sharing a hardware compute UMA slot while allowing same-VM multi-pipe overlap; verified pick_compute_uma_slot() prefers unoccupied healthy slots with RAII ComputeUmaOccupancy released on close/drop/migration.
  • Verified idle-boundary validate_shared_compute_descriptor() anchors WORK == descriptor_fw, compute_uma_retired() requires completed == counter when draining idle (last_vm_flight), and Slots::quarantine() sets uma_quarantined and retains quarantined_shared_uma[slot] so aborted pools stay mapped while VMs migrate cleanly.
  • Verified 20/20 CI green and exact-head (c4ecf0a078a8) hardware rows on both J773g (M4 mini: 20/20 shared binary semaphore CTS, 35 live VMs, s2idle + 7 post-wake GPU tests) and J516s (M3 Pro, G15S: 3.55M jobs, 0 faults).
Evidence
  • Diff reviewed at c4ecf0a0 across all core g16/ files and host tests (check-abi-26b123.rs, test-publication.py, test-resources.py, test-stamp-wrap.py).
  • CI: 20/20 PASS.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merge-train status at c4ecf0a0 (App approval noted; rows: 20/20 CI green; G16 shared compute UMA descriptor/pool per VM; J773g + J516s PASS). @DjDeveloperr code-owner ping (6-point rule, point 6): merge earliest 17:15 AEDT once full CI is green (I re-ran cancelled jobs) and the second-family row point holds. Revert: git revert -m 1 <merge>.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging under the 6-point rule (Ryan 09:29, permanent), at c4ecf0a0. (1) The review App approved at this head. (2) Full CI is green. (3/4) Rows: J773g+J516s. (5) There's no blocking review. (6) Dj was pinged here 61 min ago with no objection. Revert: git revert -m 1 <merge>.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Correction to the merge note above: the merge didn't happen. After the PRs merged just ahead of it (#3285 and others), this branch no longer merges cleanly with main. @DjDeveloperr, please forward-merge main (no force push). It goes back into the queue at the new head, and the App re-approval plus the rows still apply if the merge is conflict-only.

@github-actions github-actions Bot added the merge-conflict Conflicts with the base branch (bot) label Nov 28, 2026
Forward-merge main after #3285. Only the asahi-m4 selftests conflicted:
test-resources.py takes main's Registry::release(file, process) and
LiveToken process field in the new test_live_token() helper;
test-stamp-wrap.py keeps the PR's pub manager/fw::graph alias and adds
main's user_stamp cell, and the shared compute UMA test now marks pipe 1
done through user_stamp like the other compute cases on main.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor

Forward-merged main into this branch (merge commit 7f4b5a1, no force push). Only the two asahi-m4 selftests conflicted with #3285: test-resources.py now passes main's process field/argument in the new test_live_token() helper, and test-stamp-wrap.py keeps your pub manager/fw::graph alias plus main's user_stamp cell, so the shared compute UMA test marks pipe 1 done through user_stamp like main's other compute cases. Driver files merged cleanly and are unchanged.
Tests: test-resources.py (75 passed) and test-stamp-wrap.py (28 passed) on the host; the full asahi-m4 run-host-tests.py otherwise passed (test-resources and test-thermal-policy hit the 180 s limit under buildbox load, both pass when run alone).
Still needed: CI and App re-approval at the merge head. The J773g/J516s rows carry over because no driver code changed. Thanks @DjDeveloperr.

@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 7f4b5a10 — the #3285 selftest merge resolution is clean, but the branch is still CONFLICTING (DIRTY) against current main.

Blockers:

  1. Forward-merge current origin/main (8ebb0f75ae2d or later, no force push) to resolve the remaining conflicts: 7f4b5a10ad57 merged d2532e9034, which is 104 commits behind main and predates #3185 (fix/g16-m4-no-ta-wave), leaving conflicts across drivers/gpu/drm/asahi/g16/engine.rs, g16/hw.rs, g16/poll.rs, and tools/testing/selftests/drivers/gpu/asahi-m4/test-publication.py. While CONFLICTING, the PR cannot merge and pull_request CI cannot run.

Checked:

  • 7f4b5a10ad57 merge against d2532e9034: verified the #3285 conflict resolutions in tools/testing/selftests/drivers/gpu/asahi-m4/test-resources.py (test_live_token() process: 0 field and Registry::release(file, process)) and test-stamp-wrap.py (pub mod manager, fw::graph alias, user_stamp cell set on pipe 1 in shared_compute_uma_retires_out_of_order_and_checks_idle_conservation()) are clean and preserve all previously approved driver behavior from c4ecf0a0.
  • Live mergeability against main (8ebb0f75ae2d): CONFLICTING / DIRTY (19 CI checks queued/blocked).
Evidence
  • Head: 7f4b5a10ad57 (CONFLICTING / DIRTY against main 8ebb0f75ae2d).
  • Overlapping commits between d2532e9034 and 8ebb0f75ae2d: #3185 (4dcecee646, 4f136979ba, 4b884ef8b6, c7cf6c261b) touching g16/engine.rs (+32/-231), g16/hw.rs (+0/-13), g16/poll.rs (+7/-24), and test-publication.py (+87/-276).

Forward-merge main. Main (#3185) dropped the M4 TA wave window, which
removed Flight::heavy_render, Engine::ta_wave_wait and turned
can_queue_behind_with_ta() into can_queue_behind(). engine.rs keeps
this branch's compute_uma_mask and takes main's removal of
heavy_render. The test-publication.py stand-ins take main's Flight and
QueueBehindFlight shapes plus compute_uma_mask/quarantined_uma_mask;
the TA wave tests main deleted stay deleted, and the shared compute UMA
tests call can_queue_behind() without the TA cursor.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor

Forward-merged current main (2fd49a6) into this branch; new head 6b13f41 (no force push).
Main's #3185 dropped the M4 TA wave window: g16/engine.rs keeps this PR's compute_uma_mask and takes main's removal of heavy_render; hw.rs and poll.rs merged cleanly. In asahi-m4 test-publication.py the stand-ins take main's Flight/QueueBehindFlight shapes plus the UMA fields, the TA wave tests main deleted stay deleted, and the shared compute UMA test now calls can_queue_behind().
Tests: asahi-m4 run-host-tests.py 26/26 ok (test-publication 88 passed, both shared compute UMA tests included), tools/asahi run-host-tests.py --only g16 2/2 ok.
Still needed: CI at the merge head (apple-build/KUnit for the Rust build) and an App re-review. The driver logic is unchanged apart from the dropped TA wave field, so the rows should carry over.

@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 6b13f41 after exact-head CI.

Checked: The branch merges with current main. The resolution retains compute UMA ownership and quarantine checks while following main’s removal of the TA wave window. The publication fixture exercises the same-VM and cross-VM UMA decisions with the new queueing signature. Keep hosted Apple build and KUnit on the merged head and record hardware evidence equivalence against that tree.

@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) ci-failing A check failed at the PR head (bot) and removed merge-conflict Conflicts with the base branch (bot) labels Nov 29, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

code-owner ping @DjDeveloperr: closeout merge at 6b13f413. The App approved at this head. Rows: J773g + J516s at the pre-merge head; the forward-merges only resolved selftests and g16 conflicts, with no driver logic change. Merging under the 6-point rule 1 h from now, once hosted CI at this head is green, unless you object.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging under the 6-point rule (Ryan 09:29, permanent), at 6b13f413. (1) The review App approved at this head. (2) Full CI is green. (3/4) Rows: J773g-+-J516s-at-the-pre-merge-head;-the-forward-merges-only-resolved-. (5) There's no blocking review. (6) Dj was pinged here 174 min ago with no objection. Revert: git revert -m 1 <merge>.

@RyanTheTide
RyanTheTide merged commit ab863c5 into main Nov 29, 2026
20 of 27 checks passed
@RyanTheTide
RyanTheTide deleted the perf/g16-compute-shared-uma branch November 29, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpu Area from CODEOWNERS (bot) blast:m3 Macs affected, from Merge risk (bot) blast:m4 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants