startup: lower pixel-stage image_store to a typed UAV store #2147

Merged
rasptum merged 11 commits from upstream-pr/2155 into main 2026-11-25 08:43:45 +00:00
rasptum commented 2026-11-25 01:48:55 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-25T01:48:55Z.


Refs #1996 (item F).

Today tools/startup/gfx2hlsl.py has no image_store handler, so the instruction is refused in every stage.

Translator

  • In a pixel stage, image_store with dim:SQ_RSRC_IMG_2D and dmask:0xf now becomes w<n>[uint2(x, y)] = asfloat(uint4(data)) on a RWTexture2D<float4> w<n> : register(u<n>).
  • The store runs under the lane's exec bit, like the other per-lane writes. D3D drops UAV writes from helper lanes, as the hardware drops them for inactive lanes.
  • The manifest becomes version 2 and gains uav <index> tex2d table <table> <offset>. Programs without a store keep version 1.
  • Semantics:
    • MIMG opcode 0x08, from LLVM AMDGPU MIMGInstructions.td (IMAGE_STORE, defined through MIMG_Store). VDATA is the source, VADDR the integer texel address (x, y for dim 2D) and SRSRC the image descriptor. The DMASK channels are written in order from consecutive VDATA registers.
    • Mesa ACO's visit_image_store emits the same form, with DMASK taken from the write mask.
    • A typed UAV store writes every channel of the view, so only DMASK 0xf is exact.
  • Accepted: glc, slc, dlc.
  • Refused by name, because none of them is covered:
    • a partial DMASK;
    • 1D, 3D and 2D-array images;
    • d16, a16, tfe, lwe, r128, unorm and the reserved bit;
    • image_store_mip;
    • a store outside a pixel stage;
    • a program that both loads and stores the same image, which would need a read-write view.

Runtime: the translated graphics path does not bind UAVs yet. d3d12_draw.inl now logs and skips a translation whose manifest has a uav line. Before, such a line was rejected as an invalid sampler-heap line. Binding the view, with a UAV range in the translated root signature and a view made from the title's image descriptor, is a separate follow-up.

Fixture: tests/startup_pixel_image_store_check.py, a hand-assembled gfx1013 pixel program with no bytes from any retail software. It loads a descriptor from table 0, stores 1.0, 2.0, 3.0 and 4.0 at texel (1, 2), and exports the same values.

  • The words are decoded back with tools/disasm_rdna2.py. binary <llvm-mc> reassembles the source and compares, but I could not run that here because no llvm-mc is available.
  • Controls check the HLSL, the manifest, the accepted cache bits and every refusal above.
  • Negative control: with op_image_store removed, the program is refused again.
  • The draw (offscreen_check --startup-image-store, new file tests/startup_image_store.cpp) compiles the translation with DXC and draws one pixel. It reads back all 16 texels of a 4x4 R32G32B32A32_FLOAT image that starts at -1.0.
  • Texel (1, 2) must hold the four values and every other texel must still hold -1.0. Two mutants of the translated shader must be detected:
    • with the store deleted, texel (1, 2) stays -1.0;
    • with x and y exchanged, the write lands at (2, 1).

Overlap: #2059 (vertex-stage buffer_store_*) also adds a uav <slot> table <param> <offset> line under x2w-manifest 2, for a RWByteAddressBuffer. This PR's line names its kind (tex2d) so the two forms stay distinguishable. If both land, they need one shared u register numbering; this PR numbers stored images from u0.

Test (Windows 10 19045, NVIDIA GeForce RTX 3060, driver 32.0.15.9636, and WARP; debug layer enabled):

cmake --build --preset dev --target offscreen_check
ctest --preset dev --no-tests=error -R '^(startup_pixel_image_store_.*|startup_image_(3d|load_mip|2d_array)_.*)$' -V
  • dev: 12 passed, 0 failed, 0 skipped. startup_pixel_image_store_{controls,warp,hardware} pass; the draw reports texel (1, 2) written and the other 15 untouched, with both mutants detected and no debug-layer errors.
  • release (the same commands with --preset release): 12 passed, 0 failed, 0 skipped.
  • The existing tests/startup_gfx2hlsl_*_check.py and tests/startup_translator_check.py all pass, together with the new check and the image 3D / mip / 2D-array checks: 41 scripts, 0 failures. tests/docs_links_check.py and tests/bidi_controls_check.py also pass.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6595268755 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2155). Originally posted by [rasptum](https://github.com/rasptum) on 2026-11-25T01:48:55Z. --- Refs #1996 (item F). Today `tools/startup/gfx2hlsl.py` has no `image_store` handler, so the instruction is refused in every stage. **Translator** - In a pixel stage, `image_store` with `dim:SQ_RSRC_IMG_2D` and `dmask:0xf` now becomes `w<n>[uint2(x, y)] = asfloat(uint4(data))` on a `RWTexture2D<float4> w<n> : register(u<n>)`. - The store runs under the lane's exec bit, like the other per-lane writes. D3D drops UAV writes from helper lanes, as the hardware drops them for inactive lanes. - The manifest becomes version 2 and gains `uav <index> tex2d table <table> <offset>`. Programs without a store keep version 1. - Semantics: - MIMG opcode 0x08, from LLVM AMDGPU `MIMGInstructions.td` (`IMAGE_STORE`, defined through `MIMG_Store`). VDATA is the source, VADDR the integer texel address (x, y for dim 2D) and SRSRC the image descriptor. The DMASK channels are written in order from consecutive VDATA registers. - Mesa ACO's `visit_image_store` emits the same form, with DMASK taken from the write mask. - A typed UAV store writes every channel of the view, so only DMASK 0xf is exact. - Accepted: `glc`, `slc`, `dlc`. - Refused by name, because none of them is covered: - a partial DMASK; - 1D, 3D and 2D-array images; - `d16`, `a16`, `tfe`, `lwe`, `r128`, `unorm` and the reserved bit; - `image_store_mip`; - a store outside a pixel stage; - a program that both loads and stores the same image, which would need a read-write view. **Runtime:** the translated graphics path does not bind UAVs yet. `d3d12_draw.inl` now logs and skips a translation whose manifest has a `uav` line. Before, such a line was rejected as an invalid sampler-heap line. Binding the view, with a UAV range in the translated root signature and a view made from the title's image descriptor, is a separate follow-up. **Fixture:** `tests/startup_pixel_image_store_check.py`, a hand-assembled gfx1013 pixel program with no bytes from any retail software. It loads a descriptor from table 0, stores 1.0, 2.0, 3.0 and 4.0 at texel (1, 2), and exports the same values. - The words are decoded back with `tools/disasm_rdna2.py`. `binary <llvm-mc>` reassembles the source and compares, but I could not run that here because no llvm-mc is available. - Controls check the HLSL, the manifest, the accepted cache bits and every refusal above. - Negative control: with `op_image_store` removed, the program is refused again. - The draw (`offscreen_check --startup-image-store`, new file `tests/startup_image_store.cpp`) compiles the translation with DXC and draws one pixel. It reads back all 16 texels of a 4x4 R32G32B32A32_FLOAT image that starts at -1.0. - Texel (1, 2) must hold the four values and every other texel must still hold -1.0. Two mutants of the translated shader must be detected: - with the store deleted, texel (1, 2) stays -1.0; - with x and y exchanged, the write lands at (2, 1). Overlap: #2059 (vertex-stage `buffer_store_*`) also adds a `uav <slot> table <param> <offset>` line under `x2w-manifest 2`, for a `RWByteAddressBuffer`. This PR's line names its kind (`tex2d`) so the two forms stay distinguishable. If both land, they need one shared `u` register numbering; this PR numbers stored images from u0. Test (Windows 10 19045, NVIDIA GeForce RTX 3060, driver 32.0.15.9636, and WARP; debug layer enabled): ```powershell cmake --build --preset dev --target offscreen_check ctest --preset dev --no-tests=error -R '^(startup_pixel_image_store_.*|startup_image_(3d|load_mip|2d_array)_.*)$' -V ``` - dev: 12 passed, 0 failed, 0 skipped. `startup_pixel_image_store_{controls,warp,hardware}` pass; the draw reports texel (1, 2) written and the other 15 untouched, with both mutants detected and no debug-layer errors. - release (the same commands with `--preset release`): 12 passed, 0 failed, 0 skipped. - The existing `tests/startup_gfx2hlsl_*_check.py` and `tests/startup_translator_check.py` all pass, together with the new check and the image 3D / mip / 2D-array checks: 41 scripts, 0 failures. `tests/docs_links_check.py` and `tests/bidi_controls_check.py` also pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tedin7 commented 2026-11-25 03:01:10 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T02:08:14Z.

Review: COMMENTED


Review of head f14d392d3acf065f2f130bc876f17a4b397249b6 (non-blocking comment, no approval).

Scope: pixel-stage image_store lowered to a RWTexture2D<float4> store (gfx2hlsl), manifest v2 uav line, runtime refusal for uav manifests, new Python controls and a desktop draw readback test, docs.

Checked:

  • CI on this head: Windows build and test pass, Linux Python checks pass, gfx1013 fixtures pass.
  • Mergeable, title neutral, no clean-room concerns seen in the diff.
  • The lowering matches the ISA shape: VDATA is four consecutive VGPRs, the address is x and y, and the store runs under exec. Refusing 1D, 3D, array, partial masks, image_store_mip, non-pixel stages, and load+store of the same image is sensible.
  • The runtime logs and skips a translation with a uav line, so nothing is bound wrongly.

Findings:

  • P1: none.
  • P2: the dmask != 0xf guard (tools/startup/gfx2hlsl.py, in op_image_store) is not killed by the tests. I replaced the condition with if False: and tests/startup_pixel_image_store_check.py still passed. The "dmask 0x7" and "dmask 0x1" controls are refused earlier by the "four VGPRs expected" check, because the patched encoding also changes the data register count. Suggest a control that keeps v[4:7] with a partial dmask (call op_image_store directly with ['v[4:7]','v[0:1]','s[16:23]'] and dmask:0x7) so the guard itself is exercised. The refusal text names the wrong reason in the current controls.
  • Nit: stored_images() uses __dict__.setdefault to cover pipelines built without __init__. Giving uavs a class-level default or fixing the test constructors would be clearer.
  • Nit: the docs bullet has a short broken line ("The cache-policy" wraps oddly); cosmetic.

Mutations run (then git checkout -- .):

  • Swapped x and y in the store address: startup_pixel_image_store_check.py exits 1, so the test kills it.
  • Disabled the dmask guard: the test still exits 0, so it survives (the P2 above).

Not run: Win2025 WARP/hardware draw (startup_pixel_image_store_warp/hardware) was not run locally. I rely on the Windows CI job being green. I did not confirm that job includes these ctest names.

Commands executed locally in the worktree:

  • python3 -B tests/startup_pixel_image_store_check.py -> Self-test passed
  • python3 tests/docs_links_check.py -> Checked 18 Markdown files and 398 links
  • python3 tests/bidi_controls_check.py -> no bidirectional controls
  • git diff --check origin/main...HEAD -> clean
  • gh pr checks 2155 -> all pass or skipping

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6050585274 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2155#pullrequestreview-6050585274). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T02:08:14Z. **Review:** COMMENTED --- Review of head `f14d392d3acf065f2f130bc876f17a4b397249b6` (non-blocking comment, no approval). Scope: pixel-stage `image_store` lowered to a `RWTexture2D<float4>` store (gfx2hlsl), manifest v2 `uav` line, runtime refusal for `uav` manifests, new Python controls and a desktop draw readback test, docs. Checked: - CI on this head: Windows build and test pass, Linux Python checks pass, gfx1013 fixtures pass. - Mergeable, title neutral, no clean-room concerns seen in the diff. - The lowering matches the ISA shape: VDATA is four consecutive VGPRs, the address is x and y, and the store runs under exec. Refusing 1D, 3D, array, partial masks, `image_store_mip`, non-pixel stages, and load+store of the same image is sensible. - The runtime logs and skips a translation with a `uav` line, so nothing is bound wrongly. Findings: - P1: none. - P2: the `dmask != 0xf` guard (`tools/startup/gfx2hlsl.py`, in `op_image_store`) is not killed by the tests. I replaced the condition with `if False:` and `tests/startup_pixel_image_store_check.py` still passed. The "dmask 0x7" and "dmask 0x1" controls are refused earlier by the "four VGPRs expected" check, because the patched encoding also changes the data register count. Suggest a control that keeps `v[4:7]` with a partial dmask (call `op_image_store` directly with `['v[4:7]','v[0:1]','s[16:23]']` and `dmask:0x7`) so the guard itself is exercised. The refusal text names the wrong reason in the current controls. - Nit: `stored_images()` uses `__dict__.setdefault` to cover pipelines built without `__init__`. Giving `uavs` a class-level default or fixing the test constructors would be clearer. - Nit: the docs bullet has a short broken line ("The cache-policy" wraps oddly); cosmetic. Mutations run (then `git checkout -- .`): - Swapped x and y in the store address: `startup_pixel_image_store_check.py` exits 1, so the test kills it. - Disabled the dmask guard: the test still exits 0, so it survives (the P2 above). Not run: Win2025 WARP/hardware draw (`startup_pixel_image_store_warp/hardware`) was not run locally. I rely on the Windows CI job being green. I did not confirm that job includes these ctest names. Commands executed locally in the worktree: - `python3 -B tests/startup_pixel_image_store_check.py` -> Self-test passed - `python3 tests/docs_links_check.py` -> Checked 18 Markdown files and 398 links - `python3 tests/bidi_controls_check.py` -> no bidirectional controls - `git diff --check origin/main...HEAD` -> clean - `gh pr checks 2155` -> all pass or skipping AI-assisted; commands listed were executed locally.
rasptum commented 2026-11-25 03:01:25 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-25T02:59:10Z.


Thanks, the guard finding was right: the two encoded partial-mask controls passed for the wrong reason. The disassembler sizes VDATA from the mask (v[4:6], v4), so with the dmask guard disabled the data-register check still refused them, and the controls only asserted that image_store was refused.

What changed, in three commits on top of f14d392d:

  • 733bd134 (test). The encoded dmask 0x7 / dmask 0x1 controls now assert the dmask reason ("a typed UAV store writes all four channels"). A new control calls op_image_store with v[4:7] and dmask:0x7, so only the mask guard can refuse it. Another passes dmask:0xf with three data registers and asserts the data reason ("four VGPRs expected"), so each check is pinned to its own message.
  • 352bae3d (nit). Pipeline.uavs is now a class attribute defaulting to None. The first store creates the instance's own map, and the __dict__.setdefault fallback is gone. Pipelines that the existing checks assemble without __init__ keep working unchanged.
  • 96c1a55b (nit). The docs bullet is rewrapped.

None of these controls is registered with WILL_FAIL. The CTest entries for this PR are plain pass/fail, with 77 kept as the capability skip for the hardware draw.

Mutation: with if int(masks[0], 0) != 0xf: replaced by if False:, tests/startup_pixel_image_store_check.py fails with:

AssertionError: (('dmask 0x7', 'writes all four channels'), 'image_store data v[4:6]: four VGPRs expected')

With the guard restored, the check passes.

Commands and results:

out/pe-env/Scripts/python.exe -B tests/startup_pixel_image_store_check.py
ctest --preset dev --no-tests=error -R '^startup_pixel_image_store_' -V
ctest --preset release --no-tests=error -R '^startup_pixel_image_store_' -V

Windows 10 19045, head 96c1a55b:

  • dev: 3 passed, 0 failed, 0 skipped (controls, warp on Microsoft Basic Render Driver, hardware on an NVIDIA GeForce RTX 3060).
  • release: 3 passed, 0 failed, 0 skipped.

All tests/startup_gfx2hlsl_*_check.py, tests/startup_translator_check.py and the image 3D / mip / 2D-array checks pass: 41 scripts, 0 failures. tests/docs_links_check.py passes.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7151465811 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2155#issuecomment-7151465811). Originally posted by [rasptum](https://github.com/rasptum) on 2026-11-25T02:59:10Z. --- Thanks, the guard finding was right: the two encoded partial-mask controls passed for the wrong reason. The disassembler sizes VDATA from the mask (`v[4:6]`, `v4`), so with the dmask guard disabled the data-register check still refused them, and the controls only asserted that `image_store` was refused. What changed, in three commits on top of f14d392d: - **733bd134** (test). The encoded `dmask 0x7` / `dmask 0x1` controls now assert the dmask reason ("a typed UAV store writes all four channels"). A new control calls `op_image_store` with `v[4:7]` and `dmask:0x7`, so only the mask guard can refuse it. Another passes `dmask:0xf` with three data registers and asserts the data reason ("four VGPRs expected"), so each check is pinned to its own message. - **352bae3d** (nit). `Pipeline.uavs` is now a class attribute defaulting to `None`. The first store creates the instance's own map, and the `__dict__.setdefault` fallback is gone. Pipelines that the existing checks assemble without `__init__` keep working unchanged. - **96c1a55b** (nit). The docs bullet is rewrapped. None of these controls is registered with `WILL_FAIL`. The CTest entries for this PR are plain pass/fail, with 77 kept as the capability skip for the hardware draw. Mutation: with `if int(masks[0], 0) != 0xf:` replaced by `if False:`, `tests/startup_pixel_image_store_check.py` fails with: ```text AssertionError: (('dmask 0x7', 'writes all four channels'), 'image_store data v[4:6]: four VGPRs expected') ``` With the guard restored, the check passes. Commands and results: ```powershell out/pe-env/Scripts/python.exe -B tests/startup_pixel_image_store_check.py ctest --preset dev --no-tests=error -R '^startup_pixel_image_store_' -V ctest --preset release --no-tests=error -R '^startup_pixel_image_store_' -V ``` Windows 10 19045, head 96c1a55b: - dev: 3 passed, 0 failed, 0 skipped (`controls`, `warp` on Microsoft Basic Render Driver, `hardware` on an NVIDIA GeForce RTX 3060). - release: 3 passed, 0 failed, 0 skipped. All `tests/startup_gfx2hlsl_*_check.py`, `tests/startup_translator_check.py` and the image 3D / mip / 2D-array checks pass: 41 scripts, 0 failures. `tests/docs_links_check.py` passes. AI-assisted (Claude Code).
tedin7 commented 2026-11-25 04:04:00 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Review of head 96c1a55b381d3b3f464c857f571b8fdd5106d425 (comment only).

State: mergeable, not draft, title neutral, CI green (Linux checks, gfx1013 fixtures, Windows build and test). Read: tools/startup/gfx2hlsl.py (op_image_store, Pipeline.uav/resource/manifest), src/startup_stubs/d3d12_draw.inl, the new check and docs.

What I checked

  • The refusals match the description: partial DMASK, non-2D dim, bad modifiers, wrong data/address register count, non-pixel stage, and a load plus a store of the same image. The load/store conflict is enforced in both orders (resource and uav).
  • Manifest: version 2 only when a store exists, version 1 otherwise (covered at tests/startup_pixel_image_store_check.py:143). The runtime ignores the version number, but it refuses any uav line, so a translation that stores is never used. That is the safe choice until UAV binding exists.

Findings

  • P1: none.
  • P2: the exec guard is not covered. I replaced self.emit(body if self.exec_known else 'if (exec & 1) ' + body) with self.emit(body) (this also hit the two sibling emits, same line text) and tests/startup_pixel_image_store_check.py still passed. So a store under a partial exec mask could lose its guard without any test failing. Please add one case with a non-constant exec and assert the guard in the output (and, if possible, in the WARP readback).
  • nit: int(masks[0], 0) raises ValueError on a malformed mask text rather than Unsupported. Low risk since the assembler produces it, but a try would give a named refusal.

Commands run locally (worktree on the PR head)

  • python3 tests/startup_pixel_image_store_check.py : pass
  • python3 tests/docs_links_check.py : pass (18 files, 398 links)
  • python3 tests/bidi_controls_check.py : pass (1441 files)
  • git diff --check origin/main...HEAD : clean
  • Mutation 1: DMASK check replaced with if False: : the check failed (killed).
  • Mutation 2: exec guard removed : the check still passed (survived, see P2).
  • gh pr checks 2155 : all required jobs pass.

Windows WARP was not re-run by me. The change adds a test under tests/startup_image_store.cpp and CI Windows is green.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6051230752 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2155#pullrequestreview-6051230752). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T03:02:29Z. **Review:** COMMENTED --- Review of head `96c1a55b381d3b3f464c857f571b8fdd5106d425` (comment only). **State:** mergeable, not draft, title neutral, CI green (Linux checks, gfx1013 fixtures, Windows build and test). Read: `tools/startup/gfx2hlsl.py` (`op_image_store`, `Pipeline.uav`/`resource`/`manifest`), `src/startup_stubs/d3d12_draw.inl`, the new check and docs. **What I checked** - The refusals match the description: partial DMASK, non-2D dim, bad modifiers, wrong data/address register count, non-pixel stage, and a load plus a store of the same image. The load/store conflict is enforced in both orders (`resource` and `uav`). - Manifest: version 2 only when a store exists, version 1 otherwise (covered at `tests/startup_pixel_image_store_check.py:143`). The runtime ignores the version number, but it refuses any `uav` line, so a translation that stores is never used. That is the safe choice until UAV binding exists. **Findings** - P1: none. - P2: the exec guard is not covered. I replaced `self.emit(body if self.exec_known else 'if (exec & 1) ' + body)` with `self.emit(body)` (this also hit the two sibling emits, same line text) and `tests/startup_pixel_image_store_check.py` still passed. So a store under a partial exec mask could lose its guard without any test failing. Please add one case with a non-constant exec and assert the guard in the output (and, if possible, in the WARP readback). - nit: `int(masks[0], 0)` raises `ValueError` on a malformed mask text rather than `Unsupported`. Low risk since the assembler produces it, but a `try` would give a named refusal. **Commands run locally** (worktree on the PR head) - `python3 tests/startup_pixel_image_store_check.py` : pass - `python3 tests/docs_links_check.py` : pass (18 files, 398 links) - `python3 tests/bidi_controls_check.py` : pass (1441 files) - `git diff --check origin/main...HEAD` : clean - Mutation 1: DMASK check replaced with `if False:` : the check failed (killed). - Mutation 2: exec guard removed : the check still passed (survived, see P2). - `gh pr checks 2155` : all required jobs pass. Windows WARP was not re-run by me. The change adds a test under `tests/startup_image_store.cpp` and CI Windows is green. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 04:04:00 +00:00 (Migrated from github.com)

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

Review: COMMENTED


AI-assisted; commands listed were executed locally.

Re-review of head 7ee19fa945ed5c347a54cdb8efa63bfae1403b94 (comment only). Previous review was on 96c1a55b; two commits since (2aa673d5, 7ee19fa9).

State: mergeable, not draft, title neutral, CI green (Linux checks, gfx1013 fixtures, Windows build and test; /O2 and chart skipped).

Previous findings

  • P2 (exec guard untested): fixed. tests/startup_pixel_image_store_check.py now adds two v_cmpx_eq_u32 variants (exec on / exec off), asserts the if (exec & 1) guard on the store line only, asserts no guard when exec is known, and in draw mode reads texels back for exec on, exec off, and an unguarded negative control.
  • nit (malformed dmask): fixed. op_image_store now raises Unsupported('image_store with dmask 0xz: not an integer'), and the check covers it.

Findings

  • P1: none.
  • P2: none.

Commands run locally (worktree on the PR head)

  • python3 tests/startup_pixel_image_store_check.py : pass (includes the new exec-guard and malformed-dmask controls)
  • python3 tests/docs_links_check.py : pass (18 files, 398 links)
  • python3 tests/bidi_controls_check.py : pass (1441 files)
  • git diff --check origin/main...HEAD : clean
  • Mutation A: exec guard removed from the store emit (gfx2hlsl.py:1511) : the check failed (killed; the new assertion fires).
  • Mutation B: DMASK required value changed from 0xf to 0xf0 : the check failed (killed).
  • gh pr checks 2155 : all required jobs pass.

Windows WARP was not re-run by me; the new draw-mode cases run in the PR's Windows CI job, which is green.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6051411162 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2155#pullrequestreview-6051411162). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T03:26:15Z. **Review:** COMMENTED --- AI-assisted; commands listed were executed locally. Re-review of head `7ee19fa945ed5c347a54cdb8efa63bfae1403b94` (comment only). Previous review was on `96c1a55b`; two commits since (`2aa673d5`, `7ee19fa9`). **State:** mergeable, not draft, title neutral, CI green (Linux checks, gfx1013 fixtures, Windows build and test; /O2 and chart skipped). **Previous findings** - P2 (exec guard untested): fixed. `tests/startup_pixel_image_store_check.py` now adds two `v_cmpx_eq_u32` variants (exec on / exec off), asserts the `if (exec & 1)` guard on the store line only, asserts no guard when exec is known, and in draw mode reads texels back for exec on, exec off, and an unguarded negative control. - nit (malformed dmask): fixed. `op_image_store` now raises `Unsupported('image_store with dmask 0xz: not an integer')`, and the check covers it. **Findings** - P1: none. - P2: none. **Commands run locally** (worktree on the PR head) - `python3 tests/startup_pixel_image_store_check.py` : pass (includes the new exec-guard and malformed-dmask controls) - `python3 tests/docs_links_check.py` : pass (18 files, 398 links) - `python3 tests/bidi_controls_check.py` : pass (1441 files) - `git diff --check origin/main...HEAD` : clean - Mutation A: exec guard removed from the store emit (`gfx2hlsl.py:1511`) : the check failed (killed; the new assertion fires). - Mutation B: DMASK required value changed from 0xf to 0xf0 : the check failed (killed). - `gh pr checks 2155` : all required jobs pass. Windows WARP was not re-run by me; the new draw-mode cases run in the PR's Windows CI job, which is green. AI-assisted; commands listed were executed locally.
rasptum commented 2026-11-25 04:04:18 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-25T03:20:38Z.


Thanks. Both findings were right. Two commits on top of 96c1a55b:

  • 2aa673d5 (nit). Mask text that is not an integer is now a named refusal: image_store with dmask 0xz: not an integer. Before, it was a ValueError from int(masks[0], 0). A control passes dmask:0xz to op_image_store and asserts the exact message.
  • 7ee19fa9 (P2). The exec guard is now tested. Two variants put v_cmpx_eq_u32_e32 <k>, v0 (VOPC, hand-encoded and decoded back) before the store, so exec is not known at translation time:
    • The controls assert exec = ((0x0000000ku == v0) ? 1u : 0u); and if (exec & 1) w0[uint2(v0, v1)] = ... in the emitted HLSL, with the store line emitted once. They also assert the unguarded form for the original program, whose exec is the entry mask.
    • The draw mode reads the 4x4 image back:
      • With k = 1 the lane stays on, and texel (1, 2) gets the four values.
      • With k = 2 every lane is off, and texel (1, 2) keeps its starting value (bf800000 x4).
      • All other texels stay untouched in both cases.
    • New negative control: the exec-off shader with only the guard removed from the store must write the texel. It fails as expected with texel_mismatch x=1 y=2 expected=bf800000,bf800000,bf800000,bf800000 actual=3f800000,40000000,40400000,40800000.

Mutations (each applied alone, then restored):

  • Your mutation, self.emit(body) at all three sites: tests/startup_pixel_image_store_check.py fails at the guarded-store assertion.
  • The same change at the image_store site only: the check fails.
  • The dmask fix reverted: the check fails with ValueError: invalid literal for int() with base 0: '0xz'.

The two sibling emits already have their own coverage. Each was mutated alone and the full Python set was rerun:

  • op_v_swap_b32: only tests/startup_gfx2hlsl_swap_check.py fails ("unknown exec guards the swap").
  • The 64-bit shift helper (shift64, used by v_lshrrev_b64 and friends): only tests/startup_gfx2hlsl_shift64_check.py fails ("exec-masked v_lshrrev_b64 guards both destination registers").

None of the CTest entries uses WILL_FAIL. 77 is still only the capability skip for the hardware draw.

Commands:

out/pe-env/Scripts/python.exe -B tests/startup_pixel_image_store_check.py
ctest --preset dev --no-tests=error -R '^startup_pixel_image_store_' -V
ctest --preset release --no-tests=error -R '^startup_pixel_image_store_' -V

Results on Windows 10 19045, head 7ee19fa9:

  • dev: 3 passed, 0 failed, 0 skipped.
    • controls.
    • warp on Microsoft Basic Render Driver.
    • hardware on an NVIDIA GeForce RTX 3060.
    • Both draw tests ran the exec-on and exec-off draws and the guard-removed control.
  • release: 3 passed, 0 failed, 0 skipped.
  • Python: all tests/startup_gfx2hlsl_*_check.py, tests/startup_translator_check.py, tests/startup_image_*_check.py, this check and tests/docs_links_check.py pass. That is 46 scripts, 0 failures.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7151825369 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2155#issuecomment-7151825369). Originally posted by [rasptum](https://github.com/rasptum) on 2026-11-25T03:20:38Z. --- Thanks. Both findings were right. Two commits on top of 96c1a55b: - **2aa673d5** (nit). Mask text that is not an integer is now a named refusal: `image_store with dmask 0xz: not an integer`. Before, it was a `ValueError` from `int(masks[0], 0)`. A control passes `dmask:0xz` to `op_image_store` and asserts the exact message. - **7ee19fa9** (P2). The exec guard is now tested. Two variants put `v_cmpx_eq_u32_e32 <k>, v0` (VOPC, hand-encoded and decoded back) before the store, so exec is not known at translation time: - The controls assert `exec = ((0x0000000ku == v0) ? 1u : 0u);` and `if (exec & 1) w0[uint2(v0, v1)] = ...` in the emitted HLSL, with the store line emitted once. They also assert the unguarded form for the original program, whose exec is the entry mask. - The draw mode reads the 4x4 image back: - With `k = 1` the lane stays on, and texel (1, 2) gets the four values. - With `k = 2` every lane is off, and texel (1, 2) keeps its starting value (`bf800000` x4). - All other texels stay untouched in both cases. - New negative control: the exec-off shader with only the guard removed from the store must write the texel. It fails as expected with `texel_mismatch x=1 y=2 expected=bf800000,bf800000,bf800000,bf800000 actual=3f800000,40000000,40400000,40800000`. Mutations (each applied alone, then restored): - Your mutation, `self.emit(body)` at all three sites: `tests/startup_pixel_image_store_check.py` fails at the guarded-store assertion. - The same change at the `image_store` site only: the check fails. - The dmask fix reverted: the check fails with `ValueError: invalid literal for int() with base 0: '0xz'`. The two sibling emits already have their own coverage. Each was mutated alone and the full Python set was rerun: - `op_v_swap_b32`: only `tests/startup_gfx2hlsl_swap_check.py` fails ("unknown exec guards the swap"). - The 64-bit shift helper (`shift64`, used by `v_lshrrev_b64` and friends): only `tests/startup_gfx2hlsl_shift64_check.py` fails ("exec-masked v_lshrrev_b64 guards both destination registers"). None of the CTest entries uses `WILL_FAIL`. 77 is still only the capability skip for the hardware draw. Commands: ```powershell out/pe-env/Scripts/python.exe -B tests/startup_pixel_image_store_check.py ctest --preset dev --no-tests=error -R '^startup_pixel_image_store_' -V ctest --preset release --no-tests=error -R '^startup_pixel_image_store_' -V ``` Results on Windows 10 19045, head 7ee19fa9: - dev: 3 passed, 0 failed, 0 skipped. - `controls`. - `warp` on Microsoft Basic Render Driver. - `hardware` on an NVIDIA GeForce RTX 3060. - Both draw tests ran the exec-on and exec-off draws and the guard-removed control. - release: 3 passed, 0 failed, 0 skipped. - Python: all `tests/startup_gfx2hlsl_*_check.py`, `tests/startup_translator_check.py`, `tests/startup_image_*_check.py`, this check and `tests/docs_links_check.py` pass. That is 46 scripts, 0 failures. AI-assisted (Claude Code).
thepatrickworld commented 2026-11-25 04:04:20 +00:00 (Migrated from github.com)

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


Draw run on hardware — RX 9070 XT, driver 32.0.32029.2010:

draw exec on:  texel (1, 2) = 3f800000,40000000,40400000,40800000, all other texels untouched
draw exec off: texel (1, 2) = bf800000,bf800000,bf800000,bf800000, all other texels untouched
control exec guard removed: fails as expected (texel_mismatch x=1 y=2 expected=bf800000,... actual=3f800000,...)

So execution masking and the untouched-texel rule both hold on the card, and removing the guard makes the check fail rather than pass by accident.

Limits: AMD only, no NVIDIA here.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7152382993 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2155#issuecomment-7152382993). Originally posted by [thepatrickworld](https://github.com/thepatrickworld) on 2026-11-25T03:56:34Z. --- Draw run on hardware — RX 9070 XT, driver 32.0.32029.2010: ``` draw exec on: texel (1, 2) = 3f800000,40000000,40400000,40800000, all other texels untouched draw exec off: texel (1, 2) = bf800000,bf800000,bf800000,bf800000, all other texels untouched control exec guard removed: fails as expected (texel_mismatch x=1 y=2 expected=bf800000,... actual=3f800000,...) ``` So execution masking and the untouched-texel rule both hold on the card, and removing the guard makes the check fail rather than pass by accident. Limits: AMD only, no NVIDIA here. _AI-assisted._
legacy-code-archaeologist commented 2026-11-25 06:01:38 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by legacy-code-archaeologist on 2026-11-25T05:43:15Z.


Ran head 7ee19fa9 on three adapters. All pass. Windows 11 build 26100, debug layer unavailable.

Test Adapter Driver Result
startup_pixel_image_store_controls n/a n/a pass
startup_pixel_image_store_warp Microsoft Basic Render Driver 10.0.26100.8972 pass
startup_pixel_image_store_hardware (XBOX2WINDOWS_ADAPTER=Quadro) NVIDIA Quadro M1000M 32.0.15.7371 pass
startup_pixel_image_store_hardware (XBOX2WINDOWS_ADAPTER=Intel) Intel HD Graphics 530 31.0.101.2111 pass

On every adapter texel (1, 2) was written, the other 15 texels were left untouched, and both exec-on and exec-off drew as expected. All three controls failed as intended.

One cosmetic point. On the Intel run, each control printed fails as expected (XBOX2WINDOWS_ADAPTER: skipping NVIDIA Quadro M1000M). The check itself is correct: it requires the texel_mismatch … needle in stderr (tests/startup_pixel_image_store_check.py:224 and :241). The printed reason, however, is run.stderr.strip().splitlines()[0], and when the adapter is filtered, offscreen_check writes its adapter-skip notice first. Printing the line that contains texel_mismatch would keep the log meaningful on multi-GPU machines.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7154074204 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2155#issuecomment-7154074204). Originally posted by [legacy-code-archaeologist](https://github.com/legacy-code-archaeologist) on 2026-11-25T05:43:15Z. --- Ran head `7ee19fa9` on three adapters. All pass. Windows 11 build 26100, debug layer unavailable. | Test | Adapter | Driver | Result | |---|---|---|---| | `startup_pixel_image_store_controls` | n/a | n/a | pass | | `startup_pixel_image_store_warp` | Microsoft Basic Render Driver | 10.0.26100.8972 | pass | | `startup_pixel_image_store_hardware` (`XBOX2WINDOWS_ADAPTER=Quadro`) | NVIDIA Quadro M1000M | 32.0.15.7371 | pass | | `startup_pixel_image_store_hardware` (`XBOX2WINDOWS_ADAPTER=Intel`) | Intel HD Graphics 530 | 31.0.101.2111 | pass | On every adapter texel (1, 2) was written, the other 15 texels were left untouched, and both exec-on and exec-off drew as expected. All three controls failed as intended. One cosmetic point. On the Intel run, each control printed `fails as expected (XBOX2WINDOWS_ADAPTER: skipping NVIDIA Quadro M1000M)`. The check itself is correct: it requires the `texel_mismatch …` needle in stderr (`tests/startup_pixel_image_store_check.py:224` and `:241`). The printed reason, however, is `run.stderr.strip().splitlines()[0]`, and when the adapter is filtered, `offscreen_check` writes its adapter-skip notice first. Printing the line that contains `texel_mismatch` would keep the log meaningful on multi-GPU machines. _AI-assisted._
tedin7 commented 2026-11-25 08:04:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T07:19:51Z.

Review: COMMENTED


AI-assisted; commands listed were executed locally.

Re-review of head 44b103638a0e3b1790ff4e1bf61b1d268935715d (comment only). Previous review was on 7ee19fa9. Since then: 6456bbbc (compute pipelines keep buffer UAVs out of the pixel-stage image list), 81ca8985 (names the texel_mismatch line in the controls), and two merges of main.

State: mergeable, not draft, title neutral. CI at the time of review: Linux checks pass; gfx1013 fixtures and Windows build/test pending; /O2 skipped. I did not re-run Windows WARP; the draw-mode cases run in the PR's Windows job, so please wait for it to go green before Ready.

Previous findings: none open (exec guard and malformed dmask were fixed earlier and still pass).

New in this head

  • ComputePipeline.stored_images() returning {} (tools/startup/gfx2hlsl.py:3527) is correct. ComputePipeline.uavs maps buffer descriptors to u indices, so without the override Pipeline.stored_images() would hand that map to the image paths (common() / manifest()).
  • P2 (test gap): that override is not guarded. Mutation A below removed it and every check I ran still passed.
  • P1: none.

Commands run locally (worktree on the PR head)

  • python3 tests/startup_pixel_image_store_check.py : pass
  • python3 tests/compute_heap_store_check.py : pass
  • python3 tests/compute_entry_layout_check.py : pass
  • python3 tests/docs_links_check.py : pass (18 files, 418 links)
  • python3 tests/bidi_controls_check.py : pass (1522 files)
  • git diff --check origin/main...HEAD : clean
  • Mutation A: delete ComputePipeline.stored_images override : SURVIVED (image-store check, compute_heap_store_check and compute_entry_layout_check all still pass).
  • Mutation B: manifest version always 1 : killed (targets 0 / check fails).
  • Mutation C: drop the read/store conflict test in Pipeline.uav : killed (accepted: ('both read and stored',)).

Suggestion for P2: add one control that builds a compute program with a buffer store and asserts its manifest has no uav line and the manifest header stays version 1 (extend tests/compute_heap_store_check.py).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6053372221 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2155#pullrequestreview-6053372221). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T07:19:51Z. **Review:** COMMENTED --- AI-assisted; commands listed were executed locally. Re-review of head `44b103638a0e3b1790ff4e1bf61b1d268935715d` (comment only). Previous review was on `7ee19fa9`. Since then: `6456bbbc` (compute pipelines keep buffer UAVs out of the pixel-stage image list), `81ca8985` (names the texel_mismatch line in the controls), and two merges of main. **State:** mergeable, not draft, title neutral. CI at the time of review: Linux checks pass; gfx1013 fixtures and Windows build/test pending; /O2 skipped. I did not re-run Windows WARP; the draw-mode cases run in the PR's Windows job, so please wait for it to go green before Ready. **Previous findings:** none open (exec guard and malformed dmask were fixed earlier and still pass). **New in this head** - `ComputePipeline.stored_images()` returning `{}` (`tools/startup/gfx2hlsl.py:3527`) is correct. `ComputePipeline.uavs` maps buffer descriptors to u indices, so without the override `Pipeline.stored_images()` would hand that map to the image paths (`common()` / `manifest()`). - P2 (test gap): that override is not guarded. Mutation A below removed it and every check I ran still passed. - P1: none. **Commands run locally** (worktree on the PR head) - `python3 tests/startup_pixel_image_store_check.py` : pass - `python3 tests/compute_heap_store_check.py` : pass - `python3 tests/compute_entry_layout_check.py` : pass - `python3 tests/docs_links_check.py` : pass (18 files, 418 links) - `python3 tests/bidi_controls_check.py` : pass (1522 files) - `git diff --check origin/main...HEAD` : clean - Mutation A: delete `ComputePipeline.stored_images` override : SURVIVED (image-store check, compute_heap_store_check and compute_entry_layout_check all still pass). - Mutation B: manifest version always 1 : killed (`targets 0` / check fails). - Mutation C: drop the read/store conflict test in `Pipeline.uav` : killed (`accepted: ('both read and stored',)`). **Suggestion for P2:** add one control that builds a compute program with a buffer store and asserts its manifest has no `uav` line and the manifest header stays version 1 (extend `tests/compute_heap_store_check.py`). AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 08:04:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T07:38:40Z.

Review: COMMENTED


AI-assisted; commands listed were executed locally.

Re-review of head 949497eb4d5521cf6fdbdeeb1f2a52810279585f (comment only). Previous review was on 44b10363. The only new commit is 949497eb, which changes tests/startup_gfx2hlsl_compute_check.py (+7 lines).

State: mergeable, not draft, title neutral. CI at review time: Linux Python checks pass. The Windows build/test and gfx1013 fixtures were still pending. I did not re-run Windows WARP. Please wait for the Windows job to go green before Ready.

Previous P2 (unguarded ComputePipeline.stored_images() override): resolved.
check_controls() now asserts that a.stored_images() == {} while a.uavs is non-empty. It also asserts that the HLSL has no RWTexture2D line, that the manifest starts with x2w-manifest 2 / stage cs, and that the only uav line is uav 0 table 1 16.

Findings: P1 none, P2 none, nit none.

Commands run locally (worktree on the PR head)

  • python3 tests/startup_gfx2hlsl_compute_check.py : pass
  • python3 tests/startup_pixel_image_store_check.py : pass
  • python3 tests/docs_links_check.py : pass (18 files, 418 links)
  • python3 tests/bidi_controls_check.py : pass (1522 files)
  • git diff --check origin/main...HEAD : clean
  • Mutation A, deleting the ComputePipeline.stored_images override in tools/startup/gfx2hlsl.py: now KILLED. startup_gfx2hlsl_compute_check.py fails with AssertionError: ({(('table', 1), 16): 0}, {(('table', 1), 16): 0}). In the previous head this mutation survived. I restored the file with git checkout -- ..

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6053573026 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2155#pullrequestreview-6053573026). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T07:38:40Z. **Review:** COMMENTED --- AI-assisted; commands listed were executed locally. Re-review of head `949497eb4d5521cf6fdbdeeb1f2a52810279585f` (comment only). Previous review was on `44b10363`. The only new commit is `949497eb`, which changes `tests/startup_gfx2hlsl_compute_check.py` (+7 lines). **State:** mergeable, not draft, title neutral. CI at review time: Linux Python checks pass. The Windows build/test and gfx1013 fixtures were still pending. I did not re-run Windows WARP. Please wait for the Windows job to go green before Ready. **Previous P2 (unguarded `ComputePipeline.stored_images()` override): resolved.** `check_controls()` now asserts that `a.stored_images() == {}` while `a.uavs` is non-empty. It also asserts that the HLSL has no `RWTexture2D` line, that the manifest starts with `x2w-manifest 2` / `stage cs`, and that the only `uav` line is `uav 0 table 1 16`. **Findings:** P1 none, P2 none, nit none. **Commands run locally** (worktree on the PR head) - `python3 tests/startup_gfx2hlsl_compute_check.py` : pass - `python3 tests/startup_pixel_image_store_check.py` : pass - `python3 tests/docs_links_check.py` : pass (18 files, 418 links) - `python3 tests/bidi_controls_check.py` : pass (1522 files) - `git diff --check origin/main...HEAD` : clean - Mutation A, deleting the `ComputePipeline.stored_images` override in `tools/startup/gfx2hlsl.py`: now KILLED. `startup_gfx2hlsl_compute_check.py` fails with `AssertionError: ({(('table', 1), 16): 0}, {(('table', 1), 16): 0})`. In the previous head this mutation survived. I restored the file with `git checkout -- .`. AI-assisted; commands listed were executed locally.
rasptum commented 2026-11-25 08:05:04 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-25T07:18:29Z.


Thanks for the three hardware reports: RX 9070 XT, Quadro M1000M and Intel HD 530. They cover adapters I could not test here.

main had moved, so I merged it into the branch instead of rebasing. The reviewed commits stay as they were. Four commits on top of 7ee19fa9:

  • 932b4c21 (merge of main). The conflicts in d3d12_draw.inl, tests/desktop_gpu.h, tests/offscreen_check.cpp and tools/startup/gfx2hlsl.py were additions on both sides, and all of them are kept:

    • main's d16srv manifest reading and writing next to the uav lines;
    • its --startup-image-load-d16 operation next to --startup-image-store;
    • its Pipeline class attributes next to uavs.

    git diff origin/main...HEAD removes one line of main's: the fixed x2w-manifest 1, which this PR makes 1 or 2.

  • 6456bbbc (fix). main now has #2182's ComputePipeline, which uses self.uavs as descriptor key to u index (an int) for its buffer stores. It inherits common() and manifest(), and those read stored_images() as this PR's pixel-stage image entries. So tests/startup_gfx2hlsl_compute_check.py failed with TypeError: 'int' object is not subscriptable. ComputePipeline.stored_images() now returns {}: a compute program has no pixel-stage image stores, and it declares and lists its buffer UAVs itself. The compute check fails without this commit and passes with it.

  • 81ca8985 (from the tester's comment). The draw controls printed the first stderr line as the reason, which on a machine with several adapters is an adapter notice. They now print the texel_mismatch line they already assert on, for example texel_mismatch x=1 y=2 expected=bf800000,... actual=3f800000,....

  • 44b10363 (a second merge of main, at 5a3ed6ac). main moved again during the checks. The only conflict was in gfx2hlsl.py: #2051's new sampler(..., lod_limits=False) signature sits right after this branch's stored_images() and uav(). Both are kept, and again only the x2w-manifest 1 line of main's is replaced.

Results on Windows 10 19045 (WARP; RTX 3060, driver 32.0.15.9636), head 44b10363:

ctest --preset dev --no-tests=error -R '^startup_pixel_image_store_' -V
ctest --preset release --no-tests=error -R '^startup_pixel_image_store_' -V
  • dev: 3 passed, 0 failed, 0 skipped.
  • release: 3 passed, 0 failed, 0 skipped.
  • Python checks: 60 scripts, 0 failures. They are every tests/startup_gfx2hlsl_*_check.py (including startup_gfx2hlsl_compute_check.py), tests/startup_translator_check.py, tests/startup_image_*_check.py, tests/startup_pixel_image_store_check.py and tests/docs_links_check.py.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7155716347 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2155#issuecomment-7155716347). Originally posted by [rasptum](https://github.com/rasptum) on 2026-11-25T07:18:29Z. --- Thanks for the three hardware reports: RX 9070 XT, Quadro M1000M and Intel HD 530. They cover adapters I could not test here. `main` had moved, so I merged it into the branch instead of rebasing. The reviewed commits stay as they were. Four commits on top of 7ee19fa9: - **932b4c21** (merge of `main`). The conflicts in `d3d12_draw.inl`, `tests/desktop_gpu.h`, `tests/offscreen_check.cpp` and `tools/startup/gfx2hlsl.py` were additions on both sides, and all of them are kept: - `main`'s `d16srv` manifest reading and writing next to the `uav` lines; - its `--startup-image-load-d16` operation next to `--startup-image-store`; - its `Pipeline` class attributes next to `uavs`. `git diff origin/main...HEAD` removes one line of `main`'s: the fixed `x2w-manifest 1`, which this PR makes 1 or 2. - **6456bbbc** (fix). `main` now has #2182's `ComputePipeline`, which uses `self.uavs` as descriptor key to `u` index (an int) for its buffer stores. It inherits `common()` and `manifest()`, and those read `stored_images()` as this PR's pixel-stage image entries. So `tests/startup_gfx2hlsl_compute_check.py` failed with `TypeError: 'int' object is not subscriptable`. `ComputePipeline.stored_images()` now returns `{}`: a compute program has no pixel-stage image stores, and it declares and lists its buffer UAVs itself. The compute check fails without this commit and passes with it. - **81ca8985** (from the tester's comment). The draw controls printed the first stderr line as the reason, which on a machine with several adapters is an adapter notice. They now print the `texel_mismatch` line they already assert on, for example `texel_mismatch x=1 y=2 expected=bf800000,... actual=3f800000,...`. - **44b10363** (a second merge of `main`, at 5a3ed6ac). `main` moved again during the checks. The only conflict was in `gfx2hlsl.py`: #2051's new `sampler(..., lod_limits=False)` signature sits right after this branch's `stored_images()` and `uav()`. Both are kept, and again only the `x2w-manifest 1` line of `main`'s is replaced. Results on Windows 10 19045 (WARP; RTX 3060, driver 32.0.15.9636), head 44b10363: ```powershell ctest --preset dev --no-tests=error -R '^startup_pixel_image_store_' -V ctest --preset release --no-tests=error -R '^startup_pixel_image_store_' -V ``` - dev: 3 passed, 0 failed, 0 skipped. - release: 3 passed, 0 failed, 0 skipped. - Python checks: 60 scripts, 0 failures. They are every `tests/startup_gfx2hlsl_*_check.py` (including `startup_gfx2hlsl_compute_check.py`), `tests/startup_translator_check.py`, `tests/startup_image_*_check.py`, `tests/startup_pixel_image_store_check.py` and `tests/docs_links_check.py`. AI-assisted (Claude Code).
rasptum commented 2026-11-25 08:05:05 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by rasptum on 2026-11-25T07:36:17Z.


Thanks. The override is covered, but by two checks you did not run.

I repeated your mutation on 44b10363 (deleted ComputePipeline.stored_images). tests/startup_pixel_image_store_check.py, tests/compute_heap_store_check.py and tests/compute_entry_layout_check.py still pass, as you saw. Two existing checks fail, both run by CI's platform-independent Python job:

  • tests/startup_gfx2hlsl_compute_check.py
  • tests/startup_compute_translate_check.py

Both fail in the inherited Pipeline.common():

for key, r in sorted(self.stored_images().items(), key=lambda kv: kv[1]['index']):
TypeError: 'int' object is not subscriptable

I took your suggestion anyway, since a TypeError deep in common() does not say what broke. 949497eb adds a control in tests/startup_gfx2hlsl_compute_check.py, where the compute manifest is already asserted. It sits ahead of the existing exact-manifest assertion and checks four things on the buffer-store program A:

  • stored_images() is empty while self.uavs holds the buffer store. This is checked before any HLSL or manifest is built.
  • The HLSL declares no RWTexture2D.
  • The manifest starts with x2w-manifest 2 / stage cs.
  • Its only uav line is #2182's kind-less uav 0 table 1 16.

With the override removed, the check now stops at that first assertion: AssertionError: ({(('table', 1), 16): 0}, {(('table', 1), 16): 0}), so stored_images() returned the compute buffer map. With the override restored, it passes.

63 Python checks pass, 0 failures:

  • every tests/startup_gfx2hlsl_*_check.py;
  • tests/startup_translator_check.py, tests/startup_image_*_check.py, tests/startup_pixel_image_store_check.py, tests/docs_links_check.py;
  • tests/startup_compute_translate_check.py, tests/compute_heap_store_check.py, tests/compute_entry_layout_check.py.

The change is test-only and touches nothing the draw tests use, so I did not rerun CTest. The branch still merges cleanly with main.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7156047500 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2155#issuecomment-7156047500). Originally posted by [rasptum](https://github.com/rasptum) on 2026-11-25T07:36:17Z. --- Thanks. The override is covered, but by two checks you did not run. I repeated your mutation on 44b10363 (deleted `ComputePipeline.stored_images`). `tests/startup_pixel_image_store_check.py`, `tests/compute_heap_store_check.py` and `tests/compute_entry_layout_check.py` still pass, as you saw. Two existing checks fail, both run by CI's platform-independent Python job: - `tests/startup_gfx2hlsl_compute_check.py` - `tests/startup_compute_translate_check.py` Both fail in the inherited `Pipeline.common()`: ```text for key, r in sorted(self.stored_images().items(), key=lambda kv: kv[1]['index']): TypeError: 'int' object is not subscriptable ``` I took your suggestion anyway, since a TypeError deep in `common()` does not say what broke. **949497eb** adds a control in `tests/startup_gfx2hlsl_compute_check.py`, where the compute manifest is already asserted. It sits ahead of the existing exact-manifest assertion and checks four things on the buffer-store program A: - `stored_images()` is empty while `self.uavs` holds the buffer store. This is checked before any HLSL or manifest is built. - The HLSL declares no `RWTexture2D`. - The manifest starts with `x2w-manifest 2` / `stage cs`. - Its only `uav` line is #2182's kind-less `uav 0 table 1 16`. With the override removed, the check now stops at that first assertion: `AssertionError: ({(('table', 1), 16): 0}, {(('table', 1), 16): 0})`, so `stored_images()` returned the compute buffer map. With the override restored, it passes. 63 Python checks pass, 0 failures: - every `tests/startup_gfx2hlsl_*_check.py`; - `tests/startup_translator_check.py`, `tests/startup_image_*_check.py`, `tests/startup_pixel_image_store_check.py`, `tests/docs_links_check.py`; - `tests/startup_compute_translate_check.py`, `tests/compute_heap_store_check.py`, `tests/compute_entry_layout_check.py`. The change is test-only and touches nothing the draw tests use, so I did not rerun CTest. The branch still merges cleanly with `main`. AI-assisted (Claude Code).
upstream-sync closed this pull request 2026-11-25 09:03:56 +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!2147
No description provided.