runtime: cache complete slot 86 mesh pipeline stages #2262

Merged
R0Y00 merged 3 commits from upstream-pr/2270 into main 2026-11-25 09:39:44 +00:00
R0Y00 commented 2026-11-25 09:02:07 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-25T09:02:07Z.


Refs #1759, #1760 and #2253. Builds on the merged slot 86 tag selection in #2248.

Record complete Xbox MS and optional PS containers at creation. An independent request key frames the original stages, serialized creation root, and pointer-free stream. The cache publisher takes an already validated desktop pair and writes a hash-checked marker last. At creation, the shim verifies the exact stage identities and asks D3D12 to create the PSO from the captured state and root.

The executable slice uses tracked root constants. Indirect execution checks the original bound root, all its constant words, matching color and depth formats and count, single-sample attachments, and viewport/scissor state. A no-PS pipeline requires a writable matching depth view and a physical adapter. It is refused on WARP after the source-built depth-only execution reproduced DXGI_ERROR_DEVICE_REMOVED. Heap-indexed and other untracked resource bindings remain refused. This change adds no external translator or binary artifacts.

cmake --build --preset release --target startup_indirect_draw_indexed
ctest --preset release --no-tests=error -j 1 -R '^startup_indirect_(mesh_|draw(_indexed)?_(warp|hardware))' -V

Windows 11 build 26200.9974, Release, 14/14 tests passed with no CTest skips. WARP 10.0.26100.9818 and RTX 4060 Laptop GPU 32.0.16.1656 ran with the debug layer enabled. The source-built nonempty-root mesh draw had 4/8 painted pixels on each of three independent attachments on both adapters. RTX depth-only D16 had 8/8 depth writes. Pending/invalid marker, incomplete root constants, and missing attachments left the targets clear and preserved the argument guards. WARP's depth-only refusal also left the depth clear.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6600888563 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2270). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-25T09:02:07Z. --- Refs #1759, #1760 and #2253. Builds on the merged slot 86 tag selection in #2248. Record complete Xbox MS and optional PS containers at creation. An independent request key frames the original stages, serialized creation root, and pointer-free stream. The cache publisher takes an already validated desktop pair and writes a hash-checked marker last. At creation, the shim verifies the exact stage identities and asks D3D12 to create the PSO from the captured state and root. The executable slice uses tracked root constants. Indirect execution checks the original bound root, all its constant words, matching color and depth formats and count, single-sample attachments, and viewport/scissor state. A no-PS pipeline requires a writable matching depth view and a physical adapter. It is refused on WARP after the source-built depth-only execution reproduced DXGI_ERROR_DEVICE_REMOVED. Heap-indexed and other untracked resource bindings remain refused. This change adds no external translator or binary artifacts. ```powershell cmake --build --preset release --target startup_indirect_draw_indexed ctest --preset release --no-tests=error -j 1 -R '^startup_indirect_(mesh_|draw(_indexed)?_(warp|hardware))' -V ``` Windows 11 build 26200.9974, Release, 14/14 tests passed with no CTest skips. WARP 10.0.26100.9818 and RTX 4060 Laptop GPU 32.0.16.1656 ran with the debug layer enabled. The source-built nonempty-root mesh draw had 4/8 painted pixels on each of three independent attachments on both adapters. RTX depth-only D16 had 8/8 depth writes. Pending/invalid marker, incomplete root constants, and missing attachments left the targets clear and preserved the argument guards. WARP's depth-only refusal also left the depth clear.
tedin7 commented 2026-11-25 09:04:15 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T09:04:15Z.

Review: COMMENTED


Review of head 73f4cff7baa831674cc7d5bf2a574ababf1188a8 (Linux-side review; I did not run Win2025).

Blocking: the branch is CONFLICTING with main. git merge-tree --write-tree origin/main HEAD reports content conflicts in src/startup_stubs/d3d12_xs_device.cpp and tests/startup_indirect_draw_indexed.cpp. Please rebase. The Windows numbers in the body predate the rebase, so re-run them on the rebased head.

Executed locally

  • git diff --stat origin/main...HEAD: 9 files, +712/-60.
  • python3 tests/docs_links_check.py: passed (18 files, 428 links).
  • python3 tests/bidi_controls_check.py: passed (1544 files).
  • git diff --check origin/main...HEAD: clean.
  • gh pr checks 2270: no checks reported on the branch.
  • The new startup_indirect_mesh_cache_* CTests need dxc and a D3D12 fixture, so they cannot run on Linux. Not run.
  • Mutation: I disabled the pixel-stage presence check in publish() (tools/startup/mesh86_cache.py). A synthetic mismatch was still rejected, but only by the later DXIL check. So that check is not independently covered by what I could run. Please confirm a test fails when it is removed (a publish with a PS against a no-PS request, using real DXIL).

Findings

  • P2: mesh86_cache.inl, xbox_mesh86_container: the "XDAT" search scans the DXIL payload in 4-byte steps and trusts the first match. A payload with those bytes earlier in the header could be mis-parsed. It fails closed (refusal), but a negative fixture would help.
  • P2: try_cached_mesh86 publishes the four req_* files before the heap-flag and tracked-constants refusals. Refused requests leave files in the cache directory. Consider publishing after the eligibility checks, or document it.
  • Nit: list_root_constants (d3d12_draw.inl): the count <= 8 - offset guard and the loop truncation overlap. A one-line comment on the invariant would help.

Good

  • The request key is length-framed and computed the same way in Python and C++.
  • The marker is written last, and the runtime re-hashes the MS/PS bytes against it.
  • Stage identity is checked on both sides.
  • The WARP depth-only refusal is documented and tested.
  • Title and content look clean-room and neutral.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6054591650 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2270#pullrequestreview-6054591650). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T09:04:15Z. **Review:** COMMENTED --- Review of head `73f4cff7baa831674cc7d5bf2a574ababf1188a8` (Linux-side review; I did not run Win2025). **Blocking: the branch is CONFLICTING with `main`.** `git merge-tree --write-tree origin/main HEAD` reports content conflicts in `src/startup_stubs/d3d12_xs_device.cpp` and `tests/startup_indirect_draw_indexed.cpp`. Please rebase. The Windows numbers in the body predate the rebase, so re-run them on the rebased head. **Executed locally** - `git diff --stat origin/main...HEAD`: 9 files, +712/-60. - `python3 tests/docs_links_check.py`: passed (18 files, 428 links). - `python3 tests/bidi_controls_check.py`: passed (1544 files). - `git diff --check origin/main...HEAD`: clean. - `gh pr checks 2270`: no checks reported on the branch. - The new `startup_indirect_mesh_cache_*` CTests need dxc and a D3D12 fixture, so they cannot run on Linux. Not run. - Mutation: I disabled the pixel-stage presence check in `publish()` (`tools/startup/mesh86_cache.py`). A synthetic mismatch was still rejected, but only by the later DXIL check. So that check is not independently covered by what I could run. Please confirm a test fails when it is removed (a publish with a PS against a no-PS request, using real DXIL). **Findings** - P2: `mesh86_cache.inl`, `xbox_mesh86_container`: the "XDAT" search scans the DXIL payload in 4-byte steps and trusts the first match. A payload with those bytes earlier in the header could be mis-parsed. It fails closed (refusal), but a negative fixture would help. - P2: `try_cached_mesh86` publishes the four `req_*` files before the heap-flag and tracked-constants refusals. Refused requests leave files in the cache directory. Consider publishing after the eligibility checks, or document it. - Nit: `list_root_constants` (`d3d12_draw.inl`): the `count <= 8 - offset` guard and the loop truncation overlap. A one-line comment on the invariant would help. **Good** - The request key is length-framed and computed the same way in Python and C++. - The marker is written last, and the runtime re-hashes the MS/PS bytes against it. - Stage identity is checked on both sides. - The WARP depth-only refusal is documented and tested. - Title and content look clean-room and neutral. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 09:23:03 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T09:23:03Z.

Review: COMMENTED


Re-review of head e5130779bb0a341c1424639e728517c5d7cdf3cf (Linux-side; I did not run Win2025).

Rebase: resolved. The head is a merge of main into the branch. git merge-tree --write-tree origin/main HEAD now returns a clean tree (main has moved 1 commit since, still no conflicts). The earlier conflicts in d3d12_xs_device.cpp and startup_indirect_draw_indexed.cpp are gone. The Windows numbers in the body predate the merge, so please re-run them on this head.

Previous P2s: both still open. Since 73f4cff7 the only changes to mesh86_cache.inl and tools/startup/mesh86_cache.py come from the merge of main. I found no change for either item.

  • P2 (open): src/startup_stubs/mesh86_cache.inl:29: the "XDAT" search still scans the payload in 4-byte steps and trusts the first match. It fails closed, but there is no negative fixture for a payload with those bytes earlier in the header.
  • P2 (open): src/startup_stubs/mesh86_cache.inl:159-179: the four req_* files are still published before the heap-flag and tracked-constants refusals. Refused requests still leave files in the cache directory. Publish after the eligibility checks, or document it.
  • The mutation gap on the pixel-stage presence check in publish() (tools/startup/mesh86_cache.py:76) is also unchanged. Please confirm a real-DXIL test fails when it is removed.

CI: at review time, "Run platform-independent Python checks on Linux" is fail (38s) on run 45584378166. The log was not yet available, so I cannot say if the PR causes it. The Windows jobs were still pending. Please check it.

Executed locally

  • git diff --stat origin/main...HEAD: 9 files, +719/-66.
  • python3 tests/docs_links_check.py: passed (18 files, 435 links).
  • python3 tests/bidi_controls_check.py: passed (1570 files).
  • git diff --check origin/main...HEAD: clean.
  • gh pr checks 2270: see CI note above.
  • The startup_indirect_mesh_cache_* CTests need dxc and a D3D12 fixture, so they were not run on Linux. I did not repeat the mutation run for the same reason.

Title and content remain neutral and clean-room.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6054865135 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2270#pullrequestreview-6054865135). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T09:23:03Z. **Review:** COMMENTED --- Re-review of head `e5130779bb0a341c1424639e728517c5d7cdf3cf` (Linux-side; I did not run Win2025). **Rebase: resolved.** The head is a merge of main into the branch. `git merge-tree --write-tree origin/main HEAD` now returns a clean tree (main has moved 1 commit since, still no conflicts). The earlier conflicts in `d3d12_xs_device.cpp` and `startup_indirect_draw_indexed.cpp` are gone. The Windows numbers in the body predate the merge, so please re-run them on this head. **Previous P2s: both still open.** Since `73f4cff7` the only changes to `mesh86_cache.inl` and `tools/startup/mesh86_cache.py` come from the merge of main. I found no change for either item. - P2 (open): `src/startup_stubs/mesh86_cache.inl:29`: the "XDAT" search still scans the payload in 4-byte steps and trusts the first match. It fails closed, but there is no negative fixture for a payload with those bytes earlier in the header. - P2 (open): `src/startup_stubs/mesh86_cache.inl:159-179`: the four `req_*` files are still published before the heap-flag and tracked-constants refusals. Refused requests still leave files in the cache directory. Publish after the eligibility checks, or document it. - The mutation gap on the pixel-stage presence check in `publish()` (`tools/startup/mesh86_cache.py:76`) is also unchanged. Please confirm a real-DXIL test fails when it is removed. **CI:** at review time, "Run platform-independent Python checks on Linux" is `fail` (38s) on run 45584378166. The log was not yet available, so I cannot say if the PR causes it. The Windows jobs were still pending. Please check it. **Executed locally** - `git diff --stat origin/main...HEAD`: 9 files, +719/-66. - `python3 tests/docs_links_check.py`: passed (18 files, 435 links). - `python3 tests/bidi_controls_check.py`: passed (1570 files). - `git diff --check origin/main...HEAD`: clean. - `gh pr checks 2270`: see CI note above. - The `startup_indirect_mesh_cache_*` CTests need dxc and a D3D12 fixture, so they were not run on Linux. I did not repeat the mutation run for the same reason. Title and content remain neutral and clean-room. AI-assisted; commands listed were executed locally.
tedin7 commented 2026-11-25 09:37:08 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T09:37:08Z.

Review: COMMENTED


Re-review of head 795ed6e9ac99a7fadafd4ec82664dbe9ddc828c6 (Linux-side; I did not run Win2025).

Delta since the last review (e5130779): only a merge of main. Changed files: README.md, docs/startup-runtime.md, gameinput.cpp, startup_gameinput_contracts_check.cpp, tools/mesh_entry_aot.py (main's commits #2264, #2269, #2276). src/startup_stubs/mesh86_cache.inl, tools/startup/mesh86_cache.py and tests/startup_indirect_mesh_cache_check.py are byte-identical to the previous head.

Previous P2s: both still open (no change).

  • P2 (open): src/startup_stubs/mesh86_cache.inl:29-30: the "XDAT" search still scans in 4-byte steps and trusts the first match. It fails closed, but there is no negative fixture for a payload with those bytes earlier in the header.
  • P2 (open): src/startup_stubs/mesh86_cache.inl:159-179: the four req_* files are still published before the heap-flag and tracked-constants refusals, so refused requests leave files in the cache directory. Publish after the eligibility checks, or document it.
  • Still unconfirmed: a test that fails when the pixel-stage presence check in publish() (tools/startup/mesh86_cache.py:76) is removed.

State: git merge-tree --write-tree origin/main HEAD is clean. The head is mergeable. At review time "Run platform-independent Python checks on Linux" passes (46s). The Windows jobs and the gfx1013 fixture job were pending. The Windows numbers in the body still predate the merges, so please re-run them on this head.

Executed locally

  • git diff --stat e5130779 HEAD: 5 files, +45/-6 (all from main).
  • git diff --stat origin/main...HEAD: 9 files, +719/-66.
  • python3 tests/docs_links_check.py: passed (18 files, 435 links).
  • python3 tests/bidi_controls_check.py: passed (1570 files).
  • git diff --check origin/main...HEAD: clean.
  • python3 -I tests/startup_indirect_mesh_cache_check.py: needs backend/work/depth_only args from the Windows CTest fixture (dxc + D3D12), so not runnable on Linux. I did not repeat the mutation run for the same reason.
  • gh pr checks 2270: see state above.

Title and content remain neutral and clean-room.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6055095017 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/2270#pullrequestreview-6055095017). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-25T09:37:08Z. **Review:** COMMENTED --- Re-review of head `795ed6e9ac99a7fadafd4ec82664dbe9ddc828c6` (Linux-side; I did not run Win2025). **Delta since the last review (`e5130779`):** only a merge of main. Changed files: README.md, docs/startup-runtime.md, gameinput.cpp, startup_gameinput_contracts_check.cpp, tools/mesh_entry_aot.py (main's commits #2264, #2269, #2276). `src/startup_stubs/mesh86_cache.inl`, `tools/startup/mesh86_cache.py` and `tests/startup_indirect_mesh_cache_check.py` are byte-identical to the previous head. **Previous P2s: both still open (no change).** - P2 (open): `src/startup_stubs/mesh86_cache.inl:29-30`: the "XDAT" search still scans in 4-byte steps and trusts the first match. It fails closed, but there is no negative fixture for a payload with those bytes earlier in the header. - P2 (open): `src/startup_stubs/mesh86_cache.inl:159-179`: the four `req_*` files are still published before the heap-flag and tracked-constants refusals, so refused requests leave files in the cache directory. Publish after the eligibility checks, or document it. - Still unconfirmed: a test that fails when the pixel-stage presence check in `publish()` (`tools/startup/mesh86_cache.py:76`) is removed. **State:** `git merge-tree --write-tree origin/main HEAD` is clean. The head is mergeable. At review time "Run platform-independent Python checks on Linux" passes (46s). The Windows jobs and the gfx1013 fixture job were pending. The Windows numbers in the body still predate the merges, so please re-run them on this head. **Executed locally** - `git diff --stat e5130779 HEAD`: 5 files, +45/-6 (all from main). - `git diff --stat origin/main...HEAD`: 9 files, +719/-66. - `python3 tests/docs_links_check.py`: passed (18 files, 435 links). - `python3 tests/bidi_controls_check.py`: passed (1570 files). - `git diff --check origin/main...HEAD`: clean. - `python3 -I tests/startup_indirect_mesh_cache_check.py`: needs backend/work/depth_only args from the Windows CTest fixture (dxc + D3D12), so not runnable on Linux. I did not repeat the mutation run for the same reason. - `gh pr checks 2270`: see state above. Title and content remain neutral and clean-room. AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-25 10:05:24 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows!2262
No description provided.