Repository navigation
D3D12.X: only a title's run reads and writes used-pipelines.txt - #1113
einfachama wants to merge 1 commit into
Conversation
|
Ran the new test binary at Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build.
Not tested: the retail-title path this PR is about (no unpacked title here), RDNA2/RDNA4 and Intel GPUs, Wine, release profile. AI-assisted (OpenCode), model: DeepSeek V4.1 Flash 1017 - checked out the PR's head commit in a detached worktree, built it, ran the test binary, wrote this report; the worktree was not modified. |
e03852f to
8aef294
Compare
|
Rebased onto Tested (head
Regression run Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Rebased onto Tested (head
Regression run AI use
|
|
Nothing has happened on this PR for 3 days, so it is marked |
The list of the pipelines a title used was kept out of tests with cfg!(test), which only the crate's own unit tests have: the integration tests in tests/ link the crate without it, so they read the user's used-pipelines.txt and add their pipelines to it. After full test runs with XCL_SAMPLE_RPF on an RTX 4060, the user's list held 10 keys (gpu_pso_e2e, run alone into an empty cache, writes 9 keys, 4 of them among those 10), and every later run of my retail title built its pipelines of those shaders ahead: 228 translated pipelines at its first menu instead of 6 (measured on Nov 24's main, before xcl-dev#3203). The list is now read and written only when a title runs (state::boot set). The new integration test fails without the change: the pipeline of a key in the list was built ahead. It turns off building ahead the pipelines no run used (XCL_PSO_AHEAD=0), which main does since xcl-dev#3203 and which would hide that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5dc8f99 to
9e4ff76
Compare
|
Still needed: on The rebase had one conflict: Tested (head
AI use
|
|
No open or merged PR makes this change: main's AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
|
The Head AI use
|
used-pipelines.txt(#690) is kept out of tests withcfg!(test), but only the crate's own unit tests have that cfg. The integration tests incrates/xcl/tests/link the crate without it, so they read the user's list (beside the DXIL cache) and add their own pipelines to it. The same code also keepsused-shaders.txt.What that did here, measured on Nov 24's
main(before #3203): after full test runs withXCL_SAMPLE_RPFset, the user's list held 10 keys.gpu_pso_e2e, run on its own into an empty cache, writes 9 keys, 4 of them among those 10; none of the 27 title runs since then changed the file. Every later run of my retail title then built its pipelines of those shaders ahead: 228 translated pipelines at its first menu instead of 6 (report.jsontranslated_pipelines). That number does not describe today'smain. Since #3203, a lazy pipeline no run has used is built ahead anyway (up toXCL_PSO_AHEAD, default 4096). So test keys in the list now decide which pipelines go first, in the ranked preload, rather than whether they are built ahead.used-shaders.txtchooses what a title's shader preparation translates before it starts. I have not measured either effect on today'smain. A PR needs both a suite run andsmoke.ps1runs on the same machine, so a tester's smoke runs can start from a list the tests wrote.The list is now read and written only when a title runs (
state::boot()is set; the host sets it at start, before the shader preparation and any pipeline).What is in it
crates/xcl/src/hle/d3d12x/pso_async.rs:used::get()returns the empty, file-less list unless a title runs (cfg!(test) || state::boot().is_none()).crates/xcl/tests/used_pipelines.rs(new): withXCL_DXIL_CACHEset to a temporary folder holding a list, a test binary neither builds the pipeline of a listed key ahead nor adds a used pipeline to the list. Since Merge nvidia-dev into main (makes #2572 mergeable) #3203 (69a48a24),mainbuilds every lazy pipeline that no run has used ahead of its first use, which would hide what the test checks. So the test setsXCL_PSO_AHEAD=0before its first pipeline, and only a build ahead from the list remains. It fails without the change (a test binary built a pipeline ahead from the user's list). No GPU needed.Tested
24c02ab/4cee988below: 1.100.0); DXC 1.9.2602.17; debug for the tests, release for the smoke runs.cargo test --workspace -- --test-threads=4at9e4ff760(onmainff0c364): 2890 passed, 0 failed, 51 ignored (44 test binaries). SKIPPED (20 tests, 28 lines):lower/lower_dxilwave64 cases (7lower_dxiltests also print the per-lane cases they skip),dispatch_chain_native_wave64_builds_whole,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,two_pass_binds_set_the_shared_view_heap;pso_measurement_compiles_an_exact_synthetic_record(no Developer Mode);cargo test -p xcl --test used_pipelines: passes at9e4ff760, and fails onmainff0c364with only the test added.0xc0000005, onmaintoo. With this branch's source it died in 3 of 15 runs: in 1 of 4 full suite runs (24c02ab, the rebase before the test change, same runtime code; the others, at24c02ab,4cee988and9e4ff760, passed it with 2741 / 0 / 31) and in 2 of 11 runs ofcargo test -p xcl --lib -- --test-threads=4alone at9e4ff760.mainff0c364's binary passed 14 such runs alone. Each time,eh::tests::thread_dumps_while_threads_run_and_exitandgpu::bvh::tests::scene_trace_matches_brute_forcewere running. With only those two andgpu::agility::tests::create_device_sets_dred_first,main's binary died in 1 of 25 runs and this branch's in 0 of 25. The change does not reach the lib tests: therecfg!(test)is true.scripts/smoke.ps1 -Seconds 60(release; the same cache snapshot restored before each run):main1 509 frames, this change 1 492 (99 %); peak commit 16 983 / 19 950 MB. I made two pairs, one in each order. In both, the second run waited about 17 s for driver compiles before its first frame, whichever side it was (mainfirst: 1 509, then this change 1 019; this change first: 1 492, thenmain1 028). The blocks below are the first run of each pair. This change's block ends at 38 / 43 / 31 presents per 2 s and has a 3 GB higher peak: that run got further into the title in its 60 s (report.jsonaudio.xapu_frames1 394 256 against 766 416 inmain's block). Both logs show the list being read the same way ("the pipelines of 1127 shader sets an earlier run used are built ahead of their first use"), with 859 and 860 translated pipelines. A title run still reads and writes the list, so these runs show that title runs are unchanged, not the effect on tests.uma.rs, a WARN in the log), with far fewer frames (First run of a title: the coherent window is 512 MB until uma_coherent.txt has been learned (menus at ~12 fps, then 30) #284).Regression run
mainff0c364:This PR's head
9e4ff760:Not tested
main(see above): no numbers.e2e.rsruns the test title as a real title run (boot set), so it can still write the list.mainhas two newer per-run lists with the samecfg!(test)-only guard, which this PR does not change:used-graphics-pipelines.bin(gfx_records::note) andused-indirect-split.txt(real/dispatch_chain.rs).AI use
ff0c364, adapted the test to Merge nvidia-dev into main (makes #2572 mergeable) #3203, reran the suite and made the smoke runs. Claude Fable 5.2 (in the Claude app) planned that check and checked the numbers against the logs. I reviewed it before posting.