runtime: bind empty Mesh86 input views as zeros #3814

Open
github-bot wants to merge 11 commits from github-bot/gh-3812 into main AGit
Owner

@⁠lambirou on GitHub · 2026-12-02 01:43 UTC · original
lambirou:codex/mesh86-geometry-streams → main · +962 −61 · 16 files · 11 commits · open

What changes

The Mesh86 input path now treats a zero-record buffer descriptor as an empty
view: every element is out of bounds, so the hardware reads zero. The resolver
binds a 16-byte zero view and records the guest table, record and descriptor
once. The ordinary compute input path is unchanged and still refuses zero
records.

Request 062d66b9e013f28e reaches bind_native_mesh86 with:

stage=mesh srv=t0 root=1 table_offset=0x40 root_type=0
descriptor=00013920,00000000,00000000,00000000
reason=an input buffer descriptor has zero records

0x40 is descriptor record 2. The guest root signature parameter 1 table
declares t12 space1, t69 space1, t20 space1, t6 space1 and b0 space1, so the
empty record is SRV t20 space1. The captured mesh shader has an empty input
signature and only emits SV_Position; its guest code loads that V# with
s_load_dwordx4 s[32:35], s[10:11], 0x40 and reads from it on one branch.
NUM_RECORDS is zero, which is an empty view rather than a missing backing.

Tests

tests/startup_indirect_mesh_input_stream.hlsl is a source-built PS-less mesh
stage with a descriptor-table ByteAddressBuffer at t0 that reads two DWORDs and
emits one triangle. tests/startup_mesh86_input_stream_check.py publishes the
desktop profile and runs three cases:

  • a nonzero raw V# naming a placed 16-byte buffer writes depth 0.5;
  • a zero-record V# with a nonzero base binds 16 zero bytes and leaves depth at
    1.0;
  • a V# whose base is not backed by a placed or committed buffer keeps the
    named "an input is in title memory outside any placed buffer" refusal.

Exact commands from the worktree:

. .\tools\dev.ps1
cmake --preset release -DINTAKE_PYTHON=C:\Users\rolandedi\dev\labs\xbox-recomp\_wt\agent-mesh-scalar\out\pe-env\Scripts\python.exe
cmake --build --preset release --target compile_dxil d3d12_xs_shim startup_indirect_draw_indexed
ctest --preset release --no-tests=error -R "startup_mesh86_input_stream_hardware" --output-on-failure -V

Hardware RX 9060 XT: passed. The fixture printed its nonzero V# and the shader
wrote depth 0.5; the zero-record and unmapped controls also passed.

WARP: startup_mesh86_input_stream_warp returns 77 only when the dispatch
removes the WARP device with 0x887a0005. The existing
startup_mesh86_psless_warp fixture has the same device removal on this driver,
so the skip is a documented adapter limitation, not a silent pass. Any other
WARP failure still fails the check.

Title replay: the isolated 420 s run was stopped when the integration run took
over the title proof. Its earlier 360 s attempt did not reach the prologue mesh
bind; its compute census showed 0 translated dispatches and refusals with
"an input is in a placed buffer that does not alias title memory" before the
mesh path. The key 062d66b9e013f28e therefore has not yet been observed after
this change in a title run.

Stack

Stacked on #3805 and #3727; the branch starts at de12a89d.

Refs #3765
Refs #3643

Follow-up verification (acd0b64f)

  • python -B tests/standin_exports_check.py: 471 cases, six mutations caught.
  • CMake Release build of d3d12_xs_shim with X2W_HAVE_DXCAPI=0: passed; native-shader Release build also passed.
  • Release CTest startup_mesh86_input_stream_hardware and startup_mesh86_psless_hardware: passed on RX 9060 XT.
  • startup_mesh86_input_stream_warp: skipped after device removal; startup_mesh86_psless_warp: failed with the same 0x887a0005 device removal.
  • The PS-less fixture diagnostic was restored; the new input-stream fixture retains its separate diagnostic.
  • This branch remains stacked on #3805 and #3727 and has conflicts with current main. Title replay remains unverified.
**@⁠lambirou** on GitHub · 2026-12-02 01:43 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3812) `lambirou:codex/mesh86-geometry-streams` → `main` · +962 −61 · 16 files · 11 commits · open ## What changes The Mesh86 input path now treats a zero-record buffer descriptor as an empty view: every element is out of bounds, so the hardware reads zero. The resolver binds a 16-byte zero view and records the guest table, record and descriptor once. The ordinary compute input path is unchanged and still refuses zero records. Request 062d66b9e013f28e reaches bind_native_mesh86 with: ``` stage=mesh srv=t0 root=1 table_offset=0x40 root_type=0 descriptor=00013920,00000000,00000000,00000000 reason=an input buffer descriptor has zero records ``` 0x40 is descriptor record 2. The guest root signature parameter 1 table declares t12 space1, t69 space1, t20 space1, t6 space1 and b0 space1, so the empty record is SRV t20 space1. The captured mesh shader has an empty input signature and only emits SV_Position; its guest code loads that V# with s_load_dwordx4 s[32:35], s[10:11], 0x40 and reads from it on one branch. NUM_RECORDS is zero, which is an empty view rather than a missing backing. ## Tests tests/startup_indirect_mesh_input_stream.hlsl is a source-built PS-less mesh stage with a descriptor-table ByteAddressBuffer at t0 that reads two DWORDs and emits one triangle. tests/startup_mesh86_input_stream_check.py publishes the desktop profile and runs three cases: - a nonzero raw V# naming a placed 16-byte buffer writes depth 0.5; - a zero-record V# with a nonzero base binds 16 zero bytes and leaves depth at 1.0; - a V# whose base is not backed by a placed or committed buffer keeps the named "an input is in title memory outside any placed buffer" refusal. Exact commands from the worktree: ```powershell . .\tools\dev.ps1 cmake --preset release -DINTAKE_PYTHON=C:\Users\rolandedi\dev\labs\xbox-recomp\_wt\agent-mesh-scalar\out\pe-env\Scripts\python.exe cmake --build --preset release --target compile_dxil d3d12_xs_shim startup_indirect_draw_indexed ctest --preset release --no-tests=error -R "startup_mesh86_input_stream_hardware" --output-on-failure -V ``` Hardware RX 9060 XT: passed. The fixture printed its nonzero V# and the shader wrote depth 0.5; the zero-record and unmapped controls also passed. WARP: startup_mesh86_input_stream_warp returns 77 only when the dispatch removes the WARP device with 0x887a0005. The existing startup_mesh86_psless_warp fixture has the same device removal on this driver, so the skip is a documented adapter limitation, not a silent pass. Any other WARP failure still fails the check. Title replay: the isolated 420 s run was stopped when the integration run took over the title proof. Its earlier 360 s attempt did not reach the prologue mesh bind; its compute census showed 0 translated dispatches and refusals with "an input is in a placed buffer that does not alias title memory" before the mesh path. The key 062d66b9e013f28e therefore has not yet been observed after this change in a title run. ## Stack Stacked on #3805 and #3727; the branch starts at de12a89d. Refs #3765 Refs #3643 ## Follow-up verification (acd0b64f) - python -B tests/standin_exports_check.py: 471 cases, six mutations caught. - CMake Release build of d3d12_xs_shim with X2W_HAVE_DXCAPI=0: passed; native-shader Release build also passed. - Release CTest startup_mesh86_input_stream_hardware and startup_mesh86_psless_hardware: passed on RX 9060 XT. - startup_mesh86_input_stream_warp: skipped after device removal; startup_mesh86_psless_warp: failed with the same 0x887a0005 device removal. - The PS-less fixture diagnostic was restored; the new input-stream fixture retains its separate diagnostic. - This branch remains stacked on #3805 and #3727 and has conflicts with current main. Title replay remains unverified.
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
After the scalar bit operations, the forced slot 86 mesh path refused
v_cvt_f16_f32 in 357 requests and v_and_or_b32 in 331, ahead of the
control-flow, heap-provenance and pixel blocks.

- v_and_or_b32 (VOP3 0x371) joins the mesh vector list that already handles
  v_or3_b32 and v_add3_u32, so it takes the three-source alu_rules entry and
  lowers to (S0 & S1) | S2. The shared operand gate still refuses abs, neg,
  clamp and omod.
- v_cvt_f16_f32 (VOP1 0x0A) joins the same list and reuses the compute
  frontend's integer round-to-nearest-even narrowing: the sign comes from bit
  31, binary32 subnormals become signed zeros, binary16 subnormals are kept,
  overflow including the 65520 tie gives 0x7c00, and a NaN keeps its quiet bit.
  The encoding goes into the low half and the reaching destination value keeps
  the high half, as the compute frontend does, so an unproven destination still
  refuses and the merged word is not treated as uniform.

tests/native_direct_mesh_check.py adds source-built programs with the run
helper: v_and_or_b32 with s20 = 0x0000ffff and s21 = 0x00ff0000 exports
(and v0, 65535) | 0x00ff0000, and v_cvt_f16_f32 exports the narrowed word for
1.0f, 0.0f and -2.0f. Controls reject an unbound third source and an unproven
conversion source or destination.

Observed IR:
- %t8 = and i32 %v0, 65535 ; %t9 = or i32 %t8, 16711680
- v_cvt_f16_f32: lshr <bits>, 16 / and ... 32768 for the sign,
  and <bits>, 2147483647, lshr ... 23, and ... 8388607, the nearest-even
  narrowing with icmp ugt %exp, 142 -> 31744 and icmp ugt %mag, 2139095040 ->
  32256 | quiet bits, then or %narrow, %sign, and %destination, -65536 and the
  final or.

Verified:
- cmake --build --preset release --target compile_dxil (7/7 steps,
  compile_dxil.exe linked)
- python -B tests/native_direct_mesh_check.py <compile_dxil.exe> <dxc dir>:
  exit 0, "mesh allocation, indexed outputs, group exchange and negative
  controls passed"
- ctest --preset release --no-tests=error -R '^native_direct'
  2/2 passed: native_direct_container 15.04 s, native_direct_mesh 13.78 s
- python -B tests/docs_links_check.py: 210 files, 807 links

Refs #3703
# 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
Request 062d66b9e013f28e loads a raw V# from root parameter 1, descriptor record 2 (SRV t20 space1). The record has NUM_RECORDS zero, so every load is out of bounds and reads zero on the hardware. The Mesh86 input resolver now binds a 16-byte zero view for a zero-record descriptor and logs the guest table, record and descriptor once; the ordinary compute input path still refuses zero records.

The new source-built fixture publishes a PS-less mesh profile with an 8-byte descriptor-table SRV and writes a raw V#: a nonzero buffer must write depth 0.5, a zero-record null must read zeros, and an unmapped base must keep its named refusal. WARP currently fails startup_mesh86_input_stream_warp with a device removal after DispatchMesh (map argument readback 0x887a0005); the hardware run is still pending.
The hardware fixture now prints the raw V# base, stride and record count, and the check requires them beside the depth proof.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 01:48:27 +00:00
startup_mesh86_input_stream_warp now returns 77 only when the dispatch removes the WARP device with 0x887a0005, the same failure the existing startup_mesh86_psless_warp fixture has. Any other failure still fails the check; the RX 9060 XT run proves the bind.
The prologue request 062d66b9e013f28e binds root parameter 1 record 2 (t20 space1) with NUM_RECORDS zero. Document the null-view binding, the source-built controls, the RX 9060 XT pass and the WARP device-removal skip.
Author
Owner

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

Reviewed acd0b64f against #3805; read the Mesh86 input delta and fixture, not built here.

Verdict: approve. The zero-record descriptor is now treated as an empty view only for the Mesh86 material/input path: the resolver allocates a 16-byte zero upload, records the table, record and descriptor once, and leaves the ordinary compute input path refusing zero records. The unmapped control still refuses by name.

  • NIT The log path indexes pass.view_tables[source.root_parameter] without a local bounds check. The source view is already validated before this point, so this is safe today; a guard or a comment would make the invariant explicit.
  • NIT The WARP skip is correctly limited to the documented 0x887a0005 device removal; keep that condition narrow so a future WARP failure is not silently converted to 77.
  • Checked, no finding: a nonzero V# still binds its placed buffer and writes depth 0.5; a zero-record V# binds zeros and leaves the depth clear; an unmapped base keeps the named refusal. The new enum value does not change the compute path.

The PR is stacked on #3805 and #3727; merge order and rebase remain the constraint.

**@⁠lambirou** on GitHub · 2026-12-02 14:44 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3812#pullrequestreview-6153051559) · **reviewed** Reviewed `acd0b64f` against #3805; read the Mesh86 input delta and fixture, not built here. **Verdict: approve.** The zero-record descriptor is now treated as an empty view only for the Mesh86 material/input path: the resolver allocates a 16-byte zero upload, records the table, record and descriptor once, and leaves the ordinary compute input path refusing zero records. The unmapped control still refuses by name. - **NIT** The log path indexes `pass.view_tables[source.root_parameter]` without a local bounds check. The source view is already validated before this point, so this is safe today; a guard or a comment would make the invariant explicit. - **NIT** The WARP skip is correctly limited to the documented `0x887a0005` device removal; keep that condition narrow so a future WARP failure is not silently converted to 77. - Checked, no finding: a nonzero V# still binds its placed buffer and writes depth 0.5; a zero-record V# binds zeros and leaves the depth clear; an unmapped base keeps the named refusal. The new enum value does not change the compute path. The PR is stacked on #3805 and #3727; merge order and rebase remain the constraint.
Author
Owner

@⁠timbot103 on GitHub · 2026-12-03 10:34 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 acd0b64f7fc743611ff8e6bf056280611fa58bf4 against pinned main d2e6a4ed9fd7377ea5a01d9384a845c26ed7b5e5.
The merge stopped with 13 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
& $python -B tests/standin_exports_check.py
cmake --preset release -B out/build/release-no-dxc -DX2W_HAVE_DXCAPI=0 "-DINTAKE_PYTHON=$python"
cmake --build out/build/release-no-dxc --target d3d12_xs_shim -- -j 6

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

Config WARP RTX 5080 Other Total
Debug 27/1/1 26/2/0 3/1/0 56/4/1
Release 27/1/1 26/2/0 3/1/0 56/4/1
  • Debug startup_mesh86_input_stream_warp skipped after WARP device removal at the positive dispatch.
  • Debug startup_mesh86_input_stream_hardware stopped at the positive depth comparison before the zero-record and unmapped controls.
  • Debug standin_exports_check.py. standin_exports: 471 cases, 6/6 mutations killed PASS
  • Release startup_mesh86_input_stream_warp skipped after WARP device removal at the positive dispatch.
  • Release startup_mesh86_input_stream_hardware stopped at the positive depth comparison before the zero-record and unmapped controls.
  • Release standin_exports_check.py. standin_exports: 471 cases, 6/6 mutations killed PASS
  • The separate Release build of d3d12_xs_shim with X2W_HAVE_DXCAPI=0 passed.
  • Separate Debug warp replay of checks after the positive readback. zero skip, unmapped pass. map argument readback failed (HRESULT 0x887a0005).
  • Separate Debug hardware replay of checks after the positive readback. zero pass, unmapped pass.
  • Separate Release warp replay of checks after the positive readback. zero skip, unmapped pass. map argument readback failed (HRESULT 0x887a0005).
  • Separate Release hardware replay of checks after the positive readback. zero pass, unmapped pass.

Failure diagnostics

Debug native_direct_mesh

AssertionError: ('compiler_init_ms=18.3839\ncold_compile_and_publish_ms=5.657 bytes=4580\n', '')

Debug/Release startup_mesh86_input_stream_hardware

Mesh86 input stream: pixel (0,0): got 0x00007fff, expected 0x00008000

Debug/Release startup_mesh86_psless_warp

map argument readback failed (HRESULT 0x887a0005)

Debug/Release startup_mesh86_psless_hardware

PS-less root SRV: pixel (0,0): got 0x00007fff, expected 0x00008000

Release native_direct_mesh

AssertionError: ('compiler_init_ms=16.1737\ncold_compile_and_publish_ms=4.3803 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:34 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3812#issuecomment-7375423803) 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 `acd0b64f7fc743611ff8e6bf056280611fa58bf4` against pinned main `d2e6a4ed9fd7377ea5a01d9384a845c26ed7b5e5`. The merge stopped with 13 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 & $python -B tests/standin_exports_check.py cmake --preset release -B out/build/release-no-dxc -DX2W_HAVE_DXCAPI=0 "-DINTAKE_PYTHON=$python" cmake --build out/build/release-no-dxc --target d3d12_xs_shim -- -j 6 ``` Counts are pass/fail/skip. The totals include the adapter-independent tests. | Config | WARP | RTX 5080 | Other | Total | |---|---:|---:|---:|---:| | Debug | 27/1/1 | 26/2/0 | 3/1/0 | 56/4/1 | | Release | 27/1/1 | 26/2/0 | 3/1/0 | 56/4/1 | - Debug `startup_mesh86_input_stream_warp` skipped after WARP device removal at the positive dispatch. - Debug `startup_mesh86_input_stream_hardware` stopped at the positive depth comparison before the zero-record and unmapped controls. - Debug `standin_exports_check.py`. standin_exports: 471 cases, 6/6 mutations killed PASS - Release `startup_mesh86_input_stream_warp` skipped after WARP device removal at the positive dispatch. - Release `startup_mesh86_input_stream_hardware` stopped at the positive depth comparison before the zero-record and unmapped controls. - Release `standin_exports_check.py`. standin_exports: 471 cases, 6/6 mutations killed PASS - The separate Release build of `d3d12_xs_shim` with `X2W_HAVE_DXCAPI=0` passed. - Separate Debug warp replay of checks after the positive readback. zero skip, unmapped pass. `map argument readback failed (HRESULT 0x887a0005)`. - Separate Debug hardware replay of checks after the positive readback. zero pass, unmapped pass. - Separate Release warp replay of checks after the positive readback. zero skip, unmapped pass. `map argument readback failed (HRESULT 0x887a0005)`. - Separate Release hardware replay of checks after the positive readback. zero pass, unmapped pass. Failure diagnostics Debug `native_direct_mesh` ```text AssertionError: ('compiler_init_ms=18.3839\ncold_compile_and_publish_ms=5.657 bytes=4580\n', '') ``` Debug/Release `startup_mesh86_input_stream_hardware` ```text Mesh86 input stream: pixel (0,0): got 0x00007fff, expected 0x00008000 ``` Debug/Release `startup_mesh86_psless_warp` ```text map argument readback failed (HRESULT 0x887a0005) ``` Debug/Release `startup_mesh86_psless_hardware` ```text PS-less root SRV: pixel (0,0): got 0x00007fff, expected 0x00008000 ``` Release `native_direct_mesh` ```text AssertionError: ('compiler_init_ms=16.1737\ncold_compile_and_publish_ms=4.3803 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-3812 from acd0b64f7f to fae7095121 2026-12-03 11:15:03 +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 cb780309, compared with main d87f8455. Thanks for the write-up and the three-case fixture. Treating a zero-record V# as an empty view is the right model, and leaving the ordinary compute path refusing is the right scope. The points below are mostly about how this lands on current main, which has changed the same function.

  • MUST (rebase) The branch conflicts with main. Main already returns a zero view for the Mesh86 use in indirect_table_buffer when the decoded address is 0 (main src/startup_stubs/d3d12_draw.inl:4037-4039). It keeps the decoded stride, and mesh86_material_range_refusal (main src/startup_stubs/native_mesh86.inl:709-715) skips the minimum-read check for source 3. This PR's branch (d3d12_draw.inl:3097-3098) covers what main still refuses: a nonzero base with zero records. Extending main's existing condition (relaxing its !address term for InputBufferUse::mesh86_material) may be simpler than a separate zero_records_are_null parameter.
  • MUST The new branch returns stride = 0 and 16 bytes (d3d12_draw.inl:3098). With this PR's binder, a zero-record V# then refuses later in three cases: indexed raw SRV record stride mismatch (native_mesh86.inl:490), material buffer is smaller than the shader's minimum read when required_bytes > 16 (native_mesh86.inl:494), and native Mesh86 material buffer stride is missing when the register is in stage.strides (native_mesh86.inl:546). Main's version avoids the first and second by keeping the stride and exempting source 3. Please carry both over in the rebase, and add a fixture case with a nonzero stride and a minimum read above 16 bytes (the current one uses required_bytes 8).
  • SHOULD typed_dword calls indirect_table_buffer without the new flag (native_mesh86.inl:450, reached from the typed_buffer_srv branch at :482), so a zero-record V# read through buffer_load_format_x still refuses. If that is intended, a sentence in docs/experiments.md would help; otherwise a typed case would close it.
  • SHOULD tests/startup_mesh86_input_stream_check.py:86-90 returns 77 on WARP device removal before the zero-record and unmapped controls run. If those two controls do not need the positive readback, running them first would keep the bind and refusal checks covered on WARP.
  • SHOULD The RTX 5080 run reported in the comment above reads 0x7fff where startup_mesh86_input_stream_check.py:94 expects 0x8000. 0.5 is not exactly representable in D16, so a ±1 tolerance or an exactly representable depth would make the check adapter-independent.
  • Checked, no finding: the ordinary compute path still refuses zero records (the flag defaults to false); the new log is bounded to 64 entries and written under draw_lock; no guest bytes are read from the base when the record count is zero; the unmapped control still expects its named refusal.

#3727 and #3805 have both merged, so the rebase on main is the main remaining step.

**@⁠Leyukaka** on GitHub · 2026-12-03 17:58 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/3812#pullrequestreview-6175470122) · **reviewed** Reviewed by reading the diff; not built or run here. Head `cb780309`, compared with main `d87f8455`. Thanks for the write-up and the three-case fixture. Treating a zero-record V# as an empty view is the right model, and leaving the ordinary compute path refusing is the right scope. The points below are mostly about how this lands on current main, which has changed the same function. - **MUST (rebase)** The branch conflicts with main. Main already returns a zero view for the Mesh86 use in `indirect_table_buffer` when the decoded address is 0 (main `src/startup_stubs/d3d12_draw.inl:4037-4039`). It keeps the decoded `stride`, and `mesh86_material_range_refusal` (main `src/startup_stubs/native_mesh86.inl:709-715`) skips the minimum-read check for source 3. This PR's branch (`d3d12_draw.inl:3097-3098`) covers what main still refuses: a nonzero base with zero records. Extending main's existing condition (relaxing its `!address` term for `InputBufferUse::mesh86_material`) may be simpler than a separate `zero_records_are_null` parameter. - **MUST** The new branch returns `stride = 0` and 16 bytes (`d3d12_draw.inl:3098`). With this PR's binder, a zero-record V# then refuses later in three cases: `indexed raw SRV record stride mismatch` (`native_mesh86.inl:490`), `material buffer is smaller than the shader's minimum read` when `required_bytes > 16` (`native_mesh86.inl:494`), and `native Mesh86 material buffer stride is missing` when the register is in `stage.strides` (`native_mesh86.inl:546`). Main's version avoids the first and second by keeping the stride and exempting source 3. Please carry both over in the rebase, and add a fixture case with a nonzero stride and a minimum read above 16 bytes (the current one uses `required_bytes` 8). - **SHOULD** `typed_dword` calls `indirect_table_buffer` without the new flag (`native_mesh86.inl:450`, reached from the `typed_buffer_srv` branch at `:482`), so a zero-record V# read through `buffer_load_format_x` still refuses. If that is intended, a sentence in `docs/experiments.md` would help; otherwise a typed case would close it. - **SHOULD** `tests/startup_mesh86_input_stream_check.py:86-90` returns 77 on WARP device removal before the zero-record and unmapped controls run. If those two controls do not need the positive readback, running them first would keep the bind and refusal checks covered on WARP. - **SHOULD** The RTX 5080 run reported in the comment above reads `0x7fff` where `startup_mesh86_input_stream_check.py:94` expects `0x8000`. 0.5 is not exactly representable in D16, so a ±1 tolerance or an exactly representable depth would make the check adapter-independent. - Checked, no finding: the ordinary compute path still refuses zero records (the flag defaults to false); the new log is bounded to 64 entries and written under `draw_lock`; no guest bytes are read from the base when the record count is zero; the unmapped control still expects its named refusal. #3727 and #3805 have both merged, so the rebase on main is the main remaining step.
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/3814/head:github-bot/gh-3812'
git switch 'github-bot/gh-3812'

Merge

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