docs(debt): measure the null vertex buffer V# fetch on gfx1036 #18142

Merged
brumskysb merged 1 commit from upstream-pr/18142 into main 2026-11-16 02:20:45 +00:00
brumskysb commented 2026-11-10 15:49:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by brumskysb on 2026-11-10T15:49:15Z.


What

Measures the gap clause of the Null vertex buffer V# entry of docs/dev/debt/libSceAgcDriver.md — "This follows the V# fields in the AMD RDNA2 ISA (NUM_RECORDS 0, DST_SEL 0 selects 0), not measured on hardware" — on RDNA2 hardware.

Measured on gfx1036 (driver 31.0.22044.1) with the hardware oracle, wave32 and wave64, one work-group, the destination preset to a sentinel (0xcdcdcdcd) inside the body before the load:

  • Control first: the rule of "[VertexBufferReadSize]" (#2241, word 3 0x0004dfac, 3 vs 6 records) reproduces 768/768 words, wave32 and wave64 — indices 3-5 over 3 records read 00000000 x4 (W included), 6 records return the stored values. Same SKU on another driver: a reproduction of the rule, not a re-measurement of #2241's numbers.
  • All-zero V# (s[8:11] = 0, read back 0 on every lane): 15 forms x wave32/wave64 — buffer_load_format_{x,xy,xyz,xyzw} with idxen, offen and idxen offen, buffer_load_format_d16_xyzw idxen, tbuffer_load_format_xyzw idxen with BUF_FMT_32_32_32_32_FLOAT and BUF_FMT_8_8_8_8_UNORM; index {0, 1, 0x10000, 0xfffffff0} x offset {0, 4, 0x1000, 0xfffffff0}. 3,840/3,840 written words are 0 (W included, not 1.0), 1,920/1,920 registers outside the destination keep the sentinel, 30/30 dispatches returned without a fault.
  • One-field isolation over six stored records (buffer_load_format_xyzw idxen): NUM_RECORDS 0, DST_SEL 0/0/0/0 and word 3 FORMAT 0 each alone zero 128/128 (wave32) and 256/256 (wave64) words; the control reads the stored data (0 zero words, 6 distinct vectors). So the ISA reading in the entry is right but names two of three sufficient fields, and the null result cannot say which one the hardware applies; the entry now says that.
  • Determinism: one control leg and one null leg, two fresh-process windows each: 0/352 and 0/768 words differ, the rig-side output deleted and verified absent before every dispatch, the rig's code-object SHA-256 equal to the local one.

The entry's first sentence (the zeroed vertex buffer of the attribute's size with stride 0) is code behaviour (NullVertexDescriptor / DecodeVertexFormat in VertexInput.hpp, read at this base) and is unchanged. No code changes in this PR.

Evidence (runners, verifier, all 50 dumps as one bundle, per-dump SHA-256 ledger, claims worksheet, results): https://gist.github.com/brumskysb/9e0579b14879df4820845462482d9066

Tested

  • GPU: AMD Radeon(TM) Graphics, integrated RDNA2, gfx1036, driver 31.0.22044.1, Windows 11; harness tools/hw-oracle through rig_runner.py, wave32 and wave64, one work-group, LDS 4096, IEEE 0, DX10 clamp 1, fp16_overflow 0.
  • V# built in SGPRs over the extra blob (base = kernarg pointer + padded rows x 16, stride 16), every word decoded before dispatch and re-read from s8-s11 on every lane.
  • 5 + 38 + 4 dispatches; verify_step4.py recomputes every count above from the dumps. Gist README.md, dumps_bundle.json and verify_step4.py raw-URL SHA-256 equal the local files.
  • Descriptor axis: none — no image resource is involved.

The replaced region, copied from check_entry_edit.py's REPLACED REGION:

- 0), not measured on hardware.
+ 0). Measured on RDNA2 (gfx1036, driver 31.0.22044.1) with the hardware oracle in wave32 and wave64: an all-zero V# returns 0 in every written component, W included, for `buffer_load_format_x` to `_xyzw` (`idxen`, `offen` or both), `_d16_xyzw` and `tbuffer_load_format_xyzw` (`32_32_32_32_FLOAT`, `8_8_8_8_UNORM`), without a fault; over stored data, `NUM_RECORDS` 0, `DST_SEL` 0 and `FORMAT` 0 each zero an `_xyzw` fetch alone, so the null result cannot name the field. The fetch was a compute dispatch, not a vertex shader; the PS5's gfx1013 is not measured.

before:
... (NUM_RECORDS0,DST_SEL 0 selects 0), not measured on hardware.

after:
... (NUM_RECORDS0,DST_SEL0 selects 0). Measured on RDNA2 (gfx1036, driver 31.0.22044.1) with the hardware oracle in wave32 and wave64: an all-zero V# returns 0 in every written component, W included, forbuffer_load_format_xto_xyzw (idxen, offenor both),_d16_xyzwandtbuffer_load_format_xyzw (32_32_32_32_FLOAT, 8_8_8_8_UNORM), without a fault; over stored data, NUM_RECORDS0,DST_SEL0 andFORMAT0 each zero an_xyzw fetch alone, so the null result cannot name the field. The fetch was a compute dispatch, not a vertex shader; the PS5's gfx1013 is not measured.

Removed phrases declared to the gate: 0), and measured on hardware. — only the closing "not measured on hardware" goes; "not measured" moves to the PS5's gfx1013. The ISA link and the field reading are untouched.

Notes

  • Entry grows from 467 to 996 characters, under the 1,000 guideline.
  • Not covered, and the new text does not claim it: the PS5's gfx1013, a real vertex-shader fetch (the fixture is a compute dispatch of the same instruction), the Vulkan binding, a base-0 V# with NUM_RECORDS > 0 (skipped: an in-range read at address 0 is not provably safe), tbuffer formats other than the two named, and isolation legs on forms other than _xyzw idxen.
  • Overlap: the 300 most recent open PRs were scanned; 21 touch docs/dev/debt/libSceAgcDriver.md and none carries this entry in a +/- line.

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:5244294224 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18142). Originally posted by [brumskysb](https://github.com/brumskysb) on 2026-11-10T15:49:15Z. --- ### What Measures the gap clause of the **Null vertex buffer V#** entry of `docs/dev/debt/libSceAgcDriver.md` — "This follows the V# fields in the AMD RDNA2 ISA (`NUM_RECORDS` 0, `DST_SEL` 0 selects 0), not measured on hardware" — on RDNA2 hardware. Measured on gfx1036 (driver **31.0.22044.1**) with the hardware oracle, wave32 and wave64, one work-group, the destination preset to a sentinel (`0xcdcdcdcd`) inside the body before the load: - **Control first:** the rule of "[VertexBufferReadSize]" (#2241, word 3 `0x0004dfac`, 3 vs 6 records) reproduces **768/768** words, wave32 and wave64 — indices 3-5 over 3 records read `00000000` x4 (W included), 6 records return the stored values. Same SKU on another driver: a reproduction of the rule, not a re-measurement of #2241's numbers. - **All-zero V#** (`s[8:11]` = 0, read back 0 on every lane): 15 forms x wave32/wave64 — `buffer_load_format_{x,xy,xyz,xyzw}` with `idxen`, `offen` and `idxen offen`, `buffer_load_format_d16_xyzw idxen`, `tbuffer_load_format_xyzw idxen` with `BUF_FMT_32_32_32_32_FLOAT` and `BUF_FMT_8_8_8_8_UNORM`; index {0, 1, 0x10000, 0xfffffff0} x offset {0, 4, 0x1000, 0xfffffff0}. **3,840/3,840** written words are 0 (W included, not 1.0), **1,920/1,920** registers outside the destination keep the sentinel, 30/30 dispatches returned without a fault. - **One-field isolation** over six stored records (`buffer_load_format_xyzw idxen`): `NUM_RECORDS` 0, `DST_SEL` 0/0/0/0 and word 3 `FORMAT` 0 **each alone** zero 128/128 (wave32) and 256/256 (wave64) words; the control reads the stored data (0 zero words, 6 distinct vectors). So the ISA reading in the entry is right but names two of three sufficient fields, and the null result cannot say which one the hardware applies; the entry now says that. - **Determinism:** one control leg and one null leg, two fresh-process windows each: **0/352** and **0/768** words differ, the rig-side output deleted and verified absent before every dispatch, the rig's code-object SHA-256 equal to the local one. The entry's first sentence (the zeroed vertex buffer of the attribute's size with stride 0) is code behaviour (`NullVertexDescriptor` / `DecodeVertexFormat` in `VertexInput.hpp`, read at this base) and is unchanged. No code changes in this PR. Evidence (runners, verifier, all 50 dumps as one bundle, per-dump SHA-256 ledger, claims worksheet, results): https://gist.github.com/brumskysb/9e0579b14879df4820845462482d9066 ### Tested - GPU: AMD Radeon(TM) Graphics, integrated RDNA2, `gfx1036`, driver **31.0.22044.1**, Windows 11; harness `tools/hw-oracle` through `rig_runner.py`, wave32 and wave64, one work-group, LDS 4096, IEEE 0, DX10 clamp 1, fp16_overflow 0. - V# built in SGPRs over the extra blob (base = kernarg pointer + padded rows x 16, stride 16), every word decoded before dispatch and re-read from `s8`-`s11` on every lane. - 5 + 38 + 4 dispatches; `verify_step4.py` recomputes every count above from the dumps. Gist `README.md`, `dumps_bundle.json` and `verify_step4.py` raw-URL SHA-256 equal the local files. - Descriptor axis: none — no image resource is involved. The replaced region, copied from `check_entry_edit.py`'s REPLACED REGION: ``` - 0), not measured on hardware. + 0). Measured on RDNA2 (gfx1036, driver 31.0.22044.1) with the hardware oracle in wave32 and wave64: an all-zero V# returns 0 in every written component, W included, for `buffer_load_format_x` to `_xyzw` (`idxen`, `offen` or both), `_d16_xyzw` and `tbuffer_load_format_xyzw` (`32_32_32_32_FLOAT`, `8_8_8_8_UNORM`), without a fault; over stored data, `NUM_RECORDS` 0, `DST_SEL` 0 and `FORMAT` 0 each zero an `_xyzw` fetch alone, so the null result cannot name the field. The fetch was a compute dispatch, not a vertex shader; the PS5's gfx1013 is not measured. ``` before: `... (`NUM_RECORDS` 0, `DST_SEL` 0 selects 0), not measured on hardware.` after: `... (`NUM_RECORDS` 0, `DST_SEL` 0 selects 0). Measured on RDNA2 (gfx1036, driver 31.0.22044.1) with the hardware oracle in wave32 and wave64: an all-zero V# returns 0 in every written component, W included, for `buffer_load_format_x` to `_xyzw` (`idxen`, `offen` or both), `_d16_xyzw` and `tbuffer_load_format_xyzw` (`32_32_32_32_FLOAT`, `8_8_8_8_UNORM`), without a fault; over stored data, `NUM_RECORDS` 0, `DST_SEL` 0 and `FORMAT` 0 each zero an `_xyzw` fetch alone, so the null result cannot name the field. The fetch was a compute dispatch, not a vertex shader; the PS5's gfx1013 is not measured.` Removed phrases declared to the gate: `0),` and `measured on hardware.` — only the closing "not measured on hardware" goes; "not measured" moves to the PS5's gfx1013. The ISA link and the field reading are untouched. ### Notes - Entry grows from 467 to 996 characters, under the 1,000 guideline. - Not covered, and the new text does not claim it: the PS5's gfx1013, a real vertex-shader fetch (the fixture is a compute dispatch of the same instruction), the Vulkan binding, a base-0 V# with `NUM_RECORDS` > 0 (skipped: an in-range read at address 0 is not provably safe), tbuffer formats other than the two named, and isolation legs on forms other than `_xyzw idxen`. - Overlap: the 300 most recent open PRs were scanned; 21 touch `docs/dev/debt/libSceAgcDriver.md` and none carries this entry in a +/- line. ### 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:50:13 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Read 1353c67b7f against main.

Correctness. The entry on main describes the NullVertexDescriptor handling in Graphics/include/VertexInput.hpp (:27-34, :296, :310): an all-zero V# is bound to a zeroed buffer of the attribute size with stride 0, so every component reads 0. The new text keeps that wording and adds the gfx1036 measurement, which agrees with the behaviour. The measurement used compute buffer_load_format and tbuffer_load_format, not a vertex shader; the entry says so and says gfx1013 is not measured, which is the right scope. The old sentence on main is unchanged since the PR base. The hardware numbers cannot be checked from the code. No overlap with the other libSceAgcDriver.md PRs in this set (#17883 edits line 9, #18091 the start of Functional).

Not run here; this is from reading the code.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5846669025 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18142#pullrequestreview-5846669025). Originally posted by [gabichuuuuu](https://github.com/gabichuuuuu) on 2026-11-10T17:50:13Z. **Review:** COMMENTED --- Read `1353c67b7f` against `main`. **Correctness.** The entry on main describes the `NullVertexDescriptor` handling in `Graphics/include/VertexInput.hpp` (`:27-34`, `:296`, `:310`): an all-zero V# is bound to a zeroed buffer of the attribute size with stride 0, so every component reads 0. The new text keeps that wording and adds the gfx1036 measurement, which agrees with the behaviour. The measurement used compute `buffer_load_format` and `tbuffer_load_format`, not a vertex shader; the entry says so and says gfx1013 is not measured, which is the right scope. The old sentence on main is unchanged since the PR base. The hardware numbers cannot be checked from the code. No overlap with the other `libSceAgcDriver.md` PRs in this set (#17883 edits line 9, #18091 the start of Functional). 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!18142
No description provided.