Skip to content

drm/asahi: g16 + shared SUBMIT: Wave 6 R2 — demand-grown 32 render slots / 18 compute units, fast SUBMIT path, stamp-only barriers, and batched render release - #2826

Merged
DjDeveloperr merged 30 commits into
mainfrom
djdev/g16-perf-wave6
Nov 25, 2026

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What: G16 (M4) and shared SUBMIT work, stacked on #2787: no-op publish skipping and batched event drains, off-lock pass scrubbing, demand-grown 32 render pass slots and 18 compute units, one-pass SUBMIT parsing with batched CDM gate locking, stamp-only same-VM barriers, VmReadGuard on the VM reservation lock, reused per-queue SUBMIT staging buffers and bulk sync reads, and the full batched render release.
Tested: M4 Mac mini (J773g, G16G B0, 26B123) on an earlier head of this branch, not the current one: vk-mustpass-short 87/87, sampled synchronization and memory_model CTS with 0 failures, 44 gpubench-vk rows with 0 CRC failures, recovery and post-recovery CTS. Host tests 25/25.
Risk: two-way · M4, plus every Mac for the shared SUBMIT parsing in file.rs and the mmu.rs read guard
Not yet: a row at the current head (the branch was rebuilt after the rows above); one row on a non-M4 Mac for the shared file.rs/mmu.rs changes; CI, which runs once the base lands and this PR targets main.

Details (original description)

Summary

Eight-commit Wave 6 R2 (f63168347300c) series stacked cleanly on #2787 (djdev/g16-perf-wave2-5 at 5610a84b974e5):

  1. 882a01ec1cd14 drm/asahi: g16: skip no-op publishes, batch event ring drains, and smooth receipt-tail backoff
  2. 3a970ce516736 drm/asahi: g16: offload displaced render pass scrubbing to an unbound workqueue
  3. 594a723798f0c drm/asahi: g16: expand render pass slots to 32 in demand-grown tiers and compute units to 18
  4. 5d6bef0371307 drm/asahi: g16: parse SUBMIT streams in one pass, batch CDM gate locking, and synchronize resnap
  5. 086fda9437006 drm/asahi: g16: use stamp-only cross-engine barriers for same-VM non-InitBM handoffs
  6. 11fb7fab68da5 drm/asahi: use VM reservation lock for VmReadGuard and merge G16 render validation (shared mmu.rs + G15/G16)
  7. b60cdb650c6f6 drm/asahi: reuse per-queue SUBMIT cmdbuf staging and bulk-read syncs (shared file.rs across generations)
  8. f63168347300c drm/asahi: g16: release full batched render count in commit_render()

Verification (exact head f63168347300c)

Host checks

  • scripts/checkpatch.pl --strict --ignore FILE_PATH_CHANGES: 0 errors, 0 warnings, 0 checks across all 8 commits.
  • run-host-tests.py: 25 / 25 PASS.

Live hardware (Apple M4 (G16G B0), J773g / T8132, Linux 7.3.0, 26B123 firmware)

  • Vulkan CTS (900 Pass / 1,687 NotSupported / 0 Fail / 0 Crash / 0 Timeout / 0 GPU errors):
    • vk-mustpass-short: 87 / 87 PASS
    • dEQP-VK.synchronization.* (1,500 strided of 64,872): 664 Pass / 836 NS / 0 Fail
    • dEQP-VK.memory_model.* (1,000 strided of 18,530): 149 Pass / 851 NS / 0 Fail
    • Live debugfs: type0: fs2c 13873 c2ta 20506 (0 faults).
  • gpubench-vk (0 CRC/status fails across 44 rows, pb: bad 0): 24-row 4K@120Hz + 4 overlap.passes + 6 render.postfx + 2 compress.bw array + 8 render.deferred.
  • Live Direction A + B hang recovery (rc=0 across all concurrent and fresh post-hang workloads):
    • Dir A (compute hang wait_rc=-4, 555.9 ms, recoveries 2 -> 3, compute_owners: retired 16 quarantined 2 reusable 15): concurrent render.heavy d=4 rc=0 (33,606 submits, 252.02 us vs 249.58 us clean), immediate fresh d=1 compute.heavy/compute.light/render.heavy all rc=0, 0 ECANCELED.
    • Dir B (render hang wait_rc=-4, 120.8 ms, recoveries 3 -> 4, render_owners: retired 30 quarantined 2 reusable 29, render_failed=0, degraded=0, pb: bad 0): concurrent compute.heavy d=4 rc=0 (16,175 submits, 550.05 us vs 547.45 us clean), immediate fresh d=1 render.heavy/render.postfx (CRC 668d6f0a)/compute.heavy all rc=0, 0 ECANCELED.
    • Post-recovery vk-mustpass-short: 87 / 87 PASS, 0 kernel BUG/WARN/Oops/wedged.
  • Real Deep Sleep S2R (rtcwake -d /dev/rtc1 -m mem -s 15): apple-sleep: back from sleep, boot object resumes 0 -> 1, pcie-apple port 0 & 2 link restored, ZERO_S2R_ERRORS, post-wake vk-mustpass-short 87 / 87 PASS.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Review at ac4f4cc.

  1. g16/resources.rs:236 + g16/hw.rs:730: RenderExtArena::new() allocates every extension pass slot at once, so RENDER_SLOTS = 32 means 30 slots of roughly 3.3 MiB each (2 MiB TPC + 1 MiB tilemap + aux/pre/scene/scratch/work). That is about 100 MiB of driver-private memory per VM, up from about 46 MiB. A VM gets it as soon as it pipelines renders or submits 2 or more renders in one SUBMIT (RENDER_BURST_COMMANDS = 2), which is nearly every compositor and app. Please give the per-VM footprint with numbers, or grow the extension slots on demand instead of all 30 at once.
  2. g16/engine.rs:2108, 2311/2369/2383: fs2c, c2ta and c2fs move from Hold to Stamp. The previous series kept the cross-engine barriers at Hold on purpose. The new comment at 2097 says "same-VM non-InitBM", but the fs2c site sets Stamp with no InitBM check, and from_stamp_only(!init_buffer) checks the consumer's InitBM, not the producer's. What guarantees that writes from the producer stage are visible to the consumer once the stamp fires? vk-mustpass-short (87 tests) is not enough to cover a memory-ordering change. Please run dEQP-VK.synchronization*/memory_model* and the compute→render/render→compute groups at this head.
  3. Commit 02aa294 reverts half of 432eaa0 (unbound events wq, EVENT_RETIRE_POLLS = 4) and cites "commit 2420bcdb1cee", which is not in this series. Please squash it into 432eaa0 and fix that message: right now it describes behaviour the series does not ship, and the commits in between bisect onto the regression. The two messages also disagree on the old value (11 vs 12).
  4. mmu.rs:2636 and file.rs:297/1829 change shared code. VmReadGuard is now used by G15 too (the #[cfg(G15)] on covers_range is gone), and the sync/cmdbuf copy runs for every generation. The title says "g16" but G13/G14/G15/G17 are affected, so this needs rows there (below).
  5. file.rs:1829: the 1 KiB inline_cmdbuf stays live in the ioctl frame across queue.lock().submit(), a deep path that goes through parse, VM locks and allocations. Please report the frame size (objdump or -Wframe-larger-than), or move the buffer into the per-queue state.
  6. g16/poll.rs:523: should_publish now skips publish_checked() unless something retired or one of the listed wake conditions holds. Pending work that becomes publishable through another path waits up to the 1 ms housekeeping tick. Examples are standby PB returned by the deferred Prepared::drop, or a VM slot freed by another file's teardown. Please either poke the poll from those release paths or say why it isn't needed.
  7. g16/poll.rs:384: the lock-free early return in cancel_resnap() can miss a rearm() running at the same moment. rearm() sets the deadline, then has_handle, then starts the timer, so the timer can stay armed after cancel. Before, the mutex ordered the two. This is harmless while idle, but join_workers() relies on this cancel before sleep.
  8. Leftover dead code: check_stream, cover, Resolved (command.rs:301/312/665/740) and ScrubBatch::run are now #[allow(dead_code)] or #[cfg(test)], and ScrubQueue/take_scrub_woke (used) carry stale allow(dead_code). params.rs:43: COMPUTE_UNITS.clamp(2, COMPUTE_UNITS) is a no-op.
  9. Rows at this head (ac4f4cc): the hardware numbers in the body come from "kernel-v14/v15" builds, not from this sha. Needed: a J773g dEQP + gpubench + hang-recovery + s2idle row, a J713 smoke row (same SoC, separate board in the module doc), and no-regression smoke for G13/G14 (M1/M2), G15 (M3, VmReadGuard change) and G17 (A18 Pro, shared sync/cmdbuf parse).

@RyanTheTide

Copy link
Copy Markdown
Contributor

Three additions to the review above (same head, ac4f4cc), not covered there:

  1. g16/poll.rs:346: while let Some(..) = self.scrub_queue.lock().pop() keeps the queue's spinlock guard alive for the whole loop body. The temporary lives until the end of the while let statement, so the scrub of up to 8 MiB runs with the spinlock held and preemption off, and enqueue_scrubs on the SUBMIT path spins on it meanwhile. Pop into a local and drop the guard before scrubbing.
  2. g16/slots.rs:506: once the scrub moved off the submitting CPU, nothing orders the scrubbed bytes before the slot is published back to the firmware. Please add the write barrier (wmb()/dma_wmb()) between the scrub completing and the slot becoming reusable.
  3. g16/hw.rs:730/758: 32 render slots (31 in flight) and 18 compute units are sized from a host address-space budget, not from a capacity the firmware publishes. Please tie them to the firmware's own limits (initdata/ring sizes) or explain why the firmware can take 31 renders in flight. This adds to the footprint point in item 1 above.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr DjDeveloperr changed the title drm/asahi: g16: Wave 6 — 32 render slots / 18 compute units, fast SUBMIT path, and batched render release drm/asahi: g16 + shared SUBMIT: Wave 6 R2 — demand-grown 32 render slots / 18 compute units, fast SUBMIT path, stamp-only barriers, and batched render release Nov 22, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

@RyanTheTide Thanks for the detailed review — pushed Wave 6 R2 (f63168347300c, 8 commits on djdev/g16-perf-wave6) addressing all 9 items from #issuecomment-7081661948 (25/25 G16 host tests PASS, 0/0/0 checkpatch.pl --strict):

  1. Demand-grown RenderExtArena tiers (594a723798f0c): Replaced eager 30-slot allocation with three demand-grown tiers (EXT_RENDER_TIERS = [(2, 8), (8, 18), (18, 32)]) sized against live pass demand (active_render_passes + render_count + 1). Exact per-VM pass backing:
    • Base only (0..2, steady single-pass): 49.19 MiB (2 × 25,184 KiB, 0 MiB ext)
    • Tier 0 (2..8, +6 slots, compositors / shallow depth): +21.56 MiB ext (6 × 3,680 KiB, 80% less than eager 30-slot)
    • Tier 1 (8..18, +10 slots, moderate multi-pass): +35.94 MiB (+57.50 MiB cumulative ext)
    • Tier 2 (18..32, +14 slots, deep multi-pass bursts): +50.31 MiB (+107.81 MiB cumulative ext)
  2. Producer + consumer InitBM gating & memory-visibility proof (086fda9437006): Added cross_engine_barrier_type(producer_initbm, consumer_initbm) with WaitTarget propagating producer InitBM across fs2c, c2ta, c2fs, and pipelined render→render barriers so BarrierType::Hold is kept whenever either side carries InitBM. Documented the G16 FINALIZE micro-sequence cache-flush-before-fw_stamp visibility invariant inline and verified with exact-head dEQP-VK.synchronization.* and dEQP-VK.memory_model.* CTS below.
  3. Squashed revert commit (882a01ec1cd14): Folded 02aa294f directly into 882a01ec1cd14 (keeping per-CPU aurora_g16_events and EVENT_RETIRE_POLLS = 11, removing the stale 2420bcdb1cee reference and inconsistent poll-count wording so every commit bisects cleanly).
  4. Shared-code scope (11fb7fab68da5, b60cdb650c6f6): Updated the PR title/body and kept non-g16: prefixes (drm/asahi:) on the shared mmu.rs (VmReadGuard, G15+G16) and file.rs (cmdbuf staging + bulk sync reads across generations) commits. Cross-SoC J713 / G13 / G14 / G15 / G17 smoke rows are not available on this M4 bench and remain noted for cross-board coverage.
  5. Removed inline_cmdbuf from the ioctl stack (b60cdb650c6f6): Replaced the 1 KiB stack buffer with a reusable per-TableQueue KVec<u8> staging buffer (retained up to 4096 bytes between submits, freed on oversized/error), keeping the ioctl stack frame small across queue.lock().submit().
  6. External publish wakeups (882a01ec1cd14): Added Shared::publish_wake / Shared::wake_publish() so external state transitions (VM close, unstarted queue cancellation) re-evaluate engine.pending immediately without waiting for the 1 ms tick; documented why Prepared::drop only releases standby PB reservations for Cache::prepare waiters whose woken SUBMIT enters submit_locked() directly.
  7. cancel_resnap() / rearm() lock ordering (5d6bef0371307): Removed the lock-free early return in cancel_resnap() — it now unconditionally acquires resnap_handle.lock(), and rearm() double-checks resnap_deadline_ns and sleeping under the same lock so join_workers() before sleep cannot race an armed timer.
  8. Dead code & no-op clamp cleanup (5d6bef0371307, 3a970ce516736, 594a723798f0c): Removed dead check_stream, cover, Resolved, and ScrubBatch::run, removed stale #[allow(dead_code)], and replaced COMPUTE_UNITS.clamp(2, COMPUTE_UNITS) with a compile-time assert!(COMPUTE_UNITS >= 2) in g16/hw.rs.
  9. Exact-head live M4 G16G B0 verification (J773g / T8132, 7.3.0-ARCH-m4prod17, exact Wave 6 R2 f63168347300c):
    • Vulkan CTS (900 Pass / 1,687 NS / 0 Fail / 0 faults):
      • vk-mustpass-short: 87 / 87 Pass
      • dEQP-VK.synchronization.* (1,500 strided of 64,872): 664 Pass / 836 NS / 0 Fail
      • dEQP-VK.memory_model.* (1,000 strided of 18,530): 149 Pass / 851 NS / 0 Fail
      • Live debugfs: type0: fs2c 13873 c2ta 20506 (0 faults) confirming live stamp-only Type-0 cross-engine barriers.
    • gpubench-vk (0 CRC/status fails across 44 rows, pb: bad 0): 24-row 4K@120Hz + overlap.passes (4) + render.postfx (6) + compress.bw array (2) + render.deferred (8).
    • Live Direction A + B hang recovery (rc=0 across all workloads):
      • Dir A (compute hang wait_rc=-4, 555.9 ms, recoveries 2 -> 3, compute_owners: retired 16 quarantined 2 reusable 15): concurrent render.heavy d=4 rc=0 (33,606 submits, 252.02 us vs 249.58 us clean); immediate fresh d=1 compute.heavy (793.65 us), compute.light (186.57 us), render.heavy (543.48 us) all rc=0, 0 ECANCELED.
      • Dir B (render hang wait_rc=-4, 120.8 ms, recoveries 3 -> 4, render_owners: retired 30 quarantined 2 reusable 29, render_failed=0, degraded=0, pb: bad 0): concurrent compute.heavy d=4 rc=0 (16,175 submits, 550.05 us vs 547.45 us clean); immediate fresh d=1 render.heavy (543.48 us), render.postfx (1630.43 us, CRC 668d6f0a), compute.heavy (793.65 us) all rc=0, 0 ECANCELED.
      • Post-recovery vk-mustpass-short: 87 / 87 PASS, 0 kernel BUG/WARN/Oops/wedged.
    • Real Deep Sleep S2R (rtcwake -d /dev/rtc1 -m mem -s 15): apple-sleep: back from sleep, boot object resumes 0 -> 1, pcie-apple port 0 & 2 link restored, ZERO_S2R_ERRORS, post-wake vk-mustpass-short 87 / 87 PASS.

(Note: I also saw your three addendum items in #issuecomment-7081689322 — run_scrubs() spinlock scope, post-scrub write barrier, and firmware in-flight capacity rationale — which arrived after f63168347300c was built/verified; we will address those in a follow-up revision.)

Assisted-by: LLM (Gemini:4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Re-checked at f631683 against both reviews at ac4f4cc.

Fixed:

  • Footprint (1). The demand-grown tiers and the per-tier numbers look right. Slot picking stays within each job's own render_passes().
  • Squash (3). The message is consistent now, and the stale hash is gone.
  • Stack buffer (5).
  • External publish wakeups (6).
  • cancel_resnap()/rearm() ordering (7).
  • Dead code and the no-op clamp (8).
  • Title and commit prefixes (part of 4).

Still open:

  • Spinlock held across the scrub (g16/poll.rs:346). Unchanged. This is the one I'd fix before merge, since it puts up to 8 MiB of WC zeroing under a preempt-off lock that SUBMIT spins on.
  • Write barrier after the off-CPU scrub (g16/slots.rs:512-527). Unchanged: scrub_clean() is followed directly by clean_mask.fetch_or().
  • 32 render slots / 18 compute units (g16/hw.rs:730/758). The commit still gives only the VA budget, not the firmware-side bound for 31 renders in flight.
  • Cross-engine stamp barriers (g16/engine.rs:156, :2137, :2356). Checking producer InitBM, and holding while any InitBM flight is live, answers the InitBM half. Two things remain:
    • g15/hw.rs:566-567 documents "Never both type 0" for FS->compute plus compute->TA, and G16 now runs both at type 0. Your debugfs counters (fs2c 13873 / c2ta 20506, 0 faults) are good evidence that this does not wedge G16. Please say in the commit why G16 differs from G15, and how the FINALIZE-flush-before-stamp behaviour was established.
    • The CTS is strided. It ran 664 + 149 tests, with 836 + 851 NotSupported, so the render<->compute single-queue cases may not have been sampled. Please run unstrided dEQP-VK.synchronization.op.single_queue.* and dEQP-VK.memory.pipeline_barrier.* at the head.
  • Rows (4/9). The J773g row at f631683 covers what was asked for on that board. Still missing at the exact head:
    • a J713 smoke row;
    • no-regression SUBMIT smoke on G13/G14 (M1/M2), G15 (M3, VmReadGuard) and G17 (A18 Pro / M4 Pro, shared cmdbuf/sync path).

New in this revision, minor:

  • Queue mutex held across user copies (file.rs:1862-1883). On the guarded path the queue mutex is now held across the cmdbuf copy and SyncItem::parse_array(). That puts user-memory faults and syncobj lookups under the queue lock. It only blocks the same file's submitters, but a PROVE_LOCKING run would confirm there is no mmap_lock inversion. Alternatively, take the staging KVec out under the lock, copy without the lock, and put it back.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Re-checked at 993edd6 against the f631683 re-check.

Fixed:

  • Scrub spinlock. run_scrubs() pops under the lock and runs run_one()/poll_now() unlocked (g16/poll.rs:346-357).
  • Write barrier. wmb() comes after scrub_clean() and before tilemap_dirty/clean_mask are published (g16/slots.rs:514-529).
  • Render-slot and compute-unit bounds. The ring-entry asserts plus the recovery snapshot size answer it (g16/hw.rs:725-777).
  • Queue mutex across user copies. The staging buffer is now taken out under the lock, and the copy and parse_array() run unlocked (file.rs:1869-1928). The error paths return the buffer, and the guarded path still copies before resolving syncobjs. Looks right.

Still open:

  • Cross-engine type 0 on both edges (g16/engine.rs:149-163). The new comment says what G16 does, but not how that was established or what G15 lacks.
    • Fault-free fs2c/c2ta counters show the type-0 handoffs do not wedge the GPU. They cannot show visibility, because a missed flush gives stale data, not a fault.
    • The comment and the commit message say "hardware-verified on M4 J713", but the counters posted here came from J773g. Please fix the board name, or post the J713 run.
    • The unstrided dEQP-VK.synchronization.op.single_queue.* and dEQP-VK.memory.pipeline_barrier.* runs at the head would settle it.
  • Rows. The PR body and the latest row are still at f631683. This revision changes the scrub path and the shared SUBMIT path, so please refresh the J773g row at 993edd6 (mustpass, gpubench, S2R).
    • Still owed from before: J713 smoke, plus SUBMIT smoke on G13/G14, G15 (VmReadGuard) and G17.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

@RyanTheTide Thanks for catching that (#issuecomment-7085440156):

  • Updated the board name from J713 to J773g in g16/engine.rs and the commit message at R4 (ec6afbe19af9b) (code-identical to R3 993edd6beda4b).
  • On Apple M4 (G16G B0) (Mac mini J773g) (dcp83, at code-identical R3 993edd6beda4b), the full unstrided sync CTS run completed cleanly: 7,214 Pass / 0 Fail / 294 NotSupported across all 7,508 dEQP-VK.synchronization*.op.single_queue.* + pipeline_barrier.* cases (103s, 0 GPU errors).
  • We'll refresh the exact-head ec6afbe19af9b J773g verification row on our next kernel build (v21).

Assisted-by: LLM (Gemini:4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Re-checked at ec6afbe. Against 993edd6, the only change is the cross_engine_barrier_type doc comment and the commit message of 44e0573; no code changed.

Fixed:

  • The board name is now J773g (g16/engine.rs:170). The comment now separates "no wedge or hang" (fault-free handoff counters) from "visibility" (CTS).
  • The unstrided synchronization*.op.single_queue.* + pipeline_barrier.* run on J773g at the code-identical 993edd6 (7,214 Pass / 0 Fail / 294 NotSupported) settles the type-0 question for G16.

Still open, rows only:

  • The J773g exact-head refresh (mustpass, gpubench, S2R) at ec6afbe.
  • J713 smoke.
  • SUBMIT smoke on the other generations that the shared file.rs path reaches: G13/G14, G15 (VmReadGuard) and G17.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Exact-head J773g live verification for R4 (ec6afbe19af9bf056fe72ea431e6dd7408341189) on Apple M4 (G16G B0) (Mac mini J773g, Linux 7.3.0-ARCH-m4prod21, run dcp88-v21-wave10-and-v13-tc, stacked kernel containing #2826 R4 + #2852 R3 + Waves 8–10 + Fast S2R):

  • Full-boot stability & lock audit: 2,119,949 (2.12M) GPU job_cmds (1,505,947 jobs), ZERO_FULL_BOOT_KERNEL_BUGS, SCHED_WHILE_ATOMIC=0, INTERRUPT_RC_WARN=0, 0 GPU dmesg errors.
  • Vulkan CTS (233 Pass / 0 Fail / 254 NotSupported / 0 Crash / 0 Timeout): 01_sync2_200 96/0, 02_multi_queue_200 50/0, vk-mustpass-short 87/0.
  • GLES3 CTS (112 / 112 Pass / 0 Fail): gles31_100 100/0, gles3_projected_12 12/0.
  • Benchmarks & CRC integrity (0 CRC fails):
    • gpubench-vk 24-row 4K@120Hz: 24 / 24 OK (1.0418× native M4 macOS 27.2 Metal).
    • gpubench-vk W1+W2: 91 / 91 OK (0.9235× Metal).
    • gpubench-gl: 43 / 43 OK.
  • Accounting, power & S2R:
    • fdinfo monotonic progression (drm-engine-vertex/drm-engine-fragment: 3.03s -> 7.72s).
    • Idle decay: S10 (97%) -> S3 within 2s (2% at 2s, 0% at 5s).
    • 3 / 3 back-to-back Deep Sleep S2R (319.11 ms p50 resume), post-S2R vk-mustpass-short 87 / 87 PASS.

Assisted-by: LLM (Gemini:4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks, the J773g refresh at ec6afbe closes that item: 2.12M job commands with no kernel bugs, CTS 233/0 including the sync2 and multi-queue slices, gpubench CRC-clean and 3/3 S2R.

Left: the J713 smoke and a SUBMIT smoke on the other generations the shared file.rs path reaches (G13/G14, G15, G17). We'll run those ourselves: one kernel with this PR and #2852 on the current fleet base, booted as a one-shot on the M4 Air, M2, M3 Air and Neo, with mustpass-short, the sync/multi-queue slices and a desktop session per machine. I'll post the rows here.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Follow-up from a non-author pass over the stack at 1b85b1e. The demand-grown tiers in f6f17f0 work as written, but on a running system the "steady single-pass clients stay on the two base pass slots" claim (resources.rs:150-156) does not hold. Scheduler::last_job (d915ca0) keeps the previous job's Prepared alive, so active_render_passes is never 0 at prepare(). A model built from a verbatim copy of target_render_slots goes 2 to 8 backed pass slots for a plain 60 Hz one-render client (18 if the last job had 7 passes). Details and the root cause are on #2741; the fix belongs there, and this PR's footprint item reopens until it lands.

The shared files in this PR (file.rs per-queue SUBMIT staging, mmu.rs VmReadGuard on the VM reservation) were checked for G16 with several threads on one queue and one VM: no findings. They were checked separately for M3, G15 and G14 callers too.

One concrete break in this PR: 0ae38e8 gives mmu::VmReadGuard a lifetime, and the g15 callers now spell it VmReadGuard<'_> (g15/command.rs:150, g15/gate.rs:74). The asahi-g15 host selftest shim at tools/testing/selftests/drivers/gpu/asahi-g15/run.py:117 still declares pub type VmReadGuard = Vm;, so run.py fails to compile at ec6afbe and 1b85b1e with six error[E0107]: type alias takes 0 lifetime arguments but 1 lifetime argument was supplied. The one-line fix is pub type VmReadGuard<'a> = Vm;. With it, the suite gives 81 passed and 0 failed on our merge of this stack; the stock suite passed 81 before this PR.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

@RyanTheTide Rebased djdev/g16-perf-wave6 onto updated #2787 (87fdefd2137d) and pushed cff14859d88138dbfe7c165f059af1ada0956204 (9 commits):

Point-by-point fixes

  1. asahi-g15/run.py E0107 compile failure (cff14859d881): added the 'a lifetime parameter to the mocked VmReadGuard<'a> in tools/testing/selftests/drivers/gpu/asahi-g15/run.py to match the VM reservation-lock VmReadGuard<'a> change in 3774df81b747.
  2. Tier inflation (active_render_passes): fixed cleanly in the base #2741 commit ba6a7bef1ea3 below this PR in the stack.

Verification

  • Host tests:
    • python3 tools/testing/selftests/drivers/gpu/asahi-g15/run.py — 81 passed; 0 failed; 2 ignored.
    • python3 tools/testing/selftests/drivers/gpu/asahi-m4/run-host-tests.py — 25/25 PASS at stack tip 44dd25507c01.
    • scripts/checkpatch.pl --no-signoff — 0 errors, 0 warnings.
  • Live Apple M4 (G16G B0, J773g Mac mini, 7.3.0-ARCH-m4prod25d, dcp99-v25d-verify):
    • Benches: compute.heavy(alu/bw) d=4,8,16 6/6 OK (0 EINVAL) + render.shadow(d32f,depth_only/alpha_test) d=2 2/2 OK (crc=c0fb9993, 7be9463a, 0 ETIMEDOUT); GATE2_BENCH_SUMMARY: ok=8 bad=0, GATE2_DMESG_DELTA=0, GATE2_GPU_DMESG_ERRS=0, sensor_errors 0.
    • Final postflight: FULL_BOOT_KERNEL_BUGS=0, FULL_BOOT_GPU_DMESG_ERRS=0, TOTAL_RECOVERIES_PLUS_HANG_KILLS=0, PB_BAD=0, jobs 197974 job_cmds 243961, POST_IDLE=IDLE_CLEAN.

Assisted-by: LLM (Gemini:4 Neon)

…ll overhead

Pipelined submissions previously never retired completed flights inside
submit_locked(), forcing a workqueue round-trip whenever in-flight slots
filled and producing hold[0] stalls and 300-500 us tail bubbles. At the
same time, every EP 0x20 interrupt triggered full housekeeping in
submit_locked(), every publish_checked() ran Session::check() (including
the cross-core UAT handoff lock and full TTB scan), every TA (0x70)
completion triggered a 50 us EVENT_RETIRE_POLLS busy-spin while FS was
still running, every retire_once() polled all nine log sub-rings and the
trace ring, and retired timestamps were re-read from WC memory for both
accounting and empty timestamp outputs.

Deferring the full Session::check() checks (ASC_RUN, pstate > top, and
check_adopted_bindings()) to the 1 ms housekeeping tick is safe because:
- publish_checked() still runs Session::transport() on every submit so
  RTKit crashes and latched transport errors stop publication immediately;
- host VM bind/unbind updates ttbs[slot] and owned_user_roots[slot]
  atomically under uat.inner.lock() before submit/publish, so
  check_adopted_bindings() detects only unexpected firmware/external
  TTBAT corruption rather than normal host binding races;
- the host never writes pstate > top (policy::limit() bounds every
  published selector to 1..=top), avoiding per-submit PPL handoff lock
  contention;
- full Session::check() still runs on every >=1 ms housekeeping tick, on
  the first submit after >=1 ms idle, and whenever recovery_pending() is
  true.

Fix the hot submit and retirement paths:
- Eagerly retire completed flights inside submit_locked() when an EP 0x20
  event arrived, housekeeping/recovery is due, or the oldest flight's
  terminal fw_stamp has reached its target, leaving evented cleared when
  work retires so queued poll work does not spin.
- Separate 1 ms housekeeping (Session::check, object health, power,
  auxiliary log/trace ring drain) from per-submit fast publication, using
  Session::transport() in publish_checked().
- Track fragment completion events (0x71) alongside stage events so
  TA-only (0x70) interrupts do not trigger receipt-tail busy-spins or
  short-repoll storms while FS is still executing, and step the initial
  receipt-tail backoff from 1 us -> 2 us -> 5 us.
- Split channel draining into fast event+stats draining on retirement and
  auxiliary log/trace draining on 1 ms housekeeping, skip ktime_get() on
  empty event rings, reuse retired_snapshot() GPU ticks in stat_retire(),
  and skip WC timestamp reads when timestamp_outputs is empty.

Signed-off-by: Diljit Singh <[email protected]>
…ork writes

With RENDER_SLOTS = 8, render pipelining capped out at 7 in-flight passes
(stalling depth 8 and 16 workloads), while each render pass recomputed
Geometry::new() three times and rewrote the untouched zero middle gaps of
both ta_work (0x360..0x740, 992 bytes) and fs_work (0x460..0x780, 800
bytes) into write-combining memory on every clean same-VM reuse.

Both WORK_STRIDE and RENDER_SLOTS are host client-VA layout choices
rather than firmware bounds: firmware receives explicit 64-bit VAs for
each pass object rather than indexing by stride. Each pass slot spans
+0x0..+0x1c00000 (28 MiB: TILEMAP at +0x1400000 plus 8 MiB TILEMAP_SIZE),
which rounds to a 32 MiB power-of-two stride (4 MiB guard) and yields 16
slots inside the 512 MiB window 0x7020000000..0x7040000000 (matching
COMPUTE_UNITS = 16).

- Halve WORK_STRIDE / PASS_STRIDE from 64 MiB to 32 MiB and expand
  RENDER_SLOTS from 8 to 16 inside the existing
  0x7020000000..0x7040000000 window, raising pipelined render depth from
  7 to 15.
- Keep full 16 MiB TPC / 8 MiB tilemap capacity on the two base pass
  slots (0..BASE_RENDER_SLOTS) and size extension slots (2..16) to 2 MiB
  TPC / 1 MiB tilemap so bursting VMs support 15 concurrent passes up to
  4K multi-layer and 8K without inflating per-VM RAM.
- Track RenderOwners::last_full (mirroring ComputeOwners::last_full) and
  write only the active head and tail spans of ta_work and fs_work on
  clean same-VM reuse, saving 1,792 bytes of WC writes per render pass
  while full-scrub claims still write the complete images.
- Compute render Geometry once per publication and update only
  layer_metadata after claiming the pass slot.

Signed-off-by: Diljit Singh <[email protected]>
Every SUBMIT ioctl currently takes 10-40 separate gpuvm.lock_inner()
holds across command root validation, attachment checks, and per-record
stream-gate walks, decodes the command stream twice, calls ktime_get()
on every submit even after extension arenas are allocated, and
unconditionally notifies the standby condvar even with zero waiters.

- Batch page-aligned VM range checks in g16/command.rs through a
  48-entry stack SpanBatch calling vm.covers_ranges_batch() once per
  render or compute command, preserving exact per-span
  EINVAL/ENOENT/EACCES error reporting on failure.
- Collapse command::prepare()'s two stream decode passes into one.
- Reuse page coverage across 256-byte window cache hits in g16/gate.rs
  instead of calling cover() on every record in the same page.
- Skip ktime_get() burst tracking in g16/resources.rs once extension
  arenas are already allocated, and skip standby_available.notify_all()
  when no waiter is blocked.
- Add a host unit test in test-stream-gate.py verifying window-cached
  coverage reuse.

Signed-off-by: Diljit Singh <[email protected]>
…s-engine barriers

Previously, G16 serialized compute and render work strictly:
can_queue_behind() rejected any mixed-class overlap, Order::ready()
forced cross-engine dependencies to wait for full host retirement, and
poll.rs only retired flights[0], leaving the compute and TA/FS hardware
pipelines unable to overlap.

Enable concurrent same-VM compute and render flights with per-class
retirement, per-class hang deadlines, drain fairness, and hardware ring
barriers:

- Allow healthy same-VM non-InitBM compute and render commands to queue
  concurrently up to their respective per-class flight caps, while
  preserving cross-VM, InitBM, and query_access serialization.
- Gate alt-class fallback selection on !needs_engine_drain(&job) so
  class-cap overlap runs concurrently on primed same-VM queues while
  drain-requiring head jobs (unprimed same-VM InitBM render, cross-VM
  switch, failed VM, or doomed/recovery/InitBM flight in progress) are
  never starved; advance queue fairness turns only after
  publish_prefix() succeeds so transient EAGAIN does not burn a turn.
- Emit hardware Hold ring barriers for same-queue cross-engine
  dependencies (fs2c0 on the compute ring using the FS fw_stamp, and
  c2ta0 on the TA ring using the compute fw_stamp via a dedicated
  PassSlot::compute_barrier FwObject), walking all commands of a flight
  so multi-command compute batches resolve their exact member stamp and
  defer with EAGAIN if an unretired predecessor is missing.
- Retire the oldest compute flight and oldest render flight
  independently in poll.rs, track progress and administrative/warning
  deadlines per class (render deadline_ns vs compute_deadline_ns) so an
  advancing class never masks a hung flight on the other class, and
  convert Job::full_retired to a 64-bit command bitmask so mixed-class
  jobs can retire out of class order while preserving completion proofs.
- Read only the published engine's WC qstate WRITE register(s) during
  publication instead of touching both compute and render rings.
- Add host selftests covering concurrent compute+render publication,
  drain fairness and EAGAIN turn preservation, fs2c0/c2ta0 barriers
  across multi-command flights, out-of-order per-class retirement, and
  independent per-class progress/timeout enforcement.

Signed-off-by: Diljit Singh <[email protected]>
…rnor

On depth-1 submission loops, the engine briefly drains between consecutive
jobs, causing Power::report_work(false) to toggle
apple_clpc_gpu_set_active() on every job boundary (triggering
mod_delayed_work(..., 0) flushes in drivers/soc/apple/clpc.c even though
CLPC itself already holds rails for APPLE_CLPC_HOLD_MS = 32 ms on a 4 ms
sampling cadence) and forcing the utilization governor to wait a full
20 ms window before stepping up from FLOOR.

Add short 2 ms CLPC idle-hold hysteresis and an asymmetric 5 ms fast-ramp
upward path to the G16 power governor:

- Hold the CLPC active hint for 2 ms (CLPC_IDLE_HOLD_NS, half of clpc.c's
  APPLE_CLPC_SAMPLE_MS = 4 ms) across brief sub-ms depth-1 inter-job gaps
  via policy::ClpcHold, releasing it from service_power() once expired and
  re-arming run_poll() while held idle. This suppresses redundant
  mod_delayed_work flushes without holding across 60 Hz (16.67 ms) or
  120 Hz (8.33 ms) frames.
- Release CLPC immediately via Power::release_clpc_now() on fail-stop
  (fail_flights) and system sleep commit (sleep_down).
- Add a 5 ms upward-only ramp window (RAMP_WINDOW_NS = SAMPLE_NS, aligned
  with the existing PMP sampling cadence) and ramp_demand() matching
  demand()'s upward thresholds (>= 70% -> top, >= 40% -> +1) so sustained
  bursts reach top within 5 ms while light 60 Hz desktop frames stay near
  FLOOR and 20 ms slow decay is preserved. Clamp stored Governor::demand to
  the active thermal/user limit on the fast-ramp path so cooling
  relaxation steps cleanly instead of jumping.
- Add unit tests in g16/power/policy.rs and wiring checks in
  test-thermal-policy.py covering fast ramp, 60 Hz non-pumping, decay
  preservation, clamped cooling ceilings, and CLPC idle-hold expiry/reset.

Signed-off-by: Diljit Singh <[email protected]>
Every render pass claim previously ran PassSlot::scrub() synchronously
while holding the device mutex (Shared::state), stalling concurrent
submissions and retirement behind WC tilemap/heap/preemption zeroing.

Move clean same-VM pass slot scrubbing outside Shared::state with a
race-free synchronous fallback:

- Record clean render retirements in Slots::note_render_retired() and
  stage remaining idle displaced, cleanly retired render pass slots
  (never Published or undisplaced Retired slots) right before dropping
  Shared::state via stage_and_take_scrubs(), only when the engine is
  neither failed nor frozen. Staging after publication avoids
  self-blocking immediate slot reuse within the same lock hold and skips
  staging on pure compute workloads.
- Run staged scrubs in run_poll(), submit(), and try_submit_inline()
  after dropping Shared::state and after signalling retired completion
  fences via job::complete_all().
- Coordinate slot selection (pass_available, pick_pass, pick_pass_in)
  and off-lock scrub completion via SeqCst scrubbing/waiter atomics so
  in-flight scrubbing slots are skipped, pre-cleaned slots are
  preferred, and blocked waiters trigger an immediate poll_now().
- Skip synchronous WC fills in claim_pass_in()/claim_pass_for() when
  a same-VM slot was pre-cleaned, while falling back synchronously on
  first use, cross-VM switch, recovery invalidation, error/cancel, or
  any failed/dropped off-lock scrub.
- Wait for active off-lock scrubs to drain in sleep_quiet() before
  entering system sleep.
- Add host selftests in test-resources.py covering displaced-only
  staging, post-publish staging without blocking immediate reuse,
  off-lock scrub + zero-fill claim, waiter wakeup, dropped batch
  cleanup, and synchronous fallback on error/recovery/cross-VM.

Signed-off-by: Diljit Singh <[email protected]>
…imelines off-lock

Ready submissions with already-signalled inputs previously still allocated
and armed a drm_sched job and woke the scheduler kworker even when inline
publication succeeded, and `try_submit_inline()` used `try_lock()` on
`Shared::state`, bouncing bursts during brief poll-lock windows onto
`drm_sched` wakeups and causing 350-520 us gap95 tail stalls on multi-depth
workloads. In addition, `Timeline::complete()` held `Timeline::pending`
across `dma_fence_signal()` callbacks.

Bypass `drm_sched` allocation and kworker wakeup in `Scheduler::push()`
when `prev_started` is true and `Job::try_start_inline()` succeeds,
rolling back `accepted` and falling through to `drm_sched` otherwise.
Track active firmware recovery in `Shared::recovering` (guarded via RAII
in `Firmware::recover()`) so `Shared::try_submit_inline()` can bail out
only during sleep or recovery and otherwise acquire `Shared::state`
directly. Finally, split `Timeline::complete()` so ready head fences are
drained in fixed stack batches under `signaller -> pending` and signalled
without holding `Timeline::pending`.

Extend `test-job-failure.py` and `test-fence-signalling.py` to cover
`Scheduler::push()` inline bypass/fallback rollback, recovery bailout,
and off-pending FIFO batch signalling.

Signed-off-by: Diljit Singh <[email protected]>
Mirror the G15 logical-queue contract on G16:

- Add params::queue_limits() (max_queues = MAX_QUEUES = 58,
  max_in_flight_per_queue = FLIGHTS = 32) and return it from
  Gpu::queue_limits(), which enables DRM_ASAHI_FEATURE_INDEPENDENT_QUEUES
  and DRM_ASAHI_PARAM_GROUP_QUEUE_LIMITS in the shared frontend.
- Track live logical queues per open DRM file in usage::Client via an
  RAII QueueCredit guard (ENOSPC at MAX_QUEUES), stored after Scheduler
  in Queue so capacity returns only after scheduler drain.  Because G16
  logical queues own no firmware execution contexts, keeping QueueCredit
  per-file while file.rs enforces per-process queue_share::Share bounds
  ensures a client that opens MAX_QUEUES queues cannot starve a later
  process (such as a compositor) from creating its own queue.
- Extend test-publication.py and usage.rs unit tests to cover queue
  limits, INDEPENDENT_QUEUES, per-file QueueCredit isolation and
  release, and multi-queue compute+render concurrency on one VM.

Signed-off-by: Diljit Singh <[email protected]>
Allow compute-only barrier-free command runs within a job and across
consecutive ready compute-only jobs on the same queue and VM to share one
firmware publication and one doorbell, bounded by free compute units,
available compute ring slots, and the compute flight budget.

Each batched compute member claims its own hardware compute unit, writes
its own submitted counter before the shared barrier, and records its own
completion stamp and work descriptor so retirement verifies every claimed
unit receipt, publishes timestamps for every grouped job, and lets
cross-engine waits and firmware recovery snapshots resolve interior stamps.

Signed-off-by: Diljit Singh <[email protected]>
…er validation

Vm::read_lock() previously called lock_vm(&self.gpuvm, None, false),
which allocates a KBox<drm_gpuvm_exec>, runs drm_exec_init() (allocating
a page-sized object array), and locks every external BO reservation on
the VM (O(external BOs)) on every G16/G15 SUBMIT.

Because every mapping mutation in mmu.rs holds the VM's shared
reservation, read-only page-table coverage walks and user-memory copies
need only self.gpuvm.lock_inner(), matching covers_ranges_batch():

1. Back VmReadGuard<'a> with GpuVmInnerGuard<'a, VmInner> via
   self.gpuvm.lock_inner(), eliminating the per-SUBMIT KBox,
   drm_exec object-array allocation, and O(external BOs) lock walk.
2. In G16 Prepared::validate(), validate render VM spans and VDM root
   barriers under one Vm::read_lock() hold via SpanBatch::flush_locked()
   and gate::vdm_batch_locked().
3. Minimize PoC cache maintenance (dc civac + dsb sy) in G16 stream
   gates: read only 4 bytes (1 cache line) for single-pass VDM roots
   and clamp CDM root-stream window reads to the validated root end.

Signed-off-by: Diljit Singh <[email protected]>
… slot is quarantined

Fresh user VMs start with only BASE_COMPUTE_UNITS (2) compute units and
BASE_RENDER_SLOTS (2) render pass slots, allocating extension slots
lazily on bursts, overlap, or multi-pass submits.

After a hang recovery quarantines one base compute unit (0 or 1) while
the other base unit is the newest-retired undisplaced owner,
compute_exhausted_within(2) becomes true even though 14+ extension
compute units remain healthy. Every subsequent fresh single-command
compute client then submits with only 2 units, hits
compute_exhausted_within(2) in engine publication, and fails
immediately with ECANCELED without ever running on an extension unit to
displace the surviving base unit. The same deadlock occurs for fresh
single-pass render clients when a base pass slot is quarantined.

Track base-slot quarantine state in Lifetime::any_quarantined_within(),
publish lockless hints on Shared whenever Slots::quarantine() runs, and
pass them via PrepareHints into Cache::prepare() so fresh VMs expand
compute_ext / render_ext immediately once a base slot is quarantined.

Add host unit tests covering both compute and render base-slot
quarantine recovery and displacement.

Signed-off-by: Diljit Singh <[email protected]>
Avoid per-SUBMIT heap allocations without placing a large command buffer
on the kernel stack across queue.lock().submit() or holding the queue
mutex across userspace copies:

- Store a reusable KVec<u8> staging buffer on TableQueue (retained up to
  4096 bytes between submissions, releasing oversized buffers on
  completion or error).
- Take the cached KVec<u8> out of TableQueue under a brief queue.lock(),
  drop the queue mutex before copy_from_user() and SyncItem::parse_array()
  (preventing queue.lock() -> mmap_lock lock-order inversion), then
  re-acquire queue.lock() only for inner.submit() and returning the
  cleared buffer (or return on early error).
- Read drm_asahi_sync entries in 8-entry (128-byte) stack chunks rather
  than issuing a separate copy_from_user per sync.
- Preserve the pre-syncobj failure boundary on guarded (G16/G17) paths
  by snapshotting the command buffer before resolving output syncobjs,
  and keep parsing syncs first on unguarded paths.

Signed-off-by: Diljit Singh <[email protected]>
…ender hangs

Physical render PB/UMA allocators (hardware UMA slot 33) were previously
capped at two fixed slots (parameter_id 0 and 1). Once both slots had
been used across VMs (for example compositor plus benchmark), a single
render hang on the active slot called pools.invalidate() and
pools.quarantine_flight(), leaving the other slot undisplaced and
immediately tripping Pools::exhausted() -> render_failed=1, degraded=1,
and device wedged even with 14+ healthy render pass slots remaining.

Expand the client-VA render allocator window to PB_SLOTS = 6
(parameter_id 0..6 in a 64 MiB stride across 0x7008000000..0x7020000000,
disjoint from base compute units, render pass slots, dynamic PB page
lists, and extension compute units). Keep non-fault VMs at
BASE_PB_SLOTS = 2 with zero extra RAM overhead; lazily allocate per-slot
PoolExtArena recovery allocators sharing the VM's existing PB heap only
after a render hang quarantines an allocator slot, signaled locklessly
via Shared::needed_pb_slots.

Generalize Pools selection, displacement, and exhaustion checks to
PB_SLOTS while preserving the two-slot working set in normal cross-VM
switching and per-job limit checks (pick_slot_within /
can_pipeline_within / exhausted_for_within) so pre-hang jobs cancel
cleanly instead of spinning on EAGAIN.

Add host unit tests covering the exact cross-VM single-render-hang
recovery and survivor displacement path, multi-hang survival up to four
quarantines, and clean exhaustion at the slot limit.

Signed-off-by: Diljit Singh <[email protected]>
When multiple render commands are batched into a single G16 flight,
engine publication previously called commit_render() once, leaving
(f.renders - 1) standby PB reservations held until Prepared::drop on the
deferred cleanup worker. Pass f.renders to commit_render() so all
published render commands release their standby reservations immediately
upon firmware visibility.

Signed-off-by: Diljit Singh <[email protected]>
…dle power

Address adversarial review findings and idle power regressions across
the pipelined G16 submission stack:

- Replace single-entry last_retired with a 64-entry per-stage
  RetiredStamps ring recording every retired compute/TA/FS member so
  late recovery snapshots after pipelined bursts still resolve safely.
- Use Firmware::compute_ticks() in publish_timestamps() so 26B123
  work_ticks fallback works for client timestamp queries as well as
  stats.
- Retain base RenderArena alongside PoolExtArena in PbOwnerArena::Ext
  so shared PB heap mappings outlive Cache::close() until displacement.
- Track queued drm_sched jobs via Scheduler::pending_sched counter
  instead of per-push Arc allocations or retaining Arc<Job>, ensuring
  VmJobGuard drops immediately on completion.
- Remove dead recovering check under Shared::state in
  try_submit_inline() and ensure retire_oldest() forgets failed-stop
  flights on every early return.
- Extract Shared::arm_idle_power_poll() across all three idle-exit
  paths, call power.report_work(false) on drain, and gate
  syncobj_wait_hint on a G17-style 8-submit burst streak with 8 ms
  auto-expiry.

Signed-off-by: Diljit Singh <[email protected]>
Match the VmReadGuard<'a> lifetime introduced when switching VM_BIND
gate reads to the VM reservation lock so asahi-g15/run.py builds and
passes all host tests.

Signed-off-by: Diljit Singh <[email protected]>
Bring in main through the updated base. Conflicts:

- g16/gate.rs, test-stream-gate.py: main lets a VDM root carry the USC
  cache invalidate (VDM_USC_INVALIDATE). vdm_batch(), which replaces
  vdm() here, now admits it too, and the root-barrier test checks both
  words through vdm_batch().
- usage.rs: Client keeps the logical queue credit next to main's
  NUM_ENGINES-sized engine ledger.
- g16/params.rs: the module comment lists VDM_USC_INVALIDATE with the
  features this series advertises.

Signed-off-by: Diljit Singh <[email protected]>
Bring in main through the updated base. Conflicts:

- g16/gate.rs, test-stream-gate.py: the base's vdm_batch() admits the
  VDM root with or without the USC cache invalidate. Keep this series'
  vdm_batch_locked() with that check, and test both words through
  vdm_check().
- g15/gate.rs: main's USC cache invalidate admission together with this
  series' VmReadGuard<'_> lifetimes.

Signed-off-by: Diljit Singh <[email protected]>
Slots::publish() takes its claims as &mut Claims. Five render-slot
cases still passed &Claims, so check-resources.rs no longer compiled
and the asahi-m4 suite failed at test-resources.py.

Signed-off-by: Diljit Singh <[email protected]>
@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot) labels Nov 24, 2026
@github-actions github-actions Bot added blast:all Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) and removed needs-template PR body lacks Tested or Risk (bot) labels Nov 24, 2026
@github-actions

Copy link
Copy Markdown

Merge readiness at fd49ba25: not ready yet

Check Detail
CI at head ok no CI for this change (the hardware row is the gate)
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 fd49ba25, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: two-way · M4, plus every Mac for the shared SUBMIT parsing in file.rs and the mmu.rs read guard

Areas: area:gpu

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

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Verdict at fd49ba25a8: FINISH, then merge. No code blockers.

Blockers:

  1. No hardware row at this head. Every row in this PR ran a commit that is no longer in the branch, because the branch was rebuilt onto the updated base. Fix: one J773g run at this head, or on a candidate that contains this head unchanged (see below).
  2. No row for the shared code. drivers/gpu/drm/asahi/file.rs (chunked sync reads, per-queue SUBMIT staging buffer) and drivers/gpu/drm/asahi/mmu.rs (VmReadGuard on the VM reservation lock) run on every Mac, not only M4. Fix: one non-M4 row (boot plus a Vulkan smoke and a synchronization subset, 0 faults) at this head.

Checked: this PR's own commits against its base; the chunked sync read in file.rs stays inside its 8-entry stack buffer; no Apple material in code or commit messages; no chip or board gates; no new parameters; only bounded waits; commits carry the author and Signed-off-by, no AI attribution; CI does not run on a stacked base and will run once this PR targets main. I reformatted the PR body to What / Tested / Risk / Not yet, with the original kept folded and its attribution line removed.

Row

One J773g run on a candidate that contains the heads of #3087, #3057 and #3046 unchanged (boot, idle/wake, deep sleep, vk-mustpass-short, gpubench vk-full, compute.long, 0 GPU faults) counts for every non-draft PR in this stack at once.

@DjDeveloperr
DjDeveloperr changed the base branch from djdev/g16-perf-wave2-5 to main November 25, 2026 01:36
@DjDeveloperr
DjDeveloperr requested review from a team as code owners November 25, 2026 01:36
@DjDeveloperr
DjDeveloperr merged commit 2a91db6 into main Nov 25, 2026
2 checks passed
@RyanTheTide
RyanTheTide deleted the djdev/g16-perf-wave6 branch November 27, 2026 13:21
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:all 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) 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