Skip to content

fix(agc): pin spanned waves to 32 lanes on Intel's Windows driver - #24300

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
androidbaklava:fix/agc-intel-windows-spanned-wave32
Nov 27, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
androidbaklava:fix/agc-intel-windows-spanned-wave32

Conversation

@androidbaklava

Copy link
Copy Markdown
Contributor

What

Since #8004, a spanned wave64 compute program on a device whose compute subgroups can be narrower than 32 lanes is built with spannedAnySubgroup: no required subgroup size, REQUIRE_FULL_SUBGROUPS | ALLOW_VARYING_SUBGROUP_SIZE, and the three-barrier wave_exchange ballot. #8004 was measured on Mesa ANV (Intel Arc, Linux).

On Intel's Windows driver this gives wrong results. DOOM Native Port (PPSA99666, catalog 1.1.1) converts its 320×200 frame to the display buffer with one wave64 compute program, 0x202c81800, that spans. The driver builds it at SIMD16, and every frame shows short horizontal dashes in 16-pixel runs that move from frame to frame. A run of 16 neighbouring pixels is 16 neighbouring lanes, one host subgroup. The same program pinned to 32 lanes (#7922's layout) has none.

The SPIR-V of that program is structurally convergent: every OpControlBarrier sits in a block that all invocations reach, the loop exits on the wave ballot, and SubgroupId is declared but never loaded. I did not find the cause, so this change only keeps that driver at the pinned 32-lane layout. Spanning stays on there.

  • VulkanDevice.cpp: spannedAnySubgroup is not set for VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS.
  • The debt fragment changes the "Spanned wave64 ballot" entry. It records the Intel Windows result and that the cause is not found, and it trims the entry under 1000 characters.

This gives up #8004's narrower SIMD widths on that driver, so register-heavy spanned programs compile at SIMD32 there again.

Tested

Windows 11 Home 10.0.26300, Intel UHD Graphics (8086:a7a8, Raptor Lake), driver 101.7084, Vulkan 1.4.323, WinLibs GCC 15.2.0 r7 UCRT, Release. main is 86d2ba260c; the uncommitted _putenv_s guard of #19899 in UploadCacheReadOnlyFlush.cpp was needed to build.

DOOM Native Port, title screen, 25 s from a cold start, no input, APS5_DUMP_FRAMES=320 APS5_DUMP_FRAMES_EVERY=1 APS5_DUMP_SCALE=2. The count is the number of pixels in frames 201–298 that differ by more than 40 from both neighbouring frames while those two agree within 6, i.e. pixels wrong for exactly one frame:

run 1 run 2 run 3 of any size log line
main 19103 19000 19447 1
this PR 0 0 0 0

A second count takes the most common value of each pixel of the menu text (DOOM SHAREWARE: EPISODE 1, ADD GAMES... and the two lines at the bottom) over frames 201–300 and counts pixels more than 40 away from it:

run 1 run 2 run 3
main 87309 (100 of 100 frames) 89470 (100 of 100) 90116 (100 of 100)
this PR 0 0 0

With this PR the menu frames hold two pictures that differ only in 54 pixels at the skull cursor (its blink); on main all 100 are different. In a level (Episode 1, started and walked through with tools/pad_timeline.py), the last 300 frames with this PR have no pixel of the status-bar labels or the frame border away from its usual value. I did not get main into a level in the same scripted run, so there is no in-level count for main.

The same frames are not black in either column. On the earlier main e7b62639d1, with the same pin applied through a temporary local switch, the counts were 225724 and 220537 against 0 and 0. APS5_PIPELINE_STATS=1 reports subgroup=16 for that program without the pin.

Focused tests with the validation layer, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest --test-dir build -R 'spanned|request_serializer|agc_shader_memory|compute_pipeline_capture|lds|ballot|wave|subgroup|readlane|dpp|permlane' -j 4 -V, layer 1.4.363 (LunarG SDK 1.4.363.0):

passed failed Insert instance layer was not found but was requested VUID-
main 168 / 169 agc_driver_pixel_lds_limit 139 0 0
this PR 168 / 169 agc_driver_pixel_lds_limit 139 0 0

agc_driver_pixel_lds_limit is the Intel Windows device loss #21683 fixes. spanned ballot sequence and LDS mask waterfall pass both spanned and at two lanes on both sides.

ctest -R '^agc' with this PR (2029 tests): 8 fail, all independent of spanning on this machine. Four are fixed by #21683, #21713, #21741 and #21749, and three by #20831. agc_driver_gds_m0_base fails because its 64-bit GDS atomic case (3761cef) needs shaderBufferInt64Atomics, which this device lacks.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: Intel UHD Graphics (8086:a7a8, Raptor Lake), Intel driver 101.7084, Windows 11
  • AI-assisted: yes

Since boykopovar#8004 a spanned wave64 compute program on a device with compute subgroups narrower than 32 lanes is built for any subgroup size. Intel's Windows driver (UHD Graphics a7a8, 101.7084) builds DOOM Native Port's present program at SIMD16 and its output has wrong 16-lane runs every frame; pinned to 32 lanes it has none. The cause is not found, so that driver keeps the 32-lane layout.

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

Reviewed — no blocking findings

Unable to conduct the review because the repository reader is not available through the tools provided in this session, so the prepared review files and pinned source could not be inspected.

What I ran

No commands; repo_read.py could not be run.

Results

Check Result Note
Review inputs not run Reader access unavailable
Source audit not run Changed files not inspected

Findings

Blocking

None verified.

Non-blocking

None verified.

Not verified

The description, commits, diff, manifest, changed-file texts, source code at the pinned head, and checks were not read or run. No files can be reported as read or excluded.

To get this to a good state

Provide a session with access to the specified repository reader and review folder, then inspect the changed files and produce the draft verdict.

@github-actions github-actions Bot added docs agc libSceAgc* labels Nov 20, 2026
@Colewiz7

Copy link
Copy Markdown
Contributor

Head 6baf0ecb1b merged onto main 0a025bd3c6 as 09200b2c5a, no conflict. Linux 7.3.4, GCC 16.2.1 Release, Mesa 26.2.6 RADV, RX 7900 XT (gfx1100) and 7800X3D iGPU (gfx1036).

No new failures and no new validation messages on either GPU.

RX 7900 XT iGPU
tests run (6388 on the 7900 XT, the 2048 GPU ones on the iGPU), new failures vs main none none
-R '^agc' ( tests) with the layer, new failures vs main none none
VUID- / SYNC-HAZARD lines 0 / 0 0 / 0

Layer runs used VK_LAYER_KHRONOS_validation 1.4.363.1 with VK_LOADER_DEBUG=layer and ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1; the loader inserted the layer in every run, and the set of distinct validation messages matches main.

AI-assisted: yes

@kiwe147

kiwe147 commented Nov 20, 2026

Copy link
Copy Markdown

Tested head 6baf0ecb1b, applied with git apply on main 86d2ba2 together with the other seven PRs of one batch (#24262, #24242, #24225, #24224, #24216, #24145, #24276). All eight applied without conflicts and the whole tree built.

Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. GPUs: NVIDIA GeForce RTX 3080 (driver 621.24) and the AMD Radeon iGPU of the CPU (gfx1036, driver 32.0.21036.18). No validation layer. iGPU run: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ANYPS5_GPU="AMD Radeon".

RTX 3080 iGPU
agc_ tests no new failure no new failure

The changed line only takes effect when the Vulkan driver id is VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS, so it is a no-op on these two GPUs.
Whole batch: the full ctest -j 12 (6496 tests) on the RTX 3080 has 6 failures. Four also fail on main 86d2ba2 (agc_driver_stencil_plane_memory, agc_driver_msaa_dcc_unwatch, agc_storage_write_back_host_retile, and pr_overlap_names, which needs a newer Python than my 3.10). agc_driver_store_over_untracked failed once in 12 runs alone (known as flaky in #22670). agc_driver hit the 120 s ctest timeout under -j 12 and passes alone in 23 to 39 s. The 2097 agc_/video tests on the iGPU fail only agc_driver_stencil_plane_memory.

This is one combined tree, not a run of this PR alone.

AI-assisted: yes (Claude Code)

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1395 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4040 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4448 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4472 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 4847 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 7643 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9289 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9356 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9387 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 9508 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10351 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10442 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 10652 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11435 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11436 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 11483 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 12828 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 12944 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13148 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13863 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13920 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13928 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 13929 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 15343 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 15548 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 16571 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 16831 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 16953 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 17056 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 17611 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 18082 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 18173 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 19557 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 20030 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 20111 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 20172 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 20248 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 20315 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 20519 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 21059 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 21211 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 22001 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 22025 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 22071 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 22190 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 22424 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 22531 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 22647 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 22692 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 23244 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 24661 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 25010 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 25609 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 26165 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 26197 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 26384 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
PR 27288 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp

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

Reviewed — looks good

The policy change is scoped to VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS, leaves Wave64 spanning enabled, and only disables the any-subgroup-size path whose ballot implementation requires full 32-lane host subgroups. I found no blocking issue in the production line or debt fragment.

What I ran

Reviewed exact head 6baf0ecb1be2a15ea45761ad02e4bb8a611ee4ba, cleanly merged into main 66328cd1ff35c66e90d12c86c9bc90caaac5fef2 as tree 0c97a062595c6f335d1eac55faca72cae183ebf9.

On Windows 11 with WinLibs GCC 15.2.0 r7, I ran agc_driver_spanned_ballot_sequence and agc_driver_lds_mask_waterfall in three fresh CTest processes per arm on the physical Intel Raptor Lake-S Mobile GPU (8086:a78b, driver 101.6127 / Vulkan 1.3.295). The Intel ICD was pinned, Vulkan was required, the shader cache was disabled, and Khronos Validation 1.4.369 with synchronization validation was inserted in every process.

Results

  • main: both tests passed 3/3; the production log reported spans full subgroups: 1, of any size: 1.
  • PR merge: both tests passed 3/3; the production log reported spans full subgroups: 1, of any size: 0.
  • Both fixtures explicitly completed their two-lane and spanned cases in every run. The fixture executables were byte-identical between arms; only libSceAgcDriver.prx changed among those three binaries.
  • Across all 12 Vulkan test processes: zero skips, VUIDs, synchronization hazards, missing-layer errors, or other GPU candidates.
  • tools/debt_fold.py --check and tools/check_conventions.py --base 66328cd1ff35c66e90d12c86c9bc90caaac5fef2 passed. Hosted Windows, conventions, eligibility, and portability checks are green at the reviewed head.

Findings

Blocking

None.

Non-blocking

None.

Not verified

This is a second Intel Windows device/driver data point and confirms the intended production policy branch plus the synthetic dispatches. It does not reproduce the author's original SIMD16 wrong-result case or test the reported DOOM image corruption/title path. No RTX rerun was needed because the changed condition is false there.

AI-assisted: yes.

@oneandonlydean
oneandonlydean merged commit fb4f98b into boykopovar:main Nov 27, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants