D3D12.X: XCL_PSO_MANIFEST=1 writes the order a run asks for its pipelines (#2088) #2096
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2096
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2096"
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?
@Anon64 on GitHub · 2026-11-25 03:53 UTC · original
Anon64:d3d12x/pso-manifest→main· +215 −1 · 5 files · 1 commits · openXCL_PSO_MANIFEST=1writes the order in which a run asks for its pipelines, as it goes, topso-manifest.txtbesideused-pipelines.txt. It records which pipelines a title needs before each point of its start, in the order it needs them, and which ones it had to wait for. That is the input #2088's milestone precompile needs, and it is workstream 1's first part, as claimed there. Recording only, off by default: nothing is built, ordered or skipped differently. Part of #2088.The file is new each run, one tab-separated event a line, numbered in file order, with milliseconds since the first event:
use: a pipeline's first use (pso_async'snote_use, the same point that feedsused-pipelines.txt), its shader-set key, compute or graphics, andready/cold(built by then or not);build: each driver compile (driver_compile_identified): kind, DXIL bytes, the console record's hash and whether a driver blob was supplied, time in the driver, and time waiting for a compile slot;present: the title's presents at milestones (1, 2, 4 … 1024, then every 1024th), so a manifest shows where presents stop and whether they come back.What is in it
crates/xcl/src/hle/d3d12x/pso_manifest.rs(new): the switch, the line format, the file, and three unit tests (the line layout against the header, the present milestones, the order of a first use against a concurrent bind).pso_async.rs: auseevent inPending::note_use, throughpso_manifest::note_first: the line is written under the manifest's lock before the pipeline is marked used, so a second bind of it and anything recorded after come later in the file (found in review by @ettehn; testa_second_bind_comes_after_the_first_use_line, which fails with the old order).real.rs: abuildevent indriver_compile_identified.present.rs: apresentevent at the milestones.mod.rs: the module.Tested
cargo test --workspace --no-fail-fast -- --test-threads=4(debug) on3b84de8: 1156 passed, 1 failed, 46 ignored. The failure ishle::kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory, which fails the same way onmain. SKIPPED (no wave64 / no dxil.dll / per-lane refusals on this adapter):ir_text_assembles_signs_and_runs,a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu,a_per_lane_2d_or_3d_group_runs_on_the_gpu,const_and_null_mask_operands_agree_with_hlsl_on_the_gpu,f16_programs_on_the_gpu,f32_programs_on_the_gpu,f64_programs_on_the_gpu,integer_programs_on_the_gpu,mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,heap_window_out_of_memory_falls_back_to_the_switch_form.XCL_PSO_MANIFEST=1 XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 XCL_PSO_PRELOAD=0, release, 150 s, A pressed every 4 s. XCL's DXIL cache and the NVIDIA cache were warm from earlier runs; the driver-blob column says which builds got a blob. The run wrote 1 030 lines: 511 first uses (510 cold, as expected with lazy pipelines and no preload), 508 driver builds, and presents up to the 1024th at 36.5 s. 12 pipelines were first used before that present; the other ~500 came after it, in the world load, where presents stop before the 2048th. No crash, no device removal.Regression run
scripts/smoke.ps1 -Game <title folder>, 60 s, release, default settings (XCL_PSO_MANIFESTunset), A pressed every 4 s from 20 s:main:
this PR:
Not tested
XCL_LAZY_PSO=0: reviewers measured that a compute pipeline built at creation gets abuildrecord but nouserecord (@itsSio, @ettehn onbb4dea4). With the default lazy pipelines theuserecord is there. A manifest captured withXCL_LAZY_PSO=0is incomplete.AI use
🤖 Generated with Claude Code
@anes66 on GitHub · 2026-11-25 05:10 UTC · original
CPU-only file-writer verification on exact head
5ffbb5ec8b5b4b475c603a3c14da1ed5d3847b9dpassed. Optional test companion d098ec2 is directly on that head and adds one integration test only.The unit-test build intentionally disables file creation, so this test compiles the unchanged
pso_manifest.rsinto a small non-test executable. Only cache-directory lookup and logging are supplied by the harness; the recorder, formatting, environment switch, file I/O and synchronization come from the real module. No GPU or title is involved.Tested
0/trueleave a missing cache directory untouched;1and whitespace-padded1each record 1,024 mixed events from eight synchronized threads; an unset process preserves an existing file; a fresh enabled process replaces that file and restarts sequence numbering; an invalid destination remains intact and the recorder returns without crashing.cargo test --locked -p xcl --test pso_manifest_processes -j 2 -- --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignored, 0 skips.cargo test --locked -p xcl --lib hle::d3d12x::pso_manifest::tests:: -j 2 -- --nocapture --test-threads=1: 2 passed, 0 failed, 0 ignored, 0 skips.Not tested
Actual
note_use/ driver / present call sites, first-use deduplication, correlation across event types, real cache-directory selection, GPU execution, retail milestones, release, full workspace suite, or performance. The test validates the recorder's file contract; it does not establish a startup speedup or first playable frame. No competing runtime PR.AI use
Codex (GPT-6; exact variant unavailable) wrote the test and temporary negative controls, ran CPU verification and prepared this report.
@DavidM1911 on GitHub · 2026-11-25 05:43 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@JoaoPauluu on GitHub · 2026-11-25 05:47 UTC · original
A regression run under Wine on Linux on the retail title: no device removal, no crash, frames level with
main(1353 here; 1360 and 1374 on the twomainruns). This PR's run is withXCL_PSO_MANIFEST=1; the two new tests pass under Wine.With
XCL_PSO_MANIFEST=1the run loggedpipeline requests are written to C:\users\steamuser\AppData\Local\xcl\dxil\pso-manifest.txtat 3.9 s and wrote 245 events after the header:build: 227graphicswithcold, 1 with a driverblob. Theirdriver_mssum to 17 ms andwaited_msto 0. I have not checked why the driver times are this low under vkd3d-proton. Three record hashes account for 222 of the builds (102, 102 and 18).use: 5graphics ready, 1compute ready.present, up topresent 1024at 45120 ms.So this run has 6 first uses against 228 builds. Your run had 511 first uses. I have not checked whether the gap is expected, for example because builds that go through the stand-in path have no
useevent.Tested
x86_64-pc-windows-gnu.5ffbb5eas it is (based oncbc296a) andmain6020a33, no uncommitted changes. Retail title 1.0.2.1,scripts/linux/smoke.sh(#257) for 60 s, no input. Runs in order: main, this PR (with other PRs in between), main. The new lib tests ran under Wine, one test per process.Regression run
main (first run):
this PR:
The second
mainrun: 1374 frames,exit: 0x0, no device removal, no crash. Under Wine,peak commitreads 0 MB, so these blocks do not check memory.Not tested
XCL_DIRECT_DXIL=1, a cold driver cache, native Windows.AI use
@luckyteagirl on GitHub · 2026-11-25 06:02 UTC · original
Independent native Windows check of exact PR head
5ffbb5ec8b5b4b475c603a3c14da1ed5d3847b9dagainstmain6020a33b16ba2de25b3aef5947552f2dc1831f09.Hardware/toolchain: Windows 11 build 26200, Ryzen 9 5980HX, Radeon RX 6800M driver
30.0.13002.13003, Rust 1.99.0 MSVC, DXC/DXIL 1.9.2609.5.Tested
cargo test --locked -p xcl --lib -j 2 pso_manifest::tests -- --test-threads=1 --show-output: 2 passed, 0 failed, 0 ignored on the exact PR head.cargo build --locked --workspace --release -j 2: passed.XCL_PSO_MANIFEST=1was set on the PR run only. Both completed without the guard firing:The PR created
pso-manifest.txtin the isolated DXIL cache. It contained the v1 header and exactly one event,0\t0\tpresent\t1, consistent with the one shown frame.used-pipelines.txtwas empty. This short run did not reach a pipelineuseorbuildevent, a world-loading milestone, or a meaningful performance comparison. It checks the enabled recorder's startup, file location, and first-present event on this AMD setup; the two unit tests check line formatting and milestone selection.No game data was uploaded. AI-assisted testing and report drafting with OpenAI Codex (GPT-6); I checked the exact revisions and local logs before posting.
@ettehn on GitHub · 2026-11-25 07:14 UTC · original
CPU-only A/B for two binds of the same pending pipeline. On Windows 11 25H2 (26200.9974), Ryzen 9 8945HX and rustc 1.97.1 MSVC, I compiled the actual
Pending::note_usebody from5ffbb5e, the real manifest writer, and thecompute_prefixparser from #2104 in a small harness. It pauses the first bind insideused::note, then lets a second thread bind the same pending pipeline and emitPresent(1)before releasing the first thread. The harness controls thread scheduling and writes to an isolated directory.5ffbb5e, 20/20: the file hadpresentthenuse. The parser selected[]through present 1.usethenpresent. The parser selected[1]. The candidate writes the first-use event under the manifest lock before publishing theusedflag when recording is enabled.The candidate also passed the 3 manifest and 6 async-pipeline unit tests with
cargo test --locked --offline -j 2 -p xcl --lib <filter> -- --test-threads=1. This is a controlled interleaving. Frequency during retail runs and recording overhead are unmeasured. No GPU or title was used.Verification and local patch assisted by OpenAI Codex (GPT-6).
@Anon64 on GitHub · 2026-11-25 07:27 UTC · original
@ettehn thanks, you're right.
used.swap(true)published the flag before the line was written, so a second bind could go on, and a present could get into the file, ahead of the first use. Fixed in3b84de8(squashed into the PR's commit):pso_manifest::note_firstchecks the flag, writes theuseline and only then sets the flag, all under the manifest's lock.Pending::note_usegoes through it. With recording off it is the oldswap.a_second_bind_comes_after_the_first_use_line: two threads bind one pipeline at once for 200 rounds. The losing one records a present as soon as its bind returns, and the test checks that theuseline comes first and appears once.presentbeforeuse, your interleaving. That was with ayield_nowadded to widen the window, so in a real run it would be much rarer.The full suite and the smoke pair on the new head are running; I'll update the description with both.
Written with Claude Code (Claude Opus 5.5).
@Gevroska on GitHub · 2026-11-25 08:14 UTC · original
Could you add a sentence to the manifest docs explaining when a
buildrecord is written? As I read the patch, it’s emitted when the driver compilation returns. Until then, the absence of abuildline can mean the request is still waiting for a compile slot or the driver call is still in progress. The manifest alone can’t distinguish those cases.I ran into that ambiguity when reviewing two RTX 3080 world-loading traces captured before this PR. The ordinary logs showed three driver calls in one run and four in the other. The earliest logged call started about 12 seconds after the last shown-present interval in the first run and 11 seconds after it in the second. None of the seven logged calls spanned the point where presentation stopped. That leaves earlier unlogged work unresolved. A short note would help anyone reading a manifest that ends during a stall.
I used Codex with GPT-6.2 Sol to analyze the saved traces. A separate GPT-6.2 Sol agent independently verified the timing comparison.
@Anon64 on GitHub · 2026-11-25 08:21 UTC · original
Added in
bb4dea4, in the module docs: abuildline is written when the driver call returns, so a compile that is still waiting for a slot or still in the driver has no line yet, and a manifest that ends in a stall cannot tell those two apart. Smoke blocks in the description are rerun on the new head.(Claude Code, Claude Opus 5.5)
@raylitebull on GitHub · 2026-11-25 10:47 UTC · original
Code review on
bb4dea4:pso_manifest::note_first_oncleanly checks and setspending.usedunder the manifest mutex so losing concurrent binds never emit apresentbefore the winninguseline (a_second_bind_comes_after_the_first_use_line).Remaining before merge: Fix
PR description,Build and testgreen, and dual-vendor verification onbb4dea4.@itsSio on GitHub · 2026-11-25 11:57 UTC · original · edited 2026-11-25 12:02 UTC
The manifest omits the first-use event for a compute pipeline built synchronously with
XCL_LAZY_PSO=0, even when its dispatch and readback succeed. Lazy-on runs recorded that event, including a new process reusing the DXIL cache directory. This is a limitation of the tested synchronous path, not evidence that a reused DXIL cache alone drops events. #2104 selectsuserather thanbuildrecords, so these manifests should not be assumed complete for milestone precompile.Tested: Clean
bb4dea405b5a108fc1a73e0de77537ed6fd93b59, Windows 11 Pro build 26200, NVIDIA 610.88, debug MSVC:On each PC ran
cargo test -p xcl --locked -j 4 --test gpu_compute_e2e console_wave64_compute_through_the_pso_hook_dispatch_and_read_back -- --exact --nocapture --test-threads=1withXCL_PSO_MANIFEST=1,XCL_ASYNC_PSO=1, andXCL_PSO_DISK_CACHE=0. Each run was 1 passed, 0 failed, 0 ignored, 0 runtime skips. WithXCL_LAZY_PSO=1, both a fresh XCL DXIL cache and a subsequent process reusing it recorded oneuse, onebuildper PC (keyb3b2fd750cde2d8d). WithXCL_LAZY_PSO=0and a separate fresh XCL DXIL cache, each PC recorded zerouse, onebuild. The built record wasf762fc1473e87d61in all six runs. A targeted docs note aboutXCL_LAZY_PSO=0would prevent readers from treating those captures as complete.Downstream CLI check: On both machines
cargo build --workspace --locked -j 4succeeded at clean #2104 headf1810d0c362e73822e08bacf789e7422736ffafc. I appended one syntheticpresent 1event to each capture because the readback test does not present. Inxcl shaders <unrelated-synthetic-record> --precompile --pipelines --pso-manifest <capture> --through-present 1, both lazy-on captures selected the recorded key and exited 2 withunmatched compute keys (1): b3b2fd750cde2d8d, as expected for the deliberately unrelated input. The lazy-off build-only capture exited 0 withpresent 1: 0 compute pipelines in first-use orderon both PCs. This confirms the CLI behavior, not a real startup milestone or a pipeline build.Not tested: A matching #2104 precompile build,
XCL_ASYNC_PSO=0, graphics, a retail title, AMD, or the whole workspace on these heads.AI use
Ran via Samaritan:
@ettehn on GitHub · 2026-11-25 13:46 UTC · original
I reproduced @itsSio’s missing compute use record on clean
bb4dea4with a synthetic dispatch/readback on Windows 11, RTX 5070 Ti Laptop (621.24), DXC 1.8.2502.11. WithXCL_ASYNC_PSO=1andXCL_LAZY_PSO=0, the readback passed but the manifest contained onebuildand zerouserecords.A local follow-up covers both paths. The eager background submission now carries the same shader key into
Pendingwhen manifest logging is enabled. The already-translated synchronous path keeps the key until first bind (or final release) and records it asready. Neither changes scheduling or which PSOs enter the lazy preload history.On the patched build, cold eager, warm eager, lazy, and async-off runs each recorded exactly one compute
useforb3b2fd750cde2d8d, with one build and correct readback. Trace-off produced no manifest. A new GPU regression also checks that synchronous creation has nouseyet, then calls the realSetPipelineStatehook twice and checks that only onereadyuse follows the build.gpu_compute_e2ereported 5 passed, 0 failed, with one explicit skip (the existing heap-window fallback test). Synthetic input only.OpenAI Codex assisted.
@Anon64 on GitHub · 2026-11-25 17:32 UTC · original
@itsSio @ettehn thank you both: two machines and a third reproduction agree, so it's confirmed. With
XCL_LAZY_PSO=0, a compute pipeline built at creation is never bound through a pending entry, so nouseline is written for it. I've added this under Not tested in the description, so nobody treats such a capture as complete.@ettehn, your follow-up covers both the eager and the already-translated synchronous path and comes with a GPU regression test. Rather than write a second version, could you open it as a PR stacked on this one (
Stacked on #2096)? Pushing it tod3d12x/pso-manifestwould also work. Either way I'll run it on the RTX 3060 and post the results there.AI use: Claude Code, Claude Opus 5.5 read the reports and wrote this reply.
@DavidM1911 on GitHub · 2026-11-26 07:28 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
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.