D3D12.X: route stream graphics PSOs through create_graphics_pso_tracked #1651
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1661"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by fixgep on 2026-11-24T18:53:04Z.
Part of #1489 (
XCL-BT-023).When
pipeline_state(called bydev_create_pipeline_state) unpacks a graphics pipeline state stream viastream_pipeline,StreamPipeline::Graphics(d, cacheable)still callsgraphics_psodirectly, bypassingdevice_x::create_graphics_pso_tracked. As a result, stream-created graphics PSOs never receiveD3D12_PIPELINE_STATE_FLAG_DYNAMIC_DEPTH_BIASon supported adapters and are never recorded bydevice_x::note_base, causing subsequentCreateDerivedPipelineStateX(#55) andRSSetDepthBiasX(#94) calls to fail.(
StreamPipeline::GraphicsStream, added onmainfor extended rasterizer streams without a projectedD3D12_GRAPHICS_PIPELINE_STATE_DESC, stays on its native stream path outsidecreate_graphics_pso_tracked.)What is in it
device_x::create_graphics_pso_trackedover its PSO creation callback incrates/xcl/src/hle/d3d12x/device_x.rs.StreamPipeline::Graphicsinpipeline_statethroughdevice_x::create_graphics_pso_trackedwithgraphics_pso(..., true, cacheable)(keepingnote_pipeline_for_dumpintact and leavingGraphicsStream,Compute, mesh, andUnknownstream paths unchanged) incrates/xcl/src/hle/d3d12x/real.rs.stream_pso_tests::stream_graphics_pso_is_tracked_for_derived_and_depth_biasincrates/xcl/src/hle/d3d12x/real.rs(resolving the stand-in shell viabind::PreparedNativePipelinebeforeCreateCommandList) and title checkgpu::stream_graphics_pso_trackingintests/testtitle/src/gpu.rsandtests/testtitle/src/main.rs.Tested
32.0.16.2140), AMD Ryzen 5 7500F 6-Core Processor, Windows build10.0.26200.0,rustc 1.100.0 (0ef1bc386 2026-11-09)0d670ae7(rebased ontoupstream/mainb2b1f109):cargo build -j 4 --workspace,cargo test -j 4 --workspace --no-run, andcargo build -j 4 --release -p xcl: exit code0,0new warnings (39pre-existingxcllib warnings on bothupstream/mainb2b1f109and0d670ae7)cargo test -j 4 -p xcl --lib stream_pso_tests -- --test-threads=1:1 passed, 0 failed, 0 ignored, 0 skippedon RTX 3060;1 passed, 0 failed, 0 ignored, 0 skippedwithXCL_ADAPTER=warpcargo test -j 4 -p xcl --test e2e -- --test-threads=1:5 passed, 0 failed, 0 ignored, 0 skippedon RTX 3060 (includes[PASS] D3D12.X: stream-created graphics PSO tracks CreateDerivedPipelineStateX and RSSetDepthBiasX)4f62f273(same logic prior to conflict resolution inreal.rs):cargo test -j 4 --workspace --no-fail-fast -- --test-threads=4:2608 passed, 1 failed(pre-existinggpu_two_pass_cache_e2e::two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs),49 ignored,27 SKIPPEDGPU tests on RTX 3060Regression run
Baseline (
upstream/main,XCL_PREPARE=0):This branch (
fix/stream-graphics-pso-tracking,XCL_PREPARE=0):Not tested
cargo test --workspacerun after rebasing ontob2b1f109(targetedstream_pso_testson RTX 3060 + WARP ande2eon RTX 3060 were run on0d670ae7)e2etest_title_*checks withXCL_ADAPTER=warp(software WARP crashes inD3D10Warp.dllon the earlierrender_trianglecheck, as excluded in CI)XCL_SAMPLE_*tests (no sample variables set)AI use
upstream/main(fa204595), updatedstream_pso_testsstand-in shell resolution, and ran earlier workspace/targeted tests and smoke runs.upstream/main(b2b1f109), resolved thereal.rstest-module merge conflict, ran the workspace/release builds, targeted tests (stream_pso_testson RTX 3060 and WARP,e2eon RTX 3060), paired 60-secondsmoke.ps1runs, and updated/validated the PR description.Imported from ivall/xcl. Originally posted by eizispark on 2026-11-24T19:21:01Z.
Hardware test report — commit
f70293dVerified
f70293d56a46ea2b2d6cbcd7afac241dd777cfeb(clean merge withmainc160d86ef2efe3a07e4dfb473e4fa72eafb413c0): pass.Tested
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 smokecargo 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_biasandtest_title_runs_and_game_folder_is_untouched(testtitlee2egpu::stream_graphics_pso_tracking) passedgpu::recomp::tests::gpu_clamp_and_omod_per_instructionand both wave64 GPU tests skipped on NVIDIA (gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware, plusconsole_wave64_compute_through_the_pso_hook_dispatch_and_read_back) ran natively and passed on RDNA4Regression run
main(c160d86ef2efe3a07e4dfb473e4fa72eafb413c0):PR (
f70293d56a46ea2b2d6cbcd7afac241dd777cfeb):Not tested
OPTIONS16dynamic depth bias (Intel Arc fallback path) except through unit/e2e coverage, Wine/vkd3d-proton, gameplay past the menusAI use
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!
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T04:47:47Z.
XCL PR #1661 — Windows / Arc A770 verification
Clean detached head
f70293d56a46ea2b2d6cbcd7afac241dd777cfebon 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 --workspaceandcargo test --workspace --no-runsucceeded outside the Arc mutex. The test build produced 19 executables.Invoke-ArcTest.ps1withXCL_ADAPTER=A770andRUST_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, nativeRSSetDepthBiaswithout 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 20test 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
RSSetDepthBiasX(-1000.5)produced a blue top-right pixel where the test expected green.SKIPPEDlines 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
mainbaseline, 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.logand published.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
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by fixgep on 2026-11-29T07:32:04Z.
Rebased onto current
main(fa204595) at4f62f273with updated RTX 3060 / WARP tests and paired 60 s smoke runs (pr_check.py: 0 problems). Still fixesStreamPipeline::Graphicsinpipeline_statebypassingdevice_x::create_graphics_pso_tracked, so stream-created graphics PSOs getD3D12_PIPELINE_STATE_FLAG_DYNAMIC_DEPTH_BIASand base tracking forCreateDerivedPipelineStateX(#55) andRSSetDepthBiasX(#94).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
cacheableflag.The
Build and test (Windows, no GPU)check passes on0d670ae7.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-12-03T11:59:25Z.
merge-check
base:
0c725d5da2head:
0d670ae7c1merge: 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:
list_x::tests::mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares, E_OUTOFMEMORY: fails on base too. I ran thelist_x,device_xandstream_pso_testsmodules in turn on both sides at 8 threads: 13 of 60 runs failed on base, 3 of 60 on this PR.test_title_runs_and_game_folder_is_untouched: every check of the title passed, butreport.jsonhad 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.
pipeline_stateput back tographics_pso, the unit test fails (left: None: the pipeline is not registered) and the title check fails withCreateDerivedPipelineStateX on stream PSO hr=0x80004005. With the fix both pass, and the unit test passed 30 of 30 repeats.stream = trueand the stream'scacheableflag, 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 ingo_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_dumpstill gets the title's own desc.cacheable = false) is now a base as well. Pipelines derived from it go throughdev_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.GraphicsStreampath (a fractional depth bias, for example) are still not tracked, as the description says.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)
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 notesIn 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
0d670ae7onto main0c725d5d, tree ed8054b5; the PR's base isb2b1f109, the merge is clean):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.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.pipeline_stateput back tographics_pso, the new unit test fails (left: None), as the merge check also found.list_xcompare before and after; from the code that can collide, here it did not).Notes (not blocking):
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_recordswrites "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.list_xsays a pipeline with the dynamic flag ignores its baked rasterizer bias, and sets the bias itself onCreateCommandListandSetPipelineState, except on bundles. That already holds for pipelines made throughCreateGraphicsPipelineState; 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
CreateDerivedPipelineStateXorRSSetDepthBiasXon 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.
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 224Low, 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.
createis nowgraphics_pso(.., true, cacheable); when the pipeline is not ready it returns the stand-in fromgo_backgroundwith a success code and builds in the background. Sohr >= 0here,used_dynamicbecomes 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
CreateGraphicsPipelineStatethis 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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.