Repository navigation
drm/asahi: g17: step past owed render stamps and suppress drained timeout heads - #3229
Conversation
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
…eout heads
G17 render pairs still had parity gaps against compute queues when a
group retires on its pass record without completion stamps
(`Active::stamps_owed`) or when a quarantined pair has already finished
executing:
1. `Pair::timeout_head()` only skipped entries with
`drained_result.is_some()`. A group that retired stampless keeps
`stamps_owed = true` and never gets a `drained_result`, so it stayed
advertised as the pair's timeout head (both live and as `failed: true`
once quarantined). Likewise, a quarantined render pair whose groups
all executed unstamped (`executed_unstamped()`) or that was parked out
of service (`drain_failures >= DRAIN_RETRY_LIMIT`) continued reporting
`failed: true` as a `blocker_failed=1` head to other VMs' watchdogs.
Skip `stamps_owed` entries in `Pair::timeout_head()` and suppress
quarantined pairs that satisfy `executed_unstamped()` or
`drain_failures >= DRAIN_RETRY_LIMIT`, while keeping genuinely pending
in-flight live or quarantined render groups visible.
2. `Pair::retire_front_command()`, `Pair::note_stamp_wait()`,
`Pair::stamp_waiting()`, and `Pair::expire_stamp_wait()` only
inspected `self.active.front()`. Once the front group held
`stamps_owed = true` waiting for lagging stamps, later groups queued
behind it on the same pair could neither latch or expire a stamp wait
nor retire past it. In addition, recovery, replay, binding-lifetime,
and timeout paths still saw retired `stamps_owed` entries as unretired
active work:
- `Pair::oldest_spared()`, `Pair::quarantine()`, `Pair::visit_contexts()`,
`Pair::classify()`, `Pair::pass_started()`, `Pair::note_interrupted()`,
`Pair::oldest_packet()`, `Pair::front_untouched()`,
`Pair::running_start()`, `Pair::report_timeout()`, and
`Pair::live_unparked()` did not filter out `stamps_owed` entries
(an all-`stamps_owed` pair reported via `visit_contexts()` caused
`recovery::classify()` to hit `oldest_spared() == None` and abort
classification, `pass_started()` could blame an already-completed
pass, and an exact-stamp match on a `stamps_owed` entry in
`note_interrupted()` must return `Interrupted::None` without falling
through to mark a successor).
- `Pair::retire_front_command()` called `note_retirement()` before
fallible completion and even on stampless or behind-owed
retirements, risking releasing `self.previous` before stamps or
`firmware_drained` proved the first publication was done; it also
omitted `executed_generation` on stampless retirement even though
the group executed on the GPU.
- `Backend::defer_timeout()`, `Registry::render_timeout_decision()`,
`Firmware::fail_render_packet()`, and `Pair::fail_after_observation()`
could treat a packet that had just retired stampless (and remained
held in `Pair::active` as `stamps_owed`) as still unretired, causing
spurious watchdog give-ups or quarantines of running successors.
Add `Tracker::get_mut()`, step past leading `stamps_owed` entries in
`retire_front_command()`, `note_stamp_wait()`, `stamp_waiting()`,
`expire_stamp_wait()`, `report_timeout()`, `oldest_packet()`,
`oldest_spared()`, `visit_contexts()`, `classify()`, `pass_started()`,
`front_untouched()`, `running_start()`, `quarantine()`,
`note_interrupted()`, and `live_unparked()`, keep leading
`stamps_owed` entries popping at index 0 once both TA and fragment
stamps cover them, keep groups retired behind held entries in FIFO
order until their predecessors pop, call `note_retirement()` only
after popping index 0 on stamps or releasing `stamps_owed` entries in
`release_witnessed()`, record `executed_generation` unconditionally on
stampless retirement too, return `Decision::Retire` in
`Backend::defer_timeout()` when `retirement_queued()` is set after
`scan_renders()`, skip `retired_held(packet)` in
`render_timeout_decision()` / `fail_render_packet()` /
`fail_after_observation()`, and guard `replay_abandoned()` against a
`stamps_owed` front.
Add `tools/asahi/g17-render-owed-stamp-tests.py` (registered in
`tools/asahi/run-host-tests.py`, with mock fields updated in
`tools/asahi/g17-quarantine-drain-tests.py`) compiling the real render
retirement, observation, replay, pair, settle, registry, backend, and
timeout policy code with 34 negative-control mutations.
Signed-off-by: AxxzyWasTaken <[email protected]>
3ad6d99 to
5e0770c
Compare
|
Rebased onto |
There was a problem hiding this comment.
Verdict: FINISH, then merge at 5e0770c9
Blockers:
- Missing hardware row at head
5e0770c9: PR touches G17 render retirement, stamp-wait, recovery, and timeout paths (drivers/gpu/drm/asahi/g17/), and the PR body notes no live G17 hardware run has been posted yet. Add an exact-head hardware row on a G17 Mac (M4 Pro / M4 Max / M5) with regression checks (0 GPU faults/timeouts, 0 failed units, 0 new kernel errors).
Checked: no Apple material, no AI attribution, no new chip/board/firmware gates, no cmdline hacks, human Signed-off-by, full diff of all 8 files, retire_front_command() FIFO stepping and idempotent retirement::poll() when stamps_owed entries advance to index 0, timeout_head()/quarantine()/note_interrupted()/replay_abandoned() filtering of stamps_owed entries, all 20/20 CI checks green (apple-build, host-tests, all KUnit suites, pr-text, readiness).
Evidence
- Code inspection found no correctness or safety blockers:
Tracker::get_mut()bounds-checksindex >= self.lenbefore modular indexing.Pair::retire_front_command()properly confinesobservedvalidation/consumption toat == 0, setsstamps_owed = trueand clearscollateral_atand updatesexecuted_generationon both stampless and behind-owed (at != 0) retirements, and callsmemory.retire()+note_retirement()only when an entry actually pops atat == 0(or inrelease_witnessed()). Becauseretirement::poll()is idempotent on monotonic stamps, a behind-owed entry that later advances to index 0 pops cleanly.Pair::timeout_head()suppresses drained/parked quarantined pairs (drain_failures >= DRAIN_RETRY_LIMIT || executed_unstamped()) and skipsstamps_owedentries;render_timeout_decision()andfail_after_observation()skipretired_held(packet);Backend::defer_timeout()returnsDecision::Retireimmediately whenretirement_queued()is set afterscan_renders().
- CI at
5e0770c9: 20/20 checks PASS. - Only missing item is a live G17 hardware row at
5e0770c9.
|
5e0770c J700 (MacBook Neo, T8140, G17P B1) PASS: combined guarded one-shot |
There was a problem hiding this comment.
The J700 combined-build row supplies render and suspend regressions. Its receipt identifies a remaining mismatch between the branch fixture and the current integrated note_retired signature. Keep landing held for a green host run on the intended integration tree with that fixture aligned.
There was a problem hiding this comment.
Verdict: MERGE at 5e0770c9ceaa
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 (6105701508).
Follow-ups (not blocking): align branch fixture with integrated note_retired signature, green host run on integration tree
|
Merging at |
The two harnesses copy driver code next to stand-ins. Code that landed on main 12-01 calls stand-ins they did not have, so both fail to compile: - g17-output-fence-tests: fence.rs (aurora-silicon#3392) calls KickDependency::qid(). - g17-render-owed-stamp-tests (aurora-silicon#3229): backend.rs calls Packet::note_first_excuse()/first_excuse() and Queues::forfeit_blocker() (compute allowance forfeit), and recovery::note_retired() now takes the retired command number. The render cases have no compute command, so the new stand-ins record no excuse and forfeit nothing. All g17 host tests pass (329 jobs).
|
One render timeout on a K116s (T6050, 16" M5 Pro OLED, firmware 27.2) with this merged, which froze the desktop. I'm posting it here because the timed-out pair looks executed but unstamped, which is the case this changed. Kernel:
I don't have a reproducer. I'm staying on this kernel and will add any repeat here. |
What: Fixes two G17 render-pair parity gaps against compute queues when a render group retires on its pass record without completion stamps (
Active::stamps_owed) or when a quarantined render pair has already finished executing:Pair::timeout_head()suppression: Skipstamps_owedentries (which never receive adrained_result) and suppress quarantined pairs that satisfyexecuted_unstamped()ordrain_failures >= DRAIN_RETRY_LIMIT, while keeping genuinely pending live or quarantined render groups visible.stamps_owedentries across retirement, stamp-wait, recovery, and timeout paths: AddTracker::get_mut()and filter outstamps_owedentries inretire_front_command(),note_stamp_wait(),stamp_waiting(),expire_stamp_wait(),report_timeout(),oldest_packet(),oldest_spared(),visit_contexts(),classify(),pass_started(),front_untouched(),running_start(),quarantine(),note_interrupted(), andlive_unparked(). Keep leadingstamps_owedentries popping at index 0 once TA and fragment stamps cover them, keep groups retired behind held entries in FIFO order until predecessors pop, callnote_retirement()only when an entry is actually popped or released inrelease_witnessed(), clearcollateral_atand recordexecuted_generationon both stampless and stamp-covered retirements, returnDecision::RetireinBackend::defer_timeout()whenretirement_queued()is set afterscan_renders(), skipretired_held(packet)inrender_timeout_decision()/fail_render_packet()/fail_after_observation(), and guardreplay_abandoned()against astamps_owedfront.tools/asahi/g17-render-owed-stamp-tests.py(registered intools/asahi/run-host-tests.py, with mock fields updated intools/asahi/g17-quarantine-drain-tests.py) compiling the real driver code with 34 negative-control mutations.Closes: #2736
Tested:
tools/asahi/run-host-tests.py --only g17: 266/266 passed at5e0770c9ceaa(includingg17-render-owed-stamp-testsbaseline + all 34 negative-control mutations killed,g17-quarantine-drain-tests7/7,g17-admission-order-tests25/25,g17-owner-release-order-tests1/1,g17-render-return-observe-tests14/14).ARCH=arm64 LLVM=1 drivers/gpu/drm/asahi/aurora.oat5e0770c9ceaawith 0 warnings in touched files.Not yet: Live G17 hardware stress run (M4 Pro / M4 Max / M5) triggering stampless render retirement behind lagging stamps and recovery classification.
Risk: two-way · G17 Macs (M4 Pro, M4 Max, M5 family)