Recompiler: treat raw buffer offsets that wrap past 2^32 as out of range #1923

Closed
PracticalStudios wants to merge 2 commits from upstream-pr/1933 into main
PracticalStudios commented 2026-11-24 23:42:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by PracticalStudios on 2026-11-24T23:42:45Z.


Direct-DXIL raw buffer loads, stores and atomics now treat an offset that wraps past 2^32 as out of range. Part of #1893 (the raw-buffer part; the s_buffer_load part is not changed).

Why: voff + OFFSET and off + bytes were added in 32 bits, so a wrapped sum passed the bounds check. On main, a buffer_load_dword at voff 0xFFFF_FFF0 + OFFSET 0x20 on a 0x100-byte buffer returned another dword of the buffer (4116) instead of 0.

What is in it

  • lower_mem.rs: mubuf's in_range and buffer_atomic also require the sums not to wrap.
  • Test gpu_direct_raw_buffer_offsets_that_wrap_are_out_of_range: wrapped loads read 0, a wrapped store and wrapped atomics (also with a non-zero OFFSET) are dropped; an in-range lane is the control.

Tested

  • RTX 3090 24 GB (driver 621.24), Ryzen 7 9800X3D, 62 GB RAM, Windows 11 26200, Rust 1.89.0, debug.
  • The new test fails on main (left: 4116, right: 0) and passes here; removing each of the two checks fails it.
  • cargo test --workspace --no-fail-fast -- --test-threads=2 on aa16bda: 1154 passed, 1 failed, 46 ignored. The failure (kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory) fails the same way on main (fixed by #650).

Regression run
.\scripts\smoke.ps1 -Game <retail title> -Seconds 60, no input, main (this PR's base) first, same machine:

xcl-smoke v1
commit: cbc296ab65a2661a61e3e2da109134bcd5319f60
gpu: NVIDIA GeForce RTX 3090
title: 2c508222
seconds: 60
exit: 0x0
frames shown: 1498 (PresentX 1498)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16250 MB
xcl-smoke v1
commit: aa16bdaf07f3bafbf0266fbacd8bac5aab831a80
gpu: NVIDIA GeForce RTX 3090
title: 2c508222
seconds: 60
exit: 0x0
frames shown: 1616 (PresentX 1616)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16641 MB

Not tested

  • AMD; structured buffers (stride ≠ 0, still only index < num_records).
  • The HLSL path has the same wrap with a single memory window (measured by @upipibi below); #1146 fixes that path, so this PR leaves it alone.

AI use

  • Claude Code (Claude Opus 5.5, with Claude Sonnet subagents) wrote the fix, the test and this text. The test runs are real runs on the hardware above.
<!-- greyfinch-sync:ivall/xcl:issue:5482256955 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1933). Originally posted by [PracticalStudios](https://github.com/PracticalStudios) on 2026-11-24T23:42:45Z. --- Direct-DXIL raw buffer loads, stores and atomics now treat an offset that wraps past 2^32 as out of range. Part of #1893 (the raw-buffer part; the `s_buffer_load` part is not changed). Why: `voff + OFFSET` and `off + bytes` were added in 32 bits, so a wrapped sum passed the bounds check. On `main`, a `buffer_load_dword` at voff `0xFFFF_FFF0` + OFFSET `0x20` on a 0x100-byte buffer returned another dword of the buffer (4116) instead of 0. **What is in it** - `lower_mem.rs`: `mubuf`'s `in_range` and `buffer_atomic` also require the sums not to wrap. - Test `gpu_direct_raw_buffer_offsets_that_wrap_are_out_of_range`: wrapped loads read 0, a wrapped store and wrapped atomics (also with a non-zero OFFSET) are dropped; an in-range lane is the control. **Tested** - RTX 3090 24 GB (driver 621.24), Ryzen 7 9800X3D, 62 GB RAM, Windows 11 26200, Rust 1.89.0, debug. - The new test fails on `main` (`left: 4116, right: 0`) and passes here; removing each of the two checks fails it. - `cargo test --workspace --no-fail-fast -- --test-threads=2` on `aa16bda`: 1154 passed, 1 failed, 46 ignored. The failure (`kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory`) fails the same way on `main` (fixed by #650). **Regression run** `.\scripts\smoke.ps1 -Game <retail title> -Seconds 60`, no input, `main` (this PR's base) first, same machine: ``` xcl-smoke v1 commit: cbc296ab65a2661a61e3e2da109134bcd5319f60 gpu: NVIDIA GeForce RTX 3090 title: 2c508222 seconds: 60 exit: 0x0 frames shown: 1498 (PresentX 1498) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16250 MB ``` ``` xcl-smoke v1 commit: aa16bdaf07f3bafbf0266fbacd8bac5aab831a80 gpu: NVIDIA GeForce RTX 3090 title: 2c508222 seconds: 60 exit: 0x0 frames shown: 1616 (PresentX 1616) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16641 MB ``` **Not tested** - AMD; structured buffers (stride ≠ 0, still only `index < num_records`). - The HLSL path has the same wrap with a single memory window (measured by @upipibi below); #1146 fixes that path, so this PR leaves it alone. **AI use** - Claude Code (Claude Opus 5.5, with Claude Sonnet subagents) wrote the fix, the test and this text. The test runs are real runs on the hardware above.
upipibi commented 2026-11-25 00:09:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T23:45:27Z.


The HLSL path has the same wrap in one of its two forms, from reading recomp/emit.rs on main (not run). In MUBUF's range check:

  • with several memory windows (mem_windows > 1), _off = (uint64_t)voff + OFFSET and _off + bytes <= num_records are 64-bit, so a wrapped sum stays out of range (fine);
  • with one window (around line 1717), uint _off = voff + OFFSET; and in_range = _off + bytes <= num_records are 32-bit. voff = 0xFFFF_FFF0 with OFFSET = 0x20 gives _off = 0x10, which passes on a 0x100-byte buffer, as on the direct path before this PR.

Measured (edited; this replaces my earlier "should"). I ran this PR's program through the HLSL path on main 20cf130 with one window (runner::run_code, XCL_DIRECT_DXIL unset), on an RTX 3070, driver 616.56:

  • lane 0 load at voff 0xFFFF_FFF0 + OFFSET 0x20: 0x1014 (4116), want 0;
  • lane 0 load at voff 0xFFFF_FFFC, no OFFSET: 0x100f, want 0. So _off + bytes wraps as well, not only voff + OFFSET;
  • the store at voff 0xFFFF_FFF0 + 0x20 wrote mem[0x50 / 4] (0xC0DE0000), which should be untouched.

Widening the one-window _off and the in_range sum to 64 bits, as the multi-window branch already does, would cover both.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ivall/xcl:comment:7147760065 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1933#issuecomment-7147760065). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-24T23:45:27Z. --- The HLSL path has the same wrap in one of its two forms, from reading `recomp/emit.rs` on `main` (not run). In MUBUF's range check: - with several memory windows (`mem_windows > 1`), `_off = (uint64_t)voff + OFFSET` and `_off + bytes <= num_records` are 64-bit, so a wrapped sum stays out of range (fine); - with one window (around line 1717), `uint _off = voff + OFFSET;` and `in_range` = `_off + bytes <= num_records` are 32-bit. `voff = 0xFFFF_FFF0` with `OFFSET = 0x20` gives `_off = 0x10`, which passes on a 0x100-byte buffer, as on the direct path before this PR. **Measured** (edited; this replaces my earlier "should"). I ran this PR's program through the HLSL path on `main` `20cf130` with one window (`runner::run_code`, `XCL_DIRECT_DXIL` unset), on an RTX 3070, driver 616.56: - lane 0 load at voff `0xFFFF_FFF0` + OFFSET `0x20`: `0x1014` (4116), want 0; - lane 0 load at voff `0xFFFF_FFFC`, no OFFSET: `0x100f`, want 0. So `_off + bytes` wraps as well, not only `voff + OFFSET`; - the store at voff `0xFFFF_FFF0` + `0x20` wrote `mem[0x50 / 4]` (`0xC0DE0000`), which should be untouched. Widening the one-window `_off` and the `in_range` sum to 64 bits, as the multi-window branch already does, would cover both. AI-assisted (Claude Code).
PracticalStudios commented 2026-11-25 00:09:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by PracticalStudios on 2026-11-25T00:06:49Z.


@upipibi thanks, confirmed: the same wrap shows on the HLSL path's one-window form here too. #1146 (b3IKK) already widens those mubuf / buffer_atomic / mubuf_d16 checks to 64 bits, so I've left that path to it and kept this PR to direct DXIL.

AI use: Claude Code (Claude Opus 5.5) wrote this reply.

<!-- greyfinch-sync:ivall/xcl:comment:7148154133 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1933#issuecomment-7148154133). Originally posted by [PracticalStudios](https://github.com/PracticalStudios) on 2026-11-25T00:06:49Z. --- @upipibi thanks, confirmed: the same wrap shows on the HLSL path's one-window form here too. #1146 (b3IKK) already widens those `mubuf` / `buffer_atomic` / `mubuf_d16` checks to 64 bits, so I've left that path to it and kept this PR to direct DXIL. AI use: Claude Code (Claude Opus 5.5) wrote this reply.
futurepro62 commented 2026-11-25 01:10:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-25T00:56:00Z.


Full-suite run, since this PR has no test report yet. Tested exact head bb5e0b7 (on its base 689f2db).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 966 passed, 0 failed, 43 ignored. SKIPPED (no wave64): a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu, a_per_lane_2d_or_3d_group_runs_on_the_gpu, coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu, cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu, gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware, the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.
  • The new tests ran and passed: gpu_direct_raw_buffer_offsets_that_wrap_are_out_of_range.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 975 passed, 0 failed, 45 ignored. SKIPPED: f16_programs_on_the_gpu (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f16_programs_on_the_gpu (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), f32_programs_on_the_gpu (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • --skip leaves out tests that fail on main 7994cd1 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (#1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests and const_and_null_mask_operands_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7149037840 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1933#issuecomment-7149037840). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-25T00:56:00Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `bb5e0b7` (on its base `689f2db`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests`: **966 passed, 0 failed, 43 ignored**. SKIPPED (no wave64): `a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu`, `a_per_lane_2d_or_3d_group_runs_on_the_gpu`, `coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu`, `cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu`, `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`, `the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu`. - The new tests ran and passed: `gpu_direct_raw_buffer_offsets_that_wrap_are_out_of_range`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1`: **975 passed, 0 failed, 45 ignored**. SKIPPED: `f16_programs_on_the_gpu` (f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f16_programs_on_the_gpu` (f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `f32_programs_on_the_gpu` (f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - `--skip` leaves out tests that fail on main `7994cd1` too, not because of this PR. On NVIDIA: `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651), the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests and `const_and_null_mask_operands_agree_with_hlsl_on_the_gpu` ([follow-up on #1651](https://github.com/xcl-dev/xcl/issues/1651#issuecomment-7146069648)) fail because `runner::skip_test` turns their skips into failures under `XCL_REQUIRE_GPU=mesh`, and `gpu::dxil::fuzz_tests` seeds 70, 545, 1019 and 1507 fail `CreateComputePipelineState` with `E_OUTOFMEMORY` on this card (drivers 616.64 and 621.40). On AMD: `fuzz_validate_and_gpu_1` fails on seed 540 (`res[833]` 0x7 vs CPU 0x6). The AMD run does not set `XCL_REQUIRE_GPU`. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
raylitebull commented 2026-11-25 01:11:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T01:08:18Z.


Diff audit passed (lower_mem.rs 32-bit wrap checks off >= voff and e >= off in mubuf and buffer_atomic, plus GPU test gpu_direct_raw_buffer_offsets_that_wrap_are_out_of_range), Build and test + PR description are green on bb5e0b7, and NVIDIA (RTX 3090, RTX 5070 Ti) verified it.

Remaining before merge: one independent AMD GPU pass on bb5e0b7.

<!-- greyfinch-sync:ivall/xcl:comment:7149243541 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1933#issuecomment-7149243541). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T01:08:18Z. --- Diff audit passed (`lower_mem.rs` 32-bit wrap checks `off >= voff` and `e >= off` in `mubuf` and `buffer_atomic`, plus GPU test `gpu_direct_raw_buffer_offsets_that_wrap_are_out_of_range`), `Build and test` + `PR description` are green on `bb5e0b7`, and NVIDIA (RTX 3090, RTX 5070 Ti) verified it. **Remaining before merge:** one independent **AMD** GPU pass on `bb5e0b7`.
PracticalStudios commented 2026-11-25 02:08:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by PracticalStudios on 2026-11-25T01:29:37Z.


Rebased onto main 8f5fca5 to resolve a conflict at the end of recomp/tests.rs (#1990's test landed in the same spot). The lower_mem.rs change and the test are unchanged, so the runs on bb5e0b7 above still apply; the regression blocks for the new head follow.

Rebased again onto cbc296a (same tests.rs end-of-file conflict): the test now sits next to the other raw-buffer bounds tests instead of at the end of the file, so later appends don't collide with it. Code and test unchanged; new head aa16bda, its blocks are in the description.

AI use: Claude Code (Claude Opus 5.5) wrote this note.

<!-- greyfinch-sync:ivall/xcl:comment:7149608121 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1933#issuecomment-7149608121). Originally posted by [PracticalStudios](https://github.com/PracticalStudios) on 2026-11-25T01:29:37Z. --- Rebased onto `main` `8f5fca5` to resolve a conflict at the end of `recomp/tests.rs` (#1990's test landed in the same spot). The `lower_mem.rs` change and the test are unchanged, so the runs on `bb5e0b7` above still apply; the regression blocks for the new head follow. Rebased again onto `cbc296a` (same `tests.rs` end-of-file conflict): the test now sits next to the other raw-buffer bounds tests instead of at the end of the file, so later appends don't collide with it. Code and test unchanged; new head `aa16bda`, its blocks are in the description. AI use: Claude Code (Claude Opus 5.5) wrote this note.
raylitebull commented 2026-11-25 02:08:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T01:36:11Z.


Build and test (Windows, no GPU) just passed on 7946c96! Two small items remain before merge:

  1. Refresh the PR xcl-smoke v1 block in the PR description (commit: still points to bb5e0b7 instead of 7946c96, causing the PR description check to fail).
  2. One independent AMD GPU run confirming gpu_direct_raw_buffer_offsets_that_wrap_are_out_of_range on 7946c96.
<!-- greyfinch-sync:ivall/xcl:comment:7149738124 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1933#issuecomment-7149738124). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T01:36:11Z. --- `Build and test (Windows, no GPU)` just passed on `7946c96`! Two small items remain before merge: 1. Refresh the `PR` `xcl-smoke v1` block in the PR description (`commit:` still points to `bb5e0b7` instead of `7946c96`, causing the `PR description` check to fail). 2. One independent **AMD** GPU run confirming `gpu_direct_raw_buffer_offsets_that_wrap_are_out_of_range` on `7946c96`.
upipibi commented 2026-11-25 03:05:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-25T02:37:01Z.


Re-checked 7946c96 on the RTX 3070 (driver 616.56): the new gpu_direct_raw_buffer_offsets_that_wrap_are_out_of_range passes with XCL_DIRECT_DXIL=0 and 1.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ivall/xcl:comment:7150954808 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1933#issuecomment-7150954808). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T02:37:01Z. --- Re-checked `7946c96` on the RTX 3070 (driver 616.56): the new `gpu_direct_raw_buffer_offsets_that_wrap_are_out_of_range` passes with `XCL_DIRECT_DXIL=0` and `1`. AI-assisted (Claude Code).
DavidM1911 commented 2026-11-25 03:05:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T02:41:02Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7151042113 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1933#issuecomment-7151042113). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T02:41:02Z. --- 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!
PracticalStudios commented 2026-11-25 03:05:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by PracticalStudios on 2026-11-25T02:21:31Z.


@philip-roy-jones would you have a few minutes for this PR's remaining check, an AMD run? Your RX 580 (native 64-lane waves) would cover what the NVIDIA runs couldn't. On head 7946c96:

cargo test -p xcl --lib -- gpu_direct_raw_buffer_offsets_that_wrap_are_out_of_range --nocapture

(and the full cargo test --workspace if you have the time). No worries if not.
As additional verification (my own run, so not the independent one): on this machine's AMD Radeon iGPU (Ryzen 7 9800X3D, RDNA2, driver 32.0.21042.62, XCL_ADAPTER=radeon), head 7946c96: gpu_direct_raw_buffer_offsets_that_wrap_are_out_of_range 1 passed; gpu::dxil 108 passed, 1 failed — fuzz_validate_and_gpu_1 seed 540 (res[833] = 0x7, CPU 0x6), the AMD failure already seen on main.

AI use: Claude Code (Claude Opus 5.5) wrote this request.

<!-- greyfinch-sync:ivall/xcl:comment:7150620563 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1933#issuecomment-7150620563). Originally posted by [PracticalStudios](https://github.com/PracticalStudios) on 2026-11-25T02:21:31Z. --- @philip-roy-jones would you have a few minutes for this PR's remaining check, an AMD run? Your RX 580 (native 64-lane waves) would cover what the NVIDIA runs couldn't. On head `7946c96`: ``` cargo test -p xcl --lib -- gpu_direct_raw_buffer_offsets_that_wrap_are_out_of_range --nocapture ``` (and the full `cargo test --workspace` if you have the time). No worries if not. As additional verification (my own run, so not the independent one): on this machine's AMD Radeon iGPU (Ryzen 7 9800X3D, RDNA2, driver 32.0.21042.62, `XCL_ADAPTER=radeon`), head `7946c96`: `gpu_direct_raw_buffer_offsets_that_wrap_are_out_of_range` 1 passed; `gpu::dxil` 108 passed, 1 failed — `fuzz_validate_and_gpu_1` seed 540 (`res[833] = 0x7, CPU 0x6`), the AMD failure already seen on `main`. AI use: Claude Code (Claude Opus 5.5) wrote this request.
DavidM1911 commented 2026-11-26 07:03:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T06:41:22Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7184682673 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1933#issuecomment-7184682673). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T06:41:22Z. --- 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
github-actions[bot] commented 2026-11-30 08:43:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:43:33Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7273265407 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1933#issuecomment-7273265407). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-30T08:43:33Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 07:06:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:06:49Z.


Triage (#1607) – head aa16bda

Main already has this fix. #3265 (cb7fe9bd, Recompiler: guard 32-bit raw-buffer OOB wraparound in Direct DXIL) adds the same two checks to the stride-0 bounds of both the MUBUF access and buffer_atomic in gpu/dxil/lower_mem.rs: off >= voff for voff + OFFSET and e >= off for off + bytes. The only difference is that main skips the first check when OFFSET is 0, where it is always true.
This PR's GPU test gpu_direct_raw_buffer_offsets_that_wrap_are_out_of_range checks loaded values and memory. Main's test (raw_buffer_oob_check_guards_32bit_wraparound) only counts icmp uge in the disassembly. The GPU test could still be offered as a test-only PR.
Recommendation: close (superseded by #3265 / main commit cb7fe9b).

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7303659942 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1933#issuecomment-7303659942). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T07:06:49Z. --- **Triage (#1607)** – head aa16bda Main already has this fix. #3265 (cb7fe9bd, `Recompiler: guard 32-bit raw-buffer OOB wraparound in Direct DXIL`) adds the same two checks to the stride-0 bounds of both the MUBUF access and `buffer_atomic` in `gpu/dxil/lower_mem.rs`: `off >= voff` for `voff + OFFSET` and `e >= off` for `off + bytes`. The only difference is that main skips the first check when OFFSET is 0, where it is always true. This PR's GPU test `gpu_direct_raw_buffer_offsets_that_wrap_are_out_of_range` checks loaded values and memory. Main's test (`raw_buffer_oob_check_guards_32bit_wraparound`) only counts `icmp uge` in the disassembly. The GPU test could still be offered as a test-only PR. Recommendation: close (superseded by #3265 / main commit cb7fe9b). AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
throny commented 2026-12-01 12:49:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-12-01T12:49:55Z.


Closing as superseded: this change is already on main (cb7fe9bd). main lower_mem.rs adds off_no_wrap (voff + OFFSET) and e_no_wrap checks to raw mubuf and buffer_atomic bounds, plus a core_tests test; equivalent to the PR

Two independent checks found this: Foniass's close list on #1607 and ours against current main. If something here is still missing on main, say so and reopen it, or ask and I will.

AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

<!-- greyfinch-sync:ivall/xcl:comment:7311710099 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1933#issuecomment-7311710099). Originally posted by [throny](https://github.com/throny) on 2026-12-01T12:49:55Z. --- Closing as superseded: this change is already on `main` (cb7fe9bd). main lower_mem.rs adds off_no_wrap (voff + OFFSET) and e_no_wrap checks to raw mubuf and buffer_atomic bounds, plus a core_tests test; equivalent to the PR Two independent checks found this: Foniass's close list on #1607 and ours against current `main`. If something here is still missing on `main`, say so and reopen it, or ask and I will. AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!1923
No description provided.