Skip to content

drm/asahi: g17: expand single-pair M5 render depth to 64 - #3411

Merged
DjDeveloperr merged 10 commits into
mainfrom
perf/g17-render-depth-64
Dec 4, 2026
Merged

DjDeveloperr merged 10 commits into
mainfrom
perf/g17-render-depth-64

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

What:
Derive per-device G17 render queue depth from hardware capacity in pairs::render_depth_for(pairs_per_owner, scratch_slots) so single-pair queues whose scratch/scene-table capacity already provides 64 slots (SCRATCH_SLOTS = 64, SCENE_TABLE_ENTRIES = 64) use RENDER_DEPTH_MAX (64) instead of capping at 32, while multi-pair or smaller-capacity queues retain RENDER_DEPTH (32). Plumb the derived depth through Backend::render_depth(), Scheduler credits, admission::Pool, compact window sizing, Target slots, Memory graph layout (128 KiB graph + 64 KiB config ring), and retirement::Tracker. Move depth-scaled inline arrays (Graph::owners, Memory::generations, Target::slots, Retired::owners, Dependencies::entries, Tracker::entries) to pre-allocated KVec storage allocated off-lock so kernel stack frames stay smaller than origin/main across allocation, submission, parking, and teardown paths. Add tools/asahi/g17-render-depth-tests.py and register it in tools/asahi/run-host-tests.py.

Tested:

  • J714s M5 Pro (G17S B1) at exact head f4607a228ded: candidate 7.3.0-m5-pr67 carries both commits' driver changes unchanged (identical changed lines in drivers/; only the host-test files differ), stacked with drm/asahi: g17: support staged and compute-prefixed renders in render_direct() #3388, drm/asahi: g17: allow inline cross-engine publication behind already-published producers #3390, drm/asahi: g17: run drm_sched submit workqueues at WQ_HIGHPRI #3391, drm/asahi: g17: batch report-ring drains and skip redundant render re-observe #3428 and the first commit of drm/asahi: g17: allow compute_direct() on mixed render/compute contexts #3429, origin/main DTB. VK CTS 594 passed, 7 not supported, 0 failed (occlusion_query copy 152/159, concurrent_queries 2/2, multiview queries 16/16, synchronization smoke 12/12, synchronization2 *read_image_compute* 412/412); GTA V Enhanced 3024x1964 Very High TAA ran clean on Mesa kits inst-A (P4 55.76 FPS) and inst-R (P4 58.03 FPS); GPU online, 0 crashed, 0 faults.
  • J700 MacBook Neo (G17P B1) at exact head f4607a228ded: row in the comments, PASS, 0 failures, 0 GPU faults or recoveries.
  • Head SHA: d3c3279f2cdcfb9787f5bd92ccdd4deeedffcd9a
  • Local host tests (tools/asahi/run-host-tests.py --only g17-): 232/232 PASS (including all mutations and new g17-render-depth-tests.py).
  • scripts/checkpatch.pl --strict --ignore FILE_PATH_CHANGES: 0 errors, 0 warnings, 0 checks.
  • llvm-objdump stack-frame audit (asahi_core.o vs origin/main): every render allocation, submission, parking, and teardown frame shrinks (Registry::reclaim_unused_render_spare 8,256 -> 2,352 B, teardown::Service::detach 9,040 -> 3,216 B, Gpu::new_queue 19,168 -> 13,360 B, Memory::new 9,504 -> 6,608 B, Backend::render_with_lease 5,312 -> 3,200 B, Pair::prepare 2,688 -> 2,096 B).
  • Hardware (J714s, Apple M5 Pro / G17S B1, origin/main DTB SLC-off, Mesa inst-A 8643d38a0c91, stacked on #3380 + #3388 + #3390 + #3391 as 7.3.0-m5-depth64 vs slot3-direct control):
    • VK CTS (5 suites): 594/594 PASS, 0 Fail (occlusion_query.copy_* 152/159 [7 NotSupported], concurrent_queries.* 2/2, multiview.queries.* 16/16, synchronization.smoke.* 12/12, synchronization2.op.single_queue.barrier.*_read_image_compute* 412/412).
    • gpubench-vk compute.cull_mdi (objs=16384, visible=75): d1 1041.67 us/submit, d2 888.10 -> 883.39 us/submit (gpu_gap_us 0.375 us, ok).
    • chainbench_diag (14 passes): V0_ALL_BAR 60x33 306.7 us (21.90 us/pass), V1_FRAG_IMG_BAR 269.3 us (19.24 us/pass), V5_ALL_BAR_LOAD 267.4 us (19.10 us/pass).
    • GTA V Enhanced (3024x1964 native, Preset 2 Very High, TAA On, ResScalingType=0, no FSR/DLSS, origin/main DTB SLC-off, 10 s 24 MHz GPU hop trace):
      • GPU busy: 94.99% -> 97.66% (+2.67 pp; GPU idle 501.5 -> 234.2 ms, -53.3%).
      • >1 ms GPU blackouts: 91 (222.4 ms) -> 1 (1.2 ms) (-99.5%).
      • >3 ms GPU blackouts: 21 (78.0 ms) -> 0 (0.0 ms) (-100.0%); max GPU idle gap 5.13 -> 1.20 ms.
      • FR->TA idle: 208.8 -> 14.0 ms (-93.3%); peak concurrent renders 34 -> 66 (7,261 samples above depth 32).
      • Benchmark P4 FPS (inst-A, SLC-off): 55.07 -> 55.97 FPS (+0.90 FPS; P0=59.31 P1=54.42 P2=53.49 P3=59.85 P4=55.97); bonus run on kit R (aurora-wip 5ab97d0 + #1216, still SLC-off) reached P3=61.71 / P4=57.92 FPS.
    • GPU health: online=1, crashed=0, quarantined=0, 0 GPU faults, 0 kernel errors/WARNs across CTS + microbenchmarks + two full GTA V runs.

Risk: two-way · J714s

Not yet:

  • Nothing known.

Single-pair M5 render queues currently cap in-flight depth at 32
(RENDER_DEPTH = 32), matching the per-pair depth of dual-pair G17P
queues even though each M5 owner holds only one physical render pair
whose scratch/scene-table capacity already provides 64 slots
(SCRATCH_SLOTS = 64, SCENE_TABLE_ENTRIES = 64). Under render-heavy
workloads such as GTA V Enhanced (~55-80 renders per frame), capping
a single-pair queue at 32 stalls admission mid-frame whenever the
render pipeline has >32 commands queued.

Derive per-device render depth from hardware capacity in
pairs::render_depth_for(pairs_per_owner, scratch_slots): single-pair
queues with >= 64 scratch slots use RENDER_DEPTH_MAX (64), while
multi-pair or smaller-capacity queues keep RENDER_DEPTH (32). Plumb
the derived depth through Backend::render_depth(), Scheduler credits,
admission::Pool, compact window sizing, Target slots, Memory graph
layout (128 KiB graph + 64 KiB config ring for 64 announce/config
records), and retirement::Tracker.

Move large depth-scaled arrays (Graph::owners, Memory::generations,
Target::slots, Retired::owners, Dependencies::entries, and
Tracker::entries) to pre-allocated KVec storage allocated off-lock so
expanding depth to 64 keeps kernel stack frames smaller than baseline
across allocation, submission, parking, and teardown paths.

Add host contract tests in tools/asahi/g17-render-depth-tests.py and
register them in tools/asahi/run-host-tests.py.

Signed-off-by: DjDeveloperr <hey@djdev.me>
@DjDeveloperr
DjDeveloperr requested review from a team as code owners November 27, 2026 16:59

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

Blockers: The recovery-storm forgiveness budget is changed globally from 32 to 64, including on devices whose per-pair depth stays at 32. The guard's stated budget is one per group a pair can hold. Please use the active depth for that budget or justify and test the expanded recovery policy independently. Cover both capacities, including the final un-forgiven event and the latched stop. Please also report the deepest supported call-chain stack total for queue creation. The published frame comparison still reports a 13,360-byte new_queue frame by itself, and individual frame reductions do not establish headroom through callees.

Checked: The submission depth is derived from pair count and scratch capacity, with distinct credits and storage sizing paths. The reported J714s saturation row covers the 64-deep path in the stated integration stack. A peer exercising unchanged-depth queue creation and recovery remains pending.

Evidence

recovery/safety.rs now uses RENDER_DEPTH_MAX unconditionally, while pairs.rs retains a separate 32-depth policy. The existing forgiveness test follows the same global constant and cannot distinguish the two cases.

…ueue in place

Address review feedback on per-device render depth expansion:

1. Keep recovery-storm forgiveness in recovery/safety.rs bounded by each
   device's active render depth instead of raising it globally to
   RENDER_DEPTH_MAX (64). Storm::new() retains the 32 default and
   Storm::with_forgive_limit() accepts the active depth derived from
   pairs::render_depth_for_device(shared.variant.m5_commands) in boot()
   and boot_m5(). Extend both the KUnit test and compiled host tests
   (tools/asahi/g17-render-depth-tests.py, with global-forgive-64 and
   m5-stuck-32 mutations registered in run-host-tests.py) to cover both
   32 and 64 capacities, including the final un-forgiven restart and
   permanent latched stop.

2. Return KBox<Queue<B>> directly from Queue::new() using KBox::try_init
   and in-place Proof::init() so Queue<B> and its 128-entry cached proof
   array never sit on Gpu::new_queue()'s stack before boxing. This drops
   Gpu::new_queue()'s own frame from 19,168 B (origin/main) / 13,360 B to
   5,984 B, and cuts the deepest ASAHI_QUEUE_CREATE -> Gpu::new_queue ->
   Context::new -> ... -> Ledger::reserve call-chain stack total inside
   asahi_core from 24,800 B (24.22 KiB) to 11,584 B (11.31 KiB).

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

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: HOLD at f4607a22 pending hosted CI and final-stack hardware evidence. The new head addresses my code findings.

Checked: Both startup paths pass the calculated active render depth to the restart storm counter. Timeout forgiveness retains its existing default. The compiled host fixture covers both budgets, exhaustion, reset and the latched stop. Queue construction now calls the in-place proof initializer and returns the boxed queue directly.

Evidence

The author's commit reports an in-driver queue-create call chain reduced from 24,800 B to 11,584 B, with the entry frame down to 5,984 B. The scope is the driver call chain. The PR body still reports test results for the preceding head. Please attach hosted checks and final-stack qualification for the J714s 64-depth path and the J700 32-depth control.

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Addressed both blockers in fast-forward commit f4607a228dedcad083f1353322930b3854a920f9:

  1. Per-device recovery-storm forgiveness budget (recovery/safety.rs, recovery.rs, mod.rs):

    • Replaced the global RENDER_DEPTH_MAX forgiveness constant with a per-instance Storm::forgive_limit (Storm::new() keeps the 32 default; Storm::with_forgive_limit() takes the active depth from pairs::render_depth_for_device(shared.variant.m5_commands) in both boot() and boot_m5()).
    • Extended both the KUnit test in recovery/safety.rs and the compiled host test in tools/asahi/g17-render-depth-tests.py (with global-forgive-64 and m5-stuck-32 mutations registered in tools/asahi/run-host-tests.py) to verify both 32-deep and 64-deep budgets, including the (limit + 1)-th un-forgiven restart, reaching LIMIT, permanent stop latching across WINDOW_NS, and fresh-window reset before stop.
  2. In-place Queue / Proof initialization and full call-chain stack audit (queue/mod.rs, validation.rs, mod.rs):

    • Queue::new() now returns Result<KBox<Self>> via KBox::try_init + in-place Proof::init(), eliminating the stack copy of Queue<B> (and its 128-entry Proof array) in Gpu::new_queue().
    • Full relocation-resolved llvm-objdump -dr call-chain stack totals inside asahi_core (origin/main vs f4607a228dedc):
      • ASAHI_QUEUE_CREATE -> Gpu::new_queue -> Context::new -> Pool::allocate -> Allocator::kernel -> KernelObject::placed -> Vm::map_in_range_with_mode -> VmInner::map_node -> UatPageTable::prepare_map -> alloc_pages -> walk_inner -> Ledger::reserve: 464 + 24,336 = 24,800 B (24.22 KiB) -> 464 + 11,120 = 11,584 B (11.31 KiB) (-13,216 B; Gpu::new_queue own frame 19,168 B -> 5,984 B, callee subtree 5,168 B -> 5,136 B).
      • Backend::render_with_lease -> ensure_render -> build_render_pair -> install_fresh_pair -> Pair::new -> Memory::new -> buffer::Manager::new -> Allocator::kernel -> ... -> Ledger::reserve: 28,176 B (27.52 KiB) -> 21,792 B (21.28 KiB) (-6,384 B).
      • Registry::reclaim_unused_render_spare -> Pair::park -> drop glue -> UatPageTable::reprot_pages -> ...: 11,168 B (10.91 KiB) -> 5,216 B (5.09 KiB) (-5,952 B).
      • teardown::Service::detach -> Pair::park -> drop glue -> UatPageTable::reprot_pages -> ...: 11,952 B (11.67 KiB) -> 6,080 B (5.94 KiB) (-5,872 B).

Verified drivers/gpu/drm/asahi/ builds clean, tools/asahi/run-host-tests.py --only g17- passes 234/234 (including both new mutations), and scripts/checkpatch.pl --strict --ignore FILE_PATH_CHANGES reports 0 errors, 0 warnings, 0 checks.

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

J700 (MacBook Neo, Apple A18 Pro T8140 / G17P B1, second generation) exact-head kernel verification row at f4607a228dedcad083f1353322930b3854a920f9: PASS (no regression, 0 failures, 0 GPU faults/recoveries).

  • Tree & depth-predicate check (7.3.0-neo-pr3411, exact head f4607a228dedcad083f1353322930b3854a920f9):
    • On G17P B1 (m5_commands = false), pairs::render_depth_for_device(false) passes SCRATCH_SLOTS = 36 (0x24 < RENDER_DEPTH_MAX = 64) with per_owner() == 1 (single-pair), so the hardware capacity predicate (pairs_per_owner == 1 && scratch_slots >= RENDER_DEPTH_MAX) cleanly retains RENDER_DEPTH = 32 while exercising the per-device Storm::with_forgive_limit(32), in-place KBox::try_init Queue/Proof initialization, and all six pre-allocated KVec depth-scaled structures on live G17P hardware.
    • Host tests on exact head: python3 tools/asahi/run-host-tests.py --only g17- passed 234/234 (12 s, including g17-render-depth-tests and its global-forgive-64 and m5-stuck-32 mutations).
  • Setup & identity:
    • Built from exact head f4607a228dedcad083f1353322930b3854a920f9 with stock 7.3.0-41 config + LOCALVERSION=-neo-pr3411 (0 build errors).
    • Booted via one-shot grub2-reboot only with a 16-minute fallback timer; default entry remained 7.3.0-41.fc44.aurora.aarch64. System Mesa, stock kernel command line (0-byte diff vs stock).
    • Verified on boot (85d7e050): uname -r = 7.3.0-neo-pr3411, kernel build ID d59af6f370a985a09393ae222db8b5872ff32bc5 (MATCH), aurora.ko build ID 89e525745bcc3c95cdea0783bd255f64ac845d48 (MATCH).
  • VK CTS (6 jobs, 37,886 cases in 185 s): 31,611 Pass, 6,275 NotSupported, 0 Fail, 0 recoveries (gate rc 0):
    • dEQP-VK.synchronization{,2}.* (basic, smoke, single-queue, timeline semaphore, implicit, none_set_reset, internally synchronized objects, plus all synchronization2.*_read_image_compute*): 31,242 Pass, 6,178 NotSupported, 0 Fail (37,420 total; of which synchronization2.*_read_image_compute* is 5,100 Pass, 5,806 NotSupported, 0 Fail).
    • dEQP-VK.compute.pipeline.basic.*: 79 Pass, 2 NotSupported, 0 Fail.
    • dEQP-VK.api.command_buffers.*: 65 Pass, 66 NotSupported, 0 Fail.
    • dEQP-VK.renderpass{,2}.suballocation.subpass_dependencies.*: 73 Pass, 22 NotSupported, 0 Fail.
    • dEQP-VK.query_pool.occlusion_query.copy_*: 152 Pass, 7 NotSupported, 0 Fail.
  • gpubench-vk (fdf4dd6, system Mesa, 20/20 rows ok, all CRCs matched same-slot stock 7.3.0-41 pre-boot baseline):
    • render.light d1/d8/d32 (deep-queue d32): ok, us/sub 130.7 / 31.1 / 29.2 µs (stock 124.9 / 29.2 / 27.4 µs).
    • render.deferred (tile msaa=4 1080p d1/d2): 5e4130ce (match), GPU 10610.4 / 10529.8 µs (stock 10798.2 / 10724.9 µs).
    • render.postfx (msaa=4 1080p d1/d2): 668d6f0a (match), us/sub 771.2 / 556.6 µs (stock 755.7 / 550.5 µs).
    • render.pass_chain (all_bar d1/d4): 93411763 (match), us/sub 550.5 / 371.7 µs (stock 514.6 / 451.1 µs).
    • render.pass_chain (oq_bar d1/d4): 93411763 (match), us/sub 854.7 / 1214.6 µs (stock 783.3 / 857.1 µs).
    • render.mdi (draws=1024 bindless=1024 d1/d4): 3ba813b3 (match), us/sub 507.6 / 193.2 µs (stock 463.0 / 130.3 µs).
    • compute.heavy (alu d1/d4): ok, us/sub 1351.4 / 1181.1 µs (stock 1382.5 / 1181.1 µs).
    • compute.light d1/d8: ok, us/sub 107.5 / 17.0 µs (stock 102.5 / 15.9 µs).
    • compute.cull_mdi d1/d4: 57276de2 (match), us/sub 9677.4 / 1886.8 µs (stock 5263.2 / 1840.5 µs).
    • sync.signal (compute.light d1): ok, latency p5/med/p95 137.6 / 150.8 / 164.2 µs (stock 140.4 / 145.5 / 152.5 µs).
    • Note: stock 7.3.0-41 predates the PR base (94ea195b6eb59), so this row serves as a second-generation correctness/CRC/stability verification rather than a merge-base perf A/B.
  • Kernel health & restore:
    • 0 GPU faults/recoveries, 0 MMU faults, 0 WARN/BUG/Oops/stack-overflow/KASAN/lockup/RCU-stall/timeout lines, 0 new kernel error lines, 0 AVC denials, 0 failed units, 0 core dumps.
    • Restored cleanly to stock 7.3.0-41.fc44.aurora.aarch64 (boot ca169f7b, PMU f701/f702 = 30 00); trial /boot, /lib/modules, BLS entry, and fallback timer removed, stock.sh POST vs PRE diff = 0 bytes.

@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 27, 2026
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Merge readiness at 2c100334: not ready yet

Check Detail
CI at head ok 9 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok comment at 2c100334
Conflicts ok none
PR text ok Risk: two-way · J714s

Areas: area:gpu

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

Resolve Queue::new(): keep the in-place pinned init from this branch and add the scratch field main introduced.

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

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The forward merge resolves the conflict and retains the active-depth recovery budget. The depth fixture is byte-identical to f4607a2. The integrated queue now also includes main’s work-state batching and retirement changes, so the prior J714s result supports the depth change but does not establish the combined path. Please post the current-head build and a focused J714s depth-above-32 run with stable retirement and no recovery faults.

RyanTheTide
RyanTheTide previously approved these changes Dec 1, 2026

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

Reviewed the conflict-pass merge commit 3d80607 only: queue/mod.rs gets Scratch::default() for main's new field; runtime.rs union. The resolution keeps what each side had and adds nothing outside the conflict. Approved for the merge-up; merging still waits on CI and the rows at this head.

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) needs-hw-row No hardware row at the PR head (bot) and removed merge-conflict Conflicts with the base branch (bot) 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 3d8060737511

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: Code reviewed in the earlier App review at this head (6122455008).

Follow-ups (not blocking): current-head build, J714s depth>32 run with stable retirement

@github-actions github-actions Bot added the merge-conflict Conflicts with the base branch (bot) label Dec 1, 2026
Initialize the per-engine failure logs inside the pinned Queue
initializer. Keep the 32-slot render template assertion and the
separate M5 render depth limit.

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

Copy link
Copy Markdown
Contributor Author

Forward-merged main 664b5dbe4182 as 69bc5a2a7e04. In queue/mod.rs, the pinned queue initializer now also initializes main's per-engine failure logs. In queue/render/memory.rs, the 32-slot non-M5 template assertion stays alongside the separate 64-record M5 limit. The render-depth changes are unchanged. On PC, the arm64 W=1 Asahi objects linked with 46 warnings and zero errors, and run-host-tests.py --jobs 8 --only g17- passed 340/340. Those ran on 40649a0b9298; the final base adds only #4026's ANE driver and DT changes. The earlier J714s run still covers the depth change. A fresh J700 run is pending for the merged queue initialization.

@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) and removed merge-conflict Conflicts with the base branch (bot) labels Dec 3, 2026
Keep #3429’s ParkedReplay wrapper in the prepared queue so installing it preserves render-active accounting.

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

Copy link
Copy Markdown
Contributor Author

Forward-merged main 4789b55eb019 as 36d059f03a29. The prepared queue now retains main’s ParkedReplay wrapper, so installing its replay tracker preserves the render-active count added by #3429. The warm arm64 W=1 build compiled asahi_core.o and linked aurora.o with 45 warnings and zero errors. The G17 host suite passed 346/346. Main + #3390 + this head still merges in that order; Neo has the new head for its arm.

The render depth change moved the owners of a pair's render slots from a
stack array to a vector that every render preparation allocates. A
replay after a GPU recovery prepares from the event worker while it
holds the device lock, and a failed preparation there fails every group
parked on the pair with ENOMEM. Preparation did not allocate there
before unless the target grew.

Hand the owners to the target as an iterator, so only a target that is
replaced copies them.

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

DjDeveloperr commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Reviewed at 36d059f03a29; one fix pushed on top as 665f2bc3d255. No blocker left in the code.

Fixed in 665f2bc3d255. Pair::prepare() allocated a KVec of slot owners for every render. After a GPU recovery the event worker prepares parked renders while it holds the device lock, and any error other than EBUSY/EAGAIN there fails every group parked on that pair (runtime/render/replay.rs). main allocates nothing at that point unless the target grows. buffer/target.rs now gets the owners as an iterator and copies them only when it replaces an object that is still in use. Nothing else changes.

Checked

  • ParkedReplay in Prepared: the tracker is empty when a pair is parked and is installed as it is, so the context's render-active count moves from the running list to the parked list and back without a gap. A parked group is republished before it is popped, so it is neither lost nor run twice. The fail-stop batch is sized for 64 and covers all pairs.
  • Locks: no new lock, and no change in order against drm/asahi: g17: share per-VM UAT execution context on M5 #4074 and drm/asahi: g17: hold one compute cell lock while choosing a channel #4039 (both on main). Dependency snapshots under the device lock use storage allocated beforehand.
  • Limits at depth 64: the item ring holds 1280 entries against a window of 508; the M5 scene table holds 80 slots; config, announce, usage and timestamp areas are covered by compile-time asserts. Depth, credits, graph, target and trackers all follow the same value.
  • Which Macs change: M5 with one render pair per queue (J714s, J813) goes to 64. J700, T6040, T6041, J716c and J775d stay at 32. On J700 no GPU allocation grows, so the depth change adds nothing to the GPU memory limit there. On the M5 Macs each pair's target records, which count against the client's limit, double.
  • No runtime switch or board gate: the depth follows the scene-table size and the pair count.

Tested on main f46dffad91fd + #3390 96262ad138c9 + 665f2bc3d255 (both merge cleanly): arm64 W=1 build of drivers/gpu/drm/asahi/ with 0 errors, run-host-tests.py --only g17- 353/353 (main alone 343/343). Mutations, run on the merge of the earlier head: dropping either half of the ParkedReplay count is caught. Three are not: the old tracker type (only a driver build sees it), a half-size parked tracker, and a fixed 32 in the tracker's push. A fixed 64 as the admission limit, run at 665f2bc3d255, passes g17-admission-order-tests; g17-render-depth-tests rejects it in acquire_for() by checking the source text.

Not blocking, for a later change

  1. ta_notify() still uses 32 as the pair's capacity. On a 64-deep pair, a deep multi-pass batch asks for a tiling notification on every kick from 31 in flight instead of every fourth. Passing self.memory.depth() to ta_notify_for_depth() fixes it, but it changes the interrupt rate on J714s and needs its own measurement there.
  2. A 64-deep M5 pair keeps about 2.2 MiB in the firmware object cache, so the 128 MiB cache fills at about 58 pairs instead of holding all 64. Later pairs use the uncached path, which works.
  3. select_board() keeps its own copy of the cluster rule that pairs_for_clusters() now holds.

Hardware. A J700 run covers the shared code, but not depth 64, which runs only on the M5 Macs. The last J714s run was at 3beaae0200e3; a J714s run at 665f2bc3d255 that includes the multi-queue CTS list would cover 64-deep pairs with more than one queue. J813 also moves to 64 and has no run. An approval at the new head from someone other than the author is still needed.

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Dec 3, 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 665f2bc

Checked: The revised prepare path passes a lazy iterator over generation owners. The existing target returns without collecting owners when capacity suffices. Growing a live target still copies its owners before replacing the backing, so retirement can release the old object. The depth and recovery host suite passed 5/5 at this head. The combined build and 353 host checks are recorded in the revision report. Merge #3390 first.

Follow-ups: #4199 tracks the 32-slot tiling-notification threshold on 64-slot render pairs. The exact host decision helpers requested 32 notifications using the current call and seven using the 64-slot policy for the same sample.

Keep the ordered parked-replay frontier on each loan and clear it when the pair returns. Reuse the preallocated dependency snapshot in the same paths, and retain both host-test suites.

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

Copy link
Copy Markdown
Contributor Author

Forward-merged main 571a6c4 as 2c10033. The resolution preserves the parked-replay frontier from #3991 and reuses the preallocated dependency snapshot from this series. ARM64 W=1 linked aurora.o with 45 warnings and no errors. G17 host checks passed 385/385 by itself and 392/392 with #3390. The J714s and J700 rows need the combined runtime with #3991, so the older f46dffa kits do not qualify this head.

@RyanTheTide
RyanTheTide disabled auto-merge December 3, 2026 21:23
@github-actions github-actions Bot added the needs-hw-row No hardware row at the PR head (bot) label Dec 3, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

J714s Exact-Head Hardware Receipt (#3411 2c100334fea4 + #3390 96262ad138c9)

  • Host: Apple M5 Pro (J714s / T6050 / G17S B1), stock control 7.3.0-m5-pr67 (56f42ac3), clean verified rollback to stock 7.3.0-m5-pr67 (c6625643, SLC enabled on 16 planes).
  • Kit: work/j714s-linux3390-3411-571a6c45-20261203-v2 (SHA256SUMS a5d673f8e9ee…, KIT CHECK OK, 132 selftests).
  • Arms (7.3.0-main571a6c45, rtgen2n31rc25 ICD):
    • Base (main 571a6c45): aurora-base.ko f19ea4889ac130b9, boot_id=769c835c-4df1-42b3-bc0b-9a68c3cfabac
    • Head (#3390 96262ad138c9 + #3411 2c100334fea4): aurora-head.ko 71d040c7d2dd7249, boot_id=546bba8e-5078-4362-a09a-3dfba9723bf9
Check Base (f19ea4889ac1) Head (71d040c7d2dd) Result
DEPTH64 active max 32 62 OK
Vulkan CTS (36,567 cases) 29,478 Pass / 7,089 NS / 0 Fail 29,478 Pass / 7,089 NS / 0 Fail 0 diffs, PASS
gpubench (15 workloads) gb bad 0 gb bad 0, all 15 within A/A noise PASS
Memory (one_client / depth drm_total) 517.47 / 121.54 MiB 517.43 (-0.05) / 122.04 (+0.50) MiB (dev_kernel_resident +8.73 / +13.23 MiB) OK
Kernel logs (measure + postsleep) klog clean klog clean PASS
Deep sleep + post-sleep render boot object resumes 0 -> 1, postsleep: render ok, klog clean (0.66s wake on macsmc USB2_plug) boot object resumes 0 -> 1, postsleep: render ok, klog clean (0.65s wake on macsmc USB2_plug) Identical on base & head*

*row.py judge reported FAIL solely because both base (660 ms) and head (653 ms) woke early from deep sleep on the same lab USB-C macsmc USB2_plug event (<20s threshold, flagged as BASE ARM: 1 problems (same class on base is not head-only)). Every #3390/#3411 GPU, DEPTH64, CTS, memory, perf, and post-sleep render gate passed cleanly.

J714s 2c100334fea4 (#3411 + #3390 96262ad138c9): GPU/DEPTH64/CTS/MEMORY/PERF PASS (base-identical USB2_plug early wake noted above).

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Dec 4, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Merge check at head 2c100334fea4 (forward merge of main 571a6c45, pushed by DjDeveloperr):

The PR diff against main is the same as the diff that aurora-silicon-review approved at 665f2bc3d255: the same 20 files, and every kernel hunk is identical. The merge changed one thing, a mutant string in tools/asahi/g17-render-return-observe-tests.py (return-keeps-frontier). It now matches this PR's entry.clear_dependencies(); instead of main's entry.borrowed_dependencies = None;. That is the right resolution, and the host tests pass at this head.

So only the last-push rule is still open, because DjDeveloperr made that push. Per the 12-02 maintainer rule, this PR gets merged with --match-head-commit 2c100334fea4 after the J700 head-arm row. The J714s row has already passed (#issuecomment-7397595908).

@RyanTheTide
RyanTheTide enabled auto-merge December 4, 2026 01:21
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

J700 (MacBook Neo, A18 Pro, G17P) row of #3390 96262ad138c9 + #3411 2c100334fea4 together on main 571a6c45fd2b: both boots PASS every functional check, but the latency card is NOT DECIDED.

One Image 7.3.0-main571a6c45 for both arms, module-only difference (aurora.ko). Base boot d6ccdfe7, head boot 427febc3; the J700 was verified back on stock after each.

Functional rows, both arms PASS: identity, GPU, overlap, CTS, faults, gpubench, latency run, two-client close, capacity, dmesg, watchdog; the hang round passed on both.

Throughput (GPUBench, head vs base):

  • cull_mdi d1 µs/submit 6250 -> 3425 (+45.2 %), pass_chain_oq_bar d1 759.9 -> 684.9 (+9.9 %).
  • Nothing more than 5 % worse.

C1 latency trace (head/base, held because head is more than 5 % above base):

case base head head/base
cull d1 p50 / p99 5.88 / 64.2 36.18 / 87.18 6.15 / 1.36 (noisy)
cull d2 p50 / p99 4.46 / 12.75 14.19 / 21.23 3.18 / 1.67 (noisy)
cull d8 p50 / p99 4.92 / 12.46 16.71 / 33.31 3.40 / 2.67 (noisy)
cr-concurrent p50 / p99 8.77 / 22.89 12.42 / 28.89 1.42 / 1.26 (noisy)

The cull cases are flagged noisy by the kit; cr-concurrent p50 is not. So with both PRs the same work finishes faster per submit while individual completions arrive later. The two PRs were judged together, so this row can't say which one moves the latency; a split rerun with #3390 alone (its aurora.ko is already built) is the next step.

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

J700 (MacBook Neo, A18 Pro, G17P) split row on main 571a6c45fd2b: #3390 moves the C1 submit latency; this PR (2c100334fea4) does not move it beyond noise on the J700. Every functional check passed on all three arms.

The arms ran on one Image 7.3.0-main571a6c45 and differ only in aurora.ko:

The J700 was verified back on stock after each boot.

Adding this PR on top of #3390 (C/B, each a median of the pooled repeats) changes the five judged latency cases by 0.97 to 1.03, inside each arm's spread:

case C/B
cr-concurrent p50 0.99
cull d2 p50 0.97
cull d2 p99 0.98
cull d8 p50 1.03
cull d8 p99 1.00

The cull d1 cases are too noisy on every arm to judge. GPUBench C vs B is within about 2 % everywhere except cull_mdi d1, which is bimodal from boot to boot on main as well.

Full numbers: the comment on #3390.

@DjDeveloperr
DjDeveloperr merged commit 33be2ff into main Dec 4, 2026
10 checks passed
@DjDeveloperr
DjDeveloperr deleted the perf/g17-render-depth-64 branch December 4, 2026 03:29
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Merged 2c100334fea4 as 33be2ff16e07 using Dj's 12-02 19:07 last-pusher override. The independent approval at 665f2bc3d255 carries forward to the same production changes at this head, as documented in the merge check. J714s exact-head hardware result and J700 split no-regression result cover both GPUs.

Merge tree c34ae0922221 (51cb5aaf20af + 2c100334fea4): warm ARM64 W=1 modules_prepare drivers/gpu/drm/asahi/ linked aurora.o with 0 errors and 46 warnings on both trees (0 new), and python3 -I tools/asahi/run-host-tests.py --jobs 4 --only g17- passed 392/392.

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) door:two-way Revertible or not, from Merge risk (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