fix(shader): accept MIMG sampler tuples ending in VCC #4996
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4996"
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 MarcZX10 on 2026-10-13T07:36:59Z.
What
Closes #4991.
The MIMG decoder rejects sampler base s104 because it checks
sampler + 4 > 106. On gfx10, the aligned four-dword sampler tuple at s104 consists of s104, s105, VCC_LO, and VCC_HI. LLVM models this explicitly asSGPR104_128/SReg_128(see register definitions and gfx10 MIMG sampler operands). The existing descriptor read path maps the upper two components to the VCC halves.Allow the exact s104 sampler base while keeping s108 and later bases rejected. Add a regression using the reported synthetic instruction words; it verifies ImageSample decode and sampler resource index 26, plus rejection of base s108.
The issue's title observation came from a private native-MSAA integration; this PR claims only the decoder boundary and synthetic translation regression. It does not claim title progression or hardware validation.
Tested
6d7b87370: builtimage_sample_gather_tests;ctest --test-dir /tmp/AnyPS5-4991-build -R '^image_sample_gather$' --output-on-failurepassed (1/1).python3 tools/check_conventions.py --base upstream/main --head HEAD: passed.git diff --check: passed.Checklist
main; no other open PR implements the same functionsImported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-13T08:40:00Z.
@MarcZX100 Independently checked unchanged #4996 head
3e238ff11d03beedfc9b224f6c749fd2a4f393ab, on Windows 11 Enterprise 26200 / WinLibs GCC 15.2r7 / Release, with RTX 5080 (NVIDIA610.62) and AMD Radeon (32.0.21036.18):image_sample_gather.patched_libraries,agc_driver_bda_span_reads,agc_driver_pixel_interlock) reproduce on exact parent-main6d7b8737 and after restoring/rebuilding the unchanged PR head. This is not a full-green claim. The loader failure matches already-merged #5014; I have not retested that correction in this build.Additional tests are preserved in our fork commit, directly on top of your unchanged head, with no additional production change:
image_sample_lzfixture writes the sampler into s104/s105/VCC_LO/VCC_HI and checks bilinear filtering plus a nonzero white-border high word, wave32 and wave64, all64 lanes/components. Nine relevant groups x5 pass on both GPUs with this supplement, shader cache disabled.Please feel free to use the supplemental tests and debt entry from that commit. Your
sampler >104predicate is equivalent to our testedsampler +4 >108because decoded bases are multiples of4. Raw gfx1013/gfx1036 execution remains unmeasured; the native evidence above is for AnyPS5's recompilation. The native fixture covers sample-lz, while gather/get-lod coverage here is CPU IR only. The conditional integration now passes full build/libraries/checkers,26 relevant groups x5 on both GPUs, and full NVIDIA1037/0/8 of1045 (max23.804s). Its exact124-module frozen profile loads x5; only AGC differs from42a,123 other modules are byte-identical, and AGC named imports match. The guarded comparison is complete: prior42a stopped atMIMG descriptor register range overflowafter807.203s/59readbacks; the credited-fix profile stops atMTBUF resource descriptor register range overflowafter792.920s/59readbacks, with no MIMG range exception logged. Both exit0xC0000409 without the1080s timeout and send the same six300ms pulses (consumption unlogged). The new run also logs GPU submissions36322/36323 not reaching36321 in10s and fence error0xFFFFFFFC before the MTBUF exception; their cause remains untraced, as in the earlier uninstrumented42a run. Protected originals/executable, exact baseline runtime/guest, saved user data, all59 archived readback hashes and source cleanliness are independently rechecked after restoration. This is a changed decoder frontier on a conditional integration, not unchanged-main startup, raw hardware equivalence, gameplay, rendering accuracy, FPS or a speed improvement. MTBUF instruction fields are not captured yet, so no new missing-capability claim or issue follows solely from this refusal. No duplicate fix PR from us.AI-assisted validation, tests and reporting: Codex; author responsible.
Update (2026-10-15): our retained native fixture is now upstreamed for review in #6422, independently extracted on main940 as a test-only change. Fresh Windows NVIDIA/AMD runs pass50/50 per GPU across initial/restored phases;30 separate fault-control runs detect the old bound or a missing sampler word. The new PR maintains exact pins and scope. The historical conditional replay's saved-user-data restoration wording above is subject to the active-root correction in #3036. AI-assisted: Codex.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T10:18:37Z.
Thanks for the independent validation and for documenting the exact parent-main controls and remaining failures. The NVIDIA and AMD repeats, plus the isolated VCC_LO/VCC_HI mutations, are especially useful evidence for the sampler tuple handling. I’ll keep the PR’s claim scoped to the paths you exercised; I understand this does not establish raw gfx1013/gfx1036 equivalence or title gameplay.
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-14T00:24:40Z.
Windows test of #4996: Windows 10 (19045), MinGW-w64 GCC 15.2, Release,
ninja -j 4, ctest called directly, GPU selected by the execution tests: NVIDIA GeForce RTX 4080 SUPER (Selected GPUlog line). Tree:mainfeddf7f4c+ merge of PR head3e238ff11d03beedfc9b224f6c749fd2a4f393ab(local merge1e384354f).agc_driver_image_gather_one_dimensional,agc_driver_image_gather_one_dimensional_array,agc_driver_image_packed_horizontal_gather,image_sample_gather: exit code 0, 3 of 3 runs each (12 of 12). Logs:rtx4996_*_N.log.Not tested: that the new test (
ImageSampleGather.cpp) fails without the change (no baseline run), the AMD GPU (present, not selected), other ctest targets, Linux, a title run (PPSA99902).AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-14T01:50:13Z.
Correction to my Windows test above: I wrote that the GPU was shown by a
Selected GPUlog line, but that line was not in the ctest logs of those runs (ctest without-Vdoes not print the output of passing tests). A later interactive run ofagc_driver_image_gather_one_dimensionalwithctest -VshowedSelected GPU name=NVIDIA GeForce RTX 4080 SUPER; I did not keep a log of that run, and the other three targets were not re-run with-V.AI-assisted (Claude Code).