fix(shader): accept a local tessellation index that nothing observes #6657
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6657"
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 xQuakes on 2026-10-16T02:00:25Z.
What
A local tessellation program that uses the relative patch index only to address local data share, and otherwise keeps it on inactive lanes or in a vector-window slot nothing reloads, was refused:
usedAsDatatreated every value that was not itself an address as a data use. The index is now followed through the arithmetic, selects, bitcasts and other pure operations that carry its bits. A side effect counts only when the value it observes still depends on the index. An exec-masked select counts only the arm that exec takes. A vector-window store counts only when a later load can see it. Storing the index into local data share, or reloading it from the window, is still refused.PPSA12361 (Transport Fever 2: Console Edition) stops at startup on this refusal for shader
0x287f20000, stage 6.#6551 also edits
TessellationLowering.cpp, for a hull read at a control point chosen by a select or a phi. This change is the data-use check for a local program.Tested
Windows 11, MinGW-w64 GCC 16.1.0, NVIDIA GeForce RTX 5090, driver 610.62.
agc_driver_tessellation_testspasses. A local program whose relative index survives only on inactive lanes compiles. Restoring exec before storing the index, and a window load after the address is stored, are still refused, as is the existingLocalIndexAsDatacase. The previous hull and domain cases pass.0x287f20000compiles. The title gets past that shader and later stops on the multisampled storage-image refusal, which is #5881.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)Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-16T02:58:38Z.
Review: COMMENTED
Linux run on NVIDIA and lavapipe, which the Linux CI job uses.
Machine: NVIDIA GeForce RTX 3070, driver 595.99.02, Vulkan 1.4.329, plus lavapipe (Mesa 26.0.3, LLVM 21.1.8) on the same machine. Ubuntu 26.04, i7-8700, GCC 15.2, Release,
BUILD_TESTING=ON. Head41972eeb9merged intomain5d9dcc42d(clean merge),-j1 --timeout 30.TessellationLowering.cpprestored frommain):agc_driver_tessellationfails on both devices withtessellation lowering: the relative patch or vertex index is used outside a tessellation ring or LDS address at pc 0x0.agc_driver_tessellationandagc_tessellation_factor_ringpass 3/3 on the RTX 3070 and 3/3 on lavapipe.GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02), lavapipe (Mesa 26.0.3, LLVM 21.1.8), Ubuntu 26.04
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-17T13:10:11Z.
Intel and AMD Windows data: the new cases pass on both GPUs with this change and fail on both without it.
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. "Without" means this PR's test files onmainc9e6c45de, with none of its other changes.41972eeb9merged intomainca82d7d88:agc_driver_tessellation, ×3tessellation lowering: the relative patch or vertex index is used outside a tessellation ring or LDS address at pc 0x0Full CTest (
--parallel 4) onmainc9e6c45dewith seven open GPU PRs merged (#6258, #6657, #6324, #6246, #6174, #6360, #6598): UHD 770 1381 of 1389, RX 9070 XT 1383 of 1389.mainalone passes 1378 of 1385 and 1381 of 1385. The merge adds only two failures:agc_buffer_pool(#6174, both GPUs) andagc_driver_indirect_dispatch_limit(#6360, RX 9070 XT).AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-10-19T00:51:49Z.
Tested on Windows 11, MinGW-w64 GCC 15.2.0, NVIDIA GeForce RTX 5090 (driver 617.42), Ryzen 9 9950X3D. Head
41972eeb9merged onto currentmain(a373e85e5); the merge is clean.agc_driver_tessellationpasses with the change.mainwith only this PR's test file (tests/execution/Tessellation.cpp) the same test fails withtessellation lowering: the relative patch or vertex index is used outside a tessellation ring or LDS address at pc 0x0, the refusal quoted in the description. So the new cases do exercise the fix.Not tested: PPSA12361 (no dump here). I skimmed
dependsOnRelativeandwindowLoadObservesbut did not check their soundness line by line. Since this relaxes a refusal, a mistake would silently accept a real data use of the index; the negative cases in the test (restored exec before the store, window load after the address store,LocalIndexAsData) still pass, but they only cover the shapes the author thought of. I am leaving this as a test report rather than an approval.AI-assisted: yes. Written with AI assistance and reviewed by me.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T07:45:20Z.
Review: CHANGES_REQUESTED
Thanks for the change and the thorough third-party runs. One correctness problem blocks it:
core/shader/recompiler/Optimization/src/TessellationLowering.cpp:256(ImpliesNot): forpredicate = !pit returnsImplies(p, condition).p => conditiondoes not give!p => !condition. Example:p = a && b,condition = a,predicate = !(a && b). Witha = true, b = falsethe predicate holds and the select takes its first arm, butdependsOnRelativefollows only the second arm and can accept an index that is observed. The sound cases arep == condition(then!p => !condition), or the other direction,condition => p. Please fix it (probably only the equality case, sinceImpliesonly looks atLogicalAndon the left) and add a test whose masked-select predicate is a negated conjunction where the observed arm carries the index, which must stay refused.The rest of the diff (the
CarriesRelativeBitsset, the window-load reachability walk, the existing refusals kept) reads fine.Imported from boykopovar/AnyPS5. Originally posted by DavidAmsellem on 2026-10-19T17:22:04Z.
First AMD-on-Linux (RADV) run of this PR. Merged onto
maindbac9fa15(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): 1638/1640 with this PR, against 1638/1640 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).agc_driver_tessellation,agc_tessellation_loweringandagc_tessellation_factor_ringrun and pass. The PR adds no new ctest entry, and no test is skipped or removed compared withmain.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 DavidAmsellem on 2026-10-19T18:16:49Z.
First AMD-on-Linux (RADV) run of this PR. Merged onto
maindbac9fa15(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) at4779e727d: 1638/1640 with this PR, against 1638/1640 onmain. The two failures are the same on both, so this PR adds none:agc_driver_image_table_vouched_lookups(#7766, fixed by #7916) andagc_driver_guest_memory_lifetime(#7784).Comparing the JUnit output with
main: this PR adds no ctest entry, and none is skipped or removed.This checks correctness only; I did not measure performance.
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 MarcZX10 on 2026-10-21T23:59:11Z.
One checklist item remains incomplete independently of the code concern in the existing changes-requested review.
CONTRIBUTING.mdrequires a title unblock to name both the title ID and its Game bring-up discussion. The current line saysUnblocks: PPSA12361 (no Game bring-up discussion yet), so it does not meet that format. Please add the discussion link if this PR is intended to unblock the title, or usenoneif it is not.