D3D12.X: reuse the pipeline lookup when binding a stand-in #1698
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1708"
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 CallMeBrado on 2026-11-24T19:31:00Z.
A title can bind the same completed pipeline thousands of times. Each bind used to look up its stand-in twice. A compute bind with the default wait policy also locked the job, demand and completion state even when the worker had already published the real pipeline.
What is in it
Bind using the entry from the first lookup. A waiting caller checks the published pipeline pointer after recording first use. A zero pointer still takes the existing wait and failure paths. The new test lets a worker finish before binding and checks that the bind returns its pipeline without requesting a priority boost.
Tested
cargo build --locked --workspace --jobs 6andcargo test --locked --workspace --no-fail-fast --jobs 6 -- --test-threads=4 --show-outputpassed. 859 reported passed, 0 failed, 42 ignored. The following tests reported a skip on this machine.gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask(no wave64)gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware(no wave64)heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows)test_title_draws_with_a_root_signature_under_the_debug_layer(no xgameruntime.dll)I timed
resolve_for_bindin release against 256 already-built stand-ins, with the default wait policy. Each caller cycled through the handles 500,000 times. The numbers are median elapsed time divided by total binds over seven runs per revision, alternating run order.Reproduce the bind benchmark
The harness uses synthetic pipeline handles and does no GPU work. To run it with Cargo, save it as
crates/xcl/examples/bind_cost.rsin a local checkout, leaveXCL_PSO_WAIT_MSunset and runcargo run --release -p xcl --example bind_cost -- 1 compute. The first argument is the caller count and the second iscomputeorgraphics. The output is nanoseconds per bind.Regression run
The retail title, 60 seconds per build, separate empty XCL profiles and shader caches,
XCL_DXC_THREADS=3.main
PR
Not tested
Gameplay frame times, world loading and other GPU vendors. Optional retail sample variables were unset for the workspace suite. The benchmark measures CPU bind resolution.
AI use
OpenAI Codex (GPT-6) wrote the change, test and benchmark, ran the checks and drafted this PR.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T22:09:39Z.
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T04:25:51Z.
PR #1708 verification
Clean detached head
35ec9ebfae008778d7fef2cd8e5a05379e4797aaon STOR-WINLAB. Windows 11 Enterprise Evaluation (build 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). Unoptimized dev/test profiles, with debug info and incremental compilation disabled.Tested
cargo build --workspaceandcargo test --workspace --no-runboth exited 0 outside the Arc mutex. Cargo prepared 19 test executables.cargo test -p xcl --lib hle::d3d12x::pso_async::used_tests -- --test-threads=1outside the mutex withXCL_ADAPTER=NONE_CPU_ONLYandRUST_TEST_NOCAPTURE=1yielded 6 passed, 0 failed, 0 ignored, and 0 explicit skips.crates/xcl/src/hle/d3d12x/pso_async.rs. Its new test uses synthetic handles to check that binding a completed compute stand-in returns the real pipeline, leaves the demand flag clear, and returns the real handle on release. It also checks the unbounded wait path. Existing tests exercised the wait budget, demand signaling, and preload behavior.cargo test --workspace --no-fail-fast -- --test-threads=4once insideInvoke-ArcTest.ps1withXCL_ADAPTER=A770andRUST_TEST_NOCAPTURE=1. Cargo exited 101. All 20 result lines (19 executables plus doc-tests) sum to 841 passed, 18 failed, and 42 ignored. The new unit test passed in this run too.Workspace failures and skips
CreateComputePipelineStatefailures (0x80070057) and four assertion failures in FMA, mip sampling, VALU, and wave reductions. The e2e title failed theRSSetDepthBiasXdynamic depth-bias check (blue pixel instead of green).SKIPPEDlines report two wave64 cases, one tiled-resource tier requirement, one unavailable heap-window case, and two missing D3D12 debug-layer cases. Cargo includes these early returns in the pass count. Sample-backed cases also returned early with the sample variables unset.Not tested
Matched
mainrun, retail-title smoke, bind performance, or other adapters.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
pr1708-suite.logand published.Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T20:17:47Z.
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 Foniass on 2026-12-01T06:32:51Z.
Triage (#1607) – head
35ec9ebThis change is on main as commit
4e59a81("D3D12.X: reuse pending pipeline entries on bind", merged with #2959), which says it was adapted from this PR.resolve_for_bindnow resolves through the entry from its first lookup (resolve_pending/resolve_wait_pending), returns the real pipeline oncebuild.realis set, and has the testbinding_a_completed_compute_pipeline_neither_relooks_it_up_nor_requests_work.Recommendation: close (superseded by main commit
4e59a81).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 throny on 2026-12-01T12:47:21Z.
Closing as superseded: this change is already on
main(4e59a81).4e59a81(adapted from #1708): resolve_for_bind resolves through the first retained Pending and returns a published real pipeline after one load; main test binding_a_completed_compute_pipeline_neither_relooks_it_up_nor_requests_workTwo independent checks found this: Foniass's close list on #1607 and ours against current
main. If something here is still missing onmain, say so and reopen it, or ask and I will.AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.
Pull request closed