perf(agc): relocate dispatch-cache entries whose user-data pointers or buffer descriptors moved #24661

Open
bagodees wants to merge 2 commits from upstream-pr/24661 into main
bagodees commented 2026-11-20 22:34:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by bagodees on 2026-11-20T22:34:41Z.


What

A dispatch whose key is not in the dispatch cache now copies the entry of a recent dispatch of the same program when only its user-data pointers, or the buffer descriptors behind them or in user data, moved. Before, every such dispatch took the uncached path. With APS5_PIPELINE_DISPATCH=1 that path also drains the draw committer.

Titles that keep their per-frame constants in a ring buffer move these pointers every frame. In PPSA01494 the SRT pointer in user[12] advances 0x20000 per frame, and the constant buffer descriptors inside it move with it. So nearly every dispatch missed: about 23,000 inserts and 2,400 hits per 10 s.

  • Relocation (DispatchRelocate.cpp): an inserted dispatch records its user data as a donor, up to 8 per program. On a miss, at most two donors whose differing user words are relocatable pointers (asBase and not asValue), or the base of a buffer descriptor in user data that a GuestBuffers binding holds, are tried.
    • The runs read through a moved pointer are read at their new address and compared word by word.
    • A word may differ only in the base of a buffer descriptor whose other words are unchanged. The runs read through such a descriptor move with it and are compared the same way.
    • The copy patches the forwarded user words and the moved descriptors in the compiled result.
    • It is refused when a moved value is still held anywhere else in the result, a descriptor moves in a program with an address table, or a run straddles a moved descriptor's range.
    • The ordinary validation then compares every run of the copy with memory before it is used, so a wrong guess becomes the usual miss. The guest-memory reads happen outside the dispatch-cache lock.
  • Moved-buffer recipes (VulkanDevice.cpp): a dispatch recipe is now also built when the template served moved read-only buffers, marked movesBuffers. Such a recipe hit runs MovedDispatchBuffers and binds them through PrepareDrawBindings, as the template path does, and rebuilds when they cannot move. A relocated copy of a recipe carries the patched push words.
  • Run accesses (ShaderResources::MovedRunAccesses): a dispatch recorded with moved in-place bindings reports their new ranges to the overlap runs. The template's old range is left out when no unmoved binding reads it. Before, a moved dispatch reported the ranges the template was built at.
  • APS5_NO_DISPATCH_RELOCATION and APS5_NO_MOVED_RECIPES are runtime switches, so APS5_AB can toggle both within one run. With APS5_PROFILE_DRAW a [dispatch-relocate] line counts each outcome per 10 s.
  • agc_driver_dispatch_relocation dispatches one program through a table that moves with the same contents, then with its input buffer moved, then with the buffer resized. It checks the results and that the first two were served by relocated entries and the third was not.
  • image_table_vouched_lookups turns relocation off for its scenario: it tests the capture path's column reuse for an SRT moved with the same contents, which relocation now serves as a hit.

Overlap: tools/pr_overlap.py --branch found no conflicting lines and no shared exports; it could not compare 108 open PRs that conflict with main themselves. Of those, none relocates dispatch-cache entries. #21780 adds the template's data buffer inside ShaderResources::RunAccesses, next to the recordDispatch line where this PR adds MovedRunAccesses; the two are independent.

Tested

Windows 11 (10.0.26300), Intel Core i9-12900K, NVIDIA GeForce RTX 4080 (NVIDIA 621.01), WinLibs GCC 15.2, Release, on main e481b13555.

  • Focused tests on main and on this branch, same machine and GPU, with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and VK_LOADER_DEBUG=layer (Vulkan SDK layer 1.4.363). Command: ctest --test-dir build -R "^agc_driver_.*(dispatch|relocation|recipe|overlap)|^agc_driver_graphics$|^agc_relocation_runs$" -V.
    • main: 41/41 passed.
    • This branch: 42/42 passed (the 41 plus agc_driver_dispatch_relocation).
    • Both logs show Insert instance layer "VK_LAYER_KHRONOS_validation" (68 and 70 times), neither has was not found but was requested by env var VK_INSTANCE_LAYERS, and neither has a VUID- error.
  • ctest -R "^agc_driver" (1462 tests) on this branch: all pass except five that fail the same way on main on this machine: agc_driver_image_plane_address_on_line, agc_driver_image_sample_lod_clamp, agc_driver_image_sample_lod_clamp_shader_lane, agc_driver_stencil_plane_memory and agc_driver_msaa_dcc_unwatch. agc_driver_store_over_untracked passes and fails intermittently on both (2 of 4 runs failed on main).
  • PPSA01494 (Borderlands 4) 01.050.000, first-run Accessibility screen, 3840x2160, APS5_WORKER_AFFINITY=1 APS5_PIPELINE_DISPATCH=1:
    • In one run, APS5_AB=20:APS5_NO_DISPATCH_RELOCATION+APS5_NO_MOVED_RECIPES (start 60 s, settle 5 s): frame time 85.6 ms with both on against 87.4 ms with both off, the mean of 8 phases each; on was faster in 7 of 8 pairs.
    • Separate runs alternating main and this branch, mean p50 over 60-180 s: main 96.4 and 96.9 ms, this branch 95.4 and 94.3 ms. GPU busy per present was the same, about 61 ms.
    • Profiled run: about 17,800 entries relocated per 10 s, and value-equal dispatch-cache hits rose from about 2,400 to about 20,800 per 10 s. The screen renders the same, and there was no driver error or device loss.
  • tools/trace_digest.py of the second main and branch runs, intervals 7-18 (60-181 s):

main (e481b13555):

# seconds presents p50 p90 p99 GPU busy busiest worker
7 60-70 101 97.9 109.4 120.2 62.1 95 %
8 70-80 103 97.6 101.6 111.1 62.6 96 %
9 80-90 102 97.2 103.6 108.1 61.3 95 %
10 90-100 101 98.4 106.2 112.2 62.0 95 %
11 100-111 102 97.8 103.0 108.3 62.7 96 %
12 111-121 102 97.6 102.8 110.2 61.6 95 %
13 121-131 103 96.9 102.3 107.3 60.8 95 %
14 131-141 103 97.0 100.5 108.6 60.8 95 %
15 141-151 103 96.2 101.5 113.5 61.3 95 %
16 151-161 104 96.5 100.4 106.4 61.0 95 %
17 161-171 104 96.1 99.9 107.1 60.9 95 %
18 171-181 104 95.8 101.7 111.4 61.4 95 %

This branch:

# seconds presents p50 p90 p99 GPU busy busiest worker
7 60-70 103 95.6 104.7 116.2 62.3 95 %
8 70-80 104 95.3 102.7 113.7 62.2 95 %
9 80-91 104 95.7 101.9 111.8 62.3 95 %
10 91-101 105 94.9 98.8 104.0 62.6 95 %
11 101-111 104 94.9 99.6 110.1 62.1 95 %
12 111-121 105 94.6 102.5 108.0 62.3 95 %
13 121-131 105 93.8 101.7 110.8 60.4 95 %
14 131-141 105 94.7 101.8 115.1 62.0 95 %
15 141-151 106 93.8 100.4 109.2 60.7 95 %
16 151-161 106 93.9 97.5 103.9 61.1 95 %
17 161-171 106 93.1 98.5 106.0 61.0 95 %
18 171-181 107 93.1 99.1 103.5 61.1 95 %

Not tested: Linux, macOS, AMD and Intel GPUs, other titles.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 4080, NVIDIA 621.01, Windows 11 (10.0.26300)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5421245584 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/24661). Originally posted by [bagodees](https://github.com/bagodees) on 2026-11-20T22:34:41Z. --- ### What A dispatch whose key is not in the dispatch cache now copies the entry of a recent dispatch of the same program when only its user-data pointers, or the buffer descriptors behind them or in user data, moved. Before, every such dispatch took the uncached path. With `APS5_PIPELINE_DISPATCH=1` that path also drains the draw committer. Titles that keep their per-frame constants in a ring buffer move these pointers every frame. In PPSA01494 the SRT pointer in `user[12]` advances 0x20000 per frame, and the constant buffer descriptors inside it move with it. So nearly every dispatch missed: about 23,000 inserts and 2,400 hits per 10 s. - **Relocation** (`DispatchRelocate.cpp`): an inserted dispatch records its user data as a donor, up to 8 per program. On a miss, at most two donors whose differing user words are relocatable pointers (`asBase` and not `asValue`), or the base of a buffer descriptor in user data that a `GuestBuffers` binding holds, are tried. - The runs read through a moved pointer are read at their new address and compared word by word. - A word may differ only in the base of a buffer descriptor whose other words are unchanged. The runs read through such a descriptor move with it and are compared the same way. - The copy patches the forwarded user words and the moved descriptors in the compiled result. - It is refused when a moved value is still held anywhere else in the result, a descriptor moves in a program with an address table, or a run straddles a moved descriptor's range. - The ordinary validation then compares every run of the copy with memory before it is used, so a wrong guess becomes the usual miss. The guest-memory reads happen outside the dispatch-cache lock. - **Moved-buffer recipes** (`VulkanDevice.cpp`): a dispatch recipe is now also built when the template served moved read-only buffers, marked `movesBuffers`. Such a recipe hit runs `MovedDispatchBuffers` and binds them through `PrepareDrawBindings`, as the template path does, and rebuilds when they cannot move. A relocated copy of a recipe carries the patched push words. - **Run accesses** (`ShaderResources::MovedRunAccesses`): a dispatch recorded with moved in-place bindings reports their new ranges to the overlap runs. The template's old range is left out when no unmoved binding reads it. Before, a moved dispatch reported the ranges the template was built at. - `APS5_NO_DISPATCH_RELOCATION` and `APS5_NO_MOVED_RECIPES` are runtime switches, so `APS5_AB` can toggle both within one run. With `APS5_PROFILE_DRAW` a `[dispatch-relocate]` line counts each outcome per 10 s. - `agc_driver_dispatch_relocation` dispatches one program through a table that moves with the same contents, then with its input buffer moved, then with the buffer resized. It checks the results and that the first two were served by relocated entries and the third was not. - `image_table_vouched_lookups` turns relocation off for its scenario: it tests the capture path's column reuse for an SRT moved with the same contents, which relocation now serves as a hit. Overlap: `tools/pr_overlap.py --branch` found no conflicting lines and no shared exports; it could not compare 108 open PRs that conflict with `main` themselves. Of those, none relocates dispatch-cache entries. #21780 adds the template's data buffer inside `ShaderResources::RunAccesses`, next to the `recordDispatch` line where this PR adds `MovedRunAccesses`; the two are independent. ### Tested Windows 11 (10.0.26300), Intel Core i9-12900K, NVIDIA GeForce RTX 4080 (NVIDIA 621.01), WinLibs GCC 15.2, Release, on `main` `e481b13555`. - Focused tests on `main` and on this branch, same machine and GPU, with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` and `VK_LOADER_DEBUG=layer` (Vulkan SDK layer 1.4.363). Command: `ctest --test-dir build -R "^agc_driver_.*(dispatch|relocation|recipe|overlap)|^agc_driver_graphics$|^agc_relocation_runs$" -V`. - `main`: 41/41 passed. - This branch: 42/42 passed (the 41 plus `agc_driver_dispatch_relocation`). - Both logs show `Insert instance layer "VK_LAYER_KHRONOS_validation"` (68 and 70 times), neither has `was not found but was requested by env var VK_INSTANCE_LAYERS`, and neither has a `VUID-` error. - `ctest -R "^agc_driver"` (1462 tests) on this branch: all pass except five that fail the same way on `main` on this machine: `agc_driver_image_plane_address_on_line`, `agc_driver_image_sample_lod_clamp`, `agc_driver_image_sample_lod_clamp_shader_lane`, `agc_driver_stencil_plane_memory` and `agc_driver_msaa_dcc_unwatch`. `agc_driver_store_over_untracked` passes and fails intermittently on both (2 of 4 runs failed on `main`). - PPSA01494 (Borderlands 4) 01.050.000, first-run Accessibility screen, 3840x2160, `APS5_WORKER_AFFINITY=1 APS5_PIPELINE_DISPATCH=1`: - In one run, `APS5_AB=20:APS5_NO_DISPATCH_RELOCATION+APS5_NO_MOVED_RECIPES` (start 60 s, settle 5 s): frame time 85.6 ms with both on against 87.4 ms with both off, the mean of 8 phases each; on was faster in 7 of 8 pairs. - Separate runs alternating `main` and this branch, mean p50 over 60-180 s: `main` 96.4 and 96.9 ms, this branch 95.4 and 94.3 ms. GPU busy per present was the same, about 61 ms. - Profiled run: about 17,800 entries relocated per 10 s, and value-equal dispatch-cache hits rose from about 2,400 to about 20,800 per 10 s. The screen renders the same, and there was no driver error or device loss. - `tools/trace_digest.py` of the second `main` and branch runs, intervals 7-18 (60-181 s): `main` (`e481b13555`): | # | seconds | presents | p50 | p90 | p99 | GPU busy | busiest worker | |---|---|---|---|---|---|---|---| | 7 | 60-70 | 101 | 97.9 | 109.4 | 120.2 | 62.1 | 95 % | | 8 | 70-80 | 103 | 97.6 | 101.6 | 111.1 | 62.6 | 96 % | | 9 | 80-90 | 102 | 97.2 | 103.6 | 108.1 | 61.3 | 95 % | | 10 | 90-100 | 101 | 98.4 | 106.2 | 112.2 | 62.0 | 95 % | | 11 | 100-111 | 102 | 97.8 | 103.0 | 108.3 | 62.7 | 96 % | | 12 | 111-121 | 102 | 97.6 | 102.8 | 110.2 | 61.6 | 95 % | | 13 | 121-131 | 103 | 96.9 | 102.3 | 107.3 | 60.8 | 95 % | | 14 | 131-141 | 103 | 97.0 | 100.5 | 108.6 | 60.8 | 95 % | | 15 | 141-151 | 103 | 96.2 | 101.5 | 113.5 | 61.3 | 95 % | | 16 | 151-161 | 104 | 96.5 | 100.4 | 106.4 | 61.0 | 95 % | | 17 | 161-171 | 104 | 96.1 | 99.9 | 107.1 | 60.9 | 95 % | | 18 | 171-181 | 104 | 95.8 | 101.7 | 111.4 | 61.4 | 95 % | This branch: | # | seconds | presents | p50 | p90 | p99 | GPU busy | busiest worker | |---|---|---|---|---|---|---|---| | 7 | 60-70 | 103 | 95.6 | 104.7 | 116.2 | 62.3 | 95 % | | 8 | 70-80 | 104 | 95.3 | 102.7 | 113.7 | 62.2 | 95 % | | 9 | 80-91 | 104 | 95.7 | 101.9 | 111.8 | 62.3 | 95 % | | 10 | 91-101 | 105 | 94.9 | 98.8 | 104.0 | 62.6 | 95 % | | 11 | 101-111 | 104 | 94.9 | 99.6 | 110.1 | 62.1 | 95 % | | 12 | 111-121 | 105 | 94.6 | 102.5 | 108.0 | 62.3 | 95 % | | 13 | 121-131 | 105 | 93.8 | 101.7 | 110.8 | 60.4 | 95 % | | 14 | 131-141 | 105 | 94.7 | 101.8 | 115.1 | 62.0 | 95 % | | 15 | 141-151 | 106 | 93.8 | 100.4 | 109.2 | 60.7 | 95 % | | 16 | 151-161 | 106 | 93.9 | 97.5 | 103.9 | 61.1 | 95 % | | 17 | 161-171 | 106 | 93.1 | 98.5 | 106.0 | 61.0 | 95 % | | 18 | 171-181 | 107 | 93.1 | 99.1 | 103.5 | 61.1 | 95 % | Not tested: Linux, macOS, AMD and Intel GPUs, other titles. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 4080, NVIDIA 621.01, Windows 11 (10.0.26300) - [x] AI-assisted: yes
MarcZX10 commented 2026-11-20 23:08:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T23:08:54Z.

Review: COMMENTED


Reviewed — comments

The review is incomplete because not all changed files were read and no checks were run; no concrete blocking defect was verified.

What I ran

  • Inspected the prepared diff and targeted repository context at head 7544a2b95195542bb25db796f10af4afffa006ec using the review reader.
  • No tests or builds were run.

Results

Check Result Note
Diff and targeted code inspection passed Reviewed selected dispatch relocation and buffer movement paths
Tests and build not run No execution environment available

Findings

Blocking

None verified in the code inspected.

Non-blocking

None.

Not verified

The full text of all changed files was not read. In particular, the changed VulkanDevice.cpp and ShaderResources.cpp were inspected only around relevant hunks, and the remaining changed files were not all inspected. No build, tests, negative control, other operating systems, hardware, or console behavior was verified. The author-reported test and performance results in the description were not independently run.

To get this to a good state

Nothing is required. Optional: complete review of the remaining changed-file content and run the focused checks on this head before making a formal approval decision.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6000582777 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/24661#pullrequestreview-6000582777). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T23:08:54Z. **Review:** COMMENTED --- # Reviewed — comments The review is incomplete because not all changed files were read and no checks were run; no concrete blocking defect was verified. ## What I ran - Inspected the prepared diff and targeted repository context at head `7544a2b95195542bb25db796f10af4afffa006ec` using the review reader. - No tests or builds were run. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted code inspection | passed | Reviewed selected dispatch relocation and buffer movement paths | | Tests and build | not run | No execution environment available | ## Findings ### Blocking None verified in the code inspected. ### Non-blocking None. ## Not verified The full text of all changed files was not read. In particular, the changed `VulkanDevice.cpp` and `ShaderResources.cpp` were inspected only around relevant hunks, and the remaining changed files were not all inspected. No build, tests, negative control, other operating systems, hardware, or console behavior was verified. The author-reported test and performance results in the description were not independently run. ## To get this to a good state Nothing is required. Optional: complete review of the remaining changed-file content and run the focused checks on this head before making a formal approval decision.
MarcZX10 commented 2026-11-21 07:00:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T07:00:53Z.

Review: COMMENTED


Reviewed — comments

Changes are not ready for a formal decision because the review bundle omitted full text for two changed files, leaving recipe buffer movement and moved-range overlap behavior unverified.

What I ran

Reviewed head 6a4e13379d525727fb3351d08833d4dacdf6cea9 from the prepared diff and targeted source context. I did not run commands or tests. The author reports Windows 11, GCC 15.2, Vulkan focused tests (42/42 passed), broader driver tests with five known baseline failures, and PPSA01494 measurements; these were not run by me.

Files read: review/description.md, review/commits.md, review/manifest.json, review/diff.patch, core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp, core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/DispatchInsert.cpp, and core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/DispatchRelocate.cpp.

Results

Check Result Note
Diff and targeted source review passed Relocation path inspected
Tests not run Author supplied results only
Complete changed-file review not run Two changed source files were excluded

Findings

Blocking

None verified.

Non-blocking

None.

Not verified

Full text was excluded for core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp and core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp. Their diff hunks were reviewed, but their surrounding implementations and callers were not. Other included changed files were listed in the manifest but not all were read in full. No tests were run.

To get this to a good state

Nothing is required. Optional: complete review of the excluded files and run the reported focused checks on this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6003682512 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/24661#pullrequestreview-6003682512). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T07:00:53Z. **Review:** COMMENTED --- # Reviewed — comments Changes are not ready for a formal decision because the review bundle omitted full text for two changed files, leaving recipe buffer movement and moved-range overlap behavior unverified. ## What I ran Reviewed head `6a4e13379d525727fb3351d08833d4dacdf6cea9` from the prepared diff and targeted source context. I did not run commands or tests. The author reports Windows 11, GCC 15.2, Vulkan focused tests (42/42 passed), broader driver tests with five known baseline failures, and PPSA01494 measurements; these were not run by me. Files read: `review/description.md`, `review/commits.md`, `review/manifest.json`, `review/diff.patch`, `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp`, `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/DispatchInsert.cpp`, and `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/DispatchRelocate.cpp`. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted source review | passed | Relocation path inspected | | Tests | not run | Author supplied results only | | Complete changed-file review | not run | Two changed source files were excluded | ## Findings ### Blocking None verified. ### Non-blocking None. ## Not verified Full text was excluded for `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` and `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`. Their diff hunks were reviewed, but their surrounding implementations and callers were not. Other included changed files were listed in the manifest but not all were read in full. No tests were run. ## To get this to a good state Nothing is required. Optional: complete review of the excluded files and run the reported focused checks on this head.
ligmaSec commented 2026-12-03 19:04:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T19:04:07Z.

Review: COMMENTED


Please reject a relocation when two user-data descriptors with the same donor value move to different destinations. In relocateDispatchEntry, userDescriptors deduplicates by held.from, so it keeps the first destination and accepts the second descriptor as a fit. ReplaceDescriptor then sends every matching guest-buffer binding to the first destination. A shader that originally reads two slots backed by the same buffer can therefore keep reading one buffer after the caller rebinds the slots to two different buffers. The old low-word check cannot catch this once the first replacement has removed that value from the compiled bindings. The captured-table comparison already rejects a conflicting destination for the same source. The direct user-data path needs the equivalent check, including slots whose descriptor stays at its original address.

Source inspection at 6a4e13379d. This head also conflicts with the main revision I checked.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6176533558 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/24661#pullrequestreview-6176533558). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T19:04:07Z. **Review:** COMMENTED --- Please reject a relocation when two user-data descriptors with the same donor value move to different destinations. In `relocateDispatchEntry`, `userDescriptors` deduplicates by `held.from`, so it keeps the first destination and accepts the second descriptor as a fit. `ReplaceDescriptor` then sends every matching guest-buffer binding to the first destination. A shader that originally reads two slots backed by the same buffer can therefore keep reading one buffer after the caller rebinds the slots to two different buffers. The old low-word check cannot catch this once the first replacement has removed that value from the compiled bindings. The captured-table comparison already rejects a conflicting destination for the same source. The direct user-data path needs the equivalent check, including slots whose descriptor stays at its original address. Source inspection at `6a4e13379d`. This head also conflicts with the main revision I checked. AI-assisted: yes.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/24661:upstream-pr/24661'
git switch 'upstream-pr/24661'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/24661'
git switch 'upstream-pr/24661'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/24661'
git switch 'upstream-pr/24661'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/24661'
git switch 'main'
git merge --squash 'upstream-pr/24661'
git switch 'main'
git merge --ff-only 'upstream-pr/24661'
git switch 'main'
git merge 'upstream-pr/24661'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!24661
No description provided.