Skip to content

[upstream #1113] D3D12.X: only a title's run reads and writes used-pipelines.txt - #46

Closed
ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1113
Closed

ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/1113

Conversation

@ufoptg

@ufoptg ufoptg commented Nov 24, 2026

Copy link
Copy Markdown
Owner

used-pipelines.txt (xcl-dev#690) is kept out of tests with cfg!(test), but only the crate's own unit tests have that cfg. The integration tests in crates/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.

What that did here: after full test runs with XCL_SAMPLE_RPF set, 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.json translated_pipelines). A PR needs both a suite run and smoke.ps1 runs 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 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): with XCL_DXIL_CACHE set 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. It fails without the change (a test binary built a pipeline ahead from the user's list). No GPU needed.

Tested

  • NVIDIA GeForce RTX 4060 8 GB (Ada, 32-lane waves), driver 621.24; Ryzen 7 5800X; 32 GB RAM; Windows 11 Pro 26300; Rust 1.100.0 MSVC; DXC 1.9.2602.17; debug for the tests, release for the smoke runs.
  • cargo test --workspace -- --test-threads=4 at e03852f (on main 47efa2e): 742 passed, 0 failed, 41 ignored; main 47efa2e: 741 / 0 / 41. Both passed on the first run. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware. On earlier bases, some runs of this change and of main (d208e14, beaa245) alike had 3 failures: placed_title_textures_share_vram_and_preserve_pixels and the two tests on its poisoned lock, which is Tests: placed_title_textures_share_vram_and_preserve_pixels fails now and then at its cubemap reuse check (main 9ce2070) xcl-dev/xcl#718 (fixed by Tests: check cubemap tile reuse independently of idle page reclamation xcl-dev/xcl#447).
  • cargo test -p xcl --test used_pipelines: passes at e03852f, fails on main 47efa2e with only the test added. Neither of today's runs, nor either full suite, changed the user's list.
  • My retail title at its first menu, scripts/smoke.ps1 -Seconds 60, unattended: the blocks below (main 1 627 frames, this change 1 621). main's first run on 47efa2e, the first title run in hours, opened its UMA 5.5 s later than usual and showed 1 430 frames; its rerun with the same binary is the block below. A title run still reads and writes the list (both runs built 228 pipelines at the menu from it), so these runs show that title runs are unchanged, not the effect on tests.
  • One thing to know when comparing smoke runs: with under 17 GB of system commit free at start, XCL gives the title a 512 MB coherent window instead of the learned one (uma.rs, a WARN in the log). Here that gave ~700–1 130 frames instead of ~1 610, on main and on this branch alike ([upstream #1856] Shaders: validate and pair per-lane sweep results #284). Both blocks below had the learned window.

Regression run

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 4060
title: title
seconds: 60
exit: 0x0
frames shown: 1627 (PresentX 1627)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14578 MB
xcl-smoke v1
commit: e03852ffb27e560f458353e6e78fc3533869f5dc
gpu: NVIDIA GeForce RTX 4060
title: title
seconds: 60
exit: 0x0
frames shown: 1621 (PresentX 1621)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14579 MB

Not tested

  • Whether building those ~220 pipelines ahead costs frames at the menu: the runs I have are confounded by the coherent-window fallback above, so I make no claim about it.
  • e2e.rs runs the test title as a real title run (boot set), so it can still write the list; with XCL_DXIL_CACHE pointed at an empty folder it wrote no key here.
  • AMD / Intel GPUs (the change has no GPU path).

AI use

  • Claude Code with Claude Opus 5.5 found this while comparing smoke runs, wrote the change, the test and this description, and ran the tests and smoke runs in an unattended session; I reviewed it before posting.

Mirror of xcl-dev#1113 (auto-synced, do not edit).

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.

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.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ufoptg

ufoptg commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Upstream PR xcl-dev#1113 was closed or merged.

@ufoptg ufoptg closed this Nov 25, 2026
@ufoptg
ufoptg deleted the upstream-pr/1113 branch November 25, 2026 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants