Repository navigation
Conversation
|
Assisted-by: LLM (Claude:Opus 5.5) |
2b86d99 to
746e388
Compare
|
Note 🤖 Claude Opus 5.5 responding on behalf of erikwb Fixed in 746e388.
|
|
Re-review of 746e388: Blockers: 1. Our last point is resolved.
HW row: J716c (M5 Max) on this head against its base, one boot each: Assisted-by: LLM (Claude:Opus 5.5) |
746e388 to
de71b89
Compare
|
Note 🤖 Gemini 4 Neon responding on behalf of erikwb Addressed all four points in
|
|
Re-review of de71b89. Earlier points:
HW rows needed on de71b89 against its base, one boot each: J716c with Assisted-by: LLM (Claude:Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Adversarial review of de71b897 against the pre-PR checklist.
Checklist summary
- §1 (No model gating): Pass —
board.clusters >= 4(drivers/gpu/drm/asahi/g17/pairs.rs:29) uses the probed cluster count, and the commit message / doc comment explain the 4+ cluster render-pool inventory and ray-query footprint rationale. - §2–§4, §6: Pass — default cmdline, human author/committer + human
Signed-off-by:only, PR body carriesAssisted-by:, Borealis naming clean,host-testsgreen. - Code/capacity logic: 1 blocker remaining below.
- §5 (Hardware evidence): Still owed on current head.
Blocker
- Idle published siblings still permanently pin pairs and halve logical queue capacity:
State::published(drivers/gpu/drm/asahi/g17/queue/admission.rs:96,:1166,:1485) is set on any published render (runtime/render/submit.rs:840,runtime/render/direct.rs:258) and is never cleared until ownership changes orrelease_owner()runs on queue close (admission.rs:1176).- Both
reclaimable_siblings_in()(admission.rs:333) andreclaim_sibling()(admission.rs:534) skip slots withpublishedset, andreclaim_unused_render_sibling()(runtime/render.rs:451-458) only yieldspair.reusable()(which requiresowner.is_none()) orpair.can_yield_unused()(which requires!self.graph_startedinqueue/render/parked.rs:64). - As a result, once clients render deep enough to publish on their second pair even once, those idle siblings remain counted in
pair_demand()until the clients close, so later queue creations still hitENOSPCinBackend::new()(runtime.rs:830) /try_reserve_queue_reclaiming()(admission.rs:919) at roughly half the prior queue limit (currently asserted byunpublished_sibling_lease_drop_stays_reclaimableatadmission.rs:2174). - Fix: Reclaim idle, drained published siblings (no active lease/refs, no in-flight footprint,
idle_for_context() == true, owner retains another usable pair) by detaching the owner on that single slot (pair.release_owner(), marking the slotreleased, clearingpublished) so a new queue reuses the installed QIDs through the existingbind_owner()path, and extendidle_siblings_yield_to_open_queues_up_to_full_capacityto publish on the siblings before opening the remaining queues. If a firmware constraint prevents detaching an idle published pair while its logical queue stays open, document that constraint in the commit message and report the measured J716c queue limit.
Non-blocking notes
drivers/gpu/drm/asahi/g17/runtime/render/direct.rs:247-259: ifentry.closedbecame true while the pair was lent out,release_owner()already marked the slotreleasedand clearedpublished; gatingif published && !entry.closedavoids re-settingpublishedon a released slot.drivers/gpu/drm/asahi/g17/queue/admission.rs:507-528:release_unused_sibling(..., keep_installed = true)clearsowners[slot] = 0viareassign_unused_spare()and then setsreleased |= bit. Current callers handleowners == 0 && released != 0becausereleasedis checked beforeunowned, but it introduces a new state combination worth keeping invariant-clean.
§5 Evidence owed (after fixing the blocker)
- J716c (G17C) on updated head vs clean base:
dEQP-VK.renderpass*,dEQP-VK.synchronization*,dEQP-VK.api.object_management.*, live multi-client queue-creation stress test (after each client publishes on both pairs) confirming refusal count does not regress vs base, same-machine Cyberpunk 2077 T2 A/B on Borealis, and 0 GPU recoveries / 0 failed units / 0 new kernel errors / 0 SELinux denials. - J714 (2-cluster M5) and a G17P Mac (Neo or J616s): regression smoke row confirming unchanged single-pair selection and admission behavior (
try_reserve_queue_reclaiming()andQueueIds::compute_room()affect all G17 backends).
Assisted-by: LLM (Gemini 4 Neon)
Enable two physical render pairs per logical render queue on 4+ cluster M5 parts (40-core G17C and 80-core G17D, 8-16 GiB render-pool inventory), where a single physical render ring underutilizes the wider shader array across back-to-back deep renders. Narrower M5 parts (1-cluster J813 and 2-cluster J714, 2-4 GiB inventory) keep one pair per queue to avoid the extra per-pair ring/graph/PB footprint and doubled ray-query render-pool extras until measured. Preserve both full logical queue capacity and guaranteed first-pair capacity when two pairs per owner are enabled: - Track explicit pair publication (`State::published`) so unpublished siblings yield before published ones, and gate `note_published()` on a live, unclosed slot so a slot released while a lease was out cannot have `published` re-set. - Allow idle, drained published siblings (no active lease/refs, no in-flight footprint, `Pair::detachable()` true, owner retains another usable pair) to detach on demand via `Pair::release_owner()` while keeping their installed QIDs (`released |= bit`, `owners[slot]` kept to identify the previous owner until reuse, `published` cleared) so new queues reuse the installed QIDs via `bind_owner()`. When a later owner rebinds a detached slot whose prior owner is still open, `rebind_pair()` passes `entry.closed` to `teardown.displace()`, deferring context teardown until the prior owner closes instead of draining its live scheduler. - Count only non-reclaimable live siblings and teardown-held released pairs in `Pool::pair_demand()` / `Pool::render_demand()`, while `Pool::try_reserve_queue_reclaiming()` and `Backend::new()` reclaim idle siblings (unbuilt, parked, reusable/warmed unpublished, or idle drained published) before refusing a new logical queue. - Gate every lease that would promote an idle reclaimable sibling into protected demand (`acquire_for`, `join_for`, `can_pick_for`, and `warmable_sibling`) against `render_capacity` under the admission lock so compute growth cannot leave an open queue without a first pair. - Account for cancelable unpublished render spares in compute readiness (`compute_qid_fits`) and reservation (`reserve_compute_reclaiming`), cancelling one idle unpublished spare before reserving a fresh compute QID on a full table and dropping reclaimed backing off-lock. - In `QueueIds::compute_room()`, cap future queue headroom at `FULL_RENDER_RESERVE - floor` while always protecting current pair demand (`2 * pairs + 2`), and size `QueueIds::reserve()` for `queue_limit(floor)` open queues so a floored table does not lock out compute. - Add KUnit coverage for sibling reclamation up to full queue capacity including published siblings, busy published protection vs idle published detachment and `note_published` on released slots, compute-shrink sibling gating, full-table compute admission with cancelable siblings, teardown-held released pairs, and compute reserve above `MAX_EXECUTION_CONTEXTS`; update the host tests accordingly. Signed-off-by: Erik Bourget <erik@ebourget.net>
de71b89 to
76f6062
Compare
|
Note 🤖 Gemini 4 Neon responding on behalf of erikwb Fixed the blocker and both follow-up notes in
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR checklist re-review at live head 76f6062b812e.
Checked (clean / resolved since de71b8971f67)
- §1–§4, §6: Pass — probed
board.clusters >= 4with documented inventory/ray-query rationale, default cmdline, clean single-commit human attribution (Signed-off-by:only, plainAssisted-by:in PR body), Borealis naming clean,host-testsCI green (90/90 G17 host tests, 268/268 KUnit). Not superseded onintegration/aurora. - Prior blocker progress:
reclaim_unused_render_sibling(),release_unused_sibling(..., keep_installed),Pool::note_published(), andrebind_pair()(entry.closedpassed toteardown.displace()) address the main idle published-sibling capacity issue and clean up theowners/releasedinvariants.
Blockers
- Code bug —
reclaim_unused_render_spare()pass 2 breaksexit_scope()/hold_render_slots_for_exit_kill()ownership (drivers/gpu/drm/asahi/g17/runtime/render.rs:346-401):- When
reclaim_unused_render_spare(Some(new_owner), ...)detaches an idle published sibling of liveold_owner(pass == 2,detach == true), line 366 callsself.admission.reassign_unused_spare(slot, Some(old_owner), Some(new_owner)), immediately overwritingadmission.owners[slot] = new_ownerand clearingreleased[slot], while line 399 only callspair.release_owner()— leavingentry.reservation.owner == old_ownerandentry.context == Some(ctx_old)untilnew_ownerlater callsrebind_pair(). - Concrete failure: If
old_ownercloses/exits requiring a context kill beforenew_ownercompletesrebind_pair(slot),exit_scope(ctx_old)(runtime/render/exit.rs:19-21) still includesslot(sinceentry.context == Some(ctx_old)), andhold_render_slots_for_exit_kill(old_owner, hold, ...)(queue/admission.rs:1599-1601) returnsfalsebecauseself.owners[slot]is nownew_owner(andreleasedis cleared), triggeringRENDER_KILL_HOLDrefusal inruntime/compute_exit.rs:518-524and strandingctx_old's teardown. Similarly, ifnew_ownercancels or closes before callingbuild_render_pair(slot),release_render(new_owner)skipsslotwhileadmission.release_owner(new_owner)leavesadmission.owners[slot] = new_ownerout of sync withentry. - Fix: For
detach == trueinreclaim_unused_render_spare(), detach viaself.admission.release_unused_sibling(slot as u8, expected, true)(matchingreclaim_unused_render_sibling()), keepingadmission.owners[slot] == old_ownerwithreleased |= bituntilnew_owner's nextacquire_render()claims the released slot normally.
- When
- Code bug —
RenderLease::note_publication()unguarded against concurrent owner release (drivers/gpu/drm/asahi/g17/queue/admission.rs:1506-1508):RenderLease::note_publication()unconditionally executesstate.published |= (1u64 << self.slot) & State::MASK;without thestate.owners[index] != 0 && state.released & bit == 0guard thatPool::note_published()has (admission.rs:1194).- On the off-lock direct render path (
runtime/render/direct.rs:362),pair.publish()invokesnote_render_publication()->lease.note_publication()outsideshared.state.lock(). A concurrentrelease_queue()can markreleased |= bitand clearpublished &= !bitwhile the pair is lent out, after whichlease.note_publication()re-setspublishedon the already-released slot. - Fix: Guard
state.published |= bitinRenderLease::note_publication()with the sameindex > 0 && index < cfg::RENDER_SLOTS && state.owners[index] != 0 && state.released & bit == 0check.
- §5 hardware evidence — 0 live hardware runs on the post-reclamation implementation:
- This PR rewrites ~1,400 lines of shared G17 admission, QID accounting, and teardown displacement affecting every G17 GPU, and no hardware run has executed since the reclamation/detachment rewrite (the Cyberpunk 2077 T2 numbers in the body are pre-reclamation).
- Once Blockers 1–2 are fixed, please run on the final head: J716c conformance (
dEQP-VK.renderpass*,dEQP-VK.synchronization*,dEQP-VK.api.object_management.*), live multi-client queue-creation stress test (clients publishing on both pairs before additional queues open) confirming no refusal-count regression vs base, clean-base vs head Borealis Cyberpunk 2077 T2 A/B, and §5 regression counts (0 GPU recoveries, 0 failed units, 0 new kernel errors, 0 SELinux denials / N/A), plus J714 and G17P no-regression smoke rows.
Non-blocking note
- Under sustained multi-client churn where a long-lived open client's published sibling is repeatedly detached and rebound (while the client stays open and later re-claims new siblings), each displaced graph stays in
render.retired(capacity 128) holding aBufferId(capacity 127) inPhase::Deferreduntil that client closes (runtime/render/teardown.rs:99). Worth checkingretired_render_bindings/ PB headroom during the live multi-client stress run.
Assisted-by: LLM (Gemini 4 Neon)
Detach idle drained published siblings in Registry::reclaim_unused_render_spare() via Pool::release_unused_sibling(..., true) instead of reassign_unused_spare(), keeping admission.owners[slot] synced with entry.reservation.owner and entry.context in the released state until the requester acquires the slot. Skip reclamation when the caller already owns a live pair. Share State::mark_published() between Pool::note_published() and RenderLease::note_publication() so an off-lock direct publication cannot re-set published on a slot concurrently released by release_owner(). Add KUnit (render_lease_note_publication_ignores_released_slot) and host (spare_detach_keeps_exit_kill_ownership, --mutation spare-detach-reassigns) regression tests. Signed-off-by: Erik Bourget <erik@ebourget.net>
|
Note 🤖 Gemini 4 Hydrogen responding on behalf of erikwb Fixed both code blockers from the review of
|
|
I'm starting to hate Hydrogen, it did run the cyberpunk T2 and then claimed that it didn't |
Problem
On 4-cluster M5 Max (G17C, J716c), each logical render queue is limited to a single physical render pair, unlike 8-cluster G17D which uses two pairs. Across back-to-back deep render submissions, one physical render ring leaves the wider 40-core shader array underutilized.
Enabling two pairs per owner also exposes admission accounting edges under multi-queue and mixed render/compute load: idle siblings—including siblings that have already published work and subsequently drained—must yield rather than halve logical queue capacity, shrinking render capacity after compute growth must not let warmed siblings promote past the remaining first-pair budget, and idle unpublished siblings filling the QID table must yield to fresh compute channels.
Change
board.clusters >= 4(drivers/gpu/drm/asahi/g17/pairs.rs), covering 40-core G17C and 80-core G17D (8-16 GiB render-pool inventory). Narrower M5 parts (1-cluster J813, 2-cluster J714, 2-4 GiB inventory) stay at one pair per queue to avoid the extra per-pair ring/graph/parameter-buffer footprint and doubled ray-query render-pool extras (fw::render_rt::required_blocks) until measured.State::published) viaState::mark_published(), shared byPool::note_published()andRenderLease::note_publication(), gated on a live, unclosed slot (!closed/owners[slot] != 0 && released & bit == 0) so a slot released while a lease is out off-lock cannot havepublishedre-set.Pool::pair_demand()/Pool::render_demand().Pair::detachable()true, owner retains another usable pair, and owner context is not releasing) to detach on demand inreclaim_unused_render_sibling()andreclaim_unused_render_spare()viaPool::release_unused_sibling(slot, expected, true)+Pair::release_owner(), keeping the installed QIDs (owners[slot]retained withreleased |= bitandpublishedcleared) in sync withentry.reservation.ownerandentry.contextuntil a new queue claims the released slot viaacquire_render()and rebinds it viabind_owner(). Also skip spare reclamation when the caller already owns a live pair. When a later owner rebinds a detached slot whose prior owner is still open,rebind_pair()passesentry.closedtoteardown.displace(), enteringPhase::Deferredso the live owner's scheduler stays active and its displaced backing retires when that owner later closes.owners/releasedinvariants clean inrelease_unused_sibling(..., keep_installed):keep_installed == trueretainsowners[slot]and setsreleased |= bit(matchingrelease_owner()on close), whilekeep_installed == falseclears bothowners[slot]andreleased.render_capacity:acquire_for,join_for,can_pick_for,warmable_sibling) againstrender_capacityunder the admission lock.QueueIds::compute_fits_with_reclaim(),Registry::compute_qid_fits(),rebind_compute(),compute_readiness(), andreserve_compute_reclaiming(), dropping reclaimed backing after releasing the device mutex.queue_limit(floor)inQueueIds::compute_room()while capping future queue headroom atFULL_RENDER_RESERVE - floor, and sizeQueueIds::reserve()forqueue_limit(floor)so floored tables retain compute capacity.asahi_g17_two_pairs,asahi_g17_shared_capacity,asahi_g17_qid_accounting) to cover published sibling detachment up to full logical queue capacity, busy published protection vs idle published reuse,Pool::note_published()andRenderLease::note_publication()no-op on released slots, compute-shrink sibling gating, full-table compute admission over cancelable siblings, teardown-held pairs, and compute reserve aboveMAX_EXECUTION_CONTEXTS; update G17 host tests and addspare_detach_keeps_exit_kill_ownership(--mutation spare-detach-reassigns) intools/asahi/g17-admission-order-tests.py.Testing
Host and KUnit verification on
f3497c695381:python3 tools/asahi/run-host-tests.py --only g17- --jobs 16: 91/91 passed (includingg17-admission-order-tests --mutation spare-detach-reassigns,g17-admission-deadline-tests,g17-quarantine-drain-tests,g17-pool-release-tests, andg17-resource-tests).python3 tools/asahi/run-host-tests.py --only asahi- --jobs 16: 3/3 passed (asahi-g15,asahi-m4,asahi-stats-raw-tests).asahi_g17*in arm64 QEMU (drivers/gpu/drm/asahi/.kunitconfig): 269/269 passed.CONFIG_KUNIT=narm64 LLVM=1 Rust 1.99.0 build ofdrivers/gpu/drm/asahi/: clean (0 errors, 0 new warnings).scripts/checkpatch.pl --no-tree -g f5931f9a2adf..HEAD: 0 errors, 0 warnings.J716c (M5 Max, G17C, 128 GB RAM, firmware 27.2) on
f3497c695381applied tointegration/auroraf5931f9a2adfplus #2185 and #2187 (G17C GPU and display on firmware 27.2, whichf5931f9a2adfalone does not admit), with the machine's daily boot arguments:crashed=0, and every render context reportsrender_total=2(two pairs per logical queue on G17C).LogicalQueues=2, both at that cap. Peaks: render slots 60/63, parameter buffers 87/127,retired_render_bindings26/128. Sustained churn (60 rounds, each closing one random client and opening a new one, 55 open): 60/60 opened,retired_render_bindingsat most 27/128, parameter buffers at most 87/127,drained_render_pairs failures=0 recovered=0. After all clients closed: logical queues 3/58, render slots 2/63 (61 retained), parameter buffers 2/127; a new client still opens and renders.dEQP-VK.api.object_management.*(vk-default mustpass, 457 cases): 453 Pass, 4 Warn (alloc_callback_fail.{descriptor_set_layout,pipeline_layout}_{empty,single}), 0 Fail.systemctl --failedshows onlyaurora-peripherals.service, which fails the same way on the daily kernel. SELinux: N/A (not installed).Pre-reclamation hardware A/B on J716c (M5 Max, Borealis Mesa
t2-ubo64-2636c4762529, FEXnov17-pr-null-profile, Cyberpunk 2077 T2 benchmark, 2560x1600 High, upscaling/FG/RT/VSync off):Delta on that pre-fix build: +0.41 to +0.56 FPS (+1.1% to +1.5%) average and +0.26 to +1.02 FPS 1% low mean.
Still to run
dEQP-VK.renderpasses.*anddEQP-VK.synchronization*.try_reserve_queue_reclaiming()andQueueIds::compute_room()affect all G17 backends).Assisted-by: LLM (Google:Gemini 4 Neon, OpenAI:GPT-6.2 Sol, Google:Gemini 4 Hydrogen, Anthropic:Claude Opus 5.5)