tests: read the kept trap log with sharing in startup_view_heap #1994
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2001"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-24T22:54:56Z.
Problem
startup_view_heap_hardwarefails onmainon adapters that refuse the full shader-visible view heap. It fails at the second check, which counts the shortcut line inX2W_TRAP_LOG:-1 means the test could not open the log. Built on the release preset, on an NVIDIA GeForce RTX 3080 (driver 32.0.16.2124) with Windows 11 build 26200, the test passes at the first parent of the #1757 merge (
cd5508e9), fails at the merge447c38df, and still fails at1d825c18.Cause. #1757 keeps the trap log open for appending (
src/startup_stubs/trap.h,CreateFileW(..., FILE_APPEND_DATA, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, ...)). The test reads the file with_wfopen_s, and files opened withfopen_s/_wfopen_sare not shareable. The open therefore fails while the stand-in still holds its handle. Before #1757 the stand-in closed the file after every line, so the test could open it.WARP accepts 1,245,184 descriptors directly, so
startup_view_heap_warpis skipped. That is why CI did not show this.Change
count_shortcut_linesnow opens the log with_wfsopen(path, L"rb", _SH_DENYNO). Nothing else changes: no production code, and the same expectation of exactly one line.Test
Run on the same machine,
devpreset, at1ebfe511plus this commit:startup_view_heap_hardwarepasses: "oversized heap accepted; shortcut logged once; 1245184 requested". Without this commit it fails as shown above.startup_view_heap_warpis skipped (77): the adapter accepts the request.startup_local_logand its three controls pass.AI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T22:58:22Z.
Review: COMMENTED
Review of head
2c1dcdd62d86e11289d073a75ac3d8c1274dbb1f(1 file, tests/startup_view_heap_check.cpp, +5/-2).Read the whole diff. It swaps
_wfopen_sfor_wfsopen(..., _SH_DENYNO)when the test reads the trap log, so the read works while the stand-ins keep the log open for appending. No CMake change, no new dependency, clean-room. P1: 0. P2: 0.Commands executed locally:
python3 tests/docs_links_check.py: PASSpython3 tests/bidi_controls_check.py: PASSgit diff --check origin/main...HEAD: PASSgit merge-tree --write-tree --name-only origin/main HEAD: clean, no conflictsx2w_pipe.py win2025 2001 --wait 900), Debug (dev) and Release/O2: both build and exit 0, butstartup_view_heap_warpreports 0/1 passed and SKIPPED (exit 77) in both. WARP accepts the full descriptor request directly, so the shortcut path and the changedcount_shortcut_linesare never reached.Mutation check: not possible here. The changed code only runs on an adapter that refuses the full request. On WARP the test skips, so a mutation such as
_SH_DENYNO->_SH_DENYRW(the original failure) cannot be killed. A skip is not a pass, so I am not merging.CI at review time: Linux checks pass,
Build and test on Windowsstill pending,/O2skipping.Result: no defects found, no merge. To merge, show the changed read path running, for example on an adapter that refuses the full request, or a CI log where the shortcut line is counted.
AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by RenzoWit35 on 2026-11-24T23:40:07Z.
Independent verification on a second NVIDIA family, plus an AMD integrated GPU and WARP. Before and after on the same machine,
devpreset (Debug), building onlystartup_view_heap_checkat each commit.XBOX2WINDOWS_ADAPTER.1ebfe511(parent)2c1dcdd6(this PR)shortcut logged -1 times, expected 1oversized heap accepted; shortcut logged once; 1245184 requested(3/3 runs)On the 4070 Ti the stand-in measured a limit of 1,000,000 shader-visible view descriptors, the same as the RTX 3080 in the description. The trap log written by the failing run contains exactly one shortcut line. That confirms the
-1comes from the open, not from the count. The AMD integrated GPU accepts the full request, so on that adapter the test doesn't exercise the shortcut either way.Commands, per commit:
Separately, a full serial
ctest --preset devonmainat889cd3f4on this machine gave 1257/1258 passing or skipped.startup_view_heap_hardwarewas the only failure.AI-assisted (Claude Code); the runs above were executed on the hardware listed.