shader: lower unsigned RGBA8 vertex fetches #2185

Merged
RavenCurseBurg merged 6 commits from upstream-pr/2193 into main 2026-11-25 09:54:06 +00:00
RavenCurseBurg commented 2026-11-25 03:45:37 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T03:45:37Z.


Refs #2023, item G (claim).

The startup translator now reads gfx10 format 60 as four unsigned bytes in increasing address order. The same decoder handles DXGI R8G8B8A8_UINT (30) in stream input layouts. The unaligned load is shared with the existing RGBA8 UNORM path. LLVM 15 lists the format as four 8-bit fields with unsigned integer interpretation. LLVM format table · DXGI format enumeration

Verification

Current head c1b5d3f8 includes the upstream MSVC build fix from #2204. The stream-fetch controls and WARP readback passed again locally: 13 formats, 16 vertices each, all 12 shader mutations detected. The upstream Windows build, Linux checks, and gfx1013 assembly checks passed. Upstream CI · Full Windows 2025 Debug and Release run

At a28a2b1e, I reran python -B tests/startup_vertex_fetch_formats_check.py <dxc> <offscreen_check> warp on Windows. All 13 formats passed at 16 vertices each. RGBA8 UINT matched all 64 component words and the untouched tail. The readback rejected all 12 shader mutations, including blue from green and alpha from blue. Replacing the translator's alpha expression with the blue expression also failed the device-free controls() check. Latest test report

On base b80be156, the source-built MTBUF instruction was refused with buffer format BUF_FMT_8_8_8_8_UINT. On e375e5c5, the fixture reads all four channels of 16 vertices at stride 5, offset 3, covering all four dword alignments. A shader that normalizes the green byte fails the readback. The independent byte reference also detects swapped channels and a one-byte shift.

  • python -B tests/startup_vertex_fetch_formats_check.py controls and python -B tests/startup_stream_fetch_check.py passed, including the DXGI stream layout and its three-component fetch record.
  • python -B tests/startup_vertex_fetch_formats_check.py <dxc> <offscreen_check> warp passed for all 13 formats. The new format matched all 320 checked words (64 component words plus the untouched tail). All applicable wrong references and all 10 shader mutations were detected. Used DXC v1.9.2609 and the upstream offscreen_check build at 153bb5f6.
  • python -B tools/run_checks_parallel.py -j 4 $checks passed all 43 scripts. In PowerShell, $checks = (Get-ChildItem tests/startup_gfx2hlsl_*_check.py).FullName + @('tests/startup_translator_check.py').
  • python -B tests/docs_links_check.py checked 405 links. python -B tests/bidi_controls_check.py checked 1,479 files. git diff HEAD^ --check passed.

The fixture extends the project's hand-assembled vertex program and its existing deterministic input buffer. Reproduction in the experiment guide

AI-assisted with Codex (GPT-6.2 Astra xhigh, as specified by the contributor).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6596733954 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2193). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T03:45:37Z. --- Refs #2023, item G ([claim](https://github.com/R0Y00/Xbox2Windows/issues/2023#issuecomment-7152145273)). The startup translator now reads gfx10 format 60 as four unsigned bytes in increasing address order. The same decoder handles DXGI `R8G8B8A8_UINT` (30) in stream input layouts. The unaligned load is shared with the existing RGBA8 UNORM path. LLVM 15 lists the format as four 8-bit fields with unsigned integer interpretation. [LLVM format table](https://releases.llvm.org/15.0.0/docs/AMDGPUModifierSyntax.html#ufmt) · [DXGI format enumeration](https://learn.microsoft.com/en-us/windows/win32/api/dxgiformat/ne-dxgiformat-dxgi_format) ## Verification Current head `c1b5d3f8` includes the upstream MSVC build fix from #2204. The stream-fetch controls and WARP readback passed again locally: 13 formats, 16 vertices each, all 12 shader mutations detected. The upstream Windows build, Linux checks, and gfx1013 assembly checks passed. [Upstream CI](https://github.com/R0Y00/Xbox2Windows/actions/runs/45551379943) · [Full Windows 2025 Debug and Release run](https://github.com/RavenCurseBurg/Xbox2Windows/actions/runs/45551404256) At `a28a2b1e`, I reran `python -B tests/startup_vertex_fetch_formats_check.py <dxc> <offscreen_check> warp` on Windows. All 13 formats passed at 16 vertices each. RGBA8 UINT matched all 64 component words and the untouched tail. The readback rejected all 12 shader mutations, including blue from green and alpha from blue. Replacing the translator's alpha expression with the blue expression also failed the device-free `controls()` check. [Latest test report](https://github.com/R0Y00/Xbox2Windows/pull/2193#issuecomment-7153028837) On base `b80be156`, the source-built MTBUF instruction was refused with `buffer format BUF_FMT_8_8_8_8_UINT`. On `e375e5c5`, the fixture reads all four channels of 16 vertices at stride 5, offset 3, covering all four dword alignments. A shader that normalizes the green byte fails the readback. The independent byte reference also detects swapped channels and a one-byte shift. - `python -B tests/startup_vertex_fetch_formats_check.py controls` and `python -B tests/startup_stream_fetch_check.py` passed, including the DXGI stream layout and its three-component fetch record. - `python -B tests/startup_vertex_fetch_formats_check.py <dxc> <offscreen_check> warp` passed for all 13 formats. The new format matched all 320 checked words (64 component words plus the untouched tail). All applicable wrong references and all 10 shader mutations were detected. Used DXC v1.9.2609 and the upstream [offscreen_check build at 153bb5f6](https://github.com/R0Y00/Xbox2Windows/actions/runs/45381229589). - `python -B tools/run_checks_parallel.py -j 4 $checks` passed all 43 scripts. In PowerShell, `$checks = (Get-ChildItem tests/startup_gfx2hlsl_*_check.py).FullName + @('tests/startup_translator_check.py')`. - `python -B tests/docs_links_check.py` checked 405 links. `python -B tests/bidi_controls_check.py` checked 1,479 files. `git diff HEAD^ --check` passed. The fixture extends the project's hand-assembled vertex program and its existing deterministic input buffer. [Reproduction in the experiment guide](https://github.com/RavenCurseBurg/Xbox2Windows/blob/e375e5c5777fcc0e224257e9a446644f1dd80897/docs/experiments.md#every-vertex-fetch-buffer-format) AI-assisted with Codex (GPT-6.2 Astra xhigh, as specified by the contributor).
tedin7 commented 2026-11-25 04:04:15 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T03:53:56Z.

Review: COMMENTED


Review at head e375e5c5777fcc0e224257e9a446644f1dd80897. 0 P1, 0 P2.

Logic: DXGI 30 is R8G8B8A8_UINT; gfx10 buffer format 60 is 8_8_8_8_UINT. Four unsigned bytes go to X, Y, Z, W in address order with no normalization, and ldu() handles the unaligned dword cases. Sibling tables FETCH_DXGI and FETCH_FORMATS are both extended. No other open or recently merged PR covers this format.

Tests: the existing WARP readback suite startup_vertex_fetch_formats gets a new 8_8_8_8_UINT entry (stride 5, offset 3) with a GPU-readback vs CPU-reference comparison, plus a new mutation control. startup_stream_fetch_translate gets a new DXGI 30 case.

Verification (Linux):

  • python3 tests/docs_links_check.py: pass
  • python3 tests/bidi_controls_check.py: pass
  • git diff --check origin/main...HEAD: clean
  • python3 tests/startup_vertex_fetch_formats_check.py controls: pass
  • python3 tests/startup_stream_fetch_check.py: pass
  • Mutation 1: green byte read as the blue byte in the 8_8_8_8_UINT row. startup_stream_fetch_check.py fails (rc=1).
  • Mutation 2: DXGI 30 mapped to 8_8_8_8_UNORM. startup_stream_fetch_check.py fails (rc=1).
  • Both mutations reverted.

Verification (Windows Server 2025, WARP, no build fast-path):

  • x2w_pipe.py win2025 2193 --scope direct --targets offscreen_check --regex 'startup_vertex_fetch_formats|startup_stream_fetch' --no-skip-build
    • Debug: startup_vertex_fetch_formats_{warp,hardware,controls} and startup_stream_fetch_{warp,hardware,translate} all pass.
    • Release /O2: startup_vertex_fetch_formats_* pass. startup_stream_fetch_{warp,hardware} failed once with request key does not include the layout, an assertion this PR does not touch.
  • Rerun of the same command with --regex 'startup_stream_fetch': 3/3 pass in Debug and 3/3 pass in Release /O2. The first failure looks like a flake from the parallel run, but I did not find its cause.

Notes (non-blocking):

  • The docs/experiments.md rewrite of the "ten formats" paragraph drops the pointer to the 16_16_SNORM section that follows. Please keep that reference.
  • The GitHub Windows checks run is action_required (it needs maintainer approval), so the Build and test on Windows check has not run. It must be SUCCESS before merge.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6051624969 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2193#pullrequestreview-6051624969). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T03:53:56Z. **Review:** COMMENTED --- Review at head `e375e5c5777fcc0e224257e9a446644f1dd80897`. 0 P1, 0 P2. Logic: DXGI 30 is `R8G8B8A8_UINT`; gfx10 buffer format 60 is `8_8_8_8_UINT`. Four unsigned bytes go to X, Y, Z, W in address order with no normalization, and `ldu()` handles the unaligned dword cases. Sibling tables `FETCH_DXGI` and `FETCH_FORMATS` are both extended. No other open or recently merged PR covers this format. Tests: the existing WARP readback suite `startup_vertex_fetch_formats` gets a new `8_8_8_8_UINT` entry (stride 5, offset 3) with a GPU-readback vs CPU-reference comparison, plus a new mutation control. `startup_stream_fetch_translate` gets a new DXGI 30 case. Verification (Linux): - `python3 tests/docs_links_check.py`: pass - `python3 tests/bidi_controls_check.py`: pass - `git diff --check origin/main...HEAD`: clean - `python3 tests/startup_vertex_fetch_formats_check.py controls`: pass - `python3 tests/startup_stream_fetch_check.py`: pass - Mutation 1: green byte read as the blue byte in the `8_8_8_8_UINT` row. `startup_stream_fetch_check.py` fails (rc=1). - Mutation 2: DXGI 30 mapped to `8_8_8_8_UNORM`. `startup_stream_fetch_check.py` fails (rc=1). - Both mutations reverted. Verification (Windows Server 2025, WARP, no build fast-path): - `x2w_pipe.py win2025 2193 --scope direct --targets offscreen_check --regex 'startup_vertex_fetch_formats|startup_stream_fetch' --no-skip-build` - Debug: `startup_vertex_fetch_formats_{warp,hardware,controls}` and `startup_stream_fetch_{warp,hardware,translate}` all pass. - Release /O2: `startup_vertex_fetch_formats_*` pass. `startup_stream_fetch_{warp,hardware}` failed once with `request key does not include the layout`, an assertion this PR does not touch. - Rerun of the same command with `--regex 'startup_stream_fetch'`: 3/3 pass in Debug and 3/3 pass in Release /O2. The first failure looks like a flake from the parallel run, but I did not find its cause. Notes (non-blocking): - The `docs/experiments.md` rewrite of the "ten formats" paragraph drops the pointer to the `16_16_SNORM` section that follows. Please keep that reference. - The GitHub `Windows checks` run is `action_required` (it needs maintainer approval), so the `Build and test on Windows` check has not run. It must be SUCCESS before merge. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 04:04:16 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T03:59:39Z.

Review: COMMENTED


Re-review of head 0f506b562778141bc6b7763b675617019be8cbff (previous review covered e375e5c5; the only change since is a docs wording fix in docs/experiments.md).

Verdict: no P1, no P2.

What I checked

  • tools/startup/gfx2hlsl.py: format 60 (BUF_FMT_8_8_8_8_UINT, matches the gfx10 numbering in tools/disasm_rdna2.py:1293) is added to FETCH_FORMATS with the same ldu() unaligned load as the UNORM sibling and raw byte extraction w & 255u, (w >> 8) & 255u, (w >> 16) & 255u, w >> 24. The sibling table FETCH_DXGI gets DXGI 30 (R8G8B8A8_UINT), next to 28 (R8G8B8A8_UNORM). Byte order and unsigned semantics are correct.
  • Tests extend the existing suites (startup_vertex_fetch_formats_check.py FORMATS and MUTATIONS, startup_stream_fetch_check.py DXGI layout) instead of adding a new file. Stride 5 / offset 3 covers all four dword alignments.
  • Docs: the vertex-fetch section no longer hard-codes "ten formats". Title is neutral, PR is MERGEABLE, clean-room wording is fine.

Commands run locally on the head (Linux):

  • python3 -B tests/startup_vertex_fetch_formats_check.py controls -> vertex fetch format controls passed
  • python3 -B tests/startup_stream_fetch_check.py -> passed (includes the new DXGI 30 record)
  • python3 tests/docs_links_check.py -> Checked 18 Markdown files and 405 links.
  • python3 tests/bidi_controls_check.py -> no bidirectional controls
  • git diff --check origin/main...HEAD -> clean
  • Mutation: changed the green component in the table from (w >> 8) to (w >> 16) in gfx2hlsl.py. Both startup_vertex_fetch_formats_check.py controls and startup_stream_fetch_check.py failed (AssertionError), so the tests kill a channel swap. Reverted with git checkout -- ..

Not run: the D3D12 WARP readback (startup_vertex_fetch_formats_check.py <dxc> <offscreen_check> warp). I did not queue the Windows VM; the PR body reports it passed on the earlier head, and the delta since then is docs only.

Nits

  • N1: the doc paragraph says the fixture "exercises each format" but lists only the original ten names; consider adding 16_16_SNORM, 16_16_16_16_FLOAT and 8_8_8_8_UINT to the list so it is complete.

Process note for the maintainer: no CI checks are reported on this head. The Windows CI run needs maintainer approval before it starts.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6051665651 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2193#pullrequestreview-6051665651). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T03:59:39Z. **Review:** COMMENTED --- Re-review of head `0f506b562778141bc6b7763b675617019be8cbff` (previous review covered `e375e5c5`; the only change since is a docs wording fix in `docs/experiments.md`). **Verdict: no P1, no P2.** What I checked - `tools/startup/gfx2hlsl.py`: format 60 (`BUF_FMT_8_8_8_8_UINT`, matches the gfx10 numbering in `tools/disasm_rdna2.py:1293`) is added to `FETCH_FORMATS` with the same `ldu()` unaligned load as the UNORM sibling and raw byte extraction `w & 255u`, `(w >> 8) & 255u`, `(w >> 16) & 255u`, `w >> 24`. The sibling table `FETCH_DXGI` gets DXGI 30 (`R8G8B8A8_UINT`), next to 28 (`R8G8B8A8_UNORM`). Byte order and unsigned semantics are correct. - Tests extend the existing suites (`startup_vertex_fetch_formats_check.py` FORMATS and MUTATIONS, `startup_stream_fetch_check.py` DXGI layout) instead of adding a new file. Stride 5 / offset 3 covers all four dword alignments. - Docs: the vertex-fetch section no longer hard-codes "ten formats". Title is neutral, PR is MERGEABLE, clean-room wording is fine. Commands run locally on the head (Linux): - `python3 -B tests/startup_vertex_fetch_formats_check.py controls` -> `vertex fetch format controls passed` - `python3 -B tests/startup_stream_fetch_check.py` -> passed (includes the new DXGI 30 record) - `python3 tests/docs_links_check.py` -> `Checked 18 Markdown files and 405 links.` - `python3 tests/bidi_controls_check.py` -> no bidirectional controls - `git diff --check origin/main...HEAD` -> clean - Mutation: changed the green component in the table from `(w >> 8)` to `(w >> 16)` in `gfx2hlsl.py`. Both `startup_vertex_fetch_formats_check.py controls` and `startup_stream_fetch_check.py` failed (`AssertionError`), so the tests kill a channel swap. Reverted with `git checkout -- .`. Not run: the D3D12 WARP readback (`startup_vertex_fetch_formats_check.py <dxc> <offscreen_check> warp`). I did not queue the Windows VM; the PR body reports it passed on the earlier head, and the delta since then is docs only. Nits - N1: the doc paragraph says the fixture "exercises each format" but lists only the original ten names; consider adding `16_16_SNORM`, `16_16_16_16_FLOAT` and `8_8_8_8_UINT` to the list so it is complete. Process note for the maintainer: no CI checks are reported on this head. The Windows CI run needs maintainer approval before it starts. AI-assisted; commands listed were executed locally.
RavenCurseBurg commented 2026-11-25 04:04:20 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T03:57:07Z.


Restored the pointer to the 16_16_SNORM signed endpoint and negative-control checks in 0f506b56. The docs link check (405 links), bidi check and vertex-fetch format controls passed on this head. Thanks for recording both the initial Release failure and the isolated rerun.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7152391193 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2193#issuecomment-7152391193). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T03:57:07Z. --- Restored the pointer to the `16_16_SNORM` signed endpoint and negative-control checks in `0f506b56`. The docs link check (405 links), bidi check and vertex-fetch format controls passed on this head. Thanks for recording both the initial Release failure and the isolated rerun.
tedin7 commented 2026-11-25 05:04:49 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T04:09:07Z.

Review: COMMENTED


Re-review of head 5405e67b9b440f754f2d0c7cf24dc73b3bad594d (3 commits over main; 4 files, +17/-5 in the latest diff stat).

Scope read: FETCH_DXGI 30 -> BUF_FMT_8_8_8_8_UINT (stride 4), the FETCH_FORMATS entry (ldu, w & 255u, (w >> 8) & 255u, (w >> 16) & 255u, w >> 24), the new translate case in tests/startup_stream_fetch_check.py, the new format and mutation in tests/startup_vertex_fetch_formats_check.py, and the docs/experiments.md wording.

Commands executed locally (Linux):

  • python3 tests/startup_stream_fetch_check.py -> passes (new R8G8B8A8_UINT translate case included).
  • python3 tests/startup_vertex_fetch_formats_check.py controls -> vertex fetch format controls passed.
  • python3 tests/docs_links_check.py -> self-test passed, 18 files / 405 links.
  • python3 tests/bidi_controls_check.py -> no bidirectional controls in 1479 files.
  • git diff --check origin/main...HEAD -> clean.
  • Mutation: changed the Z expression (w >> 16) & 255u to (w >> 8) & 255u in FETCH_FORMATS -> startup_stream_fetch_check.py fails (rc=1), so the test kills it. Reverted.

Findings

  • P1: none.
  • P2: none.
  • nit: that Z mutation is killed only by the translate string check. The MUTATIONS list for the device run covers only the green byte for this format. Optional: add a mutation for Z or W.
  • nit: the docs say "On WARP, all 64 component words matched". I could not reproduce that on Linux (no D3D12 here); it rests on the author's Windows run. I did not run x2w_pipe.py win2025; the device run belongs to the Windows gate.

Status: mergeable, title neutral, no clean-room concerns seen in the diff. No CI checks are reported on the branch. The Linux-side logic looks correct.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6051731306 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2193#pullrequestreview-6051731306). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T04:09:07Z. **Review:** COMMENTED --- Re-review of head `5405e67b9b440f754f2d0c7cf24dc73b3bad594d` (3 commits over main; 4 files, +17/-5 in the latest diff stat). **Scope read:** `FETCH_DXGI` 30 -> `BUF_FMT_8_8_8_8_UINT` (stride 4), the `FETCH_FORMATS` entry (`ldu`, `w & 255u`, `(w >> 8) & 255u`, `(w >> 16) & 255u`, `w >> 24`), the new translate case in `tests/startup_stream_fetch_check.py`, the new format and mutation in `tests/startup_vertex_fetch_formats_check.py`, and the `docs/experiments.md` wording. **Commands executed locally (Linux):** - `python3 tests/startup_stream_fetch_check.py` -> passes (new R8G8B8A8_UINT translate case included). - `python3 tests/startup_vertex_fetch_formats_check.py controls` -> `vertex fetch format controls passed`. - `python3 tests/docs_links_check.py` -> self-test passed, 18 files / 405 links. - `python3 tests/bidi_controls_check.py` -> no bidirectional controls in 1479 files. - `git diff --check origin/main...HEAD` -> clean. - Mutation: changed the Z expression `(w >> 16) & 255u` to `(w >> 8) & 255u` in `FETCH_FORMATS` -> `startup_stream_fetch_check.py` fails (rc=1), so the test kills it. Reverted. **Findings** - P1: none. - P2: none. - nit: that Z mutation is killed only by the translate string check. The `MUTATIONS` list for the device run covers only the green byte for this format. Optional: add a mutation for Z or W. - nit: the docs say "On WARP, all 64 component words matched". I could not reproduce that on Linux (no D3D12 here); it rests on the author's Windows run. I did not run `x2w_pipe.py win2025`; the device run belongs to the Windows gate. **Status:** mergeable, title neutral, no clean-room concerns seen in the diff. No CI checks are reported on the branch. The Linux-side logic looks correct. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 05:04:49 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T04:23:30Z.

Review: COMMENTED


Re-review of head fa528dc03c1c7b63d0d5d2469382c52aab7c2a10 (shader: lower unsigned RGBA8 vertex fetches). Comment-only review.

Scope: 4 files, +18/-5: tools/startup/gfx2hlsl.py (FETCH_DXGI 30 -> BUF_FMT_8_8_8_8_UINT, one FETCH_FORMATS row), tests/startup_vertex_fetch_formats_check.py, tests/startup_stream_fetch_check.py, docs/experiments.md.

Correctness

  • DXGI 30 = R8G8B8A8_UINT; gfx10 buffer format 60 = 8_8_8_8_UINT. Both match the siblings (28/56 for UNORM). Size 4 is right.
  • Row is ldu({0}, a) plus w & 255u, (w >> 8) & 255u, (w >> 16) & 255u, w >> 24: little-endian, unsigned, raw integers with no normalization. w >> 24 on uint needs no mask. Unaligned element is handled by ldu(), as for UNORM.
  • Sibling tables checked (FETCH_DXGI next to FETCH_FORMATS, the tbuffer format table, the formats fixture, the stream-fetch translate case). No gap found.
  • Docs now list the added formats (16_16_SNORM, 16_16_16_16_FLOAT, 8_8_8_8_UINT) and separate the original ten-format controls. Consistent with the FORMATS dict.

Commands executed locally (all in the review worktree)

  • python3 tests/startup_vertex_fetch_formats_check.py controls -> vertex fetch format controls passed
  • python3 -B tests/startup_stream_fetch_check.py (translate cases, includes the new rgba8_uint case) -> passed
  • python3 tests/docs_links_check.py -> Checked 18 Markdown files and 405 links.
  • python3 tests/bidi_controls_check.py -> no bidirectional controls
  • git diff --check origin/main...HEAD -> clean
  • gh pr checks -> no checks reported on the branch. PR is MERGEABLE.

Mutations

  • Changing the blue entry in the FETCH_FORMATS row: the harness itself asserts on its own source anchor, so it fails fast (precondition of the new blue byte from green mutation).
  • Changing the W entry w >> 24 to w >> 16: survives both Linux checks. Expected, since the translate case uses an XYZ record and the controls do not evaluate the new row. Only the D3D12 readback (startup_vertex_fetch_formats_warp/_hardware) can kill it.

Findings

  • P1: none.
  • P2: none.
  • nit: the Linux-only checks never look at the W expression of the new row. Optional: add a w >> 24 line to the translate case with a 4-component record, or a W mutation in MUTATIONS, so a W regression also fails without a device.
  • nit: the docs state "all 64 component words matched" on WARP. I did not run Windows here, so that device result is the author's and unverified by me. A Win2025 WARP run of startup_vertex_fetch_formats_warp should confirm it before Ready.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6051830129 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2193#pullrequestreview-6051830129). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T04:23:30Z. **Review:** COMMENTED --- Re-review of head `fa528dc03c1c7b63d0d5d2469382c52aab7c2a10` (`shader: lower unsigned RGBA8 vertex fetches`). Comment-only review. **Scope:** 4 files, +18/-5: `tools/startup/gfx2hlsl.py` (FETCH_DXGI 30 -> `BUF_FMT_8_8_8_8_UINT`, one FETCH_FORMATS row), `tests/startup_vertex_fetch_formats_check.py`, `tests/startup_stream_fetch_check.py`, `docs/experiments.md`. **Correctness** - DXGI 30 = `R8G8B8A8_UINT`; gfx10 buffer format 60 = `8_8_8_8_UINT`. Both match the siblings (`28`/`56` for UNORM). Size 4 is right. - Row is `ldu({0}, a)` plus `w & 255u`, `(w >> 8) & 255u`, `(w >> 16) & 255u`, `w >> 24`: little-endian, unsigned, raw integers with no normalization. `w >> 24` on `uint` needs no mask. Unaligned element is handled by `ldu()`, as for UNORM. - Sibling tables checked (`FETCH_DXGI` next to `FETCH_FORMATS`, the tbuffer format table, the formats fixture, the stream-fetch translate case). No gap found. - Docs now list the added formats (16_16_SNORM, 16_16_16_16_FLOAT, 8_8_8_8_UINT) and separate the original ten-format controls. Consistent with the FORMATS dict. **Commands executed locally (all in the review worktree)** - `python3 tests/startup_vertex_fetch_formats_check.py controls` -> `vertex fetch format controls passed` - `python3 -B tests/startup_stream_fetch_check.py` (translate cases, includes the new rgba8_uint case) -> passed - `python3 tests/docs_links_check.py` -> `Checked 18 Markdown files and 405 links.` - `python3 tests/bidi_controls_check.py` -> `no bidirectional controls` - `git diff --check origin/main...HEAD` -> clean - `gh pr checks` -> no checks reported on the branch. PR is MERGEABLE. **Mutations** - Changing the blue entry in the FETCH_FORMATS row: the harness itself asserts on its own source anchor, so it fails fast (precondition of the new `blue byte from green` mutation). - Changing the W entry `w >> 24` to `w >> 16`: **survives** both Linux checks. Expected, since the translate case uses an XYZ record and the controls do not evaluate the new row. Only the D3D12 readback (`startup_vertex_fetch_formats_warp`/`_hardware`) can kill it. **Findings** - P1: none. - P2: none. - nit: the Linux-only checks never look at the W expression of the new row. Optional: add a `w >> 24` line to the translate case with a 4-component record, or a W mutation in `MUTATIONS`, so a W regression also fails without a device. - nit: the docs state "all 64 component words matched" on WARP. I did not run Windows here, so that device result is the author's and unverified by me. A Win2025 WARP run of `startup_vertex_fetch_formats_warp` should confirm it before Ready. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 05:04:49 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T04:47:02Z.

Review: COMMENTED


Re-review of head a28a2b1e21.

Scope: 4 files, +19/-5. Adds BUF_FMT_8_8_8_8_UINT (gfx10 format 60) to FETCH_FORMATS and DXGI 30 (R8G8B8A8_UINT) to FETCH_DXGI in tools/startup/gfx2hlsl.py:105,110, plus tests and a docs note.

Findings: P1=0, P2=0.

  • Semantics OK: format 60 matches the tools/disasm_rdna2.py:1293 table; DXGI 30 is R8G8B8A8_UINT. The four bytes load in address order through ldu, as the unaligned UNORM sibling does. Components stay raw uint with no float conversion, and no default-component assumption is needed because all four fields exist.
  • Tests extend the existing suites. startup_stream_fetch_check.py checks the three byte extractions and the v7 = w >> 24 alpha path. The startup_vertex_fetch_formats_check.py table gains a UINT entry plus three mutations: normalized green, blue read from green, alpha read from blue.
  • nit: the stream translate case asserts only 3 of the 4 components, since the record is XYZ. The alpha byte is covered by the formats check instead, which is fine.
  • Mergeable. The branch reports no CI checks. The title is neutral.

Commands executed locally in the worktree:

  • git diff --stat origin/main...HEAD: 4 files, 19 insertions, 5 deletions.
  • python3 tests/startup_vertex_fetch_formats_check.py controls: "vertex fetch format controls passed".
  • python3 tests/startup_stream_fetch_check.py: "Self-test passed."
  • python3 tests/docs_links_check.py: 18 files, 405 links.
  • python3 tests/bidi_controls_check.py: no bidirectional controls.
  • git diff --check origin/main...HEAD: clean.
  • Mutation: I changed the blue extraction in the new FETCH_FORMATS entry to (w >> 8) & 255u. Both checks failed (the stream translate assertion, and the formats-check mutation precondition for 'blue byte from green'). I then reverted with git checkout -- ..
  • Not run: Win2025 WARP readback. The formats check is the D3D12 WARP readback harness, and it is the Windows-only part (<dxc> <offscreen_check> <adapter> mode). I ran only the Linux controls mode. A real WARP pass on this head is still needed before Ready.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6051995845 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2193#pullrequestreview-6051995845). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T04:47:02Z. **Review:** COMMENTED --- Re-review of head a28a2b1e217340620d29e866c3cac8ca05e44244. Scope: 4 files, +19/-5. Adds `BUF_FMT_8_8_8_8_UINT` (gfx10 format 60) to `FETCH_FORMATS` and DXGI 30 (`R8G8B8A8_UINT`) to `FETCH_DXGI` in `tools/startup/gfx2hlsl.py:105,110`, plus tests and a docs note. Findings: P1=0, P2=0. - Semantics OK: format 60 matches the `tools/disasm_rdna2.py:1293` table; DXGI 30 is R8G8B8A8_UINT. The four bytes load in address order through `ldu`, as the unaligned UNORM sibling does. Components stay raw `uint` with no float conversion, and no default-component assumption is needed because all four fields exist. - Tests extend the existing suites. `startup_stream_fetch_check.py` checks the three byte extractions and the `v7 = w >> 24` alpha path. The `startup_vertex_fetch_formats_check.py` table gains a UINT entry plus three mutations: normalized green, blue read from green, alpha read from blue. - nit: the stream translate case asserts only 3 of the 4 components, since the record is XYZ. The alpha byte is covered by the formats check instead, which is fine. - Mergeable. The branch reports no CI checks. The title is neutral. Commands executed locally in the worktree: - `git diff --stat origin/main...HEAD`: 4 files, 19 insertions, 5 deletions. - `python3 tests/startup_vertex_fetch_formats_check.py controls`: "vertex fetch format controls passed". - `python3 tests/startup_stream_fetch_check.py`: "Self-test passed." - `python3 tests/docs_links_check.py`: 18 files, 405 links. - `python3 tests/bidi_controls_check.py`: no bidirectional controls. - `git diff --check origin/main...HEAD`: clean. - Mutation: I changed the blue extraction in the new FETCH_FORMATS entry to `(w >> 8) & 255u`. Both checks failed (the stream translate assertion, and the formats-check mutation precondition for 'blue byte from green'). I then reverted with `git checkout -- .`. - Not run: Win2025 WARP readback. The formats check is the D3D12 WARP readback harness, and it is the Windows-only part (`<dxc> <offscreen_check> <adapter>` mode). I ran only the Linux `controls` mode. A real WARP pass on this head is still needed before Ready. AI-assisted; commands listed were executed locally.
RavenCurseBurg commented 2026-11-25 05:04:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T04:04:24Z.


Addressed N1 in 5405e67b. The experiment guide now names all 13 formats and identifies the earlier ten-format measurements. I checked the list against the fixture and reran the WARP readback on this revision. All 13 formats matched for 16 vertices each, and all 10 mutated shaders produced a mismatch. The stream-fetch, documentation link and bidi checks also passed.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7152503308 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2193#issuecomment-7152503308). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T04:04:24Z. --- Addressed N1 in `5405e67b`. The experiment guide now names all 13 formats and identifies the earlier ten-format measurements. I checked the list against the fixture and reran the WARP readback on this revision. All 13 formats matched for 16 vertices each, and all 10 mutated shaders produced a mismatch. The stream-fetch, documentation link and bidi checks also passed.
RavenCurseBurg commented 2026-11-25 05:04:56 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T04:15:25Z.


Added the suggested device mutation in fa528dc0. It replaces the blue byte with the green byte in the generated shader. I ran python -B tests/startup_vertex_fetch_formats_check.py <dxc> <offscreen_check> warp on Windows. The unmodified RGBA8 UINT shader matched all 64 component words, and the new shader produced a readback mismatch. All 13 formats passed and the fixture caught all 11 shader mutations. The standalone stream-fetch check also passed.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7152676028 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2193#issuecomment-7152676028). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T04:15:25Z. --- Added the suggested device mutation in `fa528dc0`. It replaces the blue byte with the green byte in the generated shader. I ran `python -B tests/startup_vertex_fetch_formats_check.py <dxc> <offscreen_check> warp` on Windows. The unmodified RGBA8 UINT shader matched all 64 component words, and the new shader produced a readback mismatch. All 13 formats passed and the fixture caught all 11 shader mutations. The standalone stream-fetch check also passed.
RavenCurseBurg commented 2026-11-25 05:04:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-25T04:38:26Z.


Added the W mutation in a28a2b1e. I also changed the translator's W expression in memory to read Z and ran controls() without a device. It failed at the new alpha check, while the original expression passed. On Windows, python -B tests/startup_vertex_fetch_formats_check.py <dxc> <offscreen_check> warp passed all 13 unmodified formats and detected all 12 shader mutations, including the new alpha case.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7153028837 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2193#issuecomment-7153028837). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-25T04:38:26Z. --- Added the W mutation in `a28a2b1e`. I also changed the translator's W expression in memory to read Z and ran `controls()` without a device. It failed at the new alpha check, while the original expression passed. On Windows, `python -B tests/startup_vertex_fetch_formats_check.py <dxc> <offscreen_check> warp` passed all 13 unmodified formats and detected all 12 shader mutations, including the new alpha case.
tedin7 commented 2026-11-25 06:01:23 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T05:15:50Z.

Review: COMMENTED


Re-review of head c1b5d3f8ba8dce32cd2fba12efa00ebf215cc3e5 (diff vs origin/main: 4 files, +19/-5).

Result: no P1, no P2. Looks correct.

What I checked

  • FETCH_DXGI[30] = BUF_FMT_8_8_8_8_UINT matches DXGI_FORMAT_R8G8B8A8_UINT (30); gfx10 unified format 60 is 8_8_8_8_UINT (UNORM=56 sits right before it in the same family).
  • FETCH_FORMATS['BUF_FMT_8_8_8_8_UINT']: one ldu() word, bytes taken low to high, w >> 24 needs no mask on a 32-bit uint. All four components are present, so there is no default-component question. Raw integers are kept, with no float conversion.
  • Siblings checked: FETCH_DXGI and FETCH_FORMATS both extended, the device fixture table (FORMATS) and the translate test in startup_stream_fetch_check.py both extended, and docs updated. startup_stream_fetch_* is wired in CMake and windows.yml.
  • startup_stream_fetch_check.py uses layout format 30 and asserts the exact ldu plus three byte-extract lines. That covers the DXGI mapping.
  • CI on this head: Linux checks pass, gfx1013 fixtures pass, Windows build and test pass. Mergeable.
  • Title is neutral. Nothing in the diff looks clean-room-sensitive.

Commands run locally in a worktree at this head

  • python3 tests/startup_vertex_fetch_formats_check.py controls -> vertex fetch format controls passed
  • python3 tests/docs_links_check.py -> Checked 18 Markdown files and 407 links.
  • python3 tests/bidi_controls_check.py -> no bidirectional controls.
  • git diff --check origin/main...HEAD -> clean
  • Mutation 1: in gfx2hlsl.py, the UINT alpha w >> 24 changed to (w >> 16) & 255u. The controls fail with AssertionError: ('BUF_FMT_8_8_8_8_UINT', 'alpha byte from blue'). Killed.
  • Mutation 2: green (w >> 8) & 255u changed to w >> 8. The controls fail with AssertionError: ('BUF_FMT_8_8_8_8_UINT', 'normalized green byte'). Killed. Both mutations were reverted with git checkout -- ..

Nits (non-blocking)

  • docs/experiments.md (new paragraph): it says WARP matched all 64 component words and that wrong references "each triggered a mismatch". I did not re-run the D3D12 WARP draw on Windows for this review. I am relying on the green Windows CI for the stream-fetch test. The device-side run of startup_vertex_fetch_formats_warp is not something I verified.
  • The new mutation entries only prove the translator output contains the expected text (the old in source assert). The device-side kill of those mutations is only covered by the WARP run.
  • The rewritten docs paragraph now says "the original ten" and then lists 16_16_SNORM, 16_16_16_16_FLOAT and 8_8_8_8_UINT as extra. The sentence "Before this check, only 8_UINT and 8_UNORM were run" now sits after that list and reads a bit out of order. Cosmetic.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6052200968 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2193#pullrequestreview-6052200968). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T05:15:50Z. **Review:** COMMENTED --- Re-review of head `c1b5d3f8ba8dce32cd2fba12efa00ebf215cc3e5` (diff vs origin/main: 4 files, +19/-5). **Result: no P1, no P2. Looks correct.** What I checked - `FETCH_DXGI[30] = BUF_FMT_8_8_8_8_UINT` matches `DXGI_FORMAT_R8G8B8A8_UINT` (30); gfx10 unified format 60 is 8_8_8_8_UINT (UNORM=56 sits right before it in the same family). - `FETCH_FORMATS['BUF_FMT_8_8_8_8_UINT']`: one `ldu()` word, bytes taken low to high, `w >> 24` needs no mask on a 32-bit uint. All four components are present, so there is no default-component question. Raw integers are kept, with no float conversion. - Siblings checked: `FETCH_DXGI` and `FETCH_FORMATS` both extended, the device fixture table (`FORMATS`) and the translate test in `startup_stream_fetch_check.py` both extended, and docs updated. `startup_stream_fetch_*` is wired in CMake and `windows.yml`. - `startup_stream_fetch_check.py` uses layout format 30 and asserts the exact `ldu` plus three byte-extract lines. That covers the DXGI mapping. - CI on this head: Linux checks pass, gfx1013 fixtures pass, Windows build and test pass. Mergeable. - Title is neutral. Nothing in the diff looks clean-room-sensitive. Commands run locally in a worktree at this head - `python3 tests/startup_vertex_fetch_formats_check.py controls` -> `vertex fetch format controls passed` - `python3 tests/docs_links_check.py` -> `Checked 18 Markdown files and 407 links.` - `python3 tests/bidi_controls_check.py` -> `no bidirectional controls.` - `git diff --check origin/main...HEAD` -> clean - Mutation 1: in `gfx2hlsl.py`, the UINT alpha `w >> 24` changed to `(w >> 16) & 255u`. The controls fail with `AssertionError: ('BUF_FMT_8_8_8_8_UINT', 'alpha byte from blue')`. Killed. - Mutation 2: green `(w >> 8) & 255u` changed to `w >> 8`. The controls fail with `AssertionError: ('BUF_FMT_8_8_8_8_UINT', 'normalized green byte')`. Killed. Both mutations were reverted with `git checkout -- .`. Nits (non-blocking) - `docs/experiments.md` (new paragraph): it says WARP matched all 64 component words and that wrong references "each triggered a mismatch". I did not re-run the D3D12 WARP draw on Windows for this review. I am relying on the green Windows CI for the stream-fetch test. The device-side run of `startup_vertex_fetch_formats_warp` is not something I verified. - The new mutation entries only prove the translator output contains the expected text (the `old in source` assert). The device-side kill of those mutations is only covered by the WARP run. - The rewritten docs paragraph now says "the original ten" and then lists 16_16_SNORM, 16_16_16_16_FLOAT and 8_8_8_8_UINT as extra. The sentence "Before this check, only 8_UINT and 8_UNORM were run" now sits after that list and reads a bit out of order. Cosmetic. AI-assisted; commands listed were executed locally.
stan495 commented 2026-11-25 06:01:23 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-25T05:31:27Z.

Review: APPROVED


Verified head c1b5d3f8 on Windows x64 (dev preset, MSVC 19.44.35228.0, SDK/DXC 10.0.26100.0):

  • python -B tests/startup_stream_fetch_check.py -> passed
  • ctest --preset dev --no-tests=error -R '^startup_vertex_fetch_formats_' -V -> 3/3 passed (startup_vertex_fetch_formats_controls, startup_vertex_fetch_formats_warp, startup_vertex_fetch_formats_hardware)
    • 13 buffer formats (including BUF_FMT_8_8_8_8_UINT), 16 vertices each, 320 compared words per format, 0 mismatches, and all 12 mutation controls failed as expected.
    • Hardware: AMD Radeon RX 7900 XTX (vendor=1002 device=744c, driver 32.0.32029.2010)
    • WARP: Microsoft Basic Render Driver (vendor=1414 device=008c, driver 10.0.26100.9818)

Verdict: Approved at c1b5d3f8.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6052322400 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2193#pullrequestreview-6052322400). Originally posted by [stan495](https://github.com/stan495) on 2026-11-25T05:31:27Z. **Review:** APPROVED --- Verified head `c1b5d3f8` on Windows x64 (`dev` preset, MSVC `19.44.35228.0`, SDK/DXC `10.0.26100.0`): - `python -B tests/startup_stream_fetch_check.py` -> passed - `ctest --preset dev --no-tests=error -R '^startup_vertex_fetch_formats_' -V` -> 3/3 passed (`startup_vertex_fetch_formats_controls`, `startup_vertex_fetch_formats_warp`, `startup_vertex_fetch_formats_hardware`) - 13 buffer formats (including `BUF_FMT_8_8_8_8_UINT`), 16 vertices each, 320 compared words per format, 0 mismatches, and all 12 mutation controls failed as expected. - Hardware: `AMD Radeon RX 7900 XTX` (`vendor=1002 device=744c`, driver `32.0.32029.2010`) - WARP: `Microsoft Basic Render Driver` (`vendor=1414 device=008c`, driver `10.0.26100.9818`) Verdict: Approved at `c1b5d3f8`.
upstream-sync closed this pull request 2026-11-25 10:05:17 +00:00
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
R0Y00/Xbox2Windows!2185
No description provided.