runtime: resolve readable guest Mesh86 root SRVs #3815
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!3815
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3813"
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:51 UTC · original
lambirou:codex/mesh86-root-srv-128→main· +1191 −67 · 19 files · 14 commits · openProblem
After #3812, the focus run reaches the prologue and key
13c660ac281d07d5passes the 18-byte materialt0, then refuses att1 root=3:The four
DispatchMeshcalls 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
root SRV has no mapped bufferwith a named reason and a boundedX2W_D3D12_TRACE_DIRECT_MESHrow carrying the address, readability,VirtualQuerystate/type, placement result and resource-index result. A reserved page now reportsroot SRV range is not readable in title memory.Tests
tests/startup_mesh86_root_srv_check.pypublishes a PS-less profile 6 with one 128-byte root SRV, then runsstartup_indirect_draw_indexedtwice:0x40; the mesh stage reads dwords 0 and 124 and writes depth 0.5.Results on this worktree (
f40d7a0c):0x8000); negative refused by name with depth clear.DispatchMeshis recorded; WARP then removes the device after the mesh dispatch (0x887a0005), so the depth readback is a capability skip. The negative control passes.Focus title
The previous focus run stopped at the old
root SRV has no mapped bufferrefusal. 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.
e1161e43020f90d3fdgithub-bot referenced this pull request2026-12-02 02:38:28 +00:00
@lambirou on GitHub · 2026-12-02 14:44 UTC · original · reviewed
Reviewed
f40d7a0cagainst #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.
minimumthat is readable, without applying the existing 16 MiB snapshot bound or consultingtitle_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.root_srv_unmapped_reasonkeeps a process-widestatic std::vectorfor 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.gpu_written_overlapis 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.@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_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
f40d7a0c00a508a22dd35b4b8f8884c3dff808a9against pinned maind2e6a4ed9fd7377ea5a01d9384a845c26ed7b5e5.The merge stopped with 12 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_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 skipstartup_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 skipFailure diagnostics
Debug
native_direct_meshDebug/Release
startup_mesh86_psless_warpDebug/Release
startup_mesh86_psless_hardwareDebug/Release
startup_mesh86_root_srv_hardwareRelease
native_direct_meshnative_direct_meshfailed itsuniform-load-offenrefusal assertion. The compiler published a shader where the fixture expected a refusal.f40d7a0c00to65c391b74c@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 maind87f8455. Thanks for the named refusal reasons and the reserved-page control; the trace row inroot_srv_unmapped_reasonmakes 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.mesh86_material_buffer(mainsrc/startup_stubs/native_mesh86.inl:679-683) snapshots an unowned root SRV throughmesh86_xmem_root_snapshot(mainnative_mesh86.inl:559). It does so only whenview.bounded_root_readis set orX2W_MESH86_MATERIAL_REFRESHis 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_overlaponly, and no alignment check. Please route the unresolved case through the existing helper, and keep the new named reasons for the refusal side.bounded_root_read. When the translator could not prove thatrequired_bytescovers every root load, a view of exactlyminimumbytes turns the dynamic tail into silent zeros instead of a refusal.placed_buffer_range(native_mesh86.inl:372) leavesreasonunset, so a readable one reaches the snapshot atnative_mesh86.inl:404-406and thecrosses the placed buffer endrefusal is lost. Main keeps it by requiring!range.rejectbefore its snapshot (mainnative_mesh86.inl:680). Please keep the rejection ahead of the fallback and add the crossing-range negative control.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.tests/startup_mesh86_root_srv_check.py:87-92prints 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 forroot SRV range overlaps a GPU-written resourcewould also cover the new refusal.0x7fffwherestartup_mesh86_root_srv_check.py:89expects0x8000; a ±1 tolerance or an exactly representable depth would avoid the adapter dependence.gpu_written_overlapis 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.
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.