runtime: resolve readable guest Mesh86 root SRVs #3815

Open
github-bot wants to merge 14 commits from github-bot/gh-3813 into main AGit
Owner

@⁠lambirou on GitHub · 2026-12-02 01:51 UTC · original
lambirou:codex/mesh86-root-srv-128 → main · +1191 −67 · 19 files · 14 commits · open

Problem

After #3812, the focus run reaches the prologue and key 13c660ac281d07d5 passes the 18-byte material t0, then refuses at t1 root=3:

x2w-mesh86 material refused ... stage=mesh srv=t1 root=3 needed=128 size=0 ... reason=root SRV has no mapped buffer

The four DispatchMesh calls that draw the prologue therefore bind no geometry. The 128-byte range is readable guest memory that no live D3D12 resource owns, so the upload-ring, placement-index and committed-resource lookups all miss.

Change

  • Resolve a readable guest root SRV through the recording-owned upload snapshot, the same backing rule slot 44 already uses for root SRVs and the root-CBV branch uses for scalar loads. The snapshot also makes a range whose guest offset is not 16-byte aligned addressable by the desktop raw SRV.
  • Refuse a range that overlaps a GPU-written resource before copying title bytes, so the desktop bytes stay authoritative.
  • Replace root SRV has no mapped buffer with a named reason and a bounded X2W_D3D12_TRACE_DIRECT_MESH row carrying the address, readability, VirtualQuery state/type, placement result and resource-index result. A reserved page now reports root SRV range is not readable in title memory.

Tests

tests/startup_mesh86_root_srv_check.py publishes a PS-less profile 6 with one 128-byte root SRV, then runs startup_indirect_draw_indexed twice:

  • positive: a committed 64 KiB private page at offset 0x40; the mesh stage reads dwords 0 and 124 and writes depth 0.5.
  • negative: a reserved page; the bind must print the named refusal and leave the depth clear.
. .\tools\dev.ps1
cmake --preset release -DINTAKE_PYTHON=<python>
cmake --build --preset release --target startup_indirect_draw_indexed
python -B tests/startup_mesh86_root_srv_check.py <dxc> out\build\release\startup_indirect_draw_indexed.exe hardware
python -B tests/startup_mesh86_root_srv_check.py <dxc> out\build\release\startup_indirect_draw_indexed.exe warp

Results on this worktree (f40d7a0c):

  • RX 9060 XT, driver 32.0.32029.2010: positive read depth 0.5 (8/8 non-clear pixels, all 0x8000); negative refused by name with depth clear.
  • Microsoft Basic Render Driver 10.0.26100.10068: the 128-byte root SRV binds and DispatchMesh is recorded; WARP then removes the device after the mesh dispatch (0x887a0005), so the depth readback is a capability skip. The negative control passes.
ctest --test-dir out/build/release --no-tests=error -j1 -R '^startup_mesh86_root_srv_' --output-on-failure
1/2 Test #4234: startup_mesh86_root_srv_warp ....... Passed
2/2 Test #4235: startup_mesh86_root_srv_hardware ... Passed

Focus title

The previous focus run stopped at the old root SRV has no mapped buffer refusal. The final integration run with the material and input fixes is launched separately; its refusal or mesh-bind result will be recorded here.

Stack

Stacked on #3727 / #3805 (integration head f4c9e174). Refs #3641, #3643, #870.

Review follow-up (2026-12-02)

The PR currently conflicts with main and remains stacked on open dependencies #3805 and #3812. On head f40d7a0c, a release rebuild and the two root-SRV CTest cases passed on the existing fixture. The WARP positive depth readback was a capability skip after device removal; its negative control passed.

Outstanding correctness issue: a readable range rejected by placed_buffer_range as crossing or ambiguous can reach the guest-memory snapshot fallback. Add a regression fixture and preserve the placement rejection before treating this as ready to merge. The existing positive and reserved-page controls do not cover this case.

**@⁠lambirou** on GitHub · 2026-12-02 01:51 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3813) `lambirou:codex/mesh86-root-srv-128` → `main` · +1191 −67 · 19 files · 14 commits · open ## Problem After #3812, the focus run reaches the prologue and key `13c660ac281d07d5` passes the 18-byte material `t0`, then refuses at `t1 root=3`: ``` x2w-mesh86 material refused ... stage=mesh srv=t1 root=3 needed=128 size=0 ... reason=root SRV has no mapped buffer ``` The four `DispatchMesh` calls that draw the prologue therefore bind no geometry. The 128-byte range is readable guest memory that no live D3D12 resource owns, so the upload-ring, placement-index and committed-resource lookups all miss. ## Change - Resolve a readable guest root SRV through the recording-owned upload snapshot, the same backing rule slot 44 already uses for root SRVs and the root-CBV branch uses for scalar loads. The snapshot also makes a range whose guest offset is not 16-byte aligned addressable by the desktop raw SRV. - Refuse a range that overlaps a GPU-written resource before copying title bytes, so the desktop bytes stay authoritative. - Replace `root SRV has no mapped buffer` with a named reason and a bounded `X2W_D3D12_TRACE_DIRECT_MESH` row carrying the address, readability, `VirtualQuery` state/type, placement result and resource-index result. A reserved page now reports `root SRV range is not readable in title memory`. ## Tests `tests/startup_mesh86_root_srv_check.py` publishes a PS-less profile 6 with one 128-byte root SRV, then runs `startup_indirect_draw_indexed` twice: - positive: a committed 64 KiB private page at offset `0x40`; the mesh stage reads dwords 0 and 124 and writes depth 0.5. - negative: a reserved page; the bind must print the named refusal and leave the depth clear. ```powershell . .\tools\dev.ps1 cmake --preset release -DINTAKE_PYTHON=<python> cmake --build --preset release --target startup_indirect_draw_indexed python -B tests/startup_mesh86_root_srv_check.py <dxc> out\build\release\startup_indirect_draw_indexed.exe hardware python -B tests/startup_mesh86_root_srv_check.py <dxc> out\build\release\startup_indirect_draw_indexed.exe warp ``` Results on this worktree (`f40d7a0c`): - RX 9060 XT, driver 32.0.32029.2010: positive read depth 0.5 (8/8 non-clear pixels, all `0x8000`); negative refused by name with depth clear. - Microsoft Basic Render Driver 10.0.26100.10068: the 128-byte root SRV binds and `DispatchMesh` is recorded; WARP then removes the device after the mesh dispatch (`0x887a0005`), so the depth readback is a capability skip. The negative control passes. ``` ctest --test-dir out/build/release --no-tests=error -j1 -R '^startup_mesh86_root_srv_' --output-on-failure 1/2 Test #4234: startup_mesh86_root_srv_warp ....... Passed 2/2 Test #4235: startup_mesh86_root_srv_hardware ... Passed ``` ## Focus title The previous focus run stopped at the old `root SRV has no mapped buffer` refusal. The final integration run with the material and input fixes is launched separately; its refusal or mesh-bind result will be recorded here. ## Stack Stacked on #3727 / #3805 (integration head `f4c9e174`). Refs #3641, #3643, #870. ## Review follow-up (2026-12-02) The PR currently conflicts with main and remains stacked on open dependencies #3805 and #3812. On head f40d7a0c, a release rebuild and the two root-SRV CTest cases passed on the existing fixture. The WARP positive depth readback was a capability skip after device removal; its negative control passed. Outstanding correctness issue: a readable range rejected by placed_buffer_range as crossing or ambiguous can reach the guest-memory snapshot fallback. Add a regression fixture and preserve the placement rejection before treating this as ready to merge. The existing positive and reserved-page controls do not cover this case.
The shared scalar ALU already lowers all three, SCC included. The mesh
frontend refused them with "unsupported mesh instruction or EXEC state".
They now join s_bfe_u32 and s_min_u32 on the shared path, with the same
EXEC and VCC destination refusals.

On a native Mesh86 capture (1,569 distinct slot 86 programs), these were
the first refusal for 555 of them, and 122 more now translate fully.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review follow-up on #3708. After s_cmp_eq_u32 s20, 0, an s_cselect_b32
behind s_brev_b32 still selects on the compare's SCC, and behind s_not_b32
on (result != 0). Both selects reach the exported X.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Adopt the existing committed desktop backing for a placed material view, refresh it from title memory at submit, and copy only changed runs. Keep the existing backing and its fences; a submitted GPU write stops refreshes. Add a source-built two-SRV fixture with range, token, stale, budget and mutant controls.

Refs #3640, #3638, #3545.
Both are already lowered by the shared ALU (the reciprocal as v_rcp_f32,
the shift as an arithmetic right shift by src0 & 31). The mesh lane ALU
list now admits them, so the full_exec || exec_skip rule and the
partial-write merge apply unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review follow-up on #3709: v-rcp-iflag-f32 now checks that the reciprocal's
bits reach the exported X, as v-ashrrev-i32 already does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The mesh frontend narrowed EXEC only for v_cmpx_eq_u32, ne_u32 and lt_u32,
and for v_cmpx_gt_u32 only in the lane-linear count form. Mesh86 programs
also use v_cmpx_lg_f32, v_cmpx_gt_f32 and a per-lane v_cmpx_gt_u32.

They now get the same EXEC-only narrowing through the shared compare: lg is
an ordered fcmp one and gt_f32 an ordered ogt, so a NaN lane leaves EXEC,
and gt_u32 is icmp ugt. The count form of v_cmpx_gt_u32 is still matched
first. Float abs/neg, SDWA, DPP, clamp and omod stay refused.

Part of #3703.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Inside the vertex skip, skinned mesh programs save EXEC, narrow it with
one v_cmpx_ne_u32 and no EXECZ, run straight-line VALU work and restore
the saved vertex mask. The restore was refused as "mesh EXEC write inside
a lane-skip block".

When the CMPX runs, every register is exact for the skip's guard lanes.
A write under the narrowed mask whose old value is still that exact value
(unchanged since the CMPX, or itself merged) is now merged per lane with
it, so it stays exact for the guard. A restore of the guard's saved mask
keeps every register that is unchanged since the CMPX or merged, and
clears the rest, such as a register first written under the narrowed
mask. A second narrowing, or a restore of a mask saved under the narrowed
EXEC, stays refused.

Part of #3703.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The #3671 lane-limit proof tags partial VGPRs with the vertex skip's lane
count when the skip closes, so an export under the same count may read them
after full EXEC returns. It required the closing skip's guard to be the
current lane mask. When a nested CMPX skip inside the vertex skip exits to
the same EXEC restore, the nested mask is still current at the outer close,
so the proof was skipped and the restore erased the position VGPRs
("graphics register undefined on an incoming path").

A nested per-lane skip now records the parent guard when it opens directly
after a single CMPX that narrowed it. Nothing ran under the narrowed mask
outside that skip, and the skip branches per thread, so after it closes
every register is exact for each of the parent's lanes. If the parent then
closes at the same instruction, its lane limit applies as before. Any other
narrowing, a write between the CMPX and the EXECZ, or another path arriving
at the restore keeps the previous behavior.

Part of #3703 (item 6).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A chain of per-lane skips, each opened straight after a CMPX that narrows
the skip around it, merges every register per lane when it closes. #3710
carried that fact from one nested skip to its parent only, and only when
the parent closed at the same instruction. Skinned mesh programs nest
three such skips inside the vertex skip and close all of them at a restore
of the vertex mask, after which the vertex skip goes on. The restore then
treated every register written since the mask was saved as stale and
cleared it, so the next read refused with "graphics register undefined on
an incoming path".

The carried lane set now passes through any depth of skips closing at one
pc, and an EXEC restore at that pc keeps the register file when the
restored mask is the carried guard of the enclosing skip. The set is tied
to its pc so it never describes a later instruction. A write between the
innermost CMPX and its EXECZ, or a narrowing that is not a CMPX, still
breaks the chain.

Part of #3703.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The mesh frontend accepted buffer_load_format_x only from a resource heap
slot. Skinned slot 86 programs read the V# whole from a bound descriptor
table instead and were refused with "formatted mesh load lacks an
R32_UINT resource heap contract".

Translator: a format load whose V# comes from a bound table goes through
the shared typed-buffer SRV path, as in vertex and pixel shaders, which
checks the table binding and all four descriptor words. The #3720
control that kept this route refused under heap tokens now checks that
it compiles without a token view.

Runtime: slot 86 accepts a one-dword typed_buffer_srv from a descriptor
table and binds it as an R32_UINT buffer view through the same checks as
a typed heap slot (R32_UINT token view, or a raw V# with the identity
component map and a 4-byte stride). A raw table V# must also name a
32-bit format (32_UINT, 32_SINT or 32_FLOAT), so the view returns the
dword the guest load would. Those word 3 checks live in
mesh86_typed_vsharp.h with unit tests and two mutation controls.

Part of #3703.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A merged value is exact for the guard's lanes only in the register it was
merged into. Keying the merges by value let a copy of a merged value into
another register pass the restore as exact. Record the merged value per
register instead, and add the copy fixture from review plus a second merge
into the same register.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A raw V# with SWIZZLE_ENABLE (word 1 bit 31) or ADD_TID_ENABLE (word 3
bit 23) set addresses elements differently from the linear R32_UINT view
slot 86 binds, so refuse it on both the heap and the table route. Add a
linear_addressing unit case with two header mutation controls, and run
the mesh86_typed_vsharp tests in the pr preset.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The pr test filter runs mesh86_typed_vsharp_*, but the pr build preset
only builds its listed targets, so CI reported the tests as not run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Inside a SAVEEXEC then arm the compiler often copies EXEC, runs some
vector work, narrows EXEC with one CMPX, skips with EXECZ and restores the
copy. Each lane runs the work and then the skipped instructions only if
the compare holds: the same if-only region s_and_saveexec_b64 would open
on the compare. The then-arm scan now registers it as a child region and
the mesh frontend lowers it as a nested diamond on the shared compare,
through the existing nested SAVEEXEC join and restore. The region needs
its own restore of the copied register inside the arm; anything else
stays an EXEC read of the then arm.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The compiler also narrows the rest of an if-only SAVEEXEC then arm with a
CMPX whose EXECZ skips to the arm's end, leaving the EXEC copy unrestored.
The rest of the arm is then the region, and the SAVEEXEC restore ends
both. Accept that form when the enclosing arm has no else arm (its
inverse would read the narrowed EXEC), and visit the join address again
after the region closes so the enclosing arm ends there too. Regions
chain the same way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The then-arm scan recorded every scalar destination as a register pair,
so a 32-bit write such as s_lshl_b32 s7 also marked s8 as written. At
the join s8 was clobbered, and a lane mask kept there was lost; the
else arm also could not read the neighbour. Record the pair only for
64-bit SALU forms and for non-SALU writes (compare masks, readlane),
as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A buffer_load_dword, or a buffer_load_format_x from a descriptor-table
V#, without OFFEN, with a uniform IDXEN index if any and a constant or
uniform SOFFSET, reads the same address in every lane. Until the shader
stores to memory it returns the same dwords in every lane, so mark them
uniform under the same conditions as the heap typed load and let a
following v_readfirstlane read them. The address is checked before the
load, whose destination may be its own index register.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refs #2413, #3416
# Conflicts:
#	CMakePresets.json
#	docs/experiments/mesh86-pixel-execz.md
# Conflicts:
#	CMakePresets.json
# Conflicts:
#	CMakePresets.json
# Conflicts:
#	src/gfx1013_direct_mesh.inl
#	tests/native_direct_mesh_check.py
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 01:54:17 +00:00
Author
Owner

@⁠lambirou on GitHub · 2026-12-02 14:44 UTC · original · reviewed

Reviewed f40d7a0c against #3727; read the runtime and fixture delta, not built here.

Verdict: approve. The new root-SRV path reuses the recording-owned upload snapshot rather than inventing a second backing, refuses a range that overlaps a GPU-written resource before copying title bytes, and replaces the generic refusal with named reasons. The positive/negative fixture covers a committed readable page and a reserved page.

  • SHOULD The snapshot branch returns a source-2 view for any minimum that is readable, without applying the existing 16 MiB snapshot bound or consulting title_input_snapshot_enabled(). A 128-byte root SRV is harmless, but the same branch would copy a much larger guest range if a profile declares it. Bound the copy and state whether this path is intentionally independent of the snapshot switch.
  • NIT root_srv_unmapped_reason keeps a process-wide static std::vector for de-duplication. The existing diagnostic paths use the same pattern, but this function can be called from several lists; a small lock or a per-recording set would make the bound explicit.
  • Checked, no finding: gpu_written_overlap is checked before the title snapshot; the placement, mapped-resource and readability reasons are ordered and named; the test's reserved-page control expects the named refusal and a clear depth. The PR remains stacked on #3727, so it should not merge before that base.
**@⁠lambirou** on GitHub · 2026-12-02 14:44 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3813#pullrequestreview-6153048009) · **reviewed** Reviewed `f40d7a0c` against #3727; read the runtime and fixture delta, not built here. **Verdict: approve.** The new root-SRV path reuses the recording-owned upload snapshot rather than inventing a second backing, refuses a range that overlaps a GPU-written resource before copying title bytes, and replaces the generic refusal with named reasons. The positive/negative fixture covers a committed readable page and a reserved page. - **SHOULD** The snapshot branch returns a source-2 view for any `minimum` that is readable, without applying the existing 16 MiB snapshot bound or consulting `title_input_snapshot_enabled()`. A 128-byte root SRV is harmless, but the same branch would copy a much larger guest range if a profile declares it. Bound the copy and state whether this path is intentionally independent of the snapshot switch. - **NIT** `root_srv_unmapped_reason` keeps a process-wide `static std::vector` for de-duplication. The existing diagnostic paths use the same pattern, but this function can be called from several lists; a small lock or a per-recording set would make the bound explicit. - Checked, no finding: `gpu_written_overlap` is checked before the title snapshot; the placement, mapped-resource and readability reasons are ordered and named; the test's reserved-page control expects the named refusal and a clear depth. The PR remains stacked on #3727, so it should not merge before that base.
Author
Owner

@⁠timbot103 on GitHub · 2026-12-03 10:33 UTC · original

Independent RTX 5080 + WARP run, in case a second NVIDIA data point helps (the reviewer runs here are on an RTX 4060 Laptop). Two of these findings repeat on all three of #3805, #3814 and #3815, so they probably do not come from this PR's own change, and I have not bisected them: (1) native_direct_mesh fails its uniform-load-offen refusal assertion, and (2) in-box WARP removes the device (0x887a0005) after the PS-less dispatch. The RTX 5080 depth readback of 0x7fff where the new fixtures expect 0x8000 looks NVIDIA-specific. It might need a one-ULP tolerance, or a depth value that is exactly representable. Full details below.


Independent verification of head f40d7a0c00a508a22dd35b4b8f8884c3dff808a9 against pinned main d2e6a4ed9fd7377ea5a01d9384a845c26ed7b5e5.
The merge stopped with 12 conflicts, including src/startup_stubs/mesh86_cache.inl and tests/startup_indirect_draw_indexed.cpp. These runs used the published head.

Windows 11 build 26200.9974. RTX 5080 driver 32.0.16.2140 (621.40). Microsoft Basic Render Driver with in-box WARP 10.0.26100.9818. DXC 1.9.2602.17 (21d28f727). The startup fixture reported the debug layer unavailable.

Commands run with $cfg set to dev and release, $python set to the project venv interpreter and XBOX2WINDOWS_ADAPTER set to NVIDIA GeForce RTX 5080.

. .\tools\dev.ps1
cmake --preset $cfg "-DINTAKE_PYTHON=$python"
cmake --build out/build/$cfg --target compile_dxil startup_indirect_draw_indexed startup_mesh86_material_backing -- -j 6
ctest --preset $cfg --no-tests=error -j 1 -R '^(startup_mesh86_|runtime_mesh86_cache_cli_check$|startup_indirect_mesh(_console|_request|_create_result)?_(warp|hardware)$|startup_indirect_mesh_(cache|lease)_|native_direct_(mesh|container)$|native_mesh_).*$' -V
$dxc = Join-Path (Get-Content "out/build/$cfg/x2w-dxc-dir.txt") dxc.exe
foreach ($adapter in "hardware","warp") {
    & $python -B tests/startup_mesh86_root_srv_check.py $dxc "out/build/$cfg/startup_indirect_draw_indexed.exe" $adapter
}

Counts are pass/fail/skip. The totals include the adapter-independent tests.

Config WARP RTX 5080 Other Total
Debug 28/1/0 26/2/0 3/1/0 57/4/0
Release 28/1/0 26/2/0 3/1/0 57/4/0
  • Debug startup_mesh86_root_srv_warp (Passed). warp positive: 128-byte root SRV bound and DispatchMesh recorded; WARP removes the device after the mesh dispatch, so the depth readback is a capability skip
  • Release startup_mesh86_root_srv_warp (Passed). warp positive: 128-byte root SRV bound and DispatchMesh recorded; WARP removes the device after the mesh dispatch, so the depth readback is a capability skip
  • The direct root-SRV checks reproduced the corresponding CTest results.
  • Separate Debug hardware replay of checks after the positive readback. reserved page pass.
  • Separate Release hardware replay of checks after the positive readback. reserved page pass.

Failure diagnostics

Debug native_direct_mesh

AssertionError: ('compiler_init_ms=20.5746\ncold_compile_and_publish_ms=12.536 bytes=4580\n', '')

Debug/Release startup_mesh86_psless_warp

map argument readback failed (HRESULT 0x887a0005)

Debug/Release startup_mesh86_psless_hardware

guest root SRV 128 bytes: pixel (0,0): got 0x00007fff, expected 0x00008000

Debug/Release startup_mesh86_root_srv_hardware

guest root SRV 128 bytes: pixel (0,0): got 0x00007fff, expected 0x00008000

Release native_direct_mesh

AssertionError: ('compiler_init_ms=16.069\ncold_compile_and_publish_ms=5.9024 bytes=4580\n', '')

native_direct_mesh failed its uniform-load-offen refusal assertion. The compiler published a shader where the fixture expected a refusal.

**@⁠timbot103** on GitHub · 2026-12-03 10:33 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3813#issuecomment-7375422751) Independent RTX 5080 + WARP run, in case a second NVIDIA data point helps (the reviewer runs here are on an RTX 4060 Laptop). Two of these findings repeat on all three of #3805, #3814 and #3815, so they probably do not come from this PR's own change, and I have not bisected them: (1) `native_direct_mesh` fails its `uniform-load-offen` refusal assertion, and (2) in-box WARP removes the device (`0x887a0005`) after the PS-less dispatch. The RTX 5080 depth readback of `0x7fff` where the new fixtures expect `0x8000` looks NVIDIA-specific. It might need a one-ULP tolerance, or a depth value that is exactly representable. Full details below. --- Independent verification of head `f40d7a0c00a508a22dd35b4b8f8884c3dff808a9` against pinned main `d2e6a4ed9fd7377ea5a01d9384a845c26ed7b5e5`. The merge stopped with 12 conflicts, including `src/startup_stubs/mesh86_cache.inl` and `tests/startup_indirect_draw_indexed.cpp`. These runs used the published head. Windows 11 build 26200.9974. RTX 5080 driver 32.0.16.2140 (621.40). Microsoft Basic Render Driver with in-box WARP 10.0.26100.9818. DXC 1.9.2602.17 (21d28f727). The startup fixture reported the debug layer unavailable. Commands run with `$cfg` set to `dev` and `release`, `$python` set to the project venv interpreter and `XBOX2WINDOWS_ADAPTER` set to `NVIDIA GeForce RTX 5080`. ```powershell . .\tools\dev.ps1 cmake --preset $cfg "-DINTAKE_PYTHON=$python" cmake --build out/build/$cfg --target compile_dxil startup_indirect_draw_indexed startup_mesh86_material_backing -- -j 6 ctest --preset $cfg --no-tests=error -j 1 -R '^(startup_mesh86_|runtime_mesh86_cache_cli_check$|startup_indirect_mesh(_console|_request|_create_result)?_(warp|hardware)$|startup_indirect_mesh_(cache|lease)_|native_direct_(mesh|container)$|native_mesh_).*$' -V $dxc = Join-Path (Get-Content "out/build/$cfg/x2w-dxc-dir.txt") dxc.exe foreach ($adapter in "hardware","warp") { & $python -B tests/startup_mesh86_root_srv_check.py $dxc "out/build/$cfg/startup_indirect_draw_indexed.exe" $adapter } ``` Counts are pass/fail/skip. The totals include the adapter-independent tests. | Config | WARP | RTX 5080 | Other | Total | |---|---:|---:|---:|---:| | Debug | 28/1/0 | 26/2/0 | 3/1/0 | 57/4/0 | | Release | 28/1/0 | 26/2/0 | 3/1/0 | 57/4/0 | - Debug `startup_mesh86_root_srv_warp` (Passed). warp positive: 128-byte root SRV bound and DispatchMesh recorded; WARP removes the device after the mesh dispatch, so the depth readback is a capability skip - Release `startup_mesh86_root_srv_warp` (Passed). warp positive: 128-byte root SRV bound and DispatchMesh recorded; WARP removes the device after the mesh dispatch, so the depth readback is a capability skip - The direct root-SRV checks reproduced the corresponding CTest results. - Separate Debug hardware replay of checks after the positive readback. reserved page pass. - Separate Release hardware replay of checks after the positive readback. reserved page pass. Failure diagnostics Debug `native_direct_mesh` ```text AssertionError: ('compiler_init_ms=20.5746\ncold_compile_and_publish_ms=12.536 bytes=4580\n', '') ``` Debug/Release `startup_mesh86_psless_warp` ```text map argument readback failed (HRESULT 0x887a0005) ``` Debug/Release `startup_mesh86_psless_hardware` ```text guest root SRV 128 bytes: pixel (0,0): got 0x00007fff, expected 0x00008000 ``` Debug/Release `startup_mesh86_root_srv_hardware` ```text guest root SRV 128 bytes: pixel (0,0): got 0x00007fff, expected 0x00008000 ``` Release `native_direct_mesh` ```text AssertionError: ('compiler_init_ms=16.069\ncold_compile_and_publish_ms=5.9024 bytes=4580\n', '') ``` `native_direct_mesh` failed its `uniform-load-offen` refusal assertion. The compiler published a shader where the fixture expected a refusal.
github-bot force-pushed github-bot/gh-3813 from f40d7a0c00 to 65c391b74c 2026-12-03 11:22:07 +00:00 Compare
Author
Owner

@⁠Leyukaka on GitHub · 2026-12-03 17:58 UTC · original · reviewed

Reviewed by reading the diff; not built or run here.

Head 858d1527, compared with main d87f8455. Thanks for the named refusal reasons and the reserved-page control; the trace row in root_srv_unmapped_reason makes this refusal much easier to triage. My main concern is that main now resolves the same root-SRV case through a stricter path, so the two need to be reconciled.

  • MUST (rebase) The branch conflicts with main. Since #3944, main's root-SRV branch in mesh86_material_buffer (main src/startup_stubs/native_mesh86.inl:679-683) snapshots an unowned root SRV through mesh86_xmem_root_snapshot (main native_mesh86.inl:559). It does so only when view.bounded_root_read is set or X2W_MESH86_MATERIAL_REFRESH is on (opt-in since #3916). That helper requires a validated XMem mapping and a 4-byte-aligned range, and refuses overlaps with live resources, aliases included (address_resource_overlap). This PR's fallback (native_mesh86.inl:400-407) would add a second snapshot with weaker checks and no gate: any readable range, gpu_written_overlap only, and no alignment check. Please route the unresolved case through the existing helper, and keep the new named reasons for the refusal side.
  • MUST The fallback does not consult bounded_root_read. When the translator could not prove that required_bytes covers every root load, a view of exactly minimum bytes turns the dynamic tail into silent zeros instead of a refusal.
  • MUST Still open from the follow-up note in the description: a range rejected by placed_buffer_range (native_mesh86.inl:372) leaves reason unset, so a readable one reaches the snapshot at native_mesh86.inl:404-406 and the crosses the placed buffer end refusal is lost. Main keeps it by requiring !range.reject before its snapshot (main native_mesh86.inl:680). Please keep the rejection ahead of the fallback and add the crossing-range negative control.
  • SHOULD The snapshot size is minimum, not rounded (native_mesh86.inl:406). buffer() refuses sizes that are not a multiple of 4 (native_mesh86.inl:466), so a non-dword minimum fails with a generic size reason; the CBV branch just below rounds with (minimum + 3) & ~3u.
  • SHOULD The earlier review's point about bounding the copy and stating whether this path is meant to be independent of the input-snapshot switch still applies at this head.
  • SHOULD tests/startup_mesh86_root_srv_check.py:87-92 prints the WARP positive case as a capability skip and the test still passes. Returning 77 there, as #3814's fixture does, would keep the skip visible in CTest. A negative control for root SRV range overlaps a GPU-written resource would also cover the new refusal.
  • SHOULD As in #3814, the RTX 5080 run reported in the comment above reads 0x7fff where startup_mesh86_root_srv_check.py:89 expects 0x8000; a ±1 tolerance or an exactly representable depth would avoid the adapter dependence.
  • Checked, no finding: gpu_written_overlap is evaluated before any guest bytes are copied (native_mesh86.inl:400); the reserved-page control expects the named refusal and a clear depth.

The branch also carries #3814's nine non-merge commits, so it would be easier to review once rebased on main after #3814.

**@⁠Leyukaka** on GitHub · 2026-12-03 17:58 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3813#pullrequestreview-6175471451) · **reviewed** Reviewed by reading the diff; not built or run here. Head `858d1527`, compared with main `d87f8455`. Thanks for the named refusal reasons and the reserved-page control; the trace row in `root_srv_unmapped_reason` makes this refusal much easier to triage. My main concern is that main now resolves the same root-SRV case through a stricter path, so the two need to be reconciled. - **MUST (rebase)** The branch conflicts with main. Since #3944, main's root-SRV branch in `mesh86_material_buffer` (main `src/startup_stubs/native_mesh86.inl:679-683`) snapshots an unowned root SRV through `mesh86_xmem_root_snapshot` (main `native_mesh86.inl:559`). It does so only when `view.bounded_root_read` is set or `X2W_MESH86_MATERIAL_REFRESH` is on (opt-in since #3916). That helper requires a validated XMem mapping and a 4-byte-aligned range, and refuses overlaps with live resources, aliases included (`address_resource_overlap`). This PR's fallback (`native_mesh86.inl:400-407`) would add a second snapshot with weaker checks and no gate: any readable range, `gpu_written_overlap` only, and no alignment check. Please route the unresolved case through the existing helper, and keep the new named reasons for the refusal side. - **MUST** The fallback does not consult `bounded_root_read`. When the translator could not prove that `required_bytes` covers every root load, a view of exactly `minimum` bytes turns the dynamic tail into silent zeros instead of a refusal. - **MUST** Still open from the follow-up note in the description: a range rejected by `placed_buffer_range` (`native_mesh86.inl:372`) leaves `reason` unset, so a readable one reaches the snapshot at `native_mesh86.inl:404-406` and the `crosses the placed buffer end` refusal is lost. Main keeps it by requiring `!range.reject` before its snapshot (main `native_mesh86.inl:680`). Please keep the rejection ahead of the fallback and add the crossing-range negative control. - **SHOULD** The snapshot size is `minimum`, not rounded (`native_mesh86.inl:406`). `buffer()` refuses sizes that are not a multiple of 4 (`native_mesh86.inl:466`), so a non-dword minimum fails with a generic size reason; the CBV branch just below rounds with `(minimum + 3) & ~3u`. - **SHOULD** The earlier review's point about bounding the copy and stating whether this path is meant to be independent of the input-snapshot switch still applies at this head. - **SHOULD** `tests/startup_mesh86_root_srv_check.py:87-92` prints the WARP positive case as a capability skip and the test still passes. Returning 77 there, as #3814's fixture does, would keep the skip visible in CTest. A negative control for `root SRV range overlaps a GPU-written resource` would also cover the new refusal. - **SHOULD** As in #3814, the RTX 5080 run reported in the comment above reads `0x7fff` where `startup_mesh86_root_srv_check.py:89` expects `0x8000`; a ±1 tolerance or an exactly representable depth would avoid the adapter dependence. - Checked, no finding: `gpu_written_overlap` is evaluated before any guest bytes are copied (`native_mesh86.inl:400`); the reserved-page control expects the named refusal and a clear depth. The branch also carries #3814's nine non-merge commits, so it would be easier to review once rebased on main after #3814.
This pull request has changes conflicting with the target branch.
  • CMakePresets.json
  • docs/experiments.md
  • src/startup_stubs/d3d12_draw.inl
  • src/startup_stubs/d3d12_xs_device.cpp
  • src/startup_stubs/mesh86_cache.inl
  • src/startup_stubs/native_mesh86.inl
  • tests/startup_indirect_draw_indexed.cpp
  • tests/startup_mesh86_psless_check.py
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3815/head:github-bot/gh-3813'
git switch 'github-bot/gh-3813'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3813'
git switch 'github-bot/gh-3813'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3813'
git switch 'github-bot/gh-3813'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3813'
git switch 'main'
git merge --squash 'github-bot/gh-3813'
git switch 'main'
git merge --ff-only 'github-bot/gh-3813'
git switch 'main'
git merge 'github-bot/gh-3813'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.