runtime: bind constant static samplers on the in-process compute route #3156

Manually merged
github merged 2 commits from github-bot/gh-3154 into gh-pr/3154/base 2026-11-29 00:37:51 +00:00 AGit
Owner

@⁠Not-Saii on GitHub · 2026-11-27 18:51 UTC · original
Not-Saii:claude/native-compute-static-samplers-13b9d3 → main · +290 −11 · 6 files · 2 commits · merged 2026-11-29 00:33 UTC

Change

Target branch main. Fixes #3151. Part of #2935 (item "Samplers") and #3074 (stage 5). Follow-up to #3075 / #3083, which covers the published-manifest route.

No longer depends on #3049. Since #3243, main itself accepts a 2D texture input and a 3D float texture output on the in-process route, which is all this fixture needs. The branch is now two commits on main at f5a6f6ba (af6045df change and fixture, 93582447 docs). The earlier heads (f4836244, 82117f07, 876bb210) were stacked on #3049.

With X2W_NATIVE_SHADERS set, translate_compute_natively (src/startup_stubs/d3d12_compute_dispatch.inl) refuses every program with a sampler, so a natively translated compute program that samples falls back to gfx2hlsl.py. The C++ compiler already resolves a sampler whose four words are constants into a ComputeSampler. This change binds them:

  • program.samplers fills the route's TranslatedSamplers in register order, and the existing create_translated_root / decode_statics create the static samplers. A comparison sampler is bound as smpc; any other with explicit_lod as smpl, with the descriptor's MIN_LOD and MAX_LOD. This is the choice format_graphics_runtime_manifest makes (cmp ? smpc : lod ? smpl : smp).
  • The texture of a comparison sample (comparison_texture_srv, 2D) binds like a plain 2D texture input. Without this a comparison sampler is unreachable ("view kind 11 is not bound").
  • A natively bound 2D texture input now sets slot.srv_dimension. On main it stays unset, and the dispatch path then takes the input for a described 1D, 2D-array or 3D view and refuses the Dispatch with "an input texture view is not 3D". So on main a natively translated program cannot read a 2D texture at all; the third mutation below shows it.
  • A refused native translation clears its samplers, so a published <key>.txt read next numbers its sampler lines from 0. This follows from the manifest reader's index check; no run exercises it.
  • The capacity refusal now reads "more entry values, inputs or outputs than the dispatch path binds".

Points that differ from the plan in #3151 (see the comments there):

  • The direct compute path sets explicit_lod on every sampler it emits, so this route produces no plain smp sampler. The conversion keeps the case; the fixture cannot cover it.
  • The route keeps no sampler refusal of its own. Sampler words that are not constants are refused inside translate_compute ("nonconstant sampler") before the stand-in binds anything, so the sampler clause is dropped from the message, not split off.
  • The sampler heap is untouched (#3076). Since #3142 a fixed-index sampler of the directly indexed sampler heap reaches the route as a heap_sampler view and is refused by the view-kind message. This is read from the code and was not run.

Verification

Environment: Windows 11 build 26300.9974, NVIDIA GeForce RTX 4090 (driver 32.0.16.1088), MSVC 14.44.35207, Windows SDK 10.0.26100 DXC, Debug build, D3D12 debug layer enabled. Commit af6045df.

.\tools\dev.ps1
cmake --build --preset dev --target d3d12_xs_shim startup_stream_consumer compile_dxil
ctest --preset dev --no-tests=error -V -R '^(startup_compute_dispatch_native_(hardware|warp)|native_image_store_exact_width_hardware_(r|rg|rgb|array|volume|rgba|sparse)|startup_compute_dispatch_texture_hardware|startup_compute_descriptor_scc_hardware)$'
.\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py
.\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py

11 tests selected: 10 passed, 1 capability skip, 0 failed.

  • startup_compute_dispatch_native_hardware: PASS (5.4 s). The four sampled channels match the CPU model in all 6,144 volume words, the memory sampler control leaves the volume untouched, and the other steps pass. No debug-layer error message.
  • native_image_store_exact_width_hardware_{r,rg,rgb,array,volume,rgba,sparse}: PASS (7 tests, the same binding loop).
  • startup_compute_dispatch_texture_hardware: PASS (shares the consumer's texture modes).
  • startup_compute_descriptor_scc_hardware: PASS.
  • startup_compute_dispatch_native_warp: capability skip (77), not a pass. The Microsoft Basic Render Driver 10.0.26100.9818 reports no 32-lane waves. Before it exits, the check confirms the sampled program is refused by that reason with the volume untouched, and the memory sampler control is refused with "nonconstant sampler".
  • docs_links: 157 Markdown files and 682 links checked. bidi_controls: no bidirectional controls.
  • Not run: the rest of the suite. Only the three targets above were rebuilt. The Windows CI job runs the pr preset, which does not include these tests.

Mutations, each applied alone to d3d12_compute_dispatch.inl at af6045df, with the stand-in rebuilt and startup_compute_dispatch_native_hardware rerun:

Mutation Result
The file as on main (f5a6f6ba) FAIL: not translated natively: view kind 11 is not bound for a natively translated program
Only the sampler check restored FAIL: not translated natively: a sampler, or more entry values, inputs or outputs than the dispatch path binds
The 2D input dimension left unset FAIL: Dispatch(2, 1, 1) refused: an input texture view is not 3D
lod_limits always false FAIL: sampled: word 2049 got=bf000080 expected=bf000000 (32 words differ)
comparison always false FAIL: sampled: word 2051 got=bf000080 expected=00000000 (16 words differ)
Samplers bound in reverse register order FAIL: sampled: word 2049 got=bf000080 expected=bf000000 (56 words differ)
Restored PASS

Evidence and follow-up

  • The fixture is source-built: step 5 of tests/startup_compute_dispatch_native_check.py and the consumer mode texture-volume-native-sampled (the existing 3D float store plus a sampled input texture). Instruction words are hand-encoded and checked against the gfx2hlsl decoder inside the test. The guest root with two SRV records and one UAV record follows the table layout #3049's fixture uses.
  • One program samples a 2x1 R32_FLOAT texture with a 1x1 second mip four times: image_sample_lz (wrap), image_sample_l with LOD 1.25 under a [0, 0] clamp (mirror), image_sample_l with LOD 0 under a [1, 1] clamp, and image_sample_c_lz (LESS). U and the reference double with the global X, so a row covers both texels, three address modes and both comparison results. The CPU model decodes the address mode, the LOD limits and the comparison from the sampler words.
  • Control: #3151 planned a heap-loaded sampler. The control loads the first sampler's words from the descriptor table instead, because a sampler-heap sampler needs a root with both heap-indexing flags and is refused by the view-kind message, which does not name samplers. The table-loaded words are refused with "nonconstant sampler" and the output stays untouched.
  • Limits (also in docs/experiments/startup-compute-native-samplers.md): constant sampler words only; one texture format with point filters; no plain sampler; one adapter in a Debug build; no start-up run used the switch. A comparison sampler is bound without LOD limits, as on the published route. The compute path compares at level zero and the compiler requires MIN_LOD 0, so the limits cannot change the result.
  • #3049 will conflict with this in the binding loop and the check; whichever lands second needs a small rebase.

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.

AI-assisted.

🤖 Generated with Claude Code

**@⁠Not-Saii** on GitHub · 2026-11-27 18:51 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3154) `Not-Saii:claude/native-compute-static-samplers-13b9d3` → `main` · +290 −11 · 6 files · 2 commits · merged 2026-11-29 00:33 UTC ## Change Target branch `main`. Fixes #3151. Part of #2935 (item "Samplers") and #3074 (stage 5). Follow-up to #3075 / #3083, which covers the published-manifest route. **No longer depends on #3049.** Since #3243, `main` itself accepts a 2D texture input and a 3D float texture output on the in-process route, which is all this fixture needs. The branch is now two commits on `main` at `f5a6f6ba` (`af6045df` change and fixture, `93582447` docs). The earlier heads (`f4836244`, `82117f07`, `876bb210`) were stacked on #3049. With `X2W_NATIVE_SHADERS` set, `translate_compute_natively` (`src/startup_stubs/d3d12_compute_dispatch.inl`) refuses every program with a sampler, so a natively translated compute program that samples falls back to `gfx2hlsl.py`. The C++ compiler already resolves a sampler whose four words are constants into a `ComputeSampler`. This change binds them: - `program.samplers` fills the route's `TranslatedSamplers` in register order, and the existing `create_translated_root` / `decode_statics` create the static samplers. A comparison sampler is bound as `smpc`; any other with `explicit_lod` as `smpl`, with the descriptor's MIN_LOD and MAX_LOD. This is the choice `format_graphics_runtime_manifest` makes (`cmp ? smpc : lod ? smpl : smp`). - The texture of a comparison sample (`comparison_texture_srv`, 2D) binds like a plain 2D texture input. Without this a comparison sampler is unreachable ("view kind 11 is not bound"). - A natively bound 2D texture input now sets `slot.srv_dimension`. On `main` it stays unset, and the dispatch path then takes the input for a described 1D, 2D-array or 3D view and refuses the Dispatch with "an input texture view is not 3D". So on `main` a natively translated program cannot read a 2D texture at all; the third mutation below shows it. - A refused native translation clears its samplers, so a published `<key>.txt` read next numbers its sampler lines from 0. This follows from the manifest reader's index check; no run exercises it. - The capacity refusal now reads "more entry values, inputs or outputs than the dispatch path binds". Points that differ from the plan in #3151 (see the comments there): - The direct compute path sets `explicit_lod` on every sampler it emits, so this route produces no plain `smp` sampler. The conversion keeps the case; the fixture cannot cover it. - The route keeps no sampler refusal of its own. Sampler words that are not constants are refused inside `translate_compute` ("nonconstant sampler") before the stand-in binds anything, so the sampler clause is dropped from the message, not split off. - The sampler heap is untouched (#3076). Since #3142 a fixed-index sampler of the directly indexed sampler heap reaches the route as a `heap_sampler` view and is refused by the view-kind message. This is read from the code and was not run. ## Verification Environment: Windows 11 build 26300.9974, NVIDIA GeForce RTX 4090 (driver 32.0.16.1088), MSVC 14.44.35207, Windows SDK 10.0.26100 DXC, Debug build, D3D12 debug layer enabled. Commit `af6045df`. ```powershell .\tools\dev.ps1 cmake --build --preset dev --target d3d12_xs_shim startup_stream_consumer compile_dxil ctest --preset dev --no-tests=error -V -R '^(startup_compute_dispatch_native_(hardware|warp)|native_image_store_exact_width_hardware_(r|rg|rgb|array|volume|rgba|sparse)|startup_compute_dispatch_texture_hardware|startup_compute_descriptor_scc_hardware)$' .\out\pe-env\Scripts\python.exe -B tests/docs_links_check.py .\out\pe-env\Scripts\python.exe -B tests/bidi_controls_check.py ``` 11 tests selected: 10 passed, 1 capability skip, 0 failed. - `startup_compute_dispatch_native_hardware`: **PASS** (5.4 s). The four sampled channels match the CPU model in all 6,144 volume words, the memory sampler control leaves the volume untouched, and the other steps pass. No debug-layer error message. - `native_image_store_exact_width_hardware_{r,rg,rgb,array,volume,rgba,sparse}`: **PASS** (7 tests, the same binding loop). - `startup_compute_dispatch_texture_hardware`: **PASS** (shares the consumer's texture modes). - `startup_compute_descriptor_scc_hardware`: **PASS**. - `startup_compute_dispatch_native_warp`: **capability skip (77)**, not a pass. The Microsoft Basic Render Driver 10.0.26100.9818 reports no 32-lane waves. Before it exits, the check confirms the sampled program is refused by that reason with the volume untouched, and the memory sampler control is refused with "nonconstant sampler". - `docs_links`: 157 Markdown files and 682 links checked. `bidi_controls`: no bidirectional controls. - Not run: the rest of the suite. Only the three targets above were rebuilt. The Windows CI job runs the `pr` preset, which does not include these tests. Mutations, each applied alone to `d3d12_compute_dispatch.inl` at `af6045df`, with the stand-in rebuilt and `startup_compute_dispatch_native_hardware` rerun: | Mutation | Result | |---|---| | The file as on `main` (`f5a6f6ba`) | FAIL: `not translated natively: view kind 11 is not bound for a natively translated program` | | Only the sampler check restored | FAIL: `not translated natively: a sampler, or more entry values, inputs or outputs than the dispatch path binds` | | The 2D input dimension left unset | FAIL: `Dispatch(2, 1, 1) refused: an input texture view is not 3D` | | `lod_limits` always false | FAIL: `sampled: word 2049 got=bf000080 expected=bf000000 (32 words differ)` | | `comparison` always false | FAIL: `sampled: word 2051 got=bf000080 expected=00000000 (16 words differ)` | | Samplers bound in reverse register order | FAIL: `sampled: word 2049 got=bf000080 expected=bf000000 (56 words differ)` | | Restored | PASS | ## Evidence and follow-up - The fixture is source-built: step 5 of `tests/startup_compute_dispatch_native_check.py` and the consumer mode `texture-volume-native-sampled` (the existing 3D float store plus a sampled input texture). Instruction words are hand-encoded and checked against the `gfx2hlsl` decoder inside the test. The guest root with two SRV records and one UAV record follows the table layout #3049's fixture uses. - One program samples a 2x1 R32_FLOAT texture with a 1x1 second mip four times: `image_sample_lz` (wrap), `image_sample_l` with LOD 1.25 under a [0, 0] clamp (mirror), `image_sample_l` with LOD 0 under a [1, 1] clamp, and `image_sample_c_lz` (LESS). U and the reference double with the global X, so a row covers both texels, three address modes and both comparison results. The CPU model decodes the address mode, the LOD limits and the comparison from the sampler words. - Control: #3151 planned a heap-loaded sampler. The control loads the first sampler's words from the descriptor table instead, because a sampler-heap sampler needs a root with both heap-indexing flags and is refused by the view-kind message, which does not name samplers. The table-loaded words are refused with "nonconstant sampler" and the output stays untouched. - Limits (also in `docs/experiments/startup-compute-native-samplers.md`): constant sampler words only; one texture format with point filters; no plain sampler; one adapter in a Debug build; no start-up run used the switch. A comparison sampler is bound without LOD limits, as on the published route. The compute path compares at level zero and the compiler requires MIN_LOD 0, so the limits cannot change the result. - #3049 will conflict with this in the binding loop and the check; whichever lands second needs a small rebase. ## 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. AI-assisted. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The stand-in's manifest reader and Dispatch path took only 2D and 2D
array output textures, so a compute program storing to a 3D or 1D image
could not run on cpp-migration. The runtime half of #2902 (open on main)
is taken here unchanged: `uav N tex3d|tex1d float table P OFF channels
C` lines, TEXTURE3D/TEXTURE1D UAV views from the title's view record,
and the mip and W range checks, also for slot 19. For the offline route,
format_compute_runtime_manifest now writes those lines for 3D and 1D
texture UAVs, so compile_dxil publishes a manifest the runtime accepts.

AI-assisted.

(cherry picked from commit fb53abdab9)
translate_compute_natively (X2W_NATIVE_SHADERS) bound only raw_vector_srv
and raw_buffer_uav. It now also fills the ComputeTranslation slots the
manifest reader fills for buffer_srv (srv buf table), texture_srv with
a 2D image (srv tex2d table) and texture_uav/half4_texture_uav with a
1D, 2D, 2D array or 3D image (uav tex1d/tex2d/tex2da/tex3d float table
channels 4), with the same kind and image-dimension rules as
format_compute_runtime_manifest. Samplers and other kinds stay refused.

The native check gains a case where a scalar buffer read and a 2D
image load feed a 3D image store, compared with a CPU reference; the
same program with a sample instead of the load must be refused with
the volume untouched.

AI-assisted.

(cherry picked from commit 917c124dfa)
The texture-volume-native-inputs mode created its SRV and UAV at fixed
32-byte offsets, which is mid-descriptor on adapters with a wider
CBV/SRV/UAV increment (64 bytes on WARP). It now queries the increment
(device slot 15) for the creation handles. On a wider heap the 32-byte
tokens are copied into a packed table at the guest byte offsets the
program reads, and that table's base is bound.

The native check gains a Texture3D.WSize = 0 control (translated
natively, Dispatch refused, output untouched) and in-process readbacks
for a 1D float output, a 2D-array output on a non-zero layer and a
half4 (D16) output, each against a CPU reference.

AI-assisted.

(cherry picked from commit a5d118336b)
Refs #2974, #2975 and #2993.
translate_compute_natively refused every program with a sampler. The C++
compiler already resolves constant sampler words into ComputeSampler
entries, so they now fill the route's TranslatedSamplers in register
order and the existing root signature code creates the static samplers:
a comparison sampler as smpc, any other with explicit_lod as smpl, the
choice format_graphics_runtime_manifest makes. A comparison sample's 2D
texture (comparison_texture_srv) binds like a plain texture input. A
failed native translation clears the samplers so a published manifest
read next numbers its sampler lines from 0.

Sampler words that are not constants (a sampler read from memory) are
refused by the compiler before this code runs, so the route itself no
longer has a sampler refusal; the capacity message drops that clause.

startup_compute_dispatch_native_check.py replaces the sampler refusal
control with four samples of a two-mip 2x1 R32_FLOAT texture (new
consumer mode texture-volume-native-sampled) through four constant
samplers: wrap, mirror under a MAX_LOD clamp, clamp under a MIN_LOD
clamp, and a LESS comparison. Every stored word is compared with a CPU
model of the sampler words. A sampler loaded from the table stays
refused with the volume untouched.

Refs #3149

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs/experiments/startup-compute-native-samplers.md describes what
translate_compute_natively binds for a constant sampler, the four-sampler
fixture and its memory sampler control, the hardware result on an RTX
4090, the WARP capability skip and three mutations of the change.
docs/startup-runtime.md and the route note no longer list samplers among
the refusals.

Refs #3149

AI-assisted.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 18:56:57 +00:00
Author
Owner

@⁠KelboLive on GitHub · 2026-11-27 18:55 UTC · original · approved these changes

**@⁠KelboLive** on GitHub · 2026-11-27 18:55 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3154#pullrequestreview-6092310929) · **approved these changes**
Author
Owner

@⁠KelboLive on GitHub · 2026-11-27 23:55 UTC · original

Review of f4836244: Binds constant static samplers on the in-process compute route.

**@⁠KelboLive** on GitHub · 2026-11-27 23:55 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3154#issuecomment-7230509370) Review of `f4836244`: Binds constant static samplers on the in-process compute route.
github-bot force-pushed github-bot/gh-3154 from f4836244fb to 82117f07d1 2026-11-28 00:13:50 +00:00 Compare
Author
Owner

@⁠JohnConnorNPC on GitHub · 2026-11-28 07:39 UTC · original

Thanks for this. I reviewed head 82117f07 and a trial merge of it into current main (c3204a9c). The sampler binding itself looks sound to me. Outside pixel stages, compute comparisons are level-zero only, because op 40 is refused with implicit derivatives require a pixel stage. first_sampler is set only in lower_graphics, so compute sampler i is register i, as decode_statics expects. The src diff after c3e3073e adds no DXIL opcodes.

Two things need fixing before this can land:

  1. It doesn't merge, and one conflict is semantic. git merge-tree --write-tree origin/main 82117f07 exits 1 with conflicts in src/startup_stubs/d3d12_compute_dispatch.inl (3 hunks) and tests/startup_stream_consumer.cpp (1 hunk). In the view loop, main (#3245) now binds texture outputs through exact_texture_uav_channels and slot.channels. #3049's texture_output/dimension switch and this PR's comparison_texture_srv input need to be merged into that by hand, then rebuilt and rerun against both fixtures. The PR also carries #3049, which gh pr view 3049 --json state,mergeable reports as OPEN CONFLICTING. The cleanest route may be to land or rebase #3049 first, then rebase this PR onto it.
  2. The registered check still fails after the merge. As the body says, step 1 fails with the native route left ['revision.txt'] in the cache. On the trial merge, #3233 fixes step 1 (p.name not in ('native', 'revision.txt')). But the two asserts that #3049 adds at the end of table_views and texture_outputs still read assert all(p.name.startswith('req_') or p.name == 'native' for p in cache.iterdir()), and git grep -n finds both in the merged tree. The stand-in writes revision.txt once per process (d3d12_draw.inl: "revision.txt names this runtime's revisions"), so the check would still fail after the sampler step. Adding the same exception to both asserts, here or in #3049, should fix it.

Non-blocking:

  • The body notes that no mutation covers the comparison flag or the sampler register order. In D3D12, binding smpc as smp is undefined, so a wrong flag may not show up as a wrong value. After the rebase, two hardware runs would show whether the fixture catches either: one with comparison forced false and one with program.samplers reversed, each with its debug-layer output.
  • The doc (startup-compute-native-samplers.md) and the body say "#3228 changes the step 1 assertion". #3230 was closed without merging; the fix on main is #3233 (38129ba3).
  • The mutation table ran on 36a17075 before the rebase. Rerunning the hardware test and the mutations on the final head would bring the evidence up to date.
  • All three CI jobs pass, but the Windows job runs ctest --preset pr (100% tests passed out of 69), and its log has 0 startup_compute_dispatch_native lines. So CI doesn't exercise this route.

Environment: Linux, git objects, a trial merge and pure-Python probes only. I did no build, WARP or GPU run.

This comment was AI-assisted.

**@⁠JohnConnorNPC** on GitHub · 2026-11-28 07:39 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3154#issuecomment-7236082416) Thanks for this. I reviewed head `82117f07` and a trial merge of it into current `main` (`c3204a9c`). The sampler binding itself looks sound to me. Outside pixel stages, compute comparisons are level-zero only, because op 40 is refused with `implicit derivatives require a pixel stage`. `first_sampler` is set only in `lower_graphics`, so compute sampler i is register i, as `decode_statics` expects. The src diff after `c3e3073e` adds no DXIL opcodes. Two things need fixing before this can land: 1. **It doesn't merge, and one conflict is semantic.** `git merge-tree --write-tree origin/main 82117f07` exits 1 with conflicts in `src/startup_stubs/d3d12_compute_dispatch.inl` (3 hunks) and `tests/startup_stream_consumer.cpp` (1 hunk). In the view loop, `main` (#3245) now binds texture outputs through `exact_texture_uav_channels` and `slot.channels`. #3049's `texture_output`/`dimension` switch and this PR's `comparison_texture_srv` input need to be merged into that by hand, then rebuilt and rerun against both fixtures. The PR also carries #3049, which `gh pr view 3049 --json state,mergeable` reports as `OPEN CONFLICTING`. The cleanest route may be to land or rebase #3049 first, then rebase this PR onto it. 2. **The registered check still fails after the merge.** As the body says, step 1 fails with `the native route left ['revision.txt'] in the cache`. On the trial merge, #3233 fixes step 1 (`p.name not in ('native', 'revision.txt')`). But the two asserts that #3049 adds at the end of `table_views` and `texture_outputs` still read `assert all(p.name.startswith('req_') or p.name == 'native' for p in cache.iterdir())`, and `git grep -n` finds both in the merged tree. The stand-in writes `revision.txt` once per process (`d3d12_draw.inl`: "revision.txt names this runtime's revisions"), so the check would still fail after the sampler step. Adding the same exception to both asserts, here or in #3049, should fix it. Non-blocking: - The body notes that no mutation covers the comparison flag or the sampler register order. In D3D12, binding `smpc` as `smp` is undefined, so a wrong flag may not show up as a wrong value. After the rebase, two hardware runs would show whether the fixture catches either: one with `comparison` forced false and one with `program.samplers` reversed, each with its debug-layer output. - The doc (`startup-compute-native-samplers.md`) and the body say "#3228 changes the step 1 assertion". #3230 was closed without merging; the fix on `main` is #3233 (`38129ba3`). - The mutation table ran on `36a17075` before the rebase. Rerunning the hardware test and the mutations on the final head would bring the evidence up to date. - All three CI jobs pass, but the Windows job runs `ctest --preset pr` (`100% tests passed out of 69`), and its log has 0 `startup_compute_dispatch_native` lines. So CI doesn't exercise this route. Environment: Linux, git objects, a trial merge and pure-Python probes only. I did no build, WARP or GPU run. This comment was AI-assisted.
github-bot force-pushed github-bot/gh-3154 from 82117f07d1 to 876bb210d6 2026-11-28 11:38:14 +00:00 Compare
Author
Owner

@⁠Not-Saii on GitHub · 2026-11-28 11:33 UTC · original

Thanks for the review. The head is now 876bb210; the body is updated to match.

  1. Conflicts. #3049 still conflicts with main, so this branch carries my own merge of 1356e232 into main at ee3347d3 (553be4b0). In the view loop, main's exact-width outputs (exact_texture_uav_channels, slot.channels) and #3049's four-channel float outputs, 2D texture inputs and scalar buffers are both kept, each with its own dimension mapping. One line is new to both sides: a 2D texture input sets slot.srv_dimension, which the dispatch path reads since #3308. Without it the input is refused as "not 3D". If #3049 resolves its conflicts differently, I will rebase onto it again.
  2. revision.txt. 94f2c8bc adds the exception to the two assertions that close table_views and texture_outputs. #3049 can take that commit or make the same edit.

Rerun on the RTX 4090 (driver 32.0.16.1088, Debug, debug layer on), 12 tests selected: 11 passed, 1 capability skip (startup_compute_dispatch_native_warp, 77), 0 failed. The set includes the seven native_image_store_exact_width_hardware_* cases for main's side of the merged loop and both startup_compute_dispatch_texture_*hardware tests. The command is in the body.

On the non-blocking points:

  • Comparison flag and register order. Both mutations were run and both fail by readback: comparison forced false gives word 2051 got=bf000080 expected=00000000 (16 words differ), and reversed samplers give word 2049 got=bf000080 expected=bf000000 (56 words differ). The log tail the check prints on failure holds no debug-layer message for either, so the layer is not what detects the wrong flag here.
  • #3228. Fixed: the note and the body now cite #3233.
  • Evidence on the final head. The hardware test and all five mutations were rerun at c8f0f702; the table in the body is from that run.
  • CI. Agreed, the pr preset does not run this route. The body says so.

AI-assisted.

**@⁠Not-Saii** on GitHub · 2026-11-28 11:33 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3154#issuecomment-7238632448) Thanks for the review. The head is now `876bb210`; the body is updated to match. 1. **Conflicts.** #3049 still conflicts with `main`, so this branch carries my own merge of `1356e232` into `main` at `ee3347d3` (`553be4b0`). In the view loop, `main`'s exact-width outputs (`exact_texture_uav_channels`, `slot.channels`) and #3049's four-channel float outputs, 2D texture inputs and scalar buffers are both kept, each with its own dimension mapping. One line is new to both sides: a 2D texture input sets `slot.srv_dimension`, which the dispatch path reads since #3308. Without it the input is refused as "not 3D". If #3049 resolves its conflicts differently, I will rebase onto it again. 2. **`revision.txt`.** `94f2c8bc` adds the exception to the two assertions that close `table_views` and `texture_outputs`. #3049 can take that commit or make the same edit. Rerun on the RTX 4090 (driver 32.0.16.1088, Debug, debug layer on), 12 tests selected: 11 passed, 1 capability skip (`startup_compute_dispatch_native_warp`, 77), 0 failed. The set includes the seven `native_image_store_exact_width_hardware_*` cases for `main`'s side of the merged loop and both `startup_compute_dispatch_texture_*hardware` tests. The command is in the body. On the non-blocking points: - **Comparison flag and register order.** Both mutations were run and both fail by readback: `comparison` forced false gives `word 2051 got=bf000080 expected=00000000 (16 words differ)`, and reversed samplers give `word 2049 got=bf000080 expected=bf000000 (56 words differ)`. The log tail the check prints on failure holds no debug-layer message for either, so the layer is not what detects the wrong flag here. - **#3228.** Fixed: the note and the body now cite #3233. - **Evidence on the final head.** The hardware test and all five mutations were rerun at `c8f0f702`; the table in the body is from that run. - **CI.** Agreed, the `pr` preset does not run this route. The body says so. AI-assisted.
github-bot force-pushed github-bot/gh-3154 from 876bb210d6 to 93582447f0 2026-11-28 17:37:53 +00:00 Compare
Author
Owner

@⁠Not-Saii on GitHub · 2026-11-28 17:35 UTC · original

Update: the head is now 93582447, and this PR no longer carries #3049.

#3243 rewrote the binding loop in translate_compute_natively again, and main now accepts a 2D texture input and a 3D float output on this route by itself. That is all the fixture needs, so I rebuilt the change as two commits directly on main at f5a6f6ba and ported the fixture: step 5 of the check has its own table root setup, and the consumer mode sits on top of main's volume store mode. The body is rewritten to match.

One thing came out of that: on main a natively bound 2D texture input never sets slot.srv_dimension, and the dispatch path then refuses it with "an input texture view is not 3D". This PR sets it. With that line removed the fixture fails with exactly that refusal.

Rerun on the RTX 4090 (driver 32.0.16.1088, Debug, debug layer on), 11 tests selected: 10 passed, 1 capability skip (startup_compute_dispatch_native_warp, 77), 0 failed. All six mutations fail as listed in the body, including comparison forced false and reversed samplers.

The revision.txt commit is gone from this branch because #3049's two assertions are no longer in it. #3049 still needs that exception when it is refreshed.

AI-assisted.

**@⁠Not-Saii** on GitHub · 2026-11-28 17:35 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3154#issuecomment-7243128202) Update: the head is now `93582447`, and this PR no longer carries #3049. #3243 rewrote the binding loop in `translate_compute_natively` again, and `main` now accepts a 2D texture input and a 3D float output on this route by itself. That is all the fixture needs, so I rebuilt the change as two commits directly on `main` at `f5a6f6ba` and ported the fixture: step 5 of the check has its own table root setup, and the consumer mode sits on top of `main`'s volume store mode. The body is rewritten to match. One thing came out of that: on `main` a natively bound 2D texture input never sets `slot.srv_dimension`, and the dispatch path then refuses it with "an input texture view is not 3D". This PR sets it. With that line removed the fixture fails with exactly that refusal. Rerun on the RTX 4090 (driver 32.0.16.1088, Debug, debug layer on), 11 tests selected: 10 passed, 1 capability skip (`startup_compute_dispatch_native_warp`, 77), 0 failed. All six mutations fail as listed in the body, including `comparison` forced false and reversed samplers. The `revision.txt` commit is gone from this branch because #3049's two assertions are no longer in it. #3049 still needs that exception when it is refreshed. AI-assisted.
Author
Owner

@⁠Leyukaka on GitHub · 2026-11-29 00:11 UTC · original · approved these changes

Review of 93582447: diff read against main 51472392, into which it merges cleanly, plus a build of this head merged with main 8ecd30fe in an offline Windows Sandbox (RTX 5080 vGPU).

Checked against main:

  • Static samplers: register i is entry i of program.samplers. decode_statics and native_compute_pipeline.cpp:58 number them the same way.
  • The srv_dimension fix is needed. On main, an input slot with D3D12_SRV_DIMENSION_UNKNOWN goes down the non-2D branch of the dispatch path (d3d12_compute_dispatch.inl:687-697), so every described 2D view is refused there.
  • comparison_texture_srv is the kind gfx1013_direct_compute.inl gives a non-cube compare sample, and image_dimension == 1 limits it to 2D.

Non-blocking:

  • No test observes tr.samplers = {}; (d3d12_compute_dispatch.inl:295); the body says no run exercises it. The samplers are pushed before the wave-size check, so a refusal on an adapter without 32-lane waves keeps them. If a published <key>.txt with smp* lines is read after that, its line 0 fails i == tr.samplers.statics.size() and the translation is refused as "a sampler that is not a plain static one". On the no-waves path of step 5, publishing a translation for the sampled program and checking that it runs would cover the line.
  • lod_limits = explicit_lod && !comparison follows the manifest writer (direct_compute_cache.cpp:1120-1121). native_compute_pipeline.cpp:58 passes explicit_lod for comparison samplers too. The two give the same result here only because comparisons sample level 0 and MIN_LOD is 0.

Not covered: CI's pr preset does not run startup_compute_dispatch_native_*, and WARP exits 77. In the Sandbox build startup_compute_dispatch_native_hardware passed, and failed with tr.samplers.comparison.push_back(sampler.comparison); changed to tr.samplers.comparison.push_back(false); in d3d12_compute_dispatch.inl.

Verdict: approve.

**@⁠Leyukaka** on GitHub · 2026-11-29 00:11 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3154#pullrequestreview-6100666482) · **approved these changes** Review of `93582447`: diff read against `main` `51472392`, into which it merges cleanly, plus a build of this head merged with `main` `8ecd30fe` in an offline Windows Sandbox (RTX 5080 vGPU). Checked against `main`: - Static samplers: register i is entry i of `program.samplers`. `decode_statics` and `native_compute_pipeline.cpp:58` number them the same way. - The `srv_dimension` fix is needed. On `main`, an input slot with `D3D12_SRV_DIMENSION_UNKNOWN` goes down the non-2D branch of the dispatch path (`d3d12_compute_dispatch.inl:687-697`), so every described 2D view is refused there. - `comparison_texture_srv` is the kind `gfx1013_direct_compute.inl` gives a non-cube compare sample, and `image_dimension == 1` limits it to 2D. Non-blocking: - No test observes `tr.samplers = {};` (`d3d12_compute_dispatch.inl:295`); the body says no run exercises it. The samplers are pushed before the wave-size check, so a refusal on an adapter without 32-lane waves keeps them. If a published `<key>.txt` with `smp*` lines is read after that, its line 0 fails `i == tr.samplers.statics.size()` and the translation is refused as "a sampler that is not a plain static one". On the no-waves path of step 5, publishing a translation for the sampled program and checking that it runs would cover the line. - `lod_limits = explicit_lod && !comparison` follows the manifest writer (`direct_compute_cache.cpp:1120-1121`). `native_compute_pipeline.cpp:58` passes `explicit_lod` for comparison samplers too. The two give the same result here only because comparisons sample level 0 and MIN_LOD is 0. Not covered: CI's `pr` preset does not run `startup_compute_dispatch_native_*`, and WARP exits 77. In the Sandbox build `startup_compute_dispatch_native_hardware` passed, and failed with `tr.samplers.comparison.push_back(sampler.comparison);` changed to `tr.samplers.comparison.push_back(false);` in `d3d12_compute_dispatch.inl`. Verdict: approve.
github-bot changed target branch from main to gh-pr/3154/base 2026-11-29 00:37:50 +00:00
github manually merged commit 93582447f0 into gh-pr/3154/base 2026-11-29 00:37:51 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.