D3D12.X: route stream graphics PSOs through create_graphics_pso_tracked #1651

Open
fixgep wants to merge 1 commit from upstream-pr/1661 into main
fixgep commented 2026-11-24 18:53:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fixgep on 2026-11-24T18:53:04Z.


Part of #1489 (XCL-BT-023).

When pipeline_state (called by dev_create_pipeline_state) unpacks a graphics pipeline state stream via stream_pipeline, StreamPipeline::Graphics(d, cacheable) still calls graphics_pso directly, bypassing device_x::create_graphics_pso_tracked. As a result, stream-created graphics PSOs never receive D3D12_PIPELINE_STATE_FLAG_DYNAMIC_DEPTH_BIAS on supported adapters and are never recorded by device_x::note_base, causing subsequent CreateDerivedPipelineStateX (#55) and RSSetDepthBiasX (#94) calls to fail.

(StreamPipeline::GraphicsStream, added on main for extended rasterizer streams without a projected D3D12_GRAPHICS_PIPELINE_STATE_DESC, stays on its native stream path outside create_graphics_pso_tracked.)

What is in it

  • Parameterize device_x::create_graphics_pso_tracked over its PSO creation callback in crates/xcl/src/hle/d3d12x/device_x.rs.
  • Route StreamPipeline::Graphics in pipeline_state through device_x::create_graphics_pso_tracked with graphics_pso(..., true, cacheable) (keeping note_pipeline_for_dump intact and leaving GraphicsStream, Compute, mesh, and Unknown stream paths unchanged) in crates/xcl/src/hle/d3d12x/real.rs.
  • Add synthetic unit test stream_pso_tests::stream_graphics_pso_is_tracked_for_derived_and_depth_bias in crates/xcl/src/hle/d3d12x/real.rs (resolving the stand-in shell via bind::PreparedNativePipeline before CreateCommandList) and title check gpu::stream_graphics_pso_tracking in tests/testtitle/src/gpu.rs and tests/testtitle/src/main.rs.

Tested

  • Hardware & OS: NVIDIA GeForce RTX 3060 (driver 32.0.16.2140), AMD Ryzen 5 7500F 6-Core Processor, Windows build 10.0.26200.0, rustc 1.100.0 (0ef1bc386 2026-11-09)
  • Rebased commit 0d670ae7 (rebased onto upstream/main b2b1f109):
    • cargo build -j 4 --workspace, cargo test -j 4 --workspace --no-run, and cargo build -j 4 --release -p xcl: exit code 0, 0 new warnings (39 pre-existing xcl lib warnings on both upstream/main b2b1f109 and 0d670ae7)
    • cargo test -j 4 -p xcl --lib stream_pso_tests -- --test-threads=1: 1 passed, 0 failed, 0 ignored, 0 skipped on RTX 3060; 1 passed, 0 failed, 0 ignored, 0 skipped with XCL_ADAPTER=warp
    • cargo test -j 4 -p xcl --test e2e -- --test-threads=1: 5 passed, 0 failed, 0 ignored, 0 skipped on RTX 3060 (includes [PASS] D3D12.X: stream-created graphics PSO tracks CreateDerivedPipelineStateX and RSSetDepthBiasX)
  • Previous pre-rebase commit 4f62f273 (same logic prior to conflict resolution in real.rs):
    • cargo test -j 4 --workspace --no-fail-fast -- --test-threads=4: 2608 passed, 1 failed (pre-existing gpu_two_pass_cache_e2e::two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs), 49 ignored, 27 SKIPPED GPU tests on RTX 3060

Regression run
Baseline (upstream/main, XCL_PREPARE=0):

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

This branch (fix/stream-graphics-pso-tracking, XCL_PREPARE=0):

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

Not tested

  • Full cargo test --workspace run after rebasing onto b2b1f109 (targeted stream_pso_tests on RTX 3060 + WARP and e2e on RTX 3060 were run on 0d670ae7)
  • AMD / Intel GPUs and wave64-native adapters on the rebased commit
  • e2e test_title_* checks with XCL_ADAPTER=warp (software WARP crashes in D3D10Warp.dll on the earlier render_triangle check, as excluded in CI)
  • XCL_SAMPLE_* tests (no sample variables set)

AI use

  • Antigravity with Gemini 4 Hydrogen: wrote the fix and tests, earlier rebase onto upstream/main (fa204595), updated stream_pso_tests stand-in shell resolution, and ran earlier workspace/targeted tests and smoke runs.
  • Antigravity with Gemini 4 Neon: rebased onto upstream/main (b2b1f109), resolved the real.rs test-module merge conflict, ran the workspace/release builds, targeted tests (stream_pso_tests on RTX 3060 and WARP, e2e on RTX 3060), paired 60-second smoke.ps1 runs, and updated/validated the PR description.
<!-- greyfinch-sync:ivall/xcl:issue:5478354537 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1661). Originally posted by [fixgep](https://github.com/fixgep) on 2026-11-24T18:53:04Z. --- Part of #1489 (`XCL-BT-023`). When `pipeline_state` (called by `dev_create_pipeline_state`) unpacks a graphics pipeline state stream via `stream_pipeline`, `StreamPipeline::Graphics(d, cacheable)` still calls `graphics_pso` directly, bypassing `device_x::create_graphics_pso_tracked`. As a result, stream-created graphics PSOs never receive `D3D12_PIPELINE_STATE_FLAG_DYNAMIC_DEPTH_BIAS` on supported adapters and are never recorded by `device_x::note_base`, causing subsequent `CreateDerivedPipelineStateX` (#55) and `RSSetDepthBiasX` (#94) calls to fail. (`StreamPipeline::GraphicsStream`, added on `main` for extended rasterizer streams without a projected `D3D12_GRAPHICS_PIPELINE_STATE_DESC`, stays on its native stream path outside `create_graphics_pso_tracked`.) **What is in it** - Parameterize `device_x::create_graphics_pso_tracked` over its PSO creation callback in `crates/xcl/src/hle/d3d12x/device_x.rs`. - Route `StreamPipeline::Graphics` in `pipeline_state` through `device_x::create_graphics_pso_tracked` with `graphics_pso(..., true, cacheable)` (keeping `note_pipeline_for_dump` intact and leaving `GraphicsStream`, `Compute`, mesh, and `Unknown` stream paths unchanged) in `crates/xcl/src/hle/d3d12x/real.rs`. - Add synthetic unit test `stream_pso_tests::stream_graphics_pso_is_tracked_for_derived_and_depth_bias` in `crates/xcl/src/hle/d3d12x/real.rs` (resolving the stand-in shell via `bind::PreparedNativePipeline` before `CreateCommandList`) and title check `gpu::stream_graphics_pso_tracking` in `tests/testtitle/src/gpu.rs` and `tests/testtitle/src/main.rs`. **Tested** - Hardware & OS: NVIDIA GeForce RTX 3060 (driver `32.0.16.2140`), AMD Ryzen 5 7500F 6-Core Processor, Windows build `10.0.26200.0`, `rustc 1.100.0 (0ef1bc386 2026-11-09)` - Rebased commit `0d670ae7` (rebased onto `upstream/main` `b2b1f109`): - `cargo build -j 4 --workspace`, `cargo test -j 4 --workspace --no-run`, and `cargo build -j 4 --release -p xcl`: exit code `0`, `0` new warnings (`39` pre-existing `xcl` lib warnings on both `upstream/main` `b2b1f109` and `0d670ae7`) - `cargo test -j 4 -p xcl --lib stream_pso_tests -- --test-threads=1`: `1 passed, 0 failed, 0 ignored, 0 skipped` on RTX 3060; `1 passed, 0 failed, 0 ignored, 0 skipped` with `XCL_ADAPTER=warp` - `cargo test -j 4 -p xcl --test e2e -- --test-threads=1`: `5 passed, 0 failed, 0 ignored, 0 skipped` on RTX 3060 (includes `[PASS] D3D12.X: stream-created graphics PSO tracks CreateDerivedPipelineStateX and RSSetDepthBiasX`) - Previous pre-rebase commit `4f62f273` (same logic prior to conflict resolution in `real.rs`): - `cargo test -j 4 --workspace --no-fail-fast -- --test-threads=4`: `2608 passed, 1 failed` (pre-existing `gpu_two_pass_cache_e2e::two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs`), `49 ignored`, `27 SKIPPED` GPU tests on RTX 3060 **Regression run** Baseline (`upstream/main`, `XCL_PREPARE=0`): ``` xcl-smoke v1 commit: b2b1f109d27e746a62ec95b04dd1f9924452e682 gpu: NVIDIA GeForce RTX 3060 title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1661 (PresentX 1661) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15310 MB ``` This branch (`fix/stream-graphics-pso-tracking`, `XCL_PREPARE=0`): ``` xcl-smoke v1 commit: 0d670ae7c14ad1595848f669a70c1c43a2bbe131 gpu: NVIDIA GeForce RTX 3060 title: 3c290c16 seconds: 60 exit: 0x0 frames shown: 1405 (PresentX 1405) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15294 MB ``` **Not tested** - Full `cargo test --workspace` run after rebasing onto `b2b1f109` (targeted `stream_pso_tests` on RTX 3060 + WARP and `e2e` on RTX 3060 were run on `0d670ae7`) - AMD / Intel GPUs and wave64-native adapters on the rebased commit - `e2e` `test_title_*` checks with `XCL_ADAPTER=warp` (software WARP crashes in `D3D10Warp.dll` on the earlier `render_triangle` check, as excluded in CI) - `XCL_SAMPLE_*` tests (no sample variables set) **AI use** - Antigravity with Gemini 4 Hydrogen: wrote the fix and tests, earlier rebase onto `upstream/main` (`fa204595`), updated `stream_pso_tests` stand-in shell resolution, and ran earlier workspace/targeted tests and smoke runs. - Antigravity with Gemini 4 Neon: rebased onto `upstream/main` (`b2b1f109`), resolved the `real.rs` test-module merge conflict, ran the workspace/release builds, targeted tests (`stream_pso_tests` on RTX 3060 and WARP, `e2e` on RTX 3060), paired 60-second `smoke.ps1` runs, and updated/validated the PR description.
eizispark commented 2026-11-24 21:08:46 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by eizispark on 2026-11-24T19:21:01Z.


Hardware test report — commit f70293d

Verified f70293d56a46ea2b2d6cbcd7afac241dd777cfeb (clean merge with main c160d86ef2efe3a07e4dfb473e4fa72eafb413c0): pass.

Tested

  • Hardware: AMD Radeon RX 9070 XT (RDNA4, native wave32 + wave64, driver 32.0.32015.16001), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 x64, rustc 1.100.0 (0ef1bc386 2026-11-09), debug tests + release smoke
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 777 passed, 0 failed, 41 ignored (1 skipped: heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows)
  • hle::d3d12x::real::stream_pso_tests::stream_graphics_pso_is_tracked_for_derived_and_depth_bias and test_title_runs_and_game_folder_is_untouched (testtitle e2e gpu::stream_graphics_pso_tracking) passed
  • gpu::recomp::tests::gpu_clamp_and_omod_per_instruction and both wave64 GPU tests skipped on NVIDIA (gpu_geometry_wave32_prefix_count_over_a_mask and gpu_wave32_program_in_wave64_hardware, plus console_wave64_compute_through_the_pso_hook_dispatch_and_read_back) ran natively and passed on RDNA4

Regression run
main (c160d86ef2efe3a07e4dfb473e4fa72eafb413c0):

xcl-smoke v1
commit: c160d86ef2efe3a07e4dfb473e4fa72eafb413c0
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1671 (PresentX 1671)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14861 MB

PR (f70293d56a46ea2b2d6cbcd7afac241dd777cfeb):

xcl-smoke v1
commit: f70293d56a46ea2b2d6cbcd7afac241dd777cfeb
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1677 (PresentX 1677)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14919 MB

Not tested

  • adapters without native OPTIONS16 dynamic depth bias (Intel Arc fallback path) except through unit/e2e coverage, Wine/vkd3d-proton, gameplay past the menus

AI use

  • Verified and formatted with Antigravity (Google DeepMind, Gemini 4 Carbon).
<!-- greyfinch-sync:ivall/xcl:comment:7141967575 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1661#issuecomment-7141967575). Originally posted by [eizispark](https://github.com/eizispark) on 2026-11-24T19:21:01Z. --- ### Hardware test report — commit `f70293d` Verified `f70293d56a46ea2b2d6cbcd7afac241dd777cfeb` (clean merge with `main` `c160d86ef2efe3a07e4dfb473e4fa72eafb413c0`): **pass**. **Tested** - Hardware: AMD Radeon RX 9070 XT (RDNA4, native wave32 + wave64, driver `32.0.32015.16001`), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 x64, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, debug tests + release smoke - `cargo test --workspace --no-fail-fast -- --test-threads=4`: `777 passed, 0 failed, 41 ignored` (`1 skipped`: `heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows`) - `hle::d3d12x::real::stream_pso_tests::stream_graphics_pso_is_tracked_for_derived_and_depth_bias` and `test_title_runs_and_game_folder_is_untouched` (`testtitle` e2e `gpu::stream_graphics_pso_tracking`) passed - `gpu::recomp::tests::gpu_clamp_and_omod_per_instruction` and both wave64 GPU tests skipped on NVIDIA (`gpu_geometry_wave32_prefix_count_over_a_mask` and `gpu_wave32_program_in_wave64_hardware`, plus `console_wave64_compute_through_the_pso_hook_dispatch_and_read_back`) ran natively and passed on RDNA4 **Regression run** `main` (`c160d86ef2efe3a07e4dfb473e4fa72eafb413c0`): ``` xcl-smoke v1 commit: c160d86ef2efe3a07e4dfb473e4fa72eafb413c0 gpu: AMD Radeon RX 9070 XT title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1671 (PresentX 1671) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14861 MB ``` PR (`f70293d56a46ea2b2d6cbcd7afac241dd777cfeb`): ``` xcl-smoke v1 commit: f70293d56a46ea2b2d6cbcd7afac241dd777cfeb gpu: AMD Radeon RX 9070 XT title: GTA6.Xbox.v1.0.2.1 seconds: 60 exit: 0x0 frames shown: 1677 (PresentX 1677) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14919 MB ``` **Not tested** - adapters without native `OPTIONS16` dynamic depth bias (Intel Arc fallback path) except through unit/e2e coverage, Wine/vkd3d-proton, gameplay past the menus **AI use** - Verified and formatted with Antigravity (Google DeepMind, Gemini 4 Carbon).
DavidM1911 commented 2026-11-24 21:29:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T21:16:48Z.


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

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

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7144718251 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1661#issuecomment-7144718251). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T21:16:48Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~22 ignored. Thanks!
JJAutoCompare commented 2026-11-25 05:08:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T04:47:47Z.


XCL PR #1661 — Windows / Arc A770 verification

Clean detached head f70293d56a46ea2b2d6cbcd7afac241dd777cfeb on STOR-WINLAB. Windows 11 Enterprise Evaluation 10.0.26200, AMD Ryzen 7 3800X, Intel Arc A770 (driver 32.0.101.9175), DXC 1.9.2609.5, rustc 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc).

Tested

  • cargo build --workspace and cargo test --workspace --no-run succeeded outside the Arc mutex. The test build produced 19 executables.
  • The following test commands ran inside Invoke-ArcTest.ps1 with XCL_ADAPTER=A770 and RUST_TEST_NOCAPTURE=1.
    • cargo test -p xcl --lib hle::d3d12x::real::stream_pso_tests::stream_graphics_pso_is_tracked_for_derived_and_depth_bias -- --exact — 1 passed, 0 failed, 0 ignored, 0 skipped. Verified base registration and static bias metadata, derived PSO creation, patched bias PSO creation, native RSSetDepthBias without fallback-cache growth, and tracking cleanup on release.
    • cargo test -p xcl --test e2e test_title_runs_and_game_folder_is_untouched -- --exact — 0 passed, 1 failed, 0 ignored, 0 skipped. The new title check printed [PASS] after stream creation via slot #86, derivation via #55, and a depth-biased draw via #94 with queue fence completion. A separate title check failed as described below.
    • cargo test --workspace --no-fail-fast -- --test-threads=4 — exit 101. The 20 test result: lines (19 binaries and one doctest target) sum to 761 passed, 16 failed, 41 ignored. Both new stream-PSO checks passed again.

Workspace failures and skips

  • 15 GPU recompiler tests failed. The e2e title harness also failed because RSSetDepthBiasX(-1000.5) produced a blue top-right pixel where the test expected green.
  • Six SKIPPED lines were counted. Two cited wave64, two cited debug-layer availability, one cited tiled-resource tier, and one cited heap windows. These skips provide no coverage.

Not tested

Matched main baseline, retail-title smoke, other adapters, forced command-list fallback, and optional sample data.

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 pr1661-suite.log and published.

<!-- greyfinch-sync:ivall/xcl:comment:7153171328 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1661#issuecomment-7153171328). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T04:47:47Z. --- # XCL PR #1661 — Windows / Arc A770 verification Clean detached head `f70293d56a46ea2b2d6cbcd7afac241dd777cfeb` on STOR-WINLAB. Windows 11 Enterprise Evaluation 10.0.26200, AMD Ryzen 7 3800X, Intel Arc A770 (driver 32.0.101.9175), DXC 1.9.2609.5, rustc 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc). **Tested** - `cargo build --workspace` and `cargo test --workspace --no-run` succeeded outside the Arc mutex. The test build produced 19 executables. - The following test commands ran inside `Invoke-ArcTest.ps1` with `XCL_ADAPTER=A770` and `RUST_TEST_NOCAPTURE=1`. - `cargo test -p xcl --lib hle::d3d12x::real::stream_pso_tests::stream_graphics_pso_is_tracked_for_derived_and_depth_bias -- --exact` — 1 passed, 0 failed, 0 ignored, 0 skipped. Verified base registration and static bias metadata, derived PSO creation, patched bias PSO creation, native `RSSetDepthBias` without fallback-cache growth, and tracking cleanup on release. - `cargo test -p xcl --test e2e test_title_runs_and_game_folder_is_untouched -- --exact` — 0 passed, 1 failed, 0 ignored, 0 skipped. The new title check printed `[PASS]` after stream creation via slot #86, derivation via #55, and a depth-biased draw via #94 with queue fence completion. A separate title check failed as described below. - `cargo test --workspace --no-fail-fast -- --test-threads=4` — exit 101. The 20 `test result:` lines (19 binaries and one doctest target) sum to 761 passed, 16 failed, 41 ignored. Both new stream-PSO checks passed again. **Workspace failures and skips** - 15 GPU recompiler tests failed. The e2e title harness also failed because `RSSetDepthBiasX(-1000.5)` produced a blue top-right pixel where the test expected green. - Six `SKIPPED ` lines were counted. Two cited wave64, two cited debug-layer availability, one cited tiled-resource tier, and one cited heap windows. These skips provide no coverage. **Not tested** Matched `main` baseline, retail-title smoke, other adapters, forced command-list fallback, and optional sample data. **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 `pr1661-suite.log` and published.
github-actions[bot] commented 2026-11-28 20:17:58 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T20:17:58Z.


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:7245183839 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1661#issuecomment-7245183839). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T20:17:58Z. --- 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.
fixgep commented 2026-11-29 07:32:04 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fixgep on 2026-11-29T07:32:04Z.


Rebased onto current main (fa204595) at 4f62f273 with updated RTX 3060 / WARP tests and paired 60 s smoke runs (pr_check.py: 0 problems). Still fixes StreamPipeline::Graphics in pipeline_state bypassing device_x::create_graphics_pso_tracked, so stream-created graphics PSOs get D3D12_PIPELINE_STATE_FLAG_DYNAMIC_DEPTH_BIAS and base tracking for CreateDerivedPipelineStateX (#55) and RSSetDepthBiasX (#94).

<!-- greyfinch-sync:ivall/xcl:comment:7252531599 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1661#issuecomment-7252531599). Originally posted by [fixgep](https://github.com/fixgep) on 2026-11-29T07:32:04Z. --- Rebased onto current `main` (`fa204595`) at `4f62f273` with updated RTX 3060 / WARP tests and paired 60 s smoke runs (`pr_check.py`: 0 problems). Still fixes `StreamPipeline::Graphics` in `pipeline_state` bypassing `device_x::create_graphics_pso_tracked`, so stream-created graphics PSOs get `D3D12_PIPELINE_STATE_FLAG_DYNAMIC_DEPTH_BIAS` and base tracking for `CreateDerivedPipelineStateX` (#55) and `RSSetDepthBiasX` (#94).
Foniass commented 2026-12-01 06:25:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:25:51Z.


Triage (#1607) – head 0d670ae

#1516 made the same change: stream graphics PSOs created through device #86 go through create_graphics_pso_tracked, so CreateDerivedPipelineStateX and RSSetDepthBiasX find them. #1516 is closed and was not merged, and main still calls graphics_pso directly in pipeline_state, so this PR is the only open one for it.
No problems found in the diff. Passing the creator as a closure keeps the stream path's cacheable flag.
The Build and test (Windows, no GPU) check passes on 0d670ae7.
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:7302862444 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1661#issuecomment-7302862444). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:25:51Z. --- **Triage (#1607)** – head 0d670ae #1516 made the same change: stream graphics PSOs created through device #86 go through create_graphics_pso_tracked, so CreateDerivedPipelineStateX and RSSetDepthBiasX find them. #1516 is closed and was not merged, and main still calls graphics_pso directly in pipeline_state, so this PR is the only open one for it. No problems found in the diff. Passing the creator as a closure keeps the stream path's `cacheable` flag. The `Build and test (Windows, no GPU)` check passes on 0d670ae7. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
fromthemoonx commented 2026-12-03 11:59:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-03T11:59:25Z.


merge-check
base: 0c725d5da2
head: 0d670ae7c1
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3017 passed, 0 failed, 56 ignored in run 3; SKIPPED: 25, the same as base (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps); failing: none in run 3, one test in each of runs 1 and 2 (3016 passed, 1 failed), a different one each time:

  • run 2, list_x::tests::mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares, E_OUTOFMEMORY: fails on base too. I ran the list_x, device_x and stream_pso_tests modules in turn on both sides at 8 threads: 13 of 60 runs failed on base, 3 of 60 on this PR.
  • run 1, e2e test_title_runs_and_game_folder_is_untouched: every check of the title passed, but report.json had no called stubs, although the log shows the stub call. It looks like the last report write at process exit did not happen. I could not repeat it: the e2e target then passed 44 of 44 runs on this PR (40 of them at 4 threads). I have not seen it on base either, and I did not find the cause. Nothing in this diff touches the report or the exit path.

review: read the whole diff (4 files, +294 -10) and the code it calls. No blocking finding.

  1. The fix is needed and the tests prove it. With only the call in pipeline_state put back to graphics_pso, the unit test fails (left: None: the pipeline is not registered) and the title check fails with CreateDerivedPipelineStateX on stream PSO hr=0x80004005. With the fix both pass, and the unit test passed 30 of 30 repeats.
  2. The creator callback keeps stream = true and the stream's cacheable flag, for the retry without the dynamic flag too. That retry is only reached when the pipeline is built in the call, though: with background builds the stand-in already returns success, as vasanex found (low; I had missed it and confirmed it in go_background). Plain graphics pipelines behave like that on main too, and it matters only on a driver that reports the feature and then refuses the flag. note_pipeline_for_dump still gets the title's own desc.
  3. A stream with an unknown suffix (cacheable = false) is now a base as well. Pipelines derived from it go through dev_create_graphics_pso, which does cache. That looks right to me: what is cached is built from the projected desc that also makes the key.
  4. Streams that take the GraphicsStream path (a fractional depth bias, for example) are still not tracked, as the description says.
  5. Not tested: a retail title (none on this machine), AMD.
    performance: reasoned, not measured. Each stream-created graphics pipeline is now also kept as a base (its desc and shaders), as the plain ones are. The flag is part of the pipeline keys, so pipelines cached from streams before this change are built once more after the update. The smoke pair in the description has 1661 frames on main and 1405 on this head (85 %, above the 80 % limit), with 60 presents per 2 s at the end of both. That is the one rebuild of the cached pipelines: vasanex measured 1473 frames in the first run of the merged tree and 1693 in the second, against 1692 on main (RTX 3080).
    verdict: safe to merge
    hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
<!-- greyfinch-sync:ivall/xcl:comment:7377451758 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1661#issuecomment-7377451758). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-12-03T11:59:25Z. --- merge-check base: 0c725d5da298b90797993b568e30e6ff6b16e8b6 head: 0d670ae7c14ad1595848f669a70c1c43a2bbe131 merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3017 passed, 0 failed, 56 ignored in run 3; SKIPPED: 25, the same as base (22 no wave64, 2 no heap windows, 1 no GPU_UPLOAD heaps); failing: none in run 3, one test in each of runs 1 and 2 (3016 passed, 1 failed), a different one each time: - run 2, `list_x::tests::mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares`, E_OUTOFMEMORY: fails on base too. I ran the `list_x`, `device_x` and `stream_pso_tests` modules in turn on both sides at 8 threads: 13 of 60 runs failed on base, 3 of 60 on this PR. - run 1, e2e `test_title_runs_and_game_folder_is_untouched`: every check of the title passed, but `report.json` had no called stubs, although the log shows the stub call. It looks like the last report write at process exit did not happen. I could not repeat it: the e2e target then passed 44 of 44 runs on this PR (40 of them at 4 threads). I have not seen it on base either, and I did not find the cause. Nothing in this diff touches the report or the exit path. review: read the whole diff (4 files, +294 -10) and the code it calls. No blocking finding. 1) The fix is needed and the tests prove it. With only the call in `pipeline_state` put back to `graphics_pso`, the unit test fails (`left: None`: the pipeline is not registered) and the title check fails with `CreateDerivedPipelineStateX on stream PSO hr=0x80004005`. With the fix both pass, and the unit test passed 30 of 30 repeats. 2) The creator callback keeps `stream = true` and the stream's `cacheable` flag, for the retry without the dynamic flag too. That retry is only reached when the pipeline is built in the call, though: with background builds the stand-in already returns success, as vasanex found (low; I had missed it and confirmed it in `go_background`). Plain graphics pipelines behave like that on main too, and it matters only on a driver that reports the feature and then refuses the flag. `note_pipeline_for_dump` still gets the title's own desc. 3) A stream with an unknown suffix (`cacheable = false`) is now a base as well. Pipelines derived from it go through `dev_create_graphics_pso`, which does cache. That looks right to me: what is cached is built from the projected desc that also makes the key. 4) Streams that take the `GraphicsStream` path (a fractional depth bias, for example) are still not tracked, as the description says. 5) Not tested: a retail title (none on this machine), AMD. performance: reasoned, not measured. Each stream-created graphics pipeline is now also kept as a base (its desc and shaders), as the plain ones are. The flag is part of the pipeline keys, so pipelines cached from streams before this change are built once more after the update. The smoke pair in the description has 1661 frames on main and 1405 on this head (85 %, above the 80 % limit), with 60 presents per 2 s at the end of both. That is the one rebuild of the cached pipelines: vasanex measured 1473 frames in the first run of the merged tree and 1693 in the second, against 1692 on main (RTX 3080). verdict: safe to merge hardware / tool and model: RTX 3060 12 GB (610.88), Ryzen 7 5700X, Windows 11 Pro 26300 / Claude Code (Claude Opus 5.5)
vasanex commented 2026-12-03 12:43:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by vasanex on 2026-12-03T12:43:34Z.

Review: COMMENTED


Review of 0d670ae7 (code reading and the tests named below, not a merge-check) - 1 finding (low), 2 notes

In short: this adds to fromthemoonx's merge check of the same head (12:31Z) and does not repeat it. It asked whether the lower frame count in the description's smoke pair is one rebuild of the cached pipelines: measured here, it is. The first 60 s run of the merged tree shows 1473 frames against 1692 on main, the second run of the same tree 1693. One low finding about the retry without the flag is in its own thread, and two notes follow.

Result: no blockers found. From the code, nothing stands in the way of a merge. This is a review, not a merge-check; the whole suite and a smoke pair were run for it and are below.

Measured (RTX 3080, Windows 11, merge of 0d670ae7 onto main 0c725d5d, tree ed8054b5; the PR's base is b2b1f109, the merge is clean):

  • main 0c725d5d: cargo test --workspace --no-fail-fast -- --test-threads=4 (debug): 3016 passed, 0 failed, 56 ignored, 25 SKIPPED. scripts/smoke.ps1, 60 s, offline, release: 1692 frames, no device removal, no crash, peak commit 18814 MB.
  • merge, first pass: 3016 passed, 2 failed, 56 ignored, the same 25 SKIPPED. Smoke: 1473 frames (87 % of main), no device removal, no crash, 18057 MB.
  • merge, second pass (the same tree again): 3017 passed, 0 failed, 56 ignored, the same 25 SKIPPED. Smoke: 1693 frames, no device removal, no crash, 17949 MB.
  • The two failures of the first pass are one test, two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs (gpu_two_pass_cache_e2e), and its child process: "releasing the title PSOs releases their two-pass state", 1 left after the 5 s wait. Run alone it passed 3 of 3 on the merge and 3 of 3 on main, and it passed in the suite on main and in the second pass. The description lists the same test as failing before the rebase and calls it pre-existing; I could not make it fail on main here, so I leave it as seen once under load, cause not found.
  • With the call in pipeline_state put back to graphics_pso, the new unit test fails (left: None), as the merge check also found.
  • The new unit test together with the four existing depth-bias tests, 25 parallel runs at 4 threads: 0 failures (it changes the length of the global depth-bias cache that two tests in list_x compare before and after; from the code that can collide, here it did not).

Notes (not blocking):

  1. What the rebuild covers, beyond the driver blobs. The flag is part of graphics_blob_key, so of the blob file and the pipeline-library name, as the merge check says. It is also part of the recorded recipe: gfx_records writes "every field of the description but its pointers" and keeps each distinct payload once. After the update the title's cache therefore holds the earlier flagless recipes of its stream pipelines and, from the first run on, the flagged ones too; the preparation before each launch goes on building the flagless ones, which the title no longer asks for, and both count against the file's cap (XCL_GFX_RECORDS_MB). Read, not measured. A line in the README or the description about one slower first run would be fair to users; whether the stale recipes are worth dropping is the maintainer's call.
  2. Bundles (a question). list_x says a pipeline with the dynamic flag ignores its baked rasterizer bias, and sets the bias itself on CreateCommandList and SetPipelineState, except on bundles. That already holds for pipelines made through CreateGraphicsPipelineState; with this PR it also covers every stream pipeline. Does a stream pipeline with a static bias drawn inside a bundle still get it? Read only; I have no title that does this.

Not checked: AMD and Intel adapters, adapters without dynamic depth bias, a title that calls CreateDerivedPipelineStateX or RSSetDepthBiasX on stream pipelines (the smoke title's first 60 s do not show it), memory kept per recorded base over a long run.

Review by Claude Code (Claude Fable 5.2), with an independent second read by a subagent (Claude Fable 5.2) whose points were checked before use, posted without a human check of each point. An automated PR review workflow is running at the request of the user.

<!-- greyfinch-sync:ivall/xcl:review:6170037008 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1661#pullrequestreview-6170037008). Originally posted by [vasanex](https://github.com/vasanex) on 2026-12-03T12:43:34Z. **Review:** COMMENTED --- **Review** of 0d670ae7 (code reading and the tests named below, not a merge-check) - 1 finding (low), 2 notes In short: this adds to fromthemoonx's merge check of the same head (12:31Z) and does not repeat it. It asked whether the lower frame count in the description's smoke pair is one rebuild of the cached pipelines: measured here, it is. The first 60 s run of the merged tree shows 1473 frames against 1692 on main, the second run of the same tree 1693. One low finding about the retry without the flag is in its own thread, and two notes follow. **Result:** no blockers found. From the code, nothing stands in the way of a merge. This is a review, not a merge-check; the whole suite and a smoke pair were run for it and are below. Measured (RTX 3080, Windows 11, merge of 0d670ae7 onto main 0c725d5d, tree ed8054b5; the PR's base is b2b1f109, the merge is clean): - main 0c725d5d: `cargo test --workspace --no-fail-fast -- --test-threads=4` (debug): 3016 passed, 0 failed, 56 ignored, 25 SKIPPED. `scripts/smoke.ps1`, 60 s, offline, release: 1692 frames, no device removal, no crash, peak commit 18814 MB. - merge, first pass: 3016 passed, 2 failed, 56 ignored, the same 25 SKIPPED. Smoke: 1473 frames (87 % of main), no device removal, no crash, 18057 MB. - merge, second pass (the same tree again): 3017 passed, 0 failed, 56 ignored, the same 25 SKIPPED. Smoke: 1693 frames, no device removal, no crash, 17949 MB. - The two failures of the first pass are one test, `two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs` (`gpu_two_pass_cache_e2e`), and its child process: "releasing the title PSOs releases their two-pass state", 1 left after the 5 s wait. Run alone it passed 3 of 3 on the merge and 3 of 3 on main, and it passed in the suite on main and in the second pass. The description lists the same test as failing before the rebase and calls it pre-existing; I could not make it fail on main here, so I leave it as seen once under load, cause not found. - With the call in `pipeline_state` put back to `graphics_pso`, the new unit test fails (`left: None`), as the merge check also found. - The new unit test together with the four existing depth-bias tests, 25 parallel runs at 4 threads: 0 failures (it changes the length of the global depth-bias cache that two tests in `list_x` compare before and after; from the code that can collide, here it did not). Notes (not blocking): 1. **What the rebuild covers, beyond the driver blobs.** The flag is part of `graphics_blob_key`, so of the blob file and the pipeline-library name, as the merge check says. It is also part of the recorded recipe: `gfx_records` writes "every field of the description but its pointers" and keeps each distinct payload once. After the update the title's cache therefore holds the earlier flagless recipes of its stream pipelines and, from the first run on, the flagged ones too; the preparation before each launch goes on building the flagless ones, which the title no longer asks for, and both count against the file's cap (`XCL_GFX_RECORDS_MB`). Read, not measured. A line in the README or the description about one slower first run would be fair to users; whether the stale recipes are worth dropping is the maintainer's call. 2. **Bundles (a question).** `list_x` says a pipeline with the dynamic flag ignores its baked rasterizer bias, and sets the bias itself on `CreateCommandList` and `SetPipelineState`, except on bundles. That already holds for pipelines made through `CreateGraphicsPipelineState`; with this PR it also covers every stream pipeline. Does a stream pipeline with a static bias drawn inside a bundle still get it? Read only; I have no title that does this. Not checked: AMD and Intel adapters, adapters without dynamic depth bias, a title that calls `CreateDerivedPipelineStateX` or `RSSetDepthBiasX` on stream pipelines (the smoke title's first 60 s do not show it), memory kept per recorded base over a long run. Review by Claude Code (Claude Fable 5.2), with an independent second read by a subagent (Claude Fable 5.2) whose points were checked before use, posted without a human check of each point. An automated PR review workflow is running at the request of the user.
vasanex commented 2026-12-03 12:43:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by vasanex on 2026-12-03T12:43:34Z.

Code review location: crates/xcl/src/hle/d3d12x/device_x.rs; line 224

@@ -215,19 +221,19 @@ unsafe fn create_graphics_pso_tracked(this: *mut c_void, desc: *const c_void, ri
         if want_dynamic {
             let mut dyn_desc = orig;
             enable_dynamic_depth_bias(&mut dyn_desc.0);
-            let hr = real::dev_create_graphics_pso(this, dyn_desc.0.as_ptr() as *const c_void, riid, ppv);
+            let hr = create(this, dyn_desc.0.as_ptr() as *const c_void, riid, ppv);

Low, read (not measured). Needs an adapter that reports dynamic depth bias and then refuses a pipeline with the flag.

With lazy pipelines the retry without the flag is never reached for a stream pipeline. create is now graphics_pso(.., true, cacheable); when the pipeline is not ready it returns the stand-in from go_background with a success code and builds in the background. So hr >= 0 here, used_dynamic becomes true, the base is recorded as dynamic, and the fallback two lines below does not run. If the background build with the flag then fails, the pipeline stays a stand-in (it draws nothing), where main builds it without the flag.

For CreateGraphicsPipelineState this is already so on main; the PR puts every stream pipeline on that path. In the synchronous case a failure that has nothing to do with the flag is now also tried twice.

Suggested fix: none needed if no supported driver refuses the flag after reporting it; otherwise let the background build fall back to the flagless description and correct the recorded base. Saying which of the two it is in the description would be enough for me.

<!-- greyfinch-sync:ivall/xcl:review-comment:4784834400 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1661#discussion_r4784834400). Originally posted by [vasanex](https://github.com/vasanex) on 2026-12-03T12:43:34Z. **Code review location:** `crates/xcl/src/hle/d3d12x/device_x.rs`; line 224 ~~~~diff @@ -215,19 +221,19 @@ unsafe fn create_graphics_pso_tracked(this: *mut c_void, desc: *const c_void, ri if want_dynamic { let mut dyn_desc = orig; enable_dynamic_depth_bias(&mut dyn_desc.0); - let hr = real::dev_create_graphics_pso(this, dyn_desc.0.as_ptr() as *const c_void, riid, ppv); + let hr = create(this, dyn_desc.0.as_ptr() as *const c_void, riid, ppv); ~~~~ --- **Low, read (not measured). Needs an adapter that reports dynamic depth bias and then refuses a pipeline with the flag.** With lazy pipelines the retry without the flag is never reached for a stream pipeline. `create` is now `graphics_pso(.., true, cacheable)`; when the pipeline is not ready it returns the stand-in from `go_background` with a success code and builds in the background. So `hr >= 0` here, `used_dynamic` becomes true, the base is recorded as dynamic, and the fallback two lines below does not run. If the background build with the flag then fails, the pipeline stays a stand-in (it draws nothing), where main builds it without the flag. For `CreateGraphicsPipelineState` this is already so on main; the PR puts every stream pipeline on that path. In the synchronous case a failure that has nothing to do with the flag is now also tried twice. Suggested fix: none needed if no supported driver refuses the flag after reporting it; otherwise let the background build fall back to the flagless description and correct the recorded base. Saying which of the two it is in the description would be enough for me.
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/1661:upstream-pr/1661'
git switch 'upstream-pr/1661'

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