Recompiler: direct DXIL s_buffer_load offsets wrap within their window #2062
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2062
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2062"
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?
@LucasHoepfner on GitHub · 2026-11-25 02:25 UTC · original
LucasHoepfner:dxil-raw-buffer-bounds→main· +44 −1 · 2 files · 1 commits · openWith two or more memory windows, the direct DXIL translator read an
s_buffer_loadwhose 32-bit offset (OFFSET + soff) wraps from the next window, 4 GiB above the buffer. It used the wrapped sum for the range check and the address, but took the window from the two parts added in 64 bits. The HLSL path uses the 32-bit sum for all three. Part of #1893: #1933 has the MUBUF and atomic cases, and with it this is every case measured there where the two translators differ (#1893), so the issue can be closed once both are in.What is in it
Recompiler: direct DXIL s_buffer_load offsets wrap within their window: the window comes from the 32-bit offset (crates/xcl/src/gpu/dxil/lower_mem.rs, one line), with the GPU testgpu_scalar_buffer_load_offset_wraps_within_its_window(crates/xcl/src/gpu/recomp/tests.rs):s_buffer_load_dwordanddwordx4withOFFSET0x20 andsoff0xFFFF_FFF0 on a two-window arena, through both translators and both window forms.Tested
stable-x86_64-pc-windows-msvc; DXC 1.8.2502.11. This head (a984c01, onmain08db802): the commit was rebased to resolve a conflict intests.rs, where another test had been added at the same place. The change is the same. Tests in the debug profile, smoke in release.cargo test -p xcl --lib gpu_scalar_buffer_load_offset_wraps_within_its_window: without thelower_mem.rsline, 1 failed atdirect true, heap windows false: dword(left 0xB000_0000, window 1's marker; right 0xA000_0000); with it, 1 passed.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1430 passed, 0 failed, 47 ignored. SKIPPED: 21 ×no wave64,heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows),pso_measurement_compiles_an_exact_synthetic_record(Developer Mode is off),uploads_start_from_each_subresources_state(no D3D12 debug layer), 2 ×the title under the debug layer(no d3d12SDKLayers.dll), 3 per-lane programs with f16 instructions (refused (unsupported …)).Regression run
scripts/smoke.ps1 -Game <folder> -Seconds 60on a retail title, no input, on the machine above. Each block is the second run of its build (one unreported run of the same length came first, so that neither is a first run with cold caches); the PR's was run beforemain's. Unedited.main08db802:This head
a984c01:7e2c923), is in Parakeet-Wheat's comment (RTX 3070): #2062Not tested
s_buffer_loadthat wraps, or whether it used the direct translator. AMD / Intel GPUs; native wave64; a release build of the tests.soffis not part of the MUBUF range check;num_records * stridecan wrap) are the same on the HLSL path and are not changed here.AI use
@JoaoPauluu on GitHub · 2026-11-25 03:14 UTC · original
A run with vkd3d-proton as the host D3D12. The DXIL goes through dxil-spirv and then the NVIDIA Vulkan driver, a different compiler from a native-Windows run: this PR's new test passes.
Tested
x86_64-pc-windows-gnu.7e2c923as it is (merge base withmainaaa0936), no uncommitted changes. The lib test binary runs under Wine, one test per process.gpu_scalar_buffer_load_offset_wraps_within_its_window: ok, not skippedNot tested
AI use
@Parakeet-Wheat on GitHub · 2026-11-25 03:19 UTC · original
NVIDIA RTX 3070 on native Windows, head
7e2c923on its baseaaa0936: the new test fails without thelower_mem.rsline and passes with it, the whole suite passes, and the smoke pair is within the limits.Tested
610.88, 32-lane waves), Ryzen 5 5600X, 32 GB, Windows 11 26300, Rust 1.95.0stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11, retail 1.0.2.1. Head7e2c923(one commit onmainaaa0936), checked out clean. Tests in the debug profile, smoke in release.cargo test -p xcl --lib gpu_scalar_buffer_load_offset_wraps_within_its_window -- --nocapture --test-threads=1:aaa0936with only the PR'stests.rscopied in: 1 failed,direct true, heap windows false: dword, left2952790016(0xB000_0000, window 1's marker), right2684354560(0xA000_0000);7e2c923: 1 passed, 0 failed, not skipped..\scripts\test.ps1(cargo build --workspace, thencargo test --workspace -- --test-threads=4) on7e2c923: 1152 passed, 0 failed, 46 ignored across 20 test binaries, exit 0. SKIPPED, 25: 20 ×no wave64, 3 × per-lane form refused (V_CVT_F16_F32,V_PK_MUL_F16,V_MUL_F16: "its #1426 semantics differ from the console's"), 1 ×no heap windows, 1 × cannot disable the driver cache (Windows Developer Mode required).Regression run (
scripts/smoke.ps1 -Game <folder> -Seconds 60, the same title, back to back, menus, no input; unedited).mainaaa0936:PR head
7e2c923:That is 111 % of
main's frames and 99 % of its peak commit.Not tested
no wave64skips above), a world run (the smoke stays in the menus, so it does not show whether the title reaches ans_buffer_loadthat wraps), the tests on game data (XCL_SAMPLE_*not set).AI use
@DavidM1911 on GitHub · 2026-11-25 04:55 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@DavidM1911 on GitHub · 2026-11-26 07:13 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.