test(shader): pin MIMG tfe and lwe status registers as measured on gfx1036 #24954

Merged
Jirka135 merged 1 commit from upstream-pr/24954 into main 2026-11-27 15:34:54 +00:00
Jirka135 commented 2026-11-21 12:50:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Jirka135 on 2026-11-21T12:50:32Z.


What

Test-only: pins the MIMG tfe/lwe status VGPR as measured on RDNA2 and records the measurement in the debt entry for RdnaImageOpDecoder.cpp.

Measured on gfx1036 (AMD Windows driver 32.0.21045.29003) with the hardware oracle, wave32 and wave64: the VGPR after the data is never written (keeps its old value) for tfe, lwe and both, on image_load, image_load_mip, image_sample_lz, image_sample_l, image_gather4_lz, image_get_resinfo, image_get_lod and image_store (also d16, dmask 3 and 9), for in-bounds and out-of-bounds texels, mips past the last level, and a T# MIN_LOD_WARN of 1.0 or 15.99 above an LOD of 0. The debt entry previously said lwe on sample/gather writes it when the LOD is below MIN_LOD_WARN; that did not happen on gfx1036. The recompiler's output, run through agc_oracle_runner (HW_ORACLE_RUNTIME=vulkan) on an RTX 5090 and on gfx1036, matches.

The new ImageTexelStatusBounds execution test pre-fills the status registers with 0xdeadbeef and checks data and status for 32 results per lane plus the texels written by image_store tfe, for both MIN_LOD_WARN values in wave32, wave64 and wave64 split. It complements the existing wave32 ImageTexelStatus test.

Still unmeasured: a fetch from an unmapped page of a partially resident texture, and the PS5's gfx1013.

Side observation, not changed here: on a 1-channel 32_FLOAT texture with DST_SEL Y or W, gfx1036 repeats x where the recompiler returns 0/1.0 (the test uses DST_SEL 0x204).

Tested

Windows 11 Enterprise 10.0.26300, WinLibs GCC 15.2.0, Release, rebased on main 528dfe9438. Per GPU (NVIDIA default, ANYPS5_GPU=AMD), 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_driver_image_texel_status_bounds$' -V: 3 runs with the layer and 1 without before the rebase, 1 with and 1 without after it, all passed. Every layer run logs Insert instance layer "VK_LAYER_KHRONOS_validation" (Khronos validation 1.4.369), none logs was not found, and no log has a VUID- line. Runtime under 1 s per GPU.

check_conventions.py --base upstream/main, check_test_registration.py and pr_overlap.py --branch (no overlap) pass. debt_fold.py --check reports only the existing feat-libwebrtc-rnn-vad.md failure that main also has.

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 5090, driver 617.42, Windows 11; AMD Radeon(TM) Graphics iGPU (gfx1036, 1002:13c0), driver 32.0.21045.29003, Windows 11
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5427980014 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/24954). Originally posted by [Jirka135](https://github.com/Jirka135) on 2026-11-21T12:50:32Z. --- ### What Test-only: pins the MIMG `tfe`/`lwe` status VGPR as measured on RDNA2 and records the measurement in the [debt entry](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/debt/shader.md) for `RdnaImageOpDecoder.cpp`. Measured on gfx1036 (AMD Windows driver 32.0.21045.29003) with the [hardware oracle](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/HW_ORACLE.md), wave32 and wave64: the VGPR after the data is never written (keeps its old value) for `tfe`, `lwe` and both, on `image_load`, `image_load_mip`, `image_sample_lz`, `image_sample_l`, `image_gather4_lz`, `image_get_resinfo`, `image_get_lod` and `image_store` (also `d16`, dmask 3 and 9), for in-bounds and out-of-bounds texels, mips past the last level, and a T# `MIN_LOD_WARN` of 1.0 or 15.99 above an LOD of 0. The debt entry previously said `lwe` on sample/gather writes it when the LOD is below `MIN_LOD_WARN`; that did not happen on gfx1036. The recompiler's output, run through `agc_oracle_runner` (`HW_ORACLE_RUNTIME=vulkan`) on an RTX 5090 and on gfx1036, matches. The new `ImageTexelStatusBounds` execution test pre-fills the status registers with 0xdeadbeef and checks data and status for 32 results per lane plus the texels written by `image_store tfe`, for both `MIN_LOD_WARN` values in wave32, wave64 and wave64 split. It complements the existing wave32 `ImageTexelStatus` test. Still unmeasured: a fetch from an unmapped page of a partially resident texture, and the PS5's gfx1013. Side observation, not changed here: on a 1-channel 32_FLOAT texture with DST_SEL Y or W, gfx1036 repeats x where the recompiler returns 0/1.0 (the test uses DST_SEL 0x204). ### Tested Windows 11 Enterprise 10.0.26300, WinLibs GCC 15.2.0, Release, rebased on `main` 528dfe9438. Per GPU (NVIDIA default, `ANYPS5_GPU=AMD`), `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_driver_image_texel_status_bounds$' -V`: 3 runs with the layer and 1 without before the rebase, 1 with and 1 without after it, all passed. Every layer run logs `Insert instance layer "VK_LAYER_KHRONOS_validation"` (Khronos validation 1.4.369), none logs `was not found`, and no log has a `VUID-` line. Runtime under 1 s per GPU. `check_conventions.py --base upstream/main`, `check_test_registration.py` and `pr_overlap.py --branch` (no overlap) pass. `debt_fold.py --check` reports only the existing `feat-libwebrtc-rnn-vad.md` failure that `main` also has. ### 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 5090, driver 617.42, Windows 11; AMD Radeon(TM) Graphics iGPU (gfx1036, `1002:13c0`), driver 32.0.21045.29003, Windows 11 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-11-21 13:31:00 +00:00 (Migrated from github.com)

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

Review: APPROVED


Reviewed — looks good

The reviewed change adds a focused execution test and debt record; I found no blocking defect in the changed code.

What I ran

Read the prepared diff and both changed files at head eb9961e284cc193fc966e7dee9de5a11949c1fab. No commands or tests were run.

Results

Check Result Note
Changed code review passed Both changed files read
Test execution not run Test results in the description are author-reported

Findings

Blocking

None.

Non-blocking

None.

Not verified

Did not verify test registration, run the new test, or independently confirm the hardware measurements and reported test results. No excluded changed files are listed in the manifest; files.json was unavailable through the reader.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6005494831 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/24954#pullrequestreview-6005494831). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T13:31:00Z. **Review:** APPROVED --- # Reviewed — looks good The reviewed change adds a focused execution test and debt record; I found no blocking defect in the changed code. ## What I ran Read the prepared diff and both changed files at head `eb9961e284cc193fc966e7dee9de5a11949c1fab`. No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Changed code review | passed | Both changed files read | | Test execution | not run | Test results in the description are author-reported | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified Did not verify test registration, run the new test, or independently confirm the hardware measurements and reported test results. No excluded changed files are listed in the manifest; `files.json` was unavailable through the reader. ## To get this to a good state Nothing is required.
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!24954
No description provided.