docs(debt): measure image_get_resinfo level component on 2D MSAA T#s #18467

Merged
brumskysb merged 2 commits from upstream-pr/18467 into main 2026-11-12 18:21:49 +00:00
brumskysb commented 2026-11-11 17:12:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by brumskysb on 2026-11-11T17:12:49Z.


What

Measures two gap clauses of the image_get_resinfo through DIM 1D on a cube, 2D-array or 3D T# entry of docs/dev/debt/shader.md. The first commit (d76f600d4c) closes "the level component for 2, 4 or 8 fragments is not measured". The second commit (7dbd46e5c1) closes the clause the first one left, "wave64 on a 2D MSAA-array T# is not measured", and adds DIM 1D and DIM 2D through a 2D MSAA-array T#, which the entry did not claim either way. The hardware oracle builds the T# by hand and image_get_resinfo never reads the surface, so a multi-fragment TYPE 14/15 descriptor can be queried even though the Vulkan path in #7550 could not bind one.

Measured on gfx1036 (driver 31.0.22044.1) with the hardware oracle. Format 20 (32_UINT), 1024x64 and 256x32, BASE_LEVEL 0. The fragment count is encoded the way the project decodes it: LAST_LEVEL = MAX_MIP = log2(fragments), from GuestTextureResource.cpp (samples = 1u << lastLevel, MAX_MIP in dword5 7:4). Every case ran twice, each time in a fresh process. The rig-side output was deleted and verified absent before every dispatch. Type, LAST_LEVEL, MAX_MIP, DEPTH, BASE_ARRAY, DIM and size were decoded again from the body text stored in each dump.

  • Controls first: the probe v_mov_b32 v10, 0x2a returned 0x2a on 64/64 lanes. This entry's published gfx1036 rule (#16554) reproduces: a 1D-array T# 1,024 wide with 4 slices gives (1024, 0, 0, 1) under DIM 1D and (1024, 4, 0, 1) under DIM 1D_ARRAY. Same rig and driver as #16554, so this is a re-run, not an independent reproduction. A one-fragment TYPE 14 returns (1024, 64, 0, 1) under DIM 2D_MSAA, 2D and 1D. That is the family-level counterpart of thuanquang's one-fragment gfx1031 result, not a reproduction of his numbers.
  • The level field is live in this builder: a TYPE 9 (2D) T# with LAST_LEVEL 3 returns (1024, 64, 0, 4), and a TYPE 13 (2D array) with LAST_LEVEL 3 and DEPTH 3 returns (1024, 64, 4, 4) under DIM 2D_ARRAY, at wave32 and wave64, and (1024, 64, 0, 4) under DIM 1D and DIM 2D. The TYPE 14 case that returns 1 differs from the TYPE 9 leg only in the dword3 type nibble (0x9003_0fac vs 0xe003_0fac). So a fourth component of 1 is not a dead field.
  • 2D MSAA (TYPE 14), 2/4/8/16 fragments: under DIM 1D, 2D and 2D_MSAA, at both sizes, in wave32 and wave64, every case returns (width, height, 0, 1). Isolation legs at 1024x64 (LAST_LEVEL 1-4 with MAX_MIP 0, MAX_MIP 1-4 with LAST_LEVEL 0, and the crossed pairs LL3/MM1 and LL1/MM3) also return 1. A v_mbcnt lane id proves the wave64 legs ran as one 64-lane wave.
  • 2D MSAA-array (TYPE 15), 1/2/4/8/16 fragments, DEPTH 0 and 3, BASE_ARRAY 0, wave32 and wave64: DIM 2D_MSAA_ARRAY returns (width, height, DEPTH+1, 1); DIM 1D, DIM 2D and DIM 2D_MSAA return (width, height, 0, 1). The second commit's data: 40 wave64 cases under DIM 2D_MSAA_ARRAY and 2D_MSAA (each equal to its wave32 case) and 80 cases under DIM 1D and 2D at both wave sizes. Recomputed from the per-lane arrays: 0 of 120 TYPE 15 cases off that rule, other harvest registers 0, 0 words differing between passes. Six distinct component tuples, so width, height and slice count all move.
  • Determinism: four legs, each in two fresh-process windows: TYPE 15 with 8 fragments and DEPTH 3 under DIM 2D_MSAA_ARRAY at wave32 and at wave64, TYPE 14 with 8 fragments at wave64, and TYPE 15 with 16 fragments, 256x32, DEPTH 3 under DIM 1D at wave32. 0/1,024 harvested words differ from the archived matrix in each of the 8 windows. The rig's code-object SHA-256 equalled the local one, and the rig's output mtimes were strictly ascending.

This is an observable, not a mechanism claim: the run does not establish why the hardware reports one level.

Code reading, kept as "it throws" (not a measurement): at f57c971559, ResourceMaterializer.cpp invalidImageReason returns PoisonReason::Multisampled for TYPE 14/15. The table path poisons a Dim2DMsaa/Dim2DMsaaArray mode, and TryRuntimeImageMode rejects it as Multisampled, which RuntimeImageMode throws. The one TYPE 14 -> Dim2D rewrite needs multisamplePlaneRead (a sampled DIM 2D read), so a DIM 1D query is not rewritten. The new sentence therefore opens "separate from the implementation".

No code changes in this PR.

Evidence (runners, fixture, all dumps, a SHA-256 ledger in README.md, and both claims worksheets; the second commit's files are prefixed w64-): https://gist.github.com/brumskysb/a60b17dc3640f790aa3e00280661affb. The revision-pinned raw-URL SHA-256 of every w64- file and of README.md equal the local files, for example w64-step2_dump.json (928843ade58dbed7…), w64-step3_dump.json (dc8a360da0ef2252…) and w64-step4_windows.jsonl (a41c78f9e32a3139…).

Tested

  • GPU: AMD Radeon(TM) Graphics, integrated RDNA2, gfx1036, driver 31.0.22044.1, Windows 11. Harness: stock tools/hw-oracle runner, 64 rows, 4,096-B extra blob as the T# base.
  • First commit: 12 + 78 + 162 + 4 dispatches. Second commit: 10 + 86 + 174 + 4 dispatches. The coverage table above was recomputed from each case's body text in the dumps at PR time (w64-step5_coverage.py for TYPE 15): 0 cases with lanes disagreeing or passes differing.
  • Descriptor axis: 2D MSAA (TYPE 14) and 2D MSAA-array (TYPE 15) are measured here, with a 1D-array and a 2D array (TYPE 13) as controls. The entry's cube, 2D-array and 3D statements are thuanquang's #7550 measurement and are untouched.
  • Merge check: the branch is on f57c971559. git merge-tree of the head with main 145e689ada is clean, changes only this entry's line, and the merged entry is byte-identical to the head's. main has not touched this entry since the branch was cut.

The replaced region of the whole PR against its base f57c971559, copied from check_entry_edit.py's REPLACED REGION:

- bind, and the level component for 2, 4 or 8 fragments
+ bind. Measured on RDNA2 (gfx1036, driver 31.0.22044.1) with the hardware oracle, separate from the implementation, the level component is 1: a 2D MSAA T# with 2, 4, 8 or 16 fragments returns (width, height, 0, 1) under DIM 1D, 2D and 2D_MSAA at wave32 and wave64, and a 2D MSAA-array T# with 1 to 16 fragments and 1 or 4 slices returns (width, height, slices, 1) under DIM 2D_MSAA_ARRAY and (width, height, 0, 1) under DIM 1D, 2D and 2D_MSAA at wave32 and wave64; a BASE_ARRAY other than 0

CHANGE SUMMARY of the whole PR (from the gate):

- removed: bind, and
- removed: for
- removed: or 8 fragments
+ added:   bind. Measured on RDNA2 (gfx1036, driver 31.0.22044.1) with the hardware oracle, separate from the implementation,
+ added:   is 1: a 2D MSAA T# with
+ added:   4, 8 or 16 fragments returns (width, height, 0, 1) under DIM 1D, 2D and 2D_MSAA at wave32 and wave64, and a 2D MSAA-array T# with 1 to 16 fragments and 1 or
+ added:   slices returns (width, height, slices, 1) under DIM 2D_MSAA_ARRAY and (width, height, 0, 1) under DIM 1D, 2D and 2D_MSAA at wave32 and wave64; a BASE_ARRAY other than 0

The second commit alone, against d76f600d4c:

- wave32; wave64 on a 2D MSAA-array T#
+ 1D, 2D and 2D_MSAA at wave32 and wave64; a BASE_ARRAY other than 0

before (base f57c971559):
... On a 2D MSAA or 2D MSAA-array T# it throws: gfx1031 was measured only with one fragment, which the driver cannot bind, and the level component for 2, 4 or 8 fragments is not measured.

after:
... On a 2D MSAA or 2D MSAA-array T# it throws: gfx1031 was measured only with one fragment, which the driver cannot bind. Measured on RDNA2 (gfx1036, driver 31.0.22044.1) with the hardware oracle, separate from the implementation, the level component is 1: a 2D MSAA T# with 2, 4, 8 or 16 fragments returns (width, height, 0, 1) under DIM 1D, 2D and 2D_MSAA at wave32 and wave64, and a 2D MSAA-array T# with 1 to 16 fragments and 1 or 4 slices returns (width, height, slices, 1) under DIM 2D_MSAA_ARRAY and (width, height, 0, 1) under DIM 1D, 2D and 2D_MSAA at wave32 and wave64; a BASE_ARRAY other than 0 is not measured.

Removed phrases declared to the gate for the whole PR: bind, and, for and or 8 fragments; for the second commit: wave32; wave64 on and 2D MSAA-array T#. "2, 4", "8 fragments", "wave32", "wave64", "2D MSAA-array T#" and "is not measured" are re-added inside the new sentence, and "is not measured" now names a BASE_ARRAY other than 0, which every TYPE 15 body in both commits leaves at 0. "It throws", thuanquang's gfx1031 record, "not the PS5's gfx1013" and the 1D-array sentence are untouched.

Notes

  • debt-length: the entry grows from 922 to 1,358 characters, over the 1,000 guideline. Nothing measured was trimmed to fit; a compression is its own PR.
  • Not covered, and the new text does not claim it: BASE_ARRAY other than 0 on a 2D MSAA-array T# (named in the entry), BASE_LEVEL other than 0 (the project's decode requires 0), formats other than 20, gfx1031 with more than one fragment, and the PS5's gfx1013.
  • Overlap: 421 open PRs found by "resinfo", "get_resinfo", "MSAA", "fragments", "image query", "level count", "2D MSAA"; none but this one carries this entry's anchor in a +/- line of shader.md (0 API errors).

Checklist

  • Based on current main; no other open PR implements the same functions (base f57c971559; the merge with current main is clean and changes only this entry, see Tested)
  • 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 (attached 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: AMD Radeon(TM) Graphics (gfx1036, driver 31.0.22044.1, Windows 11)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5263674529 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18467). Originally posted by [brumskysb](https://github.com/brumskysb) on 2026-11-11T17:12:49Z. --- ### What Measures two gap clauses of the **`image_get_resinfo` through DIM 1D on a cube, 2D-array or 3D T#** entry of `docs/dev/debt/shader.md`. The first commit (`d76f600d4c`) closes "the level component for 2, 4 or 8 fragments is not measured". The second commit (`7dbd46e5c1`) closes the clause the first one left, "wave64 on a 2D MSAA-array T# is not measured", and adds DIM 1D and DIM 2D through a 2D MSAA-array T#, which the entry did not claim either way. The hardware oracle builds the T# by hand and `image_get_resinfo` never reads the surface, so a multi-fragment TYPE 14/15 descriptor can be queried even though the Vulkan path in #7550 could not bind one. Measured on gfx1036 (driver **31.0.22044.1**) with the hardware oracle. Format 20 (`32_UINT`), 1024x64 and 256x32, BASE_LEVEL 0. The fragment count is encoded the way the project decodes it: LAST_LEVEL = MAX_MIP = log2(fragments), from `GuestTextureResource.cpp` (`samples = 1u << lastLevel`, MAX_MIP in dword5 7:4). Every case ran twice, each time in a fresh process. The rig-side output was deleted and verified absent before every dispatch. Type, LAST_LEVEL, MAX_MIP, DEPTH, BASE_ARRAY, DIM and size were decoded again from the body text stored in each dump. - **Controls first:** the probe `v_mov_b32 v10, 0x2a` returned 0x2a on 64/64 lanes. This entry's published gfx1036 rule (#16554) reproduces: a 1D-array T# 1,024 wide with 4 slices gives (1024, 0, 0, 1) under DIM 1D and (1024, 4, 0, 1) under DIM 1D_ARRAY. Same rig and driver as #16554, so this is a re-run, not an independent reproduction. A one-fragment TYPE 14 returns (1024, 64, 0, 1) under DIM 2D_MSAA, 2D and 1D. That is the family-level counterpart of thuanquang's one-fragment gfx1031 result, not a reproduction of his numbers. - **The level field is live in this builder:** a TYPE 9 (2D) T# with LAST_LEVEL 3 returns (1024, 64, 0, **4**), and a TYPE 13 (2D array) with LAST_LEVEL 3 and DEPTH 3 returns (1024, 64, 4, 4) under DIM 2D_ARRAY, at wave32 and wave64, and (1024, 64, 0, 4) under DIM 1D and DIM 2D. The TYPE 14 case that returns 1 differs from the TYPE 9 leg only in the dword3 type nibble (`0x9003_0fac` vs `0xe003_0fac`). So a fourth component of 1 is not a dead field. - **2D MSAA (TYPE 14), 2/4/8/16 fragments:** under DIM 1D, 2D and 2D_MSAA, at both sizes, in wave32 and wave64, every case returns **(width, height, 0, 1)**. Isolation legs at 1024x64 (LAST_LEVEL 1-4 with MAX_MIP 0, MAX_MIP 1-4 with LAST_LEVEL 0, and the crossed pairs LL3/MM1 and LL1/MM3) also return 1. A `v_mbcnt` lane id proves the wave64 legs ran as one 64-lane wave. - **2D MSAA-array (TYPE 15), 1/2/4/8/16 fragments, DEPTH 0 and 3, BASE_ARRAY 0, wave32 and wave64:** DIM 2D_MSAA_ARRAY returns **(width, height, DEPTH+1, 1)**; DIM 1D, DIM 2D and DIM 2D_MSAA return **(width, height, 0, 1)**. The second commit's data: 40 wave64 cases under DIM 2D_MSAA_ARRAY and 2D_MSAA (each equal to its wave32 case) and 80 cases under DIM 1D and 2D at both wave sizes. Recomputed from the per-lane arrays: 0 of 120 TYPE 15 cases off that rule, other harvest registers 0, 0 words differing between passes. Six distinct component tuples, so width, height and slice count all move. - **Determinism:** four legs, each in two fresh-process windows: TYPE 15 with 8 fragments and DEPTH 3 under DIM 2D_MSAA_ARRAY at wave32 and at wave64, TYPE 14 with 8 fragments at wave64, and TYPE 15 with 16 fragments, 256x32, DEPTH 3 under DIM 1D at wave32. **0/1,024** harvested words differ from the archived matrix in each of the 8 windows. The rig's code-object SHA-256 equalled the local one, and the rig's output mtimes were strictly ascending. This is an observable, not a mechanism claim: the run does not establish why the hardware reports one level. **Code reading, kept as "it throws"** (not a measurement): at `f57c971559`, `ResourceMaterializer.cpp` `invalidImageReason` returns `PoisonReason::Multisampled` for TYPE 14/15. The table path poisons a Dim2DMsaa/Dim2DMsaaArray mode, and `TryRuntimeImageMode` rejects it as Multisampled, which `RuntimeImageMode` throws. The one TYPE 14 -> Dim2D rewrite needs `multisamplePlaneRead` (a sampled DIM 2D read), so a DIM 1D query is not rewritten. The new sentence therefore opens "separate from the implementation". No code changes in this PR. Evidence (runners, fixture, all dumps, a SHA-256 ledger in `README.md`, and both claims worksheets; the second commit's files are prefixed `w64-`): https://gist.github.com/brumskysb/a60b17dc3640f790aa3e00280661affb. The revision-pinned raw-URL SHA-256 of every `w64-` file and of `README.md` equal the local files, for example `w64-step2_dump.json` (928843ade58dbed7…), `w64-step3_dump.json` (dc8a360da0ef2252…) and `w64-step4_windows.jsonl` (a41c78f9e32a3139…). ### Tested - GPU: AMD Radeon(TM) Graphics, integrated RDNA2, `gfx1036`, driver **31.0.22044.1**, Windows 11. Harness: stock `tools/hw-oracle` runner, 64 rows, 4,096-B extra blob as the T# base. - First commit: 12 + 78 + 162 + 4 dispatches. Second commit: 10 + 86 + 174 + 4 dispatches. The coverage table above was recomputed from each case's body text in the dumps at PR time (`w64-step5_coverage.py` for TYPE 15): 0 cases with lanes disagreeing or passes differing. - Descriptor axis: 2D MSAA (TYPE 14) and 2D MSAA-array (TYPE 15) are measured here, with a 1D-array and a 2D array (TYPE 13) as controls. The entry's cube, 2D-array and 3D statements are thuanquang's #7550 measurement and are untouched. - Merge check: the branch is on `f57c971559`. `git merge-tree` of the head with `main` `145e689ada` is clean, changes only this entry's line, and the merged entry is byte-identical to the head's. `main` has not touched this entry since the branch was cut. The replaced region of the whole PR against its base `f57c971559`, copied from `check_entry_edit.py`'s REPLACED REGION: ``` - bind, and the level component for 2, 4 or 8 fragments + bind. Measured on RDNA2 (gfx1036, driver 31.0.22044.1) with the hardware oracle, separate from the implementation, the level component is 1: a 2D MSAA T# with 2, 4, 8 or 16 fragments returns (width, height, 0, 1) under DIM 1D, 2D and 2D_MSAA at wave32 and wave64, and a 2D MSAA-array T# with 1 to 16 fragments and 1 or 4 slices returns (width, height, slices, 1) under DIM 2D_MSAA_ARRAY and (width, height, 0, 1) under DIM 1D, 2D and 2D_MSAA at wave32 and wave64; a BASE_ARRAY other than 0 ``` CHANGE SUMMARY of the whole PR (from the gate): ``` - removed: bind, and - removed: for - removed: or 8 fragments + added: bind. Measured on RDNA2 (gfx1036, driver 31.0.22044.1) with the hardware oracle, separate from the implementation, + added: is 1: a 2D MSAA T# with + added: 4, 8 or 16 fragments returns (width, height, 0, 1) under DIM 1D, 2D and 2D_MSAA at wave32 and wave64, and a 2D MSAA-array T# with 1 to 16 fragments and 1 or + added: slices returns (width, height, slices, 1) under DIM 2D_MSAA_ARRAY and (width, height, 0, 1) under DIM 1D, 2D and 2D_MSAA at wave32 and wave64; a BASE_ARRAY other than 0 ``` The second commit alone, against `d76f600d4c`: ``` - wave32; wave64 on a 2D MSAA-array T# + 1D, 2D and 2D_MSAA at wave32 and wave64; a BASE_ARRAY other than 0 ``` before (base `f57c971559`): `... On a 2D MSAA or 2D MSAA-array T# it throws: gfx1031 was measured only with one fragment, which the driver cannot bind, and the level component for 2, 4 or 8 fragments is not measured.` after: `... On a 2D MSAA or 2D MSAA-array T# it throws: gfx1031 was measured only with one fragment, which the driver cannot bind. Measured on RDNA2 (gfx1036, driver 31.0.22044.1) with the hardware oracle, separate from the implementation, the level component is 1: a 2D MSAA T# with 2, 4, 8 or 16 fragments returns (width, height, 0, 1) under DIM 1D, 2D and 2D_MSAA at wave32 and wave64, and a 2D MSAA-array T# with 1 to 16 fragments and 1 or 4 slices returns (width, height, slices, 1) under DIM 2D_MSAA_ARRAY and (width, height, 0, 1) under DIM 1D, 2D and 2D_MSAA at wave32 and wave64; a BASE_ARRAY other than 0 is not measured.` Removed phrases declared to the gate for the whole PR: `bind, and`, `for` and `or 8 fragments`; for the second commit: `wave32; wave64 on` and `2D MSAA-array T#`. "2, 4", "8 fragments", "wave32", "wave64", "2D MSAA-array T#" and "is not measured" are re-added inside the new sentence, and "is not measured" now names a BASE_ARRAY other than 0, which every TYPE 15 body in both commits leaves at 0. "It throws", thuanquang's gfx1031 record, "not the PS5's gfx1013" and the 1D-array sentence are untouched. ### Notes - `debt-length`: the entry grows from 922 to 1,358 characters, over the 1,000 guideline. Nothing measured was trimmed to fit; a compression is its own PR. - Not covered, and the new text does not claim it: BASE_ARRAY other than 0 on a 2D MSAA-array T# (named in the entry), BASE_LEVEL other than 0 (the project's decode requires 0), formats other than 20, gfx1031 with more than one fragment, and the PS5's gfx1013. - Overlap: 421 open PRs found by "resinfo", "get_resinfo", "MSAA", "fragments", "image query", "level count", "2D MSAA"; none but this one carries this entry's anchor in a +/- line of `shader.md` (0 API errors). ### Checklist - [x] Based on current `main`; no other open PR implements the same functions (base `f57c971559`; the merge with current `main` is clean and changes only this entry, see Tested) - [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 (attached 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: AMD Radeon(TM) Graphics (gfx1036, driver 31.0.22044.1, Windows 11) - [x] AI-assisted: yes
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!18467
No description provided.