D3D12.X: retain resolved async pipelines until reset and retirement #2407

Open
fixgep wants to merge 1 commit from upstream-pr/2417 into main
fixgep commented 2026-11-25 18:12:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fixgep on 2026-11-25T18:12:27Z.


Close the remaining async PSO fallback, command-list reset, and pso_release lifetime gaps on top of main's pipeline generation pins (dcfbb49, 665ce02, 3f91865) and late_release::hold_pipeline (eb49926b) (XCL-BT-008). Part of #916. Part of #1488.

What main already covers vs. what this rebased PR keeps:

  • main's PipelineResolution, NativeGeneration recording/submission pins, and late_release::hold_pipeline already retain completed async builds through recording/GPU retirement and defer released backing/two-pass pipelines. Redundant Resolved / Pending::state tracking from the pre-rebase PR has been dropped.
  • Three orthogonal gaps remained on main: (1) real::pso_release called f(this) before forget_ready_compute / forget_pso / pso_async::released (address-reuse race even when XCL_LATE_RELEASE=0) and did not defer the adopted stand-in/PSO itself through late_release; (2) InitialFallback binds (unbuilt stand-ins with generation = None) and PC cl_reset (PreparedNativePipeline::record_generation leaving stale bind::State.resolution across resets, plus set_depth_bias_x/prepare_draw re-probing PENDING) left fallback/bound lifetime gaps; and (3) resolve_and_pin_if_enabled* gated one-shot pinning behind rebuild_recipes_enabled(). Rebased onto upstream/main (6bfb5c51), the diff is 5 files (+817/-102, mostly tests).

What is in it

  • Pin one-shot async builds unconditionally in pso_async::resolve_and_pin_if_enabled* regardless of XCL_REBUILD_RECIPES, align resolve_and_pin_mode / resolve_and_pin_pending with resolve_wait_budgets, and expose is_tracked and retain_com (crates/xcl/src/hle/d3d12x/pso_async.rs)
  • Retain fallback COM references (ListState::retained_fallbacks) in list_x whenever bind::select_native_choice selects an unbuilt stand-in (InitialFallback), propagate them across ExecuteBundle, mid-list splits, and KickoffX, release them via late_release::hold_pipeline (unadopted) or normal Drop (adopted) on reset/release, route set_depth_bias_x and prepare_draw through bind::resolve_bound_native_pipeline, and extend a_dispatch_with_a_pipeline_still_building_waits_at_the_submit to bind an adopted stand-in across mid-list splits (crates/xcl/src/hle/d3d12x/bind.rs, crates/xcl/src/hle/d3d12x/list_x.rs)
  • Commit PreparedNativePipeline in real::cl_reset so bind::State.resolution pins do not outlive PC list resets, probe final refs in real::pso_release (add(this) / f(this) == 1) so forget_ready_compute, forget_pso, and pso_async::released always run before final driver release (even with XCL_LATE_RELEASE=0), and defer adopted PSO release via late_release::hold_adopted_pipeline (orig_fn, avoiding re-entering pso_release) with unit tests in late_release and real::async_pso_lifetime_tests (crates/xcl/src/hle/d3d12x/late_release.rs, crates/xcl/src/hle/d3d12x/real.rs)

Tested

  • Hardware: NVIDIA GeForce RTX 3060 (driver 32.0.16.2140), AMD Ryzen 5 7500F 6-Core Processor, Windows 11 x64 (10.0.26200.0), rustc 1.100.0 (0ef1bc386 2026-11-09) (stable-x86_64-pc-windows-msvc), plus XCL_ADAPTER=warp; debug and release (6908ee6d6208b86e573187209c2ba719bd6ed751 on upstream/main 6bfb5c5153ccc23517daf30aa1071ddb0fadb53c)
  • cargo build -j 4 --workspace, cargo test -j 4 --workspace --no-run, and cargo build -j 4 --release -p xcl: exited 0, 0 new compiler warnings (36 pre-existing in xcl lib vs. 39 on upstream/main; 17 pre-existing in xcl lib tests)
  • Default RTX 3060 (--test-threads=1):
    • cargo test -j 4 -p xcl --lib late_release -- --test-threads=1: 9 passed, 0 failed, 0 ignored (0 SKIPPED)
    • cargo test -j 4 -p xcl --lib pso_async -- --test-threads=1: 193 passed, 0 failed, 0 ignored (0 SKIPPED)
    • cargo test -j 4 -p xcl --lib hle::d3d12x::bind -- --test-threads=1: 116 passed, 0 failed, 0 ignored (1 SKIPPED: two_pass_binds_set_the_shared_view_heap, opt-in XCL_HEAP_WINDOWS=1)
    • cargo test -j 4 -p xcl --lib hle::d3d12x::list_x -- --test-threads=1: 114 passed, 0 failed, 0 ignored (0 SKIPPED)
    • cargo test -j 4 -p xcl --lib hle::d3d12x::console_list -- --test-threads=1: 11 passed, 0 failed, 0 ignored (0 SKIPPED)
    • cargo test -j 4 -p xcl --lib hle::d3d12x::device_x -- --test-threads=1: 23 passed, 0 failed, 0 ignored (0 SKIPPED)
    • cargo test -j 4 -p xcl --lib hle::d3d12x::real -- --test-threads=1: 178 passed, 0 failed, 0 ignored (0 SKIPPED)
  • XCL_ADAPTER=warp (--test-threads=1):
    • late_release: 9 passed, 0 failed, 0 ignored; pso_async: 193 passed, 0 failed, 0 ignored; hle::d3d12x::bind: 116 passed, 0 failed, 0 ignored (1 SKIPPED: no heap windows); hle::d3d12x::list_x: 114 passed, 0 failed, 0 ignored; hle::d3d12x::console_list: 11 passed, 0 failed, 0 ignored; hle::d3d12x::device_x: 23 passed, 0 failed, 0 ignored; hle::d3d12x::real: 178 passed, 0 failed, 0 ignored (1 SKIPPED: gpu_image_load_of_a_stencil_view_gives_the_stencil, no wave64)

Regression run
main (6bfb5c5153ccc23517daf30aa1071ddb0fadb53c):

xcl-smoke v1
commit: 6bfb5c5153ccc23517daf30aa1071ddb0fadb53c
gpu: NVIDIA GeForce RTX 3060
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1659 (PresentX 1659)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 15263 MB

PR (6908ee6d6208b86e573187209c2ba719bd6ed751):

xcl-smoke v1
commit: 6908ee6d6208b86e573187209c2ba719bd6ed751
gpu: NVIDIA GeForce RTX 3060
title: 3c290c16
seconds: 60
exit: 0x0
frames shown: 1660 (PresentX 1660)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 17226 MB

Not tested

  • Full cargo test --workspace execution (only --no-run and the 7 targeted hle::d3d12x test modules above ran on RTX 3060 and WARP)
  • AMD / Intel GPUs, native wave64 hardware, Linux / Wine without VKD3D_CONFIG=retain_psos, non-Windows targets (not built / not tested)
  • XCL_SAMPLE_* external shader packs (unset)

AI use

  • Antigravity (Gemini 4 Hydrogen): audited upstream/main generation pins (dcfbb49, 665ce02, 3f91865) and late_release::hold_pipeline, rebased fix/pso-async-lifetime-retention onto upstream/main 6bfb5c51 by dropping superseded retention logic and rebuilding the remaining InitialFallback / cl_reset / pso_release / one-shot-pin fixes, updated late_release and real::async_pso_lifetime_tests regression tests, and ran the builds, targeted RTX 3060 + WARP tests, and paired 60 s smoke runs.
<!-- greyfinch-sync:ivall/xcl:issue:5496674303 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2417). Originally posted by [fixgep](https://github.com/fixgep) on 2026-11-25T18:12:27Z. --- Close the remaining async PSO fallback, command-list reset, and `pso_release` lifetime gaps on top of `main`'s pipeline generation pins (`dcfbb49`, `665ce02`, `3f91865`) and `late_release::hold_pipeline` (`eb49926b`) (`XCL-BT-008`). Part of #916. Part of #1488. What `main` already covers vs. what this rebased PR keeps: - `main`'s `PipelineResolution`, `NativeGeneration` recording/submission pins, and `late_release::hold_pipeline` already retain completed async builds through recording/GPU retirement and defer released backing/two-pass pipelines. Redundant `Resolved` / `Pending::state` tracking from the pre-rebase PR has been dropped. - Three orthogonal gaps remained on `main`: (1) `real::pso_release` called `f(this)` before `forget_ready_compute` / `forget_pso` / `pso_async::released` (address-reuse race even when `XCL_LATE_RELEASE=0`) and did not defer the adopted stand-in/PSO itself through `late_release`; (2) `InitialFallback` binds (unbuilt stand-ins with `generation = None`) and PC `cl_reset` (`PreparedNativePipeline::record_generation` leaving stale `bind::State.resolution` across resets, plus `set_depth_bias_x`/`prepare_draw` re-probing `PENDING`) left fallback/bound lifetime gaps; and (3) `resolve_and_pin_if_enabled*` gated one-shot pinning behind `rebuild_recipes_enabled()`. Rebased onto `upstream/main` (`6bfb5c51`), the diff is 5 files (`+817/-102`, mostly tests). **What is in it** - Pin one-shot async builds unconditionally in `pso_async::resolve_and_pin_if_enabled*` regardless of `XCL_REBUILD_RECIPES`, align `resolve_and_pin_mode` / `resolve_and_pin_pending` with `resolve_wait_budgets`, and expose `is_tracked` and `retain_com` (`crates/xcl/src/hle/d3d12x/pso_async.rs`) - Retain fallback COM references (`ListState::retained_fallbacks`) in `list_x` whenever `bind::select_native_choice` selects an unbuilt stand-in (`InitialFallback`), propagate them across `ExecuteBundle`, mid-list splits, and `KickoffX`, release them via `late_release::hold_pipeline` (unadopted) or normal `Drop` (adopted) on reset/release, route `set_depth_bias_x` and `prepare_draw` through `bind::resolve_bound_native_pipeline`, and extend `a_dispatch_with_a_pipeline_still_building_waits_at_the_submit` to bind an adopted stand-in across mid-list splits (`crates/xcl/src/hle/d3d12x/bind.rs`, `crates/xcl/src/hle/d3d12x/list_x.rs`) - Commit `PreparedNativePipeline` in `real::cl_reset` so `bind::State.resolution` pins do not outlive PC list resets, probe final refs in `real::pso_release` (`add(this)` / `f(this) == 1`) so `forget_ready_compute`, `forget_pso`, and `pso_async::released` always run before final driver release (even with `XCL_LATE_RELEASE=0`), and defer adopted PSO release via `late_release::hold_adopted_pipeline` (`orig_fn`, avoiding re-entering `pso_release`) with unit tests in `late_release` and `real::async_pso_lifetime_tests` (`crates/xcl/src/hle/d3d12x/late_release.rs`, `crates/xcl/src/hle/d3d12x/real.rs`) **Tested** - Hardware: NVIDIA GeForce RTX 3060 (driver `32.0.16.2140`), AMD Ryzen 5 7500F 6-Core Processor, Windows 11 x64 (`10.0.26200.0`), `rustc 1.100.0 (0ef1bc386 2026-11-09)` (`stable-x86_64-pc-windows-msvc`), plus `XCL_ADAPTER=warp`; debug and release (`6908ee6d6208b86e573187209c2ba719bd6ed751` on `upstream/main` `6bfb5c5153ccc23517daf30aa1071ddb0fadb53c`) - `cargo build -j 4 --workspace`, `cargo test -j 4 --workspace --no-run`, and `cargo build -j 4 --release -p xcl`: exited `0`, 0 new compiler warnings (36 pre-existing in `xcl` lib vs. 39 on `upstream/main`; 17 pre-existing in `xcl` lib tests) - Default RTX 3060 (`--test-threads=1`): - `cargo test -j 4 -p xcl --lib late_release -- --test-threads=1`: `9 passed, 0 failed, 0 ignored` (0 `SKIPPED`) - `cargo test -j 4 -p xcl --lib pso_async -- --test-threads=1`: `193 passed, 0 failed, 0 ignored` (0 `SKIPPED`) - `cargo test -j 4 -p xcl --lib hle::d3d12x::bind -- --test-threads=1`: `116 passed, 0 failed, 0 ignored` (`1 SKIPPED`: `two_pass_binds_set_the_shared_view_heap`, opt-in `XCL_HEAP_WINDOWS=1`) - `cargo test -j 4 -p xcl --lib hle::d3d12x::list_x -- --test-threads=1`: `114 passed, 0 failed, 0 ignored` (0 `SKIPPED`) - `cargo test -j 4 -p xcl --lib hle::d3d12x::console_list -- --test-threads=1`: `11 passed, 0 failed, 0 ignored` (0 `SKIPPED`) - `cargo test -j 4 -p xcl --lib hle::d3d12x::device_x -- --test-threads=1`: `23 passed, 0 failed, 0 ignored` (0 `SKIPPED`) - `cargo test -j 4 -p xcl --lib hle::d3d12x::real -- --test-threads=1`: `178 passed, 0 failed, 0 ignored` (0 `SKIPPED`) - `XCL_ADAPTER=warp` (`--test-threads=1`): - `late_release`: `9 passed, 0 failed, 0 ignored`; `pso_async`: `193 passed, 0 failed, 0 ignored`; `hle::d3d12x::bind`: `116 passed, 0 failed, 0 ignored` (`1 SKIPPED`: `no heap windows`); `hle::d3d12x::list_x`: `114 passed, 0 failed, 0 ignored`; `hle::d3d12x::console_list`: `11 passed, 0 failed, 0 ignored`; `hle::d3d12x::device_x`: `23 passed, 0 failed, 0 ignored`; `hle::d3d12x::real`: `178 passed, 0 failed, 0 ignored` (`1 SKIPPED`: `gpu_image_load_of_a_stencil_view_gives_the_stencil`, `no wave64`) **Regression run** main (`6bfb5c5153ccc23517daf30aa1071ddb0fadb53c`): ``` xcl-smoke v1 commit: 6bfb5c5153ccc23517daf30aa1071ddb0fadb53c gpu: NVIDIA GeForce RTX 3060 title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1659 (PresentX 1659) presents per 2 s (last 3): 60 61 60 device removals: 0 crashes: 0 peak commit: 15263 MB ``` PR (`6908ee6d6208b86e573187209c2ba719bd6ed751`): ``` xcl-smoke v1 commit: 6908ee6d6208b86e573187209c2ba719bd6ed751 gpu: NVIDIA GeForce RTX 3060 title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1660 (PresentX 1660) presents per 2 s (last 3): 61 60 60 device removals: 0 crashes: 0 peak commit: 17226 MB ``` **Not tested** - Full `cargo test --workspace` execution (only `--no-run` and the 7 targeted `hle::d3d12x` test modules above ran on RTX 3060 and WARP) - AMD / Intel GPUs, native wave64 hardware, Linux / Wine without `VKD3D_CONFIG=retain_psos`, non-Windows targets (not built / not tested) - `XCL_SAMPLE_*` external shader packs (unset) **AI use** - Antigravity (Gemini 4 Hydrogen): audited `upstream/main` generation pins (`dcfbb49`, `665ce02`, `3f91865`) and `late_release::hold_pipeline`, rebased `fix/pso-async-lifetime-retention` onto `upstream/main` `6bfb5c51` by dropping superseded retention logic and rebuilding the remaining `InitialFallback` / `cl_reset` / `pso_release` / one-shot-pin fixes, updated `late_release` and `real::async_pso_lifetime_tests` regression tests, and ran the builds, targeted RTX 3060 + WARP tests, and paired 60 s smoke runs.
Aniseto commented 2026-11-25 19:09:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-25T18:25:18Z.


Ran the async-pipeline lifetime tests at 8142aa1:

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build.

Results

  • cargo test -p xcl --lib async_pso -- --test-threads=4: 3 passed, 0 failed (exit 0)
  • cargo test -p xcl --lib pso_async -- --test-threads=4: 12 passed, 0 failed (exit 0)
  • cargo test -p xcl --lib late_release -- --test-threads=4: 3 passed, 0 failed (exit 0)
  • cargo test -p xcl --lib list_x -- --test-threads=4: 34 passed, 0 failed (exit 0)

The new lifetime tests (async_pso_stays_alive_through_command_list_reset_and_gpu_retirement, concurrent_resolve_retained_and_release_never_exposes_freed_pipeline and the late_release queue-retirement case) pass here on a real D3D12 device and command list.

What this adds: the author ran these filters on an Ampere RTX 3060; this is a Blackwell wave32 part. No test report from another machine exists in the thread yet.

Not tested: the whole xcl --lib run (the description lists a pre-existing gpu_clamp_and_omod_per_instruction failure), a paired 60 s smoke run, AMD and Intel GPUs, Wine, release profile, title data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

<!-- greyfinch-sync:ivall/xcl:comment:7170883943 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2417#issuecomment-7170883943). Originally posted by [Aniseto](https://github.com/Aniseto) on 2026-11-25T18:25:18Z. --- Ran the async-pipeline lifetime tests at `8142aa1`: Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build. **Results** - `cargo test -p xcl --lib async_pso -- --test-threads=4`: 3 passed, 0 failed (exit 0) - `cargo test -p xcl --lib pso_async -- --test-threads=4`: 12 passed, 0 failed (exit 0) - `cargo test -p xcl --lib late_release -- --test-threads=4`: 3 passed, 0 failed (exit 0) - `cargo test -p xcl --lib list_x -- --test-threads=4`: 34 passed, 0 failed (exit 0) The new lifetime tests (`async_pso_stays_alive_through_command_list_reset_and_gpu_retirement`, `concurrent_resolve_retained_and_release_never_exposes_freed_pipeline` and the `late_release` queue-retirement case) pass here on a real D3D12 device and command list. What this adds: the author ran these filters on an Ampere RTX 3060; this is a Blackwell wave32 part. No test report from another machine exists in the thread yet. Not tested: the whole `xcl --lib` run (the description lists a pre-existing `gpu_clamp_and_omod_per_instruction` failure), a paired 60 s smoke run, AMD and Intel GPUs, Wine, release profile, title data. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash Free** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
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:37Z.


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:7172773027 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2417#issuecomment-7172773027). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T19:47:37Z. --- 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
emirduran707 commented 2026-11-25 20:08:48 +00:00 (Migrated from github.com)

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


Independent AMD RDNA4 (native wave64) test report on exact head 75726f769e996fdeae51c37f1a6beb26371f9e98 (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: 1349 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.
    • Both PR tests passed: hle::d3d12x::late_release::tests::unadopted_com_object_is_released_after_queue_retirement and hle::d3d12x::pso_async::used_tests::concurrent_resolve_retained_and_release_never_exposes_freed_pipeline.
    • The 3 failures are pre-existing on the PR's base main: 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, fixed later on main in #2420).

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

xcl-smoke v1
commit: 75726f769e996fdeae51c37f1a6beb26371f9e98
gpu: AMD Radeon RX 9060 XT
title: 21222967
seconds: 60
exit: 0x0
frames shown: 1575 (PresentX 1575)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16128 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:7172932259 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2417#issuecomment-7172932259). Originally posted by [emirduran707](https://github.com/emirduran707) on 2026-11-25T19:54:44Z. --- Independent AMD RDNA4 (native wave64) test report on exact head `75726f769e996fdeae51c37f1a6beb26371f9e98` (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`: **1349 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. - Both PR tests passed: `hle::d3d12x::late_release::tests::unadopted_com_object_is_released_after_queue_retirement` and `hle::d3d12x::pso_async::used_tests::concurrent_resolve_retained_and_release_never_exposes_freed_pipeline`. - The 3 failures are pre-existing on the PR's base `main`: `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, fixed later on `main` in #2420). **Regression run** (60 s retail-title smoke, `XCL_NETWORK=0`, release) ``` xcl-smoke v1 commit: 75726f769e996fdeae51c37f1a6beb26371f9e98 gpu: AMD Radeon RX 9060 XT title: 21222967 seconds: 60 exit: 0x0 frames shown: 1575 (PresentX 1575) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16128 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.
bmjask commented 2026-11-25 20:28:30 +00:00 (Migrated from github.com)

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

Review: COMMENTED


P1: pso_release can misclassify a normal 2->1 release as final and double-release a retained pending stand-in. With late release enabled, real.rs:1721-1734 treats f(this)==1 as final, removes async state, and queues a deferred raw Release. But this PR intentionally AddRefs a bound pending stand-in via Resolved/retained_psos, so title Release commonly changes title+list retention from 2 to 1. The branch then reports zero/forgets state and schedules release of the list-owned ref; when the list resets and drops its retained ID3D12PipelineState, it releases that same ref again. Please retain a separate deferred ref only after proving the caller released the actual last ref, and add a bind/retain -> title Release -> list reset regression.

<!-- greyfinch-sync:ivall/xcl:review:6064502229 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2417#pullrequestreview-6064502229). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-25T20:28:30Z. **Review:** COMMENTED --- P1: pso_release can misclassify a normal 2->1 release as final and double-release a retained pending stand-in. With late release enabled, real.rs:1721-1734 treats f(this)==1 as final, removes async state, and queues a deferred raw Release. But this PR intentionally AddRefs a bound pending stand-in via Resolved/retained_psos, so title Release commonly changes title+list retention from 2 to 1. The branch then reports zero/forgets state and schedules release of the list-owned ref; when the list resets and drops its retained ID3D12PipelineState, it releases that same ref again. Please retain a separate deferred ref only after proving the caller released the actual last ref, and add a bind/retain -> title Release -> list reset regression.
fixgep commented 2026-11-25 21:05:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fixgep on 2026-11-25T20:50:13Z.


Thanks for catching this! Removed the else if f(this) == 1 branch in pso_release (crates/xcl/src/hle/d3d12x/real.rs) so it now matches res_release and pso_async::release: a separate deferred ref is held in late_release::hold_deferred only when add(this) == 2 proves the caller is releasing the actual last ref (1 -> 0), and any add(this) > 2 call immediately drops its speculative ref via f(this) and runs the caller's release let n = f(this) with held = false. Also added async_pso_lifetime_tests::pending_standin_retained_on_command_list_survives_title_release_until_reset covering pending stand-in bind/retain (1 -> 2) → title Release() (2 -> 1) → command list Reset() (1 -> 0) and GPU retirement, rebased onto upstream/main, and refreshed the hle::d3d12x test and 60 s smoke runs.

<!-- greyfinch-sync:ivall/xcl:comment:7174253907 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2417#issuecomment-7174253907). Originally posted by [fixgep](https://github.com/fixgep) on 2026-11-25T20:50:13Z. --- Thanks for catching this! Removed the `else if f(this) == 1` branch in `pso_release` (`crates/xcl/src/hle/d3d12x/real.rs`) so it now matches `res_release` and `pso_async::release`: a separate deferred ref is held in `late_release::hold_deferred` only when `add(this) == 2` proves the caller is releasing the actual last ref (`1 -> 0`), and any `add(this) > 2` call immediately drops its speculative ref via `f(this)` and runs the caller's release `let n = f(this)` with `held = false`. Also added `async_pso_lifetime_tests::pending_standin_retained_on_command_list_survives_title_release_until_reset` covering pending stand-in bind/retain (`1 -> 2`) → title `Release()` (`2 -> 1`) → command list `Reset()` (`1 -> 0`) and GPU retirement, rebased onto `upstream/main`, and refreshed the `hle::d3d12x` test and 60 s smoke runs.
itsSio commented 2026-11-26 01:05:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by itsSio on 2026-11-26T00:12:43Z.


Two points from reading the diff against main 08db802:

  • Size. The PR is 1314 + / 226 − (1540 changed lines, 8 files). CONTRIBUTING.md says: "Over ~800 lines, the description must say why it cannot be split." The description doesn't say that yet. @pr1sm-dev's comment on #916 (2026-11-25) describes a ~100-line shape of the list-side retention (one reference per pipeline bound on a PC list, keyed by alloc_pool::recording_backing, dropped in dispatch_chain::allocator_reset). That suggests the retention could be one PR and the pso_async / late_release changes another.
  • Issue link. The description says "Part of #1488". #916 (goal:world-load, Linux + NVIDIA vkQueueSubmit2 AV) is where @pr1sm-dev stood down their own fix in favour of this PR. If this is meant to fix #916, a Fixes #916 / Part of #916 line and one Linux / Wine run without VKD3D_CONFIG=retain_psos would show it does. The current Tested section is Windows only.

I checked pso_release (real.rs, the hunk at 1716): the else if f(this) == 1 branch from @bmjask's review is gone. The last reference is now held for late_release::hold_deferred only when add(this) == 2.

AI use:
Ran via Samaritan:

  • OpenCode (Claude Opus 5.5): read the diff and the threads, checked each point above against the code and wrote this comment.
  • OpenCode (Claude Opus 5.5), a helper session: read the diff and the threads.

The points were checked by the account owner as well (edited to complete this AI use line).

<!-- greyfinch-sync:ivall/xcl:comment:7178516700 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2417#issuecomment-7178516700). Originally posted by [itsSio](https://github.com/itsSio) on 2026-11-26T00:12:43Z. --- Two points from reading the diff against `main` `08db802`: - **Size.** The PR is 1314 + / 226 − (1540 changed lines, 8 files). `CONTRIBUTING.md` says: "Over ~800 lines, the description must say why it cannot be split." The description doesn't say that yet. @pr1sm-dev's comment on #916 (2026-11-25) describes a ~100-line shape of the list-side retention (one reference per pipeline bound on a PC list, keyed by `alloc_pool::recording_backing`, dropped in `dispatch_chain::allocator_reset`). That suggests the retention could be one PR and the `pso_async` / `late_release` changes another. - **Issue link.** The description says "Part of #1488". #916 (`goal:world-load`, Linux + NVIDIA `vkQueueSubmit2` AV) is where @pr1sm-dev stood down their own fix in favour of this PR. If this is meant to fix #916, a `Fixes #916` / `Part of #916` line and one Linux / Wine run without `VKD3D_CONFIG=retain_psos` would show it does. The current Tested section is Windows only. I checked `pso_release` (`real.rs`, the hunk at 1716): the `else if f(this) == 1` branch from @bmjask's review is gone. The last reference is now held for `late_release::hold_deferred` only when `add(this) == 2`. AI use: Ran via Samaritan: - OpenCode (Claude Opus 5.5): read the diff and the threads, checked each point above against the code and wrote this comment. - OpenCode (Claude Opus 5.5), a helper session: read the diff and the threads. The points were checked by the account owner as well (edited to complete this AI use line).
DavidM1911 commented 2026-11-26 03:06:32 +00:00 (Migrated from github.com)

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


Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: 1 failure under parallel scheduling; clean on --test-threads=1 rerun (1308 passed, 0 failed, 27 ignored, 81s). Intermittent single-test flake — tracked in #1978.

Thanks!

— Devin

<!-- greyfinch-sync:ivall/xcl:comment:7180766898 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2417#issuecomment-7180766898). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T02:23:52Z. --- Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: 1 failure under parallel scheduling; clean on `--test-threads=1` rerun (**1308 passed, 0 failed, 27 ignored**, 81s). Intermittent single-test flake — tracked in #1978. Thanks! — Devin
luckyteagirl commented 2026-11-26 07:58:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T07:58:31Z.

Review: COMMENTED


At head 5333a9b91290a0163e2368bc27e89907c5e4207a, the mid-list split now calls resolve_cached_for_bind(bound_pso, &bound_resolved) (list_x.rs:2855). For a still-tracked compute PSO, that calls resolve_for_bind_retained, which waits for the build (or runs an unclaimed job on the recording thread); the default XCL_PSO_WAIT_MS budget is unbounded. A normal SetPipelineState records the pending PSO in both bind and list_x, and bind::dispatch calls defer specifically so the build is waited for at submit. The split therefore blocks inside Dispatch before defer can return, losing the record-now/wait-at-submit behavior. Could the split use a retained nonwaiting lookup for the continuation's initial PSO, and extend a_dispatch_with_a_pipeline_still_building_waits_at_the_submit through the normal SetPipelineState path? That test currently initializes list_x::bound_pso to zero, so it misses this branch.

This is a source-derived timing review of the exact head; I did not run a native timing reproduction. AI use: OpenAI Codex (GPT-6.2 Sol) reviewed the source and drafted this point; I checked the call chain and existing test before posting.

<!-- greyfinch-sync:ivall/xcl:review:6070353863 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2417#pullrequestreview-6070353863). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T07:58:31Z. **Review:** COMMENTED --- At head `5333a9b91290a0163e2368bc27e89907c5e4207a`, the mid-list split now calls `resolve_cached_for_bind(bound_pso, &bound_resolved)` (`list_x.rs:2855`). For a still-tracked compute PSO, that calls `resolve_for_bind_retained`, which waits for the build (or runs an unclaimed job on the recording thread); the default `XCL_PSO_WAIT_MS` budget is unbounded. A normal `SetPipelineState` records the pending PSO in both `bind` and `list_x`, and `bind::dispatch` calls `defer` specifically so the build is waited for at submit. The split therefore blocks inside `Dispatch` before `defer` can return, losing the record-now/wait-at-submit behavior. Could the split use a retained nonwaiting lookup for the continuation's initial PSO, and extend `a_dispatch_with_a_pipeline_still_building_waits_at_the_submit` through the normal `SetPipelineState` path? That test currently initializes `list_x::bound_pso` to zero, so it misses this branch. This is a source-derived timing review of the exact head; I did not run a native timing reproduction. AI use: OpenAI Codex (GPT-6.2 Sol) reviewed the source and drafted this point; I checked the call chain and existing test before posting.
fixgep commented 2026-11-26 13:05:38 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fixgep on 2026-11-26T12:25:46Z.


@luckyteagirl Good catch, thanks! Changed list_x::split to use a non-blocking lookup (resolve_cached_if_pending) so it won't wait before submit, and updated a_dispatch_with_a_pipeline_still_building_waits_at_the_submit to cover this with a bound stand-in PSO (1a51cb95).

<!-- greyfinch-sync:ivall/xcl:comment:7191989077 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2417#issuecomment-7191989077). Originally posted by [fixgep](https://github.com/fixgep) on 2026-11-26T12:25:46Z. --- @luckyteagirl Good catch, thanks! Changed `list_x::split` to use a non-blocking lookup (`resolve_cached_if_pending`) so it won't wait before submit, and updated `a_dispatch_with_a_pipeline_still_building_waits_at_the_submit` to cover this with a bound stand-in PSO (`1a51cb95`).
github-actions[bot] commented 2026-12-01 02:34:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-12-01T02:34:19Z.


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

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

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


Triage (#1607) – head 6908ee6

No open PR makes the same change. #2422 also changes real.rs:pso_release so that forget_pso runs before the last driver release, but only for the address-reuse race. Here forget_pso and pso_async::released run before the final driver release whether or not late release is enabled.
Main has since reworked this area: native pipeline generations are pinned in recordings (dcfbb49c, 665ce029, 3f91865b), and pso_release now hands the real pipeline to late_release::hold_pipeline. 6908ee6d is rebuilt on that rework and only closes the gaps left on top of it.
The diff is now +817/-102 across 5 files. The description argues it cannot be split, but the pso_release/late-release part and the list-side retention look separable.
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:7304752457 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2417#issuecomment-7304752457). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:00:22Z. --- **Triage (#1607)** – head 6908ee6 No open PR makes the same change. #2422 also changes `real.rs:pso_release` so that `forget_pso` runs before the last driver release, but only for the address-reuse race. Here `forget_pso` and `pso_async::released` run before the final driver release whether or not late release is enabled. Main has since reworked this area: native pipeline generations are pinned in recordings (dcfbb49c, 665ce029, 3f91865b), and `pso_release` now hands the real pipeline to `late_release::hold_pipeline`. 6908ee6d is rebuilt on that rework and only closes the gaps left on top of it. The diff is now +817/-102 across 5 files. The description argues it cannot be split, but the `pso_release`/late-release part and the list-side retention look separable. 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/2417:upstream-pr/2417'
git switch 'upstream-pr/2417'

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