Skip to content

Revert #896 and #822: GL coalesced submissions break render ordering on G13/G14 - #979

Merged
DjDeveloperr merged 2 commits into
aurora-wipfrom
revert/pr822-gl-coalesced-submits
Nov 24, 2026
Merged

DjDeveloperr merged 2 commits into
aurora-wipfrom
revert/pr822-gl-coalesced-submits

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 24, 2026 •

Copy link
Copy Markdown

What: Revert merge commits ba9bcc76c11 (#896) and 3fc1b773a41 (#822). On M1 Pro (G13S) and M2 Air (G14G), gpubench-gl render.postfx (1080p, msaa=1) fails its output check: the centre pixel reads (0,249,0,255) instead of a bright orange, with CRCs that vary between runs. A bisect on a bare-metal M1 Pro put the last good commit at 83150137f7f (#821) and the first bad one at 3fc1b773a41 (#822). It passes with ASAHI_MESA_DEBUG=sync, which turns off multi-command submissions, and still fails with GALLIUM_THREAD=0. M3 Air (G15G) passes.

On G13, G14 and G14X the kernel accepts DRM_ASAHI_RENDER_FRAGMENT_BARRIERS and then adds no wait at all for the earlier render. It relies on the order of the fragment queue instead (drivers/gpu/drm/asahi/queue/mod.rs, kernel commit 24a7cfa37871). #822 sets that flag on renders that depend on an earlier render, and queues the passes of a multi-pass chain into one submission. #896 (inter-submission barrier elision for disjoint AGX3 batches) is built on #822's written-BO list and per-batch submission state, so it is reverted with it. Both will re-land together with ordering that holds on every GPU.

Later commits that used #822 code are adapted, not reverted:

Tested:

  • Fedora CI at 3432e675337d (--suite asahi): 194/0.
  • drm-shim asahi suite with asserts on (debugoptimized), every test built at that commit: 287 pass, 3 fail. The 3 are asahi-egl-priority-{allow,deny,once}, which fail the same way on aurora-wip c440b7f03c2. Passing: asahi-{g13g,g17p,t6041}-gallium-submit, asahi-{g13g,g16g,g17p}-threaded-context, asahi-{g13g,g15c,g15s,g17p,t6041}-gallium-vs.
  • Mirror CI on DjDeveloperr/mesa ci/revert-pr822-gl-coalesced-submits.
  • aarch64 kit built from this head for the hardware rows.

Risk: two-way. GL multi-pass chains go back to one submission per batch, and the vertex half of a render waits for the earlier render again. #822's GL submission gains and #896's AGX3 barrier elision are lost until the re-land.

Not yet:

  • render.postfx rows on M1 Pro and M2 Air, expecting valid=true.
  • No-regression rows on the Neo (G17P) and the M4 mini (J773g), with the gpubench delta this gives up.

…ass-coalesce-frag-barriers"

This reverts merge commit 3fc1b77, reversing changes made to
8315013.

#822 breaks gpubench-gl render.postfx on M1 Pro (G13X) and M2 Air
(G14G): the output check fails with the centre pixel at (0,249,0,255).
A bisect on a bare-metal M1 Pro found 8315013 as the last good
commit and 3fc1b77 as the first bad one.

On those GPUs the kernel accepts DRM_ASAHI_RENDER_FRAGMENT_BARRIERS and
then adds no wait at all for the earlier render, relying on the order of
the fragment queue. #822 sets that flag on every render that depends on
an earlier one, and queues the passes of a multi-pass chain into one
submission. Nothing but fragment-queue order then separates a pass from
the output of the pass before it, which is not enough on these GPUs.
Revert it until the ordering is correct on every GPU.

Later commits build on parts of #822. The conflicts are resolved as
follows:

- #896 (inter-submission barrier elision) uses the written-BO list and
  the per-batch submitted_has_vdm, submitted_has_cdm and
  barrier_untracked state. That tracking and its single-submission
  barrier test are kept. Its changes to the coalesced submission path
  go with that path.
- #754 (PBO upload) replaced the valid-level bit with
  agx_resource_set_valid(); that call is kept.
- #745 (fast-clear batches) also checked the primitive counters #822
  added. Those counters are gone; its draw checks remain.
- #745's change to always write the compute end timestamp is kept.
- The flush_resource barrier sequence update from #896 is kept; the
  pending-submission flush that went with it is removed.

Signed-off-by: Dj <43033058+DjDeveloperr@users.noreply.github.com>
The revert of #822 kept #896 (inter-submission barrier elision for
disjoint AGX3 batches, merge commit ba9bcc7), but #896 is built on
#822's written-BO list and per-batch submission state, so the driver no
longer compiled. Revert #896 as well, in the order a clean revert takes:
#896 first, then #822.

Two later users of #822 are adapted rather than reverted:

- #802 (HAL200 bind elision for multi-draw indirect) noted the indirect
  buffer as a vertex-stage read for #822's render barrier tracking. That
  tracking is gone; the indirect buffer is still recorded as a batch
  read.
- #745 (fast-clear batches) also checked #822's primitive counters. Its
  draw checks remain.

#754's agx_resource_set_valid() and #745's change to always write the
compute end timestamp are kept.

Two test changes keep later tests meaningful without #822:

- #822's guard in the threaded-context test that skips comparing a
  compressed level is kept. That level uploads and reads back through
  GPU blits, which the no-op drm-shim never runs.
- The #802 multi-draw test checked that a forced flush started a new
  batch by comparing batch pointers. Without #822 the flushed batch is
  submitted at once and its slot can be reused, so it compares the batch
  sequence number instead.

Signed-off-by: Dj <43033058+DjDeveloperr@users.noreply.github.com>
@RyanTheTide

Copy link
Copy Markdown

241e852 build check: reverting #822 alone fails to compile in src/gallium/drivers/asahi/agx_batch.c:1127 (no member named 'written' in 'struct agx_batch::bo_list') because #896 (ba9bcc7, asahi-coalesced-barrier-elision) depends on #822's bo_list.written. Ready to run the J316s (G13S) + J413 (G14G) render.postfx + smoke confirm rows once #896 is reverted with #822.

@DjDeveloperr DjDeveloperr changed the title Revert "asahi: coalesce multi-pass batches and emit fragment barriers and few-primitives hints" (#822) Revert #896 and #822: GL coalesced submissions break render ordering on G13/G14 Nov 24, 2026
@DjDeveloperr

Copy link
Copy Markdown
Author

J773g row: Apple M4 Mac mini, G16G B0, kernel 7.3.0-ARCH-m4prod25d (already booted, no reboot or sleep)

Head 3432e675337d67b26b3d4080fbfdaa7e87620403 vs base aurora-wip c440b7f03c21. The base has #714 on top of this PR's base (632ca19302ee). #714 only touches src/asahi/vulkan, so the GL numbers below measure the revert alone.

Both kits are release builds (NDEBUG) made with the same options and the same toolchain, and staged in private prefixes; system Mesa was not touched. GL reports Mesa 26.3.0-devel (git-3432e67533) and (git-c440b7f03c). The mapped libgallium was checked for each kit.

Correctness on this head

  • render.postfx --verify, 1080p, depths 1 and 2, 3 runs each: msaa=1 crc 2133faaa, msaa=4 crc 9d7ff6f3, valid in every run. The base gives the same CRCs.
  • GL smoke: 116 results across 9 tests (postfx, light, heavy, shadow, draws direct and mdi, compress.bw, transfer.ops, compute light and heavy), all run with --verify. All ok, 0 readback failures. shadow c0fb9993 and transfer.ops 55a4e6b1 match the base.
  • 0 GPU faults, timeouts or recoveries (dmesg and aurora-g16 stats), 0 failed units, display-manager active the whole time.

gpubench-gl ABBA (base, #979, #979, base)

Each value is the median of 5 runs of 250 ms. Delta is #979 vs base; + means #979 is faster.

Test d Metric base (A1 / A2) #979 (B1 / B2) Delta
render.postfx msaa=1 1 fps ↑ 796 / 784 848 / 844 +7.1%
render.postfx msaa=1 2 fps ↑ 960 / 960 952 / 948 -1.0%
render.postfx msaa=4 1 fps ↑ 472 / 472 468 / 468 -0.8%
render.postfx msaa=4 2 fps ↑ 564 / 560 520 / 520 -7.5%
render.light kind=tri 1 us/submit ↓ 209.2 / 208 205.1 / 211.3 +0.2%
render.light kind=tri 4 us/submit ↓ 115.1 / 119.3 113.3 / 112.9 +3.6%
render.light kind=tri 16 us/submit ↓ 89.86 / 89.77 88.94 / 88.03 +1.5%
render.light kind=clear 1 us/submit ↓ 176.7 / 178.2 175.3 / 172.4 +2.1%
render.light kind=clear 8 us/submit ↓ 51.42 / 51.73 51.65 / 51.92 -0.4%
render.heavy kind=fill,res=1080p 1 us/submit ↓ 566.9 / 566.9 564.3 / 564.3 +0.5%
render.heavy kind=fill,res=1080p 4 us/submit ↓ 254.3 / 250.5 271.7 / 269.7 -6.8%
render.heavy kind=texture,res=1080p 1 us/submit ↓ 965.3 / 969 972.8 / 988.1 -1.4%
render.heavy kind=geom,res=1080p 1 us/submit ↓ 728.9 / 733.1 741.8 / 728.9 -0.6%
render.heavy kind=geom,res=1080p 4 us/submit ↓ 260.7 / 261 420.2 / 419.5 -37.9%
render.shadow 1 Mtri/s ↑ 8.651 / 8.716 8.847 / 8.847 +1.9%
render.draws draws=2048,mode=direct 1 us/submit ↓ 1126 / 1147 1116 / 1126 +1.4%
render.draws draws=2048,mode=mdi 1 us/submit ↓ 830.6 / 833.3 827.8 / 836.1 -0.0%
compress.bw kind=mrt4 1 us/submit ↓ 798.7 / 801.3 692.5 / 686.8 +16.0%
compress.bw kind=msaa4 1 us/submit ↓ 1037 / 1046 943.4 / 939.8 +10.6%
transfer.ops 1 GB/s ↑ 22.75 / 22.83 22.75 / 23.02 +0.4%
compute.light 1 us/submit ↓ 184.5 / 155.6 184.5 / 185.5 -8.1%
compute.light 4 us/submit ↓ 60.11 / 58.99 58.74 / 58.38 +1.7%
compute.heavy kind=alu 1 us/submit ↓ 819.7 / 825.1 825.1 / 825.1 -0.3%
compute.heavy kind=alu 4 us/submit ↓ 559.3 / 561.8 561.8 / 561.8 -0.2%
compute.heavy kind=bw 1 us/submit ↓ 1613 / 1623 1623 / 1634 -0.6%

What the revert costs on J773g

  • render.heavy kind=geom d4: −37.9% (261 → 420 us/submit; both passes of each side within 0.2%). This is the big one.
  • render.postfx msaa=4 d2: −7.5%. render.heavy kind=fill d4: −6.8%.

What it gains

  • compress.bw mrt4 +16.0%, msaa4 +10.6%. render.postfx msaa=1 d1 +7.1%.

Everything else is within ±3.6%. compute.light d1 (−8.1%) is noise: the two base passes were 184.5 and 155.6.

Not covered here: Vulkan (this PR does not change it) and CTS.

@RyanTheTide

Copy link
Copy Markdown

3432e67 J316s (M1 Pro, G13S C0, 7.3.0-aurora-fleet89) PASS (isolated ICD, MESA_SHADER_CACHE_DISABLE=1): render.postfx 1080p msaa=1 control 632ca19 FAIL 3/3 (valid=false, ctr=(0,249,0,255)/(0,250,0,255)) -> 3432e67 PASS 3/3 (valid=true, crc=b52e3012, 600-615 fps); gpubench-gl render.light ok (284.1 us), gpubench-vk render.light/compute.light ok (290.7/151.2 us), dEQP-GLES3 abs 48/48, dEQP-VK api.smoke 8/8; 0 GPU faults, 0 AVC, 0 failed units, Enforcing. (J413 G14G confirm row queued behind current M2 lock.)

@DjDeveloperr

Copy link
Copy Markdown
Author

Neo row: MacBook Neo (J700, G17P B1), kernel 7.3.0-41.fc44.aurora.aarch64 (already booted, on AC, headless, no reboot or sleep)

Head 3432e675337d. Private prefixes (LD_LIBRARY_PATH + LIBGL_DRIVERS_PATH, MESA_SHADER_CACHE_DISABLE=1).

  • 3432e675337d: kit BUILD-INFO 3432e675337+0, empty BUILD-DIFF.patch, GL renderer Mesa 26.3.0-devel (git-3432e67533), libgallium-26.3.0-devel.so sha256 719fac8c9d48668a71ff855c1630b8d6554d6f992afa062ce8540b401650bf99
  • base aurora-wip c440b7f03c2: BUILD-INFO c440b7f03c2+0, empty diff, git-c440b7f03c, libgallium-26.3.0-devel.so sha256 aa0fe498bcab3ad37a642de835fe0492e5306045df218c85a2e53376b2f0c96f

No regression at 3432e675337d: PASS

  • gpubench-gl --verify: every row valid=true, with the same CRC as c440b7f03c2: render.postfx 1080p msaa=1 2133faaa, msaa=4 9d7ff6f3 (depths 1 and 2); render.shadow depth_only c0fb9993, alpha_test 7be9463a; transfer.ops clear_16m 02b89970, copy_b2i 0883f778, mipchain 0c8dc10e. render.light tri and clear: status ok (that test has no check).
  • dEQP-GLES3 smoke (shaders.builtin_functions.common.abs, fbo.completeness, fbo.render, fbo.invalidate, fbo.msaa, multisample, fence_sync): 1191 cases, 1136 Pass, 54 NotSupported, 1 QualityWarning (fbo.completeness.samples.rbo1_rbo2_rbo4), 0 Fail, 0 Crash.
  • 0 GPU fault lines, 0 SELinux AVCs, 0 failed units.

gpubench-gl delta c440b7f03c2 -> 3432e675337d

Two passes, A B B A then B A A B (A = c440b7f03c2, B = 3432e675337d). Each run is 5 x 500 ms after a 200 ms warm-up, and its median is used. A and B are each the mean of 4 runs. Higher is better, so a minus sign means 3432e675337d is slower. In both passes the first run read high on the depth 2 and 4 rows, whichever commit it was. The last column drops that run as a check.

row unit A c440b7f03c2 B 3432e675337d B vs A (4 runs each) B vs A (first run of each pass dropped)
postfx 1080p msaa=1 d1 fps 1124 1150 +2.3% +1.6%
postfx 1080p msaa=1 d2 fps 1589 1522 -4.2% -4.9%
postfx 1080p msaa=4 d1 fps 840 920.5 +9.6% +8.5%
postfx 1080p msaa=4 d2 fps 1132 1064 -6.0% -6.5%
shadow depth_only d32f d1 Mtri/s 15.76 15.10 -4.2% -4.2%
shadow depth_only d32f d2 Mtri/s 20.07 17.53 -12.7% -12.3%
shadow alpha_test d32f d1 Mtri/s 5.923 5.890 -0.6% -1.5%
shadow alpha_test d32f d2 Mtri/s 6.406 6.251 -2.4% -2.9%
transfer clear_16m d1 GB/s 97.75 97.23 -0.5% -0.7%
transfer clear_16m d4 GB/s 615.6 616.9 +0.2% +0.2%
transfer copy_b2i d1 GB/s 31.45 31.09 -1.1% -1.1%
transfer copy_b2i d4 GB/s 43.65 42.72 -2.1% -2.2%
transfer mipchain d1 GB/s 62.26 62.29 +0.0% +0.2%
transfer mipchain d2 GB/s 92.96 93.14 +0.2% +0.1%

What the revert costs on G17P: depth-2 render.postfx (-4% to -6%) and depth_only shadow (-12.7% at d2, -4.2% at d1). For both depth_only rows and for postfx msaa=4 d1, every B run lands on the same side of every A run. postfx msaa=4 d1 gets faster (+9.6%). The transfer.ops rows stay within ±2%.

@RyanTheTide

Copy link
Copy Markdown

3432e67 J413 (M2 Air, G14G B0, 7.3.0-aurora-fleet89) PASS (isolated ICD, MESA_SHADER_CACHE_DISABLE=1): render.postfx 1080p msaa=1 control 632ca19 FAIL 3/3 (valid=false, ctr=(0,250,0,255)) -> 3432e67 PASS 3/3 (valid=true, crc=b52e3012, 760-790 fps); gpubench-gl render.light ok (252.0 us), gpubench-vk render.light/compute.light ok (214.5/132.9 us), dEQP-GLES3 abs 48/48, dEQP-VK api.smoke 8/8; 0 GPU faults, 0 AVC, 0 failed units, Enforcing.

@DjDeveloperr
DjDeveloperr marked this pull request as ready for review November 24, 2026 22:54
@DjDeveloperr
DjDeveloperr requested review from a team as code owners November 24, 2026 22:54
@DjDeveloperr

Copy link
Copy Markdown
Author

Independent review and merge verification at 3432e675337d:

Merging.

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