runtime: bind empty Mesh86 input views as zeros #3814
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3814
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3812"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@lambirou on GitHub · 2026-12-02 01:43 UTC · original
lambirou:codex/mesh86-geometry-streams→main· +962 −61 · 16 files · 11 commits · openWhat 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:
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:
1.0;
named "an input is in title memory outside any placed buffer" refusal.
Exact commands from the worktree:
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)e1161e43020f90d3fdgithub-bot referenced this pull request2026-12-02 07:17:19 +00:00
github-bot referenced this pull request2026-12-02 07:28:58 +00:00
@lambirou on GitHub · 2026-12-02 14:44 UTC · original · reviewed
Reviewed
acd0b64fagainst #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.
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.0x887a0005device removal; keep that condition narrow so a future WARP failure is not silently converted to 77.The PR is stacked on #3805 and #3727; merge order and rebase remain the constraint.
github-bot referenced this pull request2026-12-03 00:42:23 +00:00
@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_meshfails itsuniform-load-offenrefusal assertion, and (2) in-box WARP removes the device (0x887a0005) after the PS-less dispatch. The RTX 5080 depth readback of0x7fffwhere the new fixtures expect0x8000looks NVIDIA-specific. It might need a one-ULP tolerance, or a depth value that is exactly representable. Full details below.Independent verification of head
acd0b64f7fc743611ff8e6bf056280611fa58bf4against pinned maind2e6a4ed9fd7377ea5a01d9384a845c26ed7b5e5.The merge stopped with 13 conflicts, including
src/startup_stubs/mesh86_cache.inlandtests/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
$cfgset todevandrelease,$pythonset to the project venv interpreter andXBOX2WINDOWS_ADAPTERset toNVIDIA GeForce RTX 5080.Counts are pass/fail/skip. The totals include the adapter-independent tests.
startup_mesh86_input_stream_warpskipped after WARP device removal at the positive dispatch.startup_mesh86_input_stream_hardwarestopped at the positive depth comparison before the zero-record and unmapped controls.standin_exports_check.py. standin_exports: 471 cases, 6/6 mutations killed PASSstartup_mesh86_input_stream_warpskipped after WARP device removal at the positive dispatch.startup_mesh86_input_stream_hardwarestopped at the positive depth comparison before the zero-record and unmapped controls.standin_exports_check.py. standin_exports: 471 cases, 6/6 mutations killed PASSd3d12_xs_shimwithX2W_HAVE_DXCAPI=0passed.map argument readback failed (HRESULT 0x887a0005).map argument readback failed (HRESULT 0x887a0005).Failure diagnostics
Debug
native_direct_meshDebug/Release
startup_mesh86_input_stream_hardwareDebug/Release
startup_mesh86_psless_warpDebug/Release
startup_mesh86_psless_hardwareRelease
native_direct_meshnative_direct_meshfailed itsuniform-load-offenrefusal assertion. The compiler published a shader where the fixture expected a refusal.acd0b64f7ftofae7095121github-bot referenced this pull request2026-12-03 16:08:44 +00:00
@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 maind87f8455. 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.indirect_table_bufferwhen the decoded address is 0 (mainsrc/startup_stubs/d3d12_draw.inl:4037-4039). It keeps the decodedstride, andmesh86_material_range_refusal(mainsrc/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!addressterm forInputBufferUse::mesh86_material) may be simpler than a separatezero_records_are_nullparameter.stride = 0and 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 readwhenrequired_bytes > 16(native_mesh86.inl:494), andnative Mesh86 material buffer stride is missingwhen the register is instage.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 usesrequired_bytes8).typed_dwordcallsindirect_table_bufferwithout the new flag (native_mesh86.inl:450, reached from thetyped_buffer_srvbranch at:482), so a zero-record V# read throughbuffer_load_format_xstill refuses. If that is intended, a sentence indocs/experiments.mdwould help; otherwise a typed case would close it.tests/startup_mesh86_input_stream_check.py:86-90returns 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.0x7fffwherestartup_mesh86_input_stream_check.py:94expects0x8000. 0.5 is not exactly representable in D16, so a ±1 tolerance or an exactly representable depth would make the check adapter-independent.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.
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.Merge
Merge the changes and update on Forgejo.