Repository navigation
fix(agc): prepare the push-less pixel variant only without fixed push slots - #9563
EagleBearerYS wants to merge 3 commits into
Conversation
… slots Registration prepared every pixel shader twice: for its push slot and once more with no push constants, for pipelines that leave the pixel stage no push room. With fixed push slots (graphics pipeline libraries) every graphics ABI gives the pixel stage its own slot of PipelinePushSlotBytes (StagePushOffset, and the room the ABI resolution computes), so no draw can request the second variant: it was compiled, cached and kept for nothing, and it doubled the pixel work at registration. DriverDetail::RegistrationRequests lists the requests registration prepares. The push-less pixel variant is among them only for a target without fixed push slots; the partial-workgroup compute variant stays. Evidence: a title that registers about 3,100 pixel shaders at load kept 8,840 variants with 3.7 GiB of SPIR-V; its second pixel variants were about 1.3 GiB of that and 97 % byte-identical to the first (count over its shader disk cache). Tested: agc_driver_prepared_shaders gains RegistrationVariants (one pixel request with fixed push slots, two without, two compute requests); it fails without the change. Full ctest passes. Cherry-picked from fable-void's 22e072b; conflict in Execution/include/Driver/Shaders/ShaderRegistry.hpp and Execution/src/Driver/Shaders/ShaderRegistry.cpp resolved to main's InvocationFor/CaptureInvocation declarations, float-mode helpers, library prebuild switch and undrawn resource plan release.
With APS5_PROFILE_DRAW set, the [draw] driver phases line now ends with the number of pixel shaders registered for a target with fixed push slots, each of which no longer prepares its variant without push data. A draw that still asked for that variant would log that it has no artifact prepared at registration.
|
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.
|
|
Early review feedback while this remains a draft: the focused request-list test covers fixed-push pixel, non-fixed-push pixel and partial-workgroup compute cases, and the reported red/green result is useful. Before marking it ready, please coordinate the shared |
There was a problem hiding this comment.
RegistrationRequests preserves the partial-workgroup compute variant and emits the push-less pixel variant only when the target lacks fixed push slots. PrepareRegistered prepares the first request, retains library prebuild behavior, then prepares only the remaining requests. The regression checks one pixel request for fixed slots, two with the expected push sizes without fixed slots, and both compute variants. I found no correctness issue in the changed logic. The PR reports Linux/Windows red/green runs with 10 green repeats and a focused same-runner Khronos validation comparison; the layer was confirmed loaded and no new VUIDs appeared. Hosted eligibility, intake, labels, report and conventions pass; product Linux/Windows and relinker jobs are skipped. I could not run a local build because the filesystem is full, so I rely on the reported CI runs rather than claiming local test execution. Current-base diff --check and conventions pass. check_main_sync.py reports 2 ahead / 116 behind (94fbb8cea merge base), cleanly mergeable; please refresh from current main before merge. #9508 is not in this branch's ancestry, but its author has agreed #9563 and #9564 can merge in either order; preserve the prebuild changes in #9508 and let RegistrationRequests replace the push-less variant block when composing them. The automated overlap report is partial because older PRs conflict with main; no competing implementation of this request-filtering change was found. Approval is for this reviewed head only.
I’ve noticed that holding this PR because of #5239 isn’t necessary. It’s fine for PRs to keep coming in; they’ll be handled in due course. Please disregard my earlier request to hold or defer it.
MarcZX10
left a comment
There was a problem hiding this comment.
The registration filter still appears correct: fixed-push targets retain only the pushed pixel request, non-fixed targets retain both, and both compute variants remain. The PR reports Linux/Windows red-green runs with 10 focused repeats plus the required same-runner validation-layer comparison; no new VUID was reported. Hosted policy checks pass, while full product and relinker jobs are skipped. I did not run a local GPU build.
Against current upstream/main 329efe1bfdaff116c57cdf62718026ee4f5521ae, the branch is 2 ahead / 161 behind (merge base 94fbb8cea80af91db62ab6ee7e4da23341675c40). Current merge-tree is clean, git diff --check passes, and current-base conventions pass. Please refresh to current main and rerun agc_driver_prepared_shaders plus the focused Vulkan validation comparison before merge; the branch rule requires an up-to-date base.
#9508 is still open at 9f5e875b95d6a5bbee580b03b36ed7773fd80aa0. A current pairwise merge-tree conflicts in ShaderRegistry.cpp; the description records the agreed no-wait composition, preserving #9508’s library prebuild and this PR’s RegistrationRequests filter. Keep that composition and the agreed merge flexibility in the next integration check. I found no duplicate implementation of the push-less request filtering.
|
Thanks, @MarcZX10. |
|
I’ve noticed that my earlier request to hold this PR based on #5239 was unnecessary. It’s fine to keep submitting PRs; maintainers will handle them in due course. Please disregard that request. |
|
Note 🤖 Claude Opus 5.5 responding on behalf of JulesB40 On Windows + NVIDIA (Ada), head Setup: Windows 11 Home 10.0.26200, Intel Core i9-13900HX, NVIDIA GeForce RTX 4070 Laptop GPU ( Command, the same on both sides:
No title was run. |
|
I’m testing a compute-only change that prepares the partial-workgroup variant at the first partial dispatch. The synthetic Vulkan regression confirms that registration and a full dispatch keep one prepared variant, and that two different partial sizes share the second variant. The Yōtei startup cache recorded 731 eager full/partial pairs. Startup cache audit. I compared the exact |
|
I refreshed the first-use compute branch onto I also composed your current head with the refreshed compute branch in a separate source checkout. The merge keeps Does landing the compute-only change first work for this PR? The composition records the exact changes needed if the pixel work goes first. I checked the combined files at source level. The refreshed Radeon runs cover the compute branch: the negative control fails at eager registration as expected, and the candidate passes all five focused cases with zero VUID messages. Tested branch AI-assisted: yes |
What
Registration prepares every pixel shader twice: once for its push slot, and once more with no push constants, for pipelines that leave the pixel stage no push room. With fixed push slots (graphics pipeline libraries), every graphics ABI gives the pixel stage its own
PipelinePushSlotBytesslot (StagePushOffset, and the room the ABI resolution computes). So no draw asks for the second variant. It is compiled, cached and kept for nothing, and it doubles the pixel work at registration.This is fable-void's 22e072b from his fork (
wip/new-gpu-path), with his authorship:DriverDetail::RegistrationRequestslists the requests registration prepares. The push-less pixel variant is among them only for a target without fixed push slots; the partial-workgroup compute variant stays. His conflict withmain's ShaderRegistry was resolved tomain'sInvocationFor/CaptureInvocation, float-mode helpers, library prebuild switch and undrawn-plan release.APS5_PROFILE_DRAWset, the[draw] driver phasesline ends withpush-less pixel variants left out at registration N (cumulative). Without the profile it costs one test of astatic const bool.If a draw ever did ask for the variant, it would be prepared at the draw, as any variant registration didn't predict is (#2917).
fable-void's evidence, from his commit: a title that registers about 3,100 pixel shaders kept 8,840 variants with 3.7 GiB of SPIR-V. Its second pixel variants were about 1.3 GiB of that, and 97 % byte-identical to the first (counted over its shader disk cache).
Overlap: checked with
git merge-treeagainst every open PR touching these files, onmaindf2569d. One conflicts:PrepareRegisteredand keeps the old variant block after it. The two compose: feat(agc): GPU descriptor heap on VK_EXT_descriptor_heap (APS5_GPU_HEAP) #9508's prebuild code stays, andRegistrationRequestsreplaces the variant block. Neither waits for the other, agreed in feat(agc): GPU descriptor heap on VK_EXT_descriptor_heap (APS5_GPU_HEAP) #9508's thread (reply): if feat(agc): GPU descriptor heap on VK_EXT_descriptor_heap (APS5_GPU_HEAP) #9508 merges first, this PR rebases, and if this one does, the resolved merge goes on a fork branch for feat(agc): GPU descriptor heap on VK_EXT_descriptor_heap (APS5_GPU_HEAP) #9508 to take (note).Tested
agc_driver_prepared_shadersgainsRegistrationVariants: one pixel request with fixed push slots, two without, and two compute requests.RegistrationRequests, somain's code can't build it. The red tree is this PR with only the!request.target.fixedPushSlotscondition removed.maincf2c667. That's 1812/1818, with the same 6 failures asmain(IPv6 and socket-buffer tests on that machine), and^agc×3 with only the two fill tests that flake onmaintoo.mainagainst this PR (CONTRIBUTING's AGC rule), on one GitHub Linux runner (run). Both runs usedVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1andctest -V, withVK_LOADER_DEBUG=layerto show the layer loading. The device was llvmpipe (LLVM 20.1.2) on Mesa 25.2.8, Ubuntu 24.04.5, Khronos validation layers 1.3.275.agc_driver_prepared_shaders, which registers this PR's pixel variants on the real device, andagc_driver_graphics.main's tree ran them once and this PR's three times.VK_LAYER_KHRONOS_validation3 times onmainand 9 with this PR, and neither log haswas not found but was requested by env var VK_INSTANCE_LAYERS.VUID-VkDeviceCreateInfo-pNext-pNext, for a device-creation structure newer than that layer version. This PR adds noVUID-message.mainb7d1d47 merged in (clean; the PR's own diff is unchanged), on GitHub's runners (run):agc_driver_prepared_shadersandagc_driver_graphicspass 10 of 10 on Linux, none skipped. On Windows they build and pass, and one of the two skips without a Vulkan device.mainagainst this head, on the Linux runner: the loader insertedVK_LAYER_KHRONOS_validation3 times onmainand 30 with this PR, and neither log haswas not found. Both logs report onlyVUID-VkDeviceCreateInfo-pNext-pNext, so this PR adds noVUID-message.guest_raise_in_system_callfailed in the first attempt with this head, and the rerun of that job passed both suites. The libc and libkernel suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.check_conventions.pypasses, with no comment lines added.APS5_PROFILE_DRAW=1; no fatal error. Every[draw] driver phasesline reportspush-less pixel variants left out at registration 0andlibrary prebuilds refused at registration 0 (cumulative), so this title doesn't reach the case. The unit test above is this PR's evidence; no title we run shows the counter yet.maind4cb893 against thatmain, built in the same tree, all 1,125^agc_tests underVK_LAYER_KHRONOS_validationwithANYPS5_REQUIRE_VULKAN=1andANYPS5_NO_SHADER_CACHE=1. Both sides: 1,117 pass, 0 fail, 8 skip, the same skips, and the same 18VUID-lines per test, allVUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605fromagc_driver_prepared_exportsandagc_driver_srgb8_color_target, whichmainhas too (AGC: pipelines use differing per-attachment blend states while independentBlend is never enabled (VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605) #11990). Every device test selected the RTX 4070. No title was run.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)RegistrationVariantsruns before the test opens a device. The rest ofagc_driver_prepared_shadersran on Mesa llvmpipe (LLVM 20.1.2), Ubuntu 24.04, GitHub's Linux runner. The validation comparison ran on Mesa llvmpipe (LLVM 20.1.2, Mesa 25.2.8), Ubuntu 24.04.5, GitHub's Linux runner. GitHub's Windows runner has no Vulkan device. NVIDIA GeForce RTX 4070 Laptop GPU (616.92), Windows 11, in JulesB40's run of allagc_tests againstmain.