startup: bind LOD-clamped static samplers (smpl) in the translated compute Dispatch #2585

Manually merged
github merged 77 commits from gh-pr/2585/head into gh-pr/2585/base 2026-11-27 01:04:43 +00:00
Owner

@⁠NiiRoZz on GitHub · 2026-11-25 22:03 UTC · original
NiiRoZz:startup/compute-dispatch-samplers → main · +88 −5 · 4 files · 77 commits · merged 2026-11-26 06:08 UTC

Depends on #2580. Refs #2274.

What changed

  • src/startup_stubs/d3d12_compute_dispatch.inl: the compute manifest reader accepts smpl <i> <w0> <w1> <w2> <w3> lines, the static sampler with the descriptor's MinLOD and MaxLOD that the translator writes since #2482. They go through the draw path's own code (TranslatedSamplers::read_manifest_line, decode_statics and create_translated_root in translated_sampler_bindings.h), so no second sampler mechanism is added. For compute, the only difference from a draw is that the root signature is set with SetComputeRootSignature; static samplers need nothing else at Dispatch.
  • The forms still not bound now refuse with their own reasons instead of the shared "a sampler that is not a plain static one": smpc gives "a comparison sampler" and smpheap gives "a sampler from the sampler heap". Binding the heap table for compute would need the draw path's sampler snapshot (snapshot_samplers, create_sampler_snapshot_heap) taken from the compute root's sampler heap pointer, SetDescriptorHeaps with the sampler heap, and SetComputeRootDescriptorTable. That is left for the first program that needs it.
  • tests/startup_compute_dispatch_texture_check.py and tests/startup_stream_consumer.cpp: a new filtered case. The existing sampling case uses a 1x1 texture, so it cannot tell filter or address modes apart. The new case puts a constant wrap, linear sampler (MAX_LOD 12, so the translator writes smpl 0 0x0 0xc00000 0x18500000 0x0) in the texture input program. The consumer's new dispatch-sampled-2x1 mode samples a 2x1 RGBA8 texture whose left texel has red 0 and right texel red 1.0, at the left edge. Only a linear filter that wraps reads 0.5 there.
    • Control: the same compiled program with the manifest's sampler changed to clamp reads red 0, which the positive check refuses.
    • Refusals: an smpc line and an added smpheap line each refuse with one logged reason and leave the output untouched.
  • docs/experiments.md: a subsection under the translated compute Dispatch section.

Measured

.\tools\dev.ps1
cmake --preset dev
cmake --build --preset dev
ctest --preset dev --no-tests=error -j1 -R "^startup_compute_dispatch_" -V

Result: 8 of 8 passed (WARP and hardware for startup_compute_dispatch, _texture, _heap and _heap_word), with no capability skips.

  • WARP: Microsoft Basic Render Driver, driver 10.0.26100.10068.
  • Hardware: NVIDIA GeForce RTX 5090, driver 32.0.16.2135.
  • Windows 11 build 26300.10075. Debug layer enabled, no error message.

New filtered case, on both adapters: every thread read red 0.5. With the clamp sampler, every thread read red 0. The smpc and smpheap controls refused with their reasons and left the output untouched.

Negative control for the code change: with the smpl match disabled, startup_compute_dispatch_texture_warp fails. The Dispatch logs refused: a sampler that is not a plain static one.

Local census (counts only): 7 compute programs, about 135 thousand Dispatch calls, refused first for "a sampler that is not a plain static one". All 7 manifests hold only smpl sampler lines: 6 with one line and 1 with two. None has smpc or smpheap. In 6 of the 7, word 0 is 0x92 (clamp in U, V and W). The other uses wrap. When their manifests are read against the new classifier, every line of all 7 is accepted and each has a compiled program, so all 7 now pass manifest loading.

Hypothesis / unverified

  • Not measured: the next refusal of those 7 programs. It would come from the bindings at Dispatch (tables, views, buffer ranges), which reading a manifest cannot show. No title run was made for this change.
  • MinLOD and MaxLOD are carried over by the decoder the draw path already uses. The fixture texture has one mip, so this test does not check the LOD clamp itself.
  • Comparison samplers and sampler heap tables in compute stay unbound.

🤖 Generated with Claude Code

**@⁠NiiRoZz** on GitHub · 2026-11-25 22:03 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2585) `NiiRoZz:startup/compute-dispatch-samplers` → `main` · +88 −5 · 4 files · 77 commits · merged 2026-11-26 06:08 UTC Depends on #2580. Refs #2274. ## What changed - `src/startup_stubs/d3d12_compute_dispatch.inl`: the compute manifest reader accepts `smpl <i> <w0> <w1> <w2> <w3>` lines, the static sampler with the descriptor's MinLOD and MaxLOD that the translator writes since #2482. They go through the draw path's own code (`TranslatedSamplers::read_manifest_line`, `decode_statics` and `create_translated_root` in `translated_sampler_bindings.h`), so no second sampler mechanism is added. For compute, the only difference from a draw is that the root signature is set with `SetComputeRootSignature`; static samplers need nothing else at Dispatch. - The forms still not bound now refuse with their own reasons instead of the shared "a sampler that is not a plain static one": `smpc` gives "a comparison sampler" and `smpheap` gives "a sampler from the sampler heap". Binding the heap table for compute would need the draw path's sampler snapshot (`snapshot_samplers`, `create_sampler_snapshot_heap`) taken from the compute root's sampler heap pointer, `SetDescriptorHeaps` with the sampler heap, and `SetComputeRootDescriptorTable`. That is left for the first program that needs it. - `tests/startup_compute_dispatch_texture_check.py` and `tests/startup_stream_consumer.cpp`: a new filtered case. The existing sampling case uses a 1x1 texture, so it cannot tell filter or address modes apart. The new case puts a constant wrap, linear sampler (MAX_LOD 12, so the translator writes `smpl 0 0x0 0xc00000 0x18500000 0x0`) in the texture input program. The consumer's new `dispatch-sampled-2x1` mode samples a 2x1 RGBA8 texture whose left texel has red 0 and right texel red 1.0, at the left edge. Only a linear filter that wraps reads 0.5 there. - Control: the same compiled program with the manifest's sampler changed to clamp reads red 0, which the positive check refuses. - Refusals: an `smpc` line and an added `smpheap` line each refuse with one logged reason and leave the output untouched. - `docs/experiments.md`: a subsection under the translated compute Dispatch section. ## Measured ```powershell .\tools\dev.ps1 cmake --preset dev cmake --build --preset dev ctest --preset dev --no-tests=error -j1 -R "^startup_compute_dispatch_" -V ``` Result: 8 of 8 passed (WARP and hardware for `startup_compute_dispatch`, `_texture`, `_heap` and `_heap_word`), with no capability skips. - WARP: Microsoft Basic Render Driver, driver 10.0.26100.10068. - Hardware: NVIDIA GeForce RTX 5090, driver 32.0.16.2135. - Windows 11 build 26300.10075. Debug layer enabled, no error message. New filtered case, on both adapters: every thread read red 0.5. With the clamp sampler, every thread read red 0. The `smpc` and `smpheap` controls refused with their reasons and left the output untouched. Negative control for the code change: with the `smpl` match disabled, `startup_compute_dispatch_texture_warp` fails. The Dispatch logs `refused: a sampler that is not a plain static one`. Local census (counts only): 7 compute programs, about 135 thousand Dispatch calls, refused first for "a sampler that is not a plain static one". All 7 manifests hold only `smpl` sampler lines: 6 with one line and 1 with two. None has `smpc` or `smpheap`. In 6 of the 7, word 0 is 0x92 (clamp in U, V and W). The other uses wrap. When their manifests are read against the new classifier, every line of all 7 is accepted and each has a compiled program, so all 7 now pass manifest loading. ## Hypothesis / unverified - Not measured: the next refusal of those 7 programs. It would come from the bindings at Dispatch (tables, views, buffer ranges), which reading a manifest cannot show. No title run was made for this change. - MinLOD and MaxLOD are carried over by the decoder the draw path already uses. The fixture texture has one mip, so this test does not check the LOD clamp itself. - Comparison samplers and sampler heap tables in compute stay unbound. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Header-only state in list_compute_root.h with a Linux-testable check. Dispatch (slot 14) is not handled here; the state is exposed through ready() and table() for it. Refs #870.
Compute root constants are kept per list next to the graphics ones, in a shared 16 x 8 word store that refuses parameter >= 16 and offset >= 8. A new compute root signature clears them.
Part of #870. Forward Dispatch only with a desktop compute pipeline and root
bound and group counts within 65535 per axis; refuse otherwise.
Slot 43 clears a parameter's binding when a replacement is rejected, slot 33 clears all bindings, and the compute pipeline records its root so a mismatched pair is refused.
Compute root constants are kept per list next to the graphics ones, in a shared 16 x 8 word store that refuses parameter >= 16 and offset >= 8. A new compute root signature clears them.
Part of #870. Forward Dispatch only with a desktop compute pipeline and root
bound and group counts within 65535 per axis; refuse otherwise.
Slot 43 clears a parameter's binding when a replacement is rejected, slot 33 clears all bindings, and the compute pipeline records its root so a mismatched pair is refused.
Conflicts in d3d12_xs_device.cpp and docs/experiments.md resolved by keeping both sides: the pipeline root
out-parameter of the stream builder next to the cached-mesh root, the bound root SRV mask next to the recorded
upload SRV addresses, and both table entries and document sections.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Conflicts in d3d12_draw.inl and d3d12_xs_device.cpp resolved by keeping both sides: graphics root constants
go through the shared store and still mark the words a slot 40 call set.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A device slot 67 placeholder keeps the key of its published request. At
list slot 14 the stand-in loads the stage cs manifest and compiled
program for that key and records the dispatch: raw buffer inputs and
outputs from hardware descriptors in the recorded compute tables, entry
values from the recorded compute root constants. Other manifest lines
leave the pipeline untranslated; a dispatch that cannot be bound
completely is refused with one logged reason and records nothing.

startup_compute_dispatch_{warp,hardware} drives a source-built program
through the stand-in list and reads the output back, with controls
before translation, without a Dispatch and for a refused output.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Dispatches that arrive before the offline translation no longer use up
the lines kept for refusals at bind time.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The per-call refusal lines share one small budget, so a run cannot rank
keys by dispatch count. Each key now keeps its Dispatch count, the calls
recorded and the reason and table descriptor of its first refusal; the
periodic totals are followed by the refused dispatches per reason and the
40 keys with the most dispatches. A manifest that exists but cannot be
bound is counted apart from an absent one ("not modelled").

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A `uav <i> tex2d float table <param> <byte> channels 4` manifest line is
bound from the token of the unordered access view the title created in
its descriptor memory. Everything else is refused with its own reason: an
entry that is no such token, a view the desktop did not create, a view
that is not 2D, a format a float4 store cannot target, and a texture
bound to two slots of one dispatch. Programs without entry values, inputs
or outputs load too: the translated root no longer emits an empty range
or drops the table when only outputs exist.

The fixture stores through the stand-in's own list into a 32x8
RGBA16_FLOAT texture and reads it back with CopyTextureRegion.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A `srv <i> tex2d table <param> <byte>` manifest line is bound from the
token of the shader resource view the title created, through the texture
the draw path samples for that resource, uploaded first when the title
filled it in memory. `smp` lines become static samplers of the translated
root. A dispatch is refused, never bound to a null view, when the entry
is no such token, the resource has no desktop texture, the view is not 2D
or names a packed format, or the upload fails. Sampler heaps, comparison
samplers and other texture kinds keep the translation unavailable.

The fixture samples a 1x1 texture into the stored words of the raw buffer
case; without a view the dispatch is refused and the output is untouched.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
The device check drains the debug layer; a draw runs it on every 64th call
and the queue's execute drains the rest. A view token whose resource the
caller released is the caller's misuse, as on the draw path.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A texture is refused only when the same call reads and writes it; two
outputs of one texture share the unordered access state. A packed output
view format gets its own refusal reason. The census prints every
dispatched key instead of the first 40, and the wording on refused calls
says what may already be recorded (an input texture upload).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
gfx2hlsl.py lowers one form of a register-offset load through the directly
indexed resource heap pointer of a compute root signature:

    s_lshl_b32 R, <root constant word>, 5
    s_load_dwordx4 D, s[H:H+1], R      ; s[H+1] a constant zero, no offset:

with no write of R and no branch target in between. D is a buffer descriptor
and the manifest names it `srv <i> buf heap rootconst <parameter> <word>`.
Every other form keeps a refusal that names it, including an index read from
a buffer.

The stand-in records the title memory of the list's view heap on every slot 32
call (it kept only the sampler heap and, for oversized heaps, the wrapper) and
a Dispatch reads the 16-byte descriptor at byte `word << 5` of that memory,
then binds it through the path a table record takes. A record outside the heap
refuses the dispatch and binds nothing.

Checks: tests/startup_gfx2hlsl_heap_record_check.py (manifest and HLSL exact,
19 refused controls, one translator mutation, LLVM 15 reassembly) and
tests/startup_compute_dispatch_heap_check.py on WARP and a physical adapter.

Refs #2274

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The second positive case of startup_gfx2hlsl_heap_record_check.py branched to
the second dword of the two-dword heap load. The case with a branch target
before the shift already covers the form outside the entry block. The
experiments entry now says that WARP's descriptor increment is not 32 bytes.

Refs #2274

Co-Authored-By: Claude Fable 5.2 <[email protected]>
A check added on main calls op_s_load_dwordx8 on a stage built without a
kind; the heap record branch read self.kind directly.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Slot 40 keeps the graphics words of main. The dispatch refuses an entry value no slot 37 or 39 call
wrote since the compute root was set. Controls: both slots feed the readback, missing word, root
changed, same root, list reset, wrong root, one buffer as input and output.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The slot 67 cache owns desktop COM objects until module teardown. During process termination, the driver can already be shut down when static destructors run. Keep normal reference release on explicit unload and skip driver calls only during process termination.

AI-assisted with Codex (GPT-6.2 Astra, xhigh).
sampled_state gives pixel-shader (and depth-read) states, which a compute list rejects at Close.
dispatch-sampled-compute records the sampling fixture on a compute list and queue. The smp manifest
line no longer scans two fields into one variable.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
A compute program that reads its heap record index with s_buffer_load from an unmodified table buffer, at a
literal byte offset or at a root constant word times a literal plus a literal (dword-aligned), then shifts it
left by 5 for the heap s_load, is translated: the manifest names the word as
`srv <i> buf heap word table <param> <byte> at <offset> [rootconst <param> <word> times <scale>]`. At Dispatch
the runtime reads that word from the recording's upload memory, where no GPU command writes, and binds the
record it indexes. A word outside the buffer or outside upload memory refuses the dispatch with one reason.
Every other index source keeps the buffer refusal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	docs/experiments.md
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
list_compute_root cleared compute_srv_bound and recomputed
compute_root_has_arguments twice; the second copy came from the second
#1974 snapshot merge and changed nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	docs/experiments.md
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Three existing checks build a stage on a bare pipe object without it.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The compute manifest reader accepts smpl lines through the draw path's
TranslatedSamplers and create_translated_root. smpc and smpheap now refuse
with their own reasons. The texture fixture gains a 2x1 filtered case whose
wrap, linear sampler reads 0.5 at the left edge, with a clamp control.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Upstream now records the compute root and tables (slots 33 and 35) and has its own
DllMain with x2w_startup::d3d12_process_terminating, so this branch's flag and DllMain go.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
# Conflicts:
#	docs/experiments.md
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:04:42 +00:00
github manually merged commit 03aa5ffc86 into gh-pr/2585/base 2026-11-27 01:04:43 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-25 22:06 UTC · original · reviewed

Review of head 38a752af (comment only, no merge).

Code read: the new smpl branch in src/startup_stubs/d3d12_compute_dispatch.inl (lines ~115-126) reuses TranslatedSamplers::read_manifest_line, which already handles smpl and sets lod_limits (translated_sampler_bindings.h:69-96). The smpc / smpheap checks run before the generic smp fallback, so each refuses with its own reason. The index check i == tr.samplers.statics.size() keeps the manifest order strict. No problem found.

Test: the new filtered case uses a wrap + linear sampler with MAX_LOD 12 and a clamp control, and the author lists a negative control (smpl match disabled makes the texture test fail). Good. As the PR says, the fixture texture has one mip, so the LOD clamp itself is not covered.

Not merge-ready from our side:

  • Stacked on #2580 ("Depends on #2580"), which is still OPEN. The diff against main therefore shows 24 files / 2442 lines, mostly #2580's. It can only be merged after #2580 and a fresh head.
  • It is titled and framed as a startup step (the 7 programs now pass manifest loading). That claim needs the game on the merger's side; we cannot verify it. Merge stays with MasterDomino or @⁠R0Y00.
  • CI was still pending and no Windows run on this head at review time.

Commands run (Linux): git diff --check origin/main...HEAD, python3 tests/docs_links_check.py, python3 tests/bidi_controls_check.py (all clean). The D3D12 tests and mutations were not run here (no Windows run in this review).

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-25 22:06 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2585#pullrequestreview-6065647647) · **reviewed** Review of head 38a752af (comment only, no merge). Code read: the new `smpl` branch in `src/startup_stubs/d3d12_compute_dispatch.inl` (lines ~115-126) reuses `TranslatedSamplers::read_manifest_line`, which already handles `smpl` and sets `lod_limits` (`translated_sampler_bindings.h:69-96`). The `smpc` / `smpheap` checks run before the generic `smp` fallback, so each refuses with its own reason. The index check `i == tr.samplers.statics.size()` keeps the manifest order strict. No problem found. Test: the new filtered case uses a wrap + linear sampler with MAX_LOD 12 and a clamp control, and the author lists a negative control (`smpl` match disabled makes the texture test fail). Good. As the PR says, the fixture texture has one mip, so the LOD clamp itself is not covered. Not merge-ready from our side: - Stacked on #2580 ("Depends on #2580"), which is still OPEN. The diff against main therefore shows 24 files / 2442 lines, mostly #2580's. It can only be merged after #2580 and a fresh head. - It is titled and framed as a startup step (the 7 programs now pass manifest loading). That claim needs the game on the merger's side; we cannot verify it. Merge stays with MasterDomino or @⁠R0Y00. - CI was still pending and no Windows run on this head at review time. Commands run (Linux): `git diff --check origin/main...HEAD`, `python3 tests/docs_links_check.py`, `python3 tests/bidi_controls_check.py` (all clean). The D3D12 tests and mutations were not run here (no Windows run in this review). AI-assisted; commands listed were executed locally.
Author
Owner

@⁠ChazY11 on GitHub · 2026-11-25 22:55 UTC · original

Two device-free checks pass, and five mutations of the heap-index tracking are all caught

python -B tests/startup_gfx2hlsl_heap_record_check.py
    startup_gfx2hlsl_heap_record: PASS (manifest and HLSL exact; 19 refused controls; graphics, manifest and translation …)
python -B tests/startup_gfx2hlsl_heap_word_check.py
    startup_gfx2hlsl_heap_word: PASS (manifest and HLSL exact; 6 more forms; 10 refused controls)

The heap_word check is the new half here: 6 more forms accepted, 10 refused controls. It splits from
heap_record exactly where the change does — heap_record names the record, heap_word names what the index word
is (a root constant word, times a scale, plus an addend, modulo 2³²).

The other three checks in this PR (startup_compute_dispatch_check.py, …_heap_check.py, …_texture_check.py) exit 1
without arguments — they need DXC, an adapter and a dispatch mode, so they are the GPU half and I did not run them.

Mutations of heap_word_offset and the index tracking

mutation caught by
the root-constant branch returns scale 2 instead of 1 heap_word
the root-constant branch removed entirely heap_word
the rc mark no longer recognised (return mark[1:] if … else None → return None) heap_word
heap_index.clear() at a join replaced with pass heap_record and heap_word
any write stops ending a register's mark (wrote = scalar_destinations(…) → set()) heap_record and heap_word

The first three are heap_word's own business and it catches all three, which is what you would want from a check added
specifically for "6 more forms".

The last two are the interesting ones because they are caught by both, and they are the invariants that make the whole
scheme sound:

  • clearing at a join — the comment says "another path into the join may hold a different word". Without the clear, a
    mark from one predecessor survives into a block reachable from another, and the index is named for the wrong word.
  • any write ends a mark — wrote = set() means a later s_mov over the register leaves the stale mark in place, so
    the new value is named by the old word's identity.

Both are invisible unless a fixture has two paths into a join and a write between the naming and the use, and both
fixtures here do.

Note on the two PRs

This PR's gfx2hlsl.py hunk is a superset of the earlier heap-record change I reviewed (heap_record is unchanged apart
from being joined by heap_word), so the mutations above cover the whole current state of the file's heap handling rather
than only the delta. If the two are stacked, the merged result is what I measured.

Method note

Four of my first five anchors missed purely on indentation — I had copied the leading spaces from a git diff excerpt,
where the + prefix shifts the column by one. Anchors taken by line number from the file itself (Get-Content indexed)
all hit. Worth doing that way in a file this size.

AI-assisted; pure Python, Windows 11 build 26300, no DXC or GPU for the rows above.

**@⁠ChazY11** on GitHub · 2026-11-25 22:55 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2585#issuecomment-7176945982) ## Two device-free checks pass, and five mutations of the heap-index tracking are all caught ```text python -B tests/startup_gfx2hlsl_heap_record_check.py startup_gfx2hlsl_heap_record: PASS (manifest and HLSL exact; 19 refused controls; graphics, manifest and translation …) python -B tests/startup_gfx2hlsl_heap_word_check.py startup_gfx2hlsl_heap_word: PASS (manifest and HLSL exact; 6 more forms; 10 refused controls) ``` The `heap_word` check is the new half here: **6 more forms accepted, 10 refused controls**. It splits from `heap_record` exactly where the change does — `heap_record` names the record, `heap_word` names what the *index word* is (a root constant word, times a scale, plus an addend, modulo 2³²). The other three checks in this PR (`startup_compute_dispatch_check.py`, `…_heap_check.py`, `…_texture_check.py`) exit 1 without arguments — they need DXC, an adapter and a dispatch mode, so they are the GPU half and I did not run them. ### Mutations of `heap_word_offset` and the index tracking | mutation | caught by | |---|---| | the root-constant branch returns scale `2` instead of `1` | heap_word | | the root-constant branch removed entirely | heap_word | | the `rc` mark no longer recognised (`return mark[1:] if … else None` → `return None`) | heap_word | | `heap_index.clear()` at a join replaced with `pass` | heap_record **and** heap_word | | any write stops ending a register's mark (`wrote = scalar_destinations(…)` → `set()`) | heap_record **and** heap_word | The first three are `heap_word`'s own business and it catches all three, which is what you would want from a check added specifically for "6 more forms". The last two are the interesting ones because they are caught by **both**, and they are the invariants that make the whole scheme sound: - **clearing at a join** — the comment says "another path into the join may hold a different word". Without the clear, a mark from one predecessor survives into a block reachable from another, and the index is named for the wrong word. - **any write ends a mark** — `wrote = set()` means a later `s_mov` over the register leaves the stale mark in place, so the *new* value is named by the *old* word's identity. Both are invisible unless a fixture has two paths into a join and a write between the naming and the use, and both fixtures here do. ### Note on the two PRs This PR's `gfx2hlsl.py` hunk is a superset of the earlier heap-record change I reviewed (`heap_record` is unchanged apart from being joined by `heap_word`), so the mutations above cover the whole current state of the file's heap handling rather than only the delta. If the two are stacked, the merged result is what I measured. ### Method note Four of my first five anchors missed purely on indentation — I had copied the leading spaces from a `git diff` excerpt, where the `+` prefix shifts the column by one. Anchors taken by line number from the file itself (`Get-Content` indexed) all hit. Worth doing that way in a file this size. AI-assisted; pure Python, Windows 11 build 26300, no DXC or GPU for the rows above.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 05:56 UTC · original

Not merging yet: this branch still carries the commits of two open PRs, so it cannot land on its own.

  • The head contains the head commit of #2490 (translated compute Dispatch with 2D texture views and static samplers), which is still open. Checked with git merge-base --is-ancestor <#2490 head> <this head>: yes.
  • #2470 (raw table buffers) and #2596 are also open and in the same compute Dispatch chain.
  • #2580 is merged, but merging main into this branch gives add/add conflicts in d3d12_compute_dispatch.inl, startup_compute_dispatch_check.py, startup_compute_dispatch_texture_check.py and conflicts in startup_stream_consumer.cpp, d3d12_xs_device.cpp, gfx2hlsl.py, docs/experiments.md, CMakeLists.txt, AGENTS.md. The pre-squash copies of the chain are what collides with main.

Suggested path for @⁠NiiRoZz: land #2470 and #2490 first (or rebuild this branch from current main so only the smpl change is left in the diff), then this PR shrinks to the sampler part and can be tested on its own.

No push was made to the branch. No test was run on this head.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-26 05:56 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2585#issuecomment-7183941746) Not merging yet: this branch still carries the commits of two open PRs, so it cannot land on its own. - The head contains the head commit of #2490 (translated compute Dispatch with 2D texture views and static samplers), which is still open. Checked with `git merge-base --is-ancestor <#2490 head> <this head>`: yes. - #2470 (raw table buffers) and #2596 are also open and in the same compute Dispatch chain. - #2580 is merged, but merging main into this branch gives add/add conflicts in `d3d12_compute_dispatch.inl`, `startup_compute_dispatch_check.py`, `startup_compute_dispatch_texture_check.py` and conflicts in `startup_stream_consumer.cpp`, `d3d12_xs_device.cpp`, `gfx2hlsl.py`, `docs/experiments.md`, `CMakeLists.txt`, `AGENTS.md`. The pre-squash copies of the chain are what collides with main. Suggested path for @⁠NiiRoZz: land #2470 and #2490 first (or rebuild this branch from current main so only the `smpl` change is left in the diff), then this PR shrinks to the sampler part and can be tested on its own. No push was made to the branch. No test was run on this head. AI-assisted; commands listed were executed locally.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 06:05 UTC · original

Merged origin/main into this branch (merge commit 03aa5ffc8, no force, no rebase). Conflicts were the pre-squash copies of the compute Dispatch chain; #2470 and #2490 are already in main via #2532 (checked by sm3, confirmed by MasterDomino in the #2470 thread), so I kept main's side everywhere and kept only this PR's own smpl change. git diff origin/main --stat now shows 4 files only: d3d12_compute_dispatch.inl (+7), startup_stream_consumer.cpp, startup_compute_dispatch_texture_check.py, docs/experiments.md.

Review of what is left:

  • smp and smpl lines go through the draw path's read_manifest_line; smpc and smpheap refuse with their own reasons. Sound.
  • The new filtered case (2x1 texture, wrap + linear sampler reads 0.5 at the left edge; clamp control reads 0; smpc/smpheap refused with one logged reason, output untouched) guards the behaviour: point or clamp would read 0.

Verification (Windows Server 2025, merged head 03aa5ffc8, applied on top of the PR head):

  • dev: ctest --preset dev -R '^startup_compute_dispatch_': 100% tests passed out of 8 (warp and hardware for dispatch, texture, heap, heap_word).
  • release: ctest --preset release -R '^startup_compute_dispatch_' --no-tests=error: 8/8 passed.
  • Linux: python3 tests/docs_links_check.py, python3 tests/bidi_controls_check.py, git diff --check origin/main...HEAD: clean.
  • RTX 3090: not available (pod full).

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-26 06:05 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2585#issuecomment-7184079112) Merged origin/main into this branch (merge commit 03aa5ffc8, no force, no rebase). Conflicts were the pre-squash copies of the compute Dispatch chain; #2470 and #2490 are already in main via #2532 (checked by sm3, confirmed by MasterDomino in the #2470 thread), so I kept main's side everywhere and kept only this PR's own `smpl` change. `git diff origin/main --stat` now shows 4 files only: `d3d12_compute_dispatch.inl` (+7), `startup_stream_consumer.cpp`, `startup_compute_dispatch_texture_check.py`, `docs/experiments.md`. Review of what is left: - `smp` and `smpl` lines go through the draw path's `read_manifest_line`; `smpc` and `smpheap` refuse with their own reasons. Sound. - The new filtered case (2x1 texture, wrap + linear sampler reads 0.5 at the left edge; clamp control reads 0; `smpc`/`smpheap` refused with one logged reason, output untouched) guards the behaviour: point or clamp would read 0. Verification (Windows Server 2025, merged head 03aa5ffc8, applied on top of the PR head): - dev: `ctest --preset dev -R '^startup_compute_dispatch_'`: 100% tests passed out of 8 (warp and hardware for dispatch, texture, heap, heap_word). - release: `ctest --preset release -R '^startup_compute_dispatch_' --no-tests=error`: 8/8 passed. - Linux: `python3 tests/docs_links_check.py`, `python3 tests/bidi_controls_check.py`, `git diff --check origin/main...HEAD`: clean. - RTX 3090: not available (pod full). AI-assisted; commands listed were executed locally.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 06:05 UTC · original · reviewed

Merged origin/main into this branch (merge commit 03aa5ffc8, no force, no rebase). Conflicts were the pre-squash copies of the compute Dispatch chain; #2470 and #2490 are already in main via #2532 (checked by sm3, confirmed by MasterDomino in the #2470 thread), so I kept main's side everywhere and kept only this PR's own smpl change. git diff origin/main --stat now shows 4 files only: d3d12_compute_dispatch.inl (+7), startup_stream_consumer.cpp, startup_compute_dispatch_texture_check.py, docs/experiments.md.

Review of what is left:

  • smp and smpl lines go through the draw path's read_manifest_line; smpc and smpheap refuse with their own reasons. Sound.
  • The new filtered case (2x1 texture, wrap + linear sampler reads 0.5 at the left edge; clamp control reads 0; smpc/smpheap refused with one logged reason, output untouched) guards the behaviour: point or clamp would read 0.

Verification (Windows Server 2025, merged head 03aa5ffc8, applied on top of the PR head):

  • dev: ctest --preset dev -R '^startup_compute_dispatch_': 100% tests passed out of 8 (warp and hardware for dispatch, texture, heap, heap_word).
  • release: ctest --preset release -R '^startup_compute_dispatch_' --no-tests=error: 8/8 passed.
  • Linux: python3 tests/docs_links_check.py, python3 tests/bidi_controls_check.py, git diff --check origin/main...HEAD: clean.
  • RTX 3090: not available (pod full).

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-26 06:05 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2585#pullrequestreview-6069282957) · **reviewed** Merged origin/main into this branch (merge commit 03aa5ffc8, no force, no rebase). Conflicts were the pre-squash copies of the compute Dispatch chain; #2470 and #2490 are already in main via #2532 (checked by sm3, confirmed by MasterDomino in the #2470 thread), so I kept main's side everywhere and kept only this PR's own `smpl` change. `git diff origin/main --stat` now shows 4 files only: `d3d12_compute_dispatch.inl` (+7), `startup_stream_consumer.cpp`, `startup_compute_dispatch_texture_check.py`, `docs/experiments.md`. Review of what is left: - `smp` and `smpl` lines go through the draw path's `read_manifest_line`; `smpc` and `smpheap` refuse with their own reasons. Sound. - The new filtered case (2x1 texture, wrap + linear sampler reads 0.5 at the left edge; clamp control reads 0; `smpc`/`smpheap` refused with one logged reason, output untouched) guards the behaviour: point or clamp would read 0. Verification (Windows Server 2025, merged head 03aa5ffc8, applied on top of the PR head): - dev: `ctest --preset dev -R '^startup_compute_dispatch_'`: 100% tests passed out of 8 (warp and hardware for dispatch, texture, heap, heap_word). - release: `ctest --preset release -R '^startup_compute_dispatch_' --no-tests=error`: 8/8 passed. - Linux: `python3 tests/docs_links_check.py`, `python3 tests/bidi_controls_check.py`, `git diff --check origin/main...HEAD`: clean. - RTX 3090: not available (pod full). AI-assisted; commands listed were executed locally.
This discussion has been locked. Commenting is limited to contributors.
No description provided.