D3D12.X: persist both PSOs for translated mesh and geometry #1942
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!1942
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1942"
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?
@ZekkJJ on GitHub · 2026-11-24 23:44 UTC · original
ZekkJJ:upstream/two-pass-driver-cache→main· +935 −256 · 6 files · 3 commits · merged 2026-11-26 14:57 UTCPersist the passthrough mesh graphics driver blob for translated console MS and VS+GS pipelines. Current main already persists their compute blobs. Part of #1269.
What is in it
Tested
f9c9df37703babb4f6bb9b51841e18c813751c2con RTX 4060 Laptop (616.56), Ryzen 7 8845HS, Windows 11 build 26200.9974, Rust 1.98.1 MSVC and DXC 1.8.2502.11.cargo test --offline --locked -p xcl --lib mesh_stream_tests -- --nocapture --test-threads=1passed 4 with no skips. The two new mocks coverE_UNEXPECTEDand an empty successful export.cargo test --offline --locked -p xcl --test gpu_two_pass_cache_e2e -- --nocapture --test-threads=1passed 1 with no skips, including five fresh-process hits, corrupt-blob recovery for each pass, and both pixel readbacks.cargo test --offline --locked --workspace --no-fail-fast -- --test-threads=4 --show-outputpassed 1,438 with 0 failures and 47 ignores. There were 26 explicit skip markers (21 no native wave64, 3 refused wave32 per-lane operations, 1 no heap windows, and 1 Windows Developer Mode unavailable).7ca01644passed the local Radeon 780M cache fixture and paired retail smoke. Lum7nt reported the older RTX 3060 driver's export refusal at that head. The five baseline failures on that setup are recorded in the report.Regression run
Clean release builds on the same RTX 4060 Laptop GPU and retail workload. XCL used a separate title state and DXIL cache for each run.
Main
PR head
Not tested
AI use
OpenAI Codex (
gpt-6.2-sol) rebased, implemented the fallback coverage, tested the patch, and prepared the report. The original implementation also used Google Antigravity. Its exact model was unrecorded.github-bot referenced this pull request2026-11-26 05:31:15 +00:00
@thehollowedone on GitHub · 2026-11-25 00:14 UTC · original
Independent check of
024b2e2on an RTX 3080 Ti (621.35), Windows 11 build 26300, Rust 1.99.1 MSVC and DXC 1.8.2502.11. The offline locked release workspace build passed.cargo test --offline --locked --release -p xcl --test gpu_two_pass_cache_e2e -- --nocapture --test-threads=1passed 1/1 with zero skips. A separate cache-disabled run confirmed the RTX 3080 Ti and D3D12 debug-layer activation.The fixture verified five disk hits in a fresh process, recovery when either pass’s blobs were rejected, and the expected pixel readbacks for both translated mesh and geometry. This covers the published stack with synthetic input. Integration with current main, the title’s ExecuteIndirect path, and retail performance remain untested here.
AI-assisted. Codex (GPT-6 family, exact variant unavailable) ran the tests and drafted this report.
@raylitebull on GitHub · 2026-11-25 00:55 UTC · original
Code review on
024b2e2:build_two_pass_pso,finish_two_pass,two_pass_driver_id, andcrates/xcl/tests/gpu_two_pass_cache_e2e.rslook solid:mesh_psois held by RAII if the compute pass fails, rejected RAM blobs also evict their disk counterparts before the cold-compile retry, and the E2E suite exercises both translated MS and VS+GS paths with corrupt-blob recovery and pixel readbacks.What is needed before merge:
main(nowCONFLICTING):mainhas since merged#1836(80f4819, addingread_pso_cached_blob/driver_cachecompute-pass caching infinish_two_pass),#1937(2c95f01), and#1774(de36462,big_compile_headroominfinish_two_pass). Please reconcilefinish_two_passwith those changes and drop the already-merged#1937hunks.gpu_two_pass_cache_e2e+ retail smoke), as current verification is NVIDIA-only (RTX 4060 Laptop and RTX 3080 Ti).@JJAutoCompare on GitHub · 2026-11-25 01:49 UTC · original
PR #1942 GPU verification
D3D12.X: persist both PSOs for translated mesh and geometry
refs/pull/1942/headfromoriginwas024b2e2dc51924965df478fdb4f63fbcae9dc0b2. The assigned slot had no Git checkout, so the tests ran in a clean detached checkout underL:\XclTooling\sol-slot-8\source.origin/mainwas3da2abb81606df622610e009f0430de99aa9881c.git merge-tree --write-tree origin/main HEADexited 1 with a content conflict incrates/xcl/src/hle/d3d12x/real.rs.Tested
DoublePrecisionFloatShaderOps=0, and reported wave range 8–32. The suite logged the Arc A770 real D3D12 backend.1.100.0 (0ef1bc386 2026-11-09), DXC/DXIL1.9.2609.5. Unoptimized dev/test profiles with debug info and incremental compilation disabled.cargo build --workspaceandcargo test --workspace --no-runboth exited 0 outside the GPU lock.cargo test -p xcl --lib two_pass_identity::tests -- --show-outputreported 4 passed, 0 failed, 0 ignored.cargo test -p xcl --lib two_pass_blob_tests -- --show-outputreported 2 passed, 0 failed, 0 ignored. Neither run emitted skip markers.Invoke-ArcTest.ps1,cargo test -p xcl --test gpu_two_pass_cache_e2e -- --show-outputreported 1 passed, 0 failed, 0 ignored, and no skip markers. It exercised cache disablement, cold writes, warm reuse, corrupt blob recovery, and draw readback for translated mesh and geometry. It also passed in the full suite.cargo test --workspace --no-fail-fast -- --test-threads=4 --show-outputexited 101. Totals across 20 test binaries and one doctest target were 958 reported passed, 25 failed, 45 ignored. There were 25SKIPPEDmarkers across 15 binary/test pairs. The markers include skipped subcases and represent gaps in coverage.d3d12SDKLayers.dll, unavailable D3D12 debug layer, and inability to disable the driver cache. The complete marker list is inpr1942-suite-skips.txt. Full output is inpr1942-suite.log.Failures
Twenty library tests failed at
CreateComputePipelineStatewith0x80070057(invalid parameter).gpu::dxil::fuzz_tests:fuzz_validate_and_gpu_0(seed 2),fuzz_validate_and_gpu_1(506),fuzz_validate_and_gpu_2(1003),fuzz_validate_and_gpu_3(1501).gpu::dxil::ops_tests:doubles_match_cpu,groupshared_barrier_and_atomics_run.gpu::dxil::round_tests:gpu_direct_f32_round_modes_dynamic_and_denormals,gpu_direct_f32_round_modes_static.gpu::recomp::lower_dxil::tests:f64_programs_on_the_gpu.gpu::recomp::tests:gpu_clamp_and_omod_per_instruction,gpu_f64_class_compare,gpu_f64_compares_with_nan,gpu_f64_literal_high_word,gpu_f64_math_random,gpu_f64_roots,gpu_f64_rounding_and_conversions,gpu_float_compares_random,gpu_frexp_f64_exp_and_mant,gpu_ldexp_f64,gpu_rndne_f64.Four other library tests under
gpu::recomp::testsfailed assertions.gpu_nonfused_mad_and_mac_prevent_fma_contraction, the fused overflow control returned infinity.gpu_ps_image_sample_offset_implicit_lod_between_mips, pixel (0, 0) was 25.609375, expected 26.gpu_valu_16_and_64_bit, the lane 0v_add_f16high-half preservation assertion failed.gpu_wave64_ps_whole_wave_reductions, pixel 0 returned[2, 217, 2], expected[2, 216, 2].The
e2e.rstesttest_title_runs_and_game_folder_is_untouchedfailed the dynamic depth bias check forRSSetDepthBiasX(-1000.5). The top-right pixel was blue, expected green.Not tested
origin/mainfor comparison. The baseline behavior of the failing tests remains unverified.scripts/smoke.ps1runs onmainor the PR head. No AMD or NVIDIA adapter coverage.AI use
gpt-6.2-sol) ran the build and tests and drafted this report. Coordinator #2 (T3 Code / Antigravity,gemini-4-neon) verified the counts againstpr1942-suite.logand published this report.All 25 GPU SKIPPED entries
@DavidM1911 on GitHub · 2026-11-25 02:50 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.024b2e2dc5tobdef448039@gefydev on GitHub · 2026-11-25 01:37 UTC · original · reviewed
Review of
024b2e2(read againstmainbf9eebd; I did not build or run it).This now overlaps #1836, which was merged. #1836 merged on 2026-11-25 00:04 UTC, after this PR was opened. That is why
real.rsconflicts. Onmain,finish_two_passalready caches the compute pass blob in memory and on disk (compute_blob_key(&tp.cs, rs, 0),driver_cache::path(&tp.cs, 0)). #1836 also addedGRAPHICS_BLOBS(256 MiB),graphics_path,graphics_blob_key(field-by-field state hashing, which avoids the padding problem) andread_pso_cached_blob. After a rebase, the compute half of this PR would be a second cache under a different key for the same blob. What is new is the mesh pass cache, which should go throughGRAPHICS_BLOBSandgraphics_blob_keyrather than a separate hasher (two_pass_identity.rsin #1941), a secondpso_cached_blob, andCOMPUTE_BLOBS. #902 also keeps slow graphics pipeline blobs on disk.No measured gain at this head. The fresh-process ranges overlap: 2.10–2.45 s with persistence off and 2.21–2.28 s with it on. The 34× figure is historical and includes warm DXIL and NVIDIA driver caches. A run on AMD, or on NVIDIA with the driver's shader cache cleared, would show whether this cache helps.
Code points:
COMPUTE_BLOBSbudget with ordinary compute blobs, and that cache has no eviction. Withkeep_ram = bytes >= COMPUTE_BLOB_MIN_DXIL || took >= min, nearly every MS+PS pair qualifies, so mesh blobs can crowd out the compute blobs the cache was made for.recordin the compile log.driver_compile_identifiedgets the two-pass identity hash asrecord. That field is documented as the console record's hash that matches[SHADER]lines, so the logged "record" will not match anything.XCL_PSO_DISK_CACHE_MIN_MScovers only the two-pass path. Ordinary computekeep()still usesKEEP. The variable is not documented in the README.compute_blob_testschanges the exactbefore - 3assertion to thetotal == suminvariant. This makes sense with the new concurrent test, but please say why in the description, or keep the exact check by giving that test its own key.fssm,xbch,dxil_part,mesh_psv) that already exist inshaders_e2e.rs,gpu/xbox.rsandgpu/recomp/mod.rs. Itstp-cs-*file and counter expectations change once the compute half is rebased onto #1836.What is good:
build_two_pass_psotakes at most one cold slot per pair and none for blob attempts. Eviction withArc::ptr_eqhandles another thread's replacement correctly. Owning the partialID3D12PipelineStateon failure is cleaner than the manualReleaseit replaces. The cross-process replay and corrupt-blob e2e is a strong test.Suggested path: rebase onto
main, drop the compute pass half (or explain why two keys for one blob are wanted), cache the mesh pass throughGRAPHICS_BLOBSandgraphics_blob_key, and add a measurement where the driver's own cache is cold.Review written with Claude Code (Claude Opus 5.5); I checked each point against the code.
@ZekkJJ on GitHub · 2026-11-26 08:41 UTC · original
@gefydev @raylitebull The rebase is at
7ca01644on current mainb49be183. The topology, normalized identity, and compute blob cache already on main are reused. Mesh blobs use the 256 MiB graphics store and the existing graphics disk path. The shared retention policy handles a slow mesh compile even if there is no room in the graphics RAM store. The two-pass admission takes one cold turn at most, reports its wait, and skips admission for warm hits. The identity hash no longer appears as a console shader record.The original 250 ms retention policy remains in production. The small synthetic fixture seeds its entries through a test-only hook. The exact compute-blob accounting assertion remains intact. The parser, shader CLI, and GPU fixtures share the container builders, and the mesh fixture and recompiler test share the mesh PSV builder.
At this exact head on RTX 4060 Laptop (616.56),
cargo test --offline --locked -p xcl --test gpu_two_pass_cache_e2e --test shaders_e2e -- --nocapture --test-threads=1passed 9/9 with zero runtime skips. The cache fixture asserted five fresh-process hits, recovery for either rejected pass, and the expected MS and VS+GS pixel readbacks. The complete debug workspace suite reported 1,436 passed, 0 failed, 47 ignored, and 26 explicit skip markers.Independent AMD fixture and paired retail smoke remain pending. The local driver-cache-disable probe skipped because Windows Developer Mode is off, so there is no driver-cold speedup claim. Current work used OpenAI Codex (
gpt-6.2-sol). The original Google Antigravity model was unrecorded.@Lum7nt on GitHub · 2026-11-26 09:03 UTC · original
Tested on \
7ca0164422\ (\7ca01644, clean PR head on \origin/main\ \49be183):ustc 1.100.0\ (\x86_64-pc-windows-msvc), DXC \1.8.2502.11\ (Windows SDK \10.0.26100.0), debug profile, \XCL_ADAPTER=nvidia, Windows Developer Mode off.
o wave64, 3 per-lane #1426\ refusals (\V_MUL_F16, \V_PK_MUL_F16, \V_CVT_F16_F32), 2 no D3D12 debug layer (
o d3d12SDKLayers.dll), 1 \cannot disable the driver cache (0x887A002D), 1
o heap windows.
Not tested
AI use
7ca01644, ran the focused and workspace suites on this machine, and drafted this report.@ZekkJJ on GitHub · 2026-11-26 09:22 UTC · original
@Lum7nt I fast-forwarded the branch to
f9c9df37. A failed or empty blob export is a cache miss. Both successfully created PSOs stay usable. The fixture separately queries export support on the live mesh and compute PSOs, checks the cache writes the driver can support, and verifies the MS and VS+GS pixel readbacks. On a driver that cannot export all fixture PSOs, it reports only the disk replay portion as skipped.On this head, all four focused mesh-stream unit tests passed, including mocks for
E_UNEXPECTEDand an empty blob. The RTX 4060 Laptop fixture passed with zero skips and retained the full fresh-process replay and corruption coverage. The five baseline failures you identified are outside this patch.The full debug workspace suite on RTX 4060 Laptop reported 1438 passed, 0 failed, and 47 ignored. Clean exact-head retail smoke is in progress.
@Prime1997 on GitHub · 2026-11-26 11:49 UTC · original · reviewed
Read-through and GPU run of
f9c9df37. An AI tool (Claude Code) helped with the reading and ran the tests; each point below was checked against the code at this head.Test results (RTX 3060 Ti 8 GB, NVIDIA 617.14 / 32.0.16.1714, i5-10400, Windows 11 26200.9974, rustc 1.100.0, DXC 1.9.2609.5, debug, isolated cache and data roots):
gpu_two_pass_cache_e2e: 1 passed, 0 failed. The full disk replay half ran here, because this driver does export cached blobs. That complements the earlier RTX 3060 report on 581.42 where the driver did not.shaders_e2e: 8 passed, 0 failed.Points for the author
keep_compute_blobchecks for the key and then inserts in a separate step (the same check-then-insert shape is already on main; this PR only adds a condition to it). Two threads building the same pipeline can both pass the check, and the byte total is then counted twice for one stored blob. The cap gets hit early rather than anything breaking, but taking the entry once (or subtracting the replaced size) would keep the total honest.pub fn force_driver_cache_fixture_retention()is a process-wide switch in non-test code. It is#[doc(hidden)], and#[cfg(test)]is not available because the caller is an integration test, but a cargo feature that only the e2e enables, or an environment check, would stop anything else from flipping it.gfx-<hash>-<bytes>.pso, while the nvidia-dev line (which already carries the earlier head024b2e2dthroughe6657c0c) writestp-ms-/tp-cs-. After this lands, people coming from that line will have two sets of files for the same pipelines. Worth a sentence in the description, or a one-time cleanup.None of these block the change as far as I can tell. Point 1 predates this PR and could be a follow-up.
Generated by Claude Code
@gsucristo on GitHub · 2026-11-26 14:25 UTC · original · reviewed
Code review of
f9c9df37(read-only; not built or run on GPU here).What looks solid
GRAPHICS_BLOBS):remember_graphics_blobcheckscontains_keyandGRAPHICS_BLOBS_MAX.saturating_sub(*total)under the lock, andforget_graphics_blobgates eviction onArc::ptr_eq, preventing both double-counted totals and evicting another thread's replacement.finish_two_passbypasses cold admission on warm hits, takes at most one cold slot across both passes (including retries), keepsmesh_psounder RAII so compute-pass failures don't leak it, and persists slow mesh blobs to disk even if the 256 MiB RAM cache is full.size == 0 || data.is_null()uniformly for both adopted and raw PSOs inread_pso_cached_blobcleanly covers drivers and translation layers (such asvkd3d-proton/Wine or older drivers) that refuseGetCachedBlobor return an empty blob. The mock unit tests and sharedshader_container.rs/gpu_two_pass_cache_e2efixture are clean and thorough.Minor non-blocking points
two_pass_driver_iddisables both disk and RAM caching ifCheckInterfaceSupportfails (real.rs:6025-6058): ifadapter.CheckInterfaceSupport(&IDXGIDevice::IID)returnsDXGI_ERROR_UNSUPPORTED(possible on some virtual adapters or Wine/DXGI layers),two_pass_driver_idcachesNone, which setsgkey = Noneand silently disables both on-disk persistence and in-processGRAPHICS_BLOBSreuse (and would also trip theseedstore-count assertion ingpu_two_pass_cache_e2eifGetCachedBlobotherwise succeeds). Falling back toversion = 0(while still hashingVendorId/DeviceId/SubSysId/Revision) keeps both paths working, with D3D12's own blob validation + retry path as the safety net.real.rs:6101-6105): whengfrom_diskistrue,gfrom_disk || driver_cache::load(p).as_deref() == Some(blob.as_ref())short-circuits totrue. If two threads load the same corrupt disk blob and one finishes its cold retry and writes a valid replacement before the other fails, the second thread will unlink the fresh file. Checkingdriver_cache::load(p).as_deref() == Some(blob.as_ref())unconditionally (as already done for the RAM-hit branch) avoids that race.real.rs:6177-6179): unlike the mesh pass (remember_graphics_blobongreused && gfrom_disk), a compute-pass disk hit doesn't populateCOMPUTE_BLOBS, so subsequent pipelines sharing the sametp.csin the same process re-read from disk. Not introduced by this PR, just noting for a possible follow-up.Overall this looks clean and ready to land once the remaining hardware verification is in.
@ZekkJJ on GitHub · 2026-11-26 14:30 UTC · original
@gsucristo Thanks for the detailed review. The corrupt-blob eviction race is worth addressing, particularly coordinating eviction with concurrent publication. The compute RAM accounting issue is covered by #2740, which also overlaps #2574.
github-bot referenced this pull request2026-11-26 15:01:34 +00:00