Repository navigation
Conversation
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 |
bmjask
left a comment
There was a problem hiding this comment.
Review of 2d3e3fe1: 2 finding(s). 1 are inline. These are on lines outside the diff:
crates/xcl/src/gpu/dxil/lower_mem.rs:1191: scalar_flat_read, the flat s_buffer_load path from #3500, still computes slot = sel(valid, w, 0) + MEM_HEAP_BASE, so an out-of-window access still reads window 0's descriptor, the root cause this PR fixes in with_mem_i32s. Under XCL_HEAP_FLAT=1, an s_buffer_load whose V# high word is outside the windows still runs rawBufferLoad on window 0 (only masked afterwards by lim = 0). raw_loads_in_root_windows_are_branchless includes S_BUFFER_LOAD_DWORDX4 and still passes because it only checks that some select uses , i32 20. high_one_slot (lower_window.rs:170) has the same window-0 fallback, so a shared heap_load_slot(ok, w) returning sel(ok, w + MEM_HEAP_BASE, MEM_NULL_LOAD) used at all three sites would fix them together.
These findings come from an AI-assisted review (Claude Code) and focus on correctness. Each is a candidate; please check it before acting on it.
| if let (Some((hi, (valid1, slot1))), Value::Inst(test), Value::Inst(slot)) = (carry_case, inside, i) { | ||
| self.s.m.flat_reads.push(super::module::FlatRead { hi, test, slot, valid1, slot1 }); | ||
| } | ||
| let null = self.c(crate::gpu::recomp::MEM_NULL_LOAD); |
There was a problem hiding this comment.
Flat reads now index MEM_NULL_LOAD (descriptor 20) as a RWByteAddressBuffer, but on main that slot holds a Texture2D null SRV. console_heap::shared_heap runs null_window_views (line 503) before fill_nulls(MEM_HEAP_BASE..cap) (line 511), which copies an even-index Texture2D SRV over slot 20. That ordering is fixed in #3349, which is still open, and this branch isn't stacked on it. If this merges first, with XCL_HEAP_FLAT=1 and heap windows on, any lane with VAR_WIN >= mems.len() or a false EXEC/num_records guard creates a raw-buffer UAV handle from a Texture2D SRV descriptor. That descriptor-type mismatch is undefined: garbage reads, a GBV error, or device removal. The regression run at 2d3e3fe had XCL_HEAP_FLAT unset, so this path wasn't exercised. Stacking on #3349, or including its 3-line reorder here, would make it safe to merge alone.
2d3e3fe to
df2d4d0
Compare
|
Follow-up review (head df2d4d0, since 2d3e3fe, diff read, not a merge-check; checks red):
New:
Fine: the null select comes after the descriptor-index add, so after the carry rewrite a lane with no valid window still gets AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
merge-check
main (base): this PR merged into base: verdict: not yet: merge after #3349 (on main today |
|
@Pipodi thanks for picking this up; a heads-up so your merge-check isn't wasted: a new head is coming shortly. It adds bmjask's last point ( AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen. |
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. The scalar flat read (s_buffer_load in the flat form, `scalar_flat_read`) picked window 0 the same way for an address outside the windows; it takes the null view too (its dwords were and are masked as well), and so does the carry case's slot for a high dword of one (`high_one_slot`). 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, and, for a program of one s_buffer_load alone, that the scalar flat read does (it fails without the scalar change). the_flat_read_carry_rewrite_keeps_the_null_select (module/opt.rs) checks that the optimizer's FlatRead carry rewrite turns the read's bounds test and slot into carry selects and leaves its null select in place. Stacked on xcl-dev#3349: MEM_NULL_LOAD is only the null view once xcl-dev#3349 writes it after fill_nulls in shared_heap; before that, descriptor 20 holds a Texture2D null SRV. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
df2d4d0 to
87c10e6
Compare
|
@Pipodi the new head is pushed: AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen. |
|
Follow-up review (head 87c10e6, since df2d4d0, diff read, not a merge-check; checks red):
New: none. AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
@Pipodi @Foniass New head AI use: an agent swarm: Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.2-Sol, Gemini 4 Neon and Gemini 4 Hydrogen. |
|
merge-check
main (base): this PR merged into base: extra, this PR merged into base with XCL_HEAP_WINDOWS=1 XCL_HEAP_FLAT=1: verdict: safe to merge (it lands #3349's commit too: merge #3349 first or close it as included) |
|
@Prime1997 could you take a look at this one for review and merge? My automated review notes are above, if any. |
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.Stacked on #3349: the branch is
main1c8b5514+ #3349's commit unchanged (42bd1090, Kalmarv) + this PR's commit87c10e69; only the top commit belongs here.It 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,
87c10e69: the fixes and their tests)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/lower_mem.rsscalar_flat_read(the flats_buffer_loadpath from Recompiler: direct DXIL CS/MS IR cuts (rodata skip, scalar/flat windows, wave64 mask elision, sampler waterfall) #3500) andgpu/dxil/lower_window.rshigh_one_slot(the carry case's slot for a high dword of one): an address outside the windows takesMEM_NULL_LOADtoo, not window 0 (bmjask's review). The scalar read's dwords stay masked as before.gpu/dxil/core_tests.rsraw_loads_in_root_windows_are_branchless: the flat form selects the null-load view, and a program of ones_buffer_loadalone does too (that part fails without thescalar_flat_readchange).gpu/dxil/module/opt.rsthe_flat_read_carry_rewrite_keeps_the_null_select: the optimizer'sFlatReadcarry rewrite turns the read's bounds test and slot into carry selects and leaves its null select in place (Foniass's review).main1c8b551, stacked on D3D12.X: write MEM_NULL_LOAD/MEM_NULL_STORE raw UAVs after fill_nulls in shared_heap #3349. Before that, onmaind52ff48: 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
87c10e69(main1c8b5514+ D3D12.X: write MEM_NULL_LOAD/MEM_NULL_STORE raw UAVs after fill_nulls in shared_heap #3349's commit + this commit):cargo test --workspace --no-fail-fast -- --test-threads=4: 2903 passed, 5 failed, 51 ignored. The 5 fail onmain1c8b5514too:title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels, the 3stream_recheck_*tests, and e2etest_title_runs_and_game_folder_is_untouched. SKIPPED: 28 (22 no wave64, 2 no heap windows, 3 no debug layer, 1 driver cache cannot be disabled). The run leaves out the 3uma_drivertests, as every run on this VM.scalar_flat_readchange (the test commit alone onmain1c8b5514):scalar flat heap reads must select the null-load view (descriptor 20),test result: FAILED. 0 passed; 1 failed; green with it:test result: ok. 1 passed; 0 failed.-- the_flat_read_carry_rewrite_keeps_the_null_select: 1 passed, 0 failed.2d3e3fe1(maind52ff48c+ the first fix), same machine: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, 600 s each, JIT (
XCL_PREPARE=0), seeded profile and held Enter. The main block is reused from the earlier gate-batch-t pair and was validated against the full main SHA and network line. Heap windows were on, butXCL_HEAP_FLATwas unset, so this smoke checks the default path rather than the opt-in path changed here. Head frames are 114% of main and peak commit is 102.2% of main; both are within the smoke limits.main
1c8b5514(reused block):#3486 head
87c10e69:Not tested
main+ this commit alone; the title's first world frame is the only place it was seen.XCL_HEAP_FLAT=1at this head.AI use
🤖 Generated with Claude Code