Skip to content

drm/asahi: g17: deduplicate sync-input chains and resolve M5 cross-QID sources directly - #3025

Merged
DjDeveloperr merged 6 commits into
mainfrom
perf/asahi-g17-m5-direct-cross-qid-sources
Nov 25, 2026
Merged

DjDeveloperr merged 6 commits into
mainfrom
perf/asahi-g17-m5-direct-cross-qid-sources

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What: Stacked on #2969. Cross-queue compute handoffs hit three layers of host lock contention: asahi_g17_collect_fences() expanded every unsignaled dma_fence_chain node without same-context coalescing, input_sources() / compute_readiness() / sources_published() always took the global device mutex to scan compute queues, and M5 compute_direct() rejected every packet with converted input sources (so cross-QID compute went through compute_inline() under the device mutex). This coalesces same-context fence leaves, publishes immutable cross-QID kick metadata for lock-free checks, and lets M5 compute_direct() resolve same-VM compute sources directly.

Tested: J714s M5 Pro (G17S B1), Aurora 7.3.0 M5 integration test kernels (builds 7 and 8): 0 GPU faults, 0 kernel warnings, multi-queue/sync Vulkan CTS 3,976/3,985 pass, 0 fail, and 2,984/2,985 CTS on build 8; multi-queue binary and timeline semaphore handoffs (d=2) +25.8 % to +27.3 % (18.88 → 14.83 us, 18.76 → 14.91 us), concurrent multi-pass compute/render overlap +21.2 % to +26.1 %. Host tests --only g17 116/116 pass (10/10 mutations killed).

Risk: two-way · M5 family; the fence-chain coalescing in sync_input.c (main's coalescing collector, which G17 input sources now use) and the fence::Submission published-source tracking are shared G17 code and also run on Neo (G17P).

Not yet: Neo (G17P) at this head (its last row predates the main merge), M5 Max (J716C), M5 Ultra (J775D) and M5 (J813) not run; failed systemd units not captured (SELinux is not enabled in the test kernel config).

After the main merge (11-25, main a73023bc5f1f): main's collect_leaf() gained a coalescing mode for G16 (#3043); G17's input_sources() now uses it through sync_input::collect_coalesced(), which also leaves context 0 alone, as this PR did.

Details

Stacking: stacked cleanly on #2969 (d13f2358d742, which builds on #2947 and #2955). The sole new commit on top of #2969 is drm/asahi: g17: deduplicate sync-input chains and resolve M5 cross-QID sources directly. Independent of the idle-housekeeping and render fast-done follow-up PRs; targets integration/aurora so Host tests CI runs on the full stack.

New commit: 550b955538f4.

Cross-queue compute handoffs previously hit three layers of host lock contention and fallback overhead:

  1. asahi_g17_collect_fences() expanded every unsignaled node in a timeline dma_fence_chain without same-context coalescing (forcing reallocations and per-leaf global device-mutex scans inside Backend::input_sources()).
  2. Backend::input_sources(), compute_readiness(), and sources_published() always took the global device mutex and linearly scanned compute queues to check whether a same-VM producer was published.
  3. Backend::compute_direct() unconditionally rejected packets with converted input sources, forcing every cross-QID compute submission through compute_inline() under the global device mutex (and holding m5_outer across mailbox doorbell I/O in ComputeHost::notify()).

This commit:

  • Coalesces healthy unsignaled leaves sharing a non-zero fence context in collect_leaf() (drivers/gpu/drm/asahi/g17/sync_input.c), keeping only the latest seqno via dma_fence_is_later() while preserving every failed leaf (status < 0), keeping the initial Rust collection capacity at 4, and hoisting the fallback device mutex out of the leaf loop in Backend::input_sources().
  • Publishes immutable cross-QID kick metadata (PublishedSource: epoch, publication order, KickDependency, and producer source_readers counter) onto fence::Submission once compute::Queue::publish() commits and rings its doorbell, invalidating it on retirement, error, replay, and cancel. Tracks the live epoch in published_epoch (AtomicU64, 0 = unpublished) so has_published_epoch() and empty clear_published() skip Submission::state, stores immutable vm_status outside Mutex<State> so same_vm() is lock-free, and removes ReaderHint's blind spot so lock-free Hold::new() loans are always observed by shareable(), can_rearm(), and reset_for_owner().
  • Uses PublishedSource for lock-free checks in input_sources(), compute_readiness(), and sources_published(), allows M5 compute_direct() to resolve same-VM compute sources directly (skipping redundant explicit barriers, self-reader Holds, and firmware_consumer marks when a source was already published on the consumer's own physical QID in the same epoch while still validating source_status() and recovery/epoch), marks firmware_consumer atomically on cross-QID producers, and drops m5_outer before port.notify() in ComputeHost::notify().
  • Adds host C+Rust unit tests and 10/10 mutation controls in tools/asahi/g17-m5-cross-qid-direct-tests.py.
Evidence
  • scripts/checkpatch.pl --strict (sync_input.c): 0 errors, 0 warnings, 0 checks.
  • Host tests (python3 -I tools/asahi/run-host-tests.py --only g17): 116/116 passed (g17-m5-cross-qid-direct-tests: base C+Rust pass + 10/10 mutations killed: no-chain-dedup, coalesce-failed-leaf, hint-blind-spot, skip-epoch-check, skip-recovery-recheck, lock-per-leaf, hold-m5-outer-compute-host, same-qid-emits-barrier, lock-has-published-epoch, lock-same-vm).
  • Hardware (Apple M5 Pro / J714s / G17S B1): qualified in Aurora 7.3.0 M5 integration test kernel builds 7 and 8 (0 GPU faults, 0 kernel warnings; 3,976/3,985 multi-queue/sync Vulkan CTS passed with 0 failures and 2,984/2,985 CTS on build 8); improved multi-queue binary and timeline semaphore signal handoffs (d=2) by +25.8% to +27.3% (18.88 -> 14.83 us, 18.76 -> 14.91 us) and concurrent multi-pass compute/render overlap by +21.2% to +26.1%.

Regression tuple (pre-PR checklist §5)

Field Value
Board run Apple M5 Pro (J714s, G17S B1), the only board run
Distro Arch Linux ARM
Kernel Aurora 7.3.0 M5 integration test kernels, builds 7, 8 and 9 (build 9 carries all five PRs: #3023, #3024, #3025, #3035, #3036)
Mesa test build 60a40c285f on builds 7/8; test build git-8956dffd84 (with aurora-silicon/mesa#793) on build 9
GPU faults 0 (microbenchmark health check gpu_faults_delta=0, stress gate, CTS runs)
Kernel WARNs 0 (as recorded in the run summaries; the raw dmesg of these runs was not kept)
Vulkan CTS build 8: 2,984/2,985 passed, 0 failed; build 9: 4,058/4,068 multi-queue + timeline semaphore passed, 0 failed
SELinux N/A: the test kernel config has CONFIG_SECURITY_SELINUX unset
Failed systemd units Not captured: no systemctl --failed output was kept for these runs
Not run G17P (Neo), M5 Max (J716C), M5 Ultra (J775D), M5 (J813)

@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) blast:neo Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) merge-conflict Conflicts with the base branch (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 24, 2026
…D sources directly

Cross-queue compute handoffs previously hit three layers of host lock
contention and fallback overhead:

1. asahi_g17_collect_fences() expanded every unsignaled node in a
   timeline dma_fence_chain without same-context coalescing (forcing
   reallocations and per-leaf global device-mutex scans inside
   Backend::input_sources()).
2. Backend::input_sources(), compute_readiness(), and sources_published()
   always took the global device mutex and linearly scanned compute
   queues to check whether a same-VM producer was published.
3. Backend::compute_direct() unconditionally rejected packets with
   converted input sources, forcing every cross-QID compute submission
   through compute_inline() under the global device mutex (and holding
   m5_outer across mailbox doorbell I/O in ComputeHost::notify()).

Coalesce healthy unsignaled leaves sharing a non-zero fence context in
collect_leaf() (keeping only the latest seqno via dma_fence_is_later()
while preserving every failed leaf with status < 0), keeping the initial
Rust collection capacity at 4, and hoist the fallback device mutex out
of the leaf loop in Backend::input_sources().

Publish immutable cross-QID kick metadata (PublishedSource: epoch,
publication order, KickDependency, and producer source_readers counter)
onto fence::Submission once compute::Queue::publish() commits and rings
its doorbell, invalidating it on retirement, error, replay, and cancel.
Track the live epoch in published_epoch (AtomicU64, 0 = unpublished) so
has_published_epoch() and empty clear_published() skip Submission::state,
and store immutable vm_status outside Mutex<State> so same_vm() is
lock-free. Remove ReaderHint's blind spot so lock-free Hold::new() loans
are always observed by shareable(), can_rearm(), and reset_for_owner().

Use the PublishedSource snapshot for lock-free checks in input_sources(),
compute_readiness(), and sources_published(), allow M5 compute_direct()
to resolve same-VM compute sources directly (skipping duplicate explicit
barriers, self-reader Holds, and firmware_consumer marks when a source
was already published on the consumer's own physical QID in the same
epoch while still validating source_status() and recovery/epoch), mark
firmware_consumer atomically on cross-QID producers, and drop m5_outer
before port.notify() in ComputeHost::notify().

Add host C+Rust tests and mutation controls in
g17-m5-cross-qid-direct-tests.

Signed-off-by: Diljit Singh <[email protected]>
@DjDeveloperr
DjDeveloperr force-pushed the perf/asahi-g17-m5-direct-cross-qid-sources branch from 3a3b032 to 550b955 Compare November 24, 2026 16:52
@DjDeveloperr
DjDeveloperr requested review from a team as code owners November 24, 2026 16:52
@github-actions github-actions Bot removed the merge-conflict Conflicts with the base branch (bot) label Nov 24, 2026
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Merge readiness at c9d9d6be: not ready yet

Check Detail
CI at head running running: apple-build, host-tests, KUnit ane-boot, KUnit ane-pm, KUnit dcp-fabric, KUnit dcp-topology
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head no no line with the head SHA c9d9d6be, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: two-way · M5 family; the fence-chain coalescing in syncinput.c (main's coalescing collector, which G17 input sources now use) and the fence::Submission published-source tracking are shared G17 code and also run on Neo (G17P).

Areas: area:gpu

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

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Rebased onto main (2ba145b5e335, previously a4b51cdff0a7): 3a3b032c6171 → 550b955538f4.

Conflicts were all in drm/asahi: g17: enable direct compute submission on M5, from the dead-code removal merged in #2433:

  • g17/initdata/m5.rs: main removed the unused m5_policy_telemetry_word(). That removal is kept, and only this commit's new m5_history_view() is added.
  • g17/runtime.rs publish_compute_raw(): main reworded the comment on the M5 outer-ring reservation (InitData::publish_work_at). This commit moves that block below the queue checks, so the old copy is dropped as before.

The stack is unchanged: on #2969 (d13f2358d742). Every other commit is unchanged (git range-diff: patch-identical).

Host tests: tools/asahi/run-host-tests.py --only g17 116/116 pass. scripts/checkpatch.pl --strict: 0 errors, and the same warnings as before the rebase. The full suite runs in the Host tests check.

…i-g17-m5-direct-cross-qid-sources

Bring in the base PR's merge of main up to 6ec49ac, including its
m5_history_view() update for the relocated M5 submission-history
fields.

Conflict in tools/asahi/run-host-tests.py: both sides register a new
g17 test; both are kept.

Signed-off-by: Diljit Singh <[email protected]>
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Merged the updated base (with main at 6ec49ac74755) in, now at 5eb4df2c063f; the only conflict was the test list in run-host-tests.py, both entries kept. tools/asahi/run-host-tests.py --only g17: 119/119 pass; kernel build and hardware row at this head still to do.

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Nov 24, 2026

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No code blockers.

What I checked
  • collect_leaf() in sync_input.c: it keeps only the latest healthy unsignaled fence per context, as dma_fence_unwrap_merge() does, and never coalesces failed leaves.
  • PublishedSource: it is set only for live, unerrored, unretired firmware sources, and cleared on error, retire, cancel and replay. resolve_direct_sources() re-checks epoch, recovery state and source status after taking the Hold, and drops the hold on every skip.
  • The cross_qid_mask shift is bounded (at most 31 sources).
  • The same-QID skip uses the target QID.
  • The same_vm() behaviour change: its only caller runs after source_status() has confirmed the source is not complete.
  • ReaderHint::has_readers() is now always exact, which is the conservative direction.
  • ComputeCell::qid is mirrored under the cell lock.
  • Against #3023 and #3036 the only overlap is run-host-tests.py (test-only).

To merge:

  • a T6050 / J714s (M5 Pro) row built from this head (a batched fleet candidate that contains this head unchanged counts).
  • a T8140 / J700 (Neo, G17P) regression row at this head, because this PR changes shared G17 code that also runs on Neo (sync_input.c coalescing, fence::Submission published-source tracking).
  • CI: the only red check is host-tests, and its three failures (m3-recovery-tests, m3-recovery-tests --mutate, m3-runtime-tests) fail the same way on main itself (0c4e19df, run 45466941208). They are not from this PR. Every G17 host test passes.
  • Base: main has moved past 6ec49ac7 (now 77561654). The new commits touch none of this PR's files and the head merges cleanly, so a branch update needs no new row.

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) and removed ci-failing A check failed at the PR head (bot) labels Nov 24, 2026
@DjDeveloperr

DjDeveloperr commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Hardware row at e35ddb55bc59 (in fleet candidate b7b130a75bab): Apple M5 Pro (T6050 / J714s / G17S B1), pass

Build: fleet candidate wip/m5-wavec-fleet-candidate-20261125 at b7b130a75bab: all eight Wave C PR heads, unchanged, each with main merged in up to a73023bc5f1f. Kernel 7.3.0-m5-wavec2, built natively on the M5 (clang 22.1.8, rustc 1.98.1) with the running default's own config: make -j18 Image modules dtbs exit 0, 0 errors. Default command line (MTE on, SEP writes on). Mesa: the default Borealis 26.3.0-devel (aac82bea8e). Headless only.

Since the 11-24 row (at 5eb4df2c063f): main merged in. G17's input_sources() now collects through main's coalescing collector (#3043), which also leaves context 0 alone, as this PR did. New commit b15be7d699b0 wraps one line to 100 columns.

Result:

  • Boot: 7.3.0-m5-wavec2 booted with the default command line in 29 s. Failed units: only tailscaled.service, which also fails on the default boot. 0 SELinux denials (LSMs capability,landlock). dmesg: 0 new kernel errors, and 0 GPU or DART faults, timeouts or recoveries across all runs below. Kernel lines at priority err or worse: 10, none from the GPU, all of kinds the default boot also logs (HID listeners, DCP clock index).
  • gpubench-vk (µs per submit, all ok):
    • compute.light: d1 108.0, d2 60.7, d4 28.2.
    • compute.heavy: d1 373.1 (5,755 GFLOP/s), d4 262.5 (8,182 GFLOP/s).
    • render.light: d1 128.2, d2 71.8, d4 25.8.
    • render.heavy: d1 261.4, d4 125.3.
    • sync.signal: d1 91.0 µs latency.
    • concurrent.cr: d4 overlap 1.02.
  • Vulkan CTS (deqp-runner, --deqp-surface-type=fbo), 0 fail, crash or timeout:
    • synchronization.smoke.*: 12/12.
    • synchronization2.smoke.*: 10/10.
    • compute.pipeline.basic.*: 80 pass, 1 not supported.
    • draw.renderpass.linear_interpolation.*: 12 pass, 9 not supported.
    • synchronization2.op.multi_queue.*, every 8th mustpass case (2,970 cases): 2,147 pass, 823 not supported, the same as the default kernel (7.3.0-m5-cdirect15) in the same slot.
  • GL (zink on Borealis, surfaceless; µs per submit): gpubench-gl render.light d1 143.5, d2 86.0; compute.light d1 109.5, d2 62.7; all ok.
  • Deep sleep: one RTC wake (mem_sleep deep, +28 s, Wi-Fi parked across it): entered and returned in 33.6 s, suspend_stats success 0 → 1, fail 0, same boot. After the wake the GPU is live (vulkaninfo and a dispatch). gpubench-vk compute.light d1 108.5, d4 26.9; render.light d1 128.5, d4 27.4; sync.signal d1 90.2 µs, all ok. 0 new GPU errors. The wake's err-level lines are display (DCP service matching), USB, PCIe and SD-card lines, none from the GPU.
  • GPU capacity after all runs: crashed=0, online=1; firmware_linked_render_graphs leaked=0; drained_render_pairs failures=0 out_of_service=0; 0 quarantined or awaiting-witness compute queues; 0 refusals; sync inputs converted/published 1,525/1,525. Compute channels went from 4 to 8 across compute.light and compute.heavy.
  • Restore: afterwards the M5 runs its slot-start default 7.3.0-m5-cdirect15 again: all 253 boot-partition files are byte-identical, and the kernel, Mesa and packages are unchanged. The trial modules are removed and the GPU is live.

Not run: GLES CTS (the surfaceless glcts harness problem from the 11-24 row; the GL smoke above ran). Neo (G17P) at this head. No other Mac.

@github-actions github-actions Bot added merge-conflict Conflicts with the base branch (bot) and removed needs-hw-row No hardware row at the PR head (bot) labels Nov 24, 2026
…i-g17-m5-direct-cross-qid-sources

Bring in the base branch, which now carries main up to a73023b.

Conflict:
- drivers/gpu/drm/asahi/g17/sync_input.c: main (4ec3675) gives
  collect_leaf() a coalesce_contexts mode for G16's firmware barriers,
  drops already-signalled leaves and merges repeated ones, while G17
  kept the collector that does not coalesce. This branch coalesces
  same-context leaves for G17's input sources. main's collector is
  kept, its coalescing mode also leaves context 0 alone (it names no
  timeline), as this branch did, and G17's Backend::input_sources()
  now collects through sync_input::collect_coalesced(). The Rust
  collect(), which nothing calls any more, goes away; the C collector
  without coalescing stays, as main's M4 fence-signalling selftest
  checks it. g17-m5-cross-qid-direct-tests.py calls collect_leaf() in
  its coalescing mode, and its mutations follow main's condition.

Signed-off-by: Diljit Singh <[email protected]>
Split the Submission::state initializer that "drm/asahi: g17:
deduplicate sync-input chains and resolve M5 cross-QID sources
directly" left at 111 columns, as checkpatch asks. No functional
change.

Signed-off-by: Diljit Singh <[email protected]>
@DjDeveloperr
DjDeveloperr requested a review from a team as a code owner November 25, 2026 10:28
@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) and removed ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) labels Nov 25, 2026
…i-g17-m5-direct-cross-qid-sources

Bring in the removal of the unused unlocked M5 history update from the base branch. No conflicts.

Signed-off-by: Diljit Singh <[email protected]>
@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 Nov 25, 2026
satchlj
satchlj previously approved these changes Nov 25, 2026

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Verdict: MERGE at e35ddb55bc59

Blockers: none

Checked: Full diff audit of drivers/gpu/drm/asahi/g17/ (completion.rs, fence.rs, job.rs, queue/compute.rs, runtime.rs, runtime/backend.rs, sync_input.c, and sync_input.rs) plus paginated CI and J714s hardware row verification.

Evidence
  • Fence coalescing & published-source lifecycle: sync_input.c coalesces healthy unsignaled leaves sharing a non-zero dma_fence context while preserving errored leaves and context 0. fence::Submission encodes published_epoch (epoch.wrapping_add(1) with tag != 0 guard), clears PublishedSource on retire, error, cancel, replay, and release_state(), and queue/compute.rs re-checks cancel_requested() after note_source_published().
  • Lock-free cross-QID resolution: Backend::resolve_direct_sources() validates source_status(), skips explicit barriers/holds for same-QID sources already ordered by the queue's implicit parent, takes Hold::new(&published.readers) for cross-QID sources (with ReaderHint::has_readers() reading count directly), re-validates recovery_state == 0, port.generation() == generation, source_status(), and has_published_epoch(generation), and falls back to the device-mutex path on any mismatch. KICK_BARRIERS_MAX is 31 (< 64), so cross_qid_mask shifts cannot overflow.
  • CI & hardware evidence: Paginated numeric-ID check-runs 19/19 passed (0 active / 0 bad), commit statuses clean, exact-head J714s Apple M5 Pro pass row posted (wip/m5-wavec-fleet-candidate-20261125 at b7b130a75bab); unrun boards are explicitly noted in Not yet:.

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

Copy link
Copy Markdown
Contributor Author

Tested (J700 MacBook Neo, Apple A18 Pro / G17P B1, combined Wave C g17 kernel): PASS (correctness, boot, stability) at exact PR head e35ddb55bc59392f2b0aec492ff94f57239d81b9 in combined tree 7bb607c48427f67f8c3cadb31aad26e017804e0d (origin/main 7c9d9adcda5a + #2947, #2955, #2969, #3024, #3036, #3023, #3025, #3035; kernel 7.3.0-neo-wavec, vmlinuz SHA-256 be56c16aa298..., aurora.ko SHA-256 bef28f236557...).

  • Host tests & boot: 215/215 g17 host tests passed on the combined tree (python3 -I tools/asahi/run-host-tests.py --only g17). Booted cleanly via one-shot grub2-reboot with default 7.3.0-41 kernel cmdline verbatim (wld0 Wi-Fi + eDP-1 display up, SELinux Enforcing, 0 failed units).
  • Vulkan CTS & correctness (7.3.0-neo-wavec, system Mesa git-d4ad4a4dce):
    • Full dEQP-VK.synchronization.timeline_semaphore.*: 2,880/2,880 Pass, 0 failures, 0 recoveries.
    • Focused compute/sync CTS (compute.pipeline.basic.*, synchronization*.smoke.*, synchronization.basic.*, timeline_semaphore subsets): 373 Pass, 7 NotSupported, 0 failures, 0 recoveries (380/380 recorded).
    • Vulkan compute CRCs: 5/5 matched (conv2d gaussian 2d55a14d / bilateral 6cdc0716, edge sobel 27c79e6d / harris 4cebadfc, stereo c62aadf9).
    • Offline Geekbench 6.7.1 Vulkan: 8/8 workloads completed, 0 validation errors.
  • Health & restore: 0 GPU faults, 0 kernel WARNs/BUGs/Oops, 0 AVC denials across boot and the full test window, 0 failed units. Restored cleanly back to 7.3.0-41.fc44.aurora.aarch64 with byte-exact /boot, ESP, /lib/modules, BLS, and grubenv verification.
  • Performance vs shipped 7.3.0-41 (note: compares origin/main + Wave C vs Nov 16 -41, not a main-only control): rt.scene raster d2 improved +19.1% (148.9 → 177.4 fps), copy.bw buf2img d1 -3.7% (1612.9 → 1552.8 µs), compute.heavy alu queues/d2 -2.0%. compute.light queue/d2 was slower vs -41 (35.1 → 47.6 µs, submit CPU 9.1 → 12.0 µs, d1 +3.3%, d4 +5.4%), and a single offline GB6 pass showed Edge +4.7% / Particle +6.2% (unconfirmed single pass); a main-only (7c9d9adc) arm is needed to separate main drift from the 8-PR stack.
  • Merge note: tools/asahi/run-host-tests.py had a test-list-only conflict when combining the #2947..#3023 and #2969..#3035 stacks (resolved by keeping the union of ASAHI_TESTS entries; zero kernel source conflicts).

@DjDeveloperr
DjDeveloperr dismissed satchlj’s stale review November 25, 2026 19:04

The merge-base changed after approval.

satchlj
satchlj previously approved these changes Nov 25, 2026

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Verdict: MERGE at e35ddb55bc59

Blockers: none

Checked:

  • Clean-room diff with no Apple copyrighted material, decompiled listings, or copied firmware/tuning data.
  • No hardcoded model, board, or firmware gates and no new module or command-line parameters.
  • No hardcoded hardware safety limits; safety and hardware values come from machine descriptors and runtime state.
  • Clean human Signed-off-by: DCO on every commit and zero AI attribution across commits and PR text.
  • Exact-head hardware rows pass on both J714s (M5 Pro) and J700 (Neo) with clean merge preview on main, and all paginated CI checks are green.
Evidence
  • Incremental diff audit above #2969 (10 files):
    • drivers/gpu/drm/asahi/g17/sync_input.c and sync_input.rs: coalesces healthy unsignaled leaves sharing a non-zero dma_fence context while preserving errored leaves and context 0; ReaderHint::has_readers() reads count directly so direct-path Hold::new() loans are always observed.
    • drivers/gpu/drm/asahi/g17/fence.rs, completion.rs, job.rs, queue/compute.rs: stores immutable vm_status for lock-free same_vm(), encodes published_epoch (epoch.wrapping_add(1) with tag != 0 guard), clears PublishedSource on retire, error, cancel, replay, and release_state(), and re-checks cancel_requested() after note_source_published().
    • drivers/gpu/drm/asahi/g17/runtime.rs and runtime/backend.rs: mirrors ComputeCell::qid atomically under the cell lock, drops m5_outer before mailbox I/O in ComputeHost, skips duplicate explicit barriers for same-QID sources, and in resolve_direct_sources() takes Hold::new(&published.readers) for cross-QID sources followed by re-checking recovery_state == 0, port.generation() == generation, source_status(), and has_published_epoch(generation), falling back on any mismatch. KICK_BARRIERS_MAX (31) keeps cross_qid_mask shifts in bounds.
  • Hardware rows & CI:
    • Exact-head Apple M5 Pro (T6050 / J714s / G17S B1) pass row in fleet candidate b7b130a75bab (gpubench-vk ok, Vulkan CTS 0 fail, 0 GPU/DART faults).
    • Exact-head MacBook Neo (J700 / G17P B1) combined Wave C pass row (7bb607c48427): 215/215 g17 host tests, 2,880/2,880 timeline semaphore CTS pass, 373 focused compute/sync CTS pass / 0 fail, 5/5 compute CRCs, 0 GPU faults / 0 AVCs.
    • Paginated CI check-runs at e35ddb55bc59: 19/19 green (0 active, 0 failed), clean merge preview onto main.

@DjDeveloperr
DjDeveloperr dismissed satchlj’s stale review November 25, 2026 21:35

The merge-base changed after approval.

@github-actions github-actions Bot added the merge-conflict Conflicts with the base branch (bot) label Nov 25, 2026
Merge origin/main (f3bfe50) to keep the union of host test entries
in tools/asahi/run-host-tests.py after #3024, #3036, and #3023 landed.

Signed-off-by: Diljit Singh <[email protected]>
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Merged main (f3bfe5007089) into perf/asahi-g17-m5-direct-cross-qid-sources at c9d9d6be45d8 (non-force-push). The only conflict was the test registry union in tools/asahi/run-host-tests.py after #3024, #3036, and #3023 landed; all kernel source changes from e35ddb55bc59 are unchanged, carrying forward the J714s and J700 hardware verification rows.

@github-actions github-actions Bot added needs-hw-row No hardware row 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) merge-conflict Conflicts with the base branch (bot) labels Nov 25, 2026
@DjDeveloperr
DjDeveloperr merged commit 95a983c into main Nov 25, 2026
19 checks passed
@RyanTheTide
RyanTheTide deleted the perf/asahi-g17-m5-direct-cross-qid-sources branch November 27, 2026 13:21
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:m5 Macs affected, from Merge risk (bot) blast:neo 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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants