Skip to content

drm/asahi: g16: map scheduling context, render stamps, and UMA/PB records ASC-cached - #3503

Merged
RyanTheTide merged 5 commits into
mainfrom
perf/g16-fw-cache
Dec 1, 2026
Merged

RyanTheTide merged 5 commits into
mainfrom
perf/g16-fw-cache

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

What

Map the firmware-hot g16 scheduling, render FS stamp, render UMA descriptor, and parameter-buffer (PB) records ASC-cached (0x443) to match macOS 26B123 (uat-clp8p-1 / uat-postfx2p-1), eliminating uncached DRAM round-trips on every TA, FS, and compute kick and completion:

  1. a295a52632c6 — drm/asahi: g16: map the shared scheduling context ASC-cached: allocates the single shared sched_ctx from Graphs::finish()'s probe-time persistent allocator as Class::FwCoherent (0x443) with sync_for_cpu() before the pre-post check and in register_context()'s poll loop.
  2. 0bac8ba30d12 — drm/asahi: g16: map render FS firmware stamp ASC-cached: maps RenderGraphSession FS fw_stamp[1] as device-lifetime Class::FwCoherent (0x443) while keeping TA fw_stamp[0] uncached Class::Shared so ta_pending_passes(), recovery_snapshot(), progress(), and report() observe per-pass TA progress without 3-wave throttling on multi-pass renders. Normal flights fail fast on uncached notifier FS_STAMP; cold recovery_suspect flights with unsettled notifiers use sync_for_cpu(0, 4)? on fw_stamp[1] as an independent stage witness.
  3. cf33fcddeb3e — drm/asahi: g16: map render UMA descriptors and PB records ASC-cached: adds device-lifetime RenderUmaPool and PbRecordPool on Factory:
    • RenderUmaPool maps render UMA descriptor as Class::FwCoherent (0x443, unconditionally dc civac'd by 26B123 at 0x2d538) paired with uncached submitted (Class::Fw).
    • PbRecordPool places per-slot ASC-cached managers[0..PB_SLOTS] (256 B stride, 2x M4 cache lines, zero cross-slot false sharing) and firmware-read-only initbm in one 16 KiB cached_records (Class::FwCoherent, 0x443), keeps blocks Class::FwCoherent (0x443), and keeps ring (BLOCK_CTL), counter (constant 1, avoiding per-flight 0x101e4 HW PB slot unloads), and misc in nc_records (Class::Fw, 0x44b).
    • pages (32 KiB, Class::Shared) is hosted in PbRecordSet at a globally unique bounds-checked pages_gpu = DYNAMIC.start + slot * 0xc000 aliased per VM via Objects::map_client_at(). PbEpochInner declares _objects strictly before records_lease, unmapping VM A's pages_gpu alias synchronously before the lease returns to the pool.
    • Once exposed on slot k, a PbRecordEntry is permanently bound to (layout, heap_gva, heap_blocks) and slot_exposed bit k ensures the host never writes to managers[k] or blocks again (InitBM resets live cursors on the ASC-cached line itself), eliminating any host-write vs ASC-dirty-line coherency race. Both pools pre-allocate UniqueArc lease storage before locking so OOM can never double-release or strand mappings; quarantined/aborted entries never return to the pool.
  • Base: 00fbe806db2322d96561542e7cf92af0874ff0ed (clean git merge-tree against live origin/main 844781f1b56b).
  • Head: cf33fcddeb3e98dd62561eaf9bc804829ca69609 (perf/g16-fw-cache).

Tested

  • Build, style, and host selftests at cf33fcddeb3e:
    • Kernel module build (drivers/gpu/drm/asahi/): LD [M] drivers/gpu/drm/asahi/aurora.o, 0 errors, 0 new warnings (35 pre-existing).
    • run-host-tests.py: 26/26 PASS (80/80 tests in test-resources.py, covering immutable pb_mgr/blocks zero-write recycle, cross-slot isolation, wrong-binding rejection, runtime+static _objects-before-records_lease drop order, DYNAMIC exhaustion ENOMEM, pre-lock UniqueArc idle-entry OOM safety, partial-alloc/sync retry without burning DYNAMIC slots, and concurrent heap-growth standby reservations; test-stamp-wrap.py covering both stale-FS-notifier abort and unreached-FS-stage pending recovery paths).
    • checkpatch.pl --strict --git 00fbe806db232..cf33fcddeb3e: 0 errors, 0 warnings, 0 checks across all 3 commits.
  • J773g (Mac mini M4, T8132 / G16G B0, exact-head 4-boot mirrored ABBA mbase,fwimmtw,fwimmtw,mbase on cf33fcddeb3e, Vulkan Borealis Mesa 90211df6816a, gpubench-vk ae90a40, 2 passes x 20 rows per visit, 3x250 ms samples after 150 ms warmup):
    • 18/20 reproducible wins and 0 regressions under the two-pair 1% threshold (80/80 exact pinned CRCs, 8/8 compression readback checks, 72/72 status-only OK, 160/160 timed records valid).
    • SLC ON 2 planes across all 4 boots and stock restore; 0 GPU faults, 0 recoveries, 0 hang kills, 0 quarantined owners, 0 kernel findings.
    • Headline pooled improvements:
      • render.light tri d16: -11.58% (-9.10% / -13.94%, 58.26/60.94 -> 52.95/52.44 us)
      • query.occlusion d16: -11.52% (-8.78% / -14.11%, 57.87/61.16 -> 52.79/52.53 us)
      • render.light procs tri d16: -10.97% (-8.83% / -13.02%, 66.70/69.66 -> 60.81/60.59 us)
      • render.postfx msaa=4 1080p d2: -10.38% (-8.91% / -11.81%, 729.97/751.96 -> 664.91/663.13 us)
      • render.light tri d64: -10.22% (-7.80% / -12.54%)
      • compute.light procs d16: -8.89% (-6.77% / -10.92%)
      • render.bindless_ubo 512 d2 / d1: -8.86% / -7.34%
      • compress.bw array 1440p d4: -8.70% (-6.80% / -10.55%)
      • render.mdi 1024 d1 / d4: -8.61% / -6.01%
      • concurrent.cr interleave d4: -8.49% (-6.66% / -10.25%)
      • compute.light queue d16 / d4: -6.80% / -4.48%; procs d4: -5.40%
      • render.postfx msaa=4 1080p d1: -6.37% (-5.49% / -7.23%, GPU -8.41%, 807.81/824.10 -> 763.50/764.53 us)
      • render.shadow depth_only d2: -4.00% (-0.09% / -7.76%, GPU -4.35%)
      • render.deferred tile msaa=4 d1: -1.69% (d2 -0.11%)
Full exact-head J773g 4-boot mirrored ABBA table (20 workloads, 160 timed records, 80/80 pinned CRCs)

A is origin/main (00fbe806db23). B is perf/g16-fw-cache (cf33fcddeb3e). Values are us/submit; pooled delta is ratio of arm means.

Workload A1 B1 B2 A2 Pair 1 % Pair 2 % Pooled % CRC
postfx msaa=4,res=1080p d1 807.81 763.50 764.53 824.10 -5.49% -7.23% -6.37% 668d6f0a
postfx msaa=4,res=1080p d2 729.97 664.91 663.13 751.96 -8.91% -11.81% -10.38% 668d6f0a
bubo draws=512,mode=ubo_vec4 d1 269.71 254.61 250.79 275.74 -5.60% -9.05% -7.34% 1af53d5c
bubo draws=512,mode=ubo_vec4 d2 165.56 153.99 154.47 172.89 -6.99% -10.66% -8.86% 1af53d5c
mdi bindless=256,draws=1024 d1 220.33 204.89 204.49 227.63 -7.01% -10.17% -8.61% f69c5f55
mdi bindless=256,draws=1024 d4 126.24 121.36 121.11 131.74 -3.86% -8.07% -6.01% f69c5f55
shadow depth_only d2 446.44 446.03 427.43 463.40 -0.09% -7.76% -4.00% c0fb9993
shadow alpha_test d2 1004.16 1010.20 1014.24 1008.13 +0.60% +0.61% +0.60% 7be9463a
compress array 1440p d4 450.05 419.46 415.29 464.25 -6.80% -10.55% -8.70% 8/8 valid
deferred tile msaa=4 d1 600.25 596.66 595.95 612.88 -0.60% -2.76% -1.69% 6dc74b48
deferred tile msaa=4 d2 351.87 350.88 350.88 350.63 -0.28% +0.07% -0.11% 6dc74b48
render.light tri d16 58.26 52.95 52.44 60.94 -9.10% -13.94% -11.58% status OK
render.light tri d64 59.44 54.81 54.12 61.88 -7.80% -12.54% -10.22% status OK
render.light procs tri d16 66.70 60.81 60.59 69.66 -8.83% -13.02% -10.97% status OK
query occlusion d16 57.87 52.79 52.53 61.16 -8.78% -14.11% -11.52% status OK
concurrent.cr interleave d4 63.89 59.63 59.95 66.79 -6.66% -10.25% -8.49% status OK
compute.light queue d4 43.22 42.16 41.96 44.84 -2.45% -6.44% -4.48% status OK
compute.light queue d16 27.74 25.98 25.97 28.00 -6.35% -7.25% -6.80% status OK
compute.light procs d4 46.62 44.74 44.64 47.86 -4.05% -6.72% -5.40% status OK
compute.light procs d16 39.81 37.11 37.21 41.76 -6.77% -10.92% -8.89% status OK

Driver counters across 4 boots: 391,016-409,092 jobs/pass (255,355-267,859 early) on mbase vs 432,706-436,178 jobs/pass (285,595-288,172 early) on cf33fcddeb3e; recoveries_delta = 0, hang_kills_delta = 0, compute_quarantined_after = 0, render_quarantined_after = 0.

  • J773g exact head 09d84a54 (main dbfbced7 + this head's driver, tree checked equal to the head): bindless_ubo d2 −8.3 %, postfx msaa4 d2 −7.6 %, light d64 −10 %, compute.uber d4 −3.9 %, shadow/deferred flat; 10/10 pinned CRCs, 0 GPU faults.
  • J516s (M3 Pro, T6030 G15S) second-generation row at cf33fcdd: PASS, 90/90 gpubench rows with CRC parity across two runs, 0 GPU faults.

Risk

Two-way door (low risk): strictly scoped to drivers/gpu/drm/asahi/g16/ firmware object caching classes and device-lifetime pools with zero UAPI/ABI changes. All ASC-cached mappings obey the persistent device-lifetime contract (no unmap teardown), PbRecordEntry is immutable after first exposure on each slot, client pages_gpu aliases unmap strictly before lease return, and quarantined/aborted entries never return to the pool. Cleanly revertible commit-by-commit.

Not yet

  • Nothing. J773g exact-head row at 09d84a54 and the J516s (G15S) second-generation row at cf33fcdd are both posted.

Firmware reads and updates the shared scheduling context on every TA, FS,
and compute kick, completion, and active-count idle transition, and maps it
ASC-cached (0x443) on macOS 26B123.

Allocate the single shared scheduling context inside Graphs::finish() from
the probe-time device-lifetime persistent allocator as Class::FwCoherent
rather than uncached Class::Fw, and sync its cacheable host mapping with
sync_for_cpu() before the pre-post check and inside the registration poll
loop in register_context().

Signed-off-by: DjDeveloperr <[email protected]>
@DjDeveloperr
DjDeveloperr requested review from a team as code owners November 28, 2026 08:43

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

HOLD at 9e8862ce48e278bbca0265d9b3925055daff0c7c.

  1. A multi-pass PB epoch can be recycled without proving firmware write-back. The firmware-visible PB counter is initialized to 1 (drivers/gpu/drm/asahi/g16/pools.rs:1404). Publication increments a host-only flight count once and advances the separate UMA counter (g16/engine.rs:3489–3496, g16/resources.rs:445–446). In the CPU pool harness, publishing a two-pass flight leaves the PB counter at 1, expected 2. On 26B123 the manager write-back is conditional on its completed-pass count equalling that counter. The final service stamp therefore does not establish write-back before g16/resources.rs:477–478 permits reuse. Publish the cumulative pass total to the manager's counter before the producer becomes visible and cover folded and repeated flights on one epoch.
  2. Recovery loses a previously supported abort receipt. With one suspect render, both stage stamps and queue receipts passed, and the FS notifier still stale, the base receipt harness returns Aborted after the grace interval. The same input on this head returns Pending. g16/poll.rs:1385–1402 exits before the grace/quarantine logic at g16/poll.rs:1439–1458. Preserve an independent stage/queue proof for suspect renders and keep the notifier as part of the full receipt. This was reproduced with mocked receipts.
  3. A failed pool insertion strands a complete record set. In g16/resources.rs:232–243 and g16/resources.rs:401–411, the mappings are made permanent before the fallible entry allocation and vector insertion. An allocation failure there leaves the complete set mapped but unreachable by subsequent checkouts. Reserve the tracking storage before mapping, or retain the set in a pool-owned entry that can be retried.

All 26 stock host suites, strict checkpatch, canonical PR text and the live merge-tree passed. The packaged J773g module matches the recorded exact-tree build. The four-boot replay covers 160 rows, 80/80 pinned CRCs and zero faults. After the fixes, the second hardware row needs T6030 or T8122 with this backend (g16/mod.rs:109–118). T6040/T6041 and G17P use a separate driver path.

@github-actions github-actions Bot added 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) labels Nov 28, 2026
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Merge readiness at 09d84a54: not ready yet

Check Detail
CI at head no failing: apple-build, host-tests, pr-text / pr-text, KUnit ane-boot, KUnit ane-pm, KUnit dcp-fabric
Review ok approved by RyanTheTide
Requested changes ok none
Hardware row at head ok in the PR body at 09d84a54
Conflicts ok none
PR text ok Risk: two-way · (low risk): strictly scoped to drivers/gpu/drm/asahi/g16/ firmware object caching classes and device-lifetime pools with zero UAPI/ABI changes. All ASC-cached mappings obey the persistent device-lifetime contract (no unmap teardown), PbRecordEntry is immutable after first exposure on each slot, client pages_gpu aliases unmap strictly before lease return, and quarantined/aborted entries never return to the pool. Cleanly revertible commit-by-commit.

Areas: area:gpu

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

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

HOLD at e6eaeef0f1f4d385ef4428ee2cc63e30989cfcd4. The cumulative PB pass counter and the retry of partially mapped record sets address the earlier findings. Two ownership and recovery paths still need attention.

  1. Idle-entry allocation failure releases the same entry twice. Both pools unlock before calling Arc::new(lease). On OOM the kernel drops the supplied lease (rust/kernel/sync/arc.rs:227, rust/kernel/alloc/kbox.rs:255), whose destructor marks the entry idle. The error arm then marks it idle again (drivers/gpu/drm/asahi/g16/resources.rs:244,448; destructors at lines 354 and 585). That second store can clear another caller's successful claim and allow two live owners of the same firmware records. Give rollback to the lease destructor alone, or allocate its storage before claiming the entry. The new test injects failures into fresh-entry construction. Its ordinary Arc::new stub always succeeds.
  2. A suspect render can start abort grace without a passed FS stage. The stale-notifier regression now passes. I also ran its negative counterpart in the CPU receipt harness: queue receipts passed, FS stage and FS notifier both one target behind, two polls 20 ms apart. The pre-series base stayed Pending; this head returned Aborted. The suspect branches bypass stage progress (drivers/gpu/drm/asahi/g16/poll.rs:1367,1393), then mark the flight doomed at line 1464. Preserve an independent stage witness for suspect renders, or establish that the queue receipts alone imply stage passage for both exact and pipelined flights. This result is from mocked receipts.

All 26 stock host suites passed, including all three named regressions, with no additional host Rust warnings. Strict checkpatch passed for all three commits and the merge-tree was clean against 0285ae51cccb. Hardware qualification still requires exact-head J773g and G15 T6030/T8122 results.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

CODE-CLEAR at 238f795dfba7da9111d845ec0e144c5d19223209. Both pools now allocate the lease before claiming an idle entry. The PB manager, misc, ring and fixed counter occupy disjoint, aligned ranges of the uncached page. Recycling a multi-pass epoch no longer depends on a conditional manager write-back. The UMA submission counter is separate, and aborted leases remain quarantined.

For suspect renders with a stale notifier, the driver synchronizes the persistent stage stamp before reading it. I reran the prior negative receipt test: an unfinished FS stays pending. Passed stages and queues with a persistently stale notifier reach abort after grace. A simulated TA stamp-sync error propagated without arming grace.

All 26 host suites passed, with no additional host Rust warnings. Strict checkpatch passed for all three commits and the merge-tree was clean against 844781f1b56b. Merge still needs the exact-head J773g four-boot ABBA and one G15 T6030/T8122 row on this backend.

Render FS queue fw_stamp is written and polled by firmware on every FS
finalize and render barrier, and is mapped ASC-cached (0x443) on macOS
26B123.

Allocate RenderGraphSession FS fw_stamp[1] as a device-lifetime
Class::FwCoherent (0x443) object in QueueSession::finish(), while
keeping TA fw_stamp[0] uncached (Class::Shared) so ta_pending_passes(),
recovery snapshots, progress sampling, and diagnostics continue to
observe per-pass TA progress across multi-pass batches without waiting
for the flight-tail TA_STAMP notifier update. Observe normal render
completion through the uncached FS_STAMP and TA_STAMP service cells
written by the notifier service after firmware descriptor and PB
bookkeeping. On post-recovery suspect renders whose uncached notifier
stamps have not settled, sync_for_cpu() and check fw_stamp[1] alongside
uncached fw_stamp[0] and TA/FS queue receipts so a still-running suspect
render never enters abort grace before both stages pass while keeping
both notifier stamps required for Retirement::Full.

Signed-off-by: DjDeveloperr <[email protected]>
Render UMA descriptors and PB manager/block/initbm records are read and
updated by firmware on every render pass and are mapped ASC-cached
(0x443) on macOS 26B123.

Add device-lifetime RenderUmaPool and PbRecordPool caches for persistent
Class::FwCoherent (0x443) render records so closed VMs never drop an
ASC-cached mapping:
- RenderUmaPool pairs ASC-cached descriptor (0x443) with uncached
  submitted (Class::Fw, 0x44b). Allocator resets the descriptor and
  submitted counter on reuse and leaves the lease settled only after all
  published flights retire normally without quarantine.
- PbRecordPool pairs one 16 KiB ASC-cached cached_records page
  (per-slot pb_mgr array for 0..PB_SLOTS at 256-byte cache-line-isolated
  stride plus firmware-read-only initbm) and ASC-cached blocks with a
  persistent context-0 Class::Shared pages object assigned a globally
  unique client pages_gpu address in hw::client::DYNAMIC, plus uncached
  ring, counter, and misc (Class::Fw). Each PbEpoch maps pages into its
  VM via Objects::map_client_at() and drops _objects before releasing
  records_lease so no VM holds a client alias when a record set returns
  to the pool.
- Once a hardware PB slot k is exposed on a PbRecordEntry, the entry is
  permanently bound to its (layout, heap_gva, heap_blocks) and the host
  never writes to slot k's ASC-cached pb_mgr or to blocks again: static
  fields stay invariant per set and slot, firmware's InitBM resets live
  cursors on the ASC-cached line itself, and counter stays at 1 to avoid
  per-flight hardware PB unloads. Standby reservations track per-heap
  sizes across PB heap growth so concurrent jobs never starve.

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

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

Blockers: none (wait for the queued CI checks to finish green and run a second-Mac regression smoke before landing).

Checked:

  • Three-commit ASC-cached (0x443) g16 series (a295a526 shared sched_ctx, 0bac8ba3 render FS fw_stamp[1] keeping TA fw_stamp[0] uncached, cf33fcdd render UMA descriptors and PbRecordSet PB records with globally unique bounds-checked pages_gpu and _objects-before-records drop ordering).
  • Tests & exact-head hardware row: run-host-tests.py 26/26 PASS (80/80 test-resources.py covering zero-write recycle, cross-slot isolation, wrong-binding rejection, drop order); J773g (T8132/G16G) exact-head 4-boot mirrored ABBA (20 workloads, 160 timed records, 80/80 pinned CRCs, 0 recoveries, 0 hang kills).
  • Checked for Apple material, tool attribution, private serials, and gating: clean; MERGEABLE on main.
Evidence
  • Head: cf33fcddeb3e (base: main, mergeable: MERGEABLE, +2335/-300 across 12 files).

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

CODE-CLEAR at cf33fcddeb3e98dd62561eaf9bc804829ca69609. I found no blockers in the three commits. Merge still needs one G15 hardware row on this backend at this head (see the last section).

Checked

  • FS stamp: every host read of render fw_stamp[1] either moved to the uncached notifier FS_STAMP or syncs first.
    • Moved: completion, the oldest-render check, progress sampling, the diagnostic dump and recovery_snapshot().
    • Synced: the two recovery-suspect reads (g16/poll.rs:1380, :1423).
    • The host never writes this stamp. Firmware barriers still use its VA.
    • Reading the notifier in recovery_snapshot() can only mark an already-finished render as suspect. It can never make an unfinished one look complete.
    • TA fw_stamp[0] stays uncached.
  • Scheduling context: the only reads are in register_context(), and both sync first. Nothing uses its VA before Graphs::finish().
  • Exposed pb_mgr slots: once a slot's bit is set, no host path writes that slot's pb_mgr. Once the set is bound, none writes blocks.
    • This holds across prepare, pool reuse, recovery, sleep restart (Pools::invalidate()), reclaim and quarantine.
    • An aborted or quarantined set never returns to the pool.
    • The 20 slots at 256 B, plus InitBM, fit in one 16 KiB page on separate cache lines.
  • pages_gpu stays inside DYNAMIC. Nothing else maps there now that alloc_dynamic_client() is unused. Each address belongs to one set, mapped into one VM at a time.
  • Drop order: PbEpochInner has no Drop impl and no ManuallyDrop field, so _objects drops before records_lease (g16/pools.rs:1280, :1285). KernelMapping::drop unmaps and flushes the TLB synchronously, so the client alias is gone before the lease can return to the pool.
  • Locking:
    • The pool mutexes only wrap process-context allocation.
    • Lease Drop only does atomic stores.
    • The standby spinlock is never held across an allocation or an epoch drop.
  • UMA retirement now uses the host-side retired_submitted, which is stricter than reading COMPLETED. publish_batch() and the poll use the same per-flight f.renders.
  • Local results:
    • run-host-tests.py: 26/26 pass.
    • checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks on all three commits.
    • Sign-offs are valid, with no tool trailers.
    • git merge-tree against live origin/main 844781f1b56b is clean, and main's 39 new commits don't touch g16/.

Follow-ups (not blocking)

  1. The PB record-set pool never shrinks.
    • Each set pins about 96 KiB until reboot: 16 KiB cached records, 16 KiB uncached records, 32 KiB pages and 32 KiB blocks.
    • DYNAMIC holds 10,922 sets (512 MiB / 48 KiB). The per-VM epoch budget (256) times MAX_VMS (63) allows 16,128.
    • A local client that queues fence-blocked renders across many VMs can therefore pin about 1 GiB permanently.
    • Once DYNAMIC runs out, take_for() returns ENOMEM to every other client that needs a new set (g16/resources.rs:534).
    • Base kept pages in each VM's own DYNAMIC and freed it with the epoch.
    • A device-wide cap on sets, with the same wait-for-credit behaviour as Budget, would bound both problems.
  2. take_for() and take_standby_for() claim a set by bound_blocks only (g16/resources.rs:467, :1680).
    • prepare_with_scs_for() also checks the heap GVA and layout, and fails the render with EINVAL on a mismatch (g16/engine.rs:2641).
    • That is safe today: the heap is always client::pb_heap(0), and the layout comes from the device ABI.
    • If either ever varies, claim on the full binding instead.
  3. slot_exposed is an AtomicU32 indexed with 1u32 << k. Add const _: () = assert!(sizes::PB_SLOTS <= 32); next to the stride asserts.

Hardware still owed

  • The host cannot prove three firmware behaviours this relies on:
    • InitBM resets the cursors of an exposed pb_mgr.
    • Firmware never writes blocks.
    • COMPLETED advances before FS_STAMP.
  • The exact-head J773g run (T8132, G16G; 4-boot ABBA, 0 faults, 80/80 CRCs) covers G16 only.
  • This backend also claims T6030 and T8122 (the g16/mod.rs OF table and the T8122 path in driver.rs).
  • So merge needs one exact-head G15 row on J516s (M3 Pro, T6030 G15S) or on a T8122 (M3, G15G) board.
    • Run with SLC on.
    • Include a VM close/reopen cycle so recycled, already-exposed record sets get reused.
  • T6040/T6041 and G17P use a separate driver path and are unaffected.
  • CI at this head is still queued. Nothing has failed so far.

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) and removed needs-hw-row No hardware row at the PR head (bot) labels Nov 28, 2026
@DjDeveloperr

DjDeveloperr commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor Author

PASS — J516s (M3 Pro, T6030 G15S) second-generation row at cf33fcddeb3e98dd62561eaf9bc804829ca69609. One-shot boot of 7.3.0-m3-maint-gcf33fcddeb3e with the PR's own J516s DTB, the stock kernel command line, and 27.2 firmware.

  • SLC on. All six MCC planes reported 0x2100 with 16 data and 16 tag ways each.
  • CRC parity. gpubench-vk cba9025 and Mesa 69179743d9ae passed 90/90 rows across two runs. All 44 CPU-pinned CRC results matched, including all 20 results with J773g pins. The four compression self-checks passed.
  • VM close and reopen. All 48 sequential Vulkan processes exited successfully, each with postfx MSAA4 CRC 668d6f0a. The observer recorded 144 successful DRM VM creates. The driver counted one fresh InitBM epoch per process and showed zero user VM handles after every exit. The sequence continued beyond the 16 warm PB slots to exercise reuse of previously exposed PB records.
  • GPU and system health. Zero faults, recoveries, hang kills, quarantines, new dmesg errors during testing, or failed units. The recurring HID no-listener and Wi-Fi ring messages were already present before the workload. The sampled Vulkan CTS cases returned 914 Pass, 274 NotSupported, and 0 Fail.
  • Restored and verified stock Linux 7.3.0 with SLC on and zero failed units. Released m3hw.

J516s second-generation row, 30 Nov: PASS. 44/44 rows passed, 22/22 pinned CRCs matched, and both compression structural checks passed. Pins included compute.uber uniform b022fbaf, postfx MSAA4 668d6f0a, and bindless UBO 1af53d5c. Zero GPU faults, recoveries, hang kills, compute/render quarantines, or failed units.

M3 Pro J516s (T6030, G15S), 30 Nov 2026. Both arms used their own one-shot kernel and matching aurora.ko built from the same source commit, SLC on (all six planes), Borealis 69179743d9ae, and GPUBench cba9025d3fd9. Baseline kernel/driver source was main e6c7b032633cd0018a90bfc8fe6fb9f3bc3890f9. Tested at 3692d7e712891572aed8b053a870528868519ffe. The current head 09d84a54f23fe47dc473607ba26d367225742578 differs only by a merge from main that touches none of this PR's files.

Staged aurora.ko SHA-256: main 456f346552b20a12d28ab2b53bdf59027ba03769c3224cd010fd7747dbb21f6f, PR da7df1d1c5ddbdb7b381d0b79ae60c4b4f9ce3d28429a245946dc55269b43d36.

Two-pass wall-time smoke measurements vs baseline: compute.uber uniform d4 +0.1%, compute.light d16 −6.7%, render.light tri d8/d16/d64 −13.1%/−13.8%/−16.1%, postfx MSAA4 d2 −1.2%, bindless UBO d1/d2 −3.3%/+1.8%, and mixed compute/render d4 −10.1%.

Evidence on the controller is in work/m3pro-bringup-20261124/rows-render3-e6c7b032/evidence-20261130T112653Z-qxQe5jS7/RESULTS.md, with raw rows and stages.tsv in the same directory.

@github-actions github-actions Bot added merge-conflict Conflicts with the base branch (bot) and removed ci-failing A check failed at the PR head (bot) labels Nov 29, 2026
@github-actions github-actions Bot removed the merge-conflict Conflicts with the base branch (bot) label Nov 30, 2026
@github-actions github-actions Bot added the needs-hw-row No hardware row at the PR head (bot) label Nov 30, 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: HOLD at 3692d7e7

Blockers:

  • Hosted CI at 3692d7e7 is still pending (18 queued jobs: apple-build, host-tests, and KUnit suites).
  • Exact-head 3692d7e7 hardware receipt or hwok carry-forward is still needed (needs-hw-row flagged by pr-readiness after the main merge).

Checked:

  • Forward-merge cleanliness (+2334/-302 across 12 files): 3692d7e7 cleanly merges main (e6c7b03263) onto the previously approved 3-commit ASC-cached series (a295a526 shared sched_ctx, 0bac8ba3 render FS fw_stamp[1], cf33fcdd render UMA descriptors and PbRecordSet PB records), preserving sync_for_cpu guards on sched_ctx and recovery-suspect fw_stamp[1] reads.
  • Prior hardware evidence (cf33fcdd): both J773g (M4, G16G) and J516s (M3 Pro, T6030 G15S — 90/90 gpubench-vk CRC parity across two runs, 0 GPU faults) passed.
Evidence
  • Merge-order note (non-blocking): g16/engine.rs:914 and g16/poll.rs:924,1379,1384 read g.notifier.r32(notifier_page::{TA,FS}_STAMP) and notifier::CONTEXT. If #3298 (which maps RenderGraph.notifier Class::FwCached and moves those stamps to g.user_stamp[0/1]) merges first, this branch will need to switch those reads to g.user_stamp[0/1] and drop the cached notifier::CONTEXT reads when merging main.
  • Ready condition: Upgradeable to APPROVE as soon as the 18 queued CI checks complete green and the 3692d7e7 hardware-row / carry-forward check clears.

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

PASS — J773g (M4 mini, T8132 G16G) target row at 3692d7e712891572aed8b053a870528868519ffe. On every render row this PR targets, it is faster than main in every boot, outputs match and there are no GPU faults.

aurora.ko was built from this head's driver on the main 42169a04 kernel. That kernel has the same drivers/gpu/drm/asahi as e6c7b032, the main this head merges. Boot order: main, this PR, this PR, main. Setup: SLC on both planes, Borealis Mesa 5e89c89ce5, gpubench-vk ae90a40, 300 ms warmup, 5 × 250 ms windows, two passes per boot. Values are the median µs per submission (lower is better); overlap is a ratio (higher is better).

Row main this PR Δ every boot
render.light tri d8 62.12 59.15 −4.8 % faster
render.light tri d16 57.92 53.98 −6.8 % faster
render.light tri d64 51.70 47.88 −7.4 % faster
render.postfx msaa4 1080p d1 758.74 724.18 −4.6 % faster
render.postfx msaa4 1080p d2 684.47 642.28 −6.2 % faster
render.bindless_ubo 512 ubo_vec4 d2 166.68 159.60 −4.3 % faster
render.mdi bindless 256, 1024 draws d4 113.82 110.95 −2.5 % faster
render.shadow d32f depth-only 2048 d1 / d2 699.36 / 451.99 690.15 / 450.08 −1.3 % / −0.4 % faster
render.shadow d16 depth-only 2048 d1 / d2 730.00 / 450.89 728.34 / 450.46 −0.2 % / −0.1 % overlaps
render.deferred tile msaa4 1080p d2 289.27 288.93 −0.1 % overlaps
compute.light procs d8 40.57 38.87 −4.2 % faster
compute.light queues d8 31.97 31.99 +0.1 % overlaps
overlap.passes render_render d2 (ratio) 1.10 1.08 −1.6 % lower

Correctness on all four boots:

  • Every render row above carries its readback CRC, and all match.
  • The pinned-CRC smoke matched 10/10 per boot: compute.uber uniform d4 b022fbaf, render.postfx msaa=4 d1/d2 668d6f0a, render.bindless_ubo 512 d2 1af53d5c, render.deferred tile msaa=4 d2 6dc74b48.
  • 0 GPU faults, recoveries, hang kills or quarantined owners. Each boot returned to the saved stock kernel.

The only row that moved the wrong way is the render-pass overlap ratio (1.10 → 1.08). It's small and outside this PR's scope. It is being investigated separately as the remaining M4 render gap to Metal (Metal 1.37).

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Nov 30, 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: HOLD at 09d84a54

Blockers:

  • Hosted CI workflows (apple-build, host-tests, and KUnit suites) are still queued/running at 09d84a54.
  • Exact-head 09d84a54 hardware row or hwok carry-forward (pr-readiness requires the current head SHA after the main merge).

Checked:

  • Forward merge 09d84a54 (3692d7e7..09d84a54): only unrelated drivers/accel/ane/* and include/uapi/drm/ane_accel.h files entered from main; zero changes to drivers/gpu/drm/asahi/ relative to the previously audited and hardware-tested 3692d7e7 tree (J773g G16G target row at 3692d7e7 and J516s G15S second-generation row at cf33fcdd).
Evidence
  • Code remains clean across all 12 touched files (+2334/-302). Ready to approve once hosted CI at 09d84a54 finishes green and the head SHA is recorded with hardware acceptance.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Merge-train approval (last-push review of the merge-up delta, per the merge bar: better than before, doesn't break). 09d84a54 only merges current main into 3692d7e7, which is where the J773g target row passed; J516s (T6030 G15S) second-generation row at cf33fcdd. Merging once hosted CI is green.

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

PASS — J773g (M4 mini, T8132 G16G) exact-head row at 09d84a54f23fe47dc473607ba26d367225742578. Faster than main on the render rows this PR targets, with all outputs matching and no GPU faults.

  • Kernel: main dbfbced7 with this head's driver. The source tree with the head applied was checked equal to 09d84a54's tree (df13da4a); the head is 0 behind dbfbced7, and its only other change is host selftests. Borealis 285776c6af, gpubench 868b0644, SLC on both planes.

  • Results, µs/submit, two passes on one boot, against main measured on the same Mac today:

    Row main this head change
    render.bindless_ubo 512 ubo_vec4 d2 166.8 153.5 / 152.3 −8.3 %
    render.postfx msaa4 1080p d2 677.5 625.0 / 626.6 −7.6 %
    render.light tri d64 51.5 46.7 / 45.9 −10 %
    compute.uber uniform d4 178.4 171.4 / 171.4 −3.9 %
    render.shadow d16 depth_only d2 451.3 448.8 / 447.2 flat
    render.deferred tile msaa4 d2 289.0 289.4 / 289.4 flat
  • Pinned CRCs: 10/10 match (668d6f0a, 1af53d5c, 6dc74b48, b022fbaf, plus c0fb9993 for shadow). 0 GPU faults, recoveries or hang kills.

  • Separate timeline boot, same head driver with lab-only completion timestamps: the per-submit gap between one render finishing and the next starting shrinks inside the firmware. On bindless_ubo d2 it drops from 108 to 100 µs, on postfx d2 from 256 to 236 µs, and the postfx frame's GPU span from 417.5 to 387.6 µs. That's where the time comes from; host-side time is unchanged. Light d8 −7.8 %, mdi d4 −3.3 % on that boot.

  • Afterwards: the Mac returned to its saved stock kernel and passed the stock checks.

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) and removed needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 1, 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 09d84a54f23f

Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.

Checked: - Forward merge 09d84a54 (3692d7e7..09d84a54): only unrelated drivers/accel/ane/* and include/uapi/drm/ane_accel.h files entered from main; zero changes to drivers/gpu/drm/asahi/ relative to the previously audited and hardware-tested 3692d7e7 tree (J773g G16G target row at 3692d7e7 and J516s G15S second-generation row at cf33fcdd).

Follow-ups (not blocking): queued CI; hwok carry-forward to head

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging at 09d84a54f23f (B2 merge train, 12-01 merge bar). Approval at this head: RyanTheTide,aurora-silicon-review[bot]. Row: J773g (M4 mini, G16G) exact head 09d84a5 PASS (Dj) + J516s at cf33fcd. CI: linux train L1 = main 595e754 + #3503 #3499 #3240 #3208 #3696 #731 #2634 #2110 #3325 #3441 #3650 (candidate ef98b31c): Apple driver compile (defconfig + asahi.config, LLVM=1, Rust) pass, Apple DTBs W=1 pass, planned KUnit clpc/dcp-fabric/dcp-topology/dcp-display/pmgr-pwrstate/mt7932/asahi all pass; host-tests green (or path-skipped) at this head. The rest of the hosted run is queued behind the ~19 h backlog. Revert: git revert -m 1 <merge commit>.

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) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants