Skip to content

drm/asahi: g17: no performance floor outside M5 - #2607

Merged
RyanTheTide merged 5 commits into
aurora-silicon:integration/aurorafrom
AxxzyWasTaken:g17-no-effort-floor
Nov 21, 2026
Merged

RyanTheTide merged 5 commits into
aurora-silicon:integration/aurorafrom
AxxzyWasTaken:g17-no-effort-floor

Conversation

@AxxzyWasTaken

@AxxzyWasTaken AxxzyWasTaken commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

The firmware takes the region C effort word (+0xe4) as a floor for its performance state. M5 already publishes none while work streams. The non-M5 G17 path (T8140, T6040, T6041) kept the full effort (0x10000) for as long as work kept arriving, and dropped it only after 16 ms without a submission. A game never leaves that gap, so the GPU sat at its top state. The firmware's own statistics show it: state 10 in every 0x1b report, while tag 0x1c's load word reads near zero on light loads.

This publishes no effort outside M5 and leaves the state to the firmware's own controller. M5's exception, the full effort while a host thread waits on a fence, isn't carried over: a game always has such a waiter, so with the exception the floor stays on. It's measured below as "M5 rule".

J616C (T6041, 25G83), CS2 offline de_dust2 fixed scene, FIFO 120, rails from SMC:

before after M5 rule
fps 120.0 120.0 120.0
GPU state (0x1b reports) 10 always 4-7 mostly (3-10) 10 always
GPU rail (PSVR) 35.1 W 25.2 W 35.3 W
SoC (PHPC) 39.9 W 31.3 W 40.4 W
system (PSTR) 52.0 W 42.0 W 52.7 W

A second "before" run gave 52.5 / 40.0 / 35.0 W.

Full load:

  • CS2 uncapped: 175.5-176.1 fps before, 176.1-176.4 after, state 10 in both. System power 74.3 W before, 72.3 W after.
  • A tight submit-and-wait loop (vkdep, 4 dependent dispatches + a copy per round) is about 5-9 % slower: 370-400 rounds/s before, 355-369 after. The runs are noisy. That's the cost of the firmware ramping up instead of starting at the top.
  • No GPU faults, recoveries or timeouts in any run.

The test build was the J616C's daily driver with a live module parameter that switched between the three behaviours, so all rows come from one boot. The patch itself passes tools/asahi/run-host-tests.py --only g17 (90/90) on integration/aurora 4e58401.

T6040 shows the same stuck state on 25G83: state 10 in 99.9 % of its reports, including idle and light paced loads (Ryan's J616s capture, traces/gpu/20261121-j616s-gpudvfs-pstate). T8140 takes this path too and is untested. A Neo row would be welcome.

Follow-up commits (from review). With no floor at all, submit-and-wait clients lost up to 2x on T6040. The next commits bring back full effort only while the GPU really runs without going idle (a busy run of 16 ms or more without a 2 ms idle gap). Otherwise they keep a graded floor just above the base state, and sleeping waits let the idle check take the effort down. The last commit (901f8cd1) keeps the busy run per client. With one GPU-wide run, another client's short command could restart the run during a long render, so the floor could lock CS2 at state 2 (62.6 fps on the J616C, once). J616C on the full head: CS2 FIFO 120 at 120 fps, SoC 34.9 W, on two boots with no faults (see the comments for the T6040 rows).

Assisted-by: LLM (Anthropic:Claude Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Rows from our two non-M5 G17 machines: a Neo (J700, T8140) and a J616s (T6040, 25G83). Both use the same method: the fleet76 kernel (integration e00fb9a) with two module builds that differ only by this diff, one boot per arm.

Power: the floor is real on both, and this removes it. With the patch, light paced work runs at state 1 instead of 10, at the same frame rate:

SMC PSTR (system) Neo before Neo after J616s before J616s after
idle 2.91 W 2.93 W 7.12 W 7.17 W
render 10 Hz 3.07 W 2.94 W 8.98 W 7.81 W
render 30 Hz 3.38 W 2.98 W 10.44 W 8.50 W
render 60 Hz 3.67 W 3.04 W 12.58 W 8.69 W
render 120 Hz, heavier 4.20 W 3.31 W 12.72 W 8.71 W
compute 60 Hz 3.62 W 3.01 W 12.45 W 8.69 W

But two regressions, so I don't think it can go in as is:

  1. GPU recoveries under concurrent load. The base module never hit any. With the patch, dEQP-VK at 4 workers produces G17: GPU recovery (reason Some(0)): firmware blamed queue N, failing its oldest render and a lost device for the test:

    • Neo, 672 synchronization cases with a geometry/tessellation stage: 0/30 runs before, 12/30 after (14 recoveries). Full 16541-case smoke: 0/13 before, 5/13 after.
    • J616s, same 672-case list: 0/30 before, 3/30 after.

    All 22 recoveries are the same render: a 16x16-tile, 1-layer geometry/tessellation-stage image write (the *image_64x64x8_r32_sfloat* sync cases), with no MMU fault. At 1 worker the same cases pass 90/90, so it needs other work in flight.

  2. Submit-and-wait loops stay at state 1 even when the GPU is fully busy. A GLES probe that calls glFinish every frame never ramps:

    unpaced, glFinish per frame Neo before Neo after J616s before J616s after
    60 quads/frame 1852 fps 649 fps (-65 %) 3804 fps 1503 fps (-60 %)
    1 quad/frame 3235 fps 1362 fps (-58 %) 7054 fps 3799 fps (-46 %)
    1 dispatch/frame 5420 fps 3033 fps (-44 %) 9891 fps 7254 fps (-27 %)

    Pipelined work does ramp (glmark2 terrain on the Neo: state 8-10 both ways, 714 vs 725). So the 5-9 % vkdep cost looks like the mild end; a strictly serialised client loses much more.

Method and raw numbers
  • Modules: module-only aurora.ko from the fleet76 tree (e00fb9a) with the shipped config. "Before" = unchanged source. "After" = this PR's diff (applies cleanly). The two builds have identical vermagic and undefined symbols.
  • Boot: the unchanged fleet76 kernel with modprobe.blacklist=aurora, then insmod of one arm. One boot per arm.
  • State = firmware stats tag 0x1b (word 1) polled every 5 ms from debugfs aurora-g17/firmware_reports. Power = SMC Total System Power from macsmc-hwmon at 2 Hz, mean over 40 s rows. Both machines were on AC.
  • Before, every paced row reports state 10 in 100 % of 0x1b snapshots on both machines. The only exceptions are the J616s's power-gated 10 Hz row (state 1 at power-up) and the Neo's terrain run (8-10). After, the paced rows report state 1, except the Neo's 120 Hz heavier row (state 1 73 %, state 10 24 %).
  • dEQP-VK 1.4.7.1, 4 workers, one deqp process per shard and run. Recovery count = GPU recovery (reason lines in each run's kernel log.
  • J616s: glmark2 did not run on its test boots, so it has no glmark2 rows. Its base arm had one unrelated 10 s render watchdog timeout in a ray_query case; that is not a recovery of this kind.
  • Example recovery (Neo): recovery render geometry ordinal=816323 width=16 height=16 layers=1 ... tvb_blocks: 32, GPU recovery: 2 commands were in flight (2 matched by stamp, 0 by queue); they fail instead of completing, GPU recovery (reason Some(0)): firmware blamed queue 5, failing its oldest render.

Assisted-by: LLM (Claude:Opus 5.5)

@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

Thanks for the two machines' worth of rows. They settle the power side, and both regressions are real. I've moved this back to draft.

Recoveries: I haven't reproduced them on the J616C yet. That's with the daily kernel carrying this PR, dEQP-VK 1.4.7.1 from neo-cts-kit-base2-v8, and 4 concurrent workers over the 420 synchronization.op.*write_image_{geometry,tess_*}*image_64x64x8_r32_sfloat* cases. Every run gave 240 Pass and 0 Fail, with 0 GPU recovery lines, 50 runs in a row. Your 672-case list is broader than mine. Could you post it (or the sharding) so I can run exactly the same set? Then the J616C row sits next to the J616s's 3/30.

Submit-and-wait: I measured only the mild end of this (vkdep, -5 to -9 %). A strictly serialised client never gives the firmware's own controller enough utilisation to ramp, and M5's rule doesn't help either: it puts the floor back whenever a host thread waits, and every game always has a waiter, so CS2 at 120 Hz went back to state 10 and the same power.

What I'd try next: keep no floor by default, and publish the full effort only while Feed's refill-gap detector reports the GPU starved by host round trips. That's 8+ passes in a row, each starting within 2 ms of the previous one's end, with idle at least a quarter of busy. Your glFinish loop should trip it, and a paced 120 Hz frame shouldn't. I still have to check that CS2's short gaps inside a frame don't trip it too. If they do, the detector needs a per-submission view rather than a per-pass one. I'll post rows for the glFinish probe (if you can share it), vkdep, CS2 FIFO 120 power and the concurrent sync list before taking this out of draft.

Disclosure: prepared with an AI tool (the commits carry Assisted-by: LLM); tested as described.

@AxxzyWasTaken
AxxzyWasTaken marked this pull request as draft November 20, 2026 23:37
@RyanTheTide

Copy link
Copy Markdown
Contributor

Adding to the Neo/J616s rows above, two code points:

  • sleep_quiet() (g17/runtime/events.rs:394) refuses while self.effort.applied() != 0. With this change submission_effort() returns 0 on every non-M5 SoC, so applied is always 0 there and that check never holds. Sleep then no longer waits for the idle check's Clear (g17/mod.rs:1060), which is also what drops effort_full and the CLPC demand (Port::set_effort_full, port.rs:539). If the check is meant as "the idle check has taken the effort down", as its comment says, testing self.effort.streaming() there would keep that meaning on non-M5. governor_tick() (mod.rs:973) has the same applied() != 0 test, but it returns early on non-M5 anyway.
  • A small unit test of submission_effort() for the four (m5, waited) cases would pin the policy down. The g17 host tests pass with this change, but nothing in them covers it.

On the policy itself, the comment's numbers point to keeping some floor for clients that submit and then block (the glFinish-per-frame rows), and dropping it only for pipelined streams like the CS2 case. The recoveries in the geometry/tessellation sync cases also need explaining before the floor goes away on T8140/T6040.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

RyanTheTide commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

@AxxzyWasTaken, here is the exact set and sharding from the Neo/J616s rows: https://gist.github.com/RyanTheTide/525b63d735047b2202a4490fbcf3194b

  • syncgeo.txt: the 672 cases, every synchronization.* / synchronization2.* case with a geometry or tessellation stage in the 16541-case smoke list. It's wider than your 420: it also has the cross_instance, timeline_semaphore and basic variants and the other write ops (blit, clear attachments, copy) in those stages.
  • Sharding: split -n r/4 (round-robin) into 4 shards, one deqp-vk process per shard, all four running at once. A shard that dies resumes after the case it was on. sg4.sh in the gist does exactly that and counts GPU recovery (reason lines per run. Run it as bash sg4.sh <cts dir> 30.
  • Same CTS build: VK-CTS 1.4.7.1. One run of the 672 takes about 15 s on the Neo.

All recoveries hit the *image_64x64x8_r32_sfloat* geometry/tess write cases, but only while the other shards had work in flight. At 1 worker the same cases passed 90/90.

Assisted-by: LLM (Claude:Opus 5.5)

@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

Two candidate fixes for the submit-and-wait regression, tested on my J616C (T6041, 25G83). Each ran on one boot with a live switch: "always" = before this PR, "v1" = this PR as posted, then the candidate. The daily kernel already carried #2612.

A. Floor only while Feed's refill-gap detector reports host-refill-bound work: rejected.

always v1 A
vkdep (rounds/s) 460-469 382-422 419-431
CS2 FIFO 120 52.0 W, state 10 44.8 W, states 4-7 52.9 W, state 10

vkdep's rounds are about 2.5 ms apart, more than the detector's 2 ms, so it never fires there. CS2's short gaps inside a frame do trip it.

B. M5's wait rule, counting only waits by the process that submitted the work: fixes vkdep, but not the power.

Each output fence records its submitter's tgid, and enable_signaling only counts the first waiter if it is that process. The idea was to stop a compositor waiting on a game's frames from keeping the floor up.

always v1 B
vkdep (rounds/s) 452-468 360-380 432-460
CS2 FIFO 120 (52.0 W) 47-49 fps, 22.6 W, state 1 120 fps, 52.6 W, state 10

The v1 CS2 row in this table is the important one. Earlier the same scene under v1 held 120 fps at states 4-7 and 44.8 W. On this boot it stayed at state 1 and ran at 48 fps. So the behaviour is bistable. CS2 waits on its own frames: once the GPU is slow, those waits block, the firmware sees too little utilisation to ramp, and the game never recovers. Your submit-and-wait regression also hits a real game, not only probes. B avoids it because CS2's own waits bring the floor back, but that also gives up CS2's saving.

Other rows:

  • My EGL-surfaceless glFinish probe comes up as zink here. It stays at about 3,600 fps under every rule, so it doesn't reproduce your GLES numbers. I'd still like your probe.
  • 4-worker dEQP over the 420 synchronization.op.*write_image_{geometry,tess_*}*r32_sfloat cases: 0 recoveries in 70 runs on the J616C, across v1, A and B.

Where this leaves it: neither a host-side timing rule nor a waiter rule separates "GPU on the critical path" from "paced game". Both misjudge one of vkdep and CS2. That supports your lane's plan to drive this from the firmware's own utilisation: the v1 stuck state is the firmware sitting at state 1 while a client is blocked on it. I'll run your commits on the J616C as soon as they're up. The local test branches, if they're useful: refill-gap candidate 00c8c73e, own-wait candidate on j616c/own-wait. This PR stays in draft until there's a fix.

Disclosure: prepared with an AI tool (the commits carry Assisted-by: LLM); tested as described.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Both regressions are explained now. Three commits on top of this PR fix them, on g17/2607-effort-fixes (9289e4c6..35be46ac), ready to cherry-pick:

  1. f0085cb3 g17: full effort while the GPU runs without going idle: fixes the submit-and-wait loss.
  2. eb16e104 g17: sleep waits for the idle check to take the effort down: the sleep_quiet() point from my earlier comment.
  3. 35be46ac g17: keep work above the base performance state: fixes the recoveries.

Recoveries. I traced the 7 runs that recovered on the Neo (8 recoveries; tracefs asahi_g17 events plus the firmware's 0x1b state reports). Every time, the firmware had walked the state down from 10 to 1 over about 0.5 s with plenty of work queued. It was at state 1, the base state it powers the GPU up in, when the GPU stopped. No command completed on any queue for 31-63 ms, and then the firmware asked for the restart (reason 0, no fault) and blamed a render that never started. The base never published zero effort while work was in flight, so this never happened there. The effort word turns out to be a graded floor, not on/off: it's a fraction of the top state's frequency (0.25, 0.5 and 0.75 put the Neo between the states around 367, 735 and 1102 MHz). Commit 3 publishes at least the first state above the base while work streams: f(state 2) / f(top), taken from the table the firmware is given (Neo 492/1470 MHz, J616s 618/1578 MHz).

Submit-and-wait. The firmware raises the state for work queued behind the running command, not for busy time. A glFinish loop keeps the GPU powered and about 90 % busy with nothing queued, and the firmware reports state 1 the whole time. Commit 1 tracks how long the GPU has run without going idle, from the firmware's own per-command start/end timestamps. A gap of the firmware's 2 ms power-off delay ends a run. Once a run outlasts the effort hold (16 ms), the effort goes to full until the idle check takes it down. Paced frames idle longer than 2 ms, so they stay on the floor.

Same-boot results (module builds of fleet76 + this PR + the commits; one boot per Mac; the policy switched at runtime by a test-only parameter that isn't in the commits):

this PR with the 3 commits base (full effort)
Neo: recovery runs, 672 geometry/tess sync cases, 4 workers 7/15 0/30 0/10
Neo: glFinish loop, 1 quad 1423 fps 3194 3182
Neo: glFinish loop, 60 quads 645 fps 1825 1848
Neo: 1 dispatch per wait 2939 fps 4940 5450
Neo: paced 60/120 Hz render, compute 60 Hz state 1 state 2 state 10
J616s: recovery runs 0/20 0/30 -
J616s: glFinish loop, 1 quad / 60 quads 3881 / 1526 fps 6881 / 3750 6846 / 3786
J616s: 60 Hz render, system power 8.68 W 9.01 W 12.25 W
J616s: 60 Hz compute, system power 8.07 W 8.73 W 12.25 W

So the floor costs a third to two thirds of a watt over this PR at 60 Hz on the J616s, and still saves 3.2-3.5 W against the base. Every paced row kept its frame rate.

Still to run:

  • The J616s 120 Hz render row on the final head. An earlier build bounded the busy run with the DT idle-hold policy, which is longer than a 120 Hz frame on the J616s, and so held state 10 there. The pushed head uses the firmware's 2 ms instead, which is what the Neo ran with: state 2 at 120 Hz.
  • Neo power as an interleaved A/B. The Neo's SMC reading drifted with time across the arms on this boot.
  • An M1 Pro / M2 no-regression row (the change is G17-only code).
  • Your J616C (T6041, 25G83) rows: CS2 at FIFO 120 for power, vkdep, and the concurrent sync list. Commit 3 applies there through the 25G83 path's perf table (state 2 of the T6041 table).
Method, traces and test details
  • Kit: dEQP-VK 1.4.7.1, the 672 synchronization* cases with a geometry or tessellation stage from the smoke list, 4 workers, looped. Each run is traced (tracefs asahi_g17 report/publish/complete/message/schedule, plus debugfs firmware_reports polled every 5 ms). The trace is kept when the run recovers.
  • Recovery timeline, one example (Neo, drm/asahi: g17: no performance floor outside M5 #2607): the state reports step down 10→9→…→2→1 between −0.50 s and −0.06 s. A 2→1 step lands 0.4 ms before the last completion of any command, 31 ms before the restart request. The other 6 runs look the same: in all 7 the last report before the stall is state 1.
  • Effort sweep (fixed effort word, paced 60 Hz render): 0 → state 1; 0x4000 → 1/2; 0x8000 → 3/4; 0xc000 → 6/7; 0x10000 → 10.
  • A fixed 0x8000 effort (states 3 and up, transitions above that still happening) gave 0/15 recovery runs. The stall goes with the base state, not with DVFS steps in general.
  • The floor's base state is the one the table's B curve gives no relative performance (on T6040 the loader's apple,perf-base-pstate). The 25G83 builder takes the floor from the perf table it resolves (calibration or chip table), so the T6040 placeholder table is never used for it.
  • tools/asahi/run-host-tests.py --only g17: 90/90 on the final head. New KUnit tests cover BusyRun (submit-and-wait vs paced vs late completions), the effort's bound clear, and active_effort (the Neo table → 0x55af; a table with no frequency above the base is refused). I also ran them on the host with a rustc shim.
  • glmark2 on the Neo (one run each, both at state 10): build 11108 vs 11835, terrain 746 vs 730. I'll repeat build before calling it either way.

Assisted-by: LLM (Claude:Opus 5.5)

@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

J616C (T6041, 25G83) rows for g17/2607-effort-fixes, headless only tonight. CS2 FIFO 120 power needs a desktop session and follows in the morning.

Build: this Mac's daily GPU driver (#2607 v1 + #2612's wide pool window on the ia33 daily tree) plus the three commits, cherry-picked. Two small conflicts: in mod.rs I kept the daily's power::submission_effort() (the light-effort path the daily still has) next to your note_bound(...) line, and in power.rs the daily's AtomicBool import. aurora.ko 70af018e. One boot, run as root.

Firmware words (firmware_reports, sampled every 20 ms):

  • idle: 0x1b w3 = 2, w11 = 296; 0x1c w11 = 200
  • vkdep (submit-and-wait, 4 dependent dispatches + copy per round), 3 runs: 0x1b/0x1c w3 = 2, w11 = 200 throughout, load words w5/w6 0-1 %

So the graded floor works here: state 2 / w11 200, where v1 gave state 1 / w11 100. (My earlier sweep through a separate override module read w11 = 1000 for every nonzero effort, so that module's path must have published something else. Your reading of the units is the one that holds.)

Throughput:

  • vkdep 316 / 337 / 329 rounds/s. For comparison, at the same login screen on this Mac: v1 327, always full 389. So this loop doesn't get the full-effort path. I assume its rounds leave firmware power-off gaps (2 ms idle-off), so "running without going idle for longer than the hold" never starts. vkdep is a strict submit → wait → submit loop with tiny dispatches, so it may be a useful second probe next to your glFinish one.
  • gltight (EGL surfaceless, comes up as zink on this stack; glFinish every frame): 3,722 fps at 60 quads, 3,682 at 1 quad. That's the same as every earlier rule here, so it doesn't exercise the path on this stack.

Concurrent sync: 4-worker dEQP over the 420 synchronization.op.*write_image_{geometry,tess_*}*r32_sfloat cases, 0/30 runs with recoveries, 240 Pass each. This Mac never reproduced the recovery, though (0/80 on v1), so this only shows no regression here.

GPU faults, recoveries, timeouts: 0.

Next: CS2 FIFO 120 (power, state histogram, fps) on this build vs v1 once the user's session is up. I'll put it here.

Disclosure: prepared with an AI tool (the commits carry Assisted-by: LLM); tested as described.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks, that settles the T6041 side of the floor: state 2 / w11 200 under load, with no faults or recoveries.

vkdep: your reading is right. Here are the numbers. At 389 rounds/s with the full effort a round takes 2.57 ms, and with the floor about 3.0 ms. The GPU part of a round at state 2 (618 of 1578 MHz on the J616s table) is about 2.5 times its state 10 time. So the ~0.45 ms difference puts the GPU at roughly 0.3 ms per round at state 10 and 0.75 ms at state 2. That leaves over 2 ms of host turnaround per round. Every round therefore idles longer than the firmware's 2 ms power-off delay, and the busy run never builds. The GPU is only about a quarter busy in that loop; the host's latency bounds it, not GPU throughput. Busy time can't tell it apart from paced work. What could is a waiter rule, and the plain M5 one is what held CS2 at state 10.

A narrower waiter rule seems worth one CS2 run: full effort only while a host thread is blocked on work with nothing queued behind it. That's the case where the firmware can't see any demand, because the queue is on the host. A game with a frame queued behind the one being waited on wouldn't trigger it, and the firmware ramps that game by itself. The risk is the compositor: its implicit-sync waits on a client's only frame look the same. So it needs your CS2 FIFO 120 power row before it goes anywhere. I'll write it as a separate commit with its own A/B on our two Macs, and keep it out of the three commits, which stand on their own: no recoveries, and glFinish-type loops back at base speed.

Also from our side since the comment above: an M2 (G14) no-regression row with the same module (the change is G17-only code). dEQP-VK s600 has 0 per-case changes against stock fleet76, 0 GPU kernel lines, and equal pace rows.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

A correction to the waiter idea above, before anyone spends a CS2 run on it. Our own paced probe calls glFinish every frame, so at 60 Hz a host thread is blocked on the only work in flight once per frame. "Blocked on work with nothing queued behind it" would boost every paced client that waits like that. So it can't tell vkdep from paced work any better than busy time can, and I won't write it.

What does tell them apart is the response to a boost. vkdep's round rate rises with the clock, while a paced client just idles longer. That's a feedback controller: boost, measure the submission rate, keep or drop. It needs its own design and rows, so I'd keep it out of this PR. With the three commits, vkdep stays where #2607 v1 put it (327 vs 316-337 rounds/s) and below the full effort (389). glFinish-type loops with sub-2 ms host turnaround are back at base speed, and the recoveries are gone.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

The J616s (T6040) 120 Hz row on the pushed head (35be46ac), same boot, three arms:

this PR with the 3 commits base
render 120 Hz (20 quads) state 1, 6.74 W state 2, 6.97 W state 10, 10.45 W
render 60 Hz state 1, 7.04 W state 2, 6.89 W state 10, 10.19 W
compute 60 Hz state 1, 6.06 W state 2, 6.89 W state 10, 10.12 W
glFinish loop, 1 quad 3935 fps 6550 6957
1 dispatch per wait 7794 fps 9288 9615
glFinish loop, 60 quads 1529 fps 3779 3753

All paced rows kept their frame rate. 120 Hz now stays on the floor, like the Neo, where the earlier build held state 10. That finishes the J616s, Neo and M2 rows on our side. CS2 FIFO 120 on the J616C is the open one.

Assisted-by: LLM (Claude:Opus 5.5)

AxxzyWasTaken and others added 4 commits November 21, 2026 08:34
The firmware takes the region C effort word as a floor for its
performance state. Outside M5 (T8140, T6040, T6041) the driver published
the full effort for as long as work kept arriving, and dropped it only after
16 ms without a submission. A game never leaves that gap, so the GPU sat
at its top state (10) whatever the load: the firmware's own statistics
show its load near zero with the state still at 10.

Publish no effort outside M5 and leave the state to the firmware's
own controller, as M5 already does while work streams. M5's exception
(the full effort while a host thread waits on a fence) is not carried
over: a game always has one, so it would keep the floor.

On a J616C (T6041, firmware 25G83), CS2 capped at 120 fps:

                         before      after
  fps                    120.0       120.0
  GPU state (0x1b)       10 always   4-7 mostly
  GPU rail (PSVR)        35.1 W      25.2 W
  SoC (PHPC)             39.9 W      31.3 W
  system (PSTR)          52.0 W      42.0 W

Uncapped, the frame rate is unchanged (175.5-176.1 vs 176.1-176.4 fps)
and the state stays at 10. A tight submit-and-wait loop is about 5-9 %
slower (vkdep: 370-400 vs 355-369 rounds/s, noisy), the cost of the
firmware ramping up instead of starting at the top.

Signed-off-by: AxxzyWasTaken <[email protected]>
With no effort published outside M5, the firmware's own controller sets
the performance state. It raises the state for work queued behind the
running command, not for how busy the GPU is. A client that submits one
command and waits for it before the next (glFinish per frame, a
dependent dispatch chain) never queues anything, so the GPU stays at
state 1 even when it is busy most of the time. On a Neo (T8140) and a
J616s (T6040), both on firmware that reports state 1 for 100 % of such
a loop, the loops ran 27-65 % slower than with the full effort.

Track how long the GPU has run without going idle, from the start and
end timestamps the firmware writes for every command. A gap at least as
long as the firmware's idle power-off delay (2 ms) ends a run; the host's
own keep-powered hold can be longer than a frame, so it doesn't mark
idle. Once a run has lasted longer than the effort is held after work
stops (16 ms), the GPU is the bottleneck and gets the full effort until
the idle check takes it down. Paced work idles between frames and keeps
leaving the state to the firmware. A frame that leaves less idle time
than the power-off delay counts as bound, which is when a higher state
helps it.

A host waiter can't tell the two cases apart: paced work has one too
(the compositor, or the next frame's fence). M5 keeps its waiter rule.

Signed-off-by: Ryan Murray <[email protected]>
sleep_quiet() refuses while the published effort is nonzero, which is
meant as "the idle check has taken the effort down". Outside M5 the
published effort is now zero for most streaming work, so the check
passed while the idle check had not yet run its Clear, which is also
what drops the performance-controller demand (Port::set_effort_full).

Also refuse while the effort is still streaming.

Signed-off-by: Ryan Murray <[email protected]>
With no effort published while work streams, the firmware's own
controller lets the performance state fall to the base state (state 1,
the one it powers the GPU up in) even with work in flight. Concurrent
geometry and tessellation work stalls the GPU there. Nothing completes
on any queue for 30-60 ms, then the firmware asks for a restart with no
fault and blames a render that never started ("firmware blamed queue
N, failing its oldest render"), and the client loses its device.

On a Neo (T8140), 4 dEQP-VK workers over the synchronization cases with
a geometry or tessellation stage hit this in 7 of 15 runs, with the
firmware at state 1 at every stall. A fixed effort that kept the state
at 3 or above gave 0 of 15, as did the full effort (0 of 10). With this
change: 0 of 30, against 7 of 15 without it on the same boot. A J616s
(T6040) gave 0 of 30.

The effort is a fraction of the top state's frequency (16.16): 0.25,
0.5 and 0.75 put the floor between the states around 367, 735 and
1102 MHz of the Neo's table. While work streams, publish at least the
frequency of the first state above the base as a fraction of the top
one, from the table the firmware is given (the B curve gives the base
state and those below it no relative performance; on T6040 the loader
sets it as apple,perf-base-pstate). On the Neo that is 492 of 1470 MHz.
The idle check still takes the effort to zero after the hold.

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

Copy link
Copy Markdown
Contributor Author

J616C (binned T6041, 25G83) CS2 FIFO 120 row on the three commits (module 70af018e = this head on the daily tree), against the daily (waiter rule 1) and the v1 behaviour (rule 0) on the same boot before it. Dust2 bench, 3 windows each, SoC rail median under load:

fps SoC W J/frame GPU state reports
v1 (no floor) 120.1 / 120.1 / 120.0 34.1 0.284 spread 1–10, 10 in 47 %
daily, waiter rule 1 120.0 ×3 38.4 0.320 10 in 99 %
3 commits, run 1 (first run after boot) 62.6 / 62.6 / 62.8 42.9 0.685 2 in 99 %, 10 in 0.4 %
3 commits, run 2 120.0 ×3 39.0 0.325 10 in 80 %, rest 3–9

No faults or recoveries in either run. Run 2 is the expected result: CS2 never goes idle between frames, so it sits on the full-effort path and costs what the daily costs. Run 1 stayed on the graded floor (state 2) for the whole bench and never reached full effort, so it ran at half rate. Same build, same boot, two minutes apart, so the full-effort path looks like it can fail to engage. The 48 fps stuck-at-state-1 case on v1 was the same shape. I can't say yet what made run 1 different (it was the first CS2 start after boot). Happy to run a probe build if you want the effort decisions logged.

@AxxzyWasTaken

AxxzyWasTaken commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Follow-up on the stuck run 1 above: I couldn't reproduce it. Five more boots, each with a CS2 FIFO 120 bench as the first CS2 start after boot (same Dust2 bench, SoC rail median under load):

boot module fps (3 windows) SoC W J/frame GPU state reports
2 probe (this head + logging) 120.0 ×3 38.9 0.324 10 in 80 %, rest 3–9
3 probe 120.0 / 120.0 / 120.1 38.0 0.317 10 in 75 %, rest 3–9
4 probe 120.0 / 120.1 / 120.0 39.5 0.329 10 in 80 %, rest 3–9
5 70af018e (exact build of the stuck run) 120.0 / 120.1 / 120.0 37.8 0.315 10 in 75 %, rest 3–9
6 70af018e 120.0 ×3 38.9 0.324 10 in 80 %, rest 4–9

No faults or recoveries. (Boot 1's first start doesn't count: CS2 quit while loading.) So the stall is 1 of 6 first starts, and I can't produce it on demand.

The probe logs once a second: what each slow-path submission published, the busy-run and light-effort state, and the fast-path count. On every good run it shows the design working. While CS2 is in the map, the GPU runs 120–420 ms at a time with no 2 ms gap (busy share 60–80 %), so bound holds and full effort is published. Light effort leaves at the first window with busy above the exit threshold, and about 245 submissions/s take the fast path. I first suspected the fast path could freeze a floor published before bound, but idle_check runs on every event pass and re-applies when note_bound changes, so that isn't it.

What still fits the stuck run is a half-rate trap at the floor. If the bench starts with the GPU on state 2 and FIFO-paced, a CS2 frame is about 13–14 ms of GPU time in a 16.7 ms slot. That leaves a gap over the 2 ms power-off delay every frame, so the busy run never reaches the 16 ms hold. FIFO queues nothing behind the running command, so the firmware doesn't raise the state either. Once at full clock, a frame leaves gaps well under 2 ms, which would explain why it's bistable. I haven't confirmed this. A synthetic paced loop (submit, wait, sleep to the next 8.33 ms tick) stayed at 120 fps on this head.

If you want a guard against it, the candidate I tested is a busy share on the same timestamps: full effort once the GPU is busy at least 75 % of a 32 ms window, held until the share drops under 40 % or the run ends. That catches 13.5 ms of work in a 16.7 ms slot and leaves light paced work, like your 20-quad rows, on the floor. It has a cost on the J616C. CS2 in the map sits at 60–80 % busy, so once it latches it never drops under the 40 % release. The two runs with it on held state 10 for the whole bench, at 39.5 and 40.4 W, against 38.9–39.3 W with it off on the same boots, all at 120 fps. I'd rather not push it without a reproduction that shows it's needed. I'll keep the probe build ready and log the next stall if one shows up.

@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

One GPU recovery on the three commits (module 70af018e), J616C, about 30 minutes into the boot I used for the last CS2 run above. It happened in SCP: Secret Laboratory (Unity, Vulkan, under FEX) while spectating:

  • Recovery 1: reason 0, no MMU fault on either bank. The firmware blamed the game's render queue (51, render slot 9). 4 commands were in flight: 2 compositor, 2 game. TVB id 25: 32 blocks, committed 32, consumer 0, max_pages 33, grow pending 0. The target was 1728x1117 with one layer. The game got EIO and lost its device.
  • Recovery 2, about 115 ms later: reason 3, with unmapped reads from gVDM_SSD_SP on the game's VM (0x1001000000 and 0x7c00000300). That looks like the aftermath of the first one, on the game's two render queues and its compute queue.

That's the same shape as the dEQP recoveries you saw on the Neo and J616s before the three commits (reason 0, no fault). I don't know yet if the commits caused it. The daily driver ran heavy SCP:SL rounds without recoveries on 20 Nov, but it's one event, and this game has had reason-0 hangs on other kernel changes before. The J616C is back on the daily driver now. If you want to reproduce it, I can put the three commits back for an SCP:SL session.

The busy run that gives a submit-and-wait loop the full effort was one
run for the whole GPU, restarted whenever a command started at least the
firmware's idle power-off delay after the latest end noted so far.
Commands of different clients run side by side and complete in any
order: a short command of one client that starts part-way through
another client's long render completes first, while the render that
keeps the GPU busy through the gap has not been noted yet. Each such
command restarted the run.

The longer the commands, the more often that happens, so the effort can
lock a GPU-bound client at the floor: on a T6041, Counter-Strike 2
capped at 120 fps on its first run after boot sat at state 2 for the
whole bench at 62.6 fps and never got the full effort; the next run,
started at the top state, stayed bound at 120 fps. On a T6040, a
submit-and-wait client next to a second client that runs a short
dispatch every 4 ms ran at 179-192 fps at state 2, against 465-489 fps
at state 10 on its own.

Keep a run per client (its execution context), whose own commands follow
each other, so its own gaps are real. A run counts while its client is
still running: until it has been silent for longer than its last
command took plus the idle power-off delay, read on the system time
base, which the firmware stamps commands with at its own rate. A client
that stops submitting does not keep the full effort for others.

With this, the T6040 client above runs at 507-511 fps at state 10 next
to the second one, and paced work stays at state 2 at the same power.

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

Copy link
Copy Markdown
Contributor

Thanks for the CS2 FIFO 120 row. Run 1 is a bug in the busy run, and we can now reproduce it on the J616s without a game.

Cause. The busy run was one run for the whole GPU. It restarted whenever a command started 2 ms or more after the latest end noted so far. Commands of different clients complete in any order. A short command of another client (the compositor, or anything else) that starts part-way through a long render completes first, and the render that kept the GPU busy through that "gap" hasn't been noted yet. So the run restarts. The longer the commands, the more often this happens. At state 2 the renders are about 2.5x longer, so the run never reaches 16 ms and the floor locks itself in. Started at state 10, the renders are short enough that it stays bound. That matches your run 1 vs run 2.

Fix. One commit on top of this PR's head (fast-forward from 19f566df): 901f8cd on branch g17/2607-busyrun-per-client. The busy run is kept per client (its execution context). A client's own commands follow each other, so its own gaps are real, and another client's completion can't restart it. A run counts while its client is still running: it stays live until the client has been silent for longer than its last command took plus the 2 ms power-off delay. That silence is measured on the system time base the firmware stamps commands with (24 MHz; the CPU counter reads the same seconds at 1 GHz). No new constants, parameters or chip checks.

J616s (T6040), same boot, arms interleaved 0/4/0/4. A = submit-and-wait client, about 2 ms renders. B = a short compute dispatch every 4 ms on its own context. 20 s per row.

row this PR's head (4 runs) + per-client run (2 runs)
A alone 465-489 fps, state 10 480 fps, state 10
A + B 179-192 fps, state 2 (95-100 %) 507-511 fps, state 10 (100 %)
60 Hz draw + B 60 fps, state 2, 7.3-7.5 W 60 fps, state 2, 7.4-7.5 W
120 Hz draw 120 fps, state 2, 7.2-7.4 W 120 fps, state 2, 7.4 W

The serial rows are unchanged from the 3 commits (glFinish loops at state 10, paced 60/120 Hz at state 2), with 0 GPU faults.

Still to run: your CS2 FIFO 120 on the J616C with this commit, ideally twice, each the first CS2 start after a boot. If it holds, please cherry-pick it into the PR. The Neo arm waits for the Neo to come back (it has been powered off since yesterday afternoon).

Reviewer detail
  • Trace replay: in the Neo's traced dEQP-VK synchronization runs (11-21), 5-6 restarts per run fell where the union of every command's firmware interval has no gap.
  • Rejected alternative: leave the gap pending and settle it once nothing is in flight. In those runs the GPU sits idle for 22 ms with 22 commands in flight (blocked on firmware waits), so gaps never settle.
  • Liveness clock: asahi_g17_firmware_clock(hz) in trace.c scales cntvct by hz / cntfrq. Checked on the J616s: firmware end 15520315013 / 24 MHz = 646.6798 s, counter 646679847796 / 1 GHz = 646.6798 s.
  • Table: 16 clients followed at once; a new client replaces the one that ran least recently.
  • Tests: g17 host tests 90/90. The BusyRuns unit tests (5) pass, built standalone with rustc --test; the KUnit harness doesn't run power.rs on the host. Two mutations are caught: one GPU-wide run fails 2 tests, dropping liveness fails 1.
  • Test module (lab only): fleet77 kernel + this PR's 4 commits + this commit + a dev-only A/B switch (mode 4 = this PR's head behaviour), loaded on a one-shot of the installed kernel. The switch is not part of the commit.

Assisted-by: LLM (Claude:Opus 5.5)

@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

The per-client busy run holds on the J616C (binned T6041, 25G83). Two boots, each with a CS2 FIFO 120 bench as the first CS2 start after boot. The module is the daily tree plus this PR's 4 commits plus 901f8cd1 (only conflict: an import line in power.rs). Same Dust2 bench as above, SoC rail median under load:

fps (3 windows) SoC W J/frame GPU state reports
boot 1 120.1 / 120.0 / 120.0 34.9 0.290 10 in 27 %, rest 3–9
boot 2 120.0 ×3 34.9 0.291 10 in 33 %, rest 3–9
for reference: 3 commits, boots 2–6 above 120 37.8–39.5 0.317–0.329 10 in 75–80 %
for reference: v1 (no floor) 120.1 / 120.1 / 120.0 34.1 0.284 10 in 47 %

No stuck run, and 0 GPU faults or recoveries on either boot. It also costs about 4 W less than the 3 commits did: the GPU-wide run seems to have read CS2 as bound more often than it is, and the frame rate holds at the lower states. Power is now within 1 W of v1.

I fast-forwarded the PR to 901f8cd1. The SCP:SL recovery above isn't covered by this yet. I'll run an SCP:SL session on this build and report back.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for the two first-start CS2 runs and for fast-forwarding. 120 fps on both boots at 34.9 W, about 4 W under the 3 commits and within 1 W of v1, fits the cause: the GPU-wide run was read as bound or unbound according to other clients' completions, not CS2's own.

Your half-rate trap (11:57). Agreed, let's not add the 75 %/40 % busy-share guard without a reproduction. It adds two thresholds and costs about 1 W on CS2. Run 1 had the cross-client cause, which our two-client probe reproduces every time on this PR's previous head. A single FIFO client trapped at the floor would be a separate case that this commit doesn't change. In the next J616s slot I'll test it directly with a FIFO-like probe: one client, about 12 ms frames at state 2 and 4.5 ms at state 10, each frame waiting for the next 8.33 ms tick. It runs once from idle and once after a full-speed burst. If it traps, I'd look at fence deadlines rather than a busy share. KMS already sets a vblank deadline on plane in-fences, and our sync-scope fences pass deadlines on to the command fences, but the command fences drop them (set_deadline is unset). "Work still running past its deadline" is the signal the trap needs, without a threshold.

SCP:SL recovery. Thanks, a session on this head is the right next row. The busy run doesn't touch the floor, so this commit shouldn't change the recovery picture either way. On our side the Neo is back. When its overnight slot ends (about 20:30 UTC), I'll run the dEQP geometry/tessellation loop that reproduced the reason-0 recoveries before the floor (7/15 runs then, 0/30 with the floor) on this head, along with the Neo rows for the per-client run.

Assisted-by: LLM (Claude:Opus 5.5)

@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

SCP:SL on the full head (901f8cd1, J616C): about 35 minutes over two sessions on busy servers, with plenty of spectating. 0 GPU recoveries or faults. The first session froze after about 10 minutes, but the game's own log shows a network timeout (Connection Quality → Timeout), and the kernel had no GPU event. The earlier recovery came about 30 minutes into a boot on the 3 commits, so this doesn't rule it out, but it hasn't come back so far.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

J714s (M5 Pro, T6050, G17S) A/B row — tested on 35be46ac (prior to 901f8cd1)

Note: This run tested g17/2607-effort-fixes head 35be46ac (9289e4c6 + f0085cb3 + eb16e104 + 35be46ac) before the per-client busy-run commit 901f8cd1 was pushed to this PR. A rerun on 901f8cd1 is needed to cover the current head and a committed deep sleep.

  • Machine & stack: J714s (M5 Pro, G17S B1), Mesa 26.2.3-1 (Borealis), VK-CTS 1.4.7.1, AC connected, battery 100% Full.
  • Arm A (baseline): 7.3.0-m5-sship7 (cc145705c592).
  • Arm B (candidate): 7.3.0-m5-pr2607 (882e671c8761 = cc145705c592 + 9289e4c6 + f0085cb3 + eb16e104 + 35be46ac).
Check Baseline (cc145705) Candidate (35be46ac)
Concurrent sync kit (syncgeo.txt, 672 cases, J=4, 30 runs) 0/30 runs with recovery (0 recoveries, 0 stops, 12000 Pass / 8160 NotSupported, 30 shard deaths, 1.64 s/run) 0/30 runs with recovery (0 recoveries, 0 stops, 12000 Pass / 8160 NotSupported, 30 shard deaths, 1.63 s/run)
Vulkan submit-and-wait, 1 quad (rounds/s) 5637.2 (2nd half 5675.3), pstate 13 100% (1620 MHz) 5678.0 (2nd half 5692.0), pstate 13 100% (1620 MHz)
Vulkan submit-and-wait, 60 quads (rounds/s) 1541.7 (2nd half 1543.3), pstate 13 100% (1620 MHz) 1548.8 (2nd half 1549.3), pstate 13 100% (1620 MHz)
Vulkan submit-and-wait, 1 dispatch (rounds/s) 6429.8 (2nd half 6361.7), pstate 13 100% (1620 MHz) 6337.6 (2nd half 6359.3), pstate 13 100% (1620 MHz)
GLES glFinish (Zink/Borealis), 1 quad (fps) 5170.8 (2nd half 5167.7) 5219.5 (2nd half 5213.0)
GLES glFinish (Zink/Borealis), 60 quads (fps) 1471.2 (2nd half 1480.3) 1510.3 (2nd half 1521.0)
Idle pstate [0:100%], 0 MHz, system 12.67 W pstate [0:100%], 5 MHz, system 10.73 W
Paced render 60 Hz 60.0 fps (0 missed), [0:98% 1:1%], 17 MHz, 14.92 W 60.0 fps (1 missed), [0:98% 1:1%], 16 MHz, 14.51 W
Paced render 120 Hz 120.0 fps (0 missed), [0:98% 13:2%], 39 MHz, 19.26 W 120.0 fps (0 missed), [0:96% 13:4%], 60 MHz, 19.63 W
Paced compute 60 Hz 60.0 fps (0 missed), [0:99% 13:1%], 20 MHz, 16.90 W 60.0 fps (0 missed), [0:97% 13:2%], 44 MHz, 17.29 W
Kernel GPU errors (arm window) 0 recoveries, 0 stops, 0 faults, 0 timeouts 0 recoveries, 0 stops, 0 faults, 0 timeouts
  • Deep sleep check on candidate (did NOT commit — test harness bug on AC): the sleep script armed a +30 s RTC wakealarm before waiting up to ~31 s for a 1 mAh battery-gauge step; with AC connected and the battery Full (0 mA), the gauge never stepped and the alarm expired 1 s before suspend entry (apple-sleep: refused at .enter: SoC check: -16), so neither PMP nor the GPU firmware stopped (aurora: sleep refused before the commit: GPU firmware never stopped). Unrelated dwc3-apple logged PM: device_prepare(): genpd_prepare returns -11. Actual GPU timeouts/faults/recoveries were 0, and post-attempt GPU checks passed (vulkaninfo live, CTS smoke 2/2, 1-dispatch submit-and-wait 6447.7 rounds/s, paced 60 Hz render 60.0 fps).
  • Takeaway: no stability, throughput, or power regression on J714s for 35be46ac across 30 concurrent sync runs and all 8 probes; M5's sleep_quiet() path through an actual committed deep sleep and the new 901f8cd1 head remain to be tested in a rerun.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

J714s (M5 Pro, T6050, G17S) A/B + deep sleep row — 901f8cd1 (current head)

  • Machine & stack: J714s (M5 Pro, G17S B1, GPU fw 27.0 / 26A428), Mesa 26.2.3-1 (Borealis), VK-CTS 1.4.7.1, AC connected, battery 100% Full.
  • Baseline: 7.3.0-m5-sship7 (cc145705c592, PR base).
  • Candidate: 7.3.0-m5-pr2607 (cc145705c592 + all 5 PR commits 28edd1ac..901f8cd1, head 901f8cd17ea1f169af1797bdfc3958dd6f57b23f).
Check Baseline (cc145705) Candidate (901f8cd1)
Concurrent sync kit (syncgeo.txt, 672 cases, J=4, 30 runs) 0/30 runs with recovery (0 recoveries, 0 stops, 12000 Pass / 8160 NotSupported, 30 shard deaths, 1.64 s/run) 0/30 runs with recovery (0 recoveries, 0 stops, 12000 Pass / 8160 NotSupported, 30 shard deaths, 1.64 s/run)
Vulkan submit-and-wait, 1 quad (rounds/s) 5679.3 (2nd half 5712.3), pstate 13 99% (1606 MHz), 23.04 W 5689.3 (2nd half 5698.3), pstate 13 100% (1620 MHz), 22.27 W
Vulkan submit-and-wait, 60 quads (rounds/s) 1543.0 (2nd half 1544.3), pstate 13 100% (1620 MHz), 35.69 W 1547.5 (2nd half 1549.0), pstate 13 100% (1620 MHz), 35.79 W
Vulkan submit-and-wait, 1 dispatch (rounds/s) 6569.2 (2nd half 6550.0), pstate 13 100% (1620 MHz), 28.65 W 6455.5 (2nd half 6414.7), pstate 13 100% (1620 MHz), 28.17 W
GLES glFinish (Zink/Borealis), 1 quad (fps) 5183.2 (2nd half 5204.7), pstate 13 100% (1620 MHz), 25.35 W 5191.7 (2nd half 5214.0), pstate 13 100% (1620 MHz), 25.16 W
GLES glFinish (Zink/Borealis), 60 quads (fps) 1478.5 (2nd half 1502.3), pstate 13 99% (1606 MHz), 36.35 W 1515.1 (2nd half 1518.0), pstate 13 100% (1620 MHz), 36.54 W
Idle pstate [0:99% 1:1%], 3 MHz, system 11.25 W pstate [0:100%], 5 MHz, system 9.90 W
Paced render 60 Hz 60.0 fps (0 missed), [0:97% 1:2%], 14 MHz, 14.49 W 60.0 fps (0 missed), [0:99%], 11 MHz, 14.93 W
Paced render 120 Hz 120.0 fps (0 missed), [0:97% 13:3%], 56 MHz, 19.89 W 120.0 fps (0 missed), [0:97% 13:3%], 43 MHz, 18.85 W
Paced compute 60 Hz 60.0 fps (0 missed), [0:99%], 16 MHz, 17.76 W 60.0 fps (0 missed), [0:98% 13:2%], 35 MHz, 16.66 W
Kernel GPU errors (test window) 0 recoveries, 0 stops, 0 faults, 0 timeouts 0 recoveries, 0 stops, 0 faults, 0 timeouts
  • Committed deep sleep check on candidate (PASS):
    • Entered and exited deep sleep cleanly (28.3 s asleep on a 30 s RTC wakealarm, boot-object resumes 0 -> 1, 14 coprocessors stopped, RTC wake).
    • GPU sleep_quiet() / suspend / resume path committed cleanly with no refusal or hang: aurora 2300000000.gpu: commit stop: GFX 0x1404034f, commit stop: PMP request withdrawn: 0; on wake, GPU domain after the wake: 0x1f0403ff (floor 4, saved 0x1404034f) and both RTKit endpoints re-initialized cleanly.
    • Post-wake GPU health: 0 runtime stops across the boot, vulkaninfo live (Apple M5 Pro (G17S B1)), dEQP smoke 2/2 Pass, Vulkan 1-dispatch submit-and-wait 9438.9 rounds/s (0 missed), paced 60 Hz render 60.0 fps (0 missed).
    • Kernel log check across the full candidate boot and sleep window: 0 GPU recoveries, 0 stops, 0 faults, 0 timeouts, 0 kernel warnings/bugs. Only pre-existing unrelated dwc3-apple 382280000.usb: PM: device_prepare(): genpd_prepare returns -11 logged at suspend prepare (all apple-sleep entry idle/AUSS counters reported 0 timed out).
  • Verdict: PASS on 901f8cd1 — no stability, throughput, or power regression on J714s across 30 concurrent sync runs and all 8 probes, and M5's sleep_quiet() path commits and resumes cleanly across a real deep sleep.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for the SCP:SL session (0 recoveries in about 35 minutes on 901f8cd1), and Dj for the J714s row.

The half-rate trap exists for a client with nothing queued behind its frame. On the J616s, on 901f8cd1's policy: one client renders about 12 ms of GPU work per frame at the floor (about 4.5 ms at state 10), calls glFinish, then sleeps to the next 8.33 ms tick. It runs at 60 fps with the GPU on state 2 for 98-99 % of the time, starting from idle and also right after a 2 s full-speed burst. The frame misses the tick and waits 4.7 ms for the next one. That is more than the 2 ms power-off delay, so the run never becomes bound, and the firmware raises its state only for queued work. The fleet base (full effort while work streams) doesn't trap. CS2 didn't hit it in any of Axxzy's 7 first starts, presumably because its swapchain keeps frames queued. So this affects a client that waits for the GPU every frame under vsync.

Region C idle_power_off_delay is not the power-off delay. I booted the firmware twice, once with 40 (as shipped) and once with 80, and ran tiny renders with gaps of 1-8 ms. The share of time with cores powered is the same on both boots (for example 0.21/0.22 at 2 ms and 0.12/0.13 at 4 ms). So the 2 ms in the busy run can't be taken from that field. The busy-run boundary itself is where it should be: 1 ms gaps run at state 10, 2 ms gaps at state 2.

Suggestion: merge on the rows we have, and track the trap separately. The guard I'd want for it is a deadline, not a busy share: the trapped frame misses its vblank, and nothing else in the driver can tell that apart from paced work. Our sync-scope fences pass set_deadline on to the command fences, which drop it today. A first read-only probe at night (kprobe on dma_fence_set_deadline) saw 0 calls, but the headless clients presented no frames there, so it settles nothing. That needs a daytime row with a lit display. Still to run for this PR: the Neo rows and the Neo recovery loop after its overnight slot.

Rows
  • Trap probe (pace.c q = sleep to the next 1/hz tick), 2200 quads, 20 s each: q120 from idle 60.2 fps (11.9 ms per frame), state 2 99 %; q120 after a 2 s unpaced burst 59.9 fps, state 2 98 %; q60 59.9 fps, state 2 99.7 %. 0 GPU faults.
  • Gap sweep, 1 quad per frame, host hold set to 2 ms for the sweep and then put back to the J616s DT value (16 ms). Powered share for region C 40 / 80: 1.0 ms 0.36/0.35, 1.5 ms 0.23/0.23, 2.0 ms 0.21/0.22, 3.0 ms 0.15/0.15, 4.0 ms 0.12/0.13, 8.0 ms 0.04/0.05. Wall time per tiny frame is 0.56-0.63 ms across all gaps, with no wake step.
  • Lab test modules only: the region C override was a dev-only module argument, not part of any commit.

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.

Adversarial review of 901f8cd1 (all 5 commits 28edd1ac..901f8cd1): No blockers — approving for joint merge.

What I checked:

  • No new chip/board/firmware gates or magic constants: active_effort() (initdata.rs:2222-2234) derives the floor directly from the firmware OPP + PerfConfig tables (first state above base / top state, 16.16 rounded up) and rejects invalid tables with EINVAL. self.m5 is pre-existing layout dispatch.
  • Per-client busy-run tracking (power.rs:371-457, feed.rs:461-479): BusyRuns cleanly isolates concurrent clients under SpinLock<BusyRuns> (called from sleepable completion/submission paths), evicts least-recently-ended entries cleanly, clears on end_busy_run(), and asahi_g17_firmware_clock() (trace.c:113-116) uses mul_u64_u64_div_u64 without overflow.
  • Suspend safety (runtime/events.rs:395): adding || self.effort.streaming() to sleep_quiet() ensures suspend waits for the idle hold to run Clear even when the published effort is zero.
  • Attribution & CI: all 5 commits carry human Signed-off-by only; host-tests CI is green.
  • Hardware evidence: J616C (CS2 FIFO 120 + 35 min SCP:SL), J616s (concurrent submit-and-wait + 0/30 sync stalls), and J714s (0/30 sync recoveries + committed deep sleep on 901f8cd1) all pass. Agree with tracking the single-client vsync half-rate trap as a follow-up via fence deadlines. (Our Neo T8140 901f8cd1 kit is also built and queued next on neohw.)

Ready to merge once unmarked from draft and Axxzy confirms.

Assisted-by: LLM (Google:Gemini 4 Neon)

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Neo (J700, A18 Pro / T8140, G17P) A/B row — 901f8cd1 (current head)

  • Machine & stack: MacBook Neo (J700, Apple A18 Pro / G17P B1), Mesa 26.3.0-30 (git-d4ad4a4dce, Borealis), VK-CTS 1.4.7.1, gpubench c36cbbe, AC connected, battery 100% Full, headless.
  • Baseline: 7.3.0.n2607a (integration/aurora a84637dca209, aurora.ko b9594fd370924538), plus two short drift-reference boots (A2/A3) in the same slot.
  • Candidate: 7.3.0.n2607b (a84637dca209 + all 5 PR commits 28edd1ac..901f8cd1, head 901f8cd17ea1f169af1797bdfc3958dd6f57b23f, aurora.ko b6e08f03a414d817). Identical .config (kernel-aurora-core-7.3.0-43 + DEBUG_INFO_NONE; only CONFIG_LOCALVERSION differs).
Check Baseline (a84637dca209) Candidate (901f8cd1)
Concurrent sync (synclist.txt, 2,940 write_image_{geometry,tess_*} cases, J=4, 10 runs) 0/10 runs with recovery (0 recoveries, 0 stops, 0 faults, 0 timeouts, 16,800 Pass / 12,600 NotSupported, 0 deaths, 10.29 s/run) 0/10 runs with recovery (0 recoveries, 0 stops, 0 faults, 0 timeouts, 16,800 Pass / 12,600 NotSupported, 0 deaths, 10.34 s/run)
Idle (20 s, skip 3 s) 0x1b state 10 (1 rep; A2/A3 0 rep), Sys 8.22 W (A2/A3: 8.20/8.19 W), SoC PPMC 0.61 W 0x1b state 2–3 (2 rep), Sys 8.20 W, SoC PPMC 0.61 W
Paced render 60 Hz (f, 40 s, 3–40 s) 60.0 fps (1 missed), p50 7.09 / p95 7.12 ms, state 10:100%, Sys 12.79 W (A2/A3: 12.77/12.70 W), SoC PPMC 4.85 W (4.80/4.76 W), PPSM 3.89 W 60.0 fps (3 missed / 2400), p50 12.19 / p95 15.91 ms, state 3:45.5% 4:6.8% 10:47.2%, Sys 11.22 W (-1.57 W), SoC PPMC 3.33 W (-1.52 W), PPSM 2.67 W
Paced render 60 Hz (steady 15–40 s) state 10:100%, Sys 12.87 W (A2/A3: 12.85/12.76 W), SoC PPMC 4.92 W (4.87/4.82 W), PPSM 3.94 W state 3:60.1% 4:8.9% 10:31.0%, Sys 10.70 W (-2.17 W, -16.9%), SoC PPMC 2.89 W (-2.03 W, -41.3%), PPSM 2.31 W
Vulkan vkdep-style (4 dep dispatches + copy, 3×8 s) 7934.7 rounds/s (2nd half 7955.3), state 10:100% 7879.5 rounds/s (2nd half 7921.6, -0.4%), state 10:100%
Vulkan submit-and-wait, 1 dispatch (w-d1, 8 s) 9394.1 /s (2nd half 9397.8), state 10:100% 9357.6 /s (2nd half 9396.8, -0.0%), state 10:100%
GLES glFinish (Zink/Borealis), 1 quad / 60 quads (8 s) 6432.7 / 425.4 fps (2nd half 6469.5 / 425.0), state 10:98–100% 6296.3 / 425.0 fps (2nd half 6572.2 / 426.8), state 10:100%
Per-client check: uncapped render w-f alone (12 s) 136.9 fps (p50 7.20 ms), state 9–10 138.5 fps (p50 7.09 ms, +1.2%), state 9–10
Per-client check: w-f + 250 Hz d1 client (w-f-2c, 12 s) 131.3 fps (p50 7.70 ms), state 8–10 132.3 fps (p50 7.60 ms, +0.8%), state 8–10 (97%) — no cross-client stall
Per-client check: 60 Hz f + 250 Hz d1 (r60-2c, 20 s) 60.0 fps (0 missed), p50 7.06 / p95 7.09 ms, Sys 13.00 W, state 10:100% 59.6 fps (39 missed / 1193), p50 7.07 / p95 15.18 ms, Sys 12.77 W, state 10:89.9% / 2–4:10.1% (stepped down in final 5 s)
gpubench c36cbbe --quick (193 rows, 20 ms warmup / 40 ms run) 193/193 ok 193/193 ok; heavy/RT & sustained mode=queue small submits neutral (render.heavy -1.0%, rt.rays 0.0%, copy.bw -1.5%, compute.light/render.light queue d4–d64 within ±1%); short-window procs/queues and CPU-interleaved mem.buffer/mem.image start at base state (1.0537x overall geomean)
Kernel GPU errors (boot + full row) 0 recoveries, 0 stops, 0 faults, 0 timeouts 0 recoveries, 0 stops, 0 faults, 0 timeouts
  • Notes:
    • On r60-2c, a single f frame takes ~7.1 ms at state 10 (~43% of a 16.67 ms period); when the firmware stepped down to states 2–4 in the final 5 s, a few frames crossed 16.67 ms (39 missed / 1193), matching the single-client deadline-miss follow-up already noted above.
    • Verdict: PASS on Neo G17P at 901f8cd1 — 1.6–2.2 W system (1.5–2.0 W SoC / -41% steady-state) power reduction on paced 60 Hz render, uncapped submit-and-wait and two-client per-client busy-run (w-f-2c) hold full throughput, and 0/10 GPU recoveries across 29,400 concurrent geometry/tessellation dEQP-VK cases.

@AxxzyWasTaken
AxxzyWasTaken marked this pull request as ready for review November 21, 2026 21:07
@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

Moving out of draft now that the J616C, J616s, J714s, and Neo (J700) rows on 901f8cd1 are all posted. Agreed on merging with the current rows and tracking the single-client vsync half-rate trap separately via fence deadlines.

Assisted-by: LLM (Google:Gemini 4 Neon)

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

Approving at 901f8cd as our half of the joint merge decision: the per-client busy-run fix is proven on the J616s (179-192 -> 507-511 fps for a GPU-bound client beside a periodic one, paced work unchanged at state 2, 0 faults) and confirmed by Axxzy's CS2 FIFO 120 rows on the J616C, with J714s and Neo rows in. The single-client vsync half-rate trap is tracked as a follow-up (fence deadlines), as agreed.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide
RyanTheTide merged commit cacf355 into aurora-silicon:integration/aurora Nov 21, 2026
1 check passed
@RyanTheTide

Copy link
Copy Markdown
Contributor

Post-merge row on the MacBook Neo (A18 Pro, G17P): the first released kernel with this PR merged (fleet81, integration tip 1b940c26, default command line, stock module) behaves like the fix module tested on 11-21.

  • Concurrent geometry/tessellation stall repro (672 dEQP-VK 1.4.7.1 synchronization cases with a geometry/tess stage, 4 workers, 30 runs): 0/30 runs with a GPU recovery. Every run: Pass 315 / NotSupported 357. Before the base-state floor fix this list recovered in 7/15 runs.
  • Submit-and-wait and paced GLES rows, firmware perf state from the stats report:
row fleet81 fix module (11-21) without the fixes (11-21)
draw, submit-and-wait 3179 fps, top state 3194, top state 1423, base state
compute, submit-and-wait 4963 fps 4940 2939
60 draws per frame, unpaced 1827 fps, top state 1825 645
draw / compute at 60 Hz 60 fps, state 2 60, state 2 60, base state
20 draws at 120 Hz 120 fps, state 2 120, state 2 base state
  • Same boot: 0 AVC, 0 GPU recoveries, firmware crashes or oopses, 0 kernel error lines.

Assisted-by: LLM (Claude:Opus 5.5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants