shader: merge current main into the native shader module stack #3241

Merged
lambirou merged 99 commits from upstream-pr/3241 into codex/native-shader-modules 2026-11-28 13:42:15 +00:00
lambirou commented 2026-11-28 01:22:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T01:22:11Z.


Updates #3091's codex/native-shader-modules branch to current main 7e5c378d, on top of the current base 71e23baf, without modifying either target branch. This is a merge-only PR; R0Y00 can merge it to refresh #3091. Conflict resolutions: - Base merge (#3138/#3308): keep #3138's sidecar_changed invalidation together with the branch's compute dependency_changed/lost checks in the watch gate; keep #3308's reviewed address-only mesh pixel inputs. - src/shader_compute_request.cpp: use the shared graphics_request_key/compute_request_key helpers, and keep read_pixel_inputs so both .psin and .ps57in records are read. - src/gfx1013_direct_compute.inl: keep the BCNT64 block alongside main's combine_scalar_mask, both output shapes (virtual waves 64x1x1, flat compute-derivative quads x*y*z), the exact_store/indexed gates, WREXEC and the virtual-wave derivative refusal. - src/gfx1013_compute_native.cpp: accept main's raw-store cache-policy naming while keeping the branch's direct-compute paths. - tools/startup/compile_dxil.cpp: keep both --rekey and --prepare-compute-pack in the usage text, and both watch invalidations. Validation at 48b2027c, Windows 11 build 26300, WARP 10.0.26100.10068 and RX 9060 XT 32.0.32029.2010: Debug: 18/18 selected controls pass, zero skips. Release /O2: 18/19; the only failure is native_ldexp_f16_hardware on this RX 9060 XT, and unmodified main 3926a289 fails it identically (got beef7c00, expected beef0200), so it is upstream #3123. The set covers direct container/mesh, pack/frozen, the compile watcher, interface/WQM, request cache, SALU shift64, image cache flags, WREXEC64, #3262 EXEC/VCC and the packed virtual-wave derivative control. The (8,4,1) native_compute_implicit_lod_hardware mismatch also still reproduces on unmodified main and remains #3255. The D3D12 debug layer is unavailable (0x887a002d). This does not change the flag fix in #3139; it only refreshes the compiler base and keeps both merged features.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5535324123 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3241). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-28T01:22:11Z. --- Updates #3091's `codex/native-shader-modules` branch to current `main` `7e5c378d`, on top of the current base `71e23baf`, without modifying either target branch. This is a merge-only PR; R0Y00 can merge it to refresh #3091. Conflict resolutions: - Base merge (#3138/#3308): keep `#3138`'s `sidecar_changed` invalidation together with the branch's compute `dependency_changed`/`lost` checks in the watch gate; keep #3308's reviewed address-only mesh pixel inputs. - `src/shader_compute_request.cpp`: use the shared `graphics_request_key`/`compute_request_key` helpers, and keep `read_pixel_inputs` so both `.psin` and `.ps57in` records are read. - `src/gfx1013_direct_compute.inl`: keep the BCNT64 block alongside main's `combine_scalar_mask`, both output shapes (virtual waves `64x1x1`, flat compute-derivative quads `x*y*z`), the `exact_store`/`indexed` gates, WREXEC and the virtual-wave derivative refusal. - `src/gfx1013_compute_native.cpp`: accept main's raw-store cache-policy naming while keeping the branch's direct-compute paths. - `tools/startup/compile_dxil.cpp`: keep both `--rekey` and `--prepare-compute-pack` in the usage text, and both watch invalidations. Validation at `48b2027c`, Windows 11 build 26300, WARP 10.0.26100.10068 and RX 9060 XT 32.0.32029.2010: Debug: 18/18 selected controls pass, zero skips. Release `/O2`: 18/19; the only failure is `native_ldexp_f16_hardware` on this RX 9060 XT, and unmodified `main` `3926a289` fails it identically (`got beef7c00, expected beef0200`), so it is upstream #3123. The set covers direct container/mesh, pack/frozen, the compile watcher, interface/WQM, request cache, SALU shift64, image cache flags, WREXEC64, #3262 EXEC/VCC and the packed virtual-wave derivative control. The `(8,4,1)` `native_compute_implicit_lod_hardware` mismatch also still reproduces on unmodified main and remains #3255. The D3D12 debug layer is unavailable (`0x887a002d`). This does not change the flag fix in #3139; it only refreshes the compiler base and keeps both merged features.
lambirou commented 2026-11-28 01:26:05 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T01:26:05Z.


@R0Y00 this is the merge-only refresh of #3091 onto main 57e94668. It is ready to merge into codex/native-shader-modules.

Validation at cead019e: 12/12 selected compiler/compute/sampler tests in Debug and 12/12 in Release, zero skips. No source changes beyond the conflict resolution. AI was used.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7231663170 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3241#issuecomment-7231663170). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-28T01:26:05Z. --- @R0Y00 this is the merge-only refresh of #3091 onto `main` `57e94668`. It is ready to merge into `codex/native-shader-modules`. Validation at `cead019e`: 12/12 selected compiler/compute/sampler tests in Debug and 12/12 in Release, zero skips. No source changes beyond the conflict resolution. AI was used.
R0Y00 commented 2026-11-28 01:38:17 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-28T01:38:17Z.

Review: CHANGES_REQUESTED


Thanks for preparing the merge-only PR. I found one correctness issue at cead019e. In read_compute_request(), sa[18] is evaluated before validate_compute_request_shape() enforces the 28-byte .sa. check_compute_extents() only checks that the companion length agrees with the descriptor, so an internally consistent short request can reach that access. #3006 validated the length first.

Please construct ComputeRequest with its default wave32 value, call validate_compute_request_shape(request), then read request.sa[18] into request.wave32. A source-built request with correctly keyed, short state A should return the existing “compute state block A is not 28 bytes” diagnostic in Debug and Release. The other reconciliations match the intended sampler, stride, and manifest revision behavior.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6094934707 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3241#pullrequestreview-6094934707). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-28T01:38:17Z. **Review:** CHANGES_REQUESTED --- Thanks for preparing the merge-only PR. I found one correctness issue at cead019e. In read_compute_request(), sa[18] is evaluated before validate_compute_request_shape() enforces the 28-byte .sa. check_compute_extents() only checks that the companion length agrees with the descriptor, so an internally consistent short request can reach that access. #3006 validated the length first. Please construct ComputeRequest with its default wave32 value, call validate_compute_request_shape(request), then read request.sa[18] into request.wave32. A source-built request with correctly keyed, short state A should return the existing “compute state block A is not 28 bytes” diagnostic in Debug and Release. The other reconciliations match the intended sampler, stride, and manifest revision behavior.
lambirou commented 2026-11-28 01:44:53 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T01:44:53Z.


Fixed at cf19be36. read_compute_request() now constructs ComputeRequest with its default wave32, calls validate_compute_request_shape(), and only then decodes request.sa[18].

Added the requested regression to native_compute_clear_check.py: a source-built request with a correctly keyed 24-byte state A must return compute state block A is not 28 bytes and write no shader.

Validation, Debug and Release, 5/5 each (no skips):

native_compute_clear
native_compute_pack
startup_compute_request_warp
startup_compute_translate_requests
startup_compute_request_offline

The other reconciliations are unchanged.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7231889173 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3241#issuecomment-7231889173). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-28T01:44:53Z. --- Fixed at cf19be36. `read_compute_request()` now constructs `ComputeRequest` with its default `wave32`, calls `validate_compute_request_shape()`, and only then decodes `request.sa[18]`. Added the requested regression to `native_compute_clear_check.py`: a source-built request with a correctly keyed 24-byte state A must return `compute state block A is not 28 bytes` and write no shader. Validation, Debug and Release, 5/5 each (no skips): ~~~ native_compute_clear native_compute_pack startup_compute_request_warp startup_compute_translate_requests startup_compute_request_offline ~~~ The other reconciliations are unchanged.
R0Y00 commented 2026-11-28 02:04:17 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-28T02:04:17Z.

Review: APPROVED


Re-reviewed cf19be3651. The state length is now validated before the first access to byte 18. The new correctly keyed 24-byte fixture preserves the existing diagnostic and prevents publishing a shader. I also ran a correctly keyed 16-byte state through both builds, so the request ends before byte 18. Both refused it with the expected shape diagnostic.

I independently tested on main 50e4f763, with cf19be36 integrated in trial tree 0d0868d58b43ad9bd1f5cd696ef2984ef41b00ee:

ctest --test-dir <build> --no-tests=error --output-on-failure -j 1 -R "^(native_(compute_clear|compute_pack|frozen_request|direct_(container|mesh)|graphics_(interface_library|wqm_ir|sampler_heap_.*)|compile_dxil_watch|startup_request_cache_controls|rtv_variant_controls)|startup_compute_(request_warp|translate_requests|request_offline|dispatch_native_hardware))$"

Debug and Release /O2 each passed 16/16, zero skips. Windows 11 26200.9974, RTX 4060 Laptop (32.0.16.1656), and inbox WARP 10.0.26100.9818. The selected suite exercised the WARP and hardware graphics paths and hardware slot-67 Dispatch.

This review covers the compiler-branch refresh. #3091 is the main integration PR and still needs its own review and required Windows check on the resulting head.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6095097055 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3241#pullrequestreview-6095097055). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-28T02:04:17Z. **Review:** APPROVED --- Re-reviewed cf19be365119. The state length is now validated before the first access to byte 18. The new correctly keyed 24-byte fixture preserves the existing diagnostic and prevents publishing a shader. I also ran a correctly keyed 16-byte state through both builds, so the request ends before byte 18. Both refused it with the expected shape diagnostic. I independently tested on main 50e4f763, with cf19be36 integrated in trial tree 0d0868d58b43ad9bd1f5cd696ef2984ef41b00ee: ``` ctest --test-dir <build> --no-tests=error --output-on-failure -j 1 -R "^(native_(compute_clear|compute_pack|frozen_request|direct_(container|mesh)|graphics_(interface_library|wqm_ir|sampler_heap_.*)|compile_dxil_watch|startup_request_cache_controls|rtv_variant_controls)|startup_compute_(request_warp|translate_requests|request_offline|dispatch_native_hardware))$" ``` Debug and Release /O2 each passed 16/16, zero skips. Windows 11 26200.9974, RTX 4060 Laptop (32.0.16.1656), and inbox WARP 10.0.26100.9818. The selected suite exercised the WARP and hardware graphics paths and hardware slot-67 Dispatch. This review covers the compiler-branch refresh. #3091 is the main integration PR and still needs its own review and required Windows check on the resulting head.
R0Y00 commented 2026-11-28 02:55:05 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-28T02:55:05Z.


After #3243 and #2981 landed, integrating cf19be36 onto main c827d8ba now conflicts in four files. The original short-state fix remains correct. I checked this reconciliation locally (tree 91399a6f3e12cd06062928ae111abb48cfdd976e):

  • In CMakeLists.txt keep both the exact-width texture cases and the compiler stack's new cases.
  • In gfx1013_compute_native.h keep main's three exact-width kinds in their current numeric positions, append packed_d16_x_uav and indexed_raw_srv, and keep both exact_texture_uav_channels and accepts_cbv_window. Use indexed_raw_srv for the decode upper bound in direct_compute_cache.cpp. The generated native shader revision already hashes the two source files.
  • In gfx1013_direct_compute.inl keep both exact_store and indexed. The store gate needs the exact_store exception and the descriptor gate needs the indexed exception.

The local Release /O2 trial gives 9/9, no skips. This includes pack/frozen request, direct mesh compilation, exact-width RGB and R store plus RGBA/sparse refusals on RTX, and #2981's now-main cold/warm and retry paths on WARP and RTX. Windows 11 26200.9974, RTX 4060 Laptop driver 32.0.16.1656, WARP 10.0.26100.9818, debug layer enabled for the graphics/texture fixtures.

ctest --test-dir <release-build> --no-tests=error --output-on-failure -j 1 -R "^(native_(compute_pack|frozen_request|direct_mesh|image_store_exact_width_hardware_(r|rgb|rgba|sparse))|startup_native_graphics_draw_(warp|hardware))$"

Please carry the current-main reconciliation on the refresh PR's source branch so #3091 can use it in its next review. The local trial did not change either target branch.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7232676919 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3241#issuecomment-7232676919). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-28T02:55:05Z. --- After #3243 and #2981 landed, integrating cf19be36 onto main c827d8ba now conflicts in four files. The original short-state fix remains correct. I checked this reconciliation locally (tree 91399a6f3e12cd06062928ae111abb48cfdd976e): - In CMakeLists.txt keep both the exact-width texture cases and the compiler stack's new cases. - In gfx1013_compute_native.h keep main's three exact-width kinds in their current numeric positions, append packed_d16_x_uav and indexed_raw_srv, and keep both exact_texture_uav_channels and accepts_cbv_window. Use indexed_raw_srv for the decode upper bound in direct_compute_cache.cpp. The generated native shader revision already hashes the two source files. - In gfx1013_direct_compute.inl keep both exact_store and indexed. The store gate needs the exact_store exception and the descriptor gate needs the indexed exception. The local Release /O2 trial gives 9/9, no skips. This includes pack/frozen request, direct mesh compilation, exact-width RGB and R store plus RGBA/sparse refusals on RTX, and #2981's now-main cold/warm and retry paths on WARP and RTX. Windows 11 26200.9974, RTX 4060 Laptop driver 32.0.16.1656, WARP 10.0.26100.9818, debug layer enabled for the graphics/texture fixtures. ``` ctest --test-dir <release-build> --no-tests=error --output-on-failure -j 1 -R "^(native_(compute_pack|frozen_request|direct_mesh|image_store_exact_width_hardware_(r|rgb|rgba|sparse))|startup_native_graphics_draw_(warp|hardware))$" ``` Please carry the current-main reconciliation on the refresh PR's source branch so #3091 can use it in its next review. The local trial did not change either target branch.
lambirou commented 2026-11-28 03:15:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T03:15:58Z.


Carried onto the refresh branch: f7bf5e2e merges main 9872074a into cf19be36.

The four conflicts are resolved as requested:

  • CMakeLists.txt keeps both the exact-width texture cases and the compiler stack's registrations.
  • gfx1013_compute_native.h keeps float_texture_uav/float2_texture_uav/float3_texture_uav in their numeric positions, then appends packed_d16_x_uav and indexed_raw_srv; both exact_texture_uav_channels and accepts_cbv_window remain.
  • direct_compute_cache.cpp uses indexed_raw_srv as the decode upper bound.
  • gfx1013_direct_compute.inl keeps both exact_store and indexed: the store gate accepts exact_store, and the descriptor gate accepts indexed.

Release /O2 and Debug each pass 9/9, zero skips, with your regex: native_compute_pack, native_frozen_request, native_direct_mesh, the four native_image_store_exact_width_hardware_* cases, and startup_native_graphics_draw_{warp,hardware}. Windows 11 26300, WARP 10.0.26100.10068, RX 9060 XT 32.0.32029.2010. The D3D12 debug layer was unavailable (0x887a002d).

#3241 is CLEAN/MERGEABLE at f7bf5e2e and approved; #3091 can use this head for its next review.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7232932335 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3241#issuecomment-7232932335). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-28T03:15:58Z. --- Carried onto the refresh branch: `f7bf5e2e` merges `main` `9872074a` into `cf19be36`. The four conflicts are resolved as requested: - `CMakeLists.txt` keeps both the exact-width texture cases and the compiler stack's registrations. - `gfx1013_compute_native.h` keeps `float_texture_uav`/`float2_texture_uav`/`float3_texture_uav` in their numeric positions, then appends `packed_d16_x_uav` and `indexed_raw_srv`; both `exact_texture_uav_channels` and `accepts_cbv_window` remain. - `direct_compute_cache.cpp` uses `indexed_raw_srv` as the decode upper bound. - `gfx1013_direct_compute.inl` keeps both `exact_store` and `indexed`: the store gate accepts `exact_store`, and the descriptor gate accepts `indexed`. Release `/O2` and Debug each pass 9/9, zero skips, with your regex: `native_compute_pack`, `native_frozen_request`, `native_direct_mesh`, the four `native_image_store_exact_width_hardware_*` cases, and `startup_native_graphics_draw_{warp,hardware}`. Windows 11 26300, WARP 10.0.26100.10068, RX 9060 XT 32.0.32029.2010. The D3D12 debug layer was unavailable (`0x887a002d`). #3241 is `CLEAN/MERGEABLE` at `f7bf5e2e` and approved; #3091 can use this head for its next review.
lambirou commented 2026-11-28 03:33:53 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T03:33:53Z.


Refreshed #3241 at 4a007912: merge of main a44e1f95 (includes 0fe4cebc, bf1bc769 and a44e1f95).

The conflicts are resolved as follows:

  • gfx1013_direct_compute.inl: complete_compute_quads is set before the lane setup, and the output keeps both shapes: virtual_waves finishes as 64x1x1, flat compute-derivative quads as x*y*z, original dimensions otherwise. The branch's exact_store/indexed gates and main's WREXEC validation/EXEC update path are both kept.
  • gfx1013_compute_native.cpp: keep the branch's Symbol types plus main's heap_offset/heap_carry, with the heap-address SMEM branch ahead of the graphics, sampler-heap and table branches.

Current-head suite, Release /O2 and Debug: 12/12 each, zero skips, including direct container/mesh, pack/frozen, interface/WQM, request cache, SALU shift64, the image cache flags and WREXEC64.

Both-shape control: native_compute_implicit_lod_controls passes; the 96-thread wave32 and 128-thread wave64 virtual-wave cases pass, as do the 1D flat cases. native_compute_implicit_lod_hardware fails only (8,4,1) on this RX 9060 XT. Unmodified main a44e1f95 fails it identically (expected=3f800000 actual=3f948000), so this is upstream in #3255 or the fixture, not the reconciliation. WARP skips because it has no 32-lane waves.

#3241 is CLEAN/MERGEABLE and approved at 4a007912; #3091 can use this head.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7233177324 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3241#issuecomment-7233177324). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-28T03:33:53Z. --- Refreshed `#3241` at `4a007912`: merge of `main` `a44e1f95` (includes `0fe4cebc`, `bf1bc769` and `a44e1f95`). The conflicts are resolved as follows: - `gfx1013_direct_compute.inl`: `complete_compute_quads` is set before the lane setup, and the output keeps both shapes: `virtual_waves` finishes as `64x1x1`, flat compute-derivative quads as `x*y*z`, original dimensions otherwise. The branch's `exact_store`/`indexed` gates and main's WREXEC validation/EXEC update path are both kept. - `gfx1013_compute_native.cpp`: keep the branch's Symbol types plus main's `heap_offset`/`heap_carry`, with the heap-address SMEM branch ahead of the graphics, sampler-heap and table branches. Current-head suite, Release `/O2` and Debug: 12/12 each, zero skips, including direct container/mesh, pack/frozen, interface/WQM, request cache, SALU shift64, the image cache flags and WREXEC64. Both-shape control: `native_compute_implicit_lod_controls` passes; the 96-thread wave32 and 128-thread wave64 virtual-wave cases pass, as do the 1D flat cases. `native_compute_implicit_lod_hardware` fails only `(8,4,1)` on this RX 9060 XT. Unmodified `main` `a44e1f95` fails it identically (`expected=3f800000 actual=3f948000`), so this is upstream in #3255 or the fixture, not the reconciliation. WARP skips because it has no 32-lane waves. #3241 is `CLEAN/MERGEABLE` and approved at `4a007912`; #3091 can use this head.
R0Y00 commented 2026-11-28 03:36:18 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-28T03:36:18Z.

Review: CHANGES_REQUESTED


The 128-thread case in native_compute_implicit_lod_check.py exercises a source-built FSSM container. The virtual-wave scheduler has a separate entry condition: a packed slot-67 request, more than one guest wave64, and a conditional branch plus a synchronizing instruction. The existing container case therefore does not cover the combination.

I rebuilt the exact 4a007912 tree and tested source-built slot-67 requests with the packed state, a table in s4, and a 128-thread group. The explicit-LOD case with a conditional branch plus barrier compiles to 64 physical threads. The ordinary implicit case compiles to 128. Adding that same branch and barrier to the implicit case also compiles on this head, with no corresponding packed-scheduler readback. A local reconciliation on dbaa010b kept the two positive cases and refused that combination at the image opcode, +0x90: implicit derivatives with virtual wave64 groups. Its independent RTX derivative, heap-offset, scalar NOT and WREXEC set passed 6/6.

Please add a packed slot-67 control for the combination. Either keep it refused as above or show its actual derivative readback against the explicit control. Please also absorb #3262's EXEC/VCC behaviors when refreshing the branch. The separately reported RX 9060 XT mismatch reproduces on unmodified main and is tracked on #3255.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6095478148 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3241#pullrequestreview-6095478148). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-28T03:36:18Z. **Review:** CHANGES_REQUESTED --- The 128-thread case in `native_compute_implicit_lod_check.py` exercises a source-built FSSM container. The virtual-wave scheduler has a separate entry condition: a packed slot-67 request, more than one guest wave64, and a conditional branch plus a synchronizing instruction. The existing container case therefore does not cover the combination. I rebuilt the exact `4a007912` tree and tested source-built slot-67 requests with the packed state, a table in s4, and a 128-thread group. The explicit-LOD case with a conditional branch plus barrier compiles to 64 physical threads. The ordinary implicit case compiles to 128. Adding that same branch and barrier to the implicit case also compiles on this head, with no corresponding packed-scheduler readback. A local reconciliation on `dbaa010b` kept the two positive cases and refused that combination at the image opcode, `+0x90: implicit derivatives with virtual wave64 groups`. Its independent RTX derivative, heap-offset, scalar NOT and WREXEC set passed 6/6. Please add a packed slot-67 control for the combination. Either keep it refused as above or show its actual derivative readback against the explicit control. Please also absorb #3262's EXEC/VCC behaviors when refreshing the branch. The separately reported RX 9060 XT mismatch reproduces on unmodified main and is tracked on #3255.
lambirou commented 2026-11-28 03:50:19 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T03:50:19Z.


Refreshed #3241 at cd746f6a: merge of main a166a753, which includes #3262.

Packed virtual-wave control. native_wave_virtual_derivative_controls builds source-built packed slot-67 requests with a table in s4 and a 128-thread group. Explicit LOD with a conditional branch and barrier compiles; ordinary implicit compiles; the combination is refused at the image opcode with implicit derivatives with virtual wave64 groups. The code refuses at the implicit && !pixel_stage check when virtual_waves is active, before any shader is published.

#3262 absorbed. s_cselect_b64 and s_not_b64 now use main's scalar64 source validation, so VCC and EXEC are accepted as 64-bit sources while the branch's direct-compute paths stay intact.

Release /O2 and Debug each pass 13/13, zero skips: the 12 current-head checks plus native_wave_virtual_derivative_controls. native_compute_implicit_lod_controls and the 96/128 cases still pass. The (8,4,1) RX 9060 XT mismatch remains upstream #3255; it reproduces on unmodified main a44e1f95 with the same value.

#3241 is CLEAN/MERGEABLE at cd746f6a. Please re-review.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7233433314 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3241#issuecomment-7233433314). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-28T03:50:19Z. --- Refreshed `#3241` at `cd746f6a`: merge of `main` `a166a753`, which includes #3262. **Packed virtual-wave control.** `native_wave_virtual_derivative_controls` builds source-built packed slot-67 requests with a table in s4 and a 128-thread group. Explicit LOD with a conditional branch and barrier compiles; ordinary implicit compiles; the combination is refused at the image opcode with `implicit derivatives with virtual wave64 groups`. The code refuses at the `implicit && !pixel_stage` check when `virtual_waves` is active, before any shader is published. **#3262 absorbed.** `s_cselect_b64` and `s_not_b64` now use main's `scalar64` source validation, so VCC and EXEC are accepted as 64-bit sources while the branch's direct-compute paths stay intact. Release `/O2` and Debug each pass 13/13, zero skips: the 12 current-head checks plus `native_wave_virtual_derivative_controls`. `native_compute_implicit_lod_controls` and the 96/128 cases still pass. The `(8,4,1)` RX 9060 XT mismatch remains upstream #3255; it reproduces on unmodified main `a44e1f95` with the same value. `#3241` is `CLEAN/MERGEABLE` at `cd746f6a`. Please re-review.
R0Y00 commented 2026-11-28 03:56:37 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-28T03:56:37Z.

Review: APPROVED


This revision addresses the packed-dispatch finding. I rebuilt cd746f6a (tree 0bba0986) and obtained 2/2 passes in Release /O2:

ctest --preset release --no-tests=error --output-on-failure -j 1 -R '^(native_wave_virtual_derivative_controls|native_s_not_b64_exec_controls)$'

The virtual scheduler's explicit-LOD case and the ordinary implicit case still compile. Their combined packed-state case refuses the image instruction before emitting a shader. The EXEC/VCC scalar controls pass against the same executable. Windows 11 26200.9974, MSVC x64 19.51, SDK/DXC 10.0.26100.0.

This is an approval of the published refresh head and its fix. #3091 still needs the published branch update, current-main integration and hosted Windows check. The independent AMD discrepancy remains tracked at #3255.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6095608427 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3241#pullrequestreview-6095608427). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-28T03:56:37Z. **Review:** APPROVED --- This revision addresses the packed-dispatch finding. I rebuilt `cd746f6a` (tree `0bba0986`) and obtained 2/2 passes in Release /O2: ```powershell ctest --preset release --no-tests=error --output-on-failure -j 1 -R '^(native_wave_virtual_derivative_controls|native_s_not_b64_exec_controls)$' ``` The virtual scheduler's explicit-LOD case and the ordinary implicit case still compile. Their combined packed-state case refuses the image instruction before emitting a shader. The EXEC/VCC scalar controls pass against the same executable. Windows 11 26200.9974, MSVC x64 19.51, SDK/DXC 10.0.26100.0. This is an approval of the published refresh head and its fix. #3091 still needs the published branch update, current-main integration and hosted Windows check. The independent AMD discrepancy remains tracked at #3255.
JohnConnorNPC commented 2026-11-28 07:33:51 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by JohnConnorNPC on 2026-11-28T07:33:51Z.


Thanks for working through both change requests. cf19be36 moves the sa[18] read after validate_compute_request_shape, cd746f6a refuses implicit derivatives in virtual wave64 groups, and the review list (gh api repos/R0Y00/Xbox2Windows/pulls/3241/reviews) shows APPROVED at cd746f6a.

The base moved after that approval. #3138 landed on codex/native-shader-modules at 0b505c1c, and the branch no longer merges: git merge-tree --write-tree 0b505c1c cd746f6a → rc=1, CONFLICT (content): Merge conflict in tools/startup/compile_dxil.cpp.

Could you merge the current base and push? I think is_stale resolves like this:

  • keep the base's bool sidecar_changed = false; and if (has_manifest && !sidecar_changed) {;
  • keep this branch's if (req.compute) { ... x2w::native_compute_output(manifest) ... } block inside that if;
  • drop the auto-merged lost = !psin_mtime.has_value() && fs::is_regular_file(psdep_path, ec); line. With the base's declarations lost no longer exists, so the merged file would not compile.
    After that, re-running native_compile_dxil_watch* from #3138 along with this PR's 13 tests would cover both sides.

Two smaller points, neither a blocker:

  • The CR1 fixture does not pin the fix. struct.pack("<6I", ...) is 24 bytes, so sa[18] is in range. With the old order the request still fails with compute state block A is not 28 bytes and the test stays green. A state A of 16 bytes or fewer would turn the reverted order into an out-of-range std::string read, which Debug iterator checks abort on. This is from reading the code: I did not build that mutant.
  • git grep -E 'virtual wave64 groups|native_wave_virtual_derivative' cd746f6a -- docs README.md finds nothing. One line in docs/experiments/native-compute-implicit-derivatives.md would document the new refusal.

This comment was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7236020428 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3241#issuecomment-7236020428). Originally posted by [JohnConnorNPC](https://github.com/JohnConnorNPC) on 2026-11-28T07:33:51Z. --- Thanks for working through both change requests. cf19be36 moves the `sa[18]` read after `validate_compute_request_shape`, cd746f6a refuses implicit derivatives in virtual wave64 groups, and the review list (`gh api repos/R0Y00/Xbox2Windows/pulls/3241/reviews`) shows APPROVED at cd746f6a. The base moved after that approval. #3138 landed on `codex/native-shader-modules` at 0b505c1c, and the branch no longer merges: `git merge-tree --write-tree 0b505c1c cd746f6a` → rc=1, `CONFLICT (content): Merge conflict in tools/startup/compile_dxil.cpp`. Could you merge the current base and push? I think `is_stale` resolves like this: - keep the base's `bool sidecar_changed = false;` and `if (has_manifest && !sidecar_changed) {`; - keep this branch's `if (req.compute) { ... x2w::native_compute_output(manifest) ... }` block inside that `if`; - drop the auto-merged `lost = !psin_mtime.has_value() && fs::is_regular_file(psdep_path, ec);` line. With the base's declarations `lost` no longer exists, so the merged file would not compile. After that, re-running `native_compile_dxil_watch*` from #3138 along with this PR's 13 tests would cover both sides. Two smaller points, neither a blocker: - The CR1 fixture does not pin the fix. `struct.pack("<6I", ...)` is 24 bytes, so `sa[18]` is in range. With the old order the request still fails with `compute state block A is not 28 bytes` and the test stays green. A state A of 16 bytes or fewer would turn the reverted order into an out-of-range `std::string` read, which Debug iterator checks abort on. This is from reading the code: I did not build that mutant. - `git grep -E 'virtual wave64 groups|native_wave_virtual_derivative' cd746f6a -- docs README.md` finds nothing. One line in `docs/experiments/native-compute-implicit-derivatives.md` would document the new refusal. This comment was AI-assisted.
lambirou commented 2026-11-28 10:09:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T10:09:57Z.


Refreshed #3241 at 86cf5aa8: it now merges both the current base 71e23baf (#3138, #3308) and current main 3926a289.

  • The watch gate keeps #3138's sidecar_changed and the branch's compute dependency_changed/lost checks.
  • Request reading uses the shared graphics_request_key/compute_request_key helpers while keeping .psin/.ps57in pixel inputs.
  • Direct compute keeps the BCNT64 block alongside main's combine_scalar_mask, both output shapes, the exact_store/indexed gates, WREXEC and the packed virtual-wave derivative refusal.
  • The usage text keeps both --rekey and --prepare-compute-pack.

Debug: 18/18 selected controls, zero skips. Release /O2: 18/19; only native_ldexp_f16_hardware fails on this RX 9060 XT, and unmodified main 3926a289 fails it identically (got beef7c00, expected beef0200), so it is upstream #3123. The (8,4,1) implicit-LOD mismatch remains #3255. The core compiler, WREXEC, #3262 and packed virtual-wave controls all pass.

#3241 is CLEAN/MERGEABLE and approved at 86cf5aa8; it is ready to merge into codex/native-shader-modules for #3091.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7237714284 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3241#issuecomment-7237714284). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-28T10:09:57Z. --- Refreshed #3241 at `86cf5aa8`: it now merges both the current base `71e23baf` (#3138, #3308) and current `main` `3926a289`. - The watch gate keeps #3138's `sidecar_changed` and the branch's compute `dependency_changed`/`lost` checks. - Request reading uses the shared `graphics_request_key`/`compute_request_key` helpers while keeping `.psin`/`.ps57in` pixel inputs. - Direct compute keeps the BCNT64 block alongside main's `combine_scalar_mask`, both output shapes, the `exact_store`/`indexed` gates, WREXEC and the packed virtual-wave derivative refusal. - The usage text keeps both `--rekey` and `--prepare-compute-pack`. Debug: 18/18 selected controls, zero skips. Release `/O2`: 18/19; only `native_ldexp_f16_hardware` fails on this RX 9060 XT, and unmodified `main` `3926a289` fails it identically (`got beef7c00, expected beef0200`), so it is upstream #3123. The `(8,4,1)` implicit-LOD mismatch remains #3255. The core compiler, WREXEC, #3262 and packed virtual-wave controls all pass. #3241 is `CLEAN/MERGEABLE` and approved at `86cf5aa8`; it is ready to merge into `codex/native-shader-modules` for #3091.
lambirou commented 2026-11-28 10:24:58 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T10:24:58Z.


Additional runtime check on the approved head 86cf5aa8:

ctest --preset {dev,release} --no-tests=error --output-on-failure -j 1 -R '^(startup_native_graphics_draw_(warp|hardware)|startup_mrt_dxc_(warp|hardware)|startup_compute_dispatch_native_(warp|hardware)|startup_stream_draw_(warp|hardware))$'

Debug and Release each gave 7 passes and one capability skip (startup_compute_dispatch_native_warp, 32-lane waves). The WARP and RX 9060 XT paths cover first-draw native graphics, MRT late-manifest recovery, stream draw, and hardware native Dispatch. This is the tree #3091 receives when #3241 fast-forwards codex/native-shader-modules.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7237882060 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3241#issuecomment-7237882060). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-28T10:24:58Z. --- Additional runtime check on the approved head `86cf5aa8`: ``` ctest --preset {dev,release} --no-tests=error --output-on-failure -j 1 -R '^(startup_native_graphics_draw_(warp|hardware)|startup_mrt_dxc_(warp|hardware)|startup_compute_dispatch_native_(warp|hardware)|startup_stream_draw_(warp|hardware))$' ``` Debug and Release each gave 7 passes and one capability skip (`startup_compute_dispatch_native_warp`, 32-lane waves). The WARP and RX 9060 XT paths cover first-draw native graphics, MRT late-manifest recovery, stream draw, and hardware native Dispatch. This is the tree #3091 receives when #3241 fast-forwards `codex/native-shader-modules`.
lambirou commented 2026-11-28 10:43:57 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T10:43:57Z.


Full Release build on 86cf5aa8 also completes with 0 errors (cmake --build --preset release, all targets). This is on top of the 18/19 targeted controls and the 7/8 runtime set already reported.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7238085828 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3241#issuecomment-7238085828). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-28T10:43:57Z. --- Full Release build on `86cf5aa8` also completes with 0 errors (`cmake --build --preset release`, all targets). This is on top of the 18/19 targeted controls and the 7/8 runtime set already reported.
lambirou commented 2026-11-28 11:07:49 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T11:07:49Z.


Refreshed again to 48b2027c: clean merge of main 7e5c378d (#3314, #3036).

  • native_exec_symbol_b64_controls passes; gfx1013_compute_native.cpp takes main's EXEC-symbol forgetting without breaking the branch's compute paths.
  • startup_gfx2hlsl_v_dot2_controls passes with main's dot2 lowering.
  • native_compute_pack passes after relinking the checker against the new compiler (the earlier failure was the known stale-checker symptom).

#3241 is CLEAN/MERGEABLE and remains approved at 48b2027c.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7238346414 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3241#issuecomment-7238346414). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-28T11:07:49Z. --- Refreshed again to `48b2027c`: clean merge of `main` `7e5c378d` (#3314, #3036). - `native_exec_symbol_b64_controls` passes; `gfx1013_compute_native.cpp` takes main's EXEC-symbol forgetting without breaking the branch's compute paths. - `startup_gfx2hlsl_v_dot2_controls` passes with main's dot2 lowering. - `native_compute_pack` passes after relinking the checker against the new compiler (the earlier failure was the known stale-checker symptom). #3241 is `CLEAN/MERGEABLE` and remains approved at `48b2027c`.
lambirou commented 2026-11-28 11:09:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-11-28T11:09:42Z.


Runtime checks on 48b2027c (the tree #3091 receives): 7 passes and one capability skip in Release. The WARP and RX 9060 XT paths cover native graphics draw, MRT late-manifest recovery, stream draw and hardware native Dispatch. No failures.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7238366904 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3241#issuecomment-7238366904). Originally posted by [lambirou](https://github.com/lambirou) on 2026-11-28T11:09:42Z. --- Runtime checks on `48b2027c` (the tree #3091 receives): 7 passes and one capability skip in Release. The WARP and RX 9060 XT paths cover native graphics draw, MRT late-manifest recovery, stream draw and hardware native Dispatch. No failures.
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!3241
No description provided.