Repository navigation
Recompiler: heap-window shaders reach all 16 window slots of the heap - #3096
CharlyRien wants to merge 3 commits into
Conversation
|
Tested Clean
3 passed, 0 failed, 0 ignored, 0 runtime skips. Each process exited 0 with 2,030 tests filtered out. Not tested GPU workloads, full DXIL emission and validation, the benchmark, the base revision, the #3097 stack, retail titles, or the full suite. AI use T3 Code through the Codex harness ( |
|
Ran the all-window-slot test at Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, 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. Both matching tests pass, covering the 16-slot heap-window bound in the expanded layout. They are translation-level tests; I did not enable Not tested: a real session with AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used. |
|
@Aniseto thanks for running the slot-bound tests on AI use: Claude Code, model Claude Opus 5.5, read the thread and wrote this reply. |
|
Second-machine smoke pair (RTX 3060 12 GB) for #3097's head AI use: Claude Code (Claude Opus 5.5) ran the smoke runs and wrote this note. |
|
High-slot execution on the new One 64-lane dispatch spread loads, stores and atomic adds across 16 distinguishable windows. Each had 1 MiB of backing and a different input marker at each lane offset. Lane 63 instead used an out-of-range window whose low four bits match slot 15. Its load and returning atomic read zero and its store left every destination untouched.
This covers divergent shader access and real GPU readback, including slots 8–15. The runner supplied the descriptors; title discovery, sparse uploads, graphics stages and retail smoke were outside this fixture. AI use: OpenAI Codex adapted the fixture, ran both translations, and prepared this report. |
8956fb4 to
03580be
Compare
|
Rebased on What changed in the rebase:
For comparison, The branch merges with Setup: RTX 3090 24 GB (Resizable BAR off), driver 616.56, Ryzen 9 5950X, 32 GB RAM, Windows 11 22631, Rust 1.100.0, release tests, AI use: Claude Code with Claude Opus 5.5 did the rebase, ran the tests and wrote this. The person running these tests asked for it. |
|
The red "Build and test" on AI use: Claude Code with Claude Opus 5.5 read the CI log and wrote this. |
With XCL_HEAP_WINDOWS=1 a translated program takes memory window k from descriptor MEM_HEAP_BASE + k of the shared heap, and both translators stop at the unified block's own window count (an address past it reads 0). The heap already reserves MAX_HEAP_WINDOWS (16) window slots, but only the layout's windows are written; the others were never read. Both translators now let a heap-window program select any of the 16 slots (HLSL: mem_accessors; direct DXIL: lower_mem::heap_window_bound, translator version 13), and set_window_views gives every slot past the layout's windows a null UAV, which reads 0 and drops writes, as the old bound did. The test runner's heap (run_in_arena) does the same. Nothing changes for a title: an address outside the windows still reads 0. It lets memory XCL maps into those slots later (the title's memory outside the unified block) be read without translating the shaders again. Main already gives a `(0, 0)` window and the slots up to 4 null views; this extends that to the 16 slots (set_window_views writes MAX_HEAP_WINDOWS views, the completeness rule still follows the layout). Tests: the HLSL bound for 2 / 4 / 8 / 16 windows and without heap windows, the direct bound, the null views set_window_views makes for 1, 8 and 16 windows. gpu_heap_windows_reject_out_of_uma_aliasing and gpu_heap_windows_divergent_lanes_match_switch_form read window 4 of a 2-window arena: a null slot now. Ported from the lab tree where MacieGx made the shader side reach the slots past the unified block (HLSL and direct DXIL). Co-Authored-By: CharlyRien <9572419+CharlyRien@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- runner::dispatch_with (the backend-hook PSOs of gpu_compute_e2e): heap slots 0..MAX_WINDOWS stay views of `mem`, as the root form's four windows, and the slots past them are null views, as run_in_arena and the runtime. - heap_windows_select_every_heap_slot: the case without heap windows now checks the switch over the program's own windows (case 1 present, case 2 absent, no descriptor heap), instead of an assertion that held by construction. From an independent review of the PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gpu::uma::tests::expanded_heap_window_shaders_translate_and_validate asserted that the HLSL heap accessors range-check against the program's own window count (8); with the previous commits a heap-window program selects every heap window slot, so the bound is 16 for 8 and 16 windows alike. Found by the full suite on this PR's head. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
03580be to
370e1c7
Compare
|
Rebased on Read, CI: the 4 Description refreshed (Tested, Regression run, AI use). Stack: RTX 3090 24 GB (Resizable BAR off), driver 616.56, Ryzen 9 5950X, 32 GB RAM, Windows 11 22631; Rust 1.100.0, release tests, AI use: rebase, test runs and this comment done with Claude Code (Claude Opus 5.5), checked by me. |
With
XCL_HEAP_WINDOWS=1a translated program takes memory window k from descriptorMEM_HEAP_BASE + kof the shared heap. The heap already reserves 16 window slots (MAX_HEAP_WINDOWS), but both translators stop at the unified block's own window count, and only the layout's windows are written.This PR lets a heap-window program select all 16 slots, and gives the slots past the layout's windows null views. Nothing changes for a title: an address outside the windows still reads 0 and drops its writes. It prepares for memory that XCL maps into those slots later, without translating the shaders again. That is the next PR, the title's GPU-view memory (#3097), stacked on this one.
Still not on
main7a649b0:lower_mem.rsbounds the window index byself.mems.len(),set_window_viewswriteswindows.len().max(MAX_WINDOWS)views, andrunner::run_in_regionclamps to the arena's windows. #1695 and #2427 (both open, both conflicting withmain) change the same accessors to drop the guard; neither raises the bound to the 16 slots.What is in it
First commit (@MacieGx's, ported from his tree onto current
main):crates/xcl/src/gpu/recomp/emit.rs: the heap accessors test the window index against 16, not against the program's window count. Out-of-window accesses go to the null descriptors (MEM_NULL_LOAD/MEM_NULL_STORE); the bound sits before that select.crates/xcl/src/gpu/dxil/lower_mem.rs: the same bound on the direct path (heap_window_bound), including the direct flat-heap path.crates/xcl/src/gpu/dxil/kernel.rs:TRANSLATOR_VERSIONgoes from 12 to 13.crates/xcl/src/hle/d3d12x/console_heap.rs:mainalready gives a(0, 0)window and the slots up to 4 null views;set_window_viewsnow writes null raw UAVs up to all 16 slots. The completeness rule still follows the layout.crates/xcl/src/gpu/recomp/runner.rs: the test runner's heap (run_in_region) does the same.set_window_viewsmakes for 1, 8 and 16 windows.Second commit (from an independent review):
runner.rs(dispatch_with, the backend-hook pipelines ofgpu_compute_e2e): heap slots 0..3 stay views ofmem, as the root form's four windows, and the slots past them are null views, asrun_in_regionand the runtime.Third commit (found by the full suite on an earlier head):
gpu::uma::tests::expanded_heap_window_shaders_translate_and_validateasserted the old bound (the program's 8 windows); it now checks the 16-slot bound.8 files, +88 / −18 for the three commits. The translator identity changes (the HLSL text and the direct translator's version), so every shader is translated once more.
Tested
370e1c7onmain7a649b0(rebased 29/11, no conflict). RTX 3090 24 GB (Resizable BAR off), driver 616.56, Ryzen 9 5950X, 32 GB RAM, Windows 11 22631; Rust 1.100.0, release tests.XCL_ADAPTER=warp, so the GPU tests run on WARP or skip;XCL_REQUIRE_GPUunset; the tests that open the hardware adapter whateverXCL_ADAPTERsays left out with--skip):cargo test --release -p xcl --lib -- gpu::dxil::core_tests gpu::recomp::heap_window_tests gpu::uma::tests hle::d3d12x::console_heap::tests shaders::pipeline_library::tests shaders::warm_library::tests --test-threads=4: 79 passed, 7 failed, 1 ignored; 14 of the passes are GPU tests that skipped. The 7 failures are 6shaders::pipeline_library::testsandshaders::warm_library::tests::cold_publish_makes_an_unchanged_corpus_reusable:CreateComputePipelineStatereturns E_INVALIDARG on this machine's WARP, which has no SM 6.6 (the other 6 then fail on the poisoned lock or the same error). That is a local artefact of a WARP run here, not the CI failure (an entry count, 3 against 2). This PR's tests passed:heap_windows_select_every_heap_slot(HLSL and direct),expanded_heap_window_shaders_translate_and_validate, the 22console_heaptests run; its GPU tests (gpu_heap_windows_*) skipped ("no GPU").main7a649b0: the same 7 failures with the same errors, nothing else failed (408 passed, 7 failed, 19 ignored for the union of the filters of our five PRs).main7a649b0(no new one).03580be) was 4 tests outside it:shaders::pipeline_library::tests::{builder_deduplicates_names_and_atomically_replaces_output, graphics_pipeline_round_trips_through_serialized_library, mesh_pipeline_round_trips_through_serialized_library}andshaders::warm_library::tests::cold_publish_makes_an_unchanged_corpus_reusable.main's own CI failed the same 4 on227d2cb(run 46201186646); they passed onmainfa20459,d8bd9a3and7a649b0.main7a649b0's CI fails 8 other tests, all inhle::d3d12x::title_textures::tests(run 46261846646): a red Build and test on this head with those 8 ismain's.8956fb4onmaine429936.cargo test --workspace --no-fail-fast -- --test-threads=4(debug, same machine): 2128 passed, 9 failed, 48 ignored. The 9 are the 9 testsmaine429936itself failed on a GPU, the same names as in this report on an RTX 4080. The tests this PR adds or changes passed, among themgpu_heap_windows_reject_out_of_uma_aliasingandgpu_heap_windows_divergent_lanes_match_switch_form, which read window 4 of a 2-window arena through a null slot.8956fb4d:heap_windows_select_every_heap_slot, "2 passed; 0 failed"; JJAutoCompare, Ryzen 7 3800X, headba92a2a8: three CPU tests of this PR, 3 passed.Regression run
Not made on this head yet: the pair below is of
maine429936and the earlier head8956fb4, so the "PR description" check stays red until ascripts/smoke.ps1pair of this head is added. It stays a draft.Earlier pair: same machine, same title, 200 s, the same scripted A presses (
XCL_PRESS_A_AT),XCL_PREPARE=0, noXCL_*switch set (so the root-UAV form, not the heap windows), both throughmain'sscripts/smoke.ps1.main:
earlier head
8956fb4:main's, under CONTRIBUTING's 80 %. Presents per 25 s:main603 / 510 / 693 / 401 / 64 / 78 / 53 / 39, the head 376 / 616 / 543 / 68 / 67 / 81 / 45 / 54; in the world (100–200 s) the head presented 247 frames andmain235.main's own 200 s runs on this machine gave 1,723 (6089122), then 1,908, 2,442 and 1,744 frames (three runs ofe429936).main.Not tested
XCL_HEAP_WINDOWS=1(the regression pair runs the default, root-UAV form). The stacked D3D12.X: XCL_VIEW_MEM=1 maps the title's GPU-view memory into heap windows 4..15 #3097 ran one withXCL_HEAP_WINDOWS=1on an earlier head.Testing on other setups is welcome. So far this has only run on one RTX 3090 (Resizable BAR off). Results from AMD and Intel GPUs, other NVIDIA generations, or Resizable BAR on would help most. The suite plus a
scripts/smoke.ps1block, as a comment here, is enough.AI use
AI use: the port of the first commit onto
main(with the null views and the tests), the review fixes, the rebases, the test runs and this description were done with Claude Code (Claude Opus 5.5), checked by me.🤖 Generated with Claude Code