feat(recompiler): run waterfall loops over per-lane T#s through image tables #6488
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6488"
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 fdfawef324 on 2026-10-15T17:09:24Z.
What
Recognize eight T# words loaded together from a per-lane buffer table and materialize them through the image-table waterfall path. Preserve the load predicate independently of the numeric key: an EXEC-masked descriptor load yields the original zero descriptor even when a nonempty table has an invalid layout, while an active real
UINT_MAXkey keeps the unsupported-OOB fault behavior. Eligibility, nonuniform descriptor selection and fault reporting remain generic.Rebased onto
676d423968a1a8fcc79c6247020ce22090a8e0d4, retaining itsSharedValues/Sealtable storage and all newer cache fields. The snapshot hash and resolution memo both includesharedMode. This standalone branch uses shader disk cache format 41; a future combined serialized schema must recount its fields and choose its next format then.Source overlap review: #7395 follows nested/pointer-keyed tables and will need to retain the independent lane-load operand when composed. #6858 validates entry-header/key bounds; #6924 adds specialized disk entries. Their exact source changes do not duplicate the lane-table feature. Combined execution with those PRs is untested. The shared handle-operand convention with #7395 needs an agreed landing order under CONTRIBUTING.md. The proposal is #7684, then this PR, then #7395; only #7684-first was already agreed, so this verified update remains a draft while the extension is coordinated.
Tested
Current source:
a48c5a7c7321f1b47ae02a44fb110982e9a26770on the pinned main above. Release/O3 build passed. The final clean rebuild after the regression control completed in 18.44 s;agc_shader_bindless,agc_shader_memoryandagc_shader_disk_cachepassed 3/3 without skips in 4.68 s. Removing only thesameColumnsshared-mode comparison from this source produced the exact new memo-reuse assertion with exit 1 in 0.45 s; restoring it returned the natural source fingerprint and clean revision identity. Current-head Vulkan checksagc_driver_waterfall_images,agc_driver_image_tableandagc_driver_image_table_cache_boundspassed 3/3 without skips in 6.50 s, sequentially in the managed slot. All three initialized the actual RTX 3060 Vulkan device; executable/library hashes were verified before and after. Conventions passed; the candidate merges cleanly into later main72a3d9f2a49d, checked separately from this 676-based execution.Synthetic coverage includes masked-off bounded/unbounded invalid tables, mixed loaded/skipped lanes with nonzero texels, active real
UINT_MAXunder unsupported OOB2/3, eight-U32 load-predicate closure/host-plan round trips, and a resolution-memo control that varies onlysharedModewhile sharing the same storage. Fixtures are handwritten from existing project fixtures; no game payload, disassembly or shader dump is included.Historical GPU red on
6a9044cdca427bd1020489c72aede884d3b84b9a: the masked-off nonempty swizzled-table fixture exited 1 with the exact new assertion, image-table fault and actual Vulkan-device markers (1.77 s). This motivates the independent load predicate; it is not a current-head GPU result.Historical title coverage on
f85278a892945ab18b54ff84f84024848f57b050/fa9365ca74acae7c594618b0a857365774cc6f45: GTA V PPSA04264 reached the landing page in a 2400 s session, 112772 presents, 59.93 FPS. Story was not selected and the affected compute shaders were not shown to dispatch. Later separate Story experiments hit a device-lost/TDR; this PR does not establish Story playability or a performance improvement. Historical offline preparation succeeded for 242 requests without SRT memory; runtime descriptor materialization was unverified.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)Co-Authored-By: Claude Opus 5.5 [email protected]
Co-Authored-By: Codex [email protected]
Imported from boykopovar/AnyPS5. Originally posted by fdfawef324 on 2026-10-15T21:59:18Z.
In-game result, GTA V (PPSA04264), Windows Server 2025, RTX 3060 (591.86), Ryzen 9 5900X, relinked title, scripted pad input, cold shader cache:
main71bd2876eshader 0x25cb2dc00 stage 5 ... GetImageResource dword 0 is not a valid runtime value; the eight compute shaders logcould not be prepared after registrationwith the same errorfa9365ca7fa9365ca7is 182 commits after71bd2876e; without this PR the nine shaders' requests also fail offline onfa9365ca7. The PR run logged no preparation failure, noimage table:fault and no other error.Not covered yet: the run's two scripted R1 presses (541 and 571 s) came while the start screen was still up, before the landing page appeared, so the Story tab was never selected and nothing past the landing page ran. None of the eight compute shaders' request files was rewritten (
APS5_DUMP_SHADERSwrites one at a compute shader's first captured dispatch), so they were most likely not dispatched, and the log does not show whether0x25cb2dc00was drawn. The table V#s' layouts and record modes are still unchecked in game; a Story-mode run is queued. Tested section updated.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-18T02:20:43Z.
Heads-up: #6243 has merged and uses shader disk cache
FormatVersion37. This PR also bumps to 37, so please merge or rebase onto currentmainand move this PR's bump to 38 (thestatic_asserts and any version checks in the tests with it). After the new head is up, we review the delta and rerun CI.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T02:12:47Z.
Review: CHANGES_REQUESTED
Thanks for bringing this back on the #757 image-table model. It cannot be reviewed or queued as it stands:
main(40393b0f9) in content, not just adjacency:ResourceTracker.cpp,ResourceMaterializer.cpp,ControlFlowInfo.hpp(TableColumn),ResourcePlan.hpp,Recompiler.cpp,ShaderDiskCache.cppandtests/ShaderMemory.cpp. #5958, #6417 and #6243 changed the same table code since f85278a89's base. Please rebase and re-resolvelaneKey/implicitDerivativesand the lane snapshot against the current column and record handling.ShaderDiskCache::FormatVersionis 39 onmain(as @oneandonlydean asked on 18/10, after #6243 took 37). This PR's bump must go to 40, with thestatic_asserts and the version checks inShaderDiskCache.cpp/ShaderDiskCache.hppand the tests moved with it.agc_driver_waterfall_images,agc_shader_bindless/agc_shader_memoryandagc_shader_disk_cacheand update the Tested section with the new base; the replay of the GTA V requests against the new head would be worth repeating too.Once the new head is up we will review the delta and run the full Build.
Imported from boykopovar/AnyPS5. Originally posted by fdfawef324 on 2026-10-19T05:17:13Z.
Rebased onto
676d423968a1a8fcc79c6247020ce22090a8e0d4; that main now uses 40, so this standalone schema uses 41. The rebase preserves all newer main fields and SharedValues/Seal storage, plus the lane-table metadata. Separate pending branches may independently use 41; composition must retain both schemas and select the actual next version then.During verification we retained a synthetic failing case for an EXEC-masked descriptor load observing an invalid nonempty table. The fix preserves an explicit load predicate rather than treating numeric
UINT_MAXas inactive, and keeps faults for active realUINT_MAXwith unsupported OOB modes. Ata48c5a7c7321f1b47ae02a44fb110982e9a26770, the clean Release/O3 build and CPU3/3 pass; the new-main shared-mode memo control fails with its exact assertion after removing only that comparison, then passes after byte-exact restoration and an 18.44 s final rebuild. Current-head device checks passed 3/3 without skips in 6.50 s on the RTX 3060: waterfall images, image table and image-table cache bounds. Each initialized Vulkan; runtime hashes were checked before and after. The candidate also merges cleanly into later main72a3d9f2a49d; that merged tree was not executed. Historical landing-page/preparation evidence remains qualified; no Story-playability claim.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by DavidAmsellem on 2026-10-19T15:44:27Z.
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_waterfall_imagesran (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 oneandonlydean on 2026-10-20T18:50:17Z.
Picking this up for our testing: it addresses the stop we see in PPSA01474 on current main, one of the titles we're bringing up, and we'd like to move it into main. We'll review, test and merge it under the normal process. Your comments and review are still very welcome, @adriadam10.
Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-20T22:17:13Z.
@oneandonlydean a data point for the PPSA01474 stop, in case it helps your testing. Ratchet & Clank: Rift Apart (PPSA01474, 01.005.003), Linux, RTX 4090, one unattended run per build with a cold shader cache. Both builds are on
main6830c9164, and the second adds this PR (a48c5a7c7, merged cleanly apart from a test-file conflict where I kept bothverifyWaterfallImageTableandverifyLaneImageTable;agc_shader_memoryandagc_shader_bindlesspass):main6830c9164GetImageResource, T# read atpc=0x6b80through the V# loaded atpc=0x6b6c(the #6191 record → pointer → V# → T# chain)main+ this PROn this route the PR doesn't change where Ratchet stops, and there are no other refusals before that point in either run. That chain is the one #7223 resolves: with #7223's
74700a08dthe same shaders get past the T# and stop on the S# read atpc=0x6b74instead (#7223 comment above). So if the PPSA01474 stop you see is a different shader or pc, could you post its line? I can run it here and on an AMD V620.Tested and written by Claude (AI assistant) on a contributor's machine.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-22T04:04:25Z.
@Tamalero thanks, and sorry this sat unanswered. Our runs of PPSA01474 match yours: on main the stop is
GetImageResourceatpc=0x6b80(the #6191 chain), and with this PR we died on a sibling shader with the same chain. The later time (248 s vs 202 s) was within our run-to-run spread, so on our side too this PR doesn't move the stop.Our furthest stop is on a stack rather than on this PR: #7395 (which includes #7223) gets past
0x6b80and0x6b74, and #8939 on top clears the next one atpc=0x9a30. It then stops here:There the pointer merges three live sources: one record column and two 64-bit pointers read from buffers. #8939 doesn't cover that case yet, and I've raised it there.
The most useful run would be main + #7395 + #8939 on the V620. It's a recompiler refusal, so I'd expect the same
0x10b84stop on AMD, but confirming that (or showing it differs) would help, since we only test on NVIDIA here.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T02:54:03Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the optional point below is about review coverage.
What I ran
Reviewed head
a48c5a7c7321f1b47ae02a44fb110982e9a26770from the prepared diff and pinned source reader. No commands or tests were run by me; build, GPU, and regression-control results are author-reported.Results
Negative control
Not run by me. The description reports that removing the shared-mode comparison triggered the new assertion, then restoring it passed.
Findings
Blocking
None found in the code reviewed.
Non-blocking
Sources
Behavior claims were checked against the prepared diff and the pinned source at the reviewed head.
Not verified
I read the changed files in the manifest except
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp, which was excluded from the prepared folder for size; I read its addedverifyLaneImageTablefunction throughrepo_read.py. I did not read the rest of that file or independently verify author-reported checks, combined execution with the overlapping PRs, or console behavior.To get this to a good state
Nothing is required. Optional: retain the reported GPU and regression-control coverage when coordinating the overlapping PRs.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.