startup: every view call asks VirtualQuery and xmem's commit mutex before writing its 32-byte token #3096
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#3096
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@lukaslw-lab on GitHub · 2026-11-27 15:03 UTC · original
In the main executable's startup run (#870), device slot 18 (
CreateShaderResourceView) and the other view slots are called about 110,000–130,000 times per second late in the load, by five recording threads at once. Each call ends innote_view(d3d12_capture.inl), which writes a view token into the title's descriptor memory afterx2w_local::writable:commit_lazy(withX2W_XMEM_LAZY_COMMIT,x2w_xmem_commit_range, which takes xmem's commit mutex) and then aVirtualQuery. The comment onwritablesays "rare callers".The destination is always inside a registered descriptor range (
title_backedis checked first), so the write practically never faults.Windows 10 22H2, i7-4790K (4 cores, 8 threads), RTX 3080 Ti, NVIDIA 32.0.16.1047, release on
main36d2cbeb, warm shader cache, scripted input, 250 s, withX2W_D3D12_RING_RELEASE_AT_SUBMIT=1,X2W_D3D12_TABLE_ALIAS=1andX2W_D3D12_ROOT_SRV_AT_DRAW=1, two runs:writable(step timers, local build)Proposed in #3097: an opt-in
X2W_D3D12_VIEW_TOKEN_GUARDED=1that writes the token under an exception guard instead, with the same outcome for a page that refuses the write. The default stays as onmain.This report was prepared with AI assistance (Claude); the runs are mine.
@lukaslw-lab on GitHub · 2026-12-01 01:07 UTC · original
Closing together with #3097, reasons there: #3097. Can be reopened with it if a later profile shows the token write as a cost.