feat(agc): resolve table samplers through device image keys #13928
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13928"
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 Celegans12 on 2026-10-31T13:01:49Z.
What
Stacked on #10193; please review the sampler-table changes and merge resolution.
Resolve ordinary table S# values through per-use device image keys containing all four raw sampler words. Preserve correlated and separate T#/S# indices; retain sampler owners and generations through recorder completion. Mixed consumers keep their existing CPU path.
Unsupported sampler keys produce explicit faults without CPU fallback. Keep at most 64 diagnostic details of 512 bytes and one suppression record per table; retry and capacity behavior remain separate. Device image ABI 4 is unchanged. The combined sampler shader-cache layout uses format 76 and invalidates older entries.
Continues Celegans12's local work with fable-void's interface/key/hash/ring credit preserved. Runtime-only S# addresses are in #13929; #12904 validates ordinary samplers and #12980 specializes direct-image minimum LOD. The combined-stack scan reports 65 other shared-line or export overlaps, including #13929 and the request/cache-format branches; 139 conflicting branches could not be compared. Reconcile shared changes as those PRs land.
Tested
Based on
main096c45570fplus #10193; merges cleanly with9090972b7e. Windows 11 / MinGW-w64 GCC 15.2.0, Release with-DBUILD_TESTING=ONand SPIR-V Tools: 27 focused serializer, shader, image-table, sampler and heap cases passed three times on NVIDIA RTX 3080 Laptop / 610.62 with validation 1.4.363. Two additional refusal-limit and retry cases passed three times. No VUIDs or skips. GPU tests include filtering, LOD bias, poison and recovery.Ubuntu 24.04 WSL / Mesa 25.2.8 llvmpipe / LLVM 20.1.2, validation 1.4.363: 14 cases passed three times and 15 heap-dependent cases skipped. No VUIDs. Userfaultfd write protection was unavailable, so the same-texture sampler-refresh subcase did not run. The earlier native Linux sampler-owner release failure remains unverified.
Not tested: macOS, native Linux descriptor-heap execution, titles/FPS or console behavior. The parent title-scale cache-growth report remains unresolved.
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 XairRrR on 2026-11-02T21:17:05Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The merge builds and introduces no new test failures or validation errors, and the sampler negative control fails as it should. But the four new
agc_driver_device_image_samplers_*_gpu_pathtests skip on lavapipe with a reason thattools/check_skips.pydoes not accept, so the Linux CI job onmainwould fail.What I ran
Head
201659f09caf946ce9fef104cd9393f6828d5114,main9090972b7e91fd266819cbd77a8b058e177b5682, merged treedee7116809f977b1c1e8fcda84e281c8cda9eabd. Debian 13 VM, Xeon Gold 6136, GCC 14.2.0, lavapipe (Mesa 26.1.6, LLVM 19). lavapipe has noVK_EXT_descriptor_heap.The script's full build and test run (build.json) is also used below.
Results
git diff --checkcheck_conventions.pylibsmain(agc_driver_division, the denormal-mode tests,guest_interfaces, …), so they do not count against this PRcheck_skips.py(script)_gpu_pathtests,agc_driver_presentation_pass_gpu_heap);guest_net_ctlis also unexpected onmainagc_shader_device_image_tablesfails without the sampler tracker changeSkip reasons
check_skips.pyaccepts 1538 (it matches "the device lacks"). It rejects 1543, and it rejects 1842 because the earlier "the device offers no host memory type" line does not match.Negative control
I reverted only the
ResourceTracker.cppchange from the PR's sampler commit2d7abc532129(this lets table S# columns become device columns) and rebuiltagc_shader_memory_tests.agc_shader_device_image_tablesthen failed:With the merged file restored, it passes again, and
git status --porcelainis empty.There was no negative control for the GPU-path sampler tests (
_gpu_path,_filter_gpu_path,_lod_bias_gpu_path,_poison_gpu_path): they skip on this device, so a control would show nothing.Findings
Blocking
DeviceImageSamplers.cpp#L494-L497printsskipped, descriptor heap features, limits or validation policy do not permit the device image path; see the device diagnostics.check_skips.py'sDEVICE_LIMITATIONonly accepts reasons such as "the device lacks …".build.ymlrunspython3 tools/check_skips.py build/ctest.xmlafter ctest on the Linux (lavapipe) job. Once this lands, that job fails foragc_driver_device_image_samplers_gpu_path,_filter_gpu_path,_lod_bias_gpu_pathand_poison_gpu_path. The siblingagc_driver_device_image_path_gpu_pathskips for the same cause with an accepted message.skipped, the device lacks VK_EXT_descriptor_heap, …, using the device's refusal reason (DeviceImagePathRefusal).Non-blocking
agc_driver_presentation_pass_gpu_heapalso fails the skip check (from the #10193 / descriptor-heap stack, not the sampler commit).PresentationPass.cpp#L793printspresentation source in host memory: skipped, the device offers no host memory type for the imageduring the heap run. The heap block at L830-L834 then exits 77.check_skips.pyrequires everyskipped,line of a skipped test to match a device limitation. This line does not, so the test counts as an unexpected skip.Earlier review requests. I checked oneandonlydean's three requests against the merged tree:
docs/dev/debt/libSceAgcDriver.md("refused with poison … does not select the CPU table path"), and a_poison_gpu_pathtest.--filter-onlyand--lod-bias-onlycases exist.I could not run the GPU-path variants of these cases (see below).
Not verified
VK_EXT_descriptor_heap, soDeviceImageTable::lookupKey's sampler path never ran here; my validation-layer comparison does not cover it either.agc_driver_device_image_tabletimeout and "previous sampler had not been released" assertion that TechLevelZero's NVIDIA Linux runs reported. Here the test passed in 1.4 s, but its heap-dependent part skips on lavapipe, so this run neither confirms nor refutes that failure.To get this to a good state
check_skips.py's device-limitation pattern, then confirmpython3 tools/check_skips.py build/ctest.xmlpasses on a lavapipe run.agc_driver_device_image_tableon the current head and settle the owner-release failure.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T06:41:53Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected sampler-table paths construct keys from all four runtime sampler words, retain sampler owners with table entries, and report unresolved required descriptors as faults; no blocking defect was verified in these paths.
What I ran
201659f09caf946ce9fef104cd9393f6828d5114; no base merge check was run.repo_read.py.Results
Findings
Blocking
None verified in the inspected paths.
Non-blocking
None.
Not verified
This review is incomplete. Only selected portions of the changed code were read; many changed lines and files were not inspected, including the Vulkan-Headers submodule and substantial graphics, shader, and test changes. The author's reported test runs were not independently verified. No approval is justified from this partial inspection.
To get this to a good state
Nothing is required; complete a full inspection of the changed lines and run applicable checks before making a formal merge decision.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:50:01Z.
Review: COMMENTED
The trial merge onto
c1601e56d5conflicts throughout the device table, recorder, and shader resource stack. For the sampler-specific delta, retain correlated and independent T#/S# indexing and verify that the sampler owner survives a recorded batch after table replacement. A single-frame sample can pass while a slot or generation is reused too soon. Please rerun device-table and fallback cases together on the resolved stack.AI-assisted: yes.
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.