docs(shader): measure the 1D-array height for image_get_resinfo DIM 1D #16554

Merged
brumskysb merged 1 commit from upstream-pr/16554 into main 2026-11-10 20:03:48 +00:00
brumskysb commented 2026-11-07 04:37:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by brumskysb on 2026-11-07T04:37:15Z.


What

Closes the last measurement gap in the "image_get_resinfo through DIM 1D on a cube, 2D-array or 3D T#" entry: the height a 1D-array T# reports under a DIM 1D query, which the entry recorded as unmeasured.

Measured on RDNA2 (gfx1036, driver 31.0.22044.1) with the hardware oracle: a DIM 1D image_get_resinfo through a 1D-array T# reports (width, 0, 0, levels) — height 0, at 1, 4 and 16 slices and at widths 1,024 and 4,096. The slice count appears only under DIM 1D_ARRAY, and there it appears in the height component ((width, slices, 0, levels)).

Three controls come with it, all in the dumps: a plain 1D T# also reports height 0, which contradicted the campaign's expectation of 1 and matches the project's own QueryDimensions() for a Dim1D view; a 3D T# built with DEPTH 3 reports (1024, 64, 4, 1) under DIM 1D exactly as under DIM 3D; and LAST_LEVEL 3 moves the fourth component from 1 to 4, with BASE_LEVEL 1 halving the width to 512 and reporting 3 levels.

Evidence (scripts, both dumps, the entry text before and after): https://gist.github.com/brumskysb/1ede1aa1c988707fbc0bfc6362eaf2a1

Tested

  • GPU: AMD Radeon(TM) Graphics, integrated RDNA2, gfx1036, driver 31.0.22044.1, Windows 11; harness tools/hw-oracle, wave32, 64 lanes per dispatch.
  • 36 dispatches in step 2 (18 cases x 2 passes; every lane agreed and both passes were byte-identical) plus 20 in step 1.
  • Two independent checkers re-derive each case's T# type, format, width, height, depth, base level, last level and DIM from the descriptor words stored in the dump, so the report does not rely on the generator agreeing with itself (CHECK OK for all 18 cases).
  • The MSAA half of the entry is untouched: the driver cannot bind a multi-fragment image, so no dispatch here touches an MSAA T# or a fragment count, and the entry keeps saying that the level component for 2, 4 or 8 fragments is not measured.

Notes

  • The entry stays under the guideline at 922 characters (694 before), so no debt-length warning is expected.
  • The descriptor vocabulary in my local gate had no 1D/1D-array token and could only declare one fixture descriptor, so this entry could not describe itself. The gate now takes a comma list (--fixture-descriptor "1D-array,3D") plus --premeasured-descriptor "cube,2D-array,2D MSAA,2D MSAA-array" for the types the entry already attributes to thuanquang's #7550 measurement — and it was re-checked to still fail on an undeclared type before being trusted here.
  • One correction to the campaign plan, recorded in the gist: a plain 1D T# reports height 0, not 1. The plan expected 1; the hardware disagrees, and the entry now says what the hardware does.

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 (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:5198445593 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16554). Originally posted by [brumskysb](https://github.com/brumskysb) on 2026-11-07T04:37:15Z. --- ### What Closes the last measurement gap in the "`image_get_resinfo` through DIM 1D on a cube, 2D-array or 3D T#" entry: the height a 1D-array T# reports under a DIM 1D query, which the entry recorded as unmeasured. Measured on RDNA2 (gfx1036, driver 31.0.22044.1) with the hardware oracle: a DIM 1D `image_get_resinfo` through a **1D-array T# reports `(width, 0, 0, levels)`** — height 0, at 1, 4 and 16 slices and at widths 1,024 and 4,096. The slice count appears only under DIM 1D_ARRAY, and there it appears **in the height component** (`(width, slices, 0, levels)`). Three controls come with it, all in the dumps: a plain 1D T# also reports height **0**, which contradicted the campaign's expectation of 1 and matches the project's own `QueryDimensions()` for a `Dim1D` view; a 3D T# built with `DEPTH` 3 reports `(1024, 64, 4, 1)` under DIM 1D exactly as under DIM 3D; and `LAST_LEVEL` 3 moves the fourth component from 1 to 4, with `BASE_LEVEL` 1 halving the width to 512 and reporting 3 levels. Evidence (scripts, both dumps, the entry text before and after): https://gist.github.com/brumskysb/1ede1aa1c988707fbc0bfc6362eaf2a1 ### Tested - GPU: AMD Radeon(TM) Graphics, integrated RDNA2, `gfx1036`, driver **31.0.22044.1**, Windows 11; harness `tools/hw-oracle`, wave32, 64 lanes per dispatch. - 36 dispatches in step 2 (18 cases x 2 passes; every lane agreed and both passes were byte-identical) plus 20 in step 1. - Two independent checkers re-derive each case's T# type, format, width, height, depth, base level, last level and DIM from the descriptor words stored in the dump, so the report does not rely on the generator agreeing with itself (`CHECK OK` for all 18 cases). - The MSAA half of the entry is untouched: the driver cannot bind a multi-fragment image, so no dispatch here touches an MSAA T# or a fragment count, and the entry keeps saying that the level component for 2, 4 or 8 fragments is not measured. ### Notes - The entry stays under the guideline at **922 characters** (694 before), so no `debt-length` warning is expected. - The descriptor vocabulary in my local gate had no `1D`/`1D-array` token and could only declare one fixture descriptor, so this entry could not describe itself. The gate now takes a comma list (`--fixture-descriptor "1D-array,3D"`) plus `--premeasured-descriptor "cube,2D-array,2D MSAA,2D MSAA-array"` for the types the entry already attributes to thuanquang's #7550 measurement — and it was re-checked to still fail on an undeclared type before being trusted here. - One correction to the campaign plan, recorded in the gist: a plain 1D T# reports height 0, not 1. The plan expected 1; the hardware disagrees, and the entry now says what the hardware does. ### 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 (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
gabichuuuuu commented 2026-11-10 17:48:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-10T17:48:39Z.

Review: COMMENTED


Read 9d5caf1e05 against main.

Correctness. The code agrees with the measured height of 0. For a 1D-array T# under DIM 1D, descriptorDimension (ResourceMaterializer.cpp:116-122) returns Dim1D because wantArray is false, so the entry's "reads it as its first layer" holds, and QueryDimensions (SpirvImageEmitter.cpp:464-500) then fills only component 0 with the width, forces component 2 to 0 and leaves component 1 as the constant 0, with the level count in component 3. That yields (width, 0, 0, levels), the value the new text records. The MSAA half is unchanged. The measurement itself (gfx1036, widths 1,024 and 4,096, 1, 4 and 16 slices) cannot be checked from the tree.

Not run here; this is from reading the code.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5846646176 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16554#pullrequestreview-5846646176). Originally posted by [gabichuuuuu](https://github.com/gabichuuuuu) on 2026-11-10T17:48:39Z. **Review:** COMMENTED --- Read `9d5caf1e05` against `main`. **Correctness.** The code agrees with the measured height of 0. For a 1D-array T# under DIM 1D, `descriptorDimension` (`ResourceMaterializer.cpp:116-122`) returns `Dim1D` because `wantArray` is false, so the entry's "reads it as its first layer" holds, and `QueryDimensions` (`SpirvImageEmitter.cpp:464-500`) then fills only component 0 with the width, forces component 2 to 0 and leaves component 1 as the constant 0, with the level count in component 3. That yields (width, 0, 0, levels), the value the new text records. The MSAA half is unchanged. The measurement itself (gfx1036, widths 1,024 and 4,096, 1, 4 and 16 slices) cannot be checked from the tree. Not run here; this is from reading the code. 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!16554
No description provided.