shader: read the wave size of slot 67 compute requests from .sa #3006

Merged
Leyukaka merged 1 commit from upstream-pr/3006 into main 2026-11-28 01:00:33 +00:00
Leyukaka commented 2026-11-27 04:17:45 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-27T04:17:45Z.


Fixes #2999. Part of #2935. Target branch main.

Change (src/shader_compute_request.*, src/gfx1013_compute_native.cpp, src/native_compute_output.h, src/direct_compute_cache.cpp, src/startup_stubs/d3d12_compute_dispatch.inl, tools/startup/compile_dxil.cpp):

  • read_compute_request sets ComputeRequest::wave32 from bit 20 of .sa dword 4: set means wave32, clear means wave64. A .sa that is not 28 bytes is still refused, as before.
  • The direct DXIL route of translate_compute compiles a wave64 request through the wave64 path that translate_compute_container already uses for a stage without wave32.
  • A wave64 request whose group has at most 32 threads stays on the wave32 model, as before this change. Its one guest wave only has lanes 0..31, so EXEC's high word is zero and v_mbcnt_hi adds nothing for its lanes. One known difference remains: a wave64 compare or carry-out also writes zero to the high word of an SGPR pair destination, and the wave32 model leaves that word as it was.
  • Request keys stay at 29cs, as on main, and revision-28 archives are still read. The bit's meaning is an inference from captured data, explained in #2999 and in docs/experiments/native-slot67-wave-size.md.

Native output revision. A native compute manifest now ends with native <revision>, from native_compute_output_revision in src/native_compute_output.h.

  • The stand-in refuses, with a "rebuild it" reason:
    • a native manifest with another revision;
    • an unmarked manifest without the Python translator's <key>.cs.hlsl, which is a native output from before this change.
  • It looks again on the ManifestRetry schedule of an absent manifest: 1 s, doubling up to 32 s.
  • An unmarked manifest with a <key>.cs.hlsl is a Python output and is used as before.
  • compile_dxil --watch rebuilds stale native outputs. An unmarked output with a sidecar goes on to the usual bytecode check.
  • A native compile in either mode first removes a leftover <key>.cs.hlsl.
  • One case stays undetected: a directory where an earlier compile_dxil already republished a Python-translated key. That directory needs one --requests rerun.

Fixtures.

  • Source-built fixtures that relied on the wave32 default now set the bit, in 17 test files. That count includes native_dpp_row_check.py, added on main since the first version.
  • startup_compute_root_srv_dispatch_check.py now copies the Python sidecar along with the manifest and bytecode in its bad-manifest cases.

Tests. The setup was Windows 11 with an NVIDIA GeForce RTX 5080 and DXC from the Windows SDK 10.0.26100, on main 8cf9be9b plus this commit.

  • ctest -R "native_|startup_compute|startup_shader_cache_rekey|compile_dxil|startup_manifest_retry" passed 344 of 345, with five WARP capability skips (77).

  • native_scalar_lds_hardware fails with "native compute PSO creation failed", as it does on main without this change.

  • native_slot67_wave_size_hardware builds the same v_mbcnt_lo/v_mbcnt_hi program as three requests. The stored lane indices match a CPU reference, with every other buffer word untouched:

    Bit 20 Group size Expected lane index
    clear 64 threads tid % 64
    set 64 threads tid % 32
    clear 32 threads tid % 32
  • native_compile_dxil_watch, startup_compute_dispatch_warp/_hardware and native_startup_request_cache_check cover the stale-output paths. I described them in the earlier comment.

Mutation checks, run by hand on the earlier cpp-migration head and not rerun on this one:

  • for the wave size: ignoring the bit, inverting it, and dropping the 32-thread rule;
  • for stale outputs: letting the stand-in use an unmarked native output, letting --watch keep it, skipping the bytecode check for a Python output, and keeping the .cs.hlsl on a native publish.

Measured on a local capture (counts and instruction shape only), on cpp-migration e0d83759 before this was rebuilt on main, with compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests. I have not re-measured on main, which has gained lowerings since.

Requests Compiled before Compiled after Newly compiled No longer compiled
Capture, 2,689 389 393 46 42
One start-up run, 2,718 402 406 46 42
  • The 46 newly compiled requests are wave64 programs with 64-thread groups.
  • The 42 that stopped compiling are wave64 programs that the wave32 model used to accept. They stop at "multi-wave64 exchange requires converged group control flow", a limit of the existing wave64 path.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:5521113305 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3006). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-27T04:17:45Z. --- Fixes #2999. Part of #2935. Target branch `main`. **Change** (`src/shader_compute_request.*`, `src/gfx1013_compute_native.cpp`, `src/native_compute_output.h`, `src/direct_compute_cache.cpp`, `src/startup_stubs/d3d12_compute_dispatch.inl`, `tools/startup/compile_dxil.cpp`): - `read_compute_request` sets `ComputeRequest::wave32` from bit 20 of `.sa` dword 4: set means wave32, clear means wave64. A `.sa` that is not 28 bytes is still refused, as before. - The direct DXIL route of `translate_compute` compiles a wave64 request through the wave64 path that `translate_compute_container` already uses for a stage without `wave32`. - A wave64 request whose group has at most 32 threads stays on the wave32 model, as before this change. Its one guest wave only has lanes 0..31, so EXEC's high word is zero and `v_mbcnt_hi` adds nothing for its lanes. One known difference remains: a wave64 compare or carry-out also writes zero to the high word of an SGPR pair destination, and the wave32 model leaves that word as it was. - Request keys stay at `29cs`, as on `main`, and revision-28 archives are still read. The bit's meaning is an inference from captured data, explained in #2999 and in `docs/experiments/native-slot67-wave-size.md`. **Native output revision.** A native compute manifest now ends with `native <revision>`, from `native_compute_output_revision` in `src/native_compute_output.h`. - The stand-in refuses, with a "rebuild it" reason: - a native manifest with another revision; - an unmarked manifest without the Python translator's `<key>.cs.hlsl`, which is a native output from before this change. - It looks again on the `ManifestRetry` schedule of an absent manifest: 1 s, doubling up to 32 s. - An unmarked manifest with a `<key>.cs.hlsl` is a Python output and is used as before. - `compile_dxil --watch` rebuilds stale native outputs. An unmarked output with a sidecar goes on to the usual bytecode check. - A native compile in either mode first removes a leftover `<key>.cs.hlsl`. - One case stays undetected: a directory where an earlier `compile_dxil` already republished a Python-translated key. That directory needs one `--requests` rerun. **Fixtures.** - Source-built fixtures that relied on the wave32 default now set the bit, in 17 test files. That count includes `native_dpp_row_check.py`, added on `main` since the first version. - `startup_compute_root_srv_dispatch_check.py` now copies the Python sidecar along with the manifest and bytecode in its bad-manifest cases. **Tests.** The setup was Windows 11 with an NVIDIA GeForce RTX 5080 and DXC from the Windows SDK 10.0.26100, on `main` `8cf9be9b` plus this commit. - `ctest -R "native_|startup_compute|startup_shader_cache_rekey|compile_dxil|startup_manifest_retry"` passed 344 of 345, with five WARP capability skips (77). - `native_scalar_lds_hardware` fails with "native compute PSO creation failed", as it does on `main` without this change. - `native_slot67_wave_size_hardware` builds the same `v_mbcnt_lo`/`v_mbcnt_hi` program as three requests. The stored lane indices match a CPU reference, with every other buffer word untouched: | Bit 20 | Group size | Expected lane index | |---|---|---| | clear | 64 threads | `tid % 64` | | set | 64 threads | `tid % 32` | | clear | 32 threads | `tid % 32` | - `native_compile_dxil_watch`, `startup_compute_dispatch_warp`/`_hardware` and `native_startup_request_cache_check` cover the stale-output paths. I described them in the earlier comment. **Mutation checks**, run by hand on the earlier `cpp-migration` head and not rerun on this one: - for the wave size: ignoring the bit, inverting it, and dropping the 32-thread rule; - for stale outputs: letting the stand-in use an unmarked native output, letting `--watch` keep it, skipping the bytecode check for a Python output, and keeping the `.cs.hlsl` on a native publish. **Measured on a local capture** (counts and instruction shape only), on `cpp-migration` `e0d83759` before this was rebuilt on `main`, with `compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests`. I have not re-measured on `main`, which has gained lowerings since. | Requests | Compiled before | Compiled after | Newly compiled | No longer compiled | |---|---|---|---|---| | Capture, 2,689 | 389 | 393 | 46 | 42 | | One start-up run, 2,718 | 402 | 406 | 46 | 42 | - The 46 newly compiled requests are wave64 programs with 64-thread groups. - The 42 that stopped compiling are wave64 programs that the wave32 model used to accept. They stop at "multi-wave64 exchange requires converged group control flow", a limit of the existing wave64 path. AI-assisted.
R0Y00 commented 2026-11-27 04:43:17 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T04:43:17Z.

Review: COMMENTED


The cold-cache lane-index fixture verifies the new wave-size decoding. Issue #2999 also calls for rebuilding cached translations on update. The PR documents that --watch and the stand-in can still reuse the old <key>.txt / <key>.cs.cso, so a warm native cache can keep running the old wave32 result for a wave64 request. Please add an upgrade control that prepopulates the old output, then show that the updated consumer refreshes or rejects that output. A native output compatibility check could preserve legacy Python request keys while doing this.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6083581040 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3006#pullrequestreview-6083581040). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-27T04:43:17Z. **Review:** COMMENTED --- The cold-cache lane-index fixture verifies the new wave-size decoding. Issue #2999 also calls for rebuilding cached translations on update. The PR documents that `--watch` and the stand-in can still reuse the old `<key>.txt` / `<key>.cs.cso`, so a warm native cache can keep running the old wave32 result for a wave64 request. Please add an upgrade control that prepopulates the old output, then show that the updated consumer refreshes or rejects that output. A native output compatibility check could preserve legacy Python request keys while doing this.
Leyukaka commented 2026-11-27 05:13:44 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-27T05:13:44Z.


Thanks, done in the new commits, without changing request keys. The branch also merges cpp-migration 999e17cd, since #3003 changed the same --watch check.

Native output revision. compile_dxil now ends each native compute manifest with native <revision>. The revision is a constant shared with the stand-in, native_compute_output_revision in src/native_compute_output.h, starting at 1. It is meant to be bumped whenever a native translation of an unchanged request can change meaning.

Stand-in. Before reading bindings or bytecode:

  • a manifest with another native revision is refused with "native translation from another compiler revision; rebuild it";
  • a manifest with no native line and no <key>.cs.hlsl is a native output from before this change. It is refused with "native translation without a revision; rebuild it";
  • an unmarked manifest with a <key>.cs.hlsl is the Python translator's output and is used as before;
  • both refusals use the one-second retry of an absent manifest, so a running process can pick up a rebuilt output. That reload follows from the code path; no test covers it, since each check starts a new process.

compile_dxil.

  • --watch treats a stale or unmarked native output as pending and rebuilds it.
  • An unmarked output that has a .cs.hlsl goes on to the existing bytecode check, so a Python output with incomplete bytecode is still rebuilt.
  • --requests already rebuilds every output.
  • A native compile in either mode now first removes a <key>.cs.hlsl left by the Python translator, so the new pair cannot pass as a Python output. An unreadable manifest goes on to the bytecode check instead of counting as complete.

One case stays undetected: a directory where an earlier compile_dxil already republished a Python-translated key. That key's old .cs.hlsl sits next to an unmarked native manifest, and nothing tells the two apart. Such a directory needs one --requests rerun; the doc says so.

Upgrade controls:

  • native_compile_dxil_watch seeds an unmarked native output and a native 0 output, each with a dummy .cs.cso. It checks that --watch replaces the manifest and the bytecode of both. An unmarked Python-style output with a .cs.hlsl keeps all three files byte for byte, with their timestamps. The same output with truncated bytecode is rebuilt, and its .cs.hlsl is removed.
  • startup_compute_dispatch_warp and _hardware check both refusal strings with the output untouched. They then check the output words for a native 1 manifest and for a Python-style one.
  • native_startup_request_cache_check checks the exact native manifest and that no .cs.hlsl is written.

On the RTX 5080 and WARP, after the merge, ctest -R "native_|startup_compute|startup_shader_cache_rekey|compile_dxil" passed 280 of 282. The two failures fail the same way on 999e17cd without this PR: native_scalar_lds_hardware with "native compute PSO creation failed", and native_cvt_pk_u8_hardware with words 8, 24, 40 and 56 reading 0xa5a5a501 where 0xa5a5a500 is expected. Four manual mutants each fail a new control:

  • letting the stand-in use an unmarked native output fails both dispatch checks;
  • letting --watch keep an unmarked native output fails the watch check;
  • skipping the bytecode check for a Python output fails the watch check;
  • keeping the .cs.hlsl on a native publish fails the watch check.

One interaction to handle on merge: the portable fixture of #2975 writes a hand-made manifest without a native line, and its HLSL as <key>.hlsl. Under this check, that fixture needs its HLSL saved as <key>.cs.hlsl. I will make that change in whichever of the two PRs lands second.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7210457297 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3006#issuecomment-7210457297). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-27T05:13:44Z. --- Thanks, done in the new commits, without changing request keys. The branch also merges `cpp-migration` `999e17cd`, since #3003 changed the same `--watch` check. **Native output revision.** `compile_dxil` now ends each native compute manifest with `native <revision>`. The revision is a constant shared with the stand-in, `native_compute_output_revision` in `src/native_compute_output.h`, starting at 1. It is meant to be bumped whenever a native translation of an unchanged request can change meaning. **Stand-in.** Before reading bindings or bytecode: - a manifest with another `native` revision is refused with "native translation from another compiler revision; rebuild it"; - a manifest with no `native` line and no `<key>.cs.hlsl` is a native output from before this change. It is refused with "native translation without a revision; rebuild it"; - an unmarked manifest with a `<key>.cs.hlsl` is the Python translator's output and is used as before; - both refusals use the one-second retry of an absent manifest, so a running process can pick up a rebuilt output. That reload follows from the code path; no test covers it, since each check starts a new process. **`compile_dxil`.** - `--watch` treats a stale or unmarked native output as pending and rebuilds it. - An unmarked output that has a `.cs.hlsl` goes on to the existing bytecode check, so a Python output with incomplete bytecode is still rebuilt. - `--requests` already rebuilds every output. - A native compile in either mode now first removes a `<key>.cs.hlsl` left by the Python translator, so the new pair cannot pass as a Python output. An unreadable manifest goes on to the bytecode check instead of counting as complete. One case stays undetected: a directory where an earlier `compile_dxil` already republished a Python-translated key. That key's old `.cs.hlsl` sits next to an unmarked native manifest, and nothing tells the two apart. Such a directory needs one `--requests` rerun; the doc says so. **Upgrade controls:** - `native_compile_dxil_watch` seeds an unmarked native output and a `native 0` output, each with a dummy `.cs.cso`. It checks that `--watch` replaces the manifest and the bytecode of both. An unmarked Python-style output with a `.cs.hlsl` keeps all three files byte for byte, with their timestamps. The same output with truncated bytecode is rebuilt, and its `.cs.hlsl` is removed. - `startup_compute_dispatch_warp` and `_hardware` check both refusal strings with the output untouched. They then check the output words for a `native 1` manifest and for a Python-style one. - `native_startup_request_cache_check` checks the exact native manifest and that no `.cs.hlsl` is written. On the RTX 5080 and WARP, after the merge, `ctest -R "native_|startup_compute|startup_shader_cache_rekey|compile_dxil"` passed 280 of 282. The two failures fail the same way on `999e17cd` without this PR: `native_scalar_lds_hardware` with "native compute PSO creation failed", and `native_cvt_pk_u8_hardware` with words 8, 24, 40 and 56 reading `0xa5a5a501` where `0xa5a5a500` is expected. Four manual mutants each fail a new control: - letting the stand-in use an unmarked native output fails both dispatch checks; - letting `--watch` keep an unmarked native output fails the watch check; - skipping the bytecode check for a Python output fails the watch check; - keeping the `.cs.hlsl` on a native publish fails the watch check. One interaction to handle on merge: the portable fixture of #2975 writes a hand-made manifest without a `native` line, and its HLSL as `<key>.hlsl`. Under this check, that fixture needs its HLSL saved as `<key>.cs.hlsl`. I will make that change in whichever of the two PRs lands second. AI-assisted.
KelboLive commented 2026-11-27 05:20:38 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-27T05:20:38Z.

Review: COMMENTED


PR #3006 by @Leyukaka — shader: read the wave size of slot 67 compute requests from .sa

What works

  • Clean extraction of bit 20 from sa[18] with correct little-endian dword mapping (byte 18 is d4[2], bit 4 of that byte = global bit 20)
  • Default wave32=true preserves backwards compatibility: old .sa files without the bit still get wave32 behavior
  • Wave64 with <=32 threads stays on wave32 model: good fallback since lane 0..31 is valid either way
  • The known difference (wave64 compare/carry-out writes zero to high word of SGPR pair) is documented transparently
  • Key revision stays 28cs: Python caches preserved, no key hash changes needed
  • native_compute_output.h provides a clean versioning mechanism for native translations
  • Manifest retry mechanism (incompatible/unmarked -> retry after 1 second) supports live rebuilds
  • native_compute_output_revision bump to 1 is correct for the new version scheme
  • Test covers all three cases: bit clear/64 threads, bit set/64 threads, bit clear/32 threads
  • Mutation checks (ignore bit, invert bit, drop 32-thread rule) all correctly fail
  • 275/276 tests pass; 4 WARP skips, 1 adapter limitation unrelated to this change
  • compile_dxil --watch test properly handles old manifests, unmarked manifests, and new manifests
  • 15 test files updated to set the wave32 bit in their fixtures

Issues

  • sa[18] index is fragile: if .sa file structure changes (e.g., dword 4 offset shifts), this silently reads the wrong bit. Consider adding a comment with the full bit position: sa dword 4 bit 20 = sa[18] bit 4 in little-endian.
  • The native_compute_output parser uses a simple line-based search which could match partial lines (e.g., "nativex" would match the substring check). The line != "native" guard helps but substr(0,7) check on "native " should also verify the char at position 7 is a digit or the line ends after position 7.
  • load_compute_translation sets tr.retry_manifest_at in the incompatible case but the caller needs to know the retry is for manifest version, not just absence. The comment in the struct was updated to "absent and stale manifests can become ready later" which is good.
  • The wave64 threads > 32 check in gfx1013_direct_compute.inl is duplicated logic: the same check appears in both translation paths (direct DXIL and container). Moving to a single decision point would be cleaner.

Recommendations

  • Add a static_assert on sizeof(sa) == 28 or sa.size() == 28 in read_compute_request to catch malformed files early.
  • In native_compute_output, add a check that line[7] is a digit: if (line.size() == 7 || !isdigit(line[7])) return incompatible.
  • Consider adding a debug assertion in translate_program: assert(wave64 || threads <= 32) to catch any edge cases where threads > 32 but wave64 is false on a direct_dxil path.
  • The 15 fixture files updated should include a note in each file linking back to the capture analysis (#2999).

Overall

Well-executed inference-driven addition. The bit extraction is correct, the wave32 model fallback for small groups is a good safety net, and the manifest versioning provides a clean path forward for future native translation changes. The key question for merge readiness is whether the capture analysis in #2999 has sufficient evidence to confirm bit 20 as the wave size marker.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6083813037 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3006#pullrequestreview-6083813037). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-11-27T05:20:38Z. **Review:** COMMENTED --- PR #3006 by @Leyukaka — shader: read the wave size of slot 67 compute requests from .sa ## What works - Clean extraction of bit 20 from sa[18] with correct little-endian dword mapping (byte 18 is d4[2], bit 4 of that byte = global bit 20) - Default wave32=true preserves backwards compatibility: old .sa files without the bit still get wave32 behavior - Wave64 with <=32 threads stays on wave32 model: good fallback since lane 0..31 is valid either way - The known difference (wave64 compare/carry-out writes zero to high word of SGPR pair) is documented transparently - Key revision stays 28cs: Python caches preserved, no key hash changes needed - native_compute_output.h provides a clean versioning mechanism for native translations - Manifest retry mechanism (incompatible/unmarked -> retry after 1 second) supports live rebuilds - native_compute_output_revision bump to 1 is correct for the new version scheme - Test covers all three cases: bit clear/64 threads, bit set/64 threads, bit clear/32 threads - Mutation checks (ignore bit, invert bit, drop 32-thread rule) all correctly fail - 275/276 tests pass; 4 WARP skips, 1 adapter limitation unrelated to this change - compile_dxil --watch test properly handles old manifests, unmarked manifests, and new manifests - 15 test files updated to set the wave32 bit in their fixtures ## Issues - sa[18] index is fragile: if .sa file structure changes (e.g., dword 4 offset shifts), this silently reads the wrong bit. Consider adding a comment with the full bit position: sa dword 4 bit 20 = sa[18] bit 4 in little-endian. - The native_compute_output parser uses a simple line-based search which could match partial lines (e.g., "nativex" would match the substring check). The line != "native" guard helps but substr(0,7) check on "native " should also verify the char at position 7 is a digit or the line ends after position 7. - load_compute_translation sets tr.retry_manifest_at in the incompatible case but the caller needs to know the retry is for manifest version, not just absence. The comment in the struct was updated to "absent and stale manifests can become ready later" which is good. - The wave64 threads > 32 check in gfx1013_direct_compute.inl is duplicated logic: the same check appears in both translation paths (direct DXIL and container). Moving to a single decision point would be cleaner. ## Recommendations - Add a static_assert on sizeof(sa) == 28 or sa.size() == 28 in read_compute_request to catch malformed files early. - In native_compute_output, add a check that line[7] is a digit: if (line.size() == 7 || !isdigit(line[7])) return incompatible. - Consider adding a debug assertion in translate_program: assert(wave64 || threads <= 32) to catch any edge cases where threads > 32 but wave64 is false on a direct_dxil path. - The 15 fixture files updated should include a note in each file linking back to the capture analysis (#2999). ## Overall Well-executed inference-driven addition. The bit extraction is correct, the wave32 model fallback for small groups is a good safety net, and the manifest versioning provides a clean path forward for future native translation changes. The key question for merge readiness is whether the capture analysis in #2999 has sufficient evidence to confirm bit 20 as the wave size marker.
R0Y00 commented 2026-11-27 05:24:51 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T05:24:51Z.

Review: COMMENTED


Independent Release /O2 on exact head 5c49bbe38b803d13bdaccfd4e2584cc91aaffc34, Windows 11 build 26200.9974 and SDK 10.0.26100. I built startup_stream_consumer d3d12_xs_shim compile_dxil native_store_replay and ran native_compile_dxil_watch, native_startup_request_cache_controls, startup_compute_dispatch_(warp|hardware) and native_slot67_wave_size_hardware: 5 passed, no skips. WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656 matched all 320 dispatch words for the current and Python-style manifests, preserving sentinels in the stale cases. RTX also matched 128/128/64 lane indices for the three slot-67 cases. The marker keeps the existing request key, but the .cs.hlsl heuristic still cannot identify an old native output over a prior Python publication; the documented one-time --requests rebuild still applies to mixed directories. Please keep the reported #2975 sidecar rename with whichever PR lands second.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6083842968 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3006#pullrequestreview-6083842968). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-27T05:24:51Z. **Review:** COMMENTED --- Independent Release `/O2` on exact head `5c49bbe38b803d13bdaccfd4e2584cc91aaffc34`, Windows 11 build 26200.9974 and SDK 10.0.26100. I built `startup_stream_consumer d3d12_xs_shim compile_dxil native_store_replay` and ran `native_compile_dxil_watch`, `native_startup_request_cache_controls`, `startup_compute_dispatch_(warp|hardware)` and `native_slot67_wave_size_hardware`: 5 passed, no skips. WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656 matched all 320 dispatch words for the current and Python-style manifests, preserving sentinels in the stale cases. RTX also matched 128/128/64 lane indices for the three slot-67 cases. The marker keeps the existing request key, but the `.cs.hlsl` heuristic still cannot identify an old native output over a prior Python publication; the documented one-time `--requests` rebuild still applies to mixed directories. Please keep the reported #2975 sidecar rename with whichever PR lands second.
R0Y00 commented 2026-11-27 12:26:53 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T12:26:53Z.


Retargeted to main. A trial merge at 1ec2c938 conflicts in gfx1013_compute_native.cpp, shader_compute_request.cpp, d3d12_compute_dispatch.inl and startup_compute_dispatch_check.py. Please preserve the DPP changes from #3010, revision-29 request keys with revision-28 archive support, and ManifestRetry timing for both absent and stale manifests. Carry the #2975 sidecar naming resolution as discussed. #3014 still follows this PR because both touch the request reader and compile_dxil; we'll validate the wave-size and cache-rebuild path on the rebased head before requesting the rekey rebase.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7218253968 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3006#issuecomment-7218253968). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-27T12:26:53Z. --- Retargeted to `main`. A trial merge at `1ec2c938` conflicts in `gfx1013_compute_native.cpp`, `shader_compute_request.cpp`, `d3d12_compute_dispatch.inl` and `startup_compute_dispatch_check.py`. Please preserve the DPP changes from #3010, revision-29 request keys with revision-28 archive support, and `ManifestRetry` timing for both absent and stale manifests. Carry the #2975 sidecar naming resolution as discussed. #3014 still follows this PR because both touch the request reader and `compile_dxil`; we'll validate the wave-size and cache-rebuild path on the rebased head before requesting the rekey rebase.
Leyukaka commented 2026-11-27 17:47:19 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-27T17:47:19Z.


Rebuilt on current main (8cf9be9b) as one commit, e7a1e90f, which replaces the earlier branch history. The description is updated to match. Your four points:

  • DPP changes from #3010: untouched. The only change in gfx1013_compute_native.cpp is the wave64 expression; main's heap_window and parse(...) arguments stay as they are.
  • Request keys: unchanged. 29cs keys and the revision-28 archive path in shader_compute_request.cpp are as on main; only the returned wave32 field is new.
  • ManifestRetry: both stale-native refusals call manifest_retry.missed(...) and return; a usable manifest calls found(). There is no retry_manifest_at left. An absent manifest keeps main's handling.
  • Sidecar naming: #2975's portable fixture is not on main, so there is nothing to rename here. That rename applies to whichever of #2975/#3049 lands after this. On main, startup_compute_root_srv_dispatch_check.py copies a Python manifest and .cs.cso into its bad-manifest cases. It now also copies the .cs.hlsl, so those cases keep testing the binding refusals rather than the stale-native one.

One fixture added on main since the first version, native_dpp_row_check.py, built .sa without the wave32 bit and now sets it. #3022's permlane fixture sets it too, in that PR.

On this head (RTX 5080 and WARP, Release), ctest -R "native_|startup_compute|startup_shader_cache_rekey|compile_dxil|startup_manifest_retry" passed 344 of 345, with five WARP capability skips. native_scalar_lds_hardware fails with "native compute PSO creation failed", as on main without this change.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7224787234 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3006#issuecomment-7224787234). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-27T17:47:19Z. --- Rebuilt on current `main` (`8cf9be9b`) as one commit, `e7a1e90f`, which replaces the earlier branch history. The description is updated to match. Your four points: - **DPP changes from #3010:** untouched. The only change in `gfx1013_compute_native.cpp` is the `wave64` expression; `main`'s `heap_window` and `parse(...)` arguments stay as they are. - **Request keys:** unchanged. `29cs` keys and the revision-28 archive path in `shader_compute_request.cpp` are as on `main`; only the returned `wave32` field is new. - **`ManifestRetry`:** both stale-native refusals call `manifest_retry.missed(...)` and return; a usable manifest calls `found()`. There is no `retry_manifest_at` left. An absent manifest keeps `main`'s handling. - **Sidecar naming:** #2975's portable fixture is not on `main`, so there is nothing to rename here. That rename applies to whichever of #2975/#3049 lands after this. On `main`, `startup_compute_root_srv_dispatch_check.py` copies a Python manifest and `.cs.cso` into its bad-manifest cases. It now also copies the `.cs.hlsl`, so those cases keep testing the binding refusals rather than the stale-native one. One fixture added on `main` since the first version, `native_dpp_row_check.py`, built `.sa` without the wave32 bit and now sets it. #3022's permlane fixture sets it too, in that PR. On this head (RTX 5080 and WARP, Release), `ctest -R "native_|startup_compute|startup_shader_cache_rekey|compile_dxil|startup_manifest_retry"` passed 344 of 345, with five WARP capability skips. `native_scalar_lds_hardware` fails with "native compute PSO creation failed", as on `main` without this change. AI-assisted.
pigalot commented 2026-11-27 21:56:41 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-27T21:56:41Z.

Review: COMMENTED


I tried to review e7a1e90f over current main 63fd6ea8. The trial merge (git merge-tree --write-tree origin/main review/3006) conflicts in one hunk of src/gfx1013_compute_native.cpp, just after the 0xc00 root-flag check. Since this PR's base 8cf9be9b, #3140 (673a9f2c) has turned the one-line if body there into a block that also sets initial[next + 1] = {Symbol::Type::table, compute_sampler_heap};. This PR replaces the const bool wave64 = stage && !stage->wave32; line that follows it. The resolution should keep #3140's block as it is, followed by this PR's comment and new wave64 expression. The other files merge cleanly.

One interaction to recheck after the rebase: #3180 (63fd6ea8) gates the wave32 VCC SMEM limit on !wave64. With this PR, wave64 requests over 32 threads would then keep the 106-SGPR limit. That is the intended behaviour. I haven't run it.

I'll review it once it is updated with main.

This reply was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6093716978 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3006#pullrequestreview-6093716978). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-27T21:56:41Z. **Review:** COMMENTED --- I tried to review `e7a1e90f` over current `main` `63fd6ea8`. The trial merge (`git merge-tree --write-tree origin/main review/3006`) conflicts in one hunk of `src/gfx1013_compute_native.cpp`, just after the `0xc00` root-flag check. Since this PR's base `8cf9be9b`, #3140 (`673a9f2c`) has turned the one-line `if` body there into a block that also sets `initial[next + 1] = {Symbol::Type::table, compute_sampler_heap};`. This PR replaces the `const bool wave64 = stage && !stage->wave32;` line that follows it. The resolution should keep #3140's block as it is, followed by this PR's comment and new `wave64` expression. The other files merge cleanly. One interaction to recheck after the rebase: #3180 (`63fd6ea8`) gates the wave32 VCC SMEM limit on `!wave64`. With this PR, wave64 requests over 32 threads would then keep the 106-SGPR limit. That is the intended behaviour. I haven't run it. I'll review it once it is updated with `main`. This reply was AI-assisted.
pigalot commented 2026-11-27 22:22:47 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-27T22:22:47Z.


One addition to my comment on e7a1e90f: as of main 22f38526 there is a second conflict, in tests/native_f16_alu_check.py. #3188 (698a057f) changed that GPU check into a loop over an alu and a dpp program, and this PR sets the wave32 bit (1 << 20) in the .sa dword 4 of that block. The rebased version should keep both programs and set the bit for both requests.

This reply was AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7229278428 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3006#issuecomment-7229278428). Originally posted by [pigalot](https://github.com/pigalot) on 2026-11-27T22:22:47Z. --- One addition to my comment on `e7a1e90f`: as of `main` `22f38526` there is a second conflict, in `tests/native_f16_alu_check.py`. #3188 (`698a057f`) changed that GPU check into a loop over an `alu` and a `dpp` program, and this PR sets the wave32 bit (`1 << 20`) in the `.sa` dword 4 of that block. The rebased version should keep both programs and set the bit for both requests. This reply was AI-assisted.
Leyukaka commented 2026-11-28 00:06:48 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-28T00:06:48Z.


Rebased on main 14d56502 as one commit (7e018ffe). The conflicts were:

  • main's sampler-heap line next to the wave64 expression;
  • an include next to native_buffer_store_view.h in d3d12_xs_device.cpp;
  • tests/native_f16_alu_check.py. main (#3188) already sets the wave32 bit in the one .sa both the alu and dpp requests use, so main's version is kept. tests/native_sdwa_f16_check.py is the same case on main (#3201).

15 test files now set the bit, down from 17, because main already does it in those two.

Tests. ctest -R "native_|startup_compute|startup_shader_cache_rekey|compile_dxil|startup_manifest_retry" passes 394 of 399 (RTX 5080 and WARP, Release). The 5 failures are the same on main 14d56502 without this change:

  • native_scalar_lds_hardware, as before;
  • native_rtv_variant_warp/_hardware and startup_compute_dispatch_native_warp/_hardware. They assert the exact cache contents and now find the revision.txt that #2820 writes. #3228 addresses the two dispatch_native ones.

Measured on the 882 untranslated compute requests ranked in #3224, with compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests, main 14d56502 against this branch.

  • 144 programs change outcome, 2,272,681 dispatches of that run.
  • 100 of the 156 programs in the "unbound numeric SGPR" family move on: 1,930,892 of its 2,545,711 dispatches. That family is mostly the wave-size gap. The wave64 programs compare into an SGPR pair (v_cmp_*_e64 s10, ...), then read s[10:11], which the wave32 model leaves unbound.
  • 27 of them now compile (230,505 dispatches). Compiled programs go from 110 to 128.
  • 55 programs (1,150,184 dispatches) now stop at "multi-wave64 exchange requires converged group control flow". That is main's whole-program gate for wave64 groups of more than 64 threads.
  • 9 of them (55,551 dispatches) compiled on main with the wave32 model, although they are wave64 requests. They are refused now rather than translated with the wrong wave size.
  • The #3180 interaction you asked me to recheck: 17 programs now stop at "unsupported scalar memory destination range", against 0 on main. These are wave64 requests over 32 threads that keep the 106-SGPR SMEM limit, which is the behaviour you described.

The Tests and Measured sections of the description still describe the first version on 8cf9be9b. This comment replaces them.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7230657225 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3006#issuecomment-7230657225). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-28T00:06:48Z. --- Rebased on `main` `14d56502` as one commit (`7e018ffe`). The conflicts were: - `main`'s sampler-heap line next to the `wave64` expression; - an include next to `native_buffer_store_view.h` in `d3d12_xs_device.cpp`; - `tests/native_f16_alu_check.py`. `main` (#3188) already sets the wave32 bit in the one `.sa` both the `alu` and `dpp` requests use, so `main`'s version is kept. `tests/native_sdwa_f16_check.py` is the same case on `main` (#3201). 15 test files now set the bit, down from 17, because `main` already does it in those two. **Tests.** `ctest -R "native_|startup_compute|startup_shader_cache_rekey|compile_dxil|startup_manifest_retry"` passes 394 of 399 (RTX 5080 and WARP, Release). The 5 failures are the same on `main` `14d56502` without this change: - `native_scalar_lds_hardware`, as before; - `native_rtv_variant_warp`/`_hardware` and `startup_compute_dispatch_native_warp`/`_hardware`. They assert the exact cache contents and now find the `revision.txt` that #2820 writes. #3228 addresses the two `dispatch_native` ones. **Measured** on the 882 untranslated compute requests ranked in #3224, with `compile_dxil --jobs 8 gfx1013-direct-cs@36 --requests`, `main` `14d56502` against this branch. - 144 programs change outcome, 2,272,681 dispatches of that run. - 100 of the 156 programs in the "unbound numeric SGPR" family move on: 1,930,892 of its 2,545,711 dispatches. That family is mostly the wave-size gap. The wave64 programs compare into an SGPR pair (`v_cmp_*_e64 s10, ...`), then read `s[10:11]`, which the wave32 model leaves unbound. - 27 of them now compile (230,505 dispatches). Compiled programs go from 110 to 128. - 55 programs (1,150,184 dispatches) now stop at "multi-wave64 exchange requires converged group control flow". That is `main`'s whole-program gate for wave64 groups of more than 64 threads. - 9 of them (55,551 dispatches) compiled on `main` with the wave32 model, although they are wave64 requests. They are refused now rather than translated with the wrong wave size. - The #3180 interaction you asked me to recheck: 17 programs now stop at "unsupported scalar memory destination range", against 0 on `main`. These are wave64 requests over 32 threads that keep the 106-SGPR SMEM limit, which is the behaviour you described. The Tests and Measured sections of the description still describe the first version on `8cf9be9b`. This comment replaces them. AI-assisted.
R0Y00 commented 2026-11-28 00:43:18 +00:00 (Migrated from github.com)

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


Rechecked 7e018ffe against main 350785e8 after #3227. The only merge conflict is the final compute manifest writer in direct_compute_cache.cpp. Keep main's program.stride_srvs loop before the SRV/UAV/sampler lines, then append the existing native revision line. The new native_descriptor_scc_check.py exact manifest list also needs its final native 1 line.

I tried just those two changes locally on the existing PR. Windows 11 26200.9974, RTX 4060 Laptop 32.0.16.1656, Release /O2: native_descriptor_scc_hardware, startup_compute_descriptor_scc_hardware, native_compile_dxil_watch and native_slot67_wave_size_hardware all passed. Please carry those two changes in the existing PR on current main so CI and independent review can evaluate the new head. The reported #3224 compile counts remain separate from GPU readback.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7231142453 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3006#issuecomment-7231142453). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-28T00:43:18Z. --- Rechecked 7e018ffe against main 350785e8 after #3227. The only merge conflict is the final compute manifest writer in direct_compute_cache.cpp. Keep main's program.stride_srvs loop before the SRV/UAV/sampler lines, then append the existing native revision line. The new native_descriptor_scc_check.py exact manifest list also needs its final native 1 line. I tried just those two changes locally on the existing PR. Windows 11 26200.9974, RTX 4060 Laptop 32.0.16.1656, Release /O2: native_descriptor_scc_hardware, startup_compute_descriptor_scc_hardware, native_compile_dxil_watch and native_slot67_wave_size_hardware all passed. Please carry those two changes in the existing PR on current main so CI and independent review can evaluate the new head. The reported #3224 compile counts remain separate from GPU readback.
Leyukaka commented 2026-11-28 00:48:21 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-28T00:48:21Z.


Rebased again on main 86beae95; head is now ecd2646a.

  • The conflict was in format_compute_runtime_manifest: main's udsrc ... stride lines from #3227 are kept, and the native <revision> line still comes last.
  • #3227's new tests/native_descriptor_scc_check.py compares the published manifest line for line. With this PR the manifest has one more line, native <revision>. The test now checks that exactly one such line is present and compares the other lines exactly as before. native_compile_dxil_watch_check.py in this PR counts the line the same way.

ctest -R "native_|startup_compute|startup_shader_cache_rekey|compile_dxil|startup_manifest_retry" ran before the test change (RTX 5080 and WARP, Release): 408 of 411 passed.

  • native_scalar_lds_hardware failed, as it does on main.
  • The two native_descriptor_scc tests failed on the manifest line.

After the change, -R "native_descriptor_scc|startup_compute_descriptor_scc" passes both _hardware tests, and the two _warp tests report the capability skip.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7231203960 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3006#issuecomment-7231203960). Originally posted by [Leyukaka](https://github.com/Leyukaka) on 2026-11-28T00:48:21Z. --- Rebased again on `main` `86beae95`; head is now `ecd2646a`. - The conflict was in `format_compute_runtime_manifest`: `main`'s `udsrc ... stride` lines from #3227 are kept, and the `native <revision>` line still comes last. - #3227's new `tests/native_descriptor_scc_check.py` compares the published manifest line for line. With this PR the manifest has one more line, `native <revision>`. The test now checks that exactly one such line is present and compares the other lines exactly as before. `native_compile_dxil_watch_check.py` in this PR counts the line the same way. `ctest -R "native_|startup_compute|startup_shader_cache_rekey|compile_dxil|startup_manifest_retry"` ran before the test change (RTX 5080 and WARP, Release): 408 of 411 passed. - `native_scalar_lds_hardware` failed, as it does on `main`. - The two `native_descriptor_scc` tests failed on the manifest line. After the change, `-R "native_descriptor_scc|startup_compute_descriptor_scc"` passes both `_hardware` tests, and the two `_warp` tests report the capability skip. AI-assisted.
R0Y00 commented 2026-11-28 01:00:29 +00:00 (Migrated from github.com)

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

Review: APPROVED


Independent review of ecd2646aaa integrated on main 86beae95, tree 3ab5553ad6. The .sa bit selects the direct DXIL wave model for larger groups; stable request keys still load previous raw requests. Version-tagged native manifests and the watcher prevent stale DXIL reuse, and Python manifests with the existing sidecar are still accepted. The descriptor SCC entry is preserved. The small-group high-half limitation is documented and is outside this change.

Debug and Release /O2 each had six passes and three wave32 capability skips, no failures. Hardware verified the new wave-size reference, both descriptor SCC routes, native Dispatch and the legacy/retry controls. WARP was inbox 10.0.26100.9818. Windows 11 26200.9974, RTX 4060 Laptop driver 32.0.16.1656.

ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^(native_(slot67_wave_size_hardware|descriptor_scc_(warp|hardware)|compile_dxil_watch)|startup_(compute_descriptor_scc_(warp|hardware)|compute_dispatch_native_(warp|hardware)|manifest_retry))$'

This validates source-built requests and cache migration. The shader census totals are contributor measurements and do not establish title rendering.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6094787278 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/3006#pullrequestreview-6094787278). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-28T01:00:29Z. **Review:** APPROVED --- Independent review of ecd2646aaa24ac95b97333db348216a92073f14a integrated on main 86beae95, tree 3ab5553ad668f49086d4d81da40819b70dc725b8. The .sa bit selects the direct DXIL wave model for larger groups; stable request keys still load previous raw requests. Version-tagged native manifests and the watcher prevent stale DXIL reuse, and Python manifests with the existing sidecar are still accepted. The descriptor SCC entry is preserved. The small-group high-half limitation is documented and is outside this change. Debug and Release /O2 each had six passes and three wave32 capability skips, no failures. Hardware verified the new wave-size reference, both descriptor SCC routes, native Dispatch and the legacy/retry controls. WARP was inbox 10.0.26100.9818. Windows 11 26200.9974, RTX 4060 Laptop driver 32.0.16.1656. ```powershell ctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^(native_(slot67_wave_size_hardware|descriptor_scc_(warp|hardware)|compile_dxil_watch)|startup_(compute_descriptor_scc_(warp|hardware)|compute_dispatch_native_(warp|hardware)|manifest_retry))$' ``` This validates source-built requests and cache migration. The shader census totals are contributor measurements and do not establish title rendering.
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!3006
No description provided.