startup: add a compute stage to gfx2hlsl with the offen buffer store #2174

Merged
NiiRoZz merged 5 commits from upstream-pr/2182 into main 2026-11-25 05:32:13 +00:00
NiiRoZz commented 2026-11-25 03:09:38 +00:00 (Migrated from github.com)

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


Change

This adds a compute stage to the startup translator, tools/startup/gfx2hlsl.py. It lowers one compute
store form. Refs #1412.

What it adds

gfx2hlsl.ComputePipeline(cs_code, root_blob, rsrc2, group) translates one gfx1013 compute program. It
uses the same root, resource and entry-constant model as the graphics stages.

Entry registers:

  • The caller passes COMPUTE_PGM_RSRC2 and the thread group size, which are pipeline register state.
  • COMPUTE_PGM_RSRC2 is decoded with the merged compute_store_aot.entry_registers (#1608). The user
    SGPRs come first, then one SGPR per enabled group-ID axis with no gap for an omitted axis
    (SV_GroupID). v0-v2 hold SV_GroupThreadID up to TIDIG_COMP_CNT.
  • The function is imported, not copied, so gfx2hlsl now imports compute_store_aot (and through it
    pixel_aot) lazily.
  • TG_SIZE_EN stays refused, as asked on #1544.
  • Root parameters are placed from s4. This is an inference, not a documented layout, in the same
    way the graphics stages' s8 is. #1608 defines no root placement. The only evidence in the repository is
    a local compute-record scan whose table bindings used s4 or s5 (docs/experiments.md).
  • A numeric read of a user SGPR the root does not place, including s0-s3, is refused.

Output:

  • A cs HLSL main with [numthreads].
  • A version 2 manifest with stage cs, group X Y Z, ud/udsrc/srv lines in the existing format,
    and uav <slot> table <param> <byte offset>.

Store lowering:

  • One store form is lowered: buffer_store_dword/x2/x3/x4 in the offen form. The address is a
    per-lane byte VGPR plus the scalar offset and the immediate. The descriptor must sit at a fixed
    root-table offset, and the target is a RWByteAddressBuffer.
  • All four descriptor words must still be the words the s_load returned.
  • Refused:
    • the off and idxen forms, and glc/slc/dlc;
    • an immediate offset that is not a multiple of 4;
    • a moved, overwritten or modified descriptor word;
    • a descriptor that is also loaded.

New compute-only refusals:

  • A scalar instruction (or v_readlane/v_readfirstlane/v_writelane) inside a block that
    s_cbranch_execz skips. The wave runs such a block when any lane is active. The one-lane model would
    skip it for an inactive lane and lose the scalar result.
  • An image_sample with implicit LOD. A compute lane has no derivatives. The _l/_lz forms are kept.

Shared change (affects graphics too):

  • A modification of a descriptor word (s_and_b32 s18, s18, …) was recorded under the key of the
    load's first descriptor. It is now recorded under the descriptor the word belongs to: load offset
    plus 4 * (dword & ~3).
  • Only idxen loads consult that set.
  • Before and after, I translated every graphics request in a local shader cache in memory: 925 requests,
    123 of which translate. The HLSL and manifest hashes and the refusal texts were identical, so no
    graphics output moved.
  • Graphics stages keep the unknown-op refusal text for buffer stores (buffer_store_dwordx3), so
    refusal census buckets do not move.

Not in this change

  • No runtime change. There is no slot-67 runtime path yet: device slot 67 still creates a placeholder
    and slot 14 still drops the dispatch.
  • No real program translates yet. In a local census of one captured frame, 0 of 743 compute pipelines
    translated with no refusal; their weight is 2,926 direct and indirect dispatches. This is a local
    observation and the frame's data is not public.
    • The largest first refusals are buffer_load_format_* (#2138 and the #2022 item A split),
      resource-heap s_load with a register offset (#1143), s_mulk_i32, v_readfirstlane uniformity,
      buffer_store_format_d16_x, LDS writes, src_scc (#1821) and image_store.
    • Among programs refused for one reason only, the store forms dominate: buffer_store_format_d16_x, a
      descriptor whose stride field was cleared (s_and of dword 1 with 0xc000ffff), image_store and
      the off form.
  • The planned next PR publishes slot-67 requests (code, root and register state) to the existing shader
    cache. It is on a local companion branch, compute/slot67-requests.

Open design question: which tool is the runtime compute translator?

On #1412 the maintainer described the first slot-67 fixture: "A useful first slot 67 fixture would bind
explicit group dimensions, a read buffer and a writable resource, then verify nonzero GPU output plus a
dropped-dispatch or swapped-binding control." This change follows that description.

The compute lowerings merged so far live in compute_store_aot, and #2022 item A is being added there.
compute_store_aot takes its bindings from the caller (table_reg, descriptor_offset, …), and #1994's
records do the same. gfx2hlsl derives them from the root signature and already feeds the runtime shader
cache, which is why the stage is added here and reuses compute_store_aot only for the
COMPUTE_PGM_RSRC2 decode.

If the runtime compute translator should instead be compute_store_aot, made to serve requests, this
stage should move there; please say so.

Overlapping work

  • #2059 (tedin7) adds op_buffer_store_dword* to the same handler for vertex-stage off stores.
    This change uses the same shapes:

    • the uavs registry and uav();
    • the load-and-store refusal;
    • the RWByteAddressBuffer u<n> : register(u<n>) declaration and the uav <slot> table <param> <offset>
      line;
    • one alignment policy: refuse an immediate that is not a multiple of 4, and round the run-time part
      down.

    Whichever lands second has to merge the two into one handler, with the address form chosen per stage.
    Expect a textual conflict there.

  • #1994 (ArnabSaga): offline translation of fixture programs through compute_store_aot, with a
    separate cache protocol. No code overlap.

  • #2138 (tedin7): buffer_load_format_* in gfx2hlsl, the largest first refusal above. No code overlap.

Known gaps shared with the graphics stages, not changed here

  • In graphics stages, a scalar write inside an execz-skipped block has the same per-lane problem. It is
    refused only for compute in this change.
  • s_cbranch_vccz/vccnz and s_cbranch_execnz loops are also evaluated per lane while the wave
    evaluates them per wave. Scalar state updated inside a loop that lanes leave at different times can
    differ.
  • An idxen load still checks only the first register of its descriptor operand. An overwritten later
    word is not seen there.

AI-assisted (Claude Code).

Verification

Commit 0236bbcb (on 65f8ef9d). Windows 11 build 26300, MSVC Release, offscreen_check built in the
worktree, DXC 10.0.26100.0, debug layer enabled.

. .\tools\dev.ps1
cmake --preset release
cmake --build --preset release --target offscreen_check
ctest --preset release --no-tests=error -R '^startup_gfx2hlsl_compute_' -V
python -B tests/startup_gfx2hlsl_compute_check.py
python -B tests/startup_gfx2hlsl_compute_check.py binary llvm-mc   # LLVM 15.0.7
Test WARP 10.0.26100.10068 RTX 5090, driver 32.0.16.2135
startup_gfx2hlsl_compute_{warp,hardware}: cases A (3x2x2 groups), B (4x1x3), C (1x5x1) 320/320 words each 320/320 words each
control swapped-axes (case A) rejected, 128 mismatches, first at word 48 same
control dropped-store (case A) rejected, 288 mismatches, first at word 0 same
control b-offset (case B without its immediate offset) rejected, 242 mismatches, first at word 0 same
control c-unpredicated (case C without the exec predicate) rejected, 30 mismatches, first at word 46 same
  • ctest: 11/11 passed, 0 skipped. The hardware variants return 77 without a GPU; that path was not
    exercised here because a GPU was present.

  • Debug layer: 0 errors and 0 warnings in every run.

  • Each control is pinned in CMake by PASS_REGULAR_EXPRESSION "control <name>: rejected at word=[0-9]+ ".

  • Pure-Python controls pass. Each of these reviewed inputs was accepted before and is now refused:

    • a constant move into descriptor dword 2 (s_mov_b32 s18, 0);
    • s_or_b32 s17, s17, 0x40000;
    • s_and_b32 s18, s18, 0xffff;
    • s_mov_b32 s18, 4 between two stores;
    • a scalar add in an execz-skipped block, with exec set by a plain move and in the s_and_saveexec_b32
      form;
    • an implicit-LOD image_sample;
    • offset:6.

    The modification is recorded under byte 16 of the x8 load, not byte 0. An image_sample_lz still
    translates. The graphics refusal text is unchanged.

  • The binary mode reassembles the three programs and every spliced control instruction with llvm-mc 15.

  • 52 other pure-Python checks pass: all tests/startup_gfx2hlsl_*_check.py and startup_translator,
    plus compute_entry_layout, startup_flat_param, startup_buffer_address, startup_smem_address,
    startup_stream_fetch, startup_sampler_heap, startup_inline_sampler, docs_links and
    bidi_controls.

  • git diff --check is clean.

  • Not run: the full ctest suite, CI, FXC (the runtime cache's compiler) on compute output.

Evidence and follow-up

  • Fixtures: three source-built gfx1013 programs in tests/startup_gfx2hlsl_compute_check.py, with
    their llvm-mc source and recorded words. They contain no retail bytes. MIT.
    • Case A: all group-ID axes and v0-v2, group size 2x3x4, one-word store.
    • Case B: X and Z only, so Z is s8; v0-v1; group size 5x2x1; two-word store at immediate offset 8.
    • Case C: Y only; v0; group size 8x1x1; a four-word store from every lane, then a three-word store under
      an exec mask set from a compare.
  • What the GPU run does not exercise: the fixture runs on a plain D3D12 device with the runner's own
    root signature (root SRV t0, root UAV u0, 16 root constants at b0). These match the translation's r0,
    u0 and entry cbuffer by register. The manifest's srv/uav table lines and the descriptor fetch
    from the table are not exercised on the GPU
    ; they are checked only as text.
  • Assumptions, not measurements:
    • out-of-range stores (a future runtime would have to size the UAV view to the descriptor's range);
    • rounding the run-time part of a misaligned address down;
    • a raw descriptor with no stride or swizzle;
    • s4 as the start of the root parameters.
  • Request side (local observation, a hypothesis until its own PR): the local branch
    compute/slot67-requests publishes slot-67 requests (.cs code, .root, and a 28-byte state block .sa).
    A local run produced 2,689 of them.
    • The entry facts were located there, not decoded from any public source:
      • thread group size X/Y in .sa dword 3 (low and high 16 bits), Z in dword 4 (low 16 bits);
      • COMPUTE_PGM_RSRC2 in dword 6.
    • Across the 2,689 requests:
      • every group size is within the numthreads limits;
      • user SGPR counts run from 4 to 14;
      • 91 set TG_SIZE_EN, which this stage refuses.
    • Wiring load_request for .cs into ComputePipeline is the piece after both PRs land.
  • The s4 placement checked against those sizes:
    • The roots of the 743 compute pipelines in the captured frame end at s5 to s12 under s4 placement
      (4 + parameter SGPRs + heap pointers). That lies inside the observed user SGPR range of 4 to 14, so
      the refusal "root needs more SGPRs than USER_SGPR" is not expected to fire for them.
    • I did not compare each pipeline's own USER_SGPR with its own root.
    • That refusal can only catch a root placed too far. It cannot detect a wrong start register.
  • Next steps:
    • land the slot-67 request publishing above;
    • runtime slot-67 pipeline creation and binding through the single slot-14 handler (#1974/#1975);
    • accept a stride-clearing descriptor modification for stores;
    • buffer_store_format_* and image_store in gfx2hlsl.
  • Reproduce: ctest --preset dev --no-tests=error -R '^startup_gfx2hlsl_compute_' -V. The new section
    is "Compute stage in the startup translator" in docs/experiments.md.

Checklist

  • This pull request covers one reviewable behavior.
  • I included the exact command and result for every check I ran.
  • I considered a negative control or failure case for a new fixture.
  • I updated README/docs when a capability or build requirement changed.
  • I did not include game files, dumps, distribution links or secrets.

🤖 Generated with Claude Code

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6596299686 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2182). Originally posted by [NiiRoZz](https://github.com/NiiRoZz) on 2026-11-25T03:09:38Z. --- ## Change This adds a compute stage to the startup translator, `tools/startup/gfx2hlsl.py`. It lowers one compute store form. Refs #1412. **What it adds** `gfx2hlsl.ComputePipeline(cs_code, root_blob, rsrc2, group)` translates one gfx1013 compute program. It uses the same root, resource and entry-constant model as the graphics stages. Entry registers: - The caller passes `COMPUTE_PGM_RSRC2` and the thread group size, which are pipeline register state. - `COMPUTE_PGM_RSRC2` is decoded with the merged `compute_store_aot.entry_registers` (#1608). The user SGPRs come first, then one SGPR per enabled group-ID axis with no gap for an omitted axis (`SV_GroupID`). v0-v2 hold `SV_GroupThreadID` up to `TIDIG_COMP_CNT`. - The function is imported, not copied, so `gfx2hlsl` now imports `compute_store_aot` (and through it `pixel_aot`) lazily. - `TG_SIZE_EN` stays refused, as asked on #1544. - **Root parameters are placed from s4. This is an inference, not a documented layout**, in the same way the graphics stages' s8 is. #1608 defines no root placement. The only evidence in the repository is a local compute-record scan whose table bindings used s4 or s5 (`docs/experiments.md`). - A numeric read of a user SGPR the root does not place, including s0-s3, is refused. Output: - A `cs` HLSL main with `[numthreads]`. - A version 2 manifest with `stage cs`, `group X Y Z`, `ud`/`udsrc`/`srv` lines in the existing format, and `uav <slot> table <param> <byte offset>`. Store lowering: - One store form is lowered: `buffer_store_dword`/`x2`/`x3`/`x4` in the `offen` form. The address is a per-lane byte VGPR plus the scalar offset and the immediate. The descriptor must sit at a fixed root-table offset, and the target is a `RWByteAddressBuffer`. - All four descriptor words must still be the words the `s_load` returned. - Refused: - the `off` and `idxen` forms, and `glc`/`slc`/`dlc`; - an immediate offset that is not a multiple of 4; - a moved, overwritten or modified descriptor word; - a descriptor that is also loaded. New compute-only refusals: - A scalar instruction (or `v_readlane`/`v_readfirstlane`/`v_writelane`) inside a block that `s_cbranch_execz` skips. The wave runs such a block when any lane is active. The one-lane model would skip it for an inactive lane and lose the scalar result. - An `image_sample` with implicit LOD. A compute lane has no derivatives. The `_l`/`_lz` forms are kept. Shared change (affects graphics too): - A modification of a descriptor word (`s_and_b32 s18, s18, …`) was recorded under the key of the load's **first** descriptor. It is now recorded under the descriptor the word belongs to: load offset plus `4 * (dword & ~3)`. - Only `idxen` loads consult that set. - Before and after, I translated every graphics request in a local shader cache in memory: 925 requests, 123 of which translate. The HLSL and manifest hashes and the refusal texts were identical, so no graphics output moved. - Graphics stages keep the unknown-op refusal text for buffer stores (`buffer_store_dwordx3`), so refusal census buckets do not move. **Not in this change** - No runtime change. There is **no slot-67 runtime path yet**: device slot 67 still creates a placeholder and slot 14 still drops the dispatch. - No real program translates yet. In a local census of one captured frame, 0 of 743 compute pipelines translated with no refusal; their weight is 2,926 direct and indirect dispatches. This is a local observation and the frame's data is not public. - The largest first refusals are `buffer_load_format_*` (#2138 and the #2022 item A split), resource-heap `s_load` with a register offset (#1143), `s_mulk_i32`, `v_readfirstlane` uniformity, `buffer_store_format_d16_x`, LDS writes, `src_scc` (#1821) and `image_store`. - Among programs refused for one reason only, the store forms dominate: `buffer_store_format_d16_x`, a descriptor whose stride field was cleared (`s_and` of dword 1 with `0xc000ffff`), `image_store` and the `off` form. - The planned next PR publishes slot-67 requests (code, root and register state) to the existing shader cache. It is on a local companion branch, `compute/slot67-requests`. **Open design question: which tool is the runtime compute translator?** On #1412 the maintainer described the first slot-67 fixture: "A useful first slot 67 fixture would bind explicit group dimensions, a read buffer and a writable resource, then verify nonzero GPU output plus a dropped-dispatch or swapped-binding control." This change follows that description. The compute lowerings merged so far live in `compute_store_aot`, and #2022 item A is being added there. `compute_store_aot` takes its bindings from the caller (`table_reg`, `descriptor_offset`, …), and #1994's records do the same. gfx2hlsl derives them from the root signature and already feeds the runtime shader cache, which is why the stage is added here and reuses `compute_store_aot` only for the `COMPUTE_PGM_RSRC2` decode. If the runtime compute translator should instead be `compute_store_aot`, made to serve requests, this stage should move there; please say so. **Overlapping work** - **#2059** (tedin7) adds `op_buffer_store_dword*` to the same handler for vertex-stage `off` stores. This change uses the same shapes: - the `uavs` registry and `uav()`; - the load-and-store refusal; - the `RWByteAddressBuffer u<n> : register(u<n>)` declaration and the `uav <slot> table <param> <offset>` line; - one alignment policy: refuse an immediate that is not a multiple of 4, and round the run-time part down. Whichever lands second has to merge the two into one handler, with the address form chosen per stage. Expect a textual conflict there. - **#1994** (ArnabSaga): offline translation of fixture programs through `compute_store_aot`, with a separate cache protocol. No code overlap. - **#2138** (tedin7): `buffer_load_format_*` in gfx2hlsl, the largest first refusal above. No code overlap. **Known gaps shared with the graphics stages, not changed here** - In graphics stages, a scalar write inside an execz-skipped block has the same per-lane problem. It is refused only for compute in this change. - `s_cbranch_vccz`/`vccnz` and `s_cbranch_execnz` loops are also evaluated per lane while the wave evaluates them per wave. Scalar state updated inside a loop that lanes leave at different times can differ. - An `idxen` load still checks only the first register of its descriptor operand. An overwritten later word is not seen there. AI-assisted (Claude Code). ## Verification Commit `0236bbcb` (on `65f8ef9d`). Windows 11 build 26300, MSVC Release, `offscreen_check` built in the worktree, DXC 10.0.26100.0, debug layer enabled. ```powershell . .\tools\dev.ps1 cmake --preset release cmake --build --preset release --target offscreen_check ctest --preset release --no-tests=error -R '^startup_gfx2hlsl_compute_' -V python -B tests/startup_gfx2hlsl_compute_check.py python -B tests/startup_gfx2hlsl_compute_check.py binary llvm-mc # LLVM 15.0.7 ``` | Test | WARP 10.0.26100.10068 | RTX 5090, driver 32.0.16.2135 | |---|---|---| | `startup_gfx2hlsl_compute_{warp,hardware}`: cases A (3x2x2 groups), B (4x1x3), C (1x5x1) | 320/320 words each | 320/320 words each | | control `swapped-axes` (case A) | rejected, 128 mismatches, first at word 48 | same | | control `dropped-store` (case A) | rejected, 288 mismatches, first at word 0 | same | | control `b-offset` (case B without its immediate offset) | rejected, 242 mismatches, first at word 0 | same | | control `c-unpredicated` (case C without the exec predicate) | rejected, 30 mismatches, first at word 46 | same | - ctest: 11/11 passed, 0 skipped. The hardware variants return 77 without a GPU; that path was not exercised here because a GPU was present. - Debug layer: 0 errors and 0 warnings in every run. - Each control is pinned in CMake by `PASS_REGULAR_EXPRESSION "control <name>: rejected at word=[0-9]+ "`. - Pure-Python controls pass. Each of these reviewed inputs was accepted before and is now refused: - a constant move into descriptor dword 2 (`s_mov_b32 s18, 0`); - `s_or_b32 s17, s17, 0x40000`; - `s_and_b32 s18, s18, 0xffff`; - `s_mov_b32 s18, 4` between two stores; - a scalar add in an execz-skipped block, with exec set by a plain move and in the `s_and_saveexec_b32` form; - an implicit-LOD `image_sample`; - `offset:6`. The modification is recorded under byte 16 of the x8 load, not byte 0. An `image_sample_lz` still translates. The graphics refusal text is unchanged. - The `binary` mode reassembles the three programs and every spliced control instruction with llvm-mc 15. - 52 other pure-Python checks pass: all `tests/startup_gfx2hlsl_*_check.py` and `startup_translator`, plus `compute_entry_layout`, `startup_flat_param`, `startup_buffer_address`, `startup_smem_address`, `startup_stream_fetch`, `startup_sampler_heap`, `startup_inline_sampler`, `docs_links` and `bidi_controls`. - `git diff --check` is clean. - Not run: the full ctest suite, CI, FXC (the runtime cache's compiler) on compute output. ## Evidence and follow-up - **Fixtures:** three source-built gfx1013 programs in `tests/startup_gfx2hlsl_compute_check.py`, with their llvm-mc source and recorded words. They contain no retail bytes. MIT. - Case A: all group-ID axes and v0-v2, group size 2x3x4, one-word store. - Case B: X and Z only, so Z is s8; v0-v1; group size 5x2x1; two-word store at immediate offset 8. - Case C: Y only; v0; group size 8x1x1; a four-word store from every lane, then a three-word store under an exec mask set from a compare. - **What the GPU run does not exercise:** the fixture runs on a plain D3D12 device with the runner's own root signature (root SRV t0, root UAV u0, 16 root constants at b0). These match the translation's `r0`, `u0` and entry cbuffer by register. **The manifest's `srv`/`uav` table lines and the descriptor fetch from the table are not exercised on the GPU**; they are checked only as text. - **Assumptions, not measurements:** - out-of-range stores (a future runtime would have to size the UAV view to the descriptor's range); - rounding the run-time part of a misaligned address down; - a raw descriptor with no stride or swizzle; - s4 as the start of the root parameters. - **Request side (local observation, a hypothesis until its own PR):** the local branch `compute/slot67-requests` publishes slot-67 requests (`.cs` code, `.root`, and a 28-byte state block `.sa`). A local run produced 2,689 of them. - The entry facts were located there, not decoded from any public source: - thread group size X/Y in `.sa` dword 3 (low and high 16 bits), Z in dword 4 (low 16 bits); - `COMPUTE_PGM_RSRC2` in dword 6. - Across the 2,689 requests: - every group size is within the numthreads limits; - user SGPR counts run from 4 to 14; - 91 set `TG_SIZE_EN`, which this stage refuses. - Wiring `load_request` for `.cs` into `ComputePipeline` is the piece after both PRs land. - **The s4 placement checked against those sizes:** - The roots of the 743 compute pipelines in the captured frame end at s5 to s12 under s4 placement (4 + parameter SGPRs + heap pointers). That lies inside the observed user SGPR range of 4 to 14, so the refusal "root needs more SGPRs than `USER_SGPR`" is not expected to fire for them. - I did not compare each pipeline's own `USER_SGPR` with its own root. - That refusal can only catch a root placed too far. It cannot detect a wrong start register. - **Next steps:** - land the slot-67 request publishing above; - runtime slot-67 pipeline creation and binding through the single slot-14 handler (#1974/#1975); - accept a stride-clearing descriptor modification for stores; - `buffer_store_format_*` and `image_store` in gfx2hlsl. - **Reproduce:** `ctest --preset dev --no-tests=error -R '^startup_gfx2hlsl_compute_' -V`. The new section is "Compute stage in the startup translator" in `docs/experiments.md`. ## Checklist - [x] This pull request covers one reviewable behavior. - [x] I included the exact command and result for every check I ran. - [x] I considered a negative control or failure case for a new fixture. - [x] I updated README/docs when a capability or build requirement changed. - [x] I did not include game files, dumps, distribution links or secrets. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tedin7 commented 2026-11-25 04:04:10 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Review of head 0236bbcb5b (comment only, no approval).

Scope read: tools/startup/gfx2hlsl.py (cs entry, execz guard, buffer_store_dword*), tests/startup_gfx2hlsl_compute_check.py, CMakeLists.txt, windows.yml, AGENTS.md, docs/experiments.md.

Commands executed locally (Linux):

  • python3 -B tests/startup_gfx2hlsl_compute_check.py -> "compute entry, numthreads, manifest, offen store forms and the store, descriptor, execz and sample refusals pass"
  • python3 tests/startup_gfx2hlsl_compute_check.py binary llvm-mc-15 -> not runnable here (llvm-mc-15 not installed); covered by the Linux CI job, which is green.
  • python3 tests/docs_links_check.py -> 402 links OK; python3 tests/bidi_controls_check.py -> OK; git diff --check origin/main...HEAD -> clean.
  • Mutation: changed the store alignment mask 0xfffffffcu to 0xfffffff8u in op_buffer_store_dword. The Linux controls fail (exact-line assertion on the emitted a = (...) & 0xfffffffcu;). Reverted with git checkout -- ..

Windows (Win2025 node, x2w_pipe.py win2025 2182 --scope direct --regex startup_gfx2hlsl_compute --force):

  • Debug phase: 11/11 ctest passed (compute_controls, compute_warp, compute_hardware, and the 4 controls swapped-axes / dropped-store / b-offset / c-unpredicated on both adapters). The real D3D12 readback against the CPU reference is therefore exercised and the 4 controls are rejected as intended.
  • Release phase did not complete: the first attempt and the retry both died in sccache ("existing connection was forcibly closed") while compiling d3d12_xs_device.cpp. That is a node cache failure, not a PR failure; I do not count it as evidence either way. GitHub "Build and test on Windows" was still pending when I looked.

Findings:

  • P1: none. P2: none.
  • nit 1 (gfx2hlsl.py, setup_compute_entry): user SGPR base s4 is an inference, and it is documented as one in the comment and in docs/experiments.md. Good; keep the refusal of reads of s0-s3 until real evidence exists.
  • nit 2 (gfx2hlsl.py, op_buffer_store_dword): rounding the run-time address down to 4 bytes and ignoring num_records/stride are stated assumptions, not measured. The comment says so. Consider one control that stores past the range so the future runtime change cannot go unnoticed.
  • nit 3 (tests): on Linux the mutation is killed by an exact HLSL line check, which is brittle against harmless HLSL formatting changes. The behavioural kill happens only in the Windows WARP/hardware tests (controls cover axes, dropped store, b-offset, unpredicated C). That is fine, but note the Linux job alone does not prove the arithmetic.
  • windows.yml: the new check is added both to the binary matrix (with llvm-mc-15) and to the direct list, next to sibling gfx2hlsl checks. Consistent. AGENTS.md: one line added in the same order as the siblings. Consistent. CMake: controls registered per adapter with SKIP_RETURN_CODE 77 and PASS_REGULAR_EXPRESSION, matching the mad/swap siblings.
  • Clean-room: no external code or names; title is neutral; PR is mergeable.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6051370991 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2182#pullrequestreview-6051370991). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T03:20:58Z. **Review:** COMMENTED --- Review of head 0236bbcb5bc6fce4483b1c475f7f8c62fa1c0f32 (comment only, no approval). Scope read: tools/startup/gfx2hlsl.py (cs entry, execz guard, buffer_store_dword*), tests/startup_gfx2hlsl_compute_check.py, CMakeLists.txt, windows.yml, AGENTS.md, docs/experiments.md. Commands executed locally (Linux): - `python3 -B tests/startup_gfx2hlsl_compute_check.py` -> "compute entry, numthreads, manifest, offen store forms and the store, descriptor, execz and sample refusals pass" - `python3 tests/startup_gfx2hlsl_compute_check.py binary llvm-mc-15` -> not runnable here (llvm-mc-15 not installed); covered by the Linux CI job, which is green. - `python3 tests/docs_links_check.py` -> 402 links OK; `python3 tests/bidi_controls_check.py` -> OK; `git diff --check origin/main...HEAD` -> clean. - Mutation: changed the store alignment mask `0xfffffffcu` to `0xfffffff8u` in op_buffer_store_dword. The Linux controls fail (exact-line assertion on the emitted `a = (...) & 0xfffffffcu;`). Reverted with `git checkout -- .`. Windows (Win2025 node, `x2w_pipe.py win2025 2182 --scope direct --regex startup_gfx2hlsl_compute --force`): - Debug phase: 11/11 ctest passed (compute_controls, compute_warp, compute_hardware, and the 4 controls swapped-axes / dropped-store / b-offset / c-unpredicated on both adapters). The real D3D12 readback against the CPU reference is therefore exercised and the 4 controls are rejected as intended. - Release phase did not complete: the first attempt and the retry both died in sccache ("existing connection was forcibly closed") while compiling d3d12_xs_device.cpp. That is a node cache failure, not a PR failure; I do not count it as evidence either way. GitHub "Build and test on Windows" was still pending when I looked. Findings: - P1: none. P2: none. - nit 1 (gfx2hlsl.py, setup_compute_entry): user SGPR base s4 is an inference, and it is documented as one in the comment and in docs/experiments.md. Good; keep the refusal of reads of s0-s3 until real evidence exists. - nit 2 (gfx2hlsl.py, op_buffer_store_dword): rounding the run-time address down to 4 bytes and ignoring num_records/stride are stated assumptions, not measured. The comment says so. Consider one control that stores past the range so the future runtime change cannot go unnoticed. - nit 3 (tests): on Linux the mutation is killed by an exact HLSL line check, which is brittle against harmless HLSL formatting changes. The behavioural kill happens only in the Windows WARP/hardware tests (controls cover axes, dropped store, b-offset, unpredicated C). That is fine, but note the Linux job alone does not prove the arithmetic. - windows.yml: the new check is added both to the binary matrix (with llvm-mc-15) and to the direct list, next to sibling gfx2hlsl checks. Consistent. AGENTS.md: one line added in the same order as the siblings. Consistent. CMake: controls registered per adapter with SKIP_RETURN_CODE 77 and PASS_REGULAR_EXPRESSION, matching the mad/swap siblings. - Clean-room: no external code or names; title is neutral; PR is mergeable. AI-assisted; commands listed were executed locally.
NiiRoZz commented 2026-11-25 04:04:21 +00:00 (Migrated from github.com)

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


Thanks for the review. Added 94b042ba for nit 2: a pure-Python control that pins today's translation of a store past the descriptor's range (offset:4092 → a = (v4 + 4092) & 0xfffffffcu; then a plain u0.Store, no range check, manifest unchanged), so a later runtime change to range handling cannot go unnoticed. It is a text control rather than a GPU case because the fixture binds a root UAV, which has no bounds checking, so an out-of-range store has no defined GPU result to pin. Controls, binary mode against llvm-mc 15 and the 11 compute ctests pass on that head.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7152434139 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2182#issuecomment-7152434139). Originally posted by [NiiRoZz](https://github.com/NiiRoZz) on 2026-11-25T03:59:58Z. --- Thanks for the review. Added 94b042ba for nit 2: a pure-Python control that pins today's translation of a store past the descriptor's range (`offset:4092` → `a = (v4 + 4092) & 0xfffffffcu;` then a plain `u0.Store`, no range check, manifest unchanged), so a later runtime change to range handling cannot go unnoticed. It is a text control rather than a GPU case because the fixture binds a root UAV, which has no bounds checking, so an out-of-range store has no defined GPU result to pin. Controls, binary mode against llvm-mc 15 and the 11 compute ctests pass on that head. AI-assisted (Claude Code).
tedin7 commented 2026-11-25 05:04:47 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Re-review of head 94b042bac51961db9be4fd5218b3ab0eb92d9c01 (previous review was on 0236bbcb). Scope: compute stage in tools/startup/gfx2hlsl.py, new tests/startup_gfx2hlsl_compute_check.py, CMake/CI/docs wiring.

Status: mergeable, CI green on this head (Linux checks, gfx1013 fixtures, Windows build and test; /O2 and chart jobs skipped). Title and body are neutral. No external or clean-room concerns seen in the diff.

Commands executed locally in a worktree of the head:

  • git diff --stat origin/main...HEAD: 6 files, +652/-4
  • python3 tests/startup_gfx2hlsl_compute_check.py: pass ("Self-test passed.")
  • python3 tests/docs_links_check.py: pass (18 files, 402 links)
  • python3 tests/bidi_controls_check.py: pass (1465 files)
  • git diff --check origin/main...HEAD: clean

Mutations (each reverted with git checkout -- .):

  1. Disabled the s_cbranch_execz skipped-block guard in translate(): killed (test fails: expected refusal naming s_add_u32 inside a block s_cbranch_execz skips).
  2. Dropped the & 0xfffffffcu dword rounding in op_buffer_store_dword: killed (test pins the emitted a = (v4 + 0) & 0xfffffffcu;).
  3. Removed the desc_key(first) in self.pipe.modified clause in the store's descriptor check: survived.

Findings:

  • P1: none.
  • P2: none.
  • nit (tools/startup/gfx2hlsl.py, op_buffer_store_dword, the desc_key(first) in self.pipe.modified clause): mutation 3 survives. The per-word self.sym comparison already catches a modified word because the writer now tags it ('modified',), so the clause looks redundant. Either add a case where only pipe.modified carries the mark, or drop the clause.
  • nit (op_buffer_store_dword): the out-of-range store is deliberately unguarded and the comment and the new pinning test say so. It stays an assumption until a runtime sizes the UAV view. Fine to keep as documented.
  • nit (setup_entry): the compute root start at s4 is an inference. The code comment and docs/experiments.md say so honestly, and unplaced user SGPRs are refused on read. Good.

Not run: Win2025 WARP. The compute store is not yet covered by a GPU readback in this PR, which is acceptable for a translator-only slice, but a WARP readback of the offen store versus a CPU reference should come before the follow-up that binds the UAV.

Verdict: no blocking issues on this head; the earlier review points look addressed.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6051697804 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2182#pullrequestreview-6051697804). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T04:04:19Z. **Review:** COMMENTED --- Re-review of head `94b042bac51961db9be4fd5218b3ab0eb92d9c01` (previous review was on `0236bbcb`). Scope: compute stage in `tools/startup/gfx2hlsl.py`, new `tests/startup_gfx2hlsl_compute_check.py`, CMake/CI/docs wiring. Status: mergeable, CI green on this head (Linux checks, gfx1013 fixtures, Windows build and test; /O2 and chart jobs skipped). Title and body are neutral. No external or clean-room concerns seen in the diff. Commands executed locally in a worktree of the head: - `git diff --stat origin/main...HEAD`: 6 files, +652/-4 - `python3 tests/startup_gfx2hlsl_compute_check.py`: pass ("Self-test passed.") - `python3 tests/docs_links_check.py`: pass (18 files, 402 links) - `python3 tests/bidi_controls_check.py`: pass (1465 files) - `git diff --check origin/main...HEAD`: clean Mutations (each reverted with `git checkout -- .`): 1. Disabled the `s_cbranch_execz` skipped-block guard in `translate()`: killed (test fails: expected refusal naming `s_add_u32 inside a block s_cbranch_execz skips`). 2. Dropped the `& 0xfffffffcu` dword rounding in `op_buffer_store_dword`: killed (test pins the emitted `a = (v4 + 0) & 0xfffffffcu;`). 3. Removed the `desc_key(first) in self.pipe.modified` clause in the store's descriptor check: survived. Findings: - P1: none. - P2: none. - nit (`tools/startup/gfx2hlsl.py`, `op_buffer_store_dword`, the `desc_key(first) in self.pipe.modified` clause): mutation 3 survives. The per-word `self.sym` comparison already catches a modified word because the writer now tags it `('modified',)`, so the clause looks redundant. Either add a case where only `pipe.modified` carries the mark, or drop the clause. - nit (`op_buffer_store_dword`): the out-of-range store is deliberately unguarded and the comment and the new pinning test say so. It stays an assumption until a runtime sizes the UAV view. Fine to keep as documented. - nit (`setup_entry`): the compute root start at s4 is an inference. The code comment and `docs/experiments.md` say so honestly, and unplaced user SGPRs are refused on read. Good. Not run: Win2025 WARP. The compute store is not yet covered by a GPU readback in this PR, which is acceptable for a translator-only slice, but a WARP readback of the offen store versus a CPU reference should come before the follow-up that binds the UAV. Verdict: no blocking issues on this head; the earlier review points look addressed. AI-assisted; commands listed were executed locally.
R0Y00 commented 2026-11-25 05:04:47 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


The combined tree with current main (including #2139) passed the compute buffer-store comparison and all four mutations on both WARP and RTX 4060 Laptop. I found one scope leak in that combination: a source-built CS Stage with a table SRV and image_load v4, v[0:1], s[16:23] dim:SQ_RSRC_IMG_2D dmask:0x3 d16 emits pack16_d16(..., ud0) and udsrc 0 d16unorm16 0. ComputePipeline.manifest does not emit the d16srv bound-view requirement, and the CS path has no equivalent per-view validation. Please update against #2139 and explicitly refuse D16 loads in CS for this buffer-store slice. Add that synthetic case as a refusal control. Supporting D16 compute textures can follow when the compute consumer validates the effective SRV format.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6052046158 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2182#pullrequestreview-6052046158). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T04:54:02Z. **Review:** CHANGES_REQUESTED --- The combined tree with current main (including #2139) passed the compute buffer-store comparison and all four mutations on both WARP and RTX 4060 Laptop. I found one scope leak in that combination: a source-built CS Stage with a table SRV and `image_load v4, v[0:1], s[16:23] dim:SQ_RSRC_IMG_2D dmask:0x3 d16` emits `pack16_d16(..., ud0)` and `udsrc 0 d16unorm16 0`. ComputePipeline.manifest does not emit the `d16srv` bound-view requirement, and the CS path has no equivalent per-view validation. Please update against #2139 and explicitly refuse D16 loads in CS for this buffer-store slice. Add that synthetic case as a refusal control. Supporting D16 compute textures can follow when the compute consumer validates the effective SRV format.
upstream-sync closed this pull request 2026-11-25 06:01:20 +00:00
tedin7 commented 2026-11-25 06:01:21 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Re-review of head 0a523d0ec0 (comment only, no approval). Earlier reviews covered 0236bbcb and 94b042ba.

Scope: git diff --stat origin/main...HEAD is 6 files (gfx2hlsl.py, the compute check, CMakeLists.txt, windows.yml, AGENTS.md, docs/experiments.md). The new part since the last review is the "refuse unvalidated compute D16 loads" change in image() plus the D16 SRV format sets.

Commands executed locally (Linux):

  • python3 -B tests/startup_gfx2hlsl_compute_check.py -> pass
  • python3 -B tests/startup_image_sample_l_check.py -> FAIL: AttributeError: 'Stage' object has no attribute 'kind' (tools/startup/gfx2hlsl.py:1803, from tests/startup_image_sample_l_check.py:205 bare.image(...))
  • all tests/startup_gfx2hlsl_*_check.py and tests/startup_*gfx*check.py -> pass (the failure above is outside that glob)
  • python3 tests/docs_links_check.py -> 407 links OK; python3 tests/bidi_controls_check.py -> OK; git diff --check origin/main...HEAD -> clean
  • Mutation: replaced self.kind == 'cs' and 'd16' in mods with False and 'd16' in mods. The compute check fails ("accepted, expected a refusal naming 'compute d16 image load requires validated SRV formats'"), so the new refusal is guarded. Reverted with git checkout -- ..
  • CI: "Run platform-independent Python checks on Linux" is red on this head. The log shows the same traceback, in tests/startup_image_sample_l_check.py. The Windows jobs were still pending when I looked.

Findings:

  • P1: none.
  • P2 (tools/startup/gfx2hlsl.py:1803): image() now reads self.kind unconditionally. Stage instances created without kind (the bare Stage in tests/startup_image_sample_l_check.py:205 and its address-count control) raise AttributeError before any other check, so an existing test fails and the Linux CI job is red. Fix: set a default kind on Stage (or getattr(self, 'kind', None)), or have that test set bare.kind = 'ps' like startup_gfx2hlsl_refusals_check.py:37 does. A class-level default is safer, since other callers could build a Stage the same way.
  • nit (tests): the D16 refusal is covered for the unvalidated case. Add one control that a validated SRV format in D16_EXACT_SRV_FORMATS still lowers on cs, so the allowlist cannot be emptied unnoticed.
  • Earlier nits (user SGPR base s4 is an inference, store alignment/num_records assumptions, the Linux kill is an exact-line check) still stand and are documented in the code and docs.

Windows: I did not run x2w_pipe.py win2025 on this head. The Linux job is already red, and the earlier Win2025 debug result (11/11) was for 0236bbcb. It needs a rerun after the P2 fix.

Verdict: not ready until the P2 is fixed and CI is green.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6052255596 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2182#pullrequestreview-6052255596). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T05:23:05Z. **Review:** COMMENTED --- Re-review of head 0a523d0ec06c2680207e93a8a060614ccbb5d008 (comment only, no approval). Earlier reviews covered 0236bbcb and 94b042ba. Scope: `git diff --stat origin/main...HEAD` is 6 files (gfx2hlsl.py, the compute check, CMakeLists.txt, windows.yml, AGENTS.md, docs/experiments.md). The new part since the last review is the "refuse unvalidated compute D16 loads" change in `image()` plus the D16 SRV format sets. Commands executed locally (Linux): - `python3 -B tests/startup_gfx2hlsl_compute_check.py` -> pass - `python3 -B tests/startup_image_sample_l_check.py` -> FAIL: `AttributeError: 'Stage' object has no attribute 'kind'` (tools/startup/gfx2hlsl.py:1803, from tests/startup_image_sample_l_check.py:205 `bare.image(...)`) - all `tests/startup_gfx2hlsl_*_check.py` and `tests/startup_*gfx*check.py` -> pass (the failure above is outside that glob) - `python3 tests/docs_links_check.py` -> 407 links OK; `python3 tests/bidi_controls_check.py` -> OK; `git diff --check origin/main...HEAD` -> clean - Mutation: replaced `self.kind == 'cs' and 'd16' in mods` with `False and 'd16' in mods`. The compute check fails ("accepted, expected a refusal naming 'compute d16 image load requires validated SRV formats'"), so the new refusal is guarded. Reverted with `git checkout -- .`. - CI: "Run platform-independent Python checks on Linux" is red on this head. The log shows the same traceback, in tests/startup_image_sample_l_check.py. The Windows jobs were still pending when I looked. Findings: - P1: none. - P2 (tools/startup/gfx2hlsl.py:1803): `image()` now reads `self.kind` unconditionally. `Stage` instances created without `kind` (the bare Stage in tests/startup_image_sample_l_check.py:205 and its address-count control) raise AttributeError before any other check, so an existing test fails and the Linux CI job is red. Fix: set a default `kind` on `Stage` (or `getattr(self, 'kind', None)`), or have that test set `bare.kind = 'ps'` like startup_gfx2hlsl_refusals_check.py:37 does. A class-level default is safer, since other callers could build a Stage the same way. - nit (tests): the D16 refusal is covered for the unvalidated case. Add one control that a validated SRV format in D16_EXACT_SRV_FORMATS still lowers on cs, so the allowlist cannot be emptied unnoticed. - Earlier nits (user SGPR base s4 is an inference, store alignment/num_records assumptions, the Linux kill is an exact-line check) still stand and are documented in the code and docs. Windows: I did not run `x2w_pipe.py win2025` on this head. The Linux job is already red, and the earlier Win2025 debug result (11/11) was for 0236bbcb. It needs a rerun after the P2 fix. Verdict: not ready until the P2 is fixed and CI is green. AI-assisted; commands listed were executed locally.
R0Y00 commented 2026-11-25 06:01:21 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T05:23:48Z.

Review: APPROVED


Re-reviewed 0a523d0e. The integration explicitly refuses a D16 load in compute until that consumer validates the bound SRV, and the new control checks that refusal. Compute buffer-store controls, graphics D16 tests, and the offline producer test pass. The combined branch's three 320-word GPU comparisons and four mutations ran on WARP and RTX 4060 Laptop before this narrow guard. This lands the standalone compute translator only. Runtime binding and the real application Dispatch remain separate.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6052261014 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2182#pullrequestreview-6052261014). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T05:23:48Z. **Review:** APPROVED --- Re-reviewed 0a523d0e. The integration explicitly refuses a D16 load in compute until that consumer validates the bound SRV, and the new control checks that refusal. Compute buffer-store controls, graphics D16 tests, and the offline producer test pass. The combined branch's three 320-word GPU comparisons and four mutations ran on WARP and RTX 4060 Laptop before this narrow guard. This lands the standalone compute translator only. Runtime binding and the real application Dispatch remain separate.
tedin7 commented 2026-11-25 06:01:21 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Re-review of head 5633dcd0ff (PR #2182).

Delta since my last review (0a523d0e): one line, tools/startup/gfx2hlsl.py:1803, self.kind == 'cs' became getattr(self, 'kind', None) == 'cs'. This addresses the earlier P2 (bare Stage without kind raised AttributeError before the image refusals).

Commands executed locally (Linux):

  • python3 -B tests/startup_image_sample_l_check.py -> pass (was FAIL on 0a523d0e)
  • python3 -B tests/startup_gfx2hlsl_compute_check.py -> pass
  • all tests/startup_*gfx*check.py and tests/startup_image*check.py -> pass, no failures
  • python3 tests/docs_links_check.py -> 18 files, 407 links OK
  • python3 tests/bidi_controls_check.py -> OK
  • git diff --check origin/main...HEAD -> clean
  • Mutation: replaced the guard with False and 'd16' in mods. The compute check fails ("accepted, expected a refusal naming 'compute d16 image load requires validated SRV formats'"), so the refusal is guarded. Reverted with git checkout -- ..
  • CI on this head: "Run platform-independent Python checks on Linux" pass, "Assemble and translate gfx1013 fixtures" pass, "Build and test on Windows" pass. The /O2 job and the chart job are skipped. PR is mergeable, title is neutral.

Findings:

  • P1: none.
  • P2: none. The previous P2 is fixed.
  • nit (tests, carried over): add one control that a format in D16_EXACT_SRV_FORMATS still lowers on cs, so the allowlist cannot be emptied unnoticed.
  • Earlier nits (user SGPR base s4 is an inference, store alignment/num_records assumptions, the Linux kill is an exact-line check) still stand and are documented in the code and docs.

Windows: I did not run x2w_pipe.py win2025. The change since the last Win2025 run is a one-line Python default with no HLSL output change, and the Windows CI job is green. The maintainer's Draft -> Ready gate still needs its own WARP run on the final head.

Verdict: no blocking findings from this review.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6052324515 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2182#pullrequestreview-6052324515). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T05:31:41Z. **Review:** COMMENTED --- Re-review of head 5633dcd0ff9aa43efe2d678274eb584bf290c798 (PR #2182). Delta since my last review (0a523d0e): one line, tools/startup/gfx2hlsl.py:1803, `self.kind == 'cs'` became `getattr(self, 'kind', None) == 'cs'`. This addresses the earlier P2 (bare `Stage` without `kind` raised AttributeError before the image refusals). Commands executed locally (Linux): - `python3 -B tests/startup_image_sample_l_check.py` -> pass (was FAIL on 0a523d0e) - `python3 -B tests/startup_gfx2hlsl_compute_check.py` -> pass - all `tests/startup_*gfx*check.py` and `tests/startup_image*check.py` -> pass, no failures - `python3 tests/docs_links_check.py` -> 18 files, 407 links OK - `python3 tests/bidi_controls_check.py` -> OK - `git diff --check origin/main...HEAD` -> clean - Mutation: replaced the guard with `False and 'd16' in mods`. The compute check fails ("accepted, expected a refusal naming 'compute d16 image load requires validated SRV formats'"), so the refusal is guarded. Reverted with `git checkout -- .`. - CI on this head: "Run platform-independent Python checks on Linux" pass, "Assemble and translate gfx1013 fixtures" pass, "Build and test on Windows" pass. The /O2 job and the chart job are skipped. PR is mergeable, title is neutral. Findings: - P1: none. - P2: none. The previous P2 is fixed. - nit (tests, carried over): add one control that a format in D16_EXACT_SRV_FORMATS still lowers on cs, so the allowlist cannot be emptied unnoticed. - Earlier nits (user SGPR base s4 is an inference, store alignment/num_records assumptions, the Linux kill is an exact-line check) still stand and are documented in the code and docs. Windows: I did not run `x2w_pipe.py win2025`. The change since the last Win2025 run is a one-line Python default with no HLSL output change, and the Windows CI job is green. The maintainer's Draft -> Ready gate still needs its own WARP run on the final head. Verdict: no blocking findings from this review. AI-assisted; commands listed were executed locally.
NiiRoZz commented 2026-11-25 06:01:36 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by NiiRoZz on 2026-11-25T05:26:10Z.


The Linux Python job failed on 0a523d0e: tests/startup_image_sample_l_check.py builds a bare Stage (Stage.__new__) to reach the operand-only refusals, and the new compute D16 guard at the top of Stage.image reads self.kind, which a bare stage does not have (AttributeError: 'Stage' object has no attribute 'kind').

Pushed a one-line follow-up on top of your commit: the guard reads getattr(self, 'kind', None), so it is unchanged for a compute stage and bare stages reach their refusals again. Locally the 16 pure-Python checks that build a bare stage, plus startup_gfx2hlsl_compute_check.py and startup_translator_check.py, pass on that head.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7153767535 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2182#issuecomment-7153767535). Originally posted by [NiiRoZz](https://github.com/NiiRoZz) on 2026-11-25T05:26:10Z. --- The Linux Python job failed on 0a523d0e: `tests/startup_image_sample_l_check.py` builds a bare `Stage` (`Stage.__new__`) to reach the operand-only refusals, and the new compute D16 guard at the top of `Stage.image` reads `self.kind`, which a bare stage does not have (`AttributeError: 'Stage' object has no attribute 'kind'`). Pushed a one-line follow-up on top of your commit: the guard reads `getattr(self, 'kind', None)`, so it is unchanged for a compute stage and bare stages reach their refusals again. Locally the 16 pure-Python checks that build a bare stage, plus `startup_gfx2hlsl_compute_check.py` and `startup_translator_check.py`, pass on that head. AI-assisted (Claude Code).
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!2174
No description provided.