Repository navigation
fix(shader): keep host interpolation across entry EXEC copies - #7811
santhoshkumar-dev wants to merge 1 commit into
Conversation
|
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.
|
97bb70a to
c311129
Compare
c311129 to
9b45e78
Compare
jotitadev
left a comment
There was a problem hiding this comment.
Apple GPU / MoltenVK run, as a second vendor with a 32-wide subgroup. agc_driver_pixel_exec_interpolation runs its wave32 and wave64 draws on Apple and passes. With ConstantFolder.cpp reverted, it fails with the generated-stage error.
Machine: Apple M2 Max, macOS 27.2, x86-64 build under Rosetta. Drivers: MoltenVK 1.4.2 (Vulkan SDK 1.4.363.0) and MoltenVK main + SPIRV-Cross #2704. Tested at c311129, PR diff applied cleanly. The current head 9b45e78 is a rebase of the same commit (git range-diff shows it unchanged). The device reports subgroup size 32.
Tested: the tree is main a373e85 + mugurc's macOS series (ci/macos-series-2) + the PRs needed to build on macOS (#6667, #6668, #7524, #6969, and two files of #7332), not plain main (it doesn't build on macOS yet). Applied together in the same build: #7666, #7811, #7799 and #7803, plus a test-only patch that lets nine AGC fixtures load the Vulkan loader on macOS (branch jotitadev:fix/agc-tests-vulkan-loader-macos). Base on that tree: 40 ^agc failures with MoltenVK 1.4.2 and 26 with MoltenVK main + #2704, plus agc_driver_pooled_buffer_range and agc_performance_overlay, which only run because of the loader patch.
- With the PR, 3 of 3 on both drivers:
agc_driver_pixel_exec_interpolation(host interpolation matched 932 pixelsfor the 8- and 7-word programs on wave32 and wave64, andexpanded EXEC keeps barycentric emulationon both),agc_constant_bit_test,agc_masked_select,agc_shader_memory,agc_driver_exec_host_lanes,agc_driver_pixel_barycentric_emulation,agc_driver_pixel_helper_lanes,agc_driver_pixel_implicit_derivativesandagc_driver_scalar_sop1. - With only
ConstantFolder.cppreverted (tests kept), on both drivers:agc_driver_pixel_exec_interpolationfails withchanging EXEC between v_interp_p1/p2 needed a generated stage, andagc_constant_bit_testfails the intersected, nested and separate-halves whole-quad cases on wave32 and wave64 (the single expanded mask still passes). - Full
^agcsuite with the stack: the base failures on each driver, nothing new and nothing gone.
GPUs tested: Apple M2 Max (MoltenVK 1.4.2; MoltenVK main + SPIRV-Cross #2704)
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
jotitadev
left a comment
There was a problem hiding this comment.
NVIDIA and lavapipe run of 9b45e784b on Linux, since the description has the RX 6700 XT on Windows only.
Machine: Ubuntu 26.04, i7-8700, GCC 15.2, Release, BUILD_TESTING=ON, every execution test built, ANYPS5_NO_SHADER_CACHE=1, serial CTest with a 30 s timeout. Head 9b45e784b merged onto main 8816fd772 (clean merge).
agc_constant_bit_test,agc_masked_select,agc_shader_memory,agc_driver_exec_host_lanes,agc_driver_pixel_barycentric_emulationandagc_driver_pixel_exec_interpolationpass, 3 of 3 runs on NVIDIA and once on lavapipe.- The PR's tests on
main(recompiler unchanged):agc_constant_bit_testandagc_driver_pixel_exec_interpolationfail on both drivers, the other four pass. ^agcsuite: NVIDIA 781/782 and lavapipe 782/782.mainis 780/781 and 781/781, so nothing new fails; the one NVIDIA failure isagc_driver_bda_device, which fails onmaintoo.
GPUs tested: NVIDIA GeForce RTX 3070 (driver 595.99.02), lavapipe (Mesa 26.0.3).
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
|
AMD and Intel Windows data: with this PR's test changes, Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built,
The other AI-assisted: yes (Claude Code) |
|
First AMD-on-Linux (RADV) run of this PR. Merged onto AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 (Ubuntu 24.04 base), kernel 7.0.0-38, GCC 13.3, Release. Full suite ( GPUs tested: AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 / kernel 7.0.0-38 AI-assisted: yes |
What
A pixel shader that enables WQM, executes
v_interp_p1_f32, saves/restores EXEC, then executesv_interp_p2_f32unnecessarily enables barycentric emulation after #6291. Copying EXEC preserves helper lanes, but the entry-lane proof only recognized one direct WQM result. Intersections, nested WQM masks, and independently computed low/high halves prevented it from proving that the interpolation still runs for the same starting quads.The rejected IR retains the P1 result in a
SelectU32guarded by the EXEC predicate before the copy. P2 reads that result under the reconstructed EXEC predicate, sopartialOfinHostInterpolationChecker.cppcannot peel the select: the predicates are different IR values. Folding their proven entry-quad coverage removes that mismatch.Prove each word's starting-lane coverage through AND/OR and WQM, distinguishing real-lane coverage from whole-quad coverage. This preserves #6291's EXEC-copy behavior and lets the existing interpolation checker recognize the unchanged interpolation pair. Ballots captured after divergent control flow, partial masks, unexpanded real-lane masks, and mismatched word indices remain unproven.
Follow-up to #6291, related to #7693. The failing Stray (PPSA02101) shader capture is still unavailable, so recovery of that title remains unverified. This PR fixes a reproduced checker false negative consistent with the reported fallback.
The GPU regression lives in its own
PixelExecInterpolation.cpptest, allowing #7426's barycentric test-helper changes to land independently. A combined merge with #7426's8f4a50d727succeeds. The other shared-file notices (#5021 and #5500) concern vertex-bound and ancillary-input folding in different functions; neither is a dependency.Tested
Windows 11 Pro build 26200, WinLibs GCC 15.2.0 r7 Release, AMD Radeon RX 6700 XT, Windows display driver 32.0.21045.5002. Built with
BUILD_TESTING=ONandANYPS5_ENABLE_SPIRV_TOOLS=ON.main8816fd772; the driver and all nine focused test executables build.ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, the RX 6700 XT selected, and no skips:agc_constant_bit_test,agc_masked_select,agc_shader_memory,agc_driver_exec_host_lanes,agc_driver_pixel_barycentric_emulation,agc_driver_pixel_exec_interpolation,agc_driver_pixel_helper_lanes,agc_driver_pixel_implicit_derivatives, andagc_driver_scalar_sop1.8816fd772with the new tests but the originalConstantFolder.cpp: both the unit test and isolated GPU test fail; the other seven focused tests pass. The GPU failure ischanging EXEC between v_interp_p1/p2 needed a generated stage; the unit test fails its intersection, nested-WQM, and independent-halves assertions. Restoring just this proof correction passes all nine tests.aea761f4d5). Loader logs confirm the layer loads in all six Vulkan tests, neither log reports a missing requested layer, and neither contains aVUID-validation error.python tools/check_conventions.py --base origin/mainand whitespace checks pass.Not tested: Stray, Linux, Intel or NVIDIA hardware, or the full CTest suite.
Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repository