D3D12.X: a journal of the pipelines a title queues (<data>\cache\pipelines.bin) #753
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/758"
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 ghost on 2026-11-24T04:44:07Z.
Part 2 of 3 for #755. Stacked on #757; its own commits are the four after #757's head (the journal, its write-error handling, the heap-window flag, the journal off the title's threads).
Every pipeline with console shaders that goes to
pso_async(DXIL not cached yet, or madelazily) is appended to
<data>\cache\pipelines.bin. Each entry holds its desc field by field,with no pointers and no padding, so the same pipeline always hashes the same. It also holds the
input layout and its shaders by hash (each shader written once), together with the run's memory
windows. A pipeline's first build is marked as used. On open, only the frames' headers are read
to skip entries of earlier runs, and a torn last frame is cut off. One title process writes at a
time; a second one gets no journal.
replayreads an entry back with everything it points toowned and no pointer taken from the file. Part 3 (
xcl pipelines) compiles from it.XCL_PSO_JOURNAL=0turns it off.It is on by default in this PR: per pipeline the journal costs an fnv64 of its desc and shader bytes, made with
no lock held, and for a new one an append under the journal's lock. The frame headers of earlier
runs (about 63 000 for a 123 MB journal) are read on a thread of its own; what the title notes
meanwhile waits in memory (each frame once, at most 256 MB) and is written once it is open. The
tool in part 3 has nothing to read without it. 605 lines (
pso_journal.rs597), about 150 of them the reader and the tests.What is in it
gives the same hash (
crates/xcl/src/hle/d3d12x/pso_journal.rs)go_background(crates/xcl/src/hle/d3d12x/real.rs) and the module(
crates/xcl/src/hle/d3d12x/mod.rs)windows_byte,mem_windows_of), with a testTested
c02d059(opened on its own thread, the lock for appends only):cargo test -p xcl --lib -- pso_journal --test-threads=1: 3 passed, 0 failed, with the newwhat_is_noted_while_the_journal_opens_is_written_after_in_order; the run below opened a journal of 122 806 entries from earlier runs and appended to itmain9e3831e:cargo test -p xcl --lib -- pso_journal --test-threads=1: 2 passed, 0 failed, with the newthe_heap_windows_flag_is_kept(0cc1dee: since #680mem_windowscarriesHEAP_WINDOWS= 0x100, which the frame's windows byte cut off; the count is now in its low 7 bits and the flag in the top bit). The workspace run below is from before the rebase, onf4ce27ccargo test --workspace -- --test-threads=4: 659 passed, 3 failed, 21 ignored; the 3 failures (title_textures::placed_title_textures_share_vram_and_preserve_pixels,title_textures::transitions_apply_when_their_list_is_submitted,vram::d32s8_targets_take_their_own_size_of_video_memory) fail onmain(f4ce27c) the same way in a full run (657 passed, 3 failed there) and pass alone; no GPU test SKIPPED(
pipelines.bin: 123 MB)Regression run
main:
PR (this PR's head commit; the title is run through a folder named RetailTitle):
The first smoke run on this commit crashed at 31.7 s in the title's own code (a write to 0,
game_scarlett_master.exe+0x2215c35, during the Series S startup stall upstream still has); the run above, on the same build, is the re-run.Not tested
AI use
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T07:06:01Z.
Full-suite run, since this PR has no test report yet. Tested exact head
b617c88(on its basef4ce27c).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 702 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.graphics_round_trip.Not tested
AI use
upstream-sync referenced this pull request2026-11-25 07:04:28 +00:00
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T11:16:20Z.
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 KDenKC on 2026-11-27T14:34:37Z.
@oishigeso, a use for this journal: because it records each description when the title creates the pipeline (
go_background), one short run captures pipelines the title only builds minutes later. Fed into #2829's offline corpus, that removed a 135-pipeline graphics compile wall in an in-title A/B (135 of 135 from blobs, against 0 of 135): https://github.com/xcl-dev/xcl/issues/2088#issuecomment-7220952941Two gaps we noted for that use, if you revisit it:
Gframes carry no depth-bounds flag (#2829 keys depth-bounds variants separately), and two-pass mesh (OwnedDesc::Stream) isn't journaled. Neither mattered for these 135.AI use: Claude Code (Claude Opus 5.5).
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:04:42Z.
Triage (#1607) – head
c02d059Part 2 of the #755 stack: stacked on #757, with #759 and #898 on top of it. Not a duplicate. Its own commits add
pso_journal.rsand the journal call ingo_background.Overlap with main:
gfx_records.rs(773f028,used-graphics-pipelines.bin) already records each graphics pipeline's desc, input layout and shader keys at first use, for the preparation before the next launch. That is a second on-disk pipeline record in another format. This journal also covers compute and not-yet-used queued pipelines, and keeps the shader bytes. The PR should say why both are needed. #898 changes this journal'sUmark from "built" to "first bound", which is what main'sgfx_recordsdoes.No problems found in the diff.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Pull request closed