Skip to content

drm/asahi: m3: let queued compute submissions share a firmware batch - #2849

Open
RyanTheTide wants to merge 4 commits into
mainfrom
j615gpu/m3-compute-join
Open

RyanTheTide wants to merge 4 commits into
mainfrom
j615gpu/m3-compute-join

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 22, 2026 •

Copy link
Copy Markdown

Problem

On the M3 runtime (J613/J615), queued compute submissions never share a firmware batch. Later pending packets may join render batches only, so each vkQueueSubmit of compute work pays a full firmware round trip. The kernel then publishes the next batch only after full retirement. On a J615 (15-inch M3 Air, 27.2 firmware) that round trip is about 260 µs for a 182 ns shader, so a light compute job costs ~390 µs per submit even at queue depth 8. The Neo (A18 Pro) needs about 17 µs, on Linux and on macOS.

Change

  • may_join() no longer requires a render batch. A later packet of the same VM and urgency may extend a compute batch from its first command, as render batches already allow.
  • A compute batch grows past one command only under the GPU-time budget (m3_render_batch_budget_us) and with a measured per-VM GPU time per compute command (compute_cost, recorded at retirement like pass_cost). With no measurement yet, or with no budget, a batch is one command.
  • m3_compute_batch_size now defaults to the compute storage's slot count (m3_compute_storage::SLOTS) instead of 1. An explicit m3_compute_batch_override still bounds a packet's own commands, as before.
  • Each batched command keeps the 2 s completion deadline it had alone: the batch deadline is 2 s per command. A cost estimate that is too low can no longer turn valid work into a timeout.
  • A batch's packets are marked published only once every command is encoded. If a batch fails before anything reached the firmware, its new packets are unmarked and the front packet is retried alone, so a packet is failed only when it fails on its own.

No new parameters, no chip or board gate. It works on the default command line.

Testing

J615, one-shot kernel = fleet81 (1b940c26, the J615 default, which carries #2781) + the first commit, default command line, gpubench ae90a40, system Mesa, headless, silent.

In one boot, m3_compute_batch_override was flipped 0 / 1 / 0 / 1. At 0 the runtime uses this PR's default; 1 is the old behaviour, one command per batch. Microseconds per submit, lower is better:

gpubench row this PR old this PR old
compute.light, depth 8 178.2 394.9 173.6 396.8
render.light clear, depth 8 174.8 396.8 173.6 397.5
compute.heavy alu, depth 8 856.2 1207.7 844.6 1184.8
compute.heavy bw, depth 8 1644.7 1968.5 1644.7 1984.1
compute.light, depth 1 468.2 465.5 463.0 465.5
render.light tri, depth 8 500.0 500.0 500.0 500.0
  • A queued light compute submit costs 56% less, and heavy ALU compute 28% less. At depth 1 there is nothing to join, so nothing changes. render.light tri doesn't move: fleet81 lacks drm/asahi: m3: default to render batches of two #2090, and that row depends on the render batch size.
  • With the PR default the runtime retired 1.91 compute commands per firmware round trip, against 1.00 with the old behaviour. 0 firmware error events in all four legs.
  • gpubench-stress-vk --kernel-log at the default: all 10 tests that don't inject a GPU fault pass, about 940k checks, 0 firmware error lines.
  • Vulkan CTS 1.4.7.1, every dEQP-VK.compute.* case of our 636k-case lab sample (17,583 cases): 3,745 Pass, 13,838 NotSupported, 0 Fail. That matches the same sample on the previous J615 kernel exactly.
  • 0 AVC, 0 failed units. The J615 was back on its default kernel afterwards.
  • With the second commit (8eaf7613) on the J615: compute.light at depth 8 was 173.6 / 396.8 / 175.1 / 383.4 µs, gpubench-stress 10/10, 0 firmware error events.
  • At the head (79d1535a, one-shot kernel = fleet81 + all four commits, default command line), override 0 / 1 / 0 / 1 in one boot: compute.light depth 8 174.6 / 396.8 / 174.9 / 393.7 µs, compute.heavy alu depth 8 853.2 / 1179.2 / 853.2 / 1201.9 µs, compute.heavy bw depth 8 1644.7 / 1968.5 / 1644.7 / 1968.5 µs, render.light clear depth 8 174.6 / 374.3 / 176.6 / 393.7 µs. On a fresh boot of the same kernel, gpubench-stress-vk --kernel-log with the 10 non-fault tests: 10/10 pass (~704k checks), 0 firmware error lines. 0 AVC, 0 failed units; the J615 went back to its default kernel afterwards.

Host tests, at the head:

  • run-host-tests.py --only m3: 11/11 pass.
  • New m3-batch-select-tests.py runs the production next_batch() on host packets: an unmeasured compute cost gives one command, a measured cost caps the count at the budget, and a mutation without the admission check fails.
  • m3-batching-tests.rs: 17 tests, with the budget, deadline and publication cases.
  • checkpatch: only line-length warnings, in the style of the surrounding file.

Still to run

  • J613 (13-inch M3 Air): same runtime, same default, but the Extended compute profile, which has only ever run slot 0. The lab has no J613. Needed there: gpubench compute.light/heavy at depth 8 (A/B), gpubench-stress-vk, dEQP-VK.compute.*.
  • compute.long and life.fault in gpubench-stress-vk take the GPU down on the J615 with or without this change (firmware event 4, no recovery after a fault). That is the open fault-recovery item on drm/asahi: m3: run the M3 (T8122 G15G) GPU on the macOS 27.2 firmware #2781, not part of this PR.
Review points and where they are answered
  • 2 s deadline per batch against a batch sized by a smoothed cost: the deadline is 2 s x commands at both sites in poll_active() (policy::batch_deadline_secs). The example of a VM measured at ~100 µs that queues 16 x 200 ms still lands in one batch, which now has 32 s and needs 3.2 s. Its retirement corrects the estimate. Both steps are host tests.
  • mark_published() before encoding: with nothing in flight publish() marks after the last command is encoded, directly before the firmware is told. Behind a running batch it still marks first, because the firmware can consume an append without a doorbell. Errors that may have been published mark the batch in publish_next(). Unpublished errors unmark every packet whose first command was in the batch, so release_unpublished drops exactly the guards of packets the firmware never saw.
  • Blame for an encoding failure: a failed batch with joined packets is retried with the front packet alone. If that publishes, the next packet is tried as the front in turn. A packet is failed only when it fails as a batch of its own. A joined slot can also fail for batch reasons (slot or memory limits), so the joined packet is not failed directly.
  • Commit message numbers: the first commit's message quotes the earlier development kernel. The third commit's message carries the 0/1/0/1 numbers of the table above.
  • m3_render_batch_budget_us text: "disabled on Pro" is gone.
  • Host tests of the compute budget path: see Testing.
  • Known and unchanged (Extended profile only): an error from mark_binding_published() comes after the compute append and has no rollback. It predates this PR.
Method and raw data
  • Kernel: 7.3.0-aurora-pub4cjp = fleet81 1b940c26 + the first commit (tree identical to a700462), a J615-only module set, default command line, grub2-reboot one-shot.
  • Before the PR form, a dev kernel let compute join without the budget and without the new default. In-boot ABAB of the override 1 / 8 / 1 / 8: compute.light at depth 8 was 393.7 / 173.6 / 395.6 / 173.6 µs and compute.heavy alu at depth 8 was 1190 / 868 / 1168 / 845 µs. So the budget costs nothing on these rows.
  • Levers ruled out first, on the same J615 and the fleet81 default:
    • Completion-poll backoff, debugfs completion_wait 1000 / 25 / 1000 / 25: compute.light at depth 8 was 396 / 368 / 372 / 369 µs. Noise.
    • Firmware idle-off standby: a one-shot Stage 2 that only adds apple,idleoff-standby-timer = <2500> to the GPU node, run as A/B/A. compute.light at depth 8 was 396.8 / 396.8 / 388.8 µs. No effect.
    • The round trip is fixed time per batch, and this change spreads it across the commands in a batch.
  • Fairness: only packets of the same VM and urgency join, and the GPU-time budget (4000 µs) bounds each compute batch like a render batch. A VM's first compute batch has no measured cost yet, so it holds one command. Other clients wait at most one budgeted batch, as long as the measured cost holds; one batch can overrun when a VM's dispatches suddenly get heavier, and its retirement corrects the cost.
  • gpubench-stress-vk compute.long and life.fault take the GPU down on this J615 at the old setting too: firmware event 4 or a lost device, then no recovery for the rest of the boot. With the old behaviour selected they fail identically.
  • Evidence: our lab traces traces/gpu/20261123-j615-gpu-rtt (cjoin/, cjoin-pr/, cwait/, idleoff/).

The M3 runtime publishes one compute batch at a time and publishes the
next one only after the previous one fully retired. Later pending
packets could join render batches only, so every queued compute
submission paid its own firmware round trip. On a J615 (M3, 27.2
firmware) that round trip is about 260 us for a 182 ns shader, so a
light compute job costs ~390 us per vkQueueSubmit even at queue depth 8.

Let later packets of the same VM and urgency join a compute batch from
their first command, as render batches already do, and bound compute
batches by the same GPU-time budget as render batches, using a per-VM
measured GPU time per compute command. The compute batch size now
defaults to the compute storage's slot count; the budget and the
pending queue bound the batch in practice. The runtime knob
m3_compute_batch_override still wins when set.

On the J615 (one-shot kernel, in-boot ABAB of the batch size 1/8/1/8):
compute.light at depth 8 goes from 394 to 174 us per submit, a light
render clear from 363 to 173 us, heavy ALU compute from 1180 to 857 us,
with 0 firmware error events. gpubench-stress-vk passes every test that
does not inject a GPU fault.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Author

Review at a700462.

Thanks, the cross-packet join is small and the J615 data is convincing. A few problems before this becomes the default:

  1. m3_params.rs:213 also changes the default for J613. J613 runs the Extended compute profile (t8122_admission.rs:60), and until now it only ever ran slot 0 of the compute storage by default. With this change every queued compute submit on J613 uses slots 1..15, the Extended offsets (m3_compute.rs:303/307) and append() (m3_compute.rs:252), and none of that has run on hardware. The J615 rows only cover the Legacy profile. This needs a J613 row (gpubench compute.light/heavy at depth 8, stress-vk, dEQP-VK.compute.*) before merge.
  2. The 2 s completion timeout is per batch (m3_runtime.rs:737, :813), but the budget that sizes the batch is a prediction: a smoothed per-VM mean (compute_cost, m3_runtime.rs:912). Take a VM that measured ~100 us per command and then queues long dispatches, e.g. 16 x 200 ms. All 16 still pass within_budget (16 x 100 us < 4 ms) and land in one batch. The batch hits ETIMEDOUT and fail_active takes down the GPU with no recovery. Before this change each 200 ms dispatch had its own 2 s. Scale the deadline with entries.len(), or time out on per-slot progress, so that a wrong cost estimate cannot turn valid work into a fatal fault.
  3. Pre-publication failure attribution, m3_runtime.rs:419 and :434-449. mark_published() runs on every joined packet before append/set_attachments. If a joined packet's command fails there, publish returns (err,false) and fail_front (m3_runtime.rs:380) fails the front packet, which was valid. The joined packets stay pending with published=true, so a later unpublished failure keeps their VM guard (release_unpublished). Mark each packet only once its commands are encoded, or fail the packet whose entry failed.
  4. The m3_render_batch_budget_us doc (m3_params.rs:487-490) says "disabled on Pro", but this runtime only probes on T8122 (driver.rs:363-364). Drop that clause rather than extend it to compute.
  5. The commit message gives different numbers from the PR: "light render clear from 363", and an "ABAB of the batch size 1/8/1/8", which was the earlier dev kernel. Please quote the measurements of this commit.
  6. m3-batching-tests.rs: add a case for the compute budget path, i.e. unknown cost gives 1 command and a measured cost caps the count. Right now only may_join is covered.

Rows owed at this head: J613 (see 1). The other admitted T8122 boards, if any beyond J613/J615, need a boot plus the gpubench compute row.

Review follow-up for the compute batching change:

- Each batched command keeps the 2 s completion deadline it had when it
  was published alone: the batch deadline is now 2 s per command.
  Before, a batch of several long dispatches could exceed one 2 s
  deadline and fail the GPU although every command was in time.
- A compute batch grows past one command only under a GPU-time budget
  and once the VM's compute cost is measured, whether the commands come
  from the front packet or from later packets. Without a budget every
  compute batch is one command, as before. An explicit
  m3_compute_batch_override still bounds the front packet's own
  commands alone, as before; it never lets other packets join without
  the budget.
- If a batch that joined later packets fails before anything reached
  the firmware, the joined packets are marked unpublished again and the
  front packet is retried alone before it is failed, so it does not
  take the blame for a joined packet.

Host tests cover the admission rule and the deadline.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>

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

Pre-PR Checklist Review (§1–§6) — a700462ffa129c54018dcd7798bed7ccb056faa1

The cross-packet compute batch join is concise and the J615 A/B improvement (~56% latency reduction on queued compute.light) is solid, with clean §4 attribution (human author/committer + human Signed-off-by:, zero AI trailers in commit) and green host-tests CI. However, there are concrete safety/failure-mode blockers and missing §5 hardware coverage that need to be resolved before making multi-slot compute batching the default.

Blockers

  1. Fixed 2 s per-batch completion timeout vs. predictive compute_cost can fatally fault valid workloads (§2 / §3):

    • poll_active() (drivers/gpu/drm/asahi/m3/m3_runtime.rs:737, :813) enforces a fixed 2 s deadline per batch (batch.start.elapsed() >= Delta::from_secs(2)), and expiration triggers fail_active(ETIMEDOUT) -> capture_fault(), taking the GPU down unrecoverably for the rest of the boot.
    • next_batch() (m3_runtime.rs:261-274) bounds the batch using compute_cost (m3_runtime.rs:912), which is a smoothed historical per-VM mean. Previously (M3_COMPUTE_BATCH_SIZE = 1), every compute dispatch had its own 2 s timeout. With the default raised to SLOTS (16), a VM whose prior light dispatches establish a low compute_cost (e.g., ~100 µs) and that then queues heavier dispatches (e.g., 16 × 200 ms) passes within_budget() (16 × 100 µs = 1.6 ms <= 4 ms), lands all 16 commands in one batch, trips the fixed 2 s timeout, and permanently kills the GPU.
    • Scale the batch completion deadline with entries.len(), or track/extend the deadline on per-slot progress, so a stale cost estimate cannot turn valid compute submissions into a fatal GPU fault.
  2. Pre-publication failure misattribution and leaked VM quarantine (m3_runtime.rs:413, :431-452, :380) (§2 / §3):

    • publish() marks every packet in entries with p.mark_published() at m3_runtime.rs:413 before encoding any compute command (Compute::new / replay / append / prepare_completion / set_user_timestamps / set_attachments, lines 418-446).
    • If a joined packet (slot > 0) fails during encoding, publish() rolls back via j.abort_batch() and returns Err((error, false)), and publish_next() (m3_runtime.rs:380) calls self.fail_front(error). That fails pending[0] (a valid packet) while leaving the failing joined packet in pending, and leaves all joined packets permanently marked published = true (Packet::published is never cleared).
    • If a later unpublished failure hits fail_pending(), policy::release_unpublished(packet.may_be_published()) returns false for those never-published packets, permanently quarantining their VM job guards even though firmware never saw them.
    • Defer mark_published() on non-overlapping batches until after encoding succeeds (right before firmware-visible publication), and attribute pre-publication encoding failures to the failing packet rather than unconditionally failing pending[0].
  3. Missing J613 (Profile::Extended) hardware evidence before changing its default (§1 / §5):

    • Raising M3_COMPUTE_BATCH_SIZE (drivers/gpu/drm/asahi/m3/m3_params.rs:213) from 1 to SLOTS (16) also changes the default on J613, which runs Profile::Extended (t8122_admission.rs:60).
    • Until now J613 only ever exercised compute slot 0 by default; this change immediately puts J613 onto slots 1..15, Compute::append() (m3_compute.rs:252), and the Extended slot offsets (m3_compute.rs:303, :307, :314; m3_compute_storage.rs:106-110) with zero hardware runs on Profile::Extended.
    • Per §1 and §5, please provide a J613 hardware row at the updated head (gpubench compute.light/heavy depth 8 A/B, gpubench-stress-vk, dEQP-VK.compute.*, 0 AVC / 0 failed units / 0 new kernel errors) before enabling multi-slot compute batching by default there.

Non-blocking / Cleanup Items

  • Commit message numbers vs. PR measurements: The commit message still cites the earlier dev-kernel numbers (in-boot ABAB of the batch size 1/8/1/8, light render clear from 363) rather than this commit's actual 0/1/0/1 measurements reported in the PR body. Also, the PR body's "Still to run" still lists a Vulkan CTS compute subset even though the Testing section reports dEQP-VK.compute.* (17,583 cases, 3,745 Pass, 0 Fail).
  • Stale doc clause (m3_params.rs:489-490): m3_render_batch_budget_us still says disabled on Pro, even though the M3 runtime only probes on T8122 (driver.rs:363-364). Please drop that clause rather than extending it to compute.
  • Host test coverage (tools/asahi/m3-batching-tests.rs): Only may_join was updated; please add a test covering the compute budget path (unmeasured compute_cost admits 1 command; measured cost caps the batch count).

Assisted-by: LLM (Gemini 4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Author

Adversarial review record (independent reviewer, code only, before and after the fix commit).

  • First commit a700462: one blocker. A whole joined batch shared one 2 s completion deadline, so up to 16 long dispatches could time out together and fail the GPU. Also three should-fixes: compute batches had no bound without a budget (Pro), the budget capped the existing override path, and an early publish error failed the front packet and left joined packets marked published.
  • Fix commit 8eaf761: the deadline is 2 s per batched command. A compute batch grows past one command only under the GPU-time budget with a measured per-VM cost. An explicit override keeps today's front-packet behaviour. On an early error, joined packets are unpublished and the front packet is retried alone.
  • Re-review of 8eaf761: no blockers. The remaining nits (stale solo_next after an EBUSY wait costs one solo publish; no host test of next_batch selection itself) are noted and not blocking.
  • Hardware, final head on the J615 (one-shot, default cmdline): compute.light at depth 8 was 173.6 / 396.8 / 175.1 / 383.4 µs (this PR / old / this PR / old), gpubench-stress 10/10, 0 firmware error events.

Verdict from our side: ready for Dj's review. Still needed before merge: a J613 row.

Assisted-by: LLM (Claude:Opus 5.5)

publish() marked every packet of a batch published before it encoded
any command. When the encoding of a joined packet failed, nothing had
reached the firmware, but the packet stayed pending and marked. A later
failure of the pending queue then kept its VM job guard, and its VM
stayed quarantined for work the firmware never saw. The previous commit
unmarked joined packets on that path. Do it at the source instead:

- With nothing in flight, the batch's packets are marked only once
  every command is encoded, just before the firmware is told about the
  batch. Behind a running batch the firmware can consume an append
  without a doorbell, so there they are still marked first.
- If a batch fails before anything reached the firmware, every packet
  whose first command was in it is unmarked again, also when a batch
  behind a running one has to wait (EBUSY). A continuation keeps its
  mark.
- An error that may have been published marks the batch's packets in
  publish_next(), because it can now come from before the marking.

A failure of a batch with joined packets still retries the front packet
alone, so a packet is failed only when it fails as a batch of its own:
the front packet no longer takes the blame for a joined one, and a
joined one is tried as the front before it is failed.

Also drop "disabled on Pro" from the m3_render_batch_budget_us text:
this runtime only probes on T8122.

The first commit of this series quotes an earlier development kernel
(batch size 1/8/1/8, a light render clear from 363 us). Measured with
that commit itself on the J615, default command line, with
m3_compute_batch_override flipped 0/1/0/1 in one boot (0 is the new
default, 1 the old behaviour), in us per submit at depth 8:
compute.light 178.2/394.9/173.6/396.8, the light render clear
174.8/396.8/173.6/397.5, heavy ALU compute 856.2/1207.7/844.6/1184.8.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
m3-batch-select-tests.py runs the production next_batch() and batch
policy on queues of host packets: a VM without a measured compute cost
gets one command per batch, a measured cost caps the count at the
GPU-time budget, without a budget every batch is one command, and only
packets of the batch's VM and urgency join, from their first command.
It also covers the override, the solo retry and a stale cost: the
batch that a too low estimate admits stays within its deadline, and
its retirement corrects the estimate. A mutation that drops the
admission check must fail.

m3-batching-tests.rs gains the same budget cases on the policy alone,
and the rule that a batch which fails before publication leaves its
new packets unpublished.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Author

Thanks for the review. 9f4e653 and 79d1535 are pushed as new commits on top of 8eaf761 (no rewrite).

  • Deadline against a stale cost: 8eaf761 already scales the batch deadline to 2 s per command at both sites in poll_active(). 79d1535 adds host tests for your example (cost measured at ~100 µs, then 16 x 200 ms).
  • Publish before encode: 9f4e653 marks a batch's packets published only once every command is encoded. If nothing reached the firmware, the new packets are unmarked and the front packet is retried alone, so the guard release and the blame land on the packet that actually fails.
  • J613 row: still open. The lab has no J613, so that stays in "Still to run".

J615 at the head (79d1535): override 0/1/0/1 gives compute.light depth 8 at 174.6 / 396.8 / 174.9 / 393.7 µs. gpubench-stress-vk passes 10/10 on the non-fault tests with 0 firmware error lines. Details are in the updated body.

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

Formal §1–§6 pre-PR checklist re-review at 79d1535a7a5452c531506050f3ec6cba8cb51b97 (host-tests: green; mergeStateStatus: CLEAN).

Code & Safety Assessment — Prior Blockers 1 & 2 Resolved (0 code blockers)

  • Prior Blocker 1 (batch completion deadline & budget admission) — Resolved: policy::batch_deadline_secs() (drivers/gpu/drm/asahi/m3/m3_batch_policy.rs:35-37) scales the completion deadline to 2 s × commands at both poll_active() sites (m3_runtime.rs:758, :834), preventing a stale compute_cost estimate from tripping a fatal ETIMEDOUT. policy::admits() (m3_batch_policy.rs:26-31) ensures compute batches grow past 1 command only with a budget and a measured per-VM compute_cost, while preserving m3_compute_batch_override for the front packet alone.
  • Prior Blocker 2 (pre-publication failure attribution & VM guard quarantine) — Resolved: Non-overlapping publish() defers mark_published() until after command encoding (m3_runtime.rs:435, :528). publish_next() marks all entries on published errors (:375), clears first_publication packets on unpublished errors (:385), and retries the front packet alone via solo_next (:390-395) so joined-packet failures neither misattribute blame nor leak quarantined VM guards.
  • Prior nits & J615 re-verification — Resolved: m3_render_batch_budget_us drops the stale "disabled on Pro" clause, commit 9f4e653b records the 0/1/0/1 measurements, m3-batch-select-tests.py (with unbudgeted mutation check) and m3-batching-tests.rs (17 tests) cover the production next_batch() budget/deadline/publication paths, and J615 was re-tested at head 79d1535a (compute.light depth 8: 174.6 / 396.8 / 174.9 / 393.7 µs, gpubench-stress-vk 10/10, 0 FW errors, 0 AVC, 0 failed units).

Remaining §1 / §5 Blocker Holding APPROVE / MERGETRAIN-LINUX4

  • Prior Blocker 3 — Missing J613 (Profile::Extended) hardware row: Raising M3_COMPUTE_BATCH_SIZE from 1 to SLOTS (16) puts J613 (Profile::Extended) onto compute slots 1..15, Compute::append(), and Extended slot offsets by default with zero Profile::Extended hardware runs. Still open under ## Still to run. Holding APPROVE (prior CHANGES_REQUESTED remains active) until a J613 hardware + regression row lands.

Checklist Summary

  • §1 No model gating / multi-board coverage: Code clean; J613 (Profile::Extended) hardware coverage still owed.
  • §2 Production-ready: Pass — default cmdline, clean deadline/publication handling.
  • §3 Safety: Pass — stale cost cannot cause fatal timeout; unpublished failures do not misattribute or leak guards.
  • §4 Clean-room & attribution: Pass — all 4 commits carry human author/committer (Ryan Murray <ryan@aurorasilicon.org>) + human Signed-off-by: only, zero AI trailers in commits; Assisted-by: in PR body.
  • §5 Evidence: J615 head row + host tests green; withholding APPROVE strictly on the open J613 (Profile::Extended) hardware row.
  • §6 Naming: Pass.

Assisted-by: LLM (Gemini 4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Author

Review at 79d1535.

Three commits were added on top of a700462, with no rewrite. 8eaf761 adds admits(), the per-command deadline and the doc fix. 9f4e653 moves publication marking after encoding and adds the retry of the front packet alone (solo_next). 79d1535 adds the host tests m3-batching-tests.rs and m3-batch-select-tests.py.

Our points:

  1. J613 default (Extended profile, slots 1..15 and append() never run on hardware): still open. The lab has no J613. The code fix cannot close this, and there must be no chip gate, so the row has to come from outside: Dj's GPU-COORD list or a community J613 owner, running gpubench compute.light/heavy at depth 8, stress-vk and dEQP-VK.compute.*. This is the one merge blocker left.
  2. One shared 2 s deadline for the whole batch: fixed. batch_deadline_secs(n) gives 2 s per command at both poll_active() sites, and the host case covers the stale cost (16 x 200 ms after ~100 µs). The trade-off is worth a line in the commit message: a real hang in a full 16-command batch is now detected after 32 s rather than 2 s. Per-slot progress would avoid that. A follow-up is fine.
  3. Publish before encode and blame for failures: fixed. Packets are marked only once every command is encoded, except behind a running batch, where an append is firmware-visible. On an early error, packets whose first command was in the batch are unmarked (first_publication), and a batch with joined packets retries the front packet alone before anything is failed. I traced the EBUSY-with-overlap path: those errors are returned as early, so clearing there is consistent. The stale solo_next after an EBUSY wait costs one solo publish and is harmless (the other review notes it too).
  4. "Disabled on Pro" in the doc: fixed.
  5. The first commit's message still quotes the earlier dev kernel ("ABAB of the batch size 1/8/1/8", "light render clear from 363 us"). That is not fixed, because nothing was rewritten. Please fix it when the series is squashed or merged.
  6. Host test for the budget path: fixed. Unknown cost gives one command, a measured cost caps the count, and there are budget-0 and override cases.

No new issues beyond those notes. There are no new parameters, the budget/override params already exist, there is no SoC gate in the new code, and there are no agent trailers.

Verdict: NITS on the code (5, plus the hang-latency note). Merge stays blocked on the J613 row (point 1); owner TBD via Dj. The J615 rows at this head are done (compute.light d8 174.6 vs 396.8 µs, stress 10/10, 0 fw errors).

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

Formal §1–§6 pre-PR checklist re-review at 79d1535a7a5452c531506050f3ec6cba8cb51b97 (host-tests: green; mergeStateStatus: CLEAN; not superseded on integration/aurora).

Code, Safety & Attribution Assessment (0 code blockers)

  • §2 / §3 Correctness & Safety: Pass — all prior code blockers are resolved on 79d1535a7a54: policy::batch_deadline_secs() scales completion deadlines to 2 s × commands at both poll_active() sites (m3_runtime.rs:758, :834), policy::admits() gates compute batch growth on budget + measured per-VM compute_cost while preserving explicit m3_compute_batch_override for the front packet alone, non-overlapping publish() defers mark_published() until after encoding (:435, :528), first_publication clears unpublished packets on early error (:385), and solo_next retries the front packet alone (:390-395). m3-batch-select-tests.py (with unbudgeted mutation) and m3-batching-tests.rs (17 tests) pass, host-tests is green, and exact-head J615 A/B + gpubench-stress-vk (10/10, 0 FW errors, 0 AVC, 0 failed units) is verified.
  • §4 Clean-room & attribution: Pass — all 4 commits carry human author/committer (Ryan Murray <ryan@aurorasilicon.org>) and human Signed-off-by: only, zero AI commit trailers; Assisted-by: is at the end of the PR body.
  • §6 Naming: Pass.

Remaining §1 / §5 Blocker Holding APPROVE / MERGETRAIN-LINUX4

  • Missing J613 (Profile::Extended) exact-head hardware row: Raising M3_COMPUTE_BATCH_SIZE default (drivers/gpu/drm/asahi/m3/m3_params.rs:213) from 1 to SLOTS (16) moves J613 (Profile::Extended) onto compute slots 1..15, Compute::append(), and Extended slot offsets by default with zero Profile::Extended hardware runs. Still open under ## Still to run.
  • Required before approval: Exact-head (79d1535a7a54, default cmdline) J613 (Profile::Extended) hardware + regression row (gpubench compute.light/heavy depth 8 A/B, gpubench-stress-vk, dEQP-VK.compute.*, 0 firmware errors, 0 SELinux denials, 0 failed units, 0 new kernel errors).

Assisted-by: LLM (Gemini 4 Neon)

@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) changes-requested A reviewer requested changes (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

Copy link
Copy Markdown

Merge readiness at 79d1535a: not ready yet

Check Detail
CI at head ok 1 check passed
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 in the PR body at 79d1535a
Conflicts ok none
PR text adopt when you next edit add a 'Tested:' line; a 'Risk:' line (door and Macs) (guide)

Areas: area:gpu

Updated by pr-readiness on every push, edit and review, and every 30 minutes. Rules: merge policy · labels.

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) changes-requested A reviewer requested changes (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