Repository navigation
fix(recompiler): include implicit inputs in relative vector windows - #4057
Conversation
5ee79a8 to
5ec6cff
Compare
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
|
The mechanism matches the body's description: There's a real conflict to flag before this merges: this diff predates #4120 and does not include it. Both PRs are open against the same function, Two smaller things worth surfacing to the author: the diff removes the pre-existing On testing: the six named ctest targets are real and four pre-exist; two ( Written with AI assistance. |
What
Fix a shader compilation regression introduced by #3856. The relative VGPR window was sized only from decoded operands, before stage setup wrote implicit registers. A vertex program naming v0–v3 can still need v5/v8, a pixel program naming only v0 can receive position inputs in v1–v3, and a compute program naming v0/v1 can need its Z ID in v2. Each can throw “vector register … lies past the relative-addressing window.” External fetch calls have the same problem when their generated destination span extends beyond decoded operands.
Extend an active window from the actual prologue writes before translating the body, and pre-scan external fetch destinations using the same load generator as translation. Registers below the window stay in SSA; shaders without relative addressing keep their existing path. The measured out-of-range opcode behavior is unchanged.
Add CPU regressions for seven stage prologues in wave32/wave64, SSA prefixes, and external fetch spans ending at v255. Add native vertex, pixel and compute readbacks. Also keep the existing SPIR-V window-shape test observable under optimization with a dynamic index and buffer stores.
Tested
Current source:
5ec6cff3fae85661c2f69048a35c857b4e8c7826, rebased ontobab7b3285221495463a4a2494dc410cf137b4a92. The only rebase conflict was adjacent CMake test registration; both this PR's registrations and #3741's eight optimized-readback registrations were retained. The translator and both test source files are byte-identical to the preceding head.Windows 11 x64, RTX 5090 driver 617.42, portable MinGW GCC 15.2, Release with SPIRV-Tools enabled: all six selected tests passed on the rebased candidate without skips or feature refusals:
agc_driver_dpp16_operandsagc_driver_relative_indexingagc_driver_relative_stage_inputsagc_driver_scalar_relative_indexingagc_vector_windowagc_vector_window_stage_inputsThe full
libstarget built successfully. Conventions and independent source/raw-evidence reviews passed. Shader caches were disabled and every test remained below 30 seconds.The current Windows base still fails to compile in
Socket.cppbecauseHostPollis unavailable there. Validation therefore applies only the reviewed build fix from #4021 (121b16fb4bbd47ff4ce9302c40631bab858e3e71). Actual tested Windows pin:840621b548c9be8699b19a9d0440fcf3ee64b408. It differs from the published candidate only inSocket.cpp; that separate fix is not included in this PR.Historical negative controls remain at test-only baseline
359d0e0ec418fab8c600c8a73ca77023d1677684, based on11d9c00cf60bf6242fe51c5711167d8ad7cfbbb1. Windows validation pin7ab31c73af76b44ba4bb58a532f235a774dee512includes the same #4021 build dependency. Both exact baseline regressions reproduced all expected assertions: nine CPU groups and three native shader compilation failures. The preceding candidate5ee79a871b6b193ee22ef711606196b1fda222e6(Windows pina8c0c2557292f646028ff3b0072b2df44841a814) passed all six tests. The unchanged baseline failures were not repeated for this CMake rebase; current validation above covers the rebased candidate.The native regression verifies every pixel of two 64×64 draws and all 16 compute output words. Vertex indexing depends on nonzero firstVertex and firstInstance; the fragment shader reads position W relatively; the compute shader reads implicit Z relatively. Other stage prologues and external-fetch spans have CPU translation coverage only.
Linux validation remains blocked at configuration because the local runner lacks the required SDL PipeWire/PulseAudio/ALSA development files. That known blocker was not rerun, and no Linux result is claimed for this head. Before the original rebase, all nine CPU groups passed on Linux at
78763696, and the existing relative/scalar GPU controls passed; these remain historical evidence. Linux DPP16 remains excluded for the existing eight-lane lavapipe subgroup limitation. These are synthetic correctness regressions, not retail-title startup or FPS measurements. The existing inferred-usage approximation for the window end remains. No driver settings or production LTO policy changed.Checklist
main; no other open PR implements the same functions