runtime: read the view heap trap log with write sharing #2011
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!2011
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2011/head"
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?
@alvaroolt on GitHub · 2026-11-24 23:02 UTC · original
alvaroolt:runtime/view-heap-shared-log-read→main· +30 −9 · 1 files · 1 commits · closed without mergingChange
startup_view_heap_hardwarefails on currentmainon any adapter that refuses the full 1,245,184-descriptor shader-visible view heap, although the stand-in logs the shortcut correctly:The -1 means the test could not open the log.
count_shortcut_linesreadsX2W_TRAP_LOGwith_wfopen_s, which denies write sharing. Since #1757,append_loginsrc/startup_stubs/trap.hkeeps the log open withFILE_APPEND_DATAwhile the module is loaded. Its comment says it shares read/write/delete "so readers and cleanup still work". The reader's open therefore fails withERROR_SHARING_VIOLATION. WARP accepts the full request and skips (77), so CI does not run this path.This change reads the log with
CreateFileWandFILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, as the other in-process trap-log readers do (startup_chad_check.cpp,startup_local_log_check.cpp,startup_storage_*). A failed open is now reported with its error code instead of as a count of -1. The stand-in is unchanged, and the test still requires exactly one shortcut line.Follow-up to #1757 (test from
c74485f5/ab1ea74a). No issue.Verification
Environment: Windows 11 10.0.26300, MSVC 14.52, Windows SDK 10.0.26100. NVIDIA GeForce RTX 5080 (10de:2c02), driver 621.24 (32.0.16.2124). AMD Radeon(TM) Graphics iGPU (1002:13c0), driver 32.0.11034.2. Microsoft WARP. D3D12 debug layer unavailable (Graphics Tools not installed).
Before, at
150c625a(main):After, on
5b7947e5plus this change (5de9b999):startup_view_heap_hardwareoversized heap accepted; shortcut logged once; 1245184 requestedstartup_view_heap_hardwarewithXBOX2WINDOWS_ADAPTER=Radeonstartup_view_heap_warpOnly the RTX 5080 exercises the shortcut on this machine, so this is the only adapter that verifies the fix.
Full suites, run on
889cd3f4plus this change:After the rebase onto
5b7947e5(which changes onlyCMakeLists.txtamong the files involved), the dev rebuild,ctest --preset dev --no-tests=error -j8 -R '^startup_'(306 tests) and the 72 Python checks had no failures.Negative controls (RTX 5080, both reverted afterwards):
FILE_SHARE_READonly, the sharing_wfopen_suses: the test fails withcannot read the trap log: error 32(ERROR_SHARING_VIOLATION). This confirms the cause of the -1.first_calls(shortcuts, 2)ind3d12_xs_device.cpp): the test fails withshortcut logged 2 times, expected 1. The once-only check still works.Evidence and follow-up
No new fixture or input. No README or docs change: no command or capability changes.
This change was AI-assisted (Claude Code); I reviewed the diff and the test results.
Checklist
@R0Y00 on GitHub · 2026-11-24 23:30 UTC · original
Thanks for reproducing the sharing failure. #2001 landed the same fix using the existing streaming reader with explicit write sharing. I reran the shortcut check on RTX and it passed. WARP skipped because it accepted the full heap. Closing this overlapping patch.
@tedin7 on GitHub · 2026-11-24 23:08 UTC · original · reviewed
Review of head
5de9b999d8(comment only, no approval).Diff: only
tests/startup_view_heap_check.cpp(+30/-9). No CMake change. The reader now opens the trap log withCreateFileWand read/write/delete sharing, so it no longer fails with a sharing violation while the stand-in holds the log open for appending. An open failure now reports the Win32 error and fails instead of returning a count. The line splitting and counting logic reads correctly. Clean-room: no third-party code, no game data.Commands executed locally:
git merge-tree --write-tree --name-only origin/main HEAD: clean, no conflictsgh pr checks 2011: Windows build and test pass, Linux Python checks pass, gfx1013 fixtures pass;/O2job skippingpython3 tests/docs_links_check.py: pass (18 files, 388 links)python3 tests/bidi_controls_check.py: passgit diff --check origin/main...HEAD: cleanx2w_pipe.py win2025 2011, build 26100, MSVC 14.44.35207, WARP), Debugdevand Release/O2: both build.startup_view_heap_warpreturned 77 in both (capability skip, not a pass). WARP accepted the full descriptor request, so the shortcut and the changed log reader did not run.Mutation check: not done. The changed reader only runs after the adapter refuses the full request, and no adapter available here does, so a mutation (for example dropping
FILE_SHARE_WRITE) could not be killed by a run that executes the code.P1: 0. P2: 0.
Result: no merge from this pass. Merge needs a run where the test actually executes (an adapter that refuses the full request) plus a killed mutation. Happy to re-check on a new head or with such a run.
AI-assisted; commands listed were executed locally.
Pull request closed