Repository navigation
Conversation
XCL_HEAP_FLAT=1 reads a compute program's heap memory windows without a branch (2f52333): the access runs for every lane, and a lane outside the windows or under a false guard (a buffer index past num_records, an EXEC- masked lane) had its value set to zero afterwards. But its access went to window 0's descriptor, at the address it was given, so it read window 0's memory at an address the program never reaches: the guarded form branches around it, and the HLSL accessors (409cf07) send it to the null view MEM_NULL_LOAD. The direct form now selects MEM_NULL_LOAD for it as well, so it touches no window's memory. On the RTX 5090, the retail title with XCL_HEAP_FLAT=1 hung on its first world frame (DRED: a page fault in a compute dispatch); with it off it ran past 200 s. Test: raw_loads_in_root_windows_are_branchless checks that the flat form selects the null-load view. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b7eeaa8 to
2d3e3fe
Compare
|
merge-check AI-written and posted by Foniass without a human check of each point. |
|
Ran the named Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build, The new test passes at this head; the author's red run without the fix is not repeated here. This adapter is NVIDIA, where the flat heap windows are relevant. Not tested: the full workspace suite, a GPU run showing the original fault, a title run, AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the test, wrote this report; the worktree was not modified; no game data was used. |
|
No open or merged PR makes the same change. Main (after #3500) still has AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
|
merge-check claim |
1 similar comment
|
merge-check claim |
|
merge-check |
With
XCL_HEAP_FLAT=1(heap windows on), the direct DXIL translator reads a compute program's heap memory windows without a branch (2f52333). The access runs for every lane, and a lane outside the windows or under a false guard (a buffer index pastnum_records, a lane EXEC leaves out) had its value set to zero afterwards. But its access went to window 0's descriptor, at the address it was given. So it read window 0's memory at an address the program never reaches: the guarded form branches around that access, and the HLSL accessors (409cf07) send it to the null viewMEM_NULL_LOAD. Now the direct form selectsMEM_NULL_LOADfor it too, so it touches no window's memory.Depends on #3349.
Needs #3349 for the null view to be a buffer: on main,
console_heap::shared_heaprunsfill_nullsafternull_window_viewsand writes a Texture2D null SRV overMEM_NULL_LOAD, which the HLSL accessors already select today. #3349 writes the raw-UAV null views afterfill_nulls. Kalmarv's #2428 (flat heap windows by default on NVIDIA) still has the window-0 select.Related: #2626 (a compute dispatch's GPU VA 0 fault on the first world frame), #2403, #2088.
What is in it (one commit: the test and the fix)
gpu/dxil/lower_mem.rswith_mem_i32s: the flat form selects descriptorMEM_NULL_LOADinstead of window 0 for an access outside the windows or under a false guard. Its callers only load (memory loads and the BVH node loads), so the null load view is the one.gpu/dxil/core_tests.rsraw_loads_in_root_windows_are_branchless: the flat form selects the null-load view.maind52ff48. Recompiler: direct DXIL CS/MS IR cuts (rodata skip, scalar/flat windows, wave64 mask elision, sampler waterfall) #3500 (b5973e3) touched the same lines but did not change this: its flat read still selects window 0 (sel(ok, w, 0)) for an access outside the windows. ItsFlatReadrecord keeps pointing at the descriptor-index add, which its carry rewrite changes; the null select is after that add, andokisinside(also rewritten), so the carry form keeps the null view too.Tested
2d3e3fe1(maind52ff48c+ this commit):d52ff48c+ the test only):cargo test -p xcl --lib -- raw_loads_in_root_windows_are_branchless --nocapture --test-threads=1:2d3e3fe1, the same command:cargo test --workspace --no-fail-fast -- --test-threads=4(leaving out the 3uma_drivertests that need a GPU upload segment this VM has not): 2868 passed, 6 failed, 51 ignored. SKIPPED: 28 (22 no wave64, 2 no heap windows, 3 no debug layer, 1 driver cache cannot be disabled). The 6 failures:gpu::dxil::msaa_tests::gpu_direct_image_get_resinfo_d16,title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels, the 3stream_recheck_*tests, andtest_title_runs_and_game_folder_is_untouched.d52ff48con the same machine fails the same tests:gpu_direct_image_get_resinfo_d16, the 3stream_recheck_*andtest_title_runs_and_game_folder_is_untouched. Its parallel run lost the lib binary, so its lib tests come from a one-thread rerun that left out all ofuma_driver::tests(2721 passed, 5 failed, 31 ignored); its counts are not comparable to the line above, the failing names are.XCL_HEAP_FLAT=1with heap windows, the debug layer and DRED on,XCL_PREPARE=0, 200 s. The change is in our integration build of open PRs (93d11d74: the same commit on top of it); the build under it alone (1b108007) is the "before":1b108007), the device is removed on the first world frame:93d11d74), the frame is drawn and the run ends at its timer:Regression run
RTX 5090 32 GB, driver 621.40, the retail title, 600 s each,
scripts/smoke.ps1with preparation off (XCL_PREPARE=0), each run starting from its own copy of the same translated cache (made bymain). Both runs used this machine's usual settings (XCL_UMA_WINDOWS=16,XCL_UMA_DRIVER=mixed:1536:1792,XCL_COHERENT_MB=4095,XCL_HUGE_PSO_CONCURRENCY=3),XCL_DRED=1, andXCL_SKIP_CS=95cc13288a27a96e(the compute program whose compact form hangs on RTX 50, #3516), leftXCL_HEAP_FLATunset (off, as by default), and held Enter from the first frame (the same input in both).The pair shows boot and loading with held input and no device removal in either run, and a peak commit at 101.5 % of
main's; most of each run is shader compiles with few presents, so its frame counts say nothing about speed.main9dfbe3e:this head
2d3e3fe1:Not tested
main+ this commit alone; the title's first world frame is the only place it was seen.AI use
🤖 Generated with Claude Code
https://claude.ai/code/session_013oPUFCA9W9F8Qb5MPK33bR