D3D12.X: fix null device allocation info null-deref, overflow, and RowPitch truncation #1621

Merged
b3IKK merged 1 commit from upstream-pr/1631 into main 2026-11-29 13:55:09 +00:00
b3IKK commented 2026-11-24 18:25:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-24T18:25:47Z.


Fixes three bugs in crates/xcl/src/hle/d3d12x/null.rs:

  • Device_GetResourceAllocationInfo computed descs.add(i * 56) even when descs was null, dereferencing 0x38 on i = 1 when n >= 2 (access violation).
  • approx_size, new_resource, Device_GetResourceAllocationInfo, and Device_GetCopyableFootprints used unchecked arithmetic and aligned pointer dereferences on raw *const u8 / *mut u8 buffers, overflowing on large dimensions/widths and aborting on unaligned descriptors.
  • Device_GetCopyableFootprints multiplied buffer widths by 4 and truncated ((width * 4 + 255) & !255) as u32, turning a 1 GiB buffer's RowPitch into 0.

This guards descs.is_null(), uses saturating arithmetic and read_unaligned / write_unaligned, treats BUFFER (dim == 1) as 1 bpp, and clamps RowPitch to u32::MAX & !255.

What is in it

  • crates/xcl/src/hle/d3d12x/null.rs: guard null descs, use saturating math and unaligned reads/writes in approx_size, new_resource, Device_GetResourceAllocationInfo, and Device_GetCopyableFootprints; clamp RowPitch and handle 1-bpp buffers; add unit test null_alloc_info_and_footprints_guard_null_and_overflow.

Since the last push: rebased onto main 06c9f55; the only conflict was struct_returning_methods_take_the_buffer_first_or_second, a test main had added at the same place, and both are kept.

Tested

  • hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1)
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 1266 passed, 0 failed, 46 ignored (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses, no heap windows, and cannot disable the driver cache (Windows Developer Mode is required))
  • cargo test -p xcl --lib hle::d3d12x::null::tests: 4 passed, 0 failed

Regression run

main (426a5a7, clean tree, no local changes):

xcl-smoke v1
commit: 426a5a745db4d5e4b037449ede0b70cb342f5192
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1642 (PresentX 1642)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15158 MB

PR (ef0cb29, clean tree, no local changes):

xcl-smoke v1
commit: ef0cb29e0ac9513a1ee641013bc5bf1d23bab0aa
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1639 (PresentX 1639)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15885 MB

(The main block is 426a5a7, an ancestor of the current main, from the same machine and data folder.)

Not tested

  • AMD GPUs and native wave64 hardware
  • other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine

AI use

  • OpenCode, Claude Fable 5.2: rebased onto main 06c9f55, resolved the conflicts, ran the suite and the scripts/smoke.ps1 pair at the head above.
<!-- greyfinch-sync:ivall/xcl:issue:5477964338 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1631). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-24T18:25:47Z. --- Fixes three bugs in `crates/xcl/src/hle/d3d12x/null.rs`: - `Device_GetResourceAllocationInfo` computed `descs.add(i * 56)` even when `descs` was null, dereferencing `0x38` on `i = 1` when `n >= 2` (access violation). - `approx_size`, `new_resource`, `Device_GetResourceAllocationInfo`, and `Device_GetCopyableFootprints` used unchecked arithmetic and aligned pointer dereferences on raw `*const u8` / `*mut u8` buffers, overflowing on large dimensions/widths and aborting on unaligned descriptors. - `Device_GetCopyableFootprints` multiplied buffer widths by `4` and truncated `((width * 4 + 255) & !255) as u32`, turning a 1 GiB buffer's `RowPitch` into `0`. This guards `descs.is_null()`, uses saturating arithmetic and `read_unaligned` / `write_unaligned`, treats `BUFFER` (`dim == 1`) as 1 bpp, and clamps `RowPitch` to `u32::MAX & !255`. **What is in it** - `crates/xcl/src/hle/d3d12x/null.rs`: guard null `descs`, use saturating math and unaligned reads/writes in `approx_size`, `new_resource`, `Device_GetResourceAllocationInfo`, and `Device_GetCopyableFootprints`; clamp `RowPitch` and handle 1-bpp buffers; add unit test `null_alloc_info_and_footprints_guard_null_and_overflow`. **Since the last push**: rebased onto `main` `06c9f55`; the only conflict was `struct_returning_methods_take_the_buffer_first_or_second`, a test `main` had added at the same place, and both are kept. **Tested** - hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2609.5, debug (`scripts/test.ps1`) and release (`scripts/smoke.ps1`) - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`): **1266 passed, 0 failed, 46 ignored** (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses, `no heap windows`, and `cannot disable the driver cache (Windows Developer Mode is required)`) - `cargo test -p xcl --lib hle::d3d12x::null::tests`: 4 passed, 0 failed **Regression run** main (`426a5a7`, clean tree, no local changes): ``` xcl-smoke v1 commit: 426a5a745db4d5e4b037449ede0b70cb342f5192 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1642 (PresentX 1642) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15158 MB ``` PR (`ef0cb29`, clean tree, no local changes): ``` xcl-smoke v1 commit: ef0cb29e0ac9513a1ee641013bc5bf1d23bab0aa gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1639 (PresentX 1639) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15885 MB ``` (The main block is `426a5a7`, an ancestor of the current `main`, from the same machine and data folder.) **Not tested** - AMD GPUs and native wave64 hardware - other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine **AI use** - OpenCode, Claude Fable 5.2: rebased onto `main` `06c9f55`, resolved the conflicts, ran the suite and the `scripts/smoke.ps1` pair at the head above.
Belox17 commented 2026-11-24 21:09:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Belox17 on 2026-11-24T20:03:00Z.


Test report for 30418877 on NVIDIA (RTX 3060 Ti): passes, and without the fix the test crashes with an access violation

Tested

  • NVIDIA GeForce RTX 3060 Ti 8 GB (32-lane waves), driver 32.0.16.2124; Ryzen 5 5600X; Windows 11 build 26300; rustc 1.98.1 MSVC; DXC 1.8.2502.11 (Windows SDK 10.0.26100); debug build. Head 30418877 as is (base 9e3831e), clean tree.
  • The new test (null_alloc_info_and_footprints_guard_null_and_overflow) with cargo test -p xcl --lib <name>: 1 passed.
  • cargo test --workspace -- --test-threads=4 on the head: 777 passed, 0 failed, 41 ignored; its base 9e3831e on the same machine: 776 passed, 0 failed, 41 ignored. SKIPPED on both: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • Merged into current main c160d86e (clean merge): 859 passed, 0 failed, 42 ignored; main alone: 858 passed, 0 failed, 42 ignored, the same three SKIPPED as above.
  • With the non-test hunks of hle/d3d12x/null.rs reverted (test kept), the test process ends with 0xc0000005 (STATUS_ACCESS_VIOLATION).

Not tested

  • AMD / native wave64 hardware; any retail title (no smoke run).

AI use: Claude Code (Claude Opus 5.5) ran the commands on this machine and wrote this report from those runs.

<!-- greyfinch-sync:ivall/xcl:comment:7142969517 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1631#issuecomment-7142969517). Originally posted by [Belox17](https://github.com/Belox17) on 2026-11-24T20:03:00Z. --- **Test report for `30418877` on NVIDIA (RTX 3060 Ti): passes, and without the fix the test crashes with an access violation** **Tested** - NVIDIA GeForce RTX 3060 Ti 8 GB (32-lane waves), driver 32.0.16.2124; Ryzen 5 5600X; Windows 11 build 26300; rustc 1.98.1 MSVC; DXC 1.8.2502.11 (Windows SDK 10.0.26100); debug build. Head `30418877` as is (base `9e3831e`), clean tree. - The new test (`null_alloc_info_and_footprints_guard_null_and_overflow`) with `cargo test -p xcl --lib <name>`: 1 passed. - `cargo test --workspace -- --test-threads=4` on the head: **777 passed, 0 failed, 41 ignored**; its base `9e3831e` on the same machine: 776 passed, 0 failed, 41 ignored. SKIPPED on both: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - Merged into current `main` `c160d86e` (clean merge): **859 passed, 0 failed, 42 ignored**; `main` alone: 858 passed, 0 failed, 42 ignored, the same three SKIPPED as above. - With the non-test hunks of `hle/d3d12x/null.rs` reverted (test kept), the test process ends with `0xc0000005` (`STATUS_ACCESS_VIOLATION`). **Not tested** - AMD / native wave64 hardware; any retail title (no smoke run). **AI use:** Claude Code (Claude Opus 5.5) ran the commands on this machine and wrote this report from those runs.
DavidM1911 commented 2026-11-24 21:09:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T20:46:45Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7144043755 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1631#issuecomment-7144043755). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T20:46:45Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
DavidM1911 commented 2026-11-26 06:06:49 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T05:58:07Z.


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:7183968854 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1631#issuecomment-7183968854). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T05:58:07Z. --- 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
Decodere commented 2026-11-27 14:46:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-11-27T14:46:30Z.


Independent desktop NVIDIA verification of PR #1631 at head ef0cb29e0ac9513a1ee641013bc5bf1d23bab0aa (1 commit; exact parent & merge-base: 06c9f5505f63f10c5ec49ef932d75b2c28177324, pre-#2555 ancestor of main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12, Wave32-only Ada), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted tests & build (ef0cb29e)

Command Result
cargo test --release -p xcl --lib -- --nocapture null_alloc_info_and_footprints_guard_null_and_overflow (3 consecutive runs) 1 passed; 0 failed; 0 ignored; 1222 filtered out × 3 (0.00s, 0.00s, 0.00s, 0 skipped)
cargo test --release -p xcl --lib -- --nocapture hle::d3d12x::null:: (3 consecutive runs) 5 passed; 0 failed; 0 ignored; 1218 filtered out × 3 (0.02s, 0.02s, 0.02s, 0 skipped)
cargo build --release -p xcl Clean build (1m 40s, exit 0, 0 new warnings in null.rs)

Paired quiet 60 s retail smoke (title: 29640639)

Exact parent & merge-base (06c9f5505f63f10c5ec49ef932d75b2c28177324, cached baseline on the same machine):

xcl-smoke v1
commit: 06c9f5505f63f10c5ec49ef932d75b2c28177324
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1588 (PresentX 1589)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14452 MB

PR #1631 (ef0cb29e0ac9513a1ee641013bc5bf1d23bab0aa):

xcl-smoke v1
commit: ef0cb29e0ac9513a1ee641013bc5bf1d23bab0aa
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1546 (PresentX 1547)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14435 MB

Limits of coverage

  • null_alloc_info_and_footprints_guard_null_and_overflow and the full hle::d3d12x::null:: suite (5/5, 0 skipped) passed 3/3, directly verifying the null-descriptor guard in Device_GetResourceAllocationInfo, saturating approx_size for huge 2D textures, 1 GiB buffer RowPitch preservation (1 << 30, no truncation to 0), and u32::MAX & !255 saturation on extreme widths in Device_GetCopyableFootprints.
  • The 60 s retail smoke runs on the real RTX 4060 D3D12 backend rather than the fallback null device, serving as a build/regression sanity check (0 device removals, 0 crashes, steady 60 Hz); single-run frame/commit delta vs. the cached parent reflects normal startup variance.

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

<!-- greyfinch-sync:ivall/xcl:comment:7221211062 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1631#issuecomment-7221211062). Originally posted by [Decodere](https://github.com/Decodere) on 2026-11-27T14:46:30Z. --- Independent desktop NVIDIA verification of **PR #1631** at head `ef0cb29e0ac9513a1ee641013bc5bf1d23bab0aa` (`1` commit; exact parent & merge-base: `06c9f5505f63f10c5ec49ef932d75b2c28177324`, pre-`#2555` ancestor of `main`). ### Environment - **GPU:** NVIDIA GeForce RTX 4060 (8 GB / `7956 MiB` reported by D3D12, Wave32-only Ada), driver `32.0.16.2114` (NVIDIA `621.14`, WDDM 3.2) - **CPU / RAM / OS:** Intel Core i5-11400F (6C / 12T), 32 GB RAM (`31.9 GiB` usable), Windows 11 Home `26200` (Developer Mode off) - **Toolchain:** `rustc 1.100.0 (0ef1bc386 2026-11-09)` MSVC, DXC `1.9.2609.5`, `--release` ### Targeted tests & build (`ef0cb29e`) | Command | Result | | --- | --- | | `cargo test --release -p xcl --lib -- --nocapture null_alloc_info_and_footprints_guard_null_and_overflow` (3 consecutive runs) | `1 passed; 0 failed; 0 ignored; 1222 filtered out` × 3 (`0.00s`, `0.00s`, `0.00s`, `0` skipped) | | `cargo test --release -p xcl --lib -- --nocapture hle::d3d12x::null::` (3 consecutive runs) | `5 passed; 0 failed; 0 ignored; 1218 filtered out` × 3 (`0.02s`, `0.02s`, `0.02s`, `0` skipped) | | `cargo build --release -p xcl` | Clean build (`1m 40s`, exit `0`, `0` new warnings in `null.rs`) | ### Paired quiet 60 s retail smoke (`title: 29640639`) Exact parent & merge-base (`06c9f5505f63f10c5ec49ef932d75b2c28177324`, cached baseline on the same machine): ``` xcl-smoke v1 commit: 06c9f5505f63f10c5ec49ef932d75b2c28177324 gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1588 (PresentX 1589) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14452 MB ``` PR #1631 (`ef0cb29e0ac9513a1ee641013bc5bf1d23bab0aa`): ``` xcl-smoke v1 commit: ef0cb29e0ac9513a1ee641013bc5bf1d23bab0aa gpu: NVIDIA GeForce RTX 4060 title: 29640639 seconds: 60 exit: 0x0 frames shown: 1546 (PresentX 1547) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14435 MB ``` ### Limits of coverage - `null_alloc_info_and_footprints_guard_null_and_overflow` and the full `hle::d3d12x::null::` suite (`5/5`, `0` skipped) passed `3/3`, directly verifying the null-descriptor guard in `Device_GetResourceAllocationInfo`, saturating `approx_size` for huge 2D textures, 1 GiB buffer `RowPitch` preservation (`1 << 30`, no truncation to `0`), and `u32::MAX & !255` saturation on extreme widths in `Device_GetCopyableFootprints`. - The 60 s retail smoke runs on the real RTX 4060 D3D12 backend rather than the fallback null device, serving as a build/regression sanity check (`0` device removals, `0` crashes, steady 60 Hz); single-run frame/commit delta vs. the cached parent reflects normal startup variance. *AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).*
ClosetPie107 commented 2026-11-27 16:12:37 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-27T16:12:37Z.


Tested on AMD / Linux: ef0cb29e (RX 9070 16 GB, RDNA4, Mesa 26.3.1 RADV; Ryzen 5 9600X, 32 GB; CachyOS; Proton Experimental experimental-11.0-20261112 with vkd3d-proton master ec207194 plus a local patch dropping the lpVtbl checks of command allocators and lists; DXC 1.9.2609.5; Rust 1.96.0, x86_64-pc-windows-gnu debug build, tests run under Wine)

The head as it is (not merged onto current main), with its base 06c9f550 as the baseline.

Tests (XCL_REQUIRE_GPU=wave64)

  • cargo test -p xcl --lib -- hle::d3d12x::null:: --test-threads=1: 5 passed, 0 failed, 0 ignored (includes null_alloc_info_and_footprints_guard_null_and_overflow).
  • cargo test --workspace --no-fail-fast -- --test-threads=4 with --skip compositor_blends_ui_plane_over_scene_plane --skip failed_restore_stops_before_importing_an_unbacked_window --skip grooming_leaves_a_window_under_1_gib_only_its_hole (here the first loses the RADV device, the other two run out of memory under Wine): lib 1181 passed, 16 failed, 26 ignored; base 06c9f550 (this PR's base) the same session: lib 1180 passed, 16 failed, 26 ignored. The failures are the same set as on the base. The other binaries fail the same 3 tests as on the base (e2e, pls_quota, predication_e2e).
  • d3d12_resource_and_sync: its fence and queue test ended the process here, as it does on the base and most other trees in this setup.

Not tested

  • Native Windows, NVIDIA / Intel
  • A retail title

AI use

  • Claude Code (Claude Opus 5.5) wrote the test scripts, ran the builds and tests on my machine and wrote this report.
<!-- greyfinch-sync:ivall/xcl:comment:7222987471 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1631#issuecomment-7222987471). Originally posted by [ClosetPie107](https://github.com/ClosetPie107) on 2026-11-27T16:12:37Z. --- **Tested on AMD / Linux: `ef0cb29e`** (RX 9070 16 GB, RDNA4, Mesa 26.3.1 RADV; Ryzen 5 9600X, 32 GB; CachyOS; Proton Experimental `experimental-11.0-20261112` with vkd3d-proton master `ec207194` plus a local patch dropping the `lpVtbl` checks of command allocators and lists; DXC 1.9.2609.5; Rust 1.96.0, `x86_64-pc-windows-gnu` debug build, tests run under Wine) The head as it is (not merged onto current `main`), with its base `06c9f550` as the baseline. **Tests** (`XCL_REQUIRE_GPU=wave64`) - `cargo test -p xcl --lib -- hle::d3d12x::null:: --test-threads=1`: **5 passed, 0 failed**, 0 ignored (includes `null_alloc_info_and_footprints_guard_null_and_overflow`). - `cargo test --workspace --no-fail-fast -- --test-threads=4` with `--skip compositor_blends_ui_plane_over_scene_plane --skip failed_restore_stops_before_importing_an_unbacked_window --skip grooming_leaves_a_window_under_1_gib_only_its_hole` (here the first loses the RADV device, the other two run out of memory under Wine): lib 1181 passed, 16 failed, 26 ignored; base `06c9f550` (this PR's base) the same session: lib 1180 passed, 16 failed, 26 ignored. The failures are the same set as on the base. The other binaries fail the same 3 tests as on the base (`e2e`, `pls_quota`, `predication_e2e`). - `d3d12_resource_and_sync`: its fence and queue test ended the process here, as it does on the base and most other trees in this setup. **Not tested** - Native Windows, NVIDIA / Intel - A retail title **AI use** - Claude Code (Claude Opus 5.5) wrote the test scripts, ran the builds and tests on my machine and wrote this report.
thehollowedone commented 2026-11-28 13:12:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-28T13:12:53Z.


Review of exact head ef0cb29: three overflow-boundary results remain in the null D3D12 device.

  • A one-byte resource, a buffer with Width = UINT64_MAX, then another one-byte resource gives the two small live resources the same fake GPU VA (0x100000000 here). The saturated increment still wraps inside AtomicU64::fetch_add. Reject an unrepresentable aligned reservation before creating the object; use a checked atomic increment.
  • GetResourceAllocationInfo with n = 2 and a null descriptor pointer returns SizeInBytes = 0, which looks like success. An unrepresentable buffer size likewise rounds down. Microsoft documents UINT64_MAX for allocation errors.
  • For a 4 GiB buffer, GetCopyableFootprints reports an unpadded row of 0x100000000 bytes but clamps RowPitch to 0xffffff00. A caller cannot copy the advertised row into that pitch. D3D12 specifies UINT64_MAX in pTotalBytes for an invalid descriptor; Microsoft's reference helper rejects oversized buffer rows.

A local candidate uses one checked 64 KiB alignment helper for creation and allocation queries, checks the atomic VA reservation, and rejects an unrepresentable copy row instead of clamping it. It also leaves the resource output null on creation failure.

Test-only assertions on unchanged ef0cb29: cargo test --offline --locked -j 4 -p xcl --lib null_ -- --nocapture --test-threads=1 -> 9 passed, 2 failed, 0 ignored. The failures were the invalid allocation-info result and the duplicate GPU VA. The footprint mismatch follows directly from the head's row-size and pitch expressions. With the candidate: the focused null-device module had 6 passed, 0 failed; cargo build --offline --locked -j 4 --workspace passed; git diff --check passed.

Full workspace command on the RTX 3080 Ti: cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4. Unchanged PR head: 1,265 passed, 1 failed, 46 ignored, 25 SKIPPED notices. Candidate: 1,266 passed, 1 failed, 46 ignored, the same 25 skips. The sole failure on both was console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk (DXIL not compiled yet). The extra pass is the added regression.

This is an uncommitted candidate on the PR head. A clean-head title smoke and integration with current main remain for the author after any change. Hardware: Windows 11 build 26300, RTX 3080 Ti / 621.35, Ryzen 7 9800X3D, rustc 1.99.1, DXC 1.8.2502.11. AI use: Codex (GPT-6.2 Astra) traced the boundary cases; Codex (GPT-6.2 Sol) wrote and tested the candidate and drafted this review.

Candidate diff (uncommitted) ```diff diff --git a/crates/xcl/src/hle/d3d12x/null.rs b/crates/xcl/src/hle/d3d12x/null.rs index cce5d484..0bb8f7c3 100644 --- a/crates/xcl/src/hle/d3d12x/null.rs +++ b/crates/xcl/src/hle/d3d12x/null.rs @@ -460,19 +460,29 @@ unsafe fn approx_size(desc: *const u8) -> usize { (width.max(1).saturating_mul(height).saturating_mul(depth).saturating_mul(16) / 3).min(256 << 20) }

+fn aligned_resource_size(size: usize) -> Option {

  • u64::try_from(size).ok()?.checked_add(0xFFFF).map(|n| n & !0xFFFF)
    +}

unsafe fn new_resource(desc: *const u8, ppv: *mut *mut c_void) -> HRESULT {
if ppv.is_null() {
return S_FALSE;
}

  • *ppv = std::ptr::null_mut();
  • let size = approx_size(desc);
  • let Some(step) = aligned_resource_size(size) else {
  •    return E_INVALIDARG;
    
  • };
  • // A fake GPU VA must not wrap into the range of another live null resource.
  • static NEXT_VA: AtomicU64 = AtomicU64::new(0x1_0000_0000);
  • let Ok(va) = NEXT_VA.try_update(Ordering::Relaxed, Ordering::Relaxed, |next| next.checked_add(step)) else {
  •    return E_INVALIDARG;
    
  • };
    let o = new_obj(Kind::Resource);
    if !desc.is_null() {
    std::ptr::copy_nonoverlapping(desc, (*o).desc.as_mut_ptr(), 56);
    }
  • let size = approx_size(desc);
    *(*o).mem.lock().unwrap() = (0, size);
  • // unique fake GPU VA (64 KiB aligned bump allocator)
  • static NEXT_VA: AtomicU64 = AtomicU64::new(0x1_0000_0000);
  • let va = NEXT_VA.fetch_add((size as u64).saturating_add(0xFFFF) & !0xFFFF, Ordering::Relaxed);
    (*o).value.store(va, Ordering::Relaxed);
    *ppv = o as *mut c_void;
    S_OK
    @@ -480,15 +490,23 @@ unsafe fn new_resource(desc: *const u8, ppv: *mut *mut c_void) -> HRESULT {

unsafe extern "system" fn Device_GetResourceAllocationInfo(a: *mut c_void, b: *mut c_void, _mask: u32, n: u32, descs: *const u8) -> *mut u64 {
let ret = this_and_ret(a, b).1 as *mut u64;

  • let mut total = 0usize;
  • if !descs.is_null() {
  • let mut total = 0u64;
  • let mut valid = n == 0 || !descs.is_null();
  • if valid {
    for i in 0..n as usize {
  •        let aligned = approx_size(descs.add(i * 56)).saturating_add(0xFFFF) & !0xFFFF;
    
  •        total = total.saturating_add(aligned);
    
  •        let Some(aligned) = aligned_resource_size(approx_size(descs.add(i * 56))) else {
    
  •            valid = false;
    
  •            break;
    
  •        };
    
  •        let Some(next) = total.checked_add(aligned) else {
    
  •            valid = false;
    
  •            break;
    
  •        };
    
  •        total = next;
       }
    
    }
    if !ret.is_null() {
  •    *ret = total as u64;
    
  •    *ret = if valid { total } else { u64::MAX };
       *ret.add(1) = 0x10000;
    
    }
    ret
    @@ -547,8 +565,15 @@ unsafe extern "system" fn Device_GetCopyableFootprints(
    let height = if desc.is_null() { 1 } else { (desc.add(24) as *const u32).read_unaligned().max(1) };
    let format = if desc.is_null() { 0 } else { (desc.add(32) as *const u32).read_unaligned() };
    let bpp = if dim == 1 { 1u64 } else { 4u64 };
  • let row_bytes = width.saturating_mul(bpp);
  • let row = (row_bytes.saturating_add(255) & !255).min((u32::MAX & !255) as u64) as u32;
  • let Some(row_bytes) = width.checked_mul(bpp) else {
  •    if !total.is_null() { *total = u64::MAX; }
    
  •    return;
    
  • };
  • let Some(row) = row_bytes.checked_add(255).map(|n| n & !255).filter(|&n| n <= u32::MAX as u64 && width <= u32::MAX as u64) else {
  •    if !total.is_null() { *total = u64::MAX; }
    
  •    return;
    
  • };
  • let row = row as u32;
    for i in 0..num as usize {
    if !layouts.is_null() {
    let l = layouts.add(i * 32);
    @@ -886,7 +911,7 @@ mod tests {
    // Null descs with n >= 2 must not compute null.add(56) and dereference 0x38.
    let mut out = [99u64; 2];
    alloc_info(dev, &mut out, 0, 2, std::ptr::null());
  •        assert_eq!(out, [0, 0x10000]);
    
  •        assert_eq!(out, [u64::MAX, 0x10000]);
    
           // Huge 2D dimensions in approx_size must saturate instead of panicking.
           let mut huge_tex = [0u8; 56];
    

@@ -911,11 +936,36 @@ mod tests {
assert_eq!(row_pitch, 1u32 << 30, "1 GiB buffer RowPitch must not truncate to 0");
assert_eq!(row_size, 1u64 << 30);

  •        // Extreme width in GetCopyableFootprints must saturate without overflow panic.
    
  •        buf_desc[16..24].copy_from_slice(&(u64::MAX / 2).to_le_bytes());
    
  •        // An unrepresentable row pitch must report an invalid footprint.
    
  •        buf_desc[16..24].copy_from_slice(&(1u64 << 32).to_le_bytes());
           footprints(dev, buf_desc.as_ptr(), 0, 1, 0, layout.as_mut_ptr(), std::ptr::null_mut(), &mut row_size, &mut total);
    
  •        let huge_pitch = u32::from_le_bytes(layout[24..28].try_into().unwrap());
    
  •        assert_eq!(huge_pitch, u32::MAX & !255);
    
  •        assert_eq!(total, u64::MAX, "an unrepresentable row pitch must fail");
    
  •        buf_desc[16..24].copy_from_slice(&u64::MAX.to_le_bytes());
    
  •        alloc_info(dev, &mut out, 0, 1, buf_desc.as_ptr());
    
  •        assert_eq!(out[0], u64::MAX, "unrepresentable allocation must fail");
    
  •    }
    
  • }
  • #[test]
  • fn null_resource_gpu_addresses_do_not_wrap_on_an_unrepresentable_buffer() {
  •    unsafe {
    
  •        let mut desc = [0u8; 56];
    
  •        desc[0..4].copy_from_slice(&1u32.to_le_bytes());
    
  •        desc[16..24].copy_from_slice(&1u64.to_le_bytes());
    
  •        let mut first = std::ptr::null_mut();
    
  •        assert_eq!(new_resource(desc.as_ptr(), &mut first), S_OK);
    
  •        desc[16..24].copy_from_slice(&u64::MAX.to_le_bytes());
    
  •        let mut oversized = std::ptr::null_mut();
    
  •        let oversized_result = new_resource(desc.as_ptr(), &mut oversized);
    
  •        desc[16..24].copy_from_slice(&1u64.to_le_bytes());
    
  •        let mut second = std::ptr::null_mut();
    
  •        assert_eq!(new_resource(desc.as_ptr(), &mut second), S_OK);
    
  •        assert_ne!(Resource_GetGPUVirtualAddress(first as *mut NullObj), Resource_GetGPUVirtualAddress(second as *mut NullObj));
    
  •        assert_eq!(oversized_result, E_INVALIDARG);
    
  •        assert!(oversized.is_null());
       }
    
    }

</details>
<!-- greyfinch-sync:ivall/xcl:comment:7239775292 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1631#issuecomment-7239775292). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-28T13:12:53Z. --- Review of exact head [ef0cb29](https://github.com/xcl-dev/xcl/commit/ef0cb29e0ac9513a1ee641013bc5bf1d23bab0aa): three overflow-boundary results remain in the null D3D12 device. - A one-byte resource, a buffer with Width = UINT64_MAX, then another one-byte resource gives the two small live resources the same fake GPU VA (0x100000000 here). The saturated increment still wraps inside AtomicU64::fetch_add. Reject an unrepresentable aligned reservation before creating the object; use a checked atomic increment. - GetResourceAllocationInfo with n = 2 and a null descriptor pointer returns SizeInBytes = 0, which looks like success. An unrepresentable buffer size likewise rounds down. [Microsoft documents UINT64_MAX for allocation errors](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12device-getresourceallocationinfo%28uint_uint_constd3d12_resource_desc%29). - For a 4 GiB buffer, GetCopyableFootprints reports an unpadded row of 0x100000000 bytes but clamps RowPitch to 0xffffff00. A caller cannot copy the advertised row into that pitch. [D3D12 specifies UINT64_MAX in pTotalBytes for an invalid descriptor](https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12device-getcopyablefootprints); Microsoft's [reference helper rejects oversized buffer rows](https://github.com/microsoft/DirectX-Headers/blob/main/include/directx/d3dx12_resource_helpers.h#L430-L436). A local candidate uses one checked 64 KiB alignment helper for creation and allocation queries, checks the atomic VA reservation, and rejects an unrepresentable copy row instead of clamping it. It also leaves the resource output null on creation failure. Test-only assertions on unchanged ef0cb29: cargo test --offline --locked -j 4 -p xcl --lib null_ -- --nocapture --test-threads=1 -> 9 passed, 2 failed, 0 ignored. The failures were the invalid allocation-info result and the duplicate GPU VA. The footprint mismatch follows directly from the head's row-size and pitch expressions. With the candidate: the focused null-device module had 6 passed, 0 failed; cargo build --offline --locked -j 4 --workspace passed; git diff --check passed. Full workspace command on the RTX 3080 Ti: cargo test --offline --locked -j 4 --workspace --no-fail-fast -- --test-threads=4. Unchanged PR head: 1,265 passed, 1 failed, 46 ignored, 25 SKIPPED notices. Candidate: 1,266 passed, 1 failed, 46 ignored, the same 25 skips. The sole failure on both was console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk (DXIL not compiled yet). The extra pass is the added regression. This is an uncommitted candidate on the PR head. A clean-head title smoke and integration with current main remain for the author after any change. Hardware: Windows 11 build 26300, RTX 3080 Ti / 621.35, Ryzen 7 9800X3D, rustc 1.99.1, DXC 1.8.2502.11. AI use: Codex (GPT-6.2 Astra) traced the boundary cases; Codex (GPT-6.2 Sol) wrote and tested the candidate and drafted this review. <details> <summary>Candidate diff (uncommitted)</summary> ```diff diff --git a/crates/xcl/src/hle/d3d12x/null.rs b/crates/xcl/src/hle/d3d12x/null.rs index cce5d484..0bb8f7c3 100644 --- a/crates/xcl/src/hle/d3d12x/null.rs +++ b/crates/xcl/src/hle/d3d12x/null.rs @@ -460,19 +460,29 @@ unsafe fn approx_size(desc: *const u8) -> usize { (width.max(1).saturating_mul(height).saturating_mul(depth).saturating_mul(16) / 3).min(256 << 20) } +fn aligned_resource_size(size: usize) -> Option<u64> { + u64::try_from(size).ok()?.checked_add(0xFFFF).map(|n| n & !0xFFFF) +} + unsafe fn new_resource(desc: *const u8, ppv: *mut *mut c_void) -> HRESULT { if ppv.is_null() { return S_FALSE; } + *ppv = std::ptr::null_mut(); + let size = approx_size(desc); + let Some(step) = aligned_resource_size(size) else { + return E_INVALIDARG; + }; + // A fake GPU VA must not wrap into the range of another live null resource. + static NEXT_VA: AtomicU64 = AtomicU64::new(0x1_0000_0000); + let Ok(va) = NEXT_VA.try_update(Ordering::Relaxed, Ordering::Relaxed, |next| next.checked_add(step)) else { + return E_INVALIDARG; + }; let o = new_obj(Kind::Resource); if !desc.is_null() { std::ptr::copy_nonoverlapping(desc, (*o).desc.as_mut_ptr(), 56); } - let size = approx_size(desc); *(*o).mem.lock().unwrap() = (0, size); - // unique fake GPU VA (64 KiB aligned bump allocator) - static NEXT_VA: AtomicU64 = AtomicU64::new(0x1_0000_0000); - let va = NEXT_VA.fetch_add((size as u64).saturating_add(0xFFFF) & !0xFFFF, Ordering::Relaxed); (*o).value.store(va, Ordering::Relaxed); *ppv = o as *mut c_void; S_OK @@ -480,15 +490,23 @@ unsafe fn new_resource(desc: *const u8, ppv: *mut *mut c_void) -> HRESULT { unsafe extern "system" fn Device_GetResourceAllocationInfo(a: *mut c_void, b: *mut c_void, _mask: u32, n: u32, descs: *const u8) -> *mut u64 { let ret = this_and_ret(a, b).1 as *mut u64; - let mut total = 0usize; - if !descs.is_null() { + let mut total = 0u64; + let mut valid = n == 0 || !descs.is_null(); + if valid { for i in 0..n as usize { - let aligned = approx_size(descs.add(i * 56)).saturating_add(0xFFFF) & !0xFFFF; - total = total.saturating_add(aligned); + let Some(aligned) = aligned_resource_size(approx_size(descs.add(i * 56))) else { + valid = false; + break; + }; + let Some(next) = total.checked_add(aligned) else { + valid = false; + break; + }; + total = next; } } if !ret.is_null() { - *ret = total as u64; + *ret = if valid { total } else { u64::MAX }; *ret.add(1) = 0x10000; } ret @@ -547,8 +565,15 @@ unsafe extern "system" fn Device_GetCopyableFootprints( let height = if desc.is_null() { 1 } else { (desc.add(24) as *const u32).read_unaligned().max(1) }; let format = if desc.is_null() { 0 } else { (desc.add(32) as *const u32).read_unaligned() }; let bpp = if dim == 1 { 1u64 } else { 4u64 }; - let row_bytes = width.saturating_mul(bpp); - let row = (row_bytes.saturating_add(255) & !255).min((u32::MAX & !255) as u64) as u32; + let Some(row_bytes) = width.checked_mul(bpp) else { + if !total.is_null() { *total = u64::MAX; } + return; + }; + let Some(row) = row_bytes.checked_add(255).map(|n| n & !255).filter(|&n| n <= u32::MAX as u64 && width <= u32::MAX as u64) else { + if !total.is_null() { *total = u64::MAX; } + return; + }; + let row = row as u32; for i in 0..num as usize { if !layouts.is_null() { let l = layouts.add(i * 32); @@ -886,7 +911,7 @@ mod tests { // Null descs with n >= 2 must not compute null.add(56) and dereference 0x38. let mut out = [99u64; 2]; alloc_info(dev, &mut out, 0, 2, std::ptr::null()); - assert_eq!(out, [0, 0x10000]); + assert_eq!(out, [u64::MAX, 0x10000]); // Huge 2D dimensions in approx_size must saturate instead of panicking. let mut huge_tex = [0u8; 56]; @@ -911,11 +936,36 @@ mod tests { assert_eq!(row_pitch, 1u32 << 30, "1 GiB buffer RowPitch must not truncate to 0"); assert_eq!(row_size, 1u64 << 30); - // Extreme width in GetCopyableFootprints must saturate without overflow panic. - buf_desc[16..24].copy_from_slice(&(u64::MAX / 2).to_le_bytes()); + // An unrepresentable row pitch must report an invalid footprint. + buf_desc[16..24].copy_from_slice(&(1u64 << 32).to_le_bytes()); footprints(dev, buf_desc.as_ptr(), 0, 1, 0, layout.as_mut_ptr(), std::ptr::null_mut(), &mut row_size, &mut total); - let huge_pitch = u32::from_le_bytes(layout[24..28].try_into().unwrap()); - assert_eq!(huge_pitch, u32::MAX & !255); + assert_eq!(total, u64::MAX, "an unrepresentable row pitch must fail"); + + buf_desc[16..24].copy_from_slice(&u64::MAX.to_le_bytes()); + alloc_info(dev, &mut out, 0, 1, buf_desc.as_ptr()); + assert_eq!(out[0], u64::MAX, "unrepresentable allocation must fail"); + } + } + + #[test] + fn null_resource_gpu_addresses_do_not_wrap_on_an_unrepresentable_buffer() { + unsafe { + let mut desc = [0u8; 56]; + desc[0..4].copy_from_slice(&1u32.to_le_bytes()); + desc[16..24].copy_from_slice(&1u64.to_le_bytes()); + let mut first = std::ptr::null_mut(); + assert_eq!(new_resource(desc.as_ptr(), &mut first), S_OK); + + desc[16..24].copy_from_slice(&u64::MAX.to_le_bytes()); + let mut oversized = std::ptr::null_mut(); + let oversized_result = new_resource(desc.as_ptr(), &mut oversized); + + desc[16..24].copy_from_slice(&1u64.to_le_bytes()); + let mut second = std::ptr::null_mut(); + assert_eq!(new_resource(desc.as_ptr(), &mut second), S_OK); + assert_ne!(Resource_GetGPUVirtualAddress(first as *mut NullObj), Resource_GetGPUVirtualAddress(second as *mut NullObj)); + assert_eq!(oversized_result, E_INVALIDARG); + assert!(oversized.is_null()); } } ``` </details>
throny commented 2026-11-28 14:12:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T14:12:46Z.


merge-check claim
head: ef0cb29e0a

<!-- greyfinch-sync:ivall/xcl:comment:7240501477 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1631#issuecomment-7240501477). Originally posted by [throny](https://github.com/throny) on 2026-11-28T14:12:46Z. --- merge-check claim head: ef0cb29e0ac9513a1ee641013bc5bf1d23bab0aa
throny commented 2026-11-28 14:26:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-28T14:26:33Z.


merge-check
base: b937fbab
head: ef0cb29e0a
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2141 passed, 1 failed, 48 ignored (26 SKIPPED lines). The one failure is gpu::dxil::msaa_tests::direct_msaa_loads_precede_get_dimensions, which fails on main without this PR too (reported on #3093) and in every tree of this batch; the nine failures main had since #2959 are gone at b937fbab. I did not run b937fbab alone: the last base-only run is e13d6250 (2130 passed, 10 failed, 48 ignored).
review: an improvement, and all of it in the null device, which the default runtime does not use. The null-description guard fixes a real crash (with two or more descriptions the old code read through a null pointer). Three edge cases from an earlier review in the thread remain, none of them a regression: a buffer of the maximum width still wraps the fake address counter, so two later small resources can get the same fake address; a null description list returns size 0 where the maximum would say "invalid"; and for a buffer of 4 GiB or more the row size is the full row while the row pitch is clamped. A candidate patch for these is in the thread, without an answer.
performance: none.
verdict: safe to merge (the three edge cases as a follow-up)
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).

<!-- greyfinch-sync:ivall/xcl:comment:7240672788 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1631#issuecomment-7240672788). Originally posted by [throny](https://github.com/throny) on 2026-11-28T14:26:33Z. --- merge-check base: b937fbab head: ef0cb29e0ac9513a1ee641013bc5bf1d23bab0aa merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2141 passed, 1 failed, 48 ignored (26 SKIPPED lines). The one failure is gpu::dxil::msaa_tests::direct_msaa_loads_precede_get_dimensions, which fails on main without this PR too (reported on #3093) and in every tree of this batch; the nine failures main had since #2959 are gone at b937fbab. I did not run b937fbab alone: the last base-only run is e13d6250 (2130 passed, 10 failed, 48 ignored). review: an improvement, and all of it in the null device, which the default runtime does not use. The null-description guard fixes a real crash (with two or more descriptions the old code read through a null pointer). Three edge cases from an earlier review in the thread remain, none of them a regression: a buffer of the maximum width still wraps the fake address counter, so two later small resources can get the same fake address; a null description list returns size 0 where the maximum would say "invalid"; and for a buffer of 4 GiB or more the row size is the full row while the row pitch is clamped. A candidate patch for these is in the thread, without an answer. performance: none. verdict: safe to merge (the three edge cases as a follow-up) hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
thehollowedone commented 2026-11-29 04:41:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-29T04:41:46Z.


merge-check
base: fa204595a4
head: ef0cb29e0a
merge: clean (local merge commit fbe17b6b35e851016c03ba734de270691646044a; git diff --check clean)
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2607 passed, 3 failed, 49 ignored; SKIPPED: 26 notices (mainly no native wave64, plus unsupported f16 paths and no heap windows). The failing tests were console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk (1 failure) and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (2 failed attempts within its test binary). Both reproduce at untouched base fa204595 in focused runs, with the same failure points; neither touches this PR's null-device path.
review: I read the full one-file merge diff at ef0cb29. The null-description crash guard, unaligned descriptor accesses, saturating texture-size calculation, and 1 GiB buffer RowPitch result match the test that passed within the suite. The three extreme-width cases in my earlier review still need follow-up; this PR does not make them worse. The title smoke uses the real D3D12 backend and therefore does not exercise the null device.
performance: Paired 60 s smoke on the same anonymous title, debug binaries and XCL_PREPARE=0: base 1310 frames, 15082 MB peak commit; merged tree 1296 frames, 14658 MB. Both exited 0x0 with 0 device removals and 0 crashes; last three 2 s present counts were 61/61/60 and 60/61/60 respectively. One run each does not establish a performance difference. The changed null-device path is outside the default real-GPU runtime.
verdict: safe to merge (for this PR's tested scope; the previously reported extreme-width cases remain follow-up work)
hardware / tool and model: NVIDIA RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, rustc 1.99.1 MSVC, DXC 1.8.2502.11, debug; Codex (GPT-6.2 Sol) ran the checks and reviewed the merge diff.

<!-- greyfinch-sync:ivall/xcl:comment:7250806499 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1631#issuecomment-7250806499). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-29T04:41:46Z. --- merge-check base: fa204595a488c60c6c5f905244f0172072c9c2a9 head: ef0cb29e0ac9513a1ee641013bc5bf1d23bab0aa merge: clean (local merge commit fbe17b6b35e851016c03ba734de270691646044a; git diff --check clean) build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2607 passed, 3 failed, 49 ignored; SKIPPED: 26 notices (mainly no native wave64, plus unsupported f16 paths and no heap windows). The failing tests were console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk (1 failure) and two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (2 failed attempts within its test binary). Both reproduce at untouched base fa204595 in focused runs, with the same failure points; neither touches this PR's null-device path. review: I read the full one-file merge diff at [ef0cb29](https://github.com/xcl-dev/xcl/commit/ef0cb29e0ac9513a1ee641013bc5bf1d23bab0aa). The null-description crash guard, unaligned descriptor accesses, saturating texture-size calculation, and 1 GiB buffer RowPitch result match the test that passed within the suite. The three extreme-width cases in [my earlier review](https://github.com/xcl-dev/xcl/pull/1631#issuecomment-7239775292) still need follow-up; this PR does not make them worse. The title smoke uses the real D3D12 backend and therefore does not exercise the null device. performance: Paired 60 s smoke on the same anonymous title, debug binaries and XCL_PREPARE=0: base 1310 frames, 15082 MB peak commit; merged tree 1296 frames, 14658 MB. Both exited 0x0 with 0 device removals and 0 crashes; last three 2 s present counts were 61/61/60 and 60/61/60 respectively. One run each does not establish a performance difference. The changed null-device path is outside the default real-GPU runtime. verdict: safe to merge (for this PR's tested scope; the previously reported extreme-width cases remain follow-up work) hardware / tool and model: NVIDIA RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, rustc 1.99.1 MSVC, DXC 1.8.2502.11, debug; Codex (GPT-6.2 Sol) ran the checks and reviewed the merge diff.
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!1621
No description provided.