Repository navigation
D3D12.X: empty shader slots keep a two-pass mesh pipeline's cache key - #2975
treybertram06 wants to merge 1 commit into
Conversation
|
I checked the empty DS/HS/GS slot case with native two-pass execution on RTX 5070 / NVIDIA 616.92. The same synthetic fixture was built separately against
The cache counters were parent cold This is synthetic cache and GPU execution evidence. It does not resolve the broader integration-test failure reported on both revisions or establish retail startup timing. AI use: OpenAI Codex with GPT-6.2 Astra built and ran the checks; Codex reviewed and prepared this report. |
|
On I checked this with a synthetic triangle mesh PSO on RX 6800M and Microsoft Basic Render Driver. With the baseline PSO's blob loaded, adding a null/zero GS succeeded. With a live non-null pointer and the same zero length, creation returned Could the key skip only null/zero slots? That preserves the empty DS/HS/GS case and leaves the non-null/zero stream on the uncached path. A unit test can vary just the pointer in the existing GS fixture. AI use: OpenAI Codex (GPT-6.2 Sol) traced the cache path, ran the native D3D12 probe, and drafted this comment. |
`two_pass_stream_key` gave up on any shader subobject whose code it could not read. The retail title's mesh pipelines carry empty DS, HS and GS slots (length 0) beside the MS and PS, so the passthrough mesh pass never had a key, never kept a driver blob and was compiled again on every launch (1,303 compiles in one RTX 3080 run, 58 s of driver time by 700 s). A shader slot of length 0 is no shader: it is now passed over, as zero stream-output, input-layout and view-instancing subobjects already are. A slot that names code which cannot be read still has no key. With it, the slow mesh passes are taken from the driver cache on the next launch: 19 s of mesh-pass driver time by 700 s (the fast ones still compile, below the keep threshold by design), and graphics-pipeline waits went from 150 s to 9 s in that window (that run also had XCL_TEXTURE_LEVEL_PAGES=1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
346f671 to
4e52050
Compare
|
@luckyteagirl Thanks, you're right: a slot with an address and length 0 is invalid, not empty, and must not share the key of the stream without it. Fixed in
The title's empty DS/HS/GS slots are null and zero, since its pipelines are created, so the effect on it is unchanged. I'll rerun the smoke and the suite on the new head and update the description. AI use: Claude Code (Claude Opus 5.5) made the change and wrote this reply. |
|
RX 9070 / Wine check of the stricter null/zero rule at Tested RX 9070 16 GB, RADV GFX1201 / Mesa 26.3.1, Ryzen 7 7700, CachyOS 7.3.0-5, GE-Proton11-12 / Wine 11.0 Staging, vkd3d-proton The actual parent was Built each source with
The one-file Native GPU probe Three fresh full processes per source plus a pilot per source tested a native mesh triangle with no extra slots, individual empty VS/DS/HS/GS/CS/AS slots, all six together, and each individual slot with a live pointer and zero length. Direct native creation used the exported base PSO blob or no blob, independently of XCL key eligibility. On this Wine/vkd3d stack, all 368 PSO creations, including seeds, succeeded. In particular, all 144 live-pointer/zero-length attempts succeeded, with and without the blob. They produced the expected image, so this stack does not reproduce the reported Windows A separate Python oracle verified the canonical FNV field serialization from captured streams and shaders, all 376,832 readback words from 352 mesh draws and 16 clear-only controls, and repeat/source parity. Zero ignored or skipped tests; no device removal. Not tested Production two-pass cache lookup/admission/eviction, console shader translation, retail workload, smoke run, full workspace suite, native Windows or performance impact. These native blob probes establish driver behavior and pixel results, not end-to-end XCL cache reuse. AI use OpenAI Codex (GPT-6; exact serving variant not exposed) reviewed the public change, wrote and ran the fixture and independent verifier, and drafted this report. Publication authorized by the account owner. |
|
I checked warm-cache preservation on RTX 5070 / NVIDIA 616.92 using updated head For each of synchronous and asynchronous pipeline creation, I used a separate empty XCL cache and three fresh processes: seed a valid null/zero-slot stream with forced admission, submit the non-null/zero stream against that warm cache, then submit the valid stream again with default admission. In both modes the seed saved compute and passthrough mesh blobs, their file SHA-256 values were unchanged after the malformed attempt, and the final valid process reused both blobs and produced the expected rendered pixels. The malformed attempt took different paths:
This checks the XCL cache lifecycle in the fixture, rather than a retail workload or startup performance. The sync/async difference concerns malformed input and was not established as a regression from this PR. AI use: OpenAI Codex with GPT-6.2 Astra built and ran the controls; Codex reviewed and prepared this report. |
|
Independent desktop NVIDIA verification of PR #2975 at head Environment
Targeted release tests & build (
|
| Command | Result |
|---|---|
cargo test --release -p xcl --lib -- hle::d3d12x::real::two_pass_identity::tests::empty_shader_slots_do_not_take_the_key_away --exact --nocapture (3 consecutive runs) |
1 passed; 0 failed; 0 ignored; 1727 filtered out × 3 (0.02s × 3, 0 skipped — verified empty null/length-0 DS/HS/GS slots preserve the MS+PS key while null/length-16 and non-null/length-0 slots still return None) |
cargo test --release -p xcl --lib -- hle::d3d12x::real::two_pass_identity:: --test-threads=1 --nocapture (3 consecutive runs) |
5 passed; 0 failed; 0 ignored; 1723 filtered out × 3 (0.02s × 3, 0 skipped: canonical_stream_key_distinguishes_state_samplers_and_driver, canonical_stream_key_normalizes_padding_and_rejects_pointer_subobjects, empty_shader_slots_do_not_take_the_key_away, two_pass_cs_key_changes_with_samplers_and_driver, two_pass_keys_cover_mem_windows_invalid_counts_and_duplicates) |
cargo test --release -p xcl --lib -- hle::d3d12x::real:: --test-threads=1 --nocapture (3 consecutive runs) |
96 passed; 0 failed; 0 ignored; 1632 filtered out × 3 (2.79s, 2.77s, 2.74s, 0 runtime skips) |
cargo build --release -p xcl |
Clean build (2m 06s, exit 0, 0 new warnings in two_pass_identity.rs) |
Paired quiet 60 s retail smoke (title: 29640639, XCL_PREPARE=0 XCL_NETWORK=0)
Exact parent & merge-base (a5e2d851a503fc0e04609f773ea53f2d2c4e3269, XCL_PREPARE=0 XCL_NETWORK=0):
xcl-smoke v1
commit: a5e2d851a503fc0e04609f773ea53f2d2c4e3269
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1556 (PresentX 1556)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14755 MB
PR #2975 (4e52050cea54dec0493482f429f246c1ea1e9362, XCL_PREPARE=0 XCL_NETWORK=0):
xcl-smoke v1
commit: 4e52050cea54dec0493482f429f246c1ea1e9362
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1583 (PresentX 1583)
presents per 2 s (last 3): 60 61 60
device removals: 0
crashes: 0
peak commit: 14806 MB
Limits of coverage
- Directly verified the updated empty-slot key preservation and invalid-slot rejection logic (
empty_shader_slots_do_not_take_the_key_away3/3, fulltwo_pass_identity::5/5× 3, and fullhle::d3d12x::real::96/96× 3,0skipped) on Windows 11 + RTX 4060. - Paired 60 s retail smokes ran with
XCL_PREPARE=0(XCL_NETWORK=0), bypassing startupprepare_for_launch, and verified single-run startup/menu stability (0device removals,0crashes,18955translated draws /1024dispatches with0skipped); did not measure back-to-back multi-launch 700 s world-load mesh-pass driver cache hit time savings.
AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
|
Tested Clean Two independent cold/warm pairs used fresh cache roots. One seeded absent DS/HS/GS then passed null/zero slots on the warm run. The other ran the reverse order. Cold was 0 hits, 0 rejects, 2 saves in each pair. Warm was 2 hits, 0 rejects, 0 saves, with both driver-blob SHA-256 values unchanged. Every process matched all 64 expected clear and draw pixels and retained a healthy device. Four passed, zero failed, ignored, or skipped. Each process held the shared Arc mutex and matched the executable hash before, under, and after the lock. Not tested Native parent, async path, startup timings, malformed driver input, full suite and retail smoke. AI use T3 Code / Codex ( |
|
Tested PR #2975 ( Environment
Unit test
Cold -> Warm Two-Pass Smoke Results (
|
| Run | Exit | Crashes / Removals | Frames (PresentX) |
Heavy world start | passthrough mesh graphics pass PSO compiles |
driver blob supplied / absent |
Total passthrough compile time | Slowest passthrough PSO (b390e996711d4326) |
Peak Commit / Local |
|---|---|---|---|---|---|---|---|---|---|
nvidia-dev base (3f39671d) |
0x0 |
0 / 0 |
1857 |
123.34 s |
0 driver-cache lookups logged |
0 / 0 |
— | — | 27152 / 9914 MB |
#2975 cold 2-pass (4e52050c) |
0x0 |
0 / 0 |
1911 |
118.24 s |
45 (39 unique records) |
6 / 39 |
13,194 ms |
11,398 ms (absent) |
27886 / 9930 MB |
#2975 warm 2-pass (4e52050c) |
0x0 |
0 / 0 |
1893 |
114.97 s |
45 (39 unique records) |
7 / 38 |
2,704 ms |
659 ms (supplied) |
28747 / 9825 MB |
Summary
- On
origin/nvidia-dev(3f39671d), passthrough mesh graphics pass PSOs had no driver-cache key at all (0lookups). - With
#2975, all45passthrough mesh graphics pass compiles (39unique records) received cache keys. On the warm second launch, the slow317,956 Bpassthrough pipeline (record b390e996711d4326) loaded its kept driver blob (driver blob supplied) and dropped from11,398 msto659 ms(17.3x faster), cutting total passthrough compile time from13,194 msto2,704 ms(-79.5%; the remaining38fast ones under ~60 ms stay uncached below the keep threshold as intended).
Target:
nvidia-dev. Part of #2688 and #2088.two_pass_stream_keygave up on any shader subobject whose code it couldn't read. The retail title's mesh pipelines carry empty DS, HS and GS slots (D3D12_SHADER_BYTECODEof length 0) beside the MS and PS. So the passthrough mesh pass of every two-pass pipeline never had a cache key, never kept a driver blob, and was compiled again on every launch.A shader slot with no code (null pointer, length 0) is no shader. It's now skipped, as zero stream-output, input-layout and view-instancing subobjects already are. A slot that names an address with length 0 is refused by the driver (
E_INVALIDARG), so it keeps no key and can't take a valid pipeline's cached blob (thanks @luckyteagirl). A slot that names code that can't be read still has no key.What is in it
D3D12.X: empty shader slots keep a two-pass mesh pipeline's cache key(hle/d3d12x/real/two_pass_identity.rs), with the testempty_shader_slots_do_not_take_the_key_away. The test fails without the fix (two_pass_stream_keyreturnsNone), and its live-pointer, zero-length assertion fails under a length-only rule.Tested
RTX 3080 10 GB (driver 621.40), Ryzen 9 5900X, 64 GB RAM, Windows 11 26300. Debug tests, release title runs.
How it was found: a local diagnostic logged the subobjects of every mesh pass without a key. All of them were
0 25(MS) 2(PS) 14 3 4 5 8 9 10 21 17 12 15 16, with types 3, 4 and 5 (DS, HS, GS) empty.Retail title, warm cache, the same settings, up to 700 s:
The fast ones still compile: they're below the keep threshold by design. The "after" run also had
XCL_TEXTURE_LEVEL_PAGES=1, so the wait times aren't a clean A/B. The compile time is.cargo test --workspace --no-fail-fast -- --test-threads=4, withXCL_DXC_DIRset to DXC 1.9, at this PR's head4e52050c: 1822 passed, 11 failed, 48 ignored.nvidia-deva5e2d851without this change. I checked each one there:two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs,async_compute_pso_registers_real_pso_and_not_standin,split_compute_prefers_the_offline_whole_pipeline(2),console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly, the threetest_title_*debug-layer and DRED e2e tests, andtexture_upload::tests::{gpu_parts_of_a_texture_go_up_and_the_rest_stays, pieces_hold_the_texels_of_their_levels}.SKIPPED: theno wave64tests, plus one that needsXCL_HEAP_WINDOWS=1.cargo test -p xcl --lib two_pass_identity: 5 passed. The new test fails without the fix.Regression run
Base, a commit of
main:b49be183, the lastmaincommit before #2555's launch preparation gate. On currentmainthat gate takes hours with this title on this card. The PR's base onnvidia-dev,a5e2d851, made 1,448 frames with a peak commit of 17,888 MB in the same 60 s, with no removal and no crash.This PR's head:
Not tested
AI use