D3D12.X: fix use-after-move in device init, silence deprecation #1696

Open
github-bot wants to merge 2 commits from github-bot/gh-1696 into main AGit
Owner

@⁠saurabhbhoir456 on GitHub · 2026-11-24 19:22 UTC · original
saurabhbhoir456:fix/d3d12x-wave-mode-fix → main · +6 −1 · 2 files · 2 commits · open

What changes and why

Two independent fixes in the D3D12.X subsystem:

  1. Fix use-after-move in device initialization wave mode logging (crates/xcl/src/hle/d3d12x/real.rs)

    • Wave mode logging was placed after device.into_raw(), which consumes device
    • Moved logging before the move so &device is valid for wave32_only_for_device and graphics_wave32_for_device queries
    • Fixes compile error on device initialization
  2. Silence deprecation warning for Atomic::try_update (crates/xcl/src/hle/xgameruntime/mod.rs)

    • Atomic::fetch_update was renamed to try_update in Rust 1.81
    • Updated XUserCloseHandle to use the new method name

What is in it

  • D3D12.X: fix use-after-move in device initialization wave mode logging (real.rs)
  • D3D12.X: silence deprecation warning for Atomic::try_update (xgameruntime/mod.rs)

Tested

  • Hardware: AMD Radeon RX 7900 XTX (RDNA3), Windows 11 26300, Rust 1.83.0 (stable-x86_64-pc-windows-msvc), debug profile
  • Commands: cargo build --workspace; cargo test --workspace -- --test-threads=4
  • Results: 735 passed, 0 failed, 45 ignored
  • SKIPPED GPU tests: none (adapter supports SM 6.6, DXC available)

Regression run

  • Not yet run (requires retail title). Will run scripts/smoke.ps1 -Game <folder> on main and this branch head and paste both xcl-smoke blocks.

Not tested

  • Retail title (no game available for smoke test)
  • NVIDIA / Intel GPUs
  • Wave32-only GPU configurations
  • Console GDK validation

AI use

  • Claude Code, Claude Opus 5.5: fixed compile error (use-after-move) and deprecation warning; wrote PR description
**@⁠saurabhbhoir456** on GitHub · 2026-11-24 19:22 UTC · [original](https://github.com/xcl-dev/xcl/pull/1696) `saurabhbhoir456:fix/d3d12x-wave-mode-fix` → `main` · +6 −1 · 2 files · 2 commits · open **What changes and why** Two independent fixes in the D3D12.X subsystem: 1. **Fix use-after-move in device initialization wave mode logging** (`crates/xcl/src/hle/d3d12x/real.rs`) - Wave mode logging was placed after `device.into_raw()`, which consumes `device` - Moved logging before the move so `&device` is valid for `wave32_only_for_device` and `graphics_wave32_for_device` queries - Fixes compile error on device initialization 2. **Silence deprecation warning for `Atomic::try_update`** (`crates/xcl/src/hle/xgameruntime/mod.rs`) - `Atomic::fetch_update` was renamed to `try_update` in Rust 1.81 - Updated `XUserCloseHandle` to use the new method name **What is in it** - `D3D12.X: fix use-after-move in device initialization wave mode logging` (real.rs) - `D3D12.X: silence deprecation warning for Atomic::try_update` (xgameruntime/mod.rs) **Tested** - Hardware: AMD Radeon RX 7900 XTX (RDNA3), Windows 11 26300, Rust 1.83.0 (stable-x86_64-pc-windows-msvc), debug profile - Commands: `cargo build --workspace; cargo test --workspace -- --test-threads=4` - Results: 735 passed, 0 failed, 45 ignored - SKIPPED GPU tests: none (adapter supports SM 6.6, DXC available) **Regression run** - Not yet run (requires retail title). Will run `scripts/smoke.ps1 -Game <folder>` on main and this branch head and paste both xcl-smoke blocks. **Not tested** - Retail title (no game available for smoke test) - NVIDIA / Intel GPUs - Wave32-only GPU configurations - Console GDK validation **AI use** - Claude Code, Claude Opus 5.5: fixed compile error (use-after-move) and deprecation warning; wrote PR description
Wave mode logging was placed after device.into_raw() which consumes device.
Moved the logging before the move so &device is still valid for the
wave32_only_for_device and graphics_wave32_for_device queries.

Fixes compile error on device initialization.
Atomic::fetch_update was renamed to try_update in Rust 1.81.
Updated XUserCloseHandle to use the new method name.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:01:57 +00:00
Author
Owner

@⁠Toons29 on GitHub · 2026-11-24 21:43 UTC · original

Regression run of 56f53699 on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 4178e888, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 4178e888c0b5be50a2887eda45cdb832763b68a4
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1618 (PresentX 1618)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 14831 MB
xcl-smoke v1
commit: 56f53699d6b19ee018c4aa942ae6a7b5b4a23119
gpu: AMD Radeon RX 9070
title: game.exe
seconds: 60
exit: 0x0
frames shown: 1627 (PresentX 1627)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14685 MB

Against the limits in CONTRIBUTING.md: 101 % of main's frames, 99 % of its peak commit, no crash, no device removal.

AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, cargo build --release -p xcl, 60 s, XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.

AI use: Claude Code (Claude Opus 5.5) built both trees and ran scripts/smoke.ps1; I checked the blocks before posting.

**@⁠Toons29** on GitHub · 2026-11-24 21:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/1696#issuecomment-7145302785) Regression run of `56f53699` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `4178e888`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 4178e888c0b5be50a2887eda45cdb832763b68a4 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1618 (PresentX 1618) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 14831 MB ``` ``` xcl-smoke v1 commit: 56f53699d6b19ee018c4aa942ae6a7b5b4a23119 gpu: AMD Radeon RX 9070 title: game.exe seconds: 60 exit: 0x0 frames shown: 1627 (PresentX 1627) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14685 MB ``` Against the limits in CONTRIBUTING.md: 101 % of `main`'s frames, 99 % of its peak commit, no crash, no device removal. AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0, `cargo build --release -p xcl`, 60 s, `XCL_NETWORK=0`. This is a regression check only: it does not show whether the run reaches the code this PR changes. AI use: Claude Code (Claude Opus 5.5) built both trees and ran `scripts/smoke.ps1`; I checked the blocks before posting.
Author
Owner

@⁠MiharaxD on GitHub · 2026-11-24 21:44 UTC · original

Test report on an NVIDIA card, head 56f5369 (on main 384f7f7), which covers the "NVIDIA" line.

Tested

  • RTX 3070 Ti 8 GB (driver 621.01), Intel i5-14400F, 32 GB RAM, Windows 11 Pro 10.0.26300, Rust 1.100.0, DXC 1.9.2602.17.
  • cargo build --workspace, then cargo test --workspace --no-fail-fast -- --test-threads=4 (debug) on 56f5369: 737 passed, 0 failed, 41 ignored (lib tests 694 / 0 / 21).
  • SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), gpu_wave32_program_in_wave64_hardware (no wave64).
  • Retail title, the PR's smoke run below: the new line is logged once, at 1.7 s:
    [INFO ] D3D12.X: wave mode: compute_wave32=true, graphics_wave32=true, split_forced=false
    
    That matches this card (32-lane waves, no XCL_SPLIT_WAVE64).

Regression run
scripts/smoke.ps1 -Game <game folder> -Seconds 60 (release builds, start screen, no input). main is c160d86:

main:

xcl-smoke v1
commit: c160d86ef2efe3a07e4dfb473e4fa72eafb413c0
gpu: NVIDIA GeForce RTX 3070 Ti
title: game
seconds: 60
exit: 0x0
frames shown: 1586 (PresentX 1586)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15055 MB

this PR's head:

xcl-smoke v1
commit: 56f53699d6b19ee018c4aa942ae6a7b5b4a23119
gpu: NVIDIA GeForce RTX 3070 Ti
title: game
seconds: 60
exit: 0x0
frames shown: 1577 (PresentX 1578)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16164 MB

Not tested

  • Wave64 hardware (AMD) and XCL_SPLIT_WAVE64=1.
  • Intel, gameplay past the start screen.

AI use: Claude Code (Claude Opus 5.5) built the PR, ran the tests and both smoke runs, read the logs and wrote this report; I checked it before posting.

**@⁠MiharaxD** on GitHub · 2026-11-24 21:44 UTC · [original](https://github.com/xcl-dev/xcl/pull/1696#issuecomment-7145320476) Test report on an NVIDIA card, head `56f5369` (on `main` `384f7f7`), which covers the "NVIDIA" line. **Tested** - RTX 3070 Ti 8 GB (driver 621.01), Intel i5-14400F, 32 GB RAM, Windows 11 Pro 10.0.26300, Rust 1.100.0, DXC 1.9.2602.17. - `cargo build --workspace`, then `cargo test --workspace --no-fail-fast -- --test-threads=4` (debug) on `56f5369`: **737 passed, 0 failed, 41 ignored** (lib tests 694 / 0 / 21). - SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask` (no wave64), `gpu_wave32_program_in_wave64_hardware` (no wave64). - Retail title, the PR's smoke run below: the new line is logged once, at 1.7 s: ``` [INFO ] D3D12.X: wave mode: compute_wave32=true, graphics_wave32=true, split_forced=false ``` That matches this card (32-lane waves, no `XCL_SPLIT_WAVE64`). **Regression run** `scripts/smoke.ps1 -Game <game folder> -Seconds 60` (release builds, start screen, no input). `main` is `c160d86`: main: ``` xcl-smoke v1 commit: c160d86ef2efe3a07e4dfb473e4fa72eafb413c0 gpu: NVIDIA GeForce RTX 3070 Ti title: game seconds: 60 exit: 0x0 frames shown: 1586 (PresentX 1586) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15055 MB ``` this PR's head: ``` xcl-smoke v1 commit: 56f53699d6b19ee018c4aa942ae6a7b5b4a23119 gpu: NVIDIA GeForce RTX 3070 Ti title: game seconds: 60 exit: 0x0 frames shown: 1577 (PresentX 1578) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16164 MB ``` **Not tested** - Wave64 hardware (AMD) and `XCL_SPLIT_WAVE64=1`. - Intel, gameplay past the start screen. **AI use:** Claude Code (Claude Opus 5.5) built the PR, ran the tests and both smoke runs, read the logs and wrote this report; I checked it before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 22:02 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored.

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 22:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/1696#issuecomment-7145729371) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. Thanks!
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 04:26 UTC · original

XCL PR #1696 verification

Clean detached head 56f53699d6b19ee018c4aa942ae6a7b5b4a23119. Changed files are crates/xcl/src/hle/d3d12x/real.rs and crates/xcl/src/hle/xgameruntime/mod.rs.

Tested

STOR-WINLAB ran Windows 11 Enterprise Evaluation build 26200 on an AMD Ryzen 7 3800X and Intel Arc A770 with driver 32.0.101.9175. dxc.exe --version reported 1.9.2609.5. Rust was rustc 1.100.0 (0ef1bc386 2026-11-09) for x86_64-pc-windows-msvc. Unoptimized builds disabled debug info and incremental compilation.

  • cargo build --workspace and cargo test --workspace --no-run both exited 0 outside the Arc lock, with 0 compiler warnings each. The test build produced 18 executables, with the XUserCloseHandle deprecation warning absent.
  • cargo test -p xcl --lib hle::xgameruntime::tests::user_add_and_queries passed and exercised XUserCloseHandle with XCL_ADAPTER=NONE_CPU_ONLY outside the lock.
  • cargo test -p xcl --lib gpu::recomp::tests::gpu_uma_import_check_at_init and cargo test -p xcl --test sparse_reinit each passed under Invoke-ArcTest.ps1 with XCL_ADAPTER=A770. Device init reported UMA import ok and logged compute_wave32=true, graphics_wave32=true, split_forced=false. Each focused run had 1 passed, 0 failed, 0 ignored and 0 skips.
  • One cargo test --workspace --no-fail-fast -- --test-threads=4 run under the Arc lock with XCL_ADAPTER=A770 and RUST_TEST_NOCAPTURE=1 exited 101. Summing all 19 test result: lines in pr1696-suite.log gives 721 passed, 16 failed and 41 ignored across 18 binaries and one doctest harness. All three focused tests also passed in this run.

Workspace failures and skips

  • 15 library tests failed. Eleven hit CreateComputePipelineState error 0x80070057. Four reported output mismatches in FMA overflow, mip sampling, 16-bit VALU and whole-wave pixel reductions.
  • The test title failed its RSSetDepthBiasX check. The top-right pixel was blue instead of green.
  • Five lines begin with SKIPPED . Two cite wave64, two cite missing D3D12 debug-layer components and one cites tiled resource tier. These paths provided no coverage.

Not tested

Matched main baseline, retail-title smoke, retail sample fixtures, other GPU vendors and forced split-wave mode.

AI use

T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1696-suite.log and published.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 04:26 UTC · [original](https://github.com/xcl-dev/xcl/pull/1696#issuecomment-7152837800) # XCL PR #1696 verification Clean detached head `56f53699d6b19ee018c4aa942ae6a7b5b4a23119`. Changed files are `crates/xcl/src/hle/d3d12x/real.rs` and `crates/xcl/src/hle/xgameruntime/mod.rs`. **Tested** STOR-WINLAB ran Windows 11 Enterprise Evaluation build 26200 on an AMD Ryzen 7 3800X and Intel Arc A770 with driver 32.0.101.9175. `dxc.exe --version` reported 1.9.2609.5. Rust was `rustc 1.100.0 (0ef1bc386 2026-11-09)` for `x86_64-pc-windows-msvc`. Unoptimized builds disabled debug info and incremental compilation. - `cargo build --workspace` and `cargo test --workspace --no-run` both exited 0 outside the Arc lock, with 0 compiler warnings each. The test build produced 18 executables, with the `XUserCloseHandle` deprecation warning absent. - `cargo test -p xcl --lib hle::xgameruntime::tests::user_add_and_queries` passed and exercised `XUserCloseHandle` with `XCL_ADAPTER=NONE_CPU_ONLY` outside the lock. - `cargo test -p xcl --lib gpu::recomp::tests::gpu_uma_import_check_at_init` and `cargo test -p xcl --test sparse_reinit` each passed under `Invoke-ArcTest.ps1` with `XCL_ADAPTER=A770`. Device init reported UMA import `ok` and logged `compute_wave32=true, graphics_wave32=true, split_forced=false`. Each focused run had 1 passed, 0 failed, 0 ignored and 0 skips. - One `cargo test --workspace --no-fail-fast -- --test-threads=4` run under the Arc lock with `XCL_ADAPTER=A770` and `RUST_TEST_NOCAPTURE=1` exited 101. Summing all 19 `test result:` lines in `pr1696-suite.log` gives 721 passed, 16 failed and 41 ignored across 18 binaries and one doctest harness. All three focused tests also passed in this run. **Workspace failures and skips** - 15 library tests failed. Eleven hit `CreateComputePipelineState` error `0x80070057`. Four reported output mismatches in FMA overflow, mip sampling, 16-bit VALU and whole-wave pixel reductions. - The test title failed its `RSSetDepthBiasX` check. The top-right pixel was blue instead of green. - Five lines begin with `SKIPPED `. Two cite wave64, two cite missing D3D12 debug-layer components and one cites tiled resource tier. These paths provided no coverage. **Not tested** Matched `main` baseline, retail-title smoke, retail sample fixtures, other GPU vendors and forced split-wave mode. **AI use** T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against `pr1696-suite.log` and published.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1696/head:github-bot/gh-1696'
git switch 'github-bot/gh-1696'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1696'
git switch 'github-bot/gh-1696'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1696'
git switch 'github-bot/gh-1696'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1696'
git switch 'main'
git merge --squash 'github-bot/gh-1696'
git switch 'main'
git merge --ff-only 'github-bot/gh-1696'
git switch 'main'
git merge 'github-bot/gh-1696'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.