Repository navigation
Conversation
…ilds, and stack copies Profile-guided hot-path cleanup for G17 light compute and render direct submission: 1. Avoid cloning the 3-slot [Option<Arc<ComputeCell>>; 3] array in Backend::compute_direct and Backend::compute_readiness by checking any rare cross-engine render frontier before taking self.direct and borrowing the locked slice in place (strict lock order shared.state -> self.direct -> outer_compute -> ComputeCell::queue -> Port::m5_outer). 2. Add QueueConfig::matches_steady_compute and matches_steady_render_identity plus Graph::record_ref(&T) so steady-state compute and render publications skip rebuilding and copying 192-byte QueueConfig descriptors when the cached slot matches, pass Lane::config by reference instead of copying 200 bytes per stage, and defer cold non-M5/first-kick stack locals (ComputeArgs, KickAnnounce, KickPredecessor, oversized m5_dependency_types) off the M5 steady-state frame. Add KUnit coverage (asahi_g17_queue_config_steady). Signed-off-by: Satya Benson <satya@benson.earth>
There was a problem hiding this comment.
Verdict: MERGE at 2b6d528
Checked: Mixed-engine frontier lookup releases shared.state before the direct-cache lock, and a successful claim retains its cell before releasing that lock. Compute dependency input stays bounded at 31 barriers plus the parent. The cache match compares dynamic identity and skips reconstruction only with the current epoch and no required transient update. M5 still sends its config when required, and render retains its cold install and J813 paths. The exact author J775c ABBA report and KUnit coverage are recorded on the PR.
RyanTheTide
left a comment
There was a problem hiding this comment.
Verdict: MERGE at 2b6d528
Checked: Mixed-engine frontier lookup releases shared.state before the direct-cache lock, and a successful claim retains its cell before releasing that lock. Compute dependency input stays bounded at 31 barriers plus the parent. The cache match compares dynamic identity and skips reconstruction only with the current epoch and no required transient update. M5 still sends its config when required, and render retains its cold install and J813 paths. The exact author J775c ABBA report and KUnit coverage are recorded on the PR.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
The clean integration of On that tree, The upcoming J700 matched row will carry #3242 in both arms and check mixed engine submission, work completion and VM churn. |
|
Additional Host Tests passed on the integration of Ran
Two more host fixtures passed on the same tree with
The staged J700 mixed-engine and VM-churn row is still pending. |
Summary
Profile-guided hot-path cleanup for G17 light compute and render direct submission, based on callee-up
perfprofiles on G17C (compute.lightandrender.lightat depth 32):Backend::directin place (g17/runtime.rs):compute_directandcompute_readinesspreviously cloned the entire[Option<Arc<ComputeCell>>; 3]array underself.directon every compute submission, showing up as ~3.3% total CPU inrefcount_inc/refcount_dec_and_test(drop_glue<[Option<Arc<ComputeCell>>; 3]>).render_frontierlookup (shared.state.lock()) ahead ofself.direct.lock()soself.directis borrowed directly in place under strict lock ordershared.state -> self.direct -> outer_compute -> ComputeCell::queue -> Port::m5_outer.compute_readinessclones only the single claimedComputeCellon a successful claim, after dropping the lock guard.QueueConfigrebuilds and stack copies (g17/fw/queue.rs,g17/queue/compute.rs,g17/queue/render.rs,g17/queue/render/publication.rs):QueueConfig::matches_steady_computeandQueueConfig::matches_steady_render_identity(covered by new KUnit suiteasahi_g17_queue_config_steady) so steady-state compute and render publications check the cachedQueueConfigbefore constructing and copying 192-byte records (~2.0%CPU incompute::Queue::queue_configand~1.5%CPU infw::m5::queue::config).Lane::configby reference (Option<&'a QueueConfig>) instead of copying a 200-byteOption<QueueConfig>by value per render stage.Graph::record_ref(&T)on the compute graph (contiguous write of0..size_of::<T>()followed by zeroing only trailingsize_of::<T>()..windowbytes, avoiding redundant stack staging and double-writes to WC memory) and defer cold non-M5/first-kick locals (ComputeArgs,KickAnnounce,KickPredecessor, oversizedm5_dependency_types) off the M5 steady-state stack frame.Evidence
Tested: M5 Max Mac Studio (J775c / G17C B1) at
2b6d528afa5c0ae062173427fa7dbf8d7c6c4447passed Vulkan API smoke (8/8 on all four boots), bit-exact scene CRCs, and RTC s2idle on the candidate, with zero new GPU/MMU warnings or faults.The four-boot ABBA (
A1 -> B1 -> B2 -> A2) comparedef8a1bf8ce45(A) with the PR head (B) using the default command line (MTE enabled), Borealis (aurora-wipc1dd713fd116), and identical.configand LLVM 23 / Rust 1.99 toolchains:A1,A2) meanB1,B2) meancompute.lightd=4us_per_submit19.14 µs(19.18,19.10)18.67 µs(18.53,18.82)compute.lightd=4submit_cpu_us11.73 µs(11.71,11.75)11.50 µs(11.43,11.56)compute.lightd=8submit_cpu_us11.67 µs(11.67,11.67)11.40 µs(11.33,11.48)compute.lightd=32us_per_submit13.75 µs(13.80,13.71)13.98 µs(13.69,14.28)B2outlier;submit_cpu-0.44%)render.lightd=1us_per_submit/submit_cpu_us131.52/12.32 µs129.73/11.16 µsrender.lightd=4us_per_submit/submit_cpu_us26.21/12.83 µs25.67/12.44 µsrender.lightd=8us_per_submit/submit_cpu_us23.35/14.07 µs23.09/13.55 µsrender.lightd=32us_per_submit/submit_cpu_us22.52/14.33 µs22.33/13.83 µsrt.scenelight d=2fps/fps_timed/submit_cpu_us8,754/8,231/29.95 µs8,761/8,258/29.75 µsd8b92e4d4/4)rt.scenemedium d=2fps/fps_timed/submit_cpu_us887.6/919.2/47.08 µs888.4/919.8/43.33 µs3d294d0e4/4)dEQP-VK.api.smoke8/8 PASS on every boot,rt.sceneexact CRCs (d8b92e4dlight,3d294d0emedium), 15 s RTCs2idlePASS onB1with post-wakedEQP-VK.api.smoke8/8 PASS andrt.scenelight8,750.7 fps(CRCd8b92e4d),0failed systemd units,0new kernel GPU/MMU warnings or faults.tools/asahi/g17-*.pyPASS (pluslegacy-wq-prepub-abort-tests.pyPASS); KUnitasahi_g17*468/468 PASS including new suiteasahi_g17_queue_config_steady.Risk: Two-way door; scoped to G17 direct compute/render submission and steady-state
QueueConfigcaching indrivers/gpu/drm/asahi/g17/(no UAPI, ABI, DT, or M1–M4 changes).