Skip to content

drm/asahi: g16: rebuild a drained compute UMA manager without reseeding its pool - #3699

Merged
DjDeveloperr merged 12 commits into
mainfrom
feat/g16-uma-drained-rebuild
Dec 3, 2026
Merged

DjDeveloperr merged 12 commits into
mainfrom
feat/g16-uma-drained-rebuild

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

What: Rebuild a drained G16 compute UMA manager without rewriting its 64 KiB freelist when the freelist provably still holds its seed. With #3697's firmware idle power-off, #3695 rebuilds held managers after every idle gap. Before this change, that rebuild cost about 75 µs per wake on J773g. With this change, the combined tree is faster than #3697 alone on every compute row. Contains #3695; merge that first.

Tested:

Risk: two-way · M4 (T8132) and M3 (T6030/T8122), which share the g16 backend.

Not yet: J773g and J516s rows at the current head, together with #3695. The earlier rows (J773g at 106e864c, J516s at 61d33810) ran before #3695's merge with main's firmware-managed idle. No row has a GPU recovery with innocent compute in flight, or a sleep cycle. T8122 has none.

Details

The freelist is a ring of 16384 records holding 8192 pages:

  • The hardware takes pages at the head cursor and returns them at the tail cursor. Both wrap at the ring size.
  • Under drm/asahi: g16: keep compute UMA managers bound and ASC-cached #3695's in-flight hold, the firmware never saves those cursors, and the host can't read them.
  • A rebuild restarts the cursors at their seed (head 0, tail 8192). After a restart, returns fill records upwards from 8192 and only reach records 0–8191 after writing record 16383.
  • So while record 16383 still reads zero and record 0 still holds the first seed, records 0–8191 hold every page exactly once. Seed cursors then describe the drained pool exactly, wherever the hardware cursors were.

The rebuild reads those two records:

  • Both hold: it writes only the 160-byte manager record and the 16 pool-row words.
  • Otherwise: it reseeds as before and clears record 16383, so later rebuilds can trust the seed again.

Events that don't show in the freelist always force a reseed: system sleep, recovery, and a failed or aborted shared command. Each advances a seed generation in the slot ledger. Sleep and recovery go through a new restart_compute_uma(), and the idle path is unchanged.

No parameters, no SoC gates. The stats line gains a reseed count:

compute_uma: rebuilds N invalidations M idle_invalidations K reseeds R
Evidence

Setup:

Row #3697 alone combined Δ
compute.light procs d2 63.74 59.00 −7.4 %
compute.light procs d4 46.51 43.70 −6.0 %
compute.light procs d8 40.57 36.64 −9.7 %
compute.light queues d8 32.00 29.65 −7.3 %
compute.light queue d1 103.29 100.67 −2.5 %
compute.light queue d64 22.51 20.34 −9.6 %
sync.signal queues d2 25.94 23.63 −8.9 %
idle.wake 2 / 20 / 200 ms 149.8 / 196.4 / 461.7 145.2 / 195.2 / 459.0 −3.1 / −0.6 / −0.6 %

Every combined boot is faster than every #3697 boot on all rows except queue d1, where the boots overlap. Counters per combined boot: rebuilds ~300k idle_invalidations ~177k reseeds ~5.2k.

Bound measured before this change (same combined tree, one boot each):

Variant idle.wake 2 / 20 / 200 ms queue d1 procs d2
Rebuild with full reseed (#3695 + #3697 as is) 175 / 272 / 539 121.5 67.9
Reseed skipped unconditionally 145 / 193 / 458 99.1 59.0
No idle invalidation 142 / 192 / 458 101.2 58.3

So the reseed was the whole cost of the idle rebuild.

Correctness on every combined boot:

  • Pinned-CRC smoke 10/10: compute.uber uniform d4 b022fbaf, render.postfx msaa=4 d1/d2 668d6f0a, render.bindless_ubo 512 d2 1af53d5c, render.deferred tile msaa=4 d2 6dc74b48.
  • A physical PMGR sampler saw the GPU off in 16 of 16 fence-relative windows (~42 ms).
  • gpubench-stress-vk --test idle.wake passed: render plus a checked compute ring in one device across 2/20/200 ms gaps.
  • 0 GPU faults, recoveries, hang kills or quarantined owners.

A VM's shared compute UMA manager lived in a per-VM ASC-uncached
object next to its host-written counter. The firmware saves and
unbinds a manager whenever a command finishes with COMPLETED equal to
the counter. A client with one job at a time (8 processes in
compute.light procs) paid a save and a rebind on every job, with
every access to the manager uncached.

Map the managers as macOS 26B123 does. In the J773g Metal procs-d8
snapshot, each of the 8 compute managers
sits alone on its own page with leaf 0x443 (ASC write-back), each
counter is on a separate page, and an idle manager's counter equals
COMPLETED.

- Each hardware compute UMA slot gets two device-lifetime manager
  records, ASC-cached on their own pages and never freed: 1 MiB for
  all 32 slots, allocated on a slot's first use. The host rewrites
  only a record that the firmware's slot table cannot name, so each
  slot needs a second record.
- The counter stays on an uncached page of its own. While the
  manager has commands in flight it runs one past the submissions,
  so the firmware never saves the manager. When the manager's last
  command retires, the counter drops back to the submission count.
  An idle manager stays bound with its cursors in the hardware, and
  its counter equals COMPLETED, as on macOS.
- The firmware's bind loads only the incoming record and never saves
  the outgoing manager. In 26B123, the save runs only past the
  COMPLETED == *counter gate. So the host tracks which manager each
  slot holds:
  - The same manager keeps its record, with no host write.
  - Any other return waits for the manager's own commands to retire.
    That covers another VM's manager or a private SCS unit taking
    the slot, an idle power-down, a sleep and a recovery. The host
    then rebuilds a record the slot table does not name, and reseeds
    the drained freelist and pool rows with it.
  - A private unit waits for shared commands in its slot.
- The slot ledger keeps only identities and counts. As before, a
  closed VM's manager, pool and live-VM charge go when its last
  flight retires.
- The host never reads the cached manager. Retirement uses two
  receipts: the service stamp, which the firmware stores after its
  last access to the command's work, microsequence and manager; and
  the GPU end tick.

The firmware powers the GPU down after an idle delay, and that drops
the hardware state of a manager left bound. The host checks for this
only at a publication pass where it has nothing in flight and a
shared manager may be bound. It reads the firmware's powered flag,
which 26B123 and the T6030 firmware record, and treats every binding
as stale unless the flag shows the GPU powered. Firmware without the
flag keeps the GPU powered while it runs. Passes with work in flight
and render-only work read nothing.

Signed-off-by: DjDeveloperr <hey@djdev.me>
On J516s (T6030) the compute UMA idle check invalidated the held
managers at nearly every publication from an empty engine. The G15S
handoff byte at +0x638 does not read nonzero there while the GPU is
powered, so each such job rebuilt its manager record and reseeded its
64 KiB freelist. compute.light procs d2 went from 43.6 to 56.6 us. The
driver stats show the cost: about 5 us more prefix time per
publication, and 14 us more for each publication after the engine
drained. On J773g the byte reads 1 while the GPU is powered, so J773g
was not affected.

Trust the flag only after it has read nonzero at a publication pass
with nothing in flight. The GPU is then idle and powered, and only a
flag that tracks GPU power shows that. A flag that stays zero, or one
set only while work runs, never earns trust and invalidates nothing,
as on firmware without the flag. Bindings on such firmware rely on the
GPU staying powered while the firmware runs, which holds on J516s and
J773g today, and on the invalidation at system sleep and recovery. A
change that makes such firmware power the GPU down must first make the
flag earn trust.

Report the residency in aurora-g16/stats as
"compute_uma: rebuilds N invalidations M powered_flag 0|1".

Signed-off-by: DjDeveloperr <hey@djdev.me>
The error path after the compute UMA counter write-back completed only
the flight's own job with the error. Compute jobs folded into the
flight's group were left with fences that never signal. Complete them
with the error like the other fail-stop paths in retire_oldest.

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

Compute UMA managers stay bound across short idle gaps under the
in-flight hold, so their allocator cursors live only in the hardware,
and a GPU power-off drops them. The previous check trusted the
firmware's powered byte once it had read nonzero at idle. That byte is
not a validated witness of continuous power: it reads zero on G15S, so
nothing was ever invalidated there, and a byte seen high once does not
prove that the GPU stayed powered.

Decide from the power policy that boot actually sends instead. The
session records it with the final boot control. START with a zero
argument asks the firmware to wake the GPU and hold it powered, and the
firmware then never powers the GPU off on its own while idle (measured
on main: 0 of 16 checks off at 250 ms on J773g and J516s). Under that
hold a bound manager cannot be lost while idle, so nothing is
invalidated and the managers keep their fast reuse. System sleep and
recovery still invalidate, as before.

When a policy lets the firmware power the GPU off on its own, there is
no qualified power-loss witness yet (a firmware power-loss generation,
or a power hold that spans this check through the firmware's
consumption of the next kick). So every publication pass that finds
nothing in flight after retiring what it can, with a shared manager
held, invalidates the held managers. Their next commands rebuild into
the slot record that the firmware's slot table does not name. A pass
with work in flight invalidates nothing, because a flight in flight
keeps the GPU busy. A later change can replace this with a qualified
witness.

The change that releases the power hold must set the flag where it
sends that policy. The flag is set next to the START control, so such
a change conflicts with this one visibly instead of silently.

Drop the powered-byte heuristic and its stat. The stats line becomes
"compute_uma: rebuilds N invalidations M idle_invalidations K".

Signed-off-by: DjDeveloperr <hey@djdev.me>
…ng its pool

When a shared compute UMA manager's binding may be gone (it was
displaced, or the GPU may have powered off while idle), its next
command rebuilds its manager record. The rebuild also rewrote all 8192
freelist records (64 KiB of uncached writes) and the 16 pool-table
rows. When the firmware may power the GPU off on its own, every
publication with nothing in flight invalidates the held managers, so
nearly every job after an idle gap paid for that.

The freelist is a ring of 16384 records. The hardware takes pages at
the head cursor and returns them at the tail cursor, and both wrap at
the record count that bind loads with them. A rebuild restarts the
cursors at their seed: head 0, tail 8192. Taking a page only reads its
record; returning one writes the record at the tail. So after a
restart, returns fill the records from 8192 upwards, and none reaches
the first 8192 records before one has written the last record of the
ring. Until then the first 8192 records still hold the seed, every page
exactly once, and cursors at their seed describe the drained pool
exactly, wherever the hardware cursors were. Pages the hardware still
held when its cursors were lost do not matter: they are in the seed,
and with no command in flight no page is in use.

So the rebuild now reads two freelist records before it decides. The
last record reads zero until a return reaches it: the freelist is
zeroed when it is allocated, and a returned record holds a page
address. The first record still holds the first seed unless taking a
page wrote its record. If both hold, the rebuild writes only the
160-byte manager record and the 16 pool-row words. Otherwise it
reseeds the freelist as before and clears the last record, so that a
later rebuild can trust the seed again.

Some events do not show in the freelist. A system sleep, a recovery,
and a shared command that failed or was aborted advance a seed
generation in the slot ledger, and the next rebuild of every manager
then reseeds, whatever its freelist shows. Sleep and recovery call the
new restart_compute_uma(), which also invalidates the bindings; the
idle path still calls only invalidate_compute_uma().

On J773g, with #3695 and #3697 combined, skipping the reseed
unconditionally (idle invalidations unchanged, about 179k per boot)
measured:

  row                      as is         no reseed    no invalidation
  idle.wake 2/20/200 ms    175/272/539   145/193/458  142/192/458
  compute queue d1         121.5         99.1         101.2
  compute procs d2         67.9          59.0         58.3

That run passed the CRC smoke test 10/10 and the idle.wake stress with
checked compute, with the GPU physically off in 16 of 16 checks and no
faults. The reseed was the whole cost of the idle rebuild. This change
skips it only while the ring has not reached its end since the last
seed, which a run of short jobs between idle gaps never does.

The stats line gains the reseed count: "compute_uma: rebuilds N
invalidations M idle_invalidations K reseeds R".

Signed-off-by: DjDeveloperr <hey@djdev.me>
@DjDeveloperr
DjDeveloperr requested review from a team as code owners November 30, 2026 16:01
@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) blast:m3 Macs affected, from Merge risk (bot) blast:m4 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 30, 2026
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Merge readiness at e8a8a9bc: not ready yet

Check Detail
CI at head ok 11 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok comment at e8a8a9bc
Conflicts ok none
PR text ok Risk: two-way · M4 (T8132) and M3 (T6030/T8122), which share the g16 backend.

Areas: area:gpu

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

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: HOLD at 61d33810

Blockers:

  • Stacked on open PR #3695: targets feature branch feat/g16-uma-slot-records (not yet merged to main; full apple-build / host-tests / KUnit CI suites have not run on this feature-branch PR).
  • Pending hardware rows & exact-head SHA record: per Not yet, the J773g row on main without #3697 and the J516s row with #3697 are still pending, and pr-readiness flags Hardware row at head: no until a line naming head SHA 61d33810 with a Mac and result is recorded.

Checked:

  • Audited all production changes (drivers/gpu/drm/asahi/g16/poll.rs, recovery.rs, resources.rs, sleep.rs, slots.rs).
  • Verified pool_state and page_list are allocated with Class::Shared + Client::nc(...), so CPU r64/w64 reads/writes in uma_seed_intact() and reseed_uma_pool() are coherent with GPU/firmware writes.
  • Verified the freelist ring invariant in uma_seed_intact() (r64(last_uma_record(seeds)) == 0 && r64(0) == pool): on a drained pool, records[0..seeds) hold every pool page exactly once whenever the tail never wrapped through last_uma_record(seeds) and the first seed remains intact, and reseed_uma_pool() clears last_uma_record(seeds) when non-zero so later rebuilds recover the fast path.
  • Verified uma_seed_gen distrust paths cover system sleep (sleep.rs -> restart_compute_uma()), recovery (recovery.rs -> restart_compute_uma()), affected shared-compute errors (mark_dirty()), and aborts (quarantine()), and SharedComputeUmaInner::init_record() updates self.seed_gen on initial bind and after every intact-check/reseed.
  • Combined J773g ABBA row (#3699 + #3695 + #3697 vs #3697: -6% to -9.7% compute.light, 36,794 dEQP-VK Pass with 275,745 rebuilds and 2 reseeds, 0 faults) and 26/26 host tests (4 new) are clean; no code defects found.
Evidence
  • Head SHA: 61d33810c21377716c86e62ce2f7fe2ada64c572 (base=feat/g16-uma-slot-records, MERGEABLE, pr-text and readiness passed).

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

PASS — J773g (M4 mini, T8132 G16G) target row at 61d33810c21377716c86e62ce2f7fe2ada64c572. On main without #3697, every compute row is faster than main and matches #3695. With #3697, every row is faster than #3697 alone (see the body).

PASS — J516s (M3 Pro, T6030 G15S) second-generation row at 61d33810c21377716c86e62ce2f7fe2ada64c572 (via lab merge 6f929cd5 with #3697). The combined tree beats #3697 alone. Outputs match and there are no GPU faults.

J773g on main (no #3697)

Setup:

Row main this Δ
compute.light procs d2 / d4 / d8 / d16 62.56 / 46.77 / 40.76 / 40.26 58.01 / 42.94 / 36.38 / 35.44 −7.3 / −8.2 / −10.8 / −12.0 %
compute.light queues d2 / d4 / d8 61.69 / 41.74 / 31.86 57.74 / 38.52 / 29.05 −6.4 / −7.7 / −8.8 %
compute.light queue d64 22.33 20.07 −10.1 %
idle.wake 2 / 20 / 200 ms 152 / 197 / 274 149 / 192 / 259 −2 to −5 %
sync.signal host 162.73 159.08 −2.2 %
render.light procs d8 / queues d8 71.72 / 65.42 72.32 / 66.15 +0.8 / +1.1 % (boots overlap)
  • Compute rows: every boot of this change is faster than every main boot.
  • Correctness: pinned CRCs 10/10 on all four boots; 0 GPU faults, recoveries, hang kills or quarantined owners.
  • Counters: compute_uma: rebuilds 76 invalidations 0 idle_invalidations 0 reseeds 0. On main the GPU stays powered, so only the few displacement rebuilds happen, and none of them needed a reseed.

J516s with #3697 (M3 lead)

The run compares 98d103b8 (#3697) alone with lab merge 6f929cd5 (#3695 + this + #3697). Builds are native, from exact SHAs, on the same J516s config. The boot order is #3697, combined, combined, #3697. Values are medians µs across boot medians.

Row #3697 alone combined Δ
compute.light procs d2 / d4 / d8 46.61 / 29.97 / 25.87 45.17 / 29.13 / 24.78 −3.1 / −2.8 / −4.2 %
compute.light queues d8 24.85 22.81 −8.2 %
compute.light queue d64 16.42 15.31 −6.7 %
compute.light queue d1 85.50 88.37 +3.4 % (within the #3697 boots' spread, 80.3–90.7)
sync.signal queues d2 15.58 14.43 −7.4 %
idle.wake 2 / 20 / 200 ms 107.4 / 166.3 / 568.6 99.4 / 160.4 / 562.9 −7.5 / −3.6 / −1.0 %

On every boot:

  • the pinned CRCs matched 10/10;
  • the GPU was physically off in 16 of 16 windows;
  • the idle.wake stress with checked compute passed (824–992 checks, 0 errors);
  • there were 0 GPU faults, recoveries, hang kills or quarantined owners.

Counters per combined boot: rebuilds ~485k idle_invalidations ~228k reseeds 198–262.

On the earlier combined tree without this commit (e0efb60a), the same J516s rows cost procs d2 +25 % and queue d1 +54 %. This commit removes that cost.

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Nov 30, 2026
A recovery quarantines an aborted flight instead of retiring it, so its
commands stay counted in the compute UMA ledger of its slot for good:
uma_shared_flights, uma_private_flights and the manager's outstanding
count. prefix_compute waits on those counts before publish_prefix_body
checks the slot quarantine. An SCS command in a slot where a shared
flight was aborted, and a shared manager rebuilding in a slot where a
private flight was aborted, both returned EAGAIN forever. With nothing
else in flight the publication deadline then expired with ETIMEDOUT and
the whole GPU fail-stopped, where the job alone used to fail with EIO.

Check the quarantine with the other admission checks at the top of
publish_prefix_body, before any wait. A job's UMA mask is fixed when it
is prepared and nothing in between changes the quarantine, so a job in a
healthy slot takes the same path as before.

The host tests run those admission checks over the real slot ledger
after a shared and after a private flight is aborted in a slot.

Signed-off-by: DjDeveloperr <hey@djdev.me>
Brings in "drm/asahi: g16: fail compute in a quarantined UMA slot before waiting". No conflicts.

Signed-off-by: DjDeveloperr <hey@djdev.me>
@github-actions github-actions Bot added the needs-hw-row No hardware row at the PR head (bot) label Nov 30, 2026

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: HOLD at 106e864c

Blockers:

  • Stacked on open PR #3695 (base=feat/g16-uma-slot-records); retarget/rebase onto main once #3695 merges.
  • Hosted CI at 106e864c is still running (CI=PENDING).
  • Exact-head hardware confirmation at 106e864c is pending (posted J773g and J516s rows are at 61d33810).

Checked:

  • Verified 106e864c is a clean, conflict-free merge of #3695's 421240d7 (drm/asahi: g16: fail compute in a quarantined UMA slot before waiting) into previously audited 61d33810 (engine.rs, slots.rs, test-publication.py, test-resources.py), with no unintended changes to the drained-rebuild logic.
  • Verified J773g (on main and with #3697) and J516s second-generation rows posted at 61d33810.
Evidence
  • Diff 61d33810...106e864c matches 421240d7 file-for-file (engine.rs +9/-3, slots.rs +3/-2, test-publication.py +0/-1, test-resources.py +140/-0).
  • Ready once #3695 lands, this PR is retargeted onto main, hosted CI completes green, and head SHA is confirmed on hardware.

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

PASS — J773g (M4 mini, T8132 G16G) exact-head row at 106e864c4ffe695afb71cd78c9019592a3ec2309. Same compute speed as the earlier 61d33810 rows, no reseeds, stress and outputs clean.

  • Kernel: main dbfbced7 with this head's driver. The applied drivers/gpu/drm/asahi tree was checked equal to the head's (42465cdc); main has changed only drivers/accel/ane since this PR's base e6c7b032. No drm/asahi: allow firmware-managed GFX idle power-off #3697, so GFX stays powered. Borealis 285776c6af, gpubench ae90a40, SLC on both planes.

  • Compute rows, µs per job, two passes:

    Row this head earlier 61d33810 row (same suite)
    compute.light procs d8 37.05 / 36.99 36.64
    compute.light queues d8 30.29 / 29.57 29.65
    compute.light queue d64 20.30 / 20.36 20.34
    compute.light queue d1 98.5 / 99.1 —
    idle.wake 2 / 20 / 200 ms 143 / 191 / 268 —

    The earlier row measured −7..−10 % against main on these compute rows.

  • UMA manager counters: 50 rebuilds, 0 reseeds, 0 invalidations over the whole run (no power-off without drm/asahi: allow firmware-managed GFX idle power-off #3697, so nothing invalidates).

  • Checks:

    • idle.wake stress: 844/844 checks passed.
    • 10/10 pinned CRCs.
    • 0 GPU faults, recoveries or hang kills.
  • Afterwards: the Mac returned to its saved stock kernel and passed the stock checks.

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) and removed needs-hw-row No hardware row at the PR head (bot) labels Dec 1, 2026

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at 106e864c4ffe

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: - Verified 106e864c is a clean, conflict-free merge of #3695's 421240d7 (drm/asahi: g16: fail compute in a quarantined UMA slot before waiting) into previously audited 61d33810 (engine.rs, slots.rs, test-publication.py, test-resources.py), with no unintended changes to the drained-rebuild logic.

  • Verified J773g (on main and with #3697) and J516s second-generation rows posted at 61d33810.

Follow-ups (not blocking): Merge parent #3695 first; follow-ups: retarget, CI, head hardware confirmation

Main added the render UMA and PB record pools in g16/object.rs and
g16/resources.rs, and their mocks in the asahi-m4 resources test, at
the places where this branch adds the compute UMA manager records.
Keep both sides; the test module imports UniqueArc for main's pools.

Signed-off-by: DjDeveloperr <hey@djdev.me>
RyanTheTide
RyanTheTide previously approved these changes Dec 3, 2026

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 7cfc913 against the #3695 branch. Reuse is limited to drained managers whose uncached freelist still has both seed sentinels and an unchanged generation. Faults, aborts and restart force a reseed before reuse. The reported combined M3 and M4 rows support the optimization at their recorded revisions.

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

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at 7cfc913

Checked: The merge preserves the production proof before reusing a drained pool. The generation plus first and last freelist checks determine whether reseeding is required. The rows are rebuilt on either branch, and a reset or stale generation forces a fresh seed. The updated fixture retains the base's read counters and the author reports all 26 Asahi M4 host suites passing. Merge the parent #3695.

…build

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

Dropping the in-flight hold at publication, or the freelist distrust in
sleep_restart() or recover(), left every case passing. Check the three
call sites and their order.

Signed-off-by: DjDeveloperr <hey@djdev.me>
@DjDeveloperr
DjDeveloperr changed the base branch from feat/g16-uma-slot-records to main December 3, 2026 01:27
@DjDeveloperr
DjDeveloperr dismissed RyanTheTide’s stale review December 3, 2026 01:27

The base branch was changed.

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) and removed ci-failing A check failed at the PR head (bot) labels Dec 3, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

New head e8a8a9bcb43f, and the base is now main.

The push dismissed the approvals at 7cfc9130ed82, so this needs a new review.

Checks (local, pc): asahi-m4 host tests 26/26, arm64 W=1 of drivers/gpu/drm/asahi/ with no new warnings, checkpatch --strict clean.

Not covered by any row yet: innocent compute in flight across a GPU recovery while its manager is held (the cursors are only in the hardware then), and a sleep cycle with managers held.

Rows owed, together with #3695: J773g and J516s. T8122 has none; it keeps the GPU on, so only sleep and recovery invalidate there.

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

Checked: Compared the five G16 production patches relative to the old and new #3695 parents. The source additions and removals match in all five. The new publication and recovery assertions run against the exact source. The host suite passed 93/93. Removing the existing counter increment, sleep invalidation or recovery invalidation separately trips the new assertions. Merge parent #3695 first and land this immediately after it.

RyanTheTide
RyanTheTide previously approved these changes Dec 3, 2026

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed e8a8a9b. The freelist resource code matches the previous reviewed head. The new fixture checks the in-flight counter write and both restart paths before firmware can run again. This branch contains #3695 and retains the stated merge order.

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

Copy link
Copy Markdown
Contributor Author

J773g (Apple M4 Mac mini, Mac16,10, T8132, G16G B0, os-fw 27.2, desktop graphical.target) isolated hardware row at head e8a8a9bcb43f (tested in compA = #3695 @ bc7b1395c585 + #3699 @ e8a8a9bcb43f on main @ d1ae4f292b93, without #3340): PASS.

Build & Arm Identification

  • Kernel: 7.3.0-j773g-g16ready+ (identical Image 6dc091cb2e5f and t8132-j773g.dtb d1d7f79109cf, aurora.ko swap only)
  • base1 (main @ d1ae4f292b93): aurora-base.ko sha256 7f9f82c970be, boot 97f7e550-4f58-4115-abf4-f66c6c3a30d0
  • compA (#3695 @ bc7b1395c585 + #3699 @ e8a8a9bcb43f): aurora-compA.ko sha256 494045488e3e, boot 5ea52891-ad28-4f3a-8b0a-16433a287f1a

Results (base1 -> compA)

  • All commands: 0 failures (compA.fail empty, compA.err clean — both passes of compute.light [procs] d=16 pass cleanly; the VM_CREATE ENOSPC seen in the 3-PR composite is isolated exclusively to #3340).
  • UMA rebuild/reseed counters (aurora-g16/stats):
    • compute_uma: rebuilds 417566 invalidations 282242 idle_invalidations 282242 reseeds 7400 after bench, and rebuilds 610876 invalidations 339296 idle_invalidations 339296 reseeds 11612 after CTS + s2idle (98.1% of drained rebuilds completed without reseeding the pool).
    • health: failed 0 errno 0 degraded 0, gpu_lines=0, warn=0
    • compute_owners: retired 24 reusable 16, vm_bindings: live 30 handles 11 (post-sleep, matching base1 live 30 handles 11).
  • Benchmarks (us_per_submit median, lower is better):
    • compute.light [queue] d=1 / 4 / 16 / 32 / 64: -9.0% / -8.4% / -9.9% / -9.9% / -10.1%
    • compute.light [queues] d=2 / 4 / 8: -7.4% / -7.9% / -8.7%
    • compute.light [procs] d=2 / 4 / 8 / 16: -6.4% / -6.5% / -11.4% / -12.9%
    • sync.signal [queues] d=2: 26.06 -> 23.27 us (-10.7%)
    • idle.wake gap_ms=2 / 20 / 200: -1.5% / -3.0% / -4.6%
    • render.* / compute.heavy / transfer.ops: flat to -3.0%.
  • CTS (deqp-vk): compute_pipeline 103/117, compute_sample 1210/6756, multi_queue_3w 105/2439, 0 fails.
  • Stress & s2idle: stress-idle 2328/2328 PASS, stress-load 1940/1940 PASS, rtcwake -m freeze 2/2 PASS.

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Dec 3, 2026
DjDeveloperr added a commit that referenced this pull request Dec 3, 2026
…4-cached-uma

#3695 keeps the shared compute UMA managers in per-slot records and #3699
rebuilds drained ones. They replace this branch's ComputeUmaPool. The
widths, masks, client VA layout, the ASC-cached compute fw_stamp and its
recovery witness stay.

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

Copy link
Copy Markdown
Contributor Author

J516s (MacBook Pro 16" M3 Pro, Mac15,7, T6030, G15S B1, macOS 27.2 / 26B123 stub, headless with display manager stopped) isolated hardware row at head e8a8a9bcb43f (tested in compA = #3695 @ bc7b1395c585 + #3699 @ e8a8a9bcb43f on main @ cff875630c61, without #3340): PASS.

Build & Arm Identification

  • Kernel: 7.3.0-m3-s2r-gcff875630c61 (identical Image and t6030-j516s.dtb, aurora.ko swap only)
  • base (main @ cff875630c61): aurora.ko sha256 e9fa74e14022, boot 0d966b1e-03ce-4617-9ad3-6579fa451c89
  • compA (#3695 @ bc7b1395c585 + #3699 @ e8a8a9bcb43f): aurora.ko sha256 581c913c72f5, boot 4a24a4d0-713c-49ed-bf60-1618aa3b32f4
  • gpubench-vk 1f05885 (--verify, 2 passes × 6 runs × 250 ms)

Key Highlights (base vs compA, median us_per_submit)

  • compute.light queue d=16 / 32 / 64: 17.88 -> 15.73 us (-12.0%), 20.44 -> 16.15 us (-21.0%), 24.22 -> 20.04 us (-17.3%)
  • compute.light queues d=2 / 4 / 8: -9.1% / -6.7% / -7.5%
  • compute.light procs d=2 / 4 / 8 / 16: -4.3% / -1.2% / -7.6% / -6.0%
  • sync.signal queues d=2: 17.94 -> 15.74 us (-12.3%)
  • idle.wake (gap_ms=2 / 20 / 200): 413.09 / 514.10 / 517.17 -> 414.19 / 513.28 / 511.58 us (+0.3% / -0.2% / -1.1%)
  • Full benchmark table posted in the companion #3695 receipt.

Stress, Sleep, CTS & Health

  • compute_uma: rebuilds 1121036 invalidations 435543 idle_invalidations 435543 reseeds 1822 (idle invalidations active and clean across idle gaps, churn, and sleep).
  • gpubench-vk --verify: 0 CRC/status failures across all runs.
  • gpubench-stress-vk --test idle.wake: idle PASS (2064 checks), all-CPU load PASS (1936 checks).
  • 40-process VM churn (5 × compute.light procs d=8): PASS.
  • s2idle across live compute.light procs d=4 + post-sleep compute.light d=64 and render.postfx d=2: 0 -> 2 PASS.
  • Vulkan CTS (0 failures, 0 diffs vs base): compute_pipeline 103/117, compute_sample 1210/6756, multi_queue_3w 105/2439.
  • aurora-g16/stats: health: failed 0 errno 0 degraded 0, recovery_receipts: affected_full 0 aborted 0, jobs 4601105 recoveries 0 hang_kills 0, compute_owners: retired 24 quarantined 0 reusable 16, vm_bindings: live 22 handles 0.
  • Kernel logs: se61=0, gpu_lines=0, warn=0.

@github-actions github-actions Bot added the ready-to-merge Meets the merge policy: merge it (bot) label Dec 3, 2026
@DjDeveloperr
DjDeveloperr dismissed RyanTheTide’s stale review December 3, 2026 08:15

The merge-base changed after approval.

@github-actions github-actions Bot added needs-review No approving review from Core or Omarchy Mac yet (bot) and removed ready-to-merge Meets the merge policy: merge it (bot) labels Dec 3, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Local check of the merge with main, 2026-12-03.

  • Main 8ec8740a1e6f + drm/asahi: g16: keep compute UMA managers bound and ASC-cached #3695 bc7b1395c585 + this head e8a8a9bcb43f merges clean (tree e4484c5110c5).
  • Run in localhost/aurora-linux-host-tests:ubuntu2404, no network: python3 -I tools/asahi/run-host-tests.py --only <name>
    • asahi-m4: 26/26
    • pmgr-inherited 1/1, g15-display-order 1/1, m3-recovery 2/2, pool 6/6. No job is named uma.
  • asahi_core type-checks for arm64 on that tree with no errors (flags from a warm J773g build, main cff875630c61).
  • Rows at this head: J773g 7369521316 and J516s 7371496477, both PASS.

#3695 landed as f5bf8bf8d09a with the tested tree (60d183600d49). GitHub then dismissed RyanTheTide's approval of this head by itself ("The merge-base changed after approval."). The head has not changed since that review, the App approval at this head stands, and no change request is open, so this is an admin merge of the exact head.

Not run: the full host suite.

@DjDeveloperr
DjDeveloperr merged commit c09b612 into main Dec 3, 2026
16 of 19 checks passed
@DjDeveloperr
DjDeveloperr deleted the feat/g16-uma-drained-rebuild branch December 3, 2026 08:15
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:m3 Macs affected, from Merge risk (bot) blast:m4 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants