Skip to content

drm/asahi: g17: let an exhausted excuse end the blocker's allowance - #2887

Merged
RyanTheTide merged 5 commits into
mainfrom
pr/g17-allowance-forfeit
Nov 29, 2026
Merged

RyanTheTide merged 5 commits into
mainfrom
pr/g17-allowance-forfeit

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem

A G17 compute queue that asked for a watchdog allowance (compute_timeout_ms) keeps each of its commands alive for up to that allowance. Work of another VM queued behind such a command is excused meanwhile, for at most the longest allowance the system permits, and then deferred and failed as spared. Every command of the long queue starts a fresh allowance, so a queue that keeps submitting long commands outlasts the other VM's excuse: the waiting job is the one that fails, while the queue holding the GPU keeps running.

Change

When a waiting job has used its whole excuse and is deferred behind a live blocker that is still inside its allowance, the blocker loses the rest of its allowance and its other renewals (timeout::Verdict::forfeits, Packet::forfeit_allowance). Its next expiry goes straight to attribution, normally failing it, and the waiting job's remaining deferrals cover the teardown. The blocker's failure is classed recovery::Class::Forfeited (since 223077c; it was spared before). It fails as a command past its allowance does: its VM fails with ETIMEDOUT, its queue's quarantine is not a spared one, and on M5 the open timeout kill stops it. Both the compute and the render watchdog apply it and log one line when they do.

It does not apply to:

  • the command the waiting job was first excused behind: it was running before the wait, and an allowance placed late (after a wait in publication) could end after the excuse;
  • a blocker that itself waits behind older work of the waiting job's VM;
  • a waiting job that is spared anyway (its renewals were already used).

Queues whose commands stay inside their allowance with no other VM waiting behind several of them in turn behave as before. The UAPI comment for compute_timeout_ms is updated to say which command is settled once the excuse is used up.

Testing

  • Host tests (run-host-tests.py --only g17): 90/90. g17-ray-query-timeout-tests: 36 passed, three new: an_exhausted_excuse_charges_the_blocker, a_blocker_waiting_on_the_waiting_vm_keeps_its_allowance and blockers_taking_turns_lose_their_allowance_not_the_waiting_job. Against the old timeout.rs (with a forfeits() that never fires) all three fail, the last with the waiting job ending in Spare.
  • g17-compute-owed-stamp-tests now also models the new lookup (46 passed).
  • KUnit (arm64, 16K pages, QEMU, drivers/gpu/drm/asahi/.kunitconfig), integration/aurora 110861f plus this branch and the G17 watchdog change submitted alongside it: Ran 374 tests: passed: 372, skipped: 2, no new warnings in the touched files.
  • checkpatch.pl: no warnings.
  • Hardware: not yet: one-shot boot on a G17 Mac (A18 Pro / M4 Pro) with a GPU smoke and a two-client compute sharing row (one queue with a 30 s allowance submitting long GPU-filling commands back to back, another client submitting short ones), against the same row on the current fleet kernel.

Still to run

  • Generations to cover: G17P (A18 Pro / M4 Pro), M4 Max and M5, each with 0 SELinux denials, 0 failed units and 0 new kernel errors: two-client compute sharing (the waiting job completes after a forfeit), render behind a long compute job, and one client inside its 30 s allowance with no forfeit.
  • The hardware rows above, on the default command line.

Tested: run-host-tests --only g17 233/233 at 223077c (new case a_forfeited_blocker_is_failed_and_killed_on_timeout, mutants forfeit-spared/forfeit-unclassified killed); KUnit asahi 493/497 (4 skip); fleet-config asahi build OK. Hardware rows still owed (see the comments).
Risk: G17 compute watchdog on M4 Pro/Max, M5, A18 Pro; only a queue whose allowance was forfeited behaves differently (its command fails and its VM is lost, on M5 it is killed); queues inside their allowance with nobody waiting behave as before.

A compute command of a queue that asked for a watchdog allowance is not
failed while it runs inside that allowance, and work of another VM
queued behind it on the GPU is excused meanwhile. The excuse is bounded
per waiting job, the longest allowance the system permits, but every
command of the long queue starts an allowance of its own. When the
queue keeps submitting long commands, the waiting job runs out of its
excuse and its deferrals and is failed as spared, while the queue that
holds the GPU keeps running.

Charge the end of the excuse to the blocker instead. Once a waiting
job has used its whole excuse and is deferred behind a live blocker
that is still inside its allowance, the blocker loses the rest of its
allowance and its other renewals; its next expiry goes straight to
attribution, and the waiting job's remaining deferrals cover the
teardown. The blocker is failed as spared, not as hung.

The command the waiting job was first excused behind keeps its
allowance: it started before the wait, and an allowance placed late
(after a wait in publication) could otherwise end after the excuse. A
blocker that itself waits behind older work of the waiting job's VM
keeps it too, and a waiting job that is spared anyway does not take
the blocker with it.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Review at 732d813.

The mechanism holds together. A forfeit fires at most once per blocker, because within_allowance() goes false and Head::excused follows. Only blockers published before the waiting job qualify, and the Spared classify spares the whole blocker queue's active set. first_excuse uses 0 as "none", which is safe because next_publication() starts at 1. No new constants or parameters. Points:

  1. Fairness runs the other way now. Publication order is only evidence (port.rs:519-521; timeout.rs header). A client whose own compute command hangs or spins, published behind a long-allowance queue, is excused for excuse_limit and then takes the allowance from that queue's second pre-wait command. compute_control.rs:53-57 then spares that queue's whole active set, and only after that is the hung command judged on its own. Before this change only the waiting command failed. So any client can now fail another client's legitimate in-allowance work by submitting one non-terminating dispatch. Can the forfeit require evidence that the waiting command has not started (e.g. its ring items not yet consumed by the firmware, cursors.consumed())? If not, please state this trade-off in the UAPI comment for compute_timeout_ms.
  2. timeout.rs:403-416: forfeits() fires at any Defer after the excuse is spent, whatever renewals is. At renewals == MAX_RENEWALS - 1 the blocker's next expiry (up to one poll later) and its teardown come after the waiting job's last renewal. Both then fail, which is worse than either policy alone. Consider requiring enough renewals left to cover one poll plus teardown.
  3. compute.rs:953-960: forfeit_head() compares the whole Head, including excused/finished recomputed with a fresh now_ns(), so an allowance that ends between the verdict and the forfeit just skips it. That's harmless, but say so or compare (vm, published) only.
  4. Rows: g17 drives t8140 (G17P), t6040/t6041 (M4 Pro/Max) and the G17M5 probe (t6050/g17s, where timeout_head().finished takes the m5 stamp path). The planned row is compute against compute on one Mac. Still owed: the same row on G17P (Neo) and on M4 Pro; a render-waits-behind-long-compute row (render watchdog path, backend.rs:463-473); a single-client row with a 30 s allowance and no other VM, showing no forfeit line and no regression; and the G17M5 smoke.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Review at 732d813 (non-author). Changes requested.

The host tests reproduce: --only g17 90/90, timeout tests 36/36, and the three new cases fail when Verdict::forfeits never fires. I then disabled the runtime half instead: the job.rs forfeited branch, the within_allowance term, the spared classification in compute_control.rs, and forfeit_head. The g17 host tests still pass 90/90, so only the predicate is covered. The UAPI header is unchanged apart from the comment. No gates, constants or parameters are added.

  1. Failing the blocker does not stop it. compute_control.rs:53-57 classifies the whole active set as spared when the forfeited command goes Own. Queue::timeout() then records a spared quarantine (queue/compute.rs:2386-2405), and Queue::timed_out() (queue/compute/exit.rs:139-145) requires !spared_quarantine, so it is false. There is no kill on M5, and the other G17 never kill an open queue. The command and those published behind it keep running, and the queue stays ahead of the other VMs as a failed head. The waiting job then gets Defer until MAX_RENEWALS and ends Own (timeout.rs:359); before this change it ended Spare. blockers_taking_turns_lose_their_allowance_not_the_waiting_job assumes the failed blocker is gone three polls later (timeout.rs:868). What in the driver makes that true? If the blocker is to be torn down, that needs a kill that works for an open, spared queue on every G17, and a test at the queue level. The owed-stamp fixture stubs allowance_forfeited, forfeit_allowance and classify.
  2. M5: a command that lost its allowance is no longer killed when its watchdog fails it, because it lands in the same spared quarantine. Before, it was killed at the end of its allowance. A command that does not terminate now keeps its queue until the owner closes it.
  3. The forfeit acts at the blocker's own next expiry. drm_sched_job_begin() re-arms that timer for every job the blocker's queue begins (sched_main.c:204). A queue that keeps beginning jobs pushes its expiry past the waiting job's renewals. Meanwhile within_allowance() is already false, so other waiting jobs stop being excused behind a command that is still being renewed.
  4. The decision rests on publication order alone. Take another client's command that simply does not finish, at the default allowance, with nothing actually waiting behind the long queue. It uses up its excuse and takes the allowance of the long queue's current command, and the commands published behind that one fail too. Before, only the unfinished command failed. Please require evidence that the waiting command has not started. Otherwise, state in the compute_timeout_ms comment that the queue's other published commands fail too, and that any other client's unfinished command can cause it.
  5. forfeits() fires at any Defer. At renewals == MAX_RENEWALS - 1, both commands end up failed.

Rows still owed before this can be judged on hardware:

  • the two-client compute row on G17P, M4 Pro and M5, showing the waiting command complete after the forfeit line
  • a render job waiting behind compute
  • a single-client 30 s allowance row with no forfeit line

Assisted-by: LLM (Claude:Opus 5.5)

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

Formal §1–§6 review at 732d813c51ad.

§1 (no model gating), §4 (human commit + Signed-off-by, clean-room, PR Assisted-by), and §6 (naming) pass, and host tests pass (host-tests green). However, there are functional, safety, and evidence blockers that prevent merge:

  1. Blocker — Forfeit does not stop the blocker and regresses M5 timeout kills (compute_control.rs:53-57, queue/compute.rs:2375-2395, queue/compute/exit.rs:139-145):
    • Classifying a forfeited blocker as Class::Spared causes Queue::timeout() to set self.spared_quarantine = true.
    • Queue::timed_out() requires !self.spared_quarantine, so it returns false on M5, suppressing open_timeout_kill(). A non-terminating compute dispatch that gets forfeited is therefore no longer killed on M5 (regression from base, where it was killed when its allowance ended).
    • On non-M5 G17, open queues are never killed either, so the blocker keeps running on the GPU and remains ahead as a failed head; the waiting job then exhausts MAX_RENEWALS and fails as Own (worse than Spare previously).
    • blockers_taking_turns_lose_their_allowance_not_the_waiting_job mocks the blocker disappearing 3 polls after forfeit, which does not reflect actual queue teardown, and g17-compute-owed-stamp-tests.py stubs forfeit_allowance()/allowance_forfeited(), leaving the runtime path uncovered.
  2. Blocker — Cross-VM DoS via publication-order-only forfeit (§3):
    • Verdict::forfeits() decides solely on publication order with no check that the waiting command has not started executing. Any client can submit a non-terminating job behind a legitimate long-allowance compute queue, wait out excuse_limit, forfeit the queue's next command, and cause compute_control.rs to fail that queue's entire active set. Either require evidence that the waiting job has not been consumed/started, or revisit the policy and document the exact failure semantics in include/uapi/drm/asahi_drm.h.
  3. Blocker — Expiry timing & late-renewal edge case:
    • Because forfeit only takes effect on the blocker's next watchdog expiry, a queue continuously beginning jobs re-arms its scheduler timer (drm_sched_job_begin()) and can delay expiry past the waiting job's remaining renewals while within_allowance() is already false.
    • Firing forfeits() at renewals == MAX_RENEWALS - 1 leaves too few renewals for the blocker to expire and drain, failing both jobs.
  4. Blocker — §5 hardware evidence missing:
    • No hardware runs have been completed yet. Before merge, this needs default-cmdline hardware rows (with 0 AVC / 0 failed units / 0 new kernel errors) across affected G17 generations (G17P, M4 Pro/Max, M5): two-client compute sharing showing the waiting job completing after forfeit, render-behind-long-compute, and single-client 30 s allowance with no forfeit.

@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) changes-requested A reviewer requested changes (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot) labels Nov 24, 2026
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Merge readiness at 0f8628f8: not ready yet

Check Detail
CI at head no failing: apple-build, KUnit dcp-topology
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes no requested by DjDeveloperr
Hardware row at head ok comment at 0f8628f8
Conflicts ok none
PR text adopt when you next edit add 'one-way' or 'two-way' in Risk (guide)

Areas: area:gpu

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

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

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 732d813c51ad

Blockers:

  1. drivers/gpu/drm/asahi/g17/compute_control.rs:53-57 with queue/compute.rs:2375-2395: a forfeited blocker is classed Class::Spared, which sets spared_quarantine, and Queue::timed_out() then returns false while that flag is set (queue/compute/exit.rs:139-145). So on M5 a blocker that used up its excuses is never killed on timeout. Fix: give the forfeit its own class that ends the allowance and still allows the timeout kill, and add a case for it.

Rows before merging: this G17 code is shared by M4, M5 and the Neo, so at the new head it needs one M5 run with a forfeited blocker killed on timeout, and one M4 or Neo run showing no change.

Checked: no Apple material, no gates.

@DjDeveloperr
DjDeveloperr dismissed their stale review November 24, 2026 23:34

Superseded by the review at 732d813

@github-actions github-actions Bot added the merge-conflict Conflicts with the base branch (bot) label Nov 26, 2026
A blocker that lost its allowance to another VM's waiting work was
classified spared when its own watchdog failed it. Queue::timeout() then
recorded a spared quarantine, and Queue::timed_out() is false while that
flag is set, so on M5 the open timeout kill never stopped it: a
forfeited dispatch that never ends kept its queue until the owner closed
it, where before the forfeit it was killed when its allowance ended.

Give the forfeit a class of its own, recovery::Class::Forfeited. It is
not spared: its timeout fails its VM as for any command past its
allowance, its queue's quarantine is not a spared one, so the queue
never returns to service, and on M5 the timeout kill applies. That keeps
open_timeout_kill()'s premise that the owner's VM has already failed;
the kill names every queue of the context, sibling channels included,
so it must not reach a VM that can still submit to them. A later
zero-duration record keeps the class, as it keeps a recovery's.

The UAPI comment now says the settled command fails with -ETIMEDOUT, as
a lost device, with the commands queued behind it.

The compute owed-stamp host test now compiles the real Queue::classify()
and Queue::timed_out() and checks that a forfeited blocker is classed
forfeited with its active set, fails with ETIMEDOUT and fails its VM,
holds a non-spared quarantine and is due for the M5 kill; two new
mutations (forfeit classed spared again, or not classified) fail it.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide requested review from a team as code owners November 27, 2026 13:57
@github-actions github-actions Bot removed the merge-conflict Conflicts with the base branch (bot) label Nov 27, 2026
@RyanTheTide

RyanTheTide commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

@DjDeveloperr, I've pushed a fix for your blocker. The branch is forward-merged onto main fca33ed6, which is after the #3302 revert. New head: 223077c3. Please re-review.

Blocker: a forfeited blocker was classed Spared, so M5 never killed it

223077c3 adds a third recovery class, Class::Forfeited (g17/recovery.rs:135-140), and threads it through Completion::classify (g17/completion.rs:771, forfeited() at :786).

  • runtime/compute_control.rs:50-61: Decision::Spare still classes the active set Spared. Decision::Own on a packet whose allowance was forfeited now classes it Forfeited.
  • Completion::spared() is false for forfeited work. So Queue::timeout() records an ordinary quarantine, not a spared one (return_spared), and Queue::timed_out() stays true on M5. open_timeout_kill() then kills the queue once its quarantine delay has passed, as it does for any command past its allowance.
  • queue/compute.rs:1504-1508 (classify_unexecuted): a later zero-duration record keeps the forfeited class, as it keeps a recovery's.
  • I also took point 3 of the 11-22 review: the forfeit_head() doc now says the whole Head is compared, so a command whose allowance ended between the verdict and the forfeit is skipped.

open_timeout_kill()'s premise ("the owner's VM has already failed")

I checked whether a forfeited blocker could keep its VM, the way spared work does. It cannot do so safely:

  • The kill is a ContextKill of the whole context.
  • publish_compute_exit() puts every compute queue bound to that context into the kill scope, and it puts the context's render slots in too (exit_scope).
  • It records the exit only on queues that are exit_candidates.
  • A healthy sibling channel of a multi-channel context would therefore be killed in firmware without its work being settled.
  • A VM that is still live could also keep submitting to that killed context: only a failed VM status (EIO in publication_preflight) stops that.

So Forfeited is not spared. Queue::quarantine() hands the first non-spared command's status back, and timeout_compute() fails the VM with ETIMEDOUT, exactly as for any command that runs past its allowance. The premise holds unchanged. I wrote this reasoning down at queue/compute/exit.rs:146-155.

Consequence: a forfeit costs the blocker's client its device, not only that queue's commands as under the old Spared classing. This is the base behaviour at the end of an allowance. The compute_timeout_ms UAPI comment now says so (include/uapi/drm/asahi_drm.h:1349-1351: "-ETIMEDOUT as a lost device, together with the commands queued behind it"). It also makes the cross-VM trade-off in your 11-22 §3 (and RyanTheTide's points 1 and 4) sharper. A client whose unfinished command forfeits a long-allowance queue now fails that queue's VM. The forfeit still requires excuse.used >= limit (the longest system allowance), a live in-allowance blocker published before the waiting job, and not the first-excused command. If you want the forfeit to need evidence that the waiting command has not started (cursors.consumed()), that is a policy change beyond this blocker. Tell me and I'll do it here.

Test case (tools/asahi/g17-compute-owed-stamp-tests.py:586, a_forfeited_blocker_is_failed_and_killed_on_timeout)

The fixture now compiles the real Queue::classify() and exit.rs Queue::timed_out() instead of a stub classify. The forfeit flag on the fixture packet is real state. The test checks:

  • on M5 and G17P, a forfeited head is classed Forfeited with its active set;
  • both commands fail with ETIMEDOUT;
  • fail_vm(ETIMEDOUT) runs;
  • the quarantine is not spared;
  • timed_out() equals m5;
  • an unforfeited Own stays unclassified;
  • Spared work keeps its VM and is never timed_out().

Tests at 223077c3

  • run-host-tests.py --only g17: 233/233 (231 on the bare merge, plus the 2 new mutation runs).
  • Whole run-host-tests.py: 729/729 in 217 s (with GIT_NO_LAZY_FETCH=1). An earlier run showed 8 timeouts. These came from the g15 tests' lazy fetch of a commit GitHub no longer has (harness issue, fixed by linux#3394) and from the load that fetch put on the box. They were not failures.
  • KUnit (kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/asahi/.kunitconfig): Ran 497 tests: passed 493, skipped 4.
  • Fleet config (fleet O= .config, LLVM=1): prepare and drivers/gpu/drm/asahi/ build. There are 17 warnings, all already on main (g16, memacct, g17 availability/admission/outstanding) and none in the files this PR touches.

Mutants (each must fail the new case; all did):

  • forfeit-spared: the old Class::Spared for a forfeit, i.e. the fix reverted. Fails at the class assertion.
  • forfeit-unclassified: the forfeit is not classed at all. Fails.
  • The existing owed-classified mutant was re-pointed at the reformatted line and still fails.

Both new mutants are registered in run-host-tests.py.

Still open from the 11-22 reviews, not changed here:

  • the forfeit acts at the blocker's own next expiry, which drm_sched_job_begin() re-arms;
  • forfeits() fires at renewals == MAX_RENEWALS - 1;
  • the publication-order-only trigger (see above).

Rows owed at 223077c: M5 (forfeited blocker killed on timeout) from @DjDeveloperr or an M5 owner; M4 Pro (J616s) no-change row by FIXUP-A.

Tested: run-host-tests 729/729 (--only g17 233/233); KUnit asahi 493/497 (4 skip); fleet-config asahi build OK; mutants forfeit-spared and forfeit-unclassified both killed.
Risk: G17 compute watchdog (M4 Pro/Max, M5, A18 Pro). Only commands that lost their allowance to a forfeit change: they now fail their VM and, on M5, are killed instead of being spared. Nothing else is classed differently.

@github-actions github-actions Bot added blast:m4 Macs affected, from Merge risk (bot) blast:m5 Macs affected, from Merge risk (bot) and removed needs-hw-row No hardware row at the PR head (bot) labels Nov 27, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

No-change rows at this head (223077c). Both ran the combined fixa5 test kernel, linux main fca33ed plus the heads of #2887 #2959 #3384 #2919 #2393 #2895. Eleven of the twelve files this PR changes are byte-identical to this head. tools/asahi/run-host-tests.py also carries the other PRs' registrations, and nothing else differs from this head there. One-shot BLS entries, default command line.

M4 Pro (T6040, J616s):

  • 0 failed units, Enforcing, 0 AVC denials, 0 oopses, 0 err-level kernel lines. s2idle x1 rc=0.
  • dEQP-VK api.smoke.* 8/8 and draw.renderpass.simple_draw.* 4/4. glmark2 off-screen 22375.
  • gpubench submit.empty, compute.light, compute.heavy (alu) and render.light, all rc=0.
  • Multi-client load: glmark2, gpubench compute.heavy 30 s, 883 dEQP runs and 3 host-checked qpair render+compute clients, all passing.
  • Pool churn: 392 host-checked qpair processes, 0 errors.
  • 0 GPU fault, timeout, crash or recovery lines. No compute-watchdog, allowance or forfeit lines.

A18 Pro (T8140, J700):

  • Two one-shot boots: 0 failed units, Enforcing, 0 AVC denials.
  • dEQP-VK api.smoke.* 8/8 and simple_draw 4/4 on each. glmark2 9986 / 10244.
  • gpubench 0dae261 perf.list, 41 cases x 2 boots, all status ok.
  • 30 min idle soak, s2idle x3 rc=0.
  • 0 GPU fault, timeout, crash or recovery lines.

Neither row ran a compute job long enough to reach its 30 s allowance, so neither row exercised Class::Forfeited. These are no-regression rows only. Still owed, as the PR body says: the two-client compute sharing row (a 30 s-allowance blocker forfeiting to a waiting client), render behind a long compute job, and the M4 Max / M5 rows.

Both Macs were restored to fleet89 and verified: saved entry unchanged, next_entry empty, test kernel removed, Enforcing, 0 failed units.

Evidence (lab store): traces/kernel/20261128-fixa5-rows/{j616s,neo}/. Kit: kits/test/20261128-fixa5/ (README).

@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 223077c3

Blockers: none (re-run the cancelled readiness check before landing; 21/21 build/host/KUnit/pr-text checks green).

Checked:

  • drivers/gpu/drm/asahi/g17/recovery.rs, completion.rs, compute_control.rs, queue/compute.rs, queue/compute/exit.rs: commit 223077c3 cleanly resolves the prior M5 timeout-kill blocker by introducing Class::Forfeited (3) distinct from Class::Spared (1), so a forfeited blocker does not set spared_quarantine, fails its VM on timeout, and kills its context on M5 rather than stalling indefinitely.
  • Host tests & mutations (tools/asahi/g17-compute-owed-stamp-tests.py, run-host-tests.py) and 21/21 CI jobs pass; exact-head no-change hardware rows PASS on M4 Pro (J616s) and peers (fixa5); MERGEABLE on main.
  • Checked for Apple material, tool attribution, private serials, and gating: clean; human Signed-off-by present.
Evidence
  • Head: 223077c37716 (base: main, mergeable: MERGEABLE, +366/-47 across 12 files).

@github-actions github-actions Bot added the merge-conflict Conflicts with the base branch (bot) label Nov 28, 2026
main's #2228 builds the g17 packet in its allocation; the two fields
this branch adds (forfeited, first_excuse) move into the new in-place
initialiser. The forfeit logic is unchanged.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Forward-merged main into this branch, new head 45f59d7 (no force push). The only conflict was `g17/job.rs`: main's #2228 now builds the packet inside its allocation (`init_with(init!(Self { .. }))` followed by `Ok(packet.into())`). I moved this PR's two new fields, `forfeited` and `first_excuse`, into that new initialiser and dropped the old `GFP_KERNEL)?)` form. Compared with main, the merge adds exactly what the PR already added: the struct fields, their initialisers and the forfeit methods. The forfeit and excuse logic is byte-identical to 223077c.
Tests: `tools/asahi/run-host-tests.py --only g17` on the merge, 253/253 passed. I did not run an asahi KUnit or a full kernel build locally because the buildbox is saturated; CI covers both at this head.
The J616s and J700 rows at 223077c still count: the merge changes only how the packet is allocated, not the forfeit path. Still needed: CI green, App re-review at 45f59d7, Dj's re-review or a dismissal of the 732d813 CR, and the known-gap issue for the two-client forfeit and M5 rows.

@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 45f59d73 — the #2228 g17/job.rs merge resolution is clean, but the branch is still CONFLICTING (DIRTY) against current main.

Blockers:

  1. Forward-merge current origin/main (8ebb0f75ae2d or later, no force push) to resolve the remaining conflicts: 45f59d7346 merged d2532e9034, which is 104 commits behind main, leaving conflicts across drivers/gpu/drm/asahi/g17/job.rs, g17/queue/compute.rs, g17/recovery.rs, g17/runtime/backend.rs, g17/timeout.rs, and tools/asahi/run-host-tests.py. While CONFLICTING, the PR cannot merge and pull_request CI cannot run.

Checked:

  • 45f59d7346 conflict resolution in drivers/gpu/drm/asahi/g17/job.rs: moving forfeited: AtomicBool::new(false) and first_excuse: AtomicU64::new(0) into the in-place init!(Self { ... }) initializer matches #2228 cleanly and keeps 223077c3's Class::Forfeited / Verdict::forfeits() logic byte-identical.
  • Live mergeability against main (8ebb0f75ae2d): CONFLICTING / DIRTY (19 CI checks queued/blocked).
Evidence
  • Head: 45f59d734677 (CONFLICTING / DIRTY against main 8ebb0f75ae2d).
  • Parent 2 of 45f59d7346 is d2532e9034 (104 commits behind 8ebb0f75ae2d).

@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) labels Nov 29, 2026
Forward-merge main. Main (e861dd8, M5 overtaken renewals) added
Packet::ordinal and now reports shared renewals in every give-up line
(GaveUp::new(.., true, ..)). job.rs keeps this branch's forfeited and
first_excuse fields beside main's ordinal, and both callers of
Timeout::settle() pass true so the forfeit path logs like main's.

The owed-stamp host test stand-in for recovery::note_retired() still
took no argument although main's retire() now passes the publication;
give it main's signature so the test builds again.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Forward-merged current main (2fd49a6) into this branch; new head 0f8628f (no force push).
g17/job.rs: kept this PR's forfeited/first_excuse packet fields beside main's new ordinal (e861dd8). Main now reports shared renewals in every give-up line (GaveUp::new(.., true, ..)), so both Timeout::settle() callers pass true; the forfeit logic is unchanged. compute.rs, recovery.rs, runtime/backend.rs, timeout.rs and run-host-tests.py merged cleanly.
The g17-compute-owed-stamp-tests stand-in for recovery::note_retired() now takes main's published argument; with the old stub that test did not build against main's retire().
Tests: tools/asahi run-host-tests.py --only g17: 276/276 passed (mutations included).
Still needed: CI at the merge head (apple-build + asahi KUnit), an App re-review, and Dj's re-review of the 732d813 change request.

@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 0f8628f81b82

Blockers: None (wait for the 19 queued CI checks at 0f8628f81b82 to finish green and for @DjDeveloperr to re-review/dismiss the prior 732d813c change request).

Checked:

  • Forward-merge 0f8628f81b82 (main 2fd49a614f3d): Cleanly resolves the 45f59d73 merge conflicts (MERGEABLE on main):
    • drivers/gpu/drm/asahi/g17/job.rs: keeps forfeited: AtomicBool::new(false) and first_excuse: AtomicU64::new(0) beside main's ordinal: AtomicU64::new(0) inside init!(Self { ... }); both Timeout::settle() call sites pass renews_shared = true matching main's GaveUp::new(.., true, ..).
    • drivers/gpu/drm/asahi/g17/{completion.rs,queue/compute.rs,queue/compute/exit.rs,recovery.rs,runtime/backend.rs,runtime/compute_control.rs,timeout.rs}: Class::Forfeited (3), forfeit_head(), forfeit_blocker(), and Verdict::forfeits() logic remains intact from approved 223077c3.
    • tools/asahi/g17-compute-owed-stamp-tests.py: updates recovery::note_retired(_published: u64) to match main's retire() signature while keeping the a_forfeited_blocker_is_failed_and_killed_on_timeout test and forfeit-spared/forfeit-unclassified mutations (run-host-tests.py --only g17: 276/276 PASS).
  • Hardware evidence: Prior fixa5 J616s (M4 Pro) and J700 (A18 Pro) no-regression rows from 223077c3 stand (forfeit logic unchanged across the main merge).
  • Checked for Apple material, tool attribution, private serials, and gating: clean.
Evidence
  • Head: 0f8628f81b82 (base: main, mergeable: MERGEABLE, +367/-48 across 12 files).
  • Hosted CI at 0f8628f81b82: 3P/0 real failures/19Q (prior readiness cancelled; apple-build, host-tests, kunit, rust-build, asahi KUnit queued).

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) and removed ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) labels Nov 29, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

code-owner ping @DjDeveloperr: closeout merge at 0f8628f8. The App approved at this head. Rows: J616s + J700 no-change rows at the pre-merge head; the M5 two-client forfeit row is tracked in 3623. Your old change request at 732d813 is addressed: please dismiss it. Merging under the 6-point rule 1 h from now, once hosted CI at this head is green, unless you object.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merging under the 6-point rule (Ryan 09:29, permanent), at 0f8628f8. (1) The review App approved at this head. (2) Full CI is green. (3/4) Rows: J616s-+-J700-no-change-rows-at-the-pre-merge-head;-the-M5-two-client-f. (5) There's no blocking review. (6) Dj was pinged here 186 min ago with no objection. Revert: git revert -m 1 <merge>.

@RyanTheTide
RyanTheTide merged commit d02c84a into main Nov 29, 2026
23 of 27 checks passed
@RyanTheTide
RyanTheTide deleted the pr/g17-allowance-forfeit branch November 29, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpu Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) blast:m5 Macs affected, from Merge risk (bot) changes-requested A reviewer requested changes (bot) ci-failing A check failed at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants