Skip to content

borealis: keep deferred empty clear-only renders on VDM - #1244

Merged
RyanTheTide merged 4 commits into
aurora-wipfrom
perf/keep-deferred-clear-vdm
Nov 28, 2026
Merged

RyanTheTide merged 4 commits into
aurora-wipfrom
perf/keep-deferred-clear-vdm

Conversation

@DjDeveloperr

Copy link
Copy Markdown

What:

  • Keep finalized clear-only VDM render streams alive on struct hk_deferred_clear::vdm_cs when Borealis defers an empty single-sample clear-only render pass in hk_optimize_empty_vdm() on native AGX3 / M5, instead of destroying the VDM stream immediately.
  • If every cleared attachment owned by vdm_cs is absorbed by a later render pass without needing a memory fill (hk_take_deferred_clears()) or superseded by a later clear (hk_defer_clear_internal()), drop vdm_cs via hk_sync_forget_stream() and clear any render_pack/pass_merge references.
  • If the deferred clear flushes unabsorbed (for example at vkEndCommandBuffer() or before a pass with different attachments), leave vdm_cs in control_streams at its recorded VDM position without emitting any CDM hk_clear_image() fill or extra barrier, eliminating VDM -> CDM -> VDM cross-engine round-trips and preserving fragment-only tile-hazard ordering (load_hazard_frag) with following renders.
  • Have hk_sync_forget_stream() clear singleton sync_pass_records entries whose first and last both match the forgotten stream, so dropping an absorbed clear-only render pass does not rebind its footprint to an earlier unrelated render on the subqueue.
  • Add unit test coverage in test-hk-sync-prior.c for singleton pass-record cleanup on hk_sync_forget_stream().

Tested:

  • Exact head 4421add60059d3f1f73c8c0489d277b93a28d1a1 on MacBook Pro M5 Pro (J714s, G17S, kernel 7.3.0-m5-cdirect16) vs aurora-wip 13400438325:
    • Assert (-Db_ndebug=false) and Release (-Db_ndebug=true) --suite asahi: 215/215 PASS each (0 warnings in PR diff).
    • Live GPU g17p_vulkan_clear_pass_load (empty clear-only pass followed by depth-load pass with no barrier, 2x D32S8 and 1x D32, 8 frames each): PASS (0/8 wrong on both).
    • Vulkan CTS (cts1471): dEQP-VK.api.command_buffers.* 131/131 PASS, 0 Fail.
    • gpubench-vk: render.pass_chain (all_bar d=1 197.1 us, d=4 309.8 us) and render.deferred (1080p d=1 109.1 us, d=4 85.6 us): 4/4 valid=True, status=ok.
    • GTA V Enhanced (3024x1964, clean A/B vs 13400438325 + HK_FRAME_ANATOMY_TS=all on PR):
      • Clean FPS: BASE (1578 MHz med) P0=60.87 P1=53.93 P2=54.21 P3=60.31 P4=57.43 -> PR (1620 MHz med) P0=60.69 P1=53.67 P2=54.55 P3=61.72 P4=59.04.
      • Frame anatomy: standalone fast-clear CDM jobs dropped 112 -> 52 (-53.6%), total fast-clear CDM jobs dropped 234 -> 158 (-32.5%), and deferred-clear fill ... gfx=1 dropped 11 -> 0 (all converted to deferred-clear kept vdm, overlapping on VDM with concurrent compute and next-pass vertex halves).
    • Health across all runs: boot=same, online=1, crashed=0, quarantined=0, 0 kernel errors, 0 GPU faults.
Head SHA Machine / Chip / Kernel Result
4421add60059d3f1f73c8c0489d277b93a28d1a1 MacBook Pro M5 Pro (J714s, G17S, 7.3.0-m5-cdirect16) PASS: Assert & Release --suite asahi 215/215, g17p_vulkan_clear_pass_load PASS, dEQP-VK.api.command_buffers.* 131/131, gpubench-vk 4/4 valid, GTA V 3024x1964 standalone fast-clear CDM 112->52 (-53.6%), P3 60.31->61.72 / P4 57.43->59.04 FPS, 0 GPU faults

Risk: two-way · J714s

Not yet:

  • Second-generation hardware verification on J700 (G17P).

When Borealis defers an empty single-sample clear-only render pass in
hk_optimize_empty_vdm(), it previously destroyed the VDM control stream
immediately. If a later pass in the same command buffer did not absorb
the clear (for example at vkEndCommandBuffer() or before a pass with
different attachments), hk_flush_deferred_clears_why() had to emit a
compute fast-clear (CDM) job, injecting a VDM->CDM->VDM cross-engine
round-trip and blocking the following render's vertex half behind CDM.

On native AGX3 / M5, keep the finalized clear-only VDM stream alive on
struct hk_deferred_clear::vdm_cs while deferred:
- If every cleared attachment owned by vdm_cs is absorbed without
  needing a memory fill (or superseded by a later clear of the same
  image), drop vdm_cs via hk_sync_forget_stream() and clear any
  render_pack/pass_merge references.
- If the deferred clear flushes unabsorbed, keep vdm_cs in
  control_streams at its recorded VDM position without emitting any CDM
  fill or extra barrier, so the clear stays on VDM and allows fragment-
  only tile-hazard ordering with following renders.

Also have hk_sync_forget_stream() clear singleton sync_pass_records
entries whose first and last stream are both the forgotten stream, so
dropping an absorbed empty clear pass does not rebind its footprint to
an earlier unrelated render on the subqueue.

Signed-off-by: DjDeveloperr <hey@djdev.me>
@DjDeveloperr
DjDeveloperr requested review from a team as code owners November 27, 2026 16:55
@DjDeveloperr

Copy link
Copy Markdown
Author

J700 (MacBook Neo, Apple A18 Pro T8140 / G17P B1, second generation) at exact head 883ced869b31 against merge-base cb40d4645ab7: PASS — g17p-vulkan-clear-pass-load clean (0/8 wrong), 12/12 CRC-checked gpubench-vk rows match base identically, all compute timestamps non-zero, 0 CTS failures across 87,067 cases, no regressions on multi-pass render or compute.

Both arms are isolated release Borealis Vulkan overlays (-Dbuild-tests=false) built with identical options and loaded from private prefixes via VK_DRIVER_FILES / LD_LIBRARY_PATH on stock kernel 7.3.0-41.fc44.aurora.aarch64 with no reboot. System Mesa was untouched (stock.sh identical before and after). Each arm's driver ID confirmed its git SHA (git-cb40d4645a vs git-883ced869b); libvulkan_asahi.so SHA-256 base abba983c…, head 00814eef….

Live GPU clear-pass test (g17p-vulkan-clear-pass-load):

  • Base (cb40d4645ab7, 1×) and head (883ced869b31, 2×): PASS (2x D32S8: 0/8 frames wrong; 1x D32: 0/8 frames wrong on every run).

gpubench-vk (gpubench fdf4dd6). 30 s warm-up, then A1 B1 B2 A2 B3 A3 A4 B4 (n = 4 per arm, median us_per_submit and gpu_us; lower is better):

row d base us/sub head us/sub Δ us/sub base gpu_us head gpu_us Δ gpu_us ranges (us/sub)
render.light kind=clear 1 103.4 108.7 +5.11% 8.6 8.8 +2.42% 103.3–104.2 / 103.3–113.3
render.light kind=clear 4 19.8 34.1 +72.11% 6.7 6.7 +0.62% 19.6–20.1 / 33.7–34.4 (VDM vs CDM; see note)
render.light kind=tri 1 / 4 124.2 / 34.0 124.7 / 33.8 +0.33% / -0.64% 9.2 / 7.2 9.1 / 7.0 -1.59% / -3.45% overlapping
render.pass_chain kind=all_bar 1 / 4 518.6 / 421.4 518.1 / 417.0 -0.09% / -1.04% 251.1 / 407.5 244.7 / 409.9 -2.54% / +0.57% overlapping
render.pass_chain kind=oq_bar 1 / 4 781.3 / 803.2 773.2 / 795.8 -1.03% / -0.93% 598.8 / 686.1 593.4 / 675.7 -0.91% / -1.52% overlapping
render.deferred tile msaa4 1080p 1 / 2 863.3 / 707.6 863.3 / 701.8 0.00% / -0.82% 706.1 / 700.0 705.8 / 699.9 -0.05% / -0.01% overlapping
render.deferred dram msaa4 1080p 1 / 2 3278.8 / 3000.0 3260.9 / 3000.0 -0.55% / 0.00% 3051.2 / 3264.6 3039.4 / 3260.6 -0.39% / -0.12% overlapping
render.postfx msaa4 1080p 1 / 2 730.8 / 597.6 729.9 / 597.0 -0.12% / -0.10% 527.3 / 681.8 527.2 / 681.6 -0.02% / -0.04% overlapping
compute.conv2d 1 / 4 1369.9 / 1247.4 1366.7 / 1237.1 -0.23% / -0.82% 1110.0 / 1259.3 1110.0 / 1258.3 0.00% / -0.09% overlapping
compute.heavy kind=alu 1 / 4 1369.9 / 1160.5 1369.9 / 1158.3 0.00% / -0.19% 1164.0 / 1164.0 1164.0 / 1164.0 0.00% / 0.00% overlapping
compute.light 1 / 4 104.3 / 20.2 103.9 / 20.1 -0.42% / -0.54% 1.8 / 1.8 1.8 / 1.8 0.00% / 0.00% overlapping
  • CRCs match base identically on all 12 CRC-checked rows (pass_chain 93411763, deferred tile 6dc74b48 / dram 7c09507f, postfx msaa4 668d6f0a, compute.conv2d 2d55a14d).
  • All compute rows report non-zero gpu_us timestamps (conv2d, compute.heavy, compute.light, 0 zero/NaN entries).
  • Note on render.light kind=clear d4: moving standalone empty clear-only command buffers from CDM back onto VDM moves untimed us_per_submit from CDM cadence (19.8 us, same as compute.light d4 20.1 us) to VDM cadence (34.1 us, matching render.light kind=tri d4 33.8 us and us_per_submit_timed 34.3 -> 34.1 us), while gpu_us is unchanged (6.7 us) and all multi-pass render rows are flat to slightly faster.

Targeted VK CTS on exact head 883ced869b31 (0 Fail, 0 recoveries):

  • Clear & dynamic rendering (--jobs 6, 58 s): 60,573 cases — 32,664 Pass, 27,909 NotSupported, 0 Fail (dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.* 9,150 Pass / 5,787 NS; dEQP-VK.api.image_clearing.* 23,514 Pass / 22,122 NS).
  • Core query/sync/command-buffer/fill (26,494 cases, 35 s): dEQP-VK.api.command_buffers.* (131 Pass), dEQP-VK.api.fill_and_update_buffer.* (96 Pass / 14 NS), dEQP-VK.synchronization{,2}.* (basic.*, op.single_queue.event.*, implicit.*: 6,973 Pass / 3 NS at --jobs 4), dEQP-VK.query_pool.* (19,243 Pass / 32 NS). At --jobs 6, 4 cases hit transient ResourceError (all 4 passed on the --jobs 4 recheck); during the --jobs 4 recheck, 1 query_pool.occlusion_query case hit a pre-existing aurora-wip SIGSEGV in vk_sync_note_pending() from vk_queue_submit_final() (unrelated to this PR's Borealis diff; re-running the case in isolation passed on both base cb40d4645ab7 and head 883ced869b31).

Fedora 44 Mesa Asahi CI (--suite asahi, Clang): 218/0 (hk_sync_stamps OK, hk_sync_prior OK, 0 warnings in PR diff).

Health (primary ABBA + 87k CTS slot): 0 GPU faults, 0 recoveries, 0 driver warnings, 0 AVC denials, 0 core dumps, 0 leftover processes, failed 0, SELinux Enforcing, stock.diff=0, state-diff=0.

@RyanTheTide

Copy link
Copy Markdown

1b1f2b3d2d4f Borealis 3-gen PASS (GCC 16.2.1 -Db_ndebug=false, isolated VK_DRIVER_FILES, stock Mesa untouched):

  • J700 (MacBook Neo, G17P, 7.3.0-aurora-fleet89): g17p-vulkan-clear-pass-load PASS (2x D32S8: 0/8 wrong, 1x D32: 0/8 wrong); deqp-vk 1,600 PASS / 0 FAIL (api.smoke.* 8/8, renderpasses.dynamic_rendering.primary_cmd_buff.*clear* 548/694, renderpasses.renderpass2.*clear* 989/1087, synchronization.basic.* 29/29, synchronization2.basic.* 26/26); 0 GPU faults, Enforcing, 0 failed units, 0 new AVC.
  • J413 (M2 Air, G14G B0, 7.3.0-aurora-fleet89): g17p-vulkan-clear-pass-load PASS; deqp-vk 1,581 PASS / 0 FAIL (api.smoke.* 8/8, dynamic_rendering.*clear* 548/694, renderpass2.*clear* 989/1087, synchronization.basic.* 21/29, synchronization2.basic.* 15/26); 0 GPU faults, Enforcing, 0 failed units, 0 new AVC.
  • J316s (M1 Pro, G13S, 7.3.0-aurora-fleet89): hk_sync_prior_test + hk_sync_stamps_test PASS; g17p-vulkan-clear-pass-load PASS; deqp-vk api.smoke 8/8 + synchronization.basic 21/29 (29 PASS / 0 FAIL); 0 GPU faults, Enforcing, 0 failed units, 0 new AVC.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: FINISH, then merge at 1b1f2b3d2d4f.
Blockers: Please repeat the J700 standalone clear-only depth-4 benchmark on this commit with the same interleaved baseline and include both end-to-end submit cadence and GPU time. The earlier J700 row reports 19.8 to 34.1 µs/submission in the untimed arm, with nonoverlapping samples, while the timed submit and GPU time are flat. If that tradeoff persists, please get the area owner’s disposition before landing.
Checked: The current-head J700, J413 and J316s correctness rows pass. I reviewed stream retention and removal, including the shared-attachment reference check, sync footprint removal, and the forward merge preserving the heap-slot reference updates. The requested benchmark concerns end-to-end throughput for standalone clear submissions.

#1244 (comment)
#1244 (comment)

@DjDeveloperr

Copy link
Copy Markdown
Author

Exact-head J714s refresh after merging aurora-wip (99658583598) into perf/keep-deferred-clear-vdm (1b1f2b3d2d4f668f4bca404c2f073c9717c086d9):

Head Hardware / Kernel Result
1b1f2b3d2d4f668f4bca404c2f073c9717c086d9 MacBook Pro M5 Pro (J714s, G17S, 7.3.0-m5-cdirect16) PASS: Clang 22.1.8 assert (0 warnings in diff) & GCC release --suite asahi 215/215 each (hk_sync_stamps 896/896, hk_sync_prior 3,786/3,786); live GPU g17p_vulkan_clear_pass_load (2x D32S8 0/8, 1x D32 0/8); 0 GPU faults

@DjDeveloperr

Copy link
Copy Markdown
Author

J700 (MacBook Neo, A18 Pro T8140 / G17P B1) recheck at exact head 1b1f2b3d2d4f against merge-base 99658583598, as requested. The untimed clear-only d=4 tradeoff persists: the free-running submit rate drops by the same amount as before. Timed submit and GPU time stay flat. Correctness is clean. This needs the area owner's disposition before landing.

Setup: both arms are release Borealis overlays built with identical options and loaded from private prefixes through VK_DRIVER_FILES / LD_LIBRARY_PATH. The stock kernel was 7.3.0-41.fc44.aurora.aarch64, there was no reboot, and system Mesa was untouched. Driver IDs were git-9965858359 and git-1b1f2b3d2d. The benchmark was gpubench fdf4dd6, with the same flags as the earlier row (--warmup-ms 250 --runs 3 --run-ms 300 --timed-runs 1 --timestamps on). After a 30 s discarded warm-up, the run order was A1 B1 B2 A2 B3 A3 A4 B4 (A = base, B = head, n = 4 per arm). All numbers are in µs. "Untimed" is free-running us_per_submit; "timed" is us_per_submit_timed.

render.light kind=clear d=4, per sample

run untimed timed submit_cpu_us gpu_us
A1 20.35 34.55 9.79 7.04
B1 33.79 33.84 15.60 6.67
B2 34.38 34.45 15.62 6.71
A2 20.16 33.83 9.33 6.60
B3 34.16 34.10 15.54 6.75
A3 20.43 34.75 9.43 6.75
A4 20.09 33.96 9.35 6.67
B4 33.83 33.95 15.52 6.58
median A → B 20.26 → 34.00 (+67.8%, no overlap) 34.26 → 34.03 (−0.7%) 9.39 → 15.57 (+65.8%, no overlap) 6.71 → 6.69 (−0.3%)

render.light kind=clear d=1, per sample

run untimed timed submit_cpu_us gpu_us
A1 104.60 126.00 13.92 9.17
B1 124.12 125.84 12.63 9.04
B2 106.99 108.26 10.79 8.58
A2 104.68 124.74 13.64 8.79
B3 123.10 124.95 11.75 8.67
A3 104.20 123.71 13.71 8.75
A4 104.31 125.26 13.81 8.79
B4 124.58 125.10 13.33 8.71
median A → B 104.46 → 123.61 (+18.3%, no overlap) 125.00 → 125.03 (0.0%) 13.76 → 12.19 (−11.4%) 8.79 → 8.69 (−1.2%)

In the earlier row, d=1 untimed moved only +5.1%. This time three of the four head samples sit at the VDM timed cadence (about 124 µs), the same value both arms reach in the timed arm.

Reference and multi-pass rows (median A → B, all samples overlap unless noted)

row untimed timed submit_cpu_us gpu_us CRC
render.light kind=tri d=1 127.85 → 128.87 (+0.8%) 129.56 → 130.98 (+1.1%) 18.09 → 18.16 9.12 → 9.25 n/a
render.light kind=tri d=4 34.06 → 34.27 (+0.6%) 34.23 → 34.44 (+0.6%) 14.35 → 14.36 7.12 → 7.17 n/a
render.pass_chain all_bar d=4 430.42 → 426.75 (−0.9%) 647.96 → 654.31 (+1.0%) 37.14 → 36.25 439.83 → 446.40 (+1.5%) 93411763 both, 8/8
render.pass_chain oq_bar d=1 788.44 → 786.37 (−0.3%) 924.50 → 923.09 (−0.2%) 97.08 → 100.07 (+3.1%; base A2 outlier at 86.0) 601.23 → 600.55 (−0.1%) 93411763 both, 8/8
render.pass_chain oq_bar d=4 813.01 → 811.91 (−0.1%) 970.91 → 961.54 (−1.0%) 189.44 → 201.20 (noisy, overlap) 681.51 → 677.29 (−0.6%) 93411763 both, 8/8
compute.conv2d d=4 1027.41 → 1027.41 (0.0%) 1263.16 → 1265.85 (+0.2%) 46.30 → 46.18 1139.56 → 1146.25 (+0.6%, all non-zero) 2d55a14d both, 8/8

What this means: with the head, a standalone empty clear-only command buffer goes back from CDM to VDM. Its untimed cadence moves from the CDM rate (about 20 µs, the same as compute.light d4) to the VDM rate (about 34 µs, the same as render.light kind=tri d4 and as the timed arm of both builds). The host-side submit_cpu_us rises by the same ~6 µs. GPU time does not change, and every real render row is flat. So the cost shows up only when an app submits empty clear-only command buffers back to back and never waits on them; any timed or rendering workload is unaffected.

Correctness and health:

  • g17p-vulkan-clear-pass-load passes on base (1 run) and head (2 runs), with 0/8 frames wrong for both 2x D32S8 and 1x D32.
  • CRCs match on all CRC-checked rows.
  • Across the slot: 0 GPU faults, 0 recoveries, 0 kernel lines, 0 driver warnings, 0 AVC denials, 0 core dumps and 0 leftover processes. The stock system was identical before and after, and state-diff was empty.

Fedora 44 Mesa Asahi CI (--suite asahi, Clang) at 1b1f2b3d2d4f: 218/0.

Keeping every unabsorbed empty clear-only render on VDM also moved
standalone clear-only command buffers, which flush their deferred clears
at vkEndCommandBuffer(), from a compute fill to a render of their own.
On the J700 that raised their submit cost from about 20 to 34 us at
depth 4 (CPU submit 9.4 to 15.6 us).

The VDM render only saves something when a later render pass in the
same command buffer is what flushes the clear: a compute fill there
sits between two renders (VDM->CDM->VDM). Flush through
hk_flush_deferred_clears_before_render() from hk_CmdBeginRendering()
and keep the render there. Any other flush (end of the command buffer,
a barrier, compute, a transfer) drops the kept render and fills the
image as before.

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

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The revised flush restores compute fills for standalone clears while keeping the render stream when another render pass follows. I checked that the drop path clears all deferred references before destroying each shared stream once and that the fill path reuses the saved graphics dependencies. Please post a J700 A/B at this commit for untimed clear-only depth 4 (including submit CPU time), plus the clear-pass-load correctness check and the multi-pass row. The previous head reproduced the slowdown, so its timing does not establish recovery here.

@DjDeveloperr

Copy link
Copy Markdown
Author

J700 (MacBook Neo, A18 Pro T8140 / G17P B1) recheck at exact head 404a387be357 against merge-base 99658583598. The clear-only regression from the 1b1f2b3d2d4f row is gone. Untimed kind=clear is back at base cadence at both d=4 (20.19 → 20.16 µs) and d=1 (103.92 → 104.04 µs). Timed, submit and GPU times are flat, and every other row is flat. Correctness is clean.

Setup was identical to the earlier row: both arms are release Borealis overlays built with the same options (driver IDs git-9965858359 and git-404a387be3). They were loaded from private prefixes through VK_DRIVER_FILES / LD_LIBRARY_PATH on the stock 7.3.0-41.fc44.aurora.aarch64 kernel, with no reboot and system Mesa untouched. The benchmark was gpubench fdf4dd6 with --warmup-ms 250 --runs 3 --run-ms 300 --timed-runs 1 --timestamps on. After a 30 s discarded warm-up the order was A1 B1 B2 A2 B3 A3 A4 B4 (A = base, B = head, n = 4 per arm). All numbers are in µs. "Untimed" is us_per_submit and "timed" is us_per_submit_timed.

render.light kind=clear d=4, per sample

run untimed timed submit_cpu_us gpu_us
A1 20.12 33.95 9.71 6.75
B1 20.12 33.98 9.48 6.75
B2 20.54 34.83 9.33 6.54
A2 20.62 34.95 9.38 7.04
B3 19.98 34.38 9.29 6.92
A3 20.18 34.15 9.42 6.79
A4 20.21 33.82 9.42 6.79
B4 20.19 34.42 9.46 6.79
median A → B 20.19 → 20.16 (−0.2%) 34.05 → 34.40 (+1.0%) 9.42 → 9.40 (−0.2%) 6.79 → 6.77 (−0.3%)

All four metrics overlap. In the 1b1f2b3d2d4f row, untimed was 20.26 → 34.00 (+67.8%) and submit_cpu_us was 9.39 → 15.57.

render.light kind=clear d=1, per sample

run untimed timed submit_cpu_us gpu_us
A1 103.52 125.26 13.32 8.88
B1 103.77 125.63 13.73 8.79
B2 104.93 124.95 13.79 8.92
A2 104.79 126.42 13.88 9.08
B3 103.84 125.26 13.68 9.08
A3 104.31 125.84 13.88 8.88
A4 102.92 124.48 13.48 8.75
B4 104.24 126.26 13.92 8.88
median A → B 103.92 → 104.04 (+0.1%) 125.55 → 125.44 (−0.1%) 13.68 → 13.76 (+0.6%) 8.88 → 8.90 (+0.2%)

All four metrics overlap. No head sample sits at the ~124 µs VDM cadence any more; in the 1b1f2b3d2d4f row it was 104.46 → 123.61 (+18.3%).

Reference and multi-pass rows (median A → B, all samples overlap unless noted)

row untimed timed submit_cpu_us gpu_us CRC
render.light kind=tri d=4 34.13 → 34.21 (+0.2%) 34.26 → 34.39 (+0.4%) 14.34 → 14.41 7.17 → 7.06 n/a
render.light kind=tri d=1 128.01 → 126.75 (−1.0%) 130.24 → 126.70 (−2.7%) 18.13 → 15.84 (B2/B4 low outliers at 11.1 / 13.5) 9.11 → 9.06 n/a
render.pass_chain all_bar d=4 424.63 → 427.96 (+0.8%) 650.05 → 649.35 (−0.1%) 37.24 → 36.47 (−2.1%, no overlap) 447.62 → 447.73 (0.0%) 93411763 both, 8/8
render.pass_chain oq_bar d=1 785.35 → 786.38 (+0.1%) 923.08 → 924.50 (+0.2%) 92.94 → 88.52 (noisy, overlap) 597.81 → 600.64 (+0.5%) 93411763 both, 8/8
render.pass_chain oq_bar d=4 809.72 → 811.91 (+0.3%) 961.54 → 960.00 (−0.2%) 207.77 → 165.28 (noisy, overlap) 679.03 → 687.03 (+1.2%, overlap) 93411763 both, 8/8
compute.conv2d d=4 1034.48 → 1038.06 (+0.3%) 1265.82 → 1268.50 (+0.2%) 46.75 → 46.70 1162.83 → 1164.12 (+0.1%, all non-zero) 2d55a14d both, 8/8

Correctness and health:

  • g17p-vulkan-clear-pass-load passes on base (1 run) and head (2 runs), with 0/8 frames wrong for both 2x D32S8 and 1x D32.
  • CRCs match on all CRC-checked rows.
  • Across the slot: 0 GPU faults, 0 recoveries, 0 kernel lines, 0 driver warnings, 0 AVC denials, 0 core dumps and 0 leftover processes. The stock system was identical before and after, and state-diff was empty.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The exact-head J700 ABBA closes the earlier throughput finding: depth-4 untimed clear is 20.19 to 20.16 us/submit and CPU submit is 9.42 to 9.40 us. Depth-1 also overlaps. Clear-pass-load is clean, multi-pass CRCs match, and no GPU fault or recovery was recorded. Approved at this commit. The earlier peer rows are at 1b1f2b3; record their disposition for the final flush change before landing.

@DjDeveloperr

Copy link
Copy Markdown
Author

J714s (M5 Pro, G17S) row at 404a387, kernel 7.3.0-m5-cdirect16, base 9965858. Built on the machine, driver loaded only through VK_DRIVER_FILES.

  • Clang assert and GCC release --suite asahi: 215/215 each.

  • gpubench render.light, interleaved ABBA, n=4 per side, medians:

    case metric base head
    kind=clear d=1 untimed us/submit 108.72 108.66
    kind=clear d=1 submit_cpu_us 10.59 10.61
    kind=clear d=1 timed us/submit 130.04 130.12
    kind=clear d=4 untimed us/submit 17.69 18.11 (ranges overlap)
    kind=clear d=4 submit_cpu_us 10.85 10.88
    kind=clear d=4 timed us/submit 25.02 24.92

    A standalone clear-only command buffer costs the same as base on this Mac.

  • CTS (deqp-runner, 8 jobs) over api.image_clearing.core.*, draw.dynamic_rendering.primary_cmd_buff.multiple_clears_within_render_pass.* and the renderpass2 attachment tests: 13,135 pass, 11,140 not supported, 12 fail.

  • GTA V Enhanced 3024x1964, one boot, P0-P4 FPS:

    • base: 59.38 / 52.77 / 52.84 / 59.34 / 57.44 and 58.74 / 52.61 / 52.80 / 58.40 / 55.64
    • head: 58.97 / 53.28 / 53.38 / 59.11 / 57.45

    Nothing regressed, but one head run is too few to size the gain. A second head run never started: the Rockstar launcher stalled on its sign-in page, with no game process and no GPU faults.

  • No GPU faults.

@RyanTheTide RyanTheTide left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: MERGE at 404a387be357
Blockers: none
Checked: I read the full diff against merge-base 99658583598 and the head merged into aurora-wip bd7323f1 (it merges cleanly). Keeping the stream only applies where the deferral itself applies: whole, single-sample, single-layer, single-mip 2D images with every aspect cleared. So layered and multiview clears, MSAA clears, direct resolves and depth-only clears of a D/S image never reach it. Timestamped, resolving and continuation empty renders still take the earlier keep path. The kept render sits at its recorded position, so a following pass that does not take the clear sees the same VDM order as an undeferred clear. A pass that takes only some attachments keeps the stream for the rest. The redundant memory clear of the taken attachment is harmless. A later vkCmdClearColorImage of the same image drops the old stream only when no other entry uses it. Otherwise the old clear still runs first and the new fill after it, behind the application's barrier.

The drop path clears render_pack head/tail and pass_merge before destroying each shared stream once. Other work flushes through hk_cmd_buffer_get_cs_general(), and EndCommandBuffer, timestamps, queries, events and host-access barriers flush without render_follows. So a kept stream is dropped and filled before it can be packed across command buffers or carry a stamp. A held buffer copy can leave the stream mid-list when the next pass absorbs it. hk_sync_forget_stream() rebinds to the previous stream on the subqueue, so that case is covered.

The gate condition uses the existing agx_chip_agx3_path() helper and per-stream g17p_pass_ends, with no new chip or firmware checks. The new hk_sync_prior case fails without the records_replace_stream() singleton drop and passes with it. The J700 exact-head ABBA restores depth-4 untimed clear parity (20.19 to 20.16 us/submit, CPU 9.42 to 9.40). Clear-pass-load and the multi-pass CRCs are clean there and on J714s.

Not a blocker: the keep/unkeep behaviour itself has no unit test, only the hardware rows. The J413/J316s rows are at 1b1f2b3d. The final commit only changes the AGX3 flush path, but a G13/G14 regression row at this head is still owed before landing.

Evidence
  • Local x86 drm-shim gate (--suite asahi --suite poly, assert-enabled clang), head merged into bd7323f1: 339/339 Ok, the same as the tip.
  • Same tree with the drop_singleton hunk in hk_sync.c reverted: 338/339, hk_sync_prior FAIL.
  • git diff --stat 1b1f2b3d2d4f 404a387be357: hk_cmd_buffer.c, hk_cmd_buffer.h, hk_cmd_draw.c only.
  • Exact-head rows: J700 #1244 (comment) , J714s #1244 (comment)

@RyanTheTide

Copy link
Copy Markdown

404a387be35720ce987ba5a1dbd161cc25c5370b J316s regression row PASS, exact head vs merge base 99658583598f (isolated VK_DRIVER_FILES overlay, stock /usr/lib64/libvulkan_asahi.so SHA-256 unchanged pre/post):

  • Mac: J316s (MacBook Pro M1 Pro, G13S C0, 7.3.0-aurora-fleet89)
  • Build: native aarch64, Clang 23.1.4, -Dbuildtype=release -Db_ndebug=false -Dtools=drm-shim, vulkan asahi; head and merge base both 2065/2065, distinct overlay SHA-256 (9c2e2468c6e2... head vs 4032060c4f4f... base).
  • Unit tests: meson test --suite asahi 260/260 PASS on head and on base; head's new hk_sync_prior check "forgotten singleton clear leaves no false dependency on earlier pass" passes.
  • Vulkan CTS (vulkan-cts-1.4.7.1-2-g3fd4ea31), base -> head, same per-case results on both arms:
    • dEQP-VK.api.smoke.*: 8/8 -> 8/8
    • dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.basic.*clear*: 24/24 -> 24/24
    • dEQP-VK.api.image_clearing.core.{clear_depth_stencil_attachment, partial_clear_depth_stencil_attachment, partial_clear_color_attachment, clear_color_attachment.cube_layers}.* (1730 cases): 1080 PASS / 650 NS / 0 FAIL -> 1080 / 650 / 0
    • dEQP-VK.synchronization.basic.*: 21 PASS / 8 NS / 0 FAIL -> 21 / 8 / 0
    • Total 1133 PASS / 658 NS / 0 FAIL per arm; 0 new failures (per-case status diff identical).
  • Health: 0 GPU faults/recoveries, Enforcing, 0 failed units, 0 new AVC; Mac back on saved 7.3.0-aurora-fleet89, no next entry, overlay removed.

Evidence: traces/gpu/20261128-merge-blitz-mesa1244-404a387b-m1pro/.

@RyanTheTide
RyanTheTide merged commit c85fbcc into aurora-wip Nov 28, 2026
@RyanTheTide
RyanTheTide deleted the perf/keep-deferred-clear-vdm branch November 28, 2026 02:37
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.

2 participants