startup: bind a compute heap record whose index is read from a table buffer #2580

Manually merged
github merged 74 commits from gh-pr/2580/head into gh-pr/2580/base 2026-11-27 01:04:15 +00:00
Owner

@⁠NiiRoZz on GitHub · 2026-11-25 21:39 UTC · original
NiiRoZz:startup/compute-dispatch-heap-bufindex → main · +420 −36 · 10 files · 74 commits · merged 2026-11-26 05:50 UTC

Depends on #2532 (this branch is stacked on it; review the commits after its head).

What changed

  • tools/startup/gfx2hlsl.py: the heap-record index may be a word that s_buffer_load_dword(xN) reads from an unmodified table buffer descriptor, at a literal byte offset or at <root constant word> * k + c (s_mul_i32, s_mulk_i32, s_add_u32, s_add_i32, s_addk_i32 with literals, plus any offset: modifier), dword-aligned, with no branch target between the arithmetic and the load or between the load and the shift. The manifest line is srv <i> buf heap word table <parameter> <byte> at <offset> [rootconst <parameter> <word> times <k>]. Every other buffer-read index keeps a refusal, now worded ... whose index is read from a buffer other than a table buffer at a dispatch-constant offset.
  • src/startup_stubs/d3d12_compute_dispatch.inl: parses the two new forms, reads the table record, computes the byte offset in 32-bit arithmetic, reads the index word and binds the heap record through the existing #2532 path. New refusals, each one logged reason and nothing recorded: a heap index word is not in the list's upload memory (view token or memory outside the list's slot 148 upload allocations) and a heap index word is outside its table buffer (word past stride * num_records bytes, with a stride of 0 counted as 1).
  • tests/startup_stream_consumer.cpp: dispatch-heap-word modes and three controls.
  • tests/startup_gfx2hlsl_heap_record_check.py: the two "index read from a buffer" controls used a literal offset, which is now accepted; they now read the index at a group-ID offset (s14), which stays refused with the same message prefix.
  • New: tests/startup_gfx2hlsl_heap_word_check.py, tests/startup_compute_dispatch_heap_word_check.py; registered in CMakeLists.txt, the Windows workflow and AGENTS.md. docs/experiments.md paragraph next to the heap-record text.

Why the CPU read is sound

The word is read when the dispatch is recorded, not when the GPU runs. That is only correct if nothing on the GPU writes the word, so the stand-in reads it only from the recording's upload memory, which no GPU command writes, and refuses a placed buffer or a view token. A per-thread or group-ID index can't be read once on the CPU, and neither can a register sum or a modified descriptor, so all of these keep a refusal.

Tests

Commit under test: ba79c8b0 (code; the docs commits 5c248dc1 and 62b5ccc0 change no code), on #2532 head 1efce194.

python -B tests/startup_gfx2hlsl_heap_word_check.py --llvm-mc llvm-mc-15
python -B tests/startup_gfx2hlsl_heap_record_check.py --llvm-mc llvm-mc-15
python -B tests/startup_translator_check.py
cmake --build --preset dev --target startup_stream_consumer
ctest --preset dev --no-tests=error -R "^startup_compute_dispatch_|heap_record|heap_word" -V

Results: both translator checks PASS with reassembly, startup_translator_check.py reports 0 failed, ctest 10/10 passed, no exit-77 skips.

Environment: Windows 10.0.26300.10075. WARP is the Microsoft Basic Render Driver 10.0.26100.10068. The hardware run used an NVIDIA GeForce RTX 5090 on driver 32.0.16.2135. The debug layer was enabled and logged no error message.

Each control was checked against a mutant: apply the mutant, rebuild, rerun, then revert. No mutant was committed.

Mutant Fails
runtime ignores the scale (times) dispatch: 288 words differ
runtime ignores the byte offset (at) dispatch: 288 words differ
runtime uses the constant instead of the read word dispatch: 288 words differ
runtime drops the upload-memory check -placed control
runtime drops the buffer-range check -past control (output written)
translator drops the alignment check scale control
translator drops the modified-descriptor check modified-descriptor control
translator accepts any register offset group-ID control
translator keeps a register add register-add control
translator keeps marks across a branch target branch-target control

Measured vs hypothesis

Measured: one synthetic program, on WARP and on one physical adapter. In a local set of 158 compute requests that hold such a load, 153 stopped first at the buffer-read index. All 153 change their first refusal, and none translates fully yet. 145 now stop at a non-heap instruction, 6 at the narrower buffer refusal and 2 at an 8-dword record. Their next first refusals:

  • 82: a per-lane vcc live at an s_cbranch_execz join
  • 24: v_fma_mix_f32
  • 14: src_scc in s_mul_i32
  • 6: a buffer read in another form
  • 6: a formatted load without a hardware table descriptor
  • 5: a buffer store through a modified descriptor
  • 3: v_mad_u32_u16
  • 2: src_scc in s_mov_b32
  • 2: s_and_b32 live at an execz join
  • 2: an 8-dword heap record
  • 1: v_readfirstlane_b32
  • 6: s_buffer_load_dwordx8 live at an execz join

Ceiling: 145 programs hold a heap load that now lowers, but counting every refusal site, 120 of the 158 still hold a refused heap-record load:

  • 101 have the narrower buffer refusal;
  • 32 have an offset that is not a root constant shifted by 5;
  • 2 have an 8-dword record.

With the branch-target clear disabled in a scratch copy (a diagnostic only, never committed), the programs with a refused x4 buffer-form site drop from 90 to 10. The main shape that stays refused is therefore an offset computed, or a word read, before a branch target. It stays refused because another path into the join may carry a different word. About 97 programs also load an 8-dword (image) heap record, which stays refused regardless.

Hypothesis, not measured:

  • the title leaves the upload memory unchanged between recording and execution (the heap-record read already relies on this);
  • the real index buffers live in upload memory rather than in a placed buffer;
  • any dispatch gain, because no program translates fully yet.

🤖 Generated with Claude Code

**@⁠NiiRoZz** on GitHub · 2026-11-25 21:39 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2580) `NiiRoZz:startup/compute-dispatch-heap-bufindex` → `main` · +420 −36 · 10 files · 74 commits · merged 2026-11-26 05:50 UTC Depends on #2532 (this branch is stacked on it; review the commits after its head). ## What changed - `tools/startup/gfx2hlsl.py`: the heap-record index may be a word that `s_buffer_load_dword(xN)` reads from an unmodified table buffer descriptor, at a literal byte offset or at `<root constant word> * k + c` (`s_mul_i32`, `s_mulk_i32`, `s_add_u32`, `s_add_i32`, `s_addk_i32` with literals, plus any `offset:` modifier), dword-aligned, with no branch target between the arithmetic and the load or between the load and the shift. The manifest line is `srv <i> buf heap word table <parameter> <byte> at <offset> [rootconst <parameter> <word> times <k>]`. Every other buffer-read index keeps a refusal, now worded `... whose index is read from a buffer other than a table buffer at a dispatch-constant offset`. - `src/startup_stubs/d3d12_compute_dispatch.inl`: parses the two new forms, reads the table record, computes the byte offset in 32-bit arithmetic, reads the index word and binds the heap record through the existing #2532 path. New refusals, each one logged reason and nothing recorded: `a heap index word is not in the list's upload memory` (view token or memory outside the list's slot 148 upload allocations) and `a heap index word is outside its table buffer` (word past `stride * num_records` bytes, with a stride of 0 counted as 1). - `tests/startup_stream_consumer.cpp`: `dispatch-heap-word` modes and three controls. - `tests/startup_gfx2hlsl_heap_record_check.py`: the two "index read from a buffer" controls used a literal offset, which is now accepted; they now read the index at a group-ID offset (`s14`), which stays refused with the same message prefix. - New: `tests/startup_gfx2hlsl_heap_word_check.py`, `tests/startup_compute_dispatch_heap_word_check.py`; registered in `CMakeLists.txt`, the Windows workflow and `AGENTS.md`. `docs/experiments.md` paragraph next to the heap-record text. ## Why the CPU read is sound The word is read when the dispatch is recorded, not when the GPU runs. That is only correct if nothing on the GPU writes the word, so the stand-in reads it only from the recording's upload memory, which no GPU command writes, and refuses a placed buffer or a view token. A per-thread or group-ID index can't be read once on the CPU, and neither can a register sum or a modified descriptor, so all of these keep a refusal. ## Tests Commit under test: ba79c8b0 (code; the docs commits 5c248dc1 and 62b5ccc0 change no code), on #2532 head 1efce194. ```powershell python -B tests/startup_gfx2hlsl_heap_word_check.py --llvm-mc llvm-mc-15 python -B tests/startup_gfx2hlsl_heap_record_check.py --llvm-mc llvm-mc-15 python -B tests/startup_translator_check.py cmake --build --preset dev --target startup_stream_consumer ctest --preset dev --no-tests=error -R "^startup_compute_dispatch_|heap_record|heap_word" -V ``` Results: both translator checks PASS with reassembly, `startup_translator_check.py` reports 0 failed, ctest 10/10 passed, no exit-77 skips. Environment: Windows 10.0.26300.10075. WARP is the Microsoft Basic Render Driver 10.0.26100.10068. The hardware run used an NVIDIA GeForce RTX 5090 on driver 32.0.16.2135. The debug layer was enabled and logged no error message. Each control was checked against a mutant: apply the mutant, rebuild, rerun, then revert. No mutant was committed. | Mutant | Fails | |---|---| | runtime ignores the scale (`times`) | dispatch: 288 words differ | | runtime ignores the byte offset (`at`) | dispatch: 288 words differ | | runtime uses the constant instead of the read word | dispatch: 288 words differ | | runtime drops the upload-memory check | `-placed` control | | runtime drops the buffer-range check | `-past` control (output written) | | translator drops the alignment check | scale control | | translator drops the modified-descriptor check | modified-descriptor control | | translator accepts any register offset | group-ID control | | translator keeps a register add | register-add control | | translator keeps marks across a branch target | branch-target control | ## Measured vs hypothesis Measured: one synthetic program, on WARP and on one physical adapter. In a local set of 158 compute requests that hold such a load, 153 stopped first at the buffer-read index. All 153 change their first refusal, and none translates fully yet. 145 now stop at a non-heap instruction, 6 at the narrower buffer refusal and 2 at an 8-dword record. Their next first refusals: - 82: a per-lane `vcc` live at an `s_cbranch_execz` join - 24: `v_fma_mix_f32` - 14: `src_scc` in `s_mul_i32` - 6: a buffer read in another form - 6: a formatted load without a hardware table descriptor - 5: a buffer store through a modified descriptor - 3: `v_mad_u32_u16` - 2: `src_scc` in `s_mov_b32` - 2: `s_and_b32` live at an execz join - 2: an 8-dword heap record - 1: `v_readfirstlane_b32` - 6: `s_buffer_load_dwordx8` live at an execz join Ceiling: 145 programs hold a heap load that now lowers, but counting every refusal site, 120 of the 158 still hold a refused heap-record load: - 101 have the narrower buffer refusal; - 32 have an offset that is not a root constant shifted by 5; - 2 have an 8-dword record. With the branch-target clear disabled in a scratch copy (a diagnostic only, never committed), the programs with a refused x4 buffer-form site drop from 90 to 10. The main shape that stays refused is therefore an offset computed, or a word read, before a branch target. It stays refused because another path into the join may carry a different word. About 97 programs also load an 8-dword (image) heap record, which stays refused regardless. Hypothesis, not measured: - the title leaves the upload memory unchanged between recording and execution (the heap-record read already relies on this); - the real index buffers live in upload memory rather than in a placed buffer; - any dispatch gain, because no program translates fully yet. 🤖 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]>
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]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 01:04:13 +00:00
github manually merged commit 9f97acc305 into gh-pr/2580/base 2026-11-27 01:04:15 +00:00
Author
Owner

@⁠ChazY11 on GitHub · 2026-11-25 23:08 UTC · original

These three PRs (#2580, #2585, #2596) are near-identical copies of one change — worth picking one before any of them merges

Not a defect in the code. A merge-order hazard, with the measurements to back it up.

What I found while reviewing this one

I reviewed #2585 (heap-word tracking) and #2596 (entry values) earlier and mutated the same material in each. Opening this
one, the file list is the same 21 files in all three, and the diffs are identical where it matters:

tools/startup/gfx2hlsl.py                       #2580 CC DCD1341A7F   #2585 CCDCD1341A7F   #2596 CCDCD1341A7F
tests/startup_gfx2hlsl_heap_word_check.py       #2580 4980EA6F28FB   #2585 4980EA6F28FB   #2596 4980EA6F28FB

(those are SHA-1 prefixes of git diff <merge-base> <pr-head> -- <file>, so identical digests mean identical hunks).

Where they differ, the difference is additive rather than conflicting:

src/startup_stubs/d3d12_compute_dispatch.inl    #2580 2FBEC400C04C   #2585 916B6B8124BD   #2596 0B719058DE6E
tests/startup_stream_consumer.cpp               #2580 80E15022EA6D   #2585 68213B4097A6   #2596 2BEEBB7B16B9

and exactly one file is unique to a single PR:

tests/startup_compute_dispatch_entry_check.py   ← only in #2596

So the shape is: one change, three open branches, with #2585 and #2596 each adding a fixture on top of the same base
(heap_word in #2585, heap_word + entry in #2596). The 21 shared files mean that whichever merges first will conflict
with the other two on almost every hunk.

What I measured on this branch

python -B tests/startup_gfx2hlsl_heap_record_check.py   → exit 0
python -B tests/startup_gfx2hlsl_heap_word_check.py     → exit 0

Both device-free checks pass here exactly as they do on #2585 and #2596, which follows from the identical hunks.

Earlier rounds, for completeness, with the same content:

  • #2585: five mutations of heap_word_offset and the index tracking — all five caught (root-constant scale, the
    branch itself, the rc mark, the join clear, "any write ends a mark").
  • #2596: four cases green on WARP and the physical GPU, plus three mutations of the C++ entry-value extraction —
    all three caught (input_word3 word index, output_stride shift, the formatted-input refusal).

The suggestion

Pick the branch that already carries the fixtures you want — #2596 is a superset of #2585, which is a superset of this one —
and close or rebase the others onto it. Otherwise the first merge leaves two PRs that need a full manual re-resolution of
the same 21 files, and there is no way for a reader to tell from the PR list that they are the same work.

If they are meant to be stacked (this one is the base), saying so in each body would also make the review assignment
obvious: the base needs review once, the add-ons only for their own fixture.

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

**@⁠ChazY11** on GitHub · 2026-11-25 23:08 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2580#issuecomment-7177197551) ## These three PRs (#2580, #2585, #2596) are near-identical copies of one change — worth picking one before any of them merges Not a defect in the code. A merge-order hazard, with the measurements to back it up. ### What I found while reviewing this one I reviewed #2585 (heap-word tracking) and #2596 (entry values) earlier and mutated the same material in each. Opening this one, the file list is the same 21 files in all three, and the diffs are identical where it matters: ```text tools/startup/gfx2hlsl.py #2580 CC DCD1341A7F #2585 CCDCD1341A7F #2596 CCDCD1341A7F tests/startup_gfx2hlsl_heap_word_check.py #2580 4980EA6F28FB #2585 4980EA6F28FB #2596 4980EA6F28FB ``` (those are SHA-1 prefixes of `git diff <merge-base> <pr-head> -- <file>`, so identical digests mean identical hunks). Where they *differ*, the difference is additive rather than conflicting: ```text src/startup_stubs/d3d12_compute_dispatch.inl #2580 2FBEC400C04C #2585 916B6B8124BD #2596 0B719058DE6E tests/startup_stream_consumer.cpp #2580 80E15022EA6D #2585 68213B4097A6 #2596 2BEEBB7B16B9 ``` and exactly one file is unique to a single PR: ```text tests/startup_compute_dispatch_entry_check.py ← only in #2596 ``` So the shape is: **one change, three open branches**, with #2585 and #2596 each adding a fixture on top of the same base (`heap_word` in #2585, `heap_word` + `entry` in #2596). The 21 shared files mean that whichever merges first will conflict with the other two on almost every hunk. ### What I measured on this branch ```text python -B tests/startup_gfx2hlsl_heap_record_check.py → exit 0 python -B tests/startup_gfx2hlsl_heap_word_check.py → exit 0 ``` Both device-free checks pass here exactly as they do on #2585 and #2596, which follows from the identical hunks. Earlier rounds, for completeness, with the same content: - #2585: five mutations of `heap_word_offset` and the index tracking — **all five caught** (root-constant scale, the branch itself, the `rc` mark, the join clear, "any write ends a mark"). - #2596: four cases green on WARP **and** the physical GPU, plus three mutations of the C++ entry-value extraction — **all three caught** (`input_word3` word index, `output_stride` shift, the formatted-input refusal). ### The suggestion Pick the branch that already carries the fixtures you want — #2596 is a superset of #2585, which is a superset of this one — and close or rebase the others onto it. Otherwise the first merge leaves two PRs that need a full manual re-resolution of the same 21 files, and there is no way for a reader to tell from the PR list that they are the same work. If they are meant to be stacked (this one is the base), saying so in each body would also make the review assignment obvious: the base needs review once, the add-ons only for their own fixture. AI-assisted; Windows 11 build 26300, pure Python for the rows above.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 02:31 UTC · original

Merged origin/main into this branch (merge commit e2b58be0, no rebase, no force-push). #2532 landed on main as one squash commit, so the branch conflicted in 9 files. I kept main's version of the #2532 content and re-applied only this PR's own five commits on top (the heap index word change, its two docs commits and the two test-tolerance fixes). The conflicts were list entries in AGENTS.md, CMakeLists.txt, the workflow and docs/experiments.md, plus the compute dispatch code. The sources were merged by hand, keeping both sides.

Commands executed locally:

  • Linux: startup_gfx2hlsl_heap_word_check.py and startup_gfx2hlsl_heap_record_check.py (both PASS), docs_links_check.py, bidi_controls_check.py, git diff --check origin/main..HEAD (all clean).
  • Win2025 (default 5 slots, merged tree applied as a patch on c314f36f): startup_gfx2hlsl_heap_word, startup_gfx2hlsl_heap_record, startup_compute_dispatch_heap_word_warp and _hardware, startup_compute_dispatch_heap_{warp,hardware} and startup_compute_dispatch_{warp,hardware}: Passed.
  • startup_compute_dispatch_texture_{warp,hardware} fail with "an output texture view was not created on the desktop". They fail the same way on current main without this PR's change, so they predate it. startup_gfx2hlsl_scalar_table_arity_check also fails on main (fix in #2696).
  • Not run: the release build and the full dev suite on the merged head. Re-run both once main is green.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-26 02:31 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2580#issuecomment-7180881461) Merged `origin/main` into this branch (merge commit e2b58be0, no rebase, no force-push). #2532 landed on main as one squash commit, so the branch conflicted in 9 files. I kept main's version of the #2532 content and re-applied only this PR's own five commits on top (the heap index word change, its two docs commits and the two test-tolerance fixes). The conflicts were list entries in `AGENTS.md`, `CMakeLists.txt`, the workflow and `docs/experiments.md`, plus the compute dispatch code. The sources were merged by hand, keeping both sides. Commands executed locally: - Linux: `startup_gfx2hlsl_heap_word_check.py` and `startup_gfx2hlsl_heap_record_check.py` (both PASS), `docs_links_check.py`, `bidi_controls_check.py`, `git diff --check origin/main..HEAD` (all clean). - Win2025 (default 5 slots, merged tree applied as a patch on c314f36f): `startup_gfx2hlsl_heap_word`, `startup_gfx2hlsl_heap_record`, `startup_compute_dispatch_heap_word_warp` and `_hardware`, `startup_compute_dispatch_heap_{warp,hardware}` and `startup_compute_dispatch_{warp,hardware}`: Passed. - `startup_compute_dispatch_texture_{warp,hardware}` fail with "an output texture view was not created on the desktop". They fail the same way on current main without this PR's change, so they predate it. `startup_gfx2hlsl_scalar_table_arity_check` also fails on main (fix in #2696). - Not run: the release build and the full dev suite on the merged head. Re-run both once main is green. AI-assisted; commands listed were executed locally.
Author
Owner

@⁠tedin7 on GitHub · 2026-11-26 04:12 UTC · original · reviewed

Merged origin/main into the branch (plain merge, no rebase, no force): f56592de.

  • One conflict, in CMakeLists.txt (the compute dispatch test block). Kept both sides: this PR's startup_compute_dispatch_heap_word_* and main's startup_compute_live_retry_*, both in the shared set_tests_properties list.

Verification, run on the merged tree with the diff of #2710 applied on top (so it is tested as it will land):

  • x2w_pipe.py win2025 2580 --patch <merge diff + gh pr diff 2710> --regex 'startup_compute_dispatch|startup_gfx2hlsl_heap|startup_pixel_uav|startup_compute_live_retry|startup_stream'
  • Win2025 dev: 32/32 passed. Win2025 release: 32/32 passed (D3D12 WARP).
  • The one conflict between this PR and #2710 (a comment line in tests/startup_stream_consumer.cpp) was resolved by keeping both sides. When #2710 lands in main, the merge should be mechanical.

Ready to squash-merge once #2710 is in main and CI is green.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-26 04:12 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2580#pullrequestreview-6068452663) · **reviewed** Merged `origin/main` into the branch (plain merge, no rebase, no force): `f56592de`. - One conflict, in `CMakeLists.txt` (the compute dispatch test block). Kept both sides: this PR's `startup_compute_dispatch_heap_word_*` and main's `startup_compute_live_retry_*`, both in the shared `set_tests_properties` list. Verification, run on the merged tree with the diff of #2710 applied on top (so it is tested as it will land): - `x2w_pipe.py win2025 2580 --patch <merge diff + gh pr diff 2710> --regex 'startup_compute_dispatch|startup_gfx2hlsl_heap|startup_pixel_uav|startup_compute_live_retry|startup_stream'` - Win2025 dev: 32/32 passed. Win2025 release: 32/32 passed (D3D12 WARP). - The one conflict between this PR and #2710 (a comment line in `tests/startup_stream_consumer.cpp`) was resolved by keeping both sides. When #2710 lands in main, the merge should be mechanical. Ready to squash-merge once #2710 is in main and CI is green. AI-assisted; commands listed were executed locally.
Author
Owner

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

Win2025 WARP receipt after merging origin/main into this branch (new head 9f97acc3; the run applied the same merge as a patch on f56592de). Main was merged twice; the only conflict was a comment block in tests/startup_stream_consumer.cpp, kept both sides.

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):

  • Debug (--preset dev) and Release /O2 (--preset release), targets startup_stream_consumer d3d12_xs_shim, each: 100% tests passed, 8 of 8.
  • Tests that ran in both: startup_compute_dispatch_heap_word_warp, startup_compute_dispatch_heap_word_hardware, startup_compute_dispatch_heap_warp, startup_compute_dispatch_heap_hardware, startup_compute_dispatch_warp, startup_compute_dispatch_hardware, startup_gfx2hlsl_heap_word, startup_gfx2hlsl_heap_record.
  • Windows Python checks: tests/startup_gfx2hlsl_heap_word_check.py rc=0, tests/startup_gfx2hlsl_heap_record_check.py rc=0.
  • Note: the _hardware tests ran on the VM's WARP adapter only.

Linux: git diff --check origin/main...HEAD, docs_links_check.py, bidi_controls_check.py clean.

Code review of this PR's own change: reads the index word only from the recording's upload memory and refuses placed buffers, view tokens and out-of-range words, each with a negative control. The author's mutation table covers all of them. No game progress is claimed. @⁠ChazY11's note about #2580, #2585 and #2596 sharing the same hunks still applies: whichever merges first will make the others conflict.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-26 05:47 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2580#issuecomment-7183812478) Win2025 WARP receipt after merging `origin/main` into this branch (new head 9f97acc3; the run applied the same merge as a patch on f56592de). Main was merged twice; the only conflict was a comment block in `tests/startup_stream_consumer.cpp`, kept both sides. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP): - Debug (`--preset dev`) and Release `/O2` (`--preset release`), targets `startup_stream_consumer d3d12_xs_shim`, each: **100% tests passed, 8 of 8**. - Tests that ran in both: `startup_compute_dispatch_heap_word_warp`, `startup_compute_dispatch_heap_word_hardware`, `startup_compute_dispatch_heap_warp`, `startup_compute_dispatch_heap_hardware`, `startup_compute_dispatch_warp`, `startup_compute_dispatch_hardware`, `startup_gfx2hlsl_heap_word`, `startup_gfx2hlsl_heap_record`. - Windows Python checks: `tests/startup_gfx2hlsl_heap_word_check.py` rc=0, `tests/startup_gfx2hlsl_heap_record_check.py` rc=0. - Note: the `_hardware` tests ran on the VM's WARP adapter only. Linux: `git diff --check origin/main...HEAD`, `docs_links_check.py`, `bidi_controls_check.py` clean. Code review of this PR's own change: reads the index word only from the recording's upload memory and refuses placed buffers, view tokens and out-of-range words, each with a negative control. The author's mutation table covers all of them. No game progress is claimed. @⁠ChazY11's note about #2580, #2585 and #2596 sharing the same hunks still applies: whichever merges first will make the others conflict. AI-assisted; commands listed were executed locally.
Author
Owner

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

Win2025 WARP receipt after merging origin/main into this branch (new head 9f97acc3; the run applied the same merge as a patch on f56592de). Main was merged twice; the only conflict was a comment block in tests/startup_stream_consumer.cpp, kept both sides.

Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):

  • Debug (--preset dev) and Release /O2 (--preset release), targets startup_stream_consumer d3d12_xs_shim, each: 100% tests passed, 8 of 8.
  • Tests that ran in both: startup_compute_dispatch_heap_word_warp, startup_compute_dispatch_heap_word_hardware, startup_compute_dispatch_heap_warp, startup_compute_dispatch_heap_hardware, startup_compute_dispatch_warp, startup_compute_dispatch_hardware, startup_gfx2hlsl_heap_word, startup_gfx2hlsl_heap_record.
  • Windows Python checks: tests/startup_gfx2hlsl_heap_word_check.py rc=0, tests/startup_gfx2hlsl_heap_record_check.py rc=0.
  • Note: the _hardware tests ran on the VM's WARP adapter only.

Linux: git diff --check origin/main...HEAD, docs_links_check.py, bidi_controls_check.py clean.

Code review of this PR's own change: reads the index word only from the recording's upload memory and refuses placed buffers, view tokens and out-of-range words, each with a negative control. The author's mutation table covers all of them. No game progress is claimed. @⁠ChazY11's note about #2580, #2585 and #2596 sharing the same hunks still applies: whichever merges first will make the others conflict.

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-26 05:47 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/2580#pullrequestreview-6069139871) · **reviewed** Win2025 WARP receipt after merging `origin/main` into this branch (new head 9f97acc3; the run applied the same merge as a patch on f56592de). Main was merged twice; the only conflict was a comment block in `tests/startup_stream_consumer.cpp`, kept both sides. Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP): - Debug (`--preset dev`) and Release `/O2` (`--preset release`), targets `startup_stream_consumer d3d12_xs_shim`, each: **100% tests passed, 8 of 8**. - Tests that ran in both: `startup_compute_dispatch_heap_word_warp`, `startup_compute_dispatch_heap_word_hardware`, `startup_compute_dispatch_heap_warp`, `startup_compute_dispatch_heap_hardware`, `startup_compute_dispatch_warp`, `startup_compute_dispatch_hardware`, `startup_gfx2hlsl_heap_word`, `startup_gfx2hlsl_heap_record`. - Windows Python checks: `tests/startup_gfx2hlsl_heap_word_check.py` rc=0, `tests/startup_gfx2hlsl_heap_record_check.py` rc=0. - Note: the `_hardware` tests ran on the VM's WARP adapter only. Linux: `git diff --check origin/main...HEAD`, `docs_links_check.py`, `bidi_controls_check.py` clean. Code review of this PR's own change: reads the index word only from the recording's upload memory and refuses placed buffers, view tokens and out-of-range words, each with a negative control. The author's mutation table covers all of them. No game progress is claimed. @⁠ChazY11's note about #2580, #2585 and #2596 sharing the same hunks still applies: whichever merges first will make the others conflict. AI-assisted; commands listed were executed locally.
This discussion has been locked. Commenting is limited to contributors.
No description provided.