Skip to content

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

Open
DjDeveloperr wants to merge 7 commits into
mainfrom
perf/g17-render-depth-64
Open

DjDeveloperr wants to merge 7 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 69bc5a2a: not ready yet

Check Detail
CI at head running running: apple-build, host-tests, KUnit plan
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 69bc5a2a, a Mac and a result in the PR body or a comment
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
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Merged main (844502ef16a3) into the branch as f9d0f1f372bd. The textual conflicts were in queue/render/memory.rs, where I kept main's upper-half comment and protection plus this branch's depth-sized graph and config sizes, and in the two host-test registries (both sides kept).

The merge also needed two fixes that git did not flag:

  • main added Tracker::get_mut() using the DEPTH constant, which this branch removed when the tracker moved to a per-queue KVec. It now indexes modulo the tracker's own capacity, like the other accessors. Without this the driver doesn't compile.
  • main's new g17-render-owed-stamp-tests.py fixture now builds the KVec tracker (DEPTH_MAX, KVec/GFP_KERNEL stubs, with_capacity()).

On the merged tree:

  • g17-render-depth-tests passes 5/5, and both of its mutations are caught.
  • g17-admission-order-tests passes, and held-blocks-owner and main's detached-sibling-cancels-owner are both caught.
  • g17-render-owed-stamp-tests passes 47/47, and all 34 mutations are caught.
  • 44 of the other 47 g17-* scripts pass; the rest need the full tree and run in CI.

Still owed before merge: a fresh approval, and SLC-on rows at this head on J714s and J700. The base moved under the changed render files, so the earlier rows are supporting evidence only.

@github-actions github-actions Bot added needs-review No approving review from Core or Omarchy Mac yet (bot) and removed ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) labels Dec 2, 2026
RyanTheTide
RyanTheTide previously approved these changes Dec 2, 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.

Re-checked merge-up f9d0f1f372bd (3d806073 + main 844502ef): admission.rs keeps both render_depth and detached, memory.rs keeps PROT_FW_SHARED_RW and depth-sized allocations, retirement.rs updates Tracker::get_mut to index modulo self.entries.len(), and 9/9 CI checks pass. Needs an exact-head hardware row line at f9d0f1f3 before merge.

@github-actions github-actions Bot added merge-conflict Conflicts with the base branch (bot) and removed needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 2, 2026
buffer/target.rs: main adds a per-render clustering-metadata copy (GTP 4-7) sized and indexed with the DEPTH constant, which this branch replaces with each target's own depth. Size the metadata object with the target's depth in new() and ensure_capacity(), and take a render's copy modulo self.depth, as the records and slots do.

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

Copy link
Copy Markdown
Contributor Author

Merged main (b3a5fda631b9) into the branch as 3c562d0eea06.

Conflict: g17/buffer/target.rs. main now gives each in-flight render its own zeroed copy of the clustering metadata (GTP 4-7) instead of copying the whole TPC object. It sized and indexed those copies with the DEPTH constant, which this branch replaces with each target's own depth. I kept main's split between the shared TPC object and the per-render metadata, and made the metadata follow the target's depth the same way the records and slots do:

  • new() sizes the metadata object as meta_stride * depth.
  • ensure_capacity() regrows it as meta * self.depth.
  • meta_offset() picks a render's copy with ordinal % self.depth.

Using DEPTH_MAX there instead would compile, but a 32-deep target would then compute offsets past the end of its metadata object. Clustering metadata exists only on non-M5 layouts, which stay 32 deep, so the 64-deep queues allocate no metadata copies.

Changes git didn't flag: main's other changes under this branch's files (g17/mod.rs, g17/runtime.rs, hw/t8140.rs, the new gtp_va(ordinal, …) call in queue/render.rs, and the host-test registry) merged cleanly. None of main's new code uses the items this branch changes: the RENDER_DEPTH-sized arrays, DEPTH, RECORDS, FORGIVE_LIMIT, Tracker::new(), Storm::new(), or the old Target::new(), check_capacity() and pair_sizes() signatures. Against main, the merged diff touches the same 31 files as this PR. 30 of them carry exactly this PR's changes, and target.rs differs only by the three depth lines above. The merge also stays clean against main's newer tip 4c6f0f709898.

Checks on the merged tree (pc, x86_64 cross-build to arm64):

  • linux-build/build kernel --profile asahi <tree> -- W=1 modules_prepare drivers/gpu/drm/asahi/ (warm O= dir): rc 0. asahi_core reports 44 Rust warnings. Each is in a file this PR doesn't change or is already on main (State::join in queue/admission.rs has no caller on main either). None are new.
  • python3 -I tools/asahi/run-host-tests.py --jobs 8 --only g17- in the host-tests image (Ubuntu 24.04, clang 18, gcc 13, Rust 1.96.0, --network=none): 332/332 passed, including g17-render-depth-tests with its global-forgive-64 and m5-stuck-32 mutations, and all 35 g17-render-owed-stamp-tests jobs.
  • Full run-host-tests.py --jobs 8 in the same image: 970/972 passed. The only failures are centauri-scan-tests and its --negative-controls run. Both fail on main too since today's btcentauri_t6050 changes (the test's bt-production.c harness has no dev_warn_ratelimited() or cen_rx_consume()), and main's own host-tests run at c2f1583e fails the same two jobs (967/969). This PR doesn't touch them, so the hosted host-tests check stays red on them until main's test is fixed.
  • scripts/checkpatch.pl --strict --ignore FILE_PATH_CHANGES on d3c3279f2cdc and f4607a228ded: 0 errors, 0 warnings, 0 checks.

This push makes DjDeveloperr the last pusher, so the PR needs a fresh approval from a maintainer other than the pusher.

Head: 3c562d0eea06
Exact-head J714s row owed.

@github-actions github-actions Bot added needs-review No approving review from Core or Omarchy Mac yet (bot) and removed merge-conflict Conflicts with the base branch (bot) labels Dec 2, 2026

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

Independent review of the forward merge at 3c562d0. The metadata allocation and growth both use checked multiplication by the target depth. The metadata offset uses that same depth as slot ownership and retirement. The shared TPC object and per-render clustering metadata keep their separate lifetimes. The recorded Arm64 build and all 332 G17 host runs pass. The J714s row is the remaining gate.

Keep per-depth graph sizing with main's G17P queue record cache and one-time work-slot binding.

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

Copy link
Copy Markdown
Contributor Author

Forward-merged main d5597c30cb53 as 3beaae0200e3, retaining per-depth graph sizing and main's G17P cached-record and one-time work-slot behavior. On Mini, ARCH=arm64 ./linux-build/build kernel --profile asahi linux-pc-edge-pr3321-a76093e3 -- -j8 W=1 drivers/gpu/drm/asahi/ compiled and linked aurora.o with 38 Rust warnings and no errors. In Ubuntu 24.04, python3 -I tools/asahi/run-host-tests.py --jobs 6 --only centauri-scan-tests passed 2/2, and the same command with --only g17- passed 336/336. The old hosted run failed only the two Centauri cases fixed on main by #3987. The new head is ready for review and hardware validation.

RyanTheTide
RyanTheTide previously approved these changes Dec 2, 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 forward merge against the previously reviewed head. The production changes are identical when each head is compared with its main parent. The object-fence fixture now checks the variable graph size while preserving main’s device-specific queue-record offset. The exact J714s row remains due.

@github-actions github-actions Bot removed the needs-review No approving review from Core or Omarchy Mac yet (bot) label Dec 2, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

PASS on J714s (MacBook Pro 14" M5 Pro, T6050 G17S B1) at exact head 3beaae0200e3b27166f2aa1286dfc62a02aee624 (0-conflict composite 82e27746afd9 with #3390 ec14e9f2621d on origin/main 2c667a4be5a6, release 7.3.0-m5-g17-3411-3390 vs clean 7.3.0-m5-main-base, SLC 16 planes, headless WSI, 0 display windows): paired 4-boot ABBA (a1-base boot_id=2cfeca6d-4357-410c-b0b0-add3e9d47723, b1-comp boot_id=16b2b99d-069a-45b3-8f11-38b981defa0b, b2-comp boot_id=adbe2a12-88c7-453a-ba3d-3877eb9db4b6, a2-base boot_id=83ad5c7f-c4c0-43ce-8bca-9eca11b91d5b) passed with 0 CRC mismatches and 0 >5% primary regressions (render.light d64 24.89 -> 24.63 us/submit -1.05%, d32 24.98 -> 25.02 us +0.17%, d8 27.37 -> 27.48 us +0.40%, d1 134.75 -> 136.17 us +1.06%; render.postfx d1/d2 +1.39%/+2.07%; rt.scene 67.62 -> 67.58 FPS -0.06%); focused 5-suite VK CTS (occlusion_query.copy_*, concurrent_queries.*, multiview.queries.*, synchronization.smoke.*, synchronization2.op.single_queue.barrier.*_read_image_compute*) on b1-comp 601/601 Pass (0 Fail, 0 NotSupported); 0 GPU faults, 0 timeouts, 0 recoveries, 0 kernel WARN/Oops; clean stock 7.3.0-m5-pr67 handback (boot_id=154b9874-a3e5-46c8-a5a5-837ba7143a0e).

@github-actions github-actions Bot added merge-conflict Conflicts with the base branch (bot) and removed needs-hw-row No hardware row at the PR head (bot) labels Dec 3, 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

This branch has not been deployed

No deployments
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-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