fix(shader): map image-table entries filled with ones to no record #15611

Merged
XatiX merged 3 commits from upstream-pr/15611 into main 2026-11-15 19:21:45 +00:00
XatiX commented 2026-11-03 21:43:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XatiX on 2026-11-03T21:43:38Z.


What

An image-table entry whose eight words are all 0xffffffff (how an unbound slot is filled) was turned into a poison record, so a lane that selected it read zeros and raised an image-table BDA fault. Each batch then logged it at completion as deferred write-back failed: image table: ... selected the descriptor at ... (words ffffffff ...): invalid format.

Such an entry now maps to no record (NullCode), as an all-zero entry already does. This applies only when the table's image is sampled, read-only and not atomic. A lane that selects it still reads zeros, but no fault is raised, so what the shader produces does not change.

#10556 made a directly bound sampled T# with an unset format (0 or 0x1ff, including the 0xffffffff-filled slots of PPSA02721) decode as null, and kept image-table entries as poison. This PR does not widen that rule. Only an image-table entry with all eight words set is affected, and the TYPE 15 refusal for direct T#s that agc_shader_memory checks is unchanged.

What the console returns for such an entry is not measured. The existing debt entry for unset-format T#s now covers this case. I rewrote it to lead with the gap and to stay under the 1000-character limit; it keeps every rule it stated before.

agc_shader_memory (image tables) gains a step after the null-entry check. It fills that entry with ones and expects NullCode with no expected fault. On main it fails with image tables: an entry filled with ones was mapped to a record or expects a fault.

Tested

  • Windows 11 Pro 26300, NVIDIA GeForce RTX 5080, driver 617.42.
  • ctest -V -R "shader_memory|image_table|shader_replay|type_zero|agc_driver_graphics|bindless" with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1 and ANYPS5_REQUIRE_VULKAN=1, run on the same machine from a clean build of the rebased branch. The image-table and bindless execution tests were built (ANYPS5_AGC_EXECUTION_TESTS, now including ImageTableVariants). The filter selects 18 tests. Each log starts with its tested commit and these variables.
    • This change (e818079123, on main 4d513cadcc): 18/18 passed.
    • main's ResourceMaterializer.cpp (29bcc501b7, the same file as at 4d513cadcc) with the new test: 16/18 passed. Only agc_shader_memory and agc_shader_bindless fail, both at the new check, image tables: an entry filled with ones was mapped to a record or expects a fault; agc_shader_bindless runs the same test binary.
    • Neither log reports the layer as not found, neither has a VUID- error, and nothing was skipped. Logs (candidate, control and build settings): attached to the retest comment.
  • PPSA18653 (Age of Mythology: Retold v01.043) title screen, 100 s run, on a local stack that carries #15327 and #15563. Without this change the log had 78 deferred write-back failed: image table lines, from about 4 pixel shaders selecting entries at 0x3e1240820 and 0x3e1040640. With it there were none, and the screen looks the same.
  • tools/check_conventions.py --base upstream/main and tools/check_main_sync.py pass on the rebased head. tools/pr_overlap.py --branch reports #12790 and #14692 at docs/dev/debt/shader.md L251. Both add their own entries next to this one and do not edit it, so a merge keeps both.

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
  • Fixes: none
  • Unblocks: none (removes image-table faults on PPSA18653's title screen, #15328)
  • GPUs tested: NVIDIA GeForce RTX 5080, driver 617.42, Windows 11 Pro 26300
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5144960700 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15611). Originally posted by [XatiX](https://github.com/XatiX) on 2026-11-03T21:43:38Z. --- ### What An image-table entry whose eight words are all `0xffffffff` (how an unbound slot is filled) was turned into a poison record, so a lane that selected it read zeros and raised an image-table BDA fault. Each batch then logged it at completion as `deferred write-back failed: image table: ... selected the descriptor at ... (words ffffffff ...): invalid format`. Such an entry now maps to no record (`NullCode`), as an all-zero entry already does. This applies only when the table's image is sampled, read-only and not atomic. A lane that selects it still reads zeros, but no fault is raised, so what the shader produces does not change. #10556 made a directly bound sampled T# with an unset format (0 or 0x1ff, including the `0xffffffff`-filled slots of PPSA02721) decode as null, and kept image-table entries as poison. This PR does not widen that rule. Only an image-table entry with all eight words set is affected, and the TYPE 15 refusal for direct T#s that `agc_shader_memory` checks is unchanged. What the console returns for such an entry is not measured. The existing debt entry for unset-format T#s now covers this case. I rewrote it to lead with the gap and to stay under the 1000-character limit; it keeps every rule it stated before. `agc_shader_memory` (image tables) gains a step after the null-entry check. It fills that entry with ones and expects `NullCode` with no expected fault. On `main` it fails with `image tables: an entry filled with ones was mapped to a record or expects a fault`. ### Tested - Windows 11 Pro 26300, NVIDIA GeForce RTX 5080, driver 617.42. - `ctest -V -R "shader_memory|image_table|shader_replay|type_zero|agc_driver_graphics|bindless"` with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1` and `ANYPS5_REQUIRE_VULKAN=1`, run on the same machine from a clean build of the rebased branch. The image-table and bindless execution tests were built (`ANYPS5_AGC_EXECUTION_TESTS`, now including `ImageTableVariants`). The filter selects 18 tests. Each log starts with its tested commit and these variables. - This change (`e818079123`, on `main` `4d513cadcc`): 18/18 passed. - `main`'s `ResourceMaterializer.cpp` (`29bcc501b7`, the same file as at `4d513cadcc`) with the new test: 16/18 passed. Only `agc_shader_memory` and `agc_shader_bindless` fail, both at the new check, `image tables: an entry filled with ones was mapped to a record or expects a fault`; `agc_shader_bindless` runs the same test binary. - Neither log reports the layer as not found, neither has a `VUID-` error, and nothing was skipped. Logs (candidate, control and build settings): attached to [the retest comment](https://github.com/boykopovar/AnyPS5/pull/15611#issuecomment-6653863717). - PPSA18653 (Age of Mythology: Retold v01.043) title screen, 100 s run, on a local stack that carries #15327 and #15563. Without this change the log had 78 `deferred write-back failed: image table` lines, from about 4 pixel shaders selecting entries at `0x3e1240820` and `0x3e1040640`. With it there were none, and the screen looks the same. - `tools/check_conventions.py --base upstream/main` and `tools/check_main_sync.py` pass on the rebased head. `tools/pr_overlap.py --branch` reports #12790 and #14692 at `docs/dev/debt/shader.md` L251. Both add their own entries next to this one and do not edit it, so a merge keeps both. ### Checklist - [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 - [x] Fixes: none - [x] Unblocks: none (removes image-table faults on PPSA18653's title screen, #15328) - [x] GPUs tested: NVIDIA GeForce RTX 5080, driver 617.42, Windows 11 Pro 26300 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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!15611
No description provided.