fix(shader): keep host interpolation across entry EXEC copies #7811
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7811"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by santhoshkumar-dev on 2026-10-19T08:27:18Z.
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 run locally: Stray, Linux, Intel or NVIDIA hardware, or the full CTest suite. Independent runs below cover additional hosts and drivers at their pinned inputs.
Rebase audit (2026-10-21): rebased onto main
d099bc6cd8.git range-diffreports the proposal unchanged (9b45e784b7=d72c5dcd0d). Conventions and the rebuiltagc_constant_bit_testpass. The GPU results above cover the unchanged patch; GPU validation was not rerun for this rebase. Main still lacks the starting-quad coverage correction, so this PR remains useful.Independent validation of the unchanged
9b45e784bpatch (now rebased asd72c5dcd0d):85029a00f: both new regressions pass three repeated runs on each GPU and fail with the test-only patch on main.43a2abaf7: full build; full suite 1637/1639 versus main 1636/1638. The same two main failures remain; the new test runs and passes.8816fd772: six focused tests pass on both drivers; both new regressions fail with only their test changes on main. AGC suite NVIDIA 781/782 versus 780/781; lavapipe 782/782 versus 781/781. The sole NVIDIA failure also occurs on main.a373e85e5with the explicitly listed macOS, loader and other PR stack in the review; it is not validation of a stock macOS build. The same AGC baseline failures remain.These are attributed reports from the reviewers' machines and pinned combinations, not new local full-suite or cross-platform runs.
Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T08:31:33Z.
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.
core/libs/prx/libSceAgcDriver/tests/ConstantBitTest.cppcore/shader/recompiler/Optimization/src/ConstantFolder.cppImported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-19T09:39:39Z.
Review: COMMENTED
Apple GPU / MoltenVK run, as a second vendor with a 32-wide subgroup.
agc_driver_pixel_exec_interpolationruns its wave32 and wave64 draws on Apple and passes. WithConstantFolder.cppreverted, 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 c311129c0, PR diff applied cleanly. The current head 9b45e784b is a rebase of the same commit (
git range-diffshows it unchanged). The device reports subgroup size 32.Tested: the tree is
maina373e85e5+ 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 plainmain(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 (branchjotitadev:fix/agc-tests-vulkan-loader-macos). Base on that tree: 40^agcfailures with MoltenVK 1.4.2 and 26 with MoltenVK main + #2704, plusagc_driver_pooled_buffer_rangeandagc_performance_overlay, which only run because of the loader patch.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.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).^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.
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-19T10:28:25Z.
Review: COMMENTED
NVIDIA and lavapipe run of
9b45e784bon 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. Head9b45e784bmerged ontomain8816fd772(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.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.
Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T14:36:45Z.
AMD and Intel Windows data: with this PR's test changes,
agc_constant_bit_testandagc_driver_pixel_exec_interpolationfail onmainand pass with the PR, on an AMD RX 9070 XT and an Intel UHD 770.Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built,
ANYPS5_NO_SHADER_CACHE=1, serial CTest. Intel UHD Graphics 770 (8086:a780), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31041.1004, withVkCacheemptied first. This head9b45e784bmerged intomain85029a00f. "Without" means only this PR's diff totests/ConstantBitTest.cppand the newtests/execution/PixelExecInterpolation.cpp, applied tomain85029a00f.agc_constant_bit_test,agc_driver_pixel_exec_interpolationagc_constant_bit_testfails three cases at both wave 32 and wave 64:intersecting whole-quad entry masks preserves pixel helpers,a nested whole-quad entry mask covers pixel helpers,independent low and high whole-quad masks cover pixel helpers.agc_driver_pixel_exec_interpolationfails:AGC graphics: changing EXEC between v_interp_p1/p2 needed a generated stageThe other
ConstantBitTestcases pass onmain, including the plaina whole-quad entry mask covers pixel helpersand every case that must keep the lane bit test.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by DavidAmsellem on 2026-10-19T15:44:24Z.
First AMD-on-Linux (RADV) run of this PR. Merged onto
main43a2abaf7(clean merge), built in full and compared with the samemain, on the same machine.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 (
ANYPS5_REQUIRE_VULKAN=1 ctest -j8): 1637/1639 with this PR, against 1636/1638 onmain. The failures are the same two on both, so this PR adds none:agc_driver_image_table_vouched_lookups(#7766, fixed by #7916) andagc_driver_guest_memory_lifetime(#7784). The newagc_driver_pixel_exec_interpolationran (not skipped) and passed.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
Imported from boykopovar/AnyPS5. Originally posted by santhoshkumar-dev on 2026-10-22T08:03:38Z.
Thank you for the AMD, Intel, NVIDIA, lavapipe and Apple/MoltenVK comparisons. Those independent results remain recorded in this review with their tested trees and configurations. Current head
d72c5dcd0dis an unchanged rebase of9b45e784b7(git range-diffreports equality); its rebuilt constant-bit regression passed. No additional shader change was needed in response to these validation reports.