fix(shader): defer unsupported descriptor web arms to lane faults #14904

Merged
JJenkx merged 4 commits from upstream-pr/14904 into main 2026-11-15 19:25:10 +00:00
JJenkx commented 2026-11-02 00:03:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-11-02T00:03:58Z.


What

A mixed descriptor web currently fails to compile when one arm contains a buffer-loaded word or another value the planner cannot rematerialize, even when an enabled lane selects a supported arm. Extend the existing folded-arm sentinel to those leaves: supported arms retain their descriptors, and an enabled lane selecting an unsupported arm records the existing InvalidDescriptor BDA fault. Empty EXEC produces no read/fault.

Current head 5924ed8f31fa59ab3c930e2787215d1420d19795 is a merge commit with parents prior public head d401129adc12d162902a54aab90e8bb635c8b1ff and main b11c7bf84f5d2f636ff60166cc3371bd071e24d5; the branch push was a normal fast-forward and all prior topic history is retained. The sole manual conflict keeps both the deferred-sampler cache fixture and main’s complete nested-image-table fixture, with its group-ID assignment still attached to the nested fixture. The authored production patch from prior head a972e5492ef4 is preserved on top of main; the complete files also include main’s intervening changes. #12132 merged on 2026-11-03 as 81605d59ec68e4cbff43ac7cdd93243bc5897580, so it is no longer an open dependency. It adds eight buffer-data image/sampler execution cases and extends the fallback. Integration order was proposed at https://github.com/boykopovar/AnyPS5/pull/12132#issuecomment-6565805886 . The earlier overlap scan reported #9897/#14032 (vertex/instance buffer extents) and #10556 (unset-format images): their shared test insertion points are inherited from #12132; they do not implement this fallback. Those historical shared-file comparison limits remain attributed to that scan; this is not a fresh overlap-scan result for the merge head.

The NVIDIA report on the preceding head caught a cache test still expecting the newly supported mixed sampler path to fail preparation. That shader is now a positive cache fixture, including plan encoding, randomized materialization and fresh-process reloads. A truncated instruction retains the independent check that failed preparation writes no plan. Production behavior is unchanged by this test correction.

Arbitrary GPU-generated descriptors remain unsupported. A web with no rebuildable arm, over 512 states or over 64 descriptors still fails; APS5_STRICT_DESCRIPTOR_WEBS retains strict compile-time rejection. The merged debt entry combines main’s descriptor-web entry with this fallback: non-rematerializable dwords, including buffer memory and image gather/atomic results, use the existing folded arm when strict mode is off. The assumption that such a path does not reach the read is unproven; selecting it records an InvalidDescriptor BDA fault. This is no claim of console equivalence, a title unblock or FPS gain.

Tested

Current Linux qualification (2026-11-04): exact public merge head 5924ed8f31fa59ab3c930e2787215d1420d19795 and main b11c7bf84f5d2f636ff60166cc3371bd071e24d5, separate source/build directories, Release, GCC 16.2.1, bundled SPIRV-Tools. The production topic patch is unchanged; both conflicting fixture blocks are retained byte-for-byte. All 26 direct dependency clones in each bank match prescribed gitlinks. Conventions and whitespace pass.

On each arm, CPU agc_shader_memory and agc_shader_disk_cache run three times (6/6), and GPU agc_driver_descriptor_web_faults runs three times (3/3): 9/9 per arm, zero skips. GPU: RX 6650 XT, RADV Mesa 26.2.6, kernel 7.2.11, Khronos layer 1.4.363, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1; each physical execution logs an actual Khronos instance and device insertion. Zero VUIDs. Whole GPU harnesses used the shared Linux FIFO (tickets 3819/3820).

Production-only controls retain the new tests and restore main’s ResourceTracker.cpp: the CPU cache group fails at the deferred sampler GetSamplerResource/LoadAddressU32@pc=0x28; the GPU group fails at the unsupported ReadConstBuffer@pc=0x44. Exact source restoration/rebuild passes CPU 6/6 and GPU 3/3 again, with all recorded source/test-binary/library hashes identical to initial candidate. Main’s public-header audit also passes (406 libraries, 28,350 exports); this topic has no public-header delta.

Evidenced source preservation, providers, raw builds/logs/JUnit, actual validation-layer insertions, controls and restored hashes, SHA-256 6a16feeae5fbb33d119a1e26e233f827b48fbeb4e49de5f9803469ee1a2cbc6d; downloaded bytes and all 62 manifest members verified. No new Windows, title, performance, console or full-suite measurement. Earlier Windows/Linux reports retain their original pins and limits below.

Historical Windows owner-reported materialized-composition check (2026-11-03): Windows 11 Enterprise 22621, Radeon RX 6700 XT / AMDVLK, GCC 15.2 UCRT r7, Release, validation layer 1.4.363. On main 4f41f4c375 plus only the added descriptor-web GPU fixtures, agc_driver_descriptor_web_faults fails as expected at the unsupported ReadConstBuffer@pc=0x44 path. Applying the unchanged production/cache-test topic patch makes that same group pass once, with no skips or VUID IDs. Both physical arms used the Windows FIFO and ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1; each raw log shows one actual Khronos instance and one device insertion, and terminal receipts show no leftover app/test/job processes.

The candidate was labeled candidate-a972 before the merge existed. Its materialization is main 4f41f4c375 plus code-only commits 6dc20756b3 and a972e5492e; independently applying those patches reproduces the four public d401129adc code/test files byte-for-byte, with no other core/ difference. Only the debt text differs from that tested tree. This is source/composition equivalence, not a retained candidate-binary fingerprint: candidate SHA-256s and provider/input manifests were not captured before restoration; the main-arm JUnit was overwritten. The owner reports shader-memory/cache host checks passed, but their raw log was not retained, so those are not presented as an audited new pass. Restoration to clean main and rebuild logs are retained. Earlier Linux controls below keep their original pins and stronger recorded fingerprints; no new full suite, title, performance or console result is claimed.

Retained Linux qualification (original pins):

Linux, AMD Radeon RX 6650 XT, RADV Mesa 26.2.6; validation layer 1.4.363. Same focused command on every arm:

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer \
ctest --test-dir build -R '^agc_(shader_memory|driver_descriptor_web_faults)$' --no-tests=error -V
  • Main 66e1f7f993c9: 2/2 pass, original fixtures.
  • Main plus #12132: 2/2 pass, original/peer fixtures.
  • The same peer baseline plus only the eight new buffer-data GPU cases: expected GPU failure at ReadConstBuffer@pc=0x00000044; CPU group passes. This separates the remaining gap from #12132.
  • This change: 2/2 pass, including both supported texture outputs, selected unsupported image/sampler faults at PC 0x50, empty-EXEC suppression, and dynamic sampler resource planning, capture, recompilation and SPIR-V validation.
  • Fault-suppression mutant: returning arm zero instead of the new sentinel makes the enabled buffer-data assertion fail. Restored candidate: 2/2 pass.

Actual instance and device validation layers were loaded; zero skipped tests and zero VUIDs on every arm. The recorded Linux gates retain their unchanged source/binary/library hashes; the separately scoped Windows report above has its stated fingerprint limits. Public synthetic fixtures, logs and control patches are attached below; proprietary requests/IR are excluded.
Historical cache feedback verification on main 93dbd0f82aea plus this PR: the old assertion reproduced locally; the corrected agc_shader_disk_cache passes, including 18 stored plans and the new deferred sampler case (505/1000 randomized runtimes materialized). Removing only this PR's production ResourceTracker change makes the new positive fixture fail at GetSamplerResource / LoadAddressU32@pc=0x28; restoring it passes. This cache suite is CPU-only, tested with VK_DRIVER_FILES=/nonexistent/icd.json; no GPU result is inferred from it. The earlier paired AMD GPU evidence above remains for the unchanged production change and GPU fixtures on main 66e1f7f993c9, not a fresh GPU run on current main. The updated public head merged onto 93dbd0f82aea has exactly the locally tested tree 6e5ef8be7c52bdbde071c3edde6ea63e89112917.

Evidence: synthetic logs, fixtures and controls, SHA-256 c7ea6fea669de2584724ba30933ffc63760069390956f029e8173693da9520b5. The tested restored candidate was 054b2fb79006 (full hash in the archive); no new VUIDs and 2/2 groups pass.

Cache feedback evidence: reproduction, negative control, restored run and tree proof, SHA-256 fd44b2e2b4340d703d4529b3b16ed049ab39bd63c175fd14af127e3a45ac6115.

External historical NVIDIA validation (RTX 2000 Ada, driver 595.99.02, Ubuntu): Release build passes; 2,441 tests pass, six failures are also present or unstable on main, 45 skips, zero new failures. The paired report covers 930 GPU tests and counts no new validation IDs. It records one intermittent depth-clear validation message that did not reproduce in two isolated reruns. This is contributor-run evidence on its own recorded pins, distinct from upstream CI and not a new NVIDIA run of merge head d401129adc.

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
  • 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 (#12132 merged 2026-11-03)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 6650 XT; RADV Mesa 26.2.6; Arch Linux, kernel 7.2.11-arch1-1; Windows owner-reported materialized-composition check: Radeon RX 6700 XT / AMDVLK, Windows 11 22621 (limits above)
  • AI-assisted: yes

Windows owner receipt bundle: raw FIFO logs, composition proof and stated evidence limits, SHA-256 1b4d17343c303bf32a1793621aac880ab62beded87351f23535da064b70fe514.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5112899057 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14904). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-11-02T00:03:58Z. --- ### What A mixed descriptor web currently fails to compile when one arm contains a buffer-loaded word or another value the planner cannot rematerialize, even when an enabled lane selects a supported arm. Extend the existing folded-arm sentinel to those leaves: supported arms retain their descriptors, and an enabled lane selecting an unsupported arm records the existing InvalidDescriptor BDA fault. Empty EXEC produces no read/fault. Current head `5924ed8f31fa59ab3c930e2787215d1420d19795` is a merge commit with parents prior public head `d401129adc12d162902a54aab90e8bb635c8b1ff` and main `b11c7bf84f5d2f636ff60166cc3371bd071e24d5`; the branch push was a normal fast-forward and all prior topic history is retained. The sole manual conflict keeps both the deferred-sampler cache fixture and main’s complete nested-image-table fixture, with its group-ID assignment still attached to the nested fixture. The authored production patch from prior head `a972e5492ef4` is preserved on top of main; the complete files also include main’s intervening changes. #12132 merged on 2026-11-03 as `81605d59ec68e4cbff43ac7cdd93243bc5897580`, so it is no longer an open dependency. It adds eight buffer-data image/sampler execution cases and extends the fallback. Integration order was proposed at https://github.com/boykopovar/AnyPS5/pull/12132#issuecomment-6565805886 . The earlier overlap scan reported #9897/#14032 (vertex/instance buffer extents) and #10556 (unset-format images): their shared test insertion points are inherited from #12132; they do not implement this fallback. Those historical shared-file comparison limits remain attributed to that scan; this is not a fresh overlap-scan result for the merge head. The NVIDIA report on the preceding head caught a cache test still expecting the newly supported mixed sampler path to fail preparation. That shader is now a positive cache fixture, including plan encoding, randomized materialization and fresh-process reloads. A truncated instruction retains the independent check that failed preparation writes no plan. Production behavior is unchanged by this test correction. Arbitrary GPU-generated descriptors remain unsupported. A web with no rebuildable arm, over 512 states or over 64 descriptors still fails; `APS5_STRICT_DESCRIPTOR_WEBS` retains strict compile-time rejection. The merged debt entry combines main’s descriptor-web entry with this fallback: non-rematerializable dwords, including buffer memory and image gather/atomic results, use the existing folded arm when strict mode is off. The assumption that such a path does not reach the read is unproven; selecting it records an `InvalidDescriptor` BDA fault. This is no claim of console equivalence, a title unblock or FPS gain. ### Tested **Current Linux qualification (2026-11-04):** exact public merge head `5924ed8f31fa59ab3c930e2787215d1420d19795` and main `b11c7bf84f5d2f636ff60166cc3371bd071e24d5`, separate source/build directories, Release, GCC 16.2.1, bundled SPIRV-Tools. The production topic patch is unchanged; both conflicting fixture blocks are retained byte-for-byte. All 26 direct dependency clones in each bank match prescribed gitlinks. Conventions and whitespace pass. On each arm, CPU `agc_shader_memory` and `agc_shader_disk_cache` run three times (**6/6**), and GPU `agc_driver_descriptor_web_faults` runs three times (**3/3**): **9/9 per arm, zero skips**. GPU: RX 6650 XT, RADV Mesa 26.2.6, kernel 7.2.11, Khronos layer 1.4.363, `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`; each physical execution logs an actual Khronos instance and device insertion. **Zero VUIDs**. Whole GPU harnesses used the shared Linux FIFO (tickets 3819/3820). Production-only controls retain the new tests and restore main’s `ResourceTracker.cpp`: the CPU cache group fails at the deferred sampler `GetSamplerResource`/`LoadAddressU32@pc=0x28`; the GPU group fails at the unsupported `ReadConstBuffer@pc=0x44`. Exact source restoration/rebuild passes CPU **6/6** and GPU **3/3** again, with all recorded source/test-binary/library hashes identical to initial candidate. Main’s public-header audit also passes (406 libraries, 28,350 exports); this topic has no public-header delta. [Evidenced source preservation, providers, raw builds/logs/JUnit, actual validation-layer insertions, controls and restored hashes](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/pr14904-5924ed8f-mainb11-paired-linux-20261104.tar.gz), SHA-256 `6a16feeae5fbb33d119a1e26e233f827b48fbeb4e49de5f9803469ee1a2cbc6d`; downloaded bytes and all 62 manifest members verified. No new Windows, title, performance, console or full-suite measurement. Earlier Windows/Linux reports retain their original pins and limits below. **Historical Windows owner-reported materialized-composition check (2026-11-03):** Windows 11 Enterprise 22621, Radeon RX 6700 XT / AMDVLK, GCC 15.2 UCRT r7, Release, validation layer 1.4.363. On main `4f41f4c375` plus only the added descriptor-web GPU fixtures, `agc_driver_descriptor_web_faults` fails as expected at the unsupported `ReadConstBuffer@pc=0x44` path. Applying the unchanged production/cache-test topic patch makes that same group pass once, with no skips or VUID IDs. Both physical arms used the Windows FIFO and `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`; each raw log shows one actual Khronos instance and one device insertion, and terminal receipts show no leftover app/test/job processes. The candidate was labeled `candidate-a972` before the merge existed. Its materialization is main `4f41f4c375` plus code-only commits `6dc20756b3` and `a972e5492e`; independently applying those patches reproduces the four public `d401129adc` code/test files byte-for-byte, with no other `core/` difference. Only the debt text differs from that tested tree. This is source/composition equivalence, not a retained candidate-binary fingerprint: candidate SHA-256s and provider/input manifests were not captured before restoration; the main-arm JUnit was overwritten. The owner reports shader-memory/cache host checks passed, but their raw log was not retained, so those are not presented as an audited new pass. Restoration to clean main and rebuild logs are retained. Earlier Linux controls below keep their original pins and stronger recorded fingerprints; no new full suite, title, performance or console result is claimed. **Retained Linux qualification (original pins):** Linux, AMD Radeon RX 6650 XT, RADV Mesa 26.2.6; validation layer 1.4.363. Same focused command on every arm: ```sh ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer \ ctest --test-dir build -R '^agc_(shader_memory|driver_descriptor_web_faults)$' --no-tests=error -V ``` - Main `66e1f7f993c9`: 2/2 pass, original fixtures. - Main plus #12132: 2/2 pass, original/peer fixtures. - The same peer baseline plus only the eight new buffer-data GPU cases: expected GPU failure at `ReadConstBuffer@pc=0x00000044`; CPU group passes. This separates the remaining gap from #12132. - This change: 2/2 pass, including both supported texture outputs, selected unsupported image/sampler faults at PC 0x50, empty-EXEC suppression, and dynamic sampler resource planning, capture, recompilation and SPIR-V validation. - Fault-suppression mutant: returning arm zero instead of the new sentinel makes the enabled buffer-data assertion fail. Restored candidate: 2/2 pass. Actual instance and device validation layers were loaded; zero skipped tests and zero VUIDs on every arm. The recorded Linux gates retain their unchanged source/binary/library hashes; the separately scoped Windows report above has its stated fingerprint limits. Public synthetic fixtures, logs and control patches are attached below; proprietary requests/IR are excluded. Historical cache feedback verification on main `93dbd0f82aea` plus this PR: the old assertion reproduced locally; the corrected `agc_shader_disk_cache` passes, including 18 stored plans and the new deferred sampler case (505/1000 randomized runtimes materialized). Removing only this PR's production ResourceTracker change makes the new positive fixture fail at `GetSamplerResource` / `LoadAddressU32@pc=0x28`; restoring it passes. This cache suite is CPU-only, tested with `VK_DRIVER_FILES=/nonexistent/icd.json`; no GPU result is inferred from it. The earlier paired AMD GPU evidence above remains for the unchanged production change and GPU fixtures on main `66e1f7f993c9`, not a fresh GPU run on current main. The updated public head merged onto `93dbd0f82aea` has exactly the locally tested tree `6e5ef8be7c52bdbde071c3edde6ea63e89112917`. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Evidence: [synthetic logs, fixtures and controls](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/descriptor-buffer-followup-linux-20261101.tar.gz), SHA-256 `c7ea6fea669de2584724ba30933ffc63760069390956f029e8173693da9520b5`. The tested restored candidate was `054b2fb79006` (full hash in the archive); no new VUIDs and 2/2 groups pass. Cache feedback evidence: [reproduction, negative control, restored run and tree proof](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/pr14904-cache-feedback-linux-20261101.tar.gz), SHA-256 `fd44b2e2b4340d703d4529b3b16ed049ab39bd63c175fd14af127e3a45ac6115`. External [historical NVIDIA validation](https://github.com/boykopovar/AnyPS5/pull/14904#issuecomment-6567736253) (RTX 2000 Ada, driver 595.99.02, Ubuntu): Release build passes; 2,441 tests pass, six failures are also present or unstable on main, 45 skips, zero new failures. The paired report covers 930 GPU tests and counts no new validation IDs. It records one intermittent depth-clear validation message that did not reproduce in two isolated reruns. This is contributor-run evidence on its own recorded pins, distinct from upstream CI and not a new NVIDIA run of merge head `d401129adc`. ### 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) - [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 (#12132 merged 2026-11-03) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: AMD Radeon RX 6650 XT; RADV Mesa 26.2.6; Arch Linux, kernel 7.2.11-arch1-1; Windows owner-reported materialized-composition check: Radeon RX 6700 XT / AMDVLK, Windows 11 22621 (limits above) - [x] AI-assisted: yes Windows owner receipt bundle: [raw FIFO logs, composition proof and stated evidence limits](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/pr14904-d401-windows-owner-receipts-20261103.tar.gz), SHA-256 `1b4d17343c303bf32a1793621aac880ab62beded87351f23535da064b70fe514`.
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!14904
No description provided.