D3D12.X: a pipeline is forgotten before its address is free #2412

Open
veyn-sudo wants to merge 1 commit from upstream-pr/2422 into main
veyn-sudo commented 2026-11-25 18:24:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by veyn-sudo on 2026-11-25T18:24:58Z.


pso_release drops what XCL keeps of a pipeline by its address (forget_pso) after the driver has freed it. A pipeline that another thread makes in between can get the same address, register itself, and lose its own entries: a translated compute program then counts as untranslated (is_translated_compute) and its dispatches are skipped. Background workers make pipelines while titles release them, so nothing keeps the two apart.

Found by reading the code while looking into #2403. I have not seen it happen in a title. res_release has the same question, see #1404 and #1527; the stand-ins of standin.rs already forget first. #2417 changes pso_release too, as part of a larger change; with XCL_LATE_RELEASE=0 it still forgets after the release.

What is in it

  • crates/xcl/src/hle/d3d12x/real.rs: on the last reference (AddRef says 2) pso_release forgets before it releases. Two threads that release the last two references at once can both miss being the last: then it is forgotten after the release, as before.
  • The same file, test: a pipeline is forgotten when its last reference goes, and not while there are others. It fails on main (left: Some(true), right: Some(false)).

Tested

  • RTX 2070 SUPER (driver 617.14), i7-9700K, 32 GB, Windows 11 26300, Rust 1.99.0, debug for the tests, release for the title.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on 349970c: 1364 passed, 0 failed, 46 ignored.
  • 25 SKIPPED lines: 21 no wave64, 3 f16 forms refused, 1 no heap windows.

Regression run

main:

xcl-smoke v1
commit: 2898511af1c038a2ef809719e9b6f89e5675c422
gpu: NVIDIA GeForce RTX 2070 SUPER
title: 404998dc
seconds: 60
exit: 0x0
frames shown: 1552 (PresentX 1553)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14701 MB

this PR:

xcl-smoke v1
commit: 349970c0a7ad9d336675e3ea2a93263294c09511
gpu: NVIDIA GeForce RTX 2070 SUPER
title: 404998dc
seconds: 60
exit: 0x0
frames shown: 1557 (PresentX 1557)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14630 MB

Not tested

  • AMD and Intel; the race itself in a title (how many pipelines the smoke run releases is not counted).

AI use

  • Claude Code with Claude Opus 5.5 found this, wrote the fix and the test, ran everything on my PC and wrote this description.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WStEFektfHt5AEbK6Wupac

<!-- greyfinch-sync:ivall/xcl:issue:5496850695 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2422). Originally posted by [veyn-sudo](https://github.com/veyn-sudo) on 2026-11-25T18:24:58Z. --- `pso_release` drops what XCL keeps of a pipeline by its address (`forget_pso`) after the driver has freed it. A pipeline that another thread makes in between can get the same address, register itself, and lose its own entries: a translated compute program then counts as untranslated (`is_translated_compute`) and its dispatches are skipped. Background workers make pipelines while titles release them, so nothing keeps the two apart. Found by reading the code while looking into #2403. I have not seen it happen in a title. `res_release` has the same question, see #1404 and #1527; the stand-ins of `standin.rs` already forget first. #2417 changes `pso_release` too, as part of a larger change; with `XCL_LATE_RELEASE=0` it still forgets after the release. **What is in it** - `crates/xcl/src/hle/d3d12x/real.rs`: on the last reference (`AddRef` says 2) `pso_release` forgets before it releases. Two threads that release the last two references at once can both miss being the last: then it is forgotten after the release, as before. - The same file, test: a pipeline is forgotten when its last reference goes, and not while there are others. It fails on `main` (`left: Some(true)`, `right: Some(false)`). **Tested** - RTX 2070 SUPER (driver 617.14), i7-9700K, 32 GB, Windows 11 26300, Rust 1.99.0, debug for the tests, release for the title. - `cargo test --workspace --no-fail-fast -- --test-threads=4` on `349970c`: 1364 passed, 0 failed, 46 ignored. - 25 `SKIPPED` lines: 21 no wave64, 3 f16 forms refused, 1 no heap windows. **Regression run** main: ``` xcl-smoke v1 commit: 2898511af1c038a2ef809719e9b6f89e5675c422 gpu: NVIDIA GeForce RTX 2070 SUPER title: 404998dc seconds: 60 exit: 0x0 frames shown: 1552 (PresentX 1553) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14701 MB ``` this PR: ``` xcl-smoke v1 commit: 349970c0a7ad9d336675e3ea2a93263294c09511 gpu: NVIDIA GeForce RTX 2070 SUPER title: 404998dc seconds: 60 exit: 0x0 frames shown: 1557 (PresentX 1557) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14630 MB ``` **Not tested** - AMD and Intel; the race itself in a title (how many pipelines the smoke run releases is not counted). **AI use** - Claude Code with Claude Opus 5.5 found this, wrote the fix and the test, ran everything on my PC and wrote this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WStEFektfHt5AEbK6Wupac
emirduran707 commented 2026-11-25 19:09:17 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-25T19:00:11Z.


Independent AMD RDNA4 (native wave64) test report on exact head 836ddedac40e3ef43164a17df941c950c26a3df4 (clean detached checkout, no local changes).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2602.17; tests debug, smoke release.
  • cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1288 passed, 3 failed, 46 ignored; 8 SKIPPED (6 in lower_dxil::tests::{f16,f32}_programs_on_the_gpu refused by per-lane form; heap_window_out_of_memory_falls_back_to_the_switch_form; pso_measurement_compiles_an_exact_synthetic_record). All native wave64 GPU tests ran and passed.
    • The PR's test passed: hle::d3d12x::real::pso_release_tests::a_pipeline_is_forgotten_before_its_address_is_free.
    • The 3 failures are pre-existing on unmodified main 68a284a: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 (seed 722) and fuzz_validate_and_gpu_3 (seed 1599) on this GPU, plus gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier (from 50a9fde / #2074).

Regression run (60 s retail-title smoke, XCL_NETWORK=0, release)

xcl-smoke v1
commit: 836ddedac40e3ef43164a17df941c950c26a3df4
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1572 (PresentX 1572)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 13924 MB

(Matched main 68a284a baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.)

Not tested

  • D3D12 debug layer; Intel GPUs.

AI use

  • Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7171689543 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2422#issuecomment-7171689543). Originally posted by [emirduran707](https://github.com/emirduran707) on 2026-11-25T19:00:11Z. --- Independent AMD RDNA4 (native wave64) test report on exact head `836ddedac40e3ef43164a17df941c950c26a3df4` (clean detached checkout, no local changes). **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64, driver 32.0.31044.16), Ryzen 5 5600, 32 GB RAM, Windows 11 Pro 26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2602.17; tests debug, smoke release. - `cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4`: **1288 passed, 3 failed, 46 ignored; 8 SKIPPED** (6 in `lower_dxil::tests::{f16,f32}_programs_on_the_gpu` refused by per-lane form; `heap_window_out_of_memory_falls_back_to_the_switch_form`; `pso_measurement_compiles_an_exact_synthetic_record`). All native wave64 GPU tests ran and passed. - The PR's test passed: `hle::d3d12x::real::pso_release_tests::a_pipeline_is_forgotten_before_its_address_is_free`. - The 3 failures are pre-existing on unmodified `main` `68a284a`: `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` (seed 722) and `fuzz_validate_and_gpu_3` (seed 1599) on this GPU, plus `gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier` (from `50a9fde` / #2074). **Regression run** (60 s retail-title smoke, `XCL_NETWORK=0`, release) ``` xcl-smoke v1 commit: 836ddedac40e3ef43164a17df941c950c26a3df4 gpu: AMD Radeon RX 9060 XT title: 21222967 seconds: 60 exit: 0x0 frames shown: 1572 (PresentX 1572) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 13924 MB ``` (Matched `main` `68a284a` baseline on the same machine today: 1573 frames, 14420 MB peak, 0 device removals, 0 crashes.) **Not tested** - D3D12 debug layer; Intel GPUs. **AI use** - Antigravity with Gemini 4 Neon ran the build, test suite, and smoke run and drafted this report.
DavidM1911 commented 2026-11-25 20:08:46 +00:00 (Migrated from github.com)

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


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

  • cargo test -p xcl --lib: 1 real failure, deterministic (also fails --test-threads=1, 1219/1):
gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier
  assertion failed: group barriers in the program (lower_dxil.rs:1155)

The lowered program is missing an expected group barrier (or emits one where none is expected). Needs a fix before merge.

— Devin

<!-- greyfinch-sync:ivall/xcl:comment:7172774365 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2422#issuecomment-7172774365). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T19:47:41Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: **1 real failure**, deterministic (also fails `--test-threads=1`, 1219/1): ``` gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier assertion failed: group barriers in the program (lower_dxil.rs:1155) ``` The lowered program is missing an expected group barrier (or emits one where none is expected). Needs a fix before merge. — Devin
bmjask commented 2026-11-25 20:51:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T20:51:19Z.

Review: COMMENTED


P1: pso_release calls the original Release twice: f(this); then let n = f(this). Every caller Release therefore drops two COM references, risking premature pipeline destruction/use-after-free. The new test masks this by starting from two refs; after its first pso_release it sees one rather than proving the expected one-reference decrement. Remove the stray first call and assert exact one-release/one-ref behavior.

<!-- greyfinch-sync:ivall/xcl:review:6064814880 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2422#pullrequestreview-6064814880). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-25T20:51:19Z. **Review:** COMMENTED --- P1: pso_release calls the original Release twice: f(this); then let n = f(this). Every caller Release therefore drops two COM references, risking premature pipeline destruction/use-after-free. The new test masks this by starting from two refs; after its first pso_release it sees one rather than proving the expected one-reference decrement. Remove the stray first call and assert exact one-release/one-ref behavior.
veyn-sudo commented 2026-11-25 21:05:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by veyn-sudo on 2026-11-25T21:04:35Z.


That test was failing on main itself then (#2074's, fixed since). On this head (349970c, rebased) the suite is 1364 passed, 0 failed.

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

<!-- greyfinch-sync:ivall/xcl:comment:7174578733 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2422#issuecomment-7174578733). Originally posted by [veyn-sudo](https://github.com/veyn-sudo) on 2026-11-25T21:04:35Z. --- That test was failing on `main` itself then (#2074's, fixed since). On this head (`349970c`, rebased) the suite is 1364 passed, 0 failed. AI use: Claude Code (Claude Opus 5.5) wrote this.
veyn-sudo commented 2026-11-25 22:06:50 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by veyn-sudo on 2026-11-25T21:46:13Z.


The first Release balances the AddRef (add(this)) above it, which is how the count is read. So a call takes off one reference: the test starts with two and sees one after the first pso_release; two taken off would leave zero.

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

<!-- greyfinch-sync:ivall/xcl:comment:7175516000 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2422#issuecomment-7175516000). Originally posted by [veyn-sudo](https://github.com/veyn-sudo) on 2026-11-25T21:46:13Z. --- The first `Release` balances the `AddRef` (`add(this)`) above it, which is how the count is read. So a call takes off one reference: the test starts with two and sees one after the first `pso_release`; two taken off would leave zero. AI use: Claude Code (Claude Opus 5.5) wrote this.
oni-swr commented 2026-11-25 23:09:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by oni-swr on 2026-11-25T22:10:01Z.


Independent AMD report for 349970c0a7ad9d336675e3ea2a93263294c09511.

Tested

  • AMD Radeon RX 7800 XT (driver 32.0.31035.1003), Ryzen 7 5700X3D, Windows 11 build 26200, rustc 1.100.0, debug profile, DXC from Windows SDK 10.0.26100.0, XCL_ADAPTER=radeon. Exact PR head (not a local merge onto main); main at the time was 6d12f58a.
  • cargo test --workspace --no-fail-fast -j 4 -- --test-threads=4: 1363 passed, 1 failed, 46 ignored. The one failure is gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1 (seed 722: res[30] = 0x1, CPU 0x7fffffff); it fails identically on main 6d12f58a on this adapter (cargo test -p xcl --lib fuzz_validate_and_gpu_1), so it is not caused by this PR.
  • 7 SKIPPED lines: 6 f16_programs_on_the_gpu / f32_programs_on_the_gpu per-lane cases refused for V_MUL_F16, V_PK_MUL_F16 or V_CVT_F16_F32, and heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).
  • The new real::pso_release_tests::a_pipeline_is_forgotten_before_its_address_is_free passed.

Not tested

  • scripts/smoke.ps1 / a retail title (no regression run), other adapters, NVIDIA. No game data was used.

AI use

Claude Code (Claude Sonnet 5.5) ran the tests and wrote this report. No game files, dumps or shader names are included.

<!-- greyfinch-sync:ivall/xcl:comment:7176019877 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2422#issuecomment-7176019877). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-25T22:10:01Z. --- Independent AMD report for `349970c0a7ad9d336675e3ea2a93263294c09511`. **Tested** - AMD Radeon RX 7800 XT (driver 32.0.31035.1003), Ryzen 7 5700X3D, Windows 11 build 26200, rustc 1.100.0, debug profile, DXC from Windows SDK 10.0.26100.0, `XCL_ADAPTER=radeon`. Exact PR head (not a local merge onto `main`); main at the time was `6d12f58a`. - `cargo test --workspace --no-fail-fast -j 4 -- --test-threads=4`: 1363 passed, 1 failed, 46 ignored. The one failure is `gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1` (seed 722: `res[30] = 0x1, CPU 0x7fffffff`); it fails identically on `main` `6d12f58a` on this adapter (`cargo test -p xcl --lib fuzz_validate_and_gpu_1`), so it is not caused by this PR. - 7 SKIPPED lines: 6 `f16_programs_on_the_gpu` / `f32_programs_on_the_gpu` per-lane cases refused for `V_MUL_F16`, `V_PK_MUL_F16` or `V_CVT_F16_F32`, and `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). - The new `real::pso_release_tests::a_pipeline_is_forgotten_before_its_address_is_free` passed. **Not tested** - `scripts/smoke.ps1` / a retail title (no regression run), other adapters, NVIDIA. No game data was used. **AI use** Claude Code (Claude Sonnet 5.5) ran the tests and wrote this report. No game files, dumps or shader names are included.
DavidM1911 commented 2026-11-26 03:06:31 +00:00 (Migrated from github.com)

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


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:7180739698 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2422#issuecomment-7180739698). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T02:22:12Z. --- 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
itsSio commented 2026-11-26 04:07:45 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by itsSio on 2026-11-26T03:57:45Z.


Independent dual-PC NVIDIA full-workspace test report on clean head 349970c0a7ad9d336675e3ea2a93263294c09511.

Tested

  • Machine 1: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro build 26200, rustc 1.97.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug build (XCL_ADAPTER=NVIDIA)
    • cargo build --workspace: exit 0
    • cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1364 passed, 0 failed, 46 ignored (real::pso_release_tests::a_pipeline_is_forgotten_before_its_address_is_free passed)
    • SKIPPED: 26 (wave64-only GPU tests, #1426 wave32 f16/cvt refusals, heap_window_out_of_memory_falls_back_to_the_switch_form, pso_measurement_compiles_an_exact_synthetic_record)
  • Machine 2: NVIDIA GeForce RTX 2080 SUPER (driver 32.0.16.1088), AMD Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro build 26200, rustc 1.99.1 (stable-x86_64-pc-windows-msvc), Windows SDK 10.0.26100 DXC 1.8.2502.11, debug build (XCL_ADAPTER=NVIDIA)
    • cargo build --workspace: exit 0
    • cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1363 passed, 1 failed, 46 ignored (real::pso_release_tests::a_pipeline_is_forgotten_before_its_address_is_free passed; the sole failure was unrelated intermittent xgameruntime::gamesave::tests::atomic_writes_preserve_xcltmp_blobs_and_skip_leftover_temps at gamesave.rs:958, which passed 2/3 standalone reruns and 11/11 in the gamesave module)
    • SKIPPED: 29 (same 26 as Machine 1 plus 3 requiring d3d12SDKLayers.dll)

Not tested

  • Retail title / scripts/smoke.ps1 runs
  • Release builds (--release)
  • AMD / Intel GPUs, native wave64, Linux / Wine / vkd3d-proton

AI use
Ran via Samaritan:

  • Google Antigravity CLI (Claude Opus 5.5 (High)): built the branch and ran the workspace test suite on both NVIDIA machines.
  • Google Antigravity CLI (Gemini 4 Neon (High)): coordinated the runs and wrote this test report.
<!-- greyfinch-sync:ivall/xcl:comment:7182173162 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2422#issuecomment-7182173162). Originally posted by [itsSio](https://github.com/itsSio) on 2026-11-26T03:57:45Z. --- Independent dual-PC NVIDIA full-workspace test report on clean head `349970c0a7ad9d336675e3ea2a93263294c09511`. **Tested** - **Machine 1:** NVIDIA GeForce RTX 5080 (driver `32.0.16.1088`), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro build 26200, `rustc 1.97.0` (`stable-x86_64-pc-windows-msvc`), DXC `1.9.2609.5`, debug build (`XCL_ADAPTER=NVIDIA`) - `cargo build --workspace`: exit 0 - `cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture`: **1364 passed, 0 failed, 46 ignored** (`real::pso_release_tests::a_pipeline_is_forgotten_before_its_address_is_free` passed) - `SKIPPED`: 26 (wave64-only GPU tests, `#1426` wave32 f16/cvt refusals, `heap_window_out_of_memory_falls_back_to_the_switch_form`, `pso_measurement_compiles_an_exact_synthetic_record`) - **Machine 2:** NVIDIA GeForce RTX 2080 SUPER (driver `32.0.16.1088`), AMD Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro build 26200, `rustc 1.99.1` (`stable-x86_64-pc-windows-msvc`), Windows SDK 10.0.26100 DXC `1.8.2502.11`, debug build (`XCL_ADAPTER=NVIDIA`) - `cargo build --workspace`: exit 0 - `cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture`: **1363 passed, 1 failed, 46 ignored** (`real::pso_release_tests::a_pipeline_is_forgotten_before_its_address_is_free` passed; the sole failure was unrelated intermittent `xgameruntime::gamesave::tests::atomic_writes_preserve_xcltmp_blobs_and_skip_leftover_temps` at `gamesave.rs:958`, which passed 2/3 standalone reruns and 11/11 in the `gamesave` module) - `SKIPPED`: 29 (same 26 as Machine 1 plus 3 requiring `d3d12SDKLayers.dll`) **Not tested** - Retail title / `scripts/smoke.ps1` runs - Release builds (`--release`) - AMD / Intel GPUs, native wave64, Linux / Wine / vkd3d-proton **AI use** Ran via Samaritan: - Google Antigravity CLI (Claude Opus 5.5 (High)): built the branch and ran the workspace test suite on both NVIDIA machines. - Google Antigravity CLI (Gemini 4 Neon (High)): coordinated the runs and wrote this test report.
ClosetPie107 commented 2026-11-26 07:03:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ClosetPie107 on 2026-11-26T06:49:14Z.


AMD RDNA4 / Linux (Proton Experimental) test report on head 349970c0 (merged cleanly onto main b49be183):

Hardware & environment

  • AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS Linux
  • Proton Experimental (experimental-11.0-20261112), vkd3d-proton master ec207194 (3.2.0) + dxil-spirv b540c8a2 + relaxed-vtable patch (-Db_ndebug=true), DXVK v3.1.1-209, DXC 1.9.2609.5, Rust x86_64-pc-windows-gnu

Isolated unit / GPU tests (main b49be183 + #2422 349970c0, debug, --test-threads=1, WINEDLLOVERRIDES="d3d12,d3d12core=n"):

  • xcl.exe hle::d3d12x::real:: -- --test-threads=1: 61 passed, 0 failed, 0 ignored (0 skipped).

Combined 300 s retail sanity run (release, main b49be183 + #1540 + #1675 + #1844 + #1899 + #2123 + #2369 + #2422, retail 1.0.2.1 pressing A past menus):

  • Completed full 300 s (exit=0), 0 crashes, 0 device removals, 2,014 PresentX frames, 131,072 translated draws, 660,943 dispatches (44,546 chained split-compute dispatches), 102,631 Opus packets (0 errors).

Not tested

  • Native Windows, full workspace test suite, or #2422 alone in a retail run.

AI use

  • T3 Code / Antigravity (Gemini 4 Neon) merged #2422 onto main, ran the Proton unit tests and combined retail run on this machine, and drafted this report.
<!-- greyfinch-sync:ivall/xcl:comment:7184815034 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2422#issuecomment-7184815034). Originally posted by [ClosetPie107](https://github.com/ClosetPie107) on 2026-11-26T06:49:14Z. --- AMD RDNA4 / Linux (Proton Experimental) test report on head `349970c0` (merged cleanly onto `main` `b49be183`): **Hardware & environment** - AMD Radeon RX 9070 16 GB (RDNA4, RADV GFX1201, Mesa 26.3.1, native wave64), Ryzen 5 9600X, 30 GiB RAM, CachyOS Linux - Proton Experimental (`experimental-11.0-20261112`), `vkd3d-proton` `master` `ec207194` (3.2.0) + `dxil-spirv` `b540c8a2` + relaxed-vtable patch (`-Db_ndebug=true`), DXVK `v3.1.1-209`, DXC `1.9.2609.5`, Rust `x86_64-pc-windows-gnu` **Isolated unit / GPU tests** (`main` `b49be183` + #2422 `349970c0`, debug, `--test-threads=1`, `WINEDLLOVERRIDES="d3d12,d3d12core=n"`): - `xcl.exe hle::d3d12x::real:: -- --test-threads=1`: **61 passed, 0 failed, 0 ignored** (0 skipped). **Combined 300 s retail sanity run** (release, `main` `b49be183` + #1540 + #1675 + #1844 + #1899 + #2123 + #2369 + #2422, retail 1.0.2.1 pressing `A` past menus): - Completed full **300 s (`exit=0`)**, **0 crashes**, **0 device removals**, `2,014` `PresentX` frames, `131,072` translated draws, `660,943` dispatches (`44,546` chained split-compute dispatches), `102,631` Opus packets (0 errors). **Not tested** - Native Windows, full workspace test suite, or #2422 alone in a retail run. **AI use** - T3 Code / Antigravity (Gemini 4 Neon) merged #2422 onto `main`, ran the Proton unit tests and combined retail run on this machine, and drafted this report.
throny commented 2026-11-26 16:18:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by throny on 2026-11-26T16:18:18Z.


Test report: in the world on an RTX 4080 16 GB with XCL_PSO_WAIT_MS=1. Tested together with #2581; with the two, no device loss in 2 runs against 2 of 2 without.

Tested

  • RTX 4080 16 GB (driver 621.40, 1 GiB shader-heap profile of #2590), i9-12900K, 64 GB RAM, Windows 11 26300, release.
  • Both PRs are against main; they were ported by hand onto nvidia-dev af2cecc4 + #684 + #2697 + #2749 + #2729 + #2794 + #2817 (stack) + #2768 + #2782 + #2725. #2581: waits_bounded() after wait_budget() in pso_async.rs and the early return as the first statement of defer in list_x.rs. #2422: the AddRef probe and the forget-before-free order in pso_release (real.rs), keeping that branch's late_release::hold_pipeline call. cargo check and a release build clean; the PRs' tests not run.
  • The retail title of #505, Series X profile, XCL_PSO_WAIT_MS=1 XCL_GFX_PSO_WAIT_MS=200, world from about 170 s. Four runs, alternating: without, with, with, without.
run tree time in the world presents end
28 without 92 s 23 device removed (0x887a0005)
29 with #2581 + #2422 238 s 48 title stop (0xc0000005 in title code), no device loss
30 with #2581 + #2422 446 s 92 ran to the 600 s limit, no device loss
31 without 100 s 24 device removed (0x887a0005)
  • That is the pattern the description names (a device loss soon after world start with bounded waits), 2 of 2 here without and 0 of 2 with. Four runs, and two PRs at once, so I can't say which of the two does it, and this card also loses the device in about half its world runs without XCL_PSO_WAIT_MS (see #2688).
  • One thing that does not fit #2581's mechanism: the line dispatch with a pipeline still being built put off to the submit is in none of the four logs, also not in the two runs without the PR, and split command list … mid-list Wait appears 7–10 times in all four. So on this tree the put-off path was not what ran before the removals; if the fix works here, it is by another route, or the one that matters is #2422.
  • No close E_OUTOFMEMORY / 0x887a0001 in any of the four.

Not tested

  • Each PR alone, the PRs' own heads on main, their tests and the suite, AMD.

AI use: Claude Code (Claude Sonnet 5.5 ported the two diffs, Claude Fable 5.2 ran the runs and wrote this).

Follow-up, same day: at default waits the two PRs do not stop the removal. Three more world runs of the same tree with both PRs and without XCL_PSO_WAIT_MS: device removed (0x887a0005) in 3 of 3, after 76 s, 334 s and 114 s of world. So the 0 of 2 above is either specific to XCL_PSO_WAIT_MS=1 or chance, and the removal this card has on this branch is a different one.

<!-- greyfinch-sync:ivall/xcl:comment:7197464916 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2422#issuecomment-7197464916). Originally posted by [throny](https://github.com/throny) on 2026-11-26T16:18:18Z. --- **Test report: in the world on an RTX 4080 16 GB with `XCL_PSO_WAIT_MS=1`. Tested together with #2581; with the two, no device loss in 2 runs against 2 of 2 without.** **Tested** - RTX 4080 16 GB (driver 621.40, 1 GiB shader-heap profile of #2590), i9-12900K, 64 GB RAM, Windows 11 26300, release. - Both PRs are against `main`; they were ported by hand onto `nvidia-dev` `af2cecc4` + #684 + #2697 + #2749 + #2729 + #2794 + #2817 (stack) + #2768 + #2782 + #2725. #2581: `waits_bounded()` after `wait_budget()` in `pso_async.rs` and the early return as the first statement of `defer` in `list_x.rs`. #2422: the AddRef probe and the forget-before-free order in `pso_release` (`real.rs`), keeping that branch's `late_release::hold_pipeline` call. `cargo check` and a release build clean; the PRs' tests not run. - The retail title of #505, Series X profile, `XCL_PSO_WAIT_MS=1 XCL_GFX_PSO_WAIT_MS=200`, world from about 170 s. Four runs, alternating: without, with, with, without. | run | tree | time in the world | presents | end | |---|---|---|---|---| | 28 | without | 92 s | 23 | device removed (`0x887a0005`) | | 29 | with #2581 + #2422 | 238 s | 48 | title stop (`0xc0000005` in title code), no device loss | | 30 | with #2581 + #2422 | 446 s | 92 | ran to the 600 s limit, no device loss | | 31 | without | 100 s | 24 | device removed (`0x887a0005`) | - That is the pattern the description names (a device loss soon after world start with bounded waits), 2 of 2 here without and 0 of 2 with. Four runs, and two PRs at once, so I can't say which of the two does it, and this card also loses the device in about half its world runs without `XCL_PSO_WAIT_MS` (see #2688). - One thing that does not fit #2581's mechanism: the line `dispatch with a pipeline still being built put off to the submit` is in none of the four logs, also not in the two runs without the PR, and `split command list … mid-list Wait` appears 7–10 times in all four. So on this tree the put-off path was not what ran before the removals; if the fix works here, it is by another route, or the one that matters is #2422. - No close `E_OUTOFMEMORY` / `0x887a0001` in any of the four. **Not tested** - Each PR alone, the PRs' own heads on `main`, their tests and the suite, AMD. AI use: Claude Code (Claude Sonnet 5.5 ported the two diffs, Claude Fable 5.2 ran the runs and wrote this). **Follow-up, same day: at default waits the two PRs do not stop the removal.** Three more world runs of the same tree with both PRs and without `XCL_PSO_WAIT_MS`: device removed (`0x887a0005`) in 3 of 3, after 76 s, 334 s and 114 s of world. So the 0 of 2 above is either specific to `XCL_PSO_WAIT_MS=1` or chance, and the removal this card has on this branch is a different one.
Foniass commented 2026-12-01 08:00:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:00:38Z.


Triage (#1607) – head 349970c

Main's real.rs:pso_release still calls forget_pso only after Release returned 0, so the address-reuse race this PR describes is still there. #2417 also moves forget_pso ahead of the final release, but only with late release on and as part of a much larger change. This PR is the targeted fix. The test drives pso_release through a fake vtable and checks the state at free time. No problems found in the diff. Main's pso_release now also handles pso_manifest generations and late_release::hold_pipeline, so the rebase has to keep those.
Recommendation: keep open.

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:7304758089 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2422#issuecomment-7304758089). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:00:38Z. --- **Triage (#1607)** – head 349970c Main's `real.rs:pso_release` still calls `forget_pso` only after `Release` returned 0, so the address-reuse race this PR describes is still there. #2417 also moves `forget_pso` ahead of the final release, but only with late release on and as part of a much larger change. This PR is the targeted fix. The test drives `pso_release` through a fake vtable and checks the state at free time. No problems found in the diff. Main's `pso_release` now also handles `pso_manifest` generations and `late_release::hold_pipeline`, so the rebase has to keep those. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2422:upstream-pr/2422'
git switch 'upstream-pr/2422'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2422'
git switch 'upstream-pr/2422'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2422'
git switch 'upstream-pr/2422'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2422'
git switch 'main'
git merge --squash 'upstream-pr/2422'
git switch 'main'
git merge --ff-only 'upstream-pr/2422'
git switch 'main'
git merge 'upstream-pr/2422'
git push origin 'main'
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!2412
No description provided.