Shaders: share compiled DXIL across pipeline builds #2085
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!2085
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2085"
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?
@rison1337 on GitHub · 2026-11-25 03:33 UTC · original
rison1337:perf/share-compiled-dxil→main· +34 −19 · 3 files · 1 commits · openThe translated shader cache already owns an
Arc<Compiled>, but the public console-to-DXIL functions clone its DXIL and samplers for each request. Return the shared owner and keep it alive while the driver consumes the bytecode.What is in it
Arc<Compiled>from the translation entry points; borrow bytecode at compute/graphics pipeline creation, preserving sampler and two-pass pixel-shader ownership.console_shaders.rsto borrow the shared bytecode.Tested
x86_64-pc-windows-gnullvmcross-build; debug tests and release runtime under Proton Experimental, DXC 1.9.2609.5, local vkd3d-proton compatibility build.529d13f557a1, built withcargo test --locked --target x86_64-pc-windows-gnullvm -p xcl --lib --no-run, executed through the local Proton runner with--test-threads=4: 1097 passed, 2 failed, 26 ignored; 24 explicit SKIPPED messages.568e7db7729c, same environment: 1096 passed, 2 failed, 26 ignored; 24 explicit SKIPPED messages. Both failgpu_depth_buffer_created_for_unordered_access_is_placedandxma2_source_voice_decodes_and_manages_lifetime. Skips include hardware wave64 and Windows Developer Mode. No complete green suite is claimed.e56e7f57b430passed: 435 inside / 3501 outside pixels. This historical GPU result is not a rerun on the current head.e56e7f57b430revision: Windows DXC sharing test, 1 passed, Windows paired title regression. These are contributor-reported results, not tests run by this author or validation of the current head.Regression run
Generated by the unchanged
scripts/smoke.ps1using PowerShell 7.7.0 on Linux and a shell wrapper executing the EXE through Proton.Z:is mapped for Windows log paths. Same title, profile copy, 90 seconds,XCL_PSO_PRELOAD=0, no automatic input; a background Xwayland surface. Coverage is startup/start screen/menu.Both exited without recorded crashes or device removals. The existing queue-drain warning may appear at shutdown. Wine reports 0 MB for process commit, so these counters do not establish the memory-growth comparison.
Not tested
AI use
Codex (gpt-6.1-sol, as recorded for the initial implementation) prepared the initial code and tests. Codex (GPT-6 family; exact variant unavailable in this session) fixed the four integration-test borrows, rebased, cross-built, ran the Linux/Proton checks and updated this description. No game data or console SDK headers are included.
@JJAutoCompare on GitHub · 2026-11-25 03:42 UTC · original
PR #2085 native Windows compatibility check
Tested
e56e7f57b430e9e30a173f59d2cfbd1f1941f647before and after the run. The assigned checkout was clean and detached at that SHA both times. The PR description reports Wine testing, and the live discussion contained no independent native Windows report for this head.26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 driver32.0.101.9175installed. Rust1.100.0(0ef1bc386,x86_64-pc-windows-msvc), Cargo1.100.0(3acc79c0c), MSVC19.44.35230.0, linker14.44.35230.0. The test log confirms DXC and DXIL1.9.2609.5loaded from the assignedXCL_DXC_DIR.0. The harness selected one test, filtered out 1,124, and finished in 0.06 s. There were noSKIPPEDmarkers. The fixture uses CPU/DXC and has no optional GPU path.console_to_dxil. Both requests succeeded and the assertions verified identical DXIL bytes, identical static sampler lists, and the same DXIL buffer pointer while both results were live. The fresh shader cache produced a 2,308-byte DXIL container and a translated cache record with a byte-for-byte matching payload and zero static samplers.The run used the unoptimized test profile with
CARGO_PROFILE_DEV_DEBUG=0,CARGO_PROFILE_TEST_DEBUG=0,CARGO_BUILD_JOBS=2, andCARGO_INCREMENTAL=0. It reusedL:/XclTooling/pr1844-71f2ceb-t3-737e5ee5/target.TEMP,TMP, and an initially emptyXCL_DXIL_CACHEwere scoped to this run directory underL:/XclTooling/pr2085. The command, stdout, stderr, exit status, environment, and final verification logs are alongside this report. The assigned checkout and target slot are released.Not tested
AI use
gpt-6.2-sol) ran the checked-in test, inspected the assertions and artifacts, and wrote this report.@Anon64 on GitHub · 2026-11-25 04:22 UTC · original
Regression run for this PR: head
e56e7f5, based onmaincbc296a. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release,XCL_NETWORK=0, A pressed every 4 s from 20 s,scripts/smoke.ps1on a retail title for 60 s, back to back with themainrun.main
cbc296a:this PR:
No device removals or crashes; 101 % of main's frames, 100 % of its peak commit.
Not tested: the whole suite; world loading; whether these 60 s build pipelines that share DXIL.
Written with Claude Code (Claude Opus 5.5) from runs on this machine.
@DavidM1911 on GitHub · 2026-11-25 05:26 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@JoaoPauluu on GitHub · 2026-11-25 05:47 UTC · original
A regression run under Wine on Linux on the retail title: no device removal, no crash, frames level with
main(1359 here; 1360 and 1374 on the twomainruns). Nothing in the log points to the shared DXIL, so I cannot tell whether this run reached it; this is a regression run only. The new testrepeated_console_shader_requests_share_dxilpasses under Wine.Tested
x86_64-pc-windows-gnu.e56e7f5as it is (based oncbc296a) andmain6020a33, no uncommitted changes. Retail title 1.0.2.1,scripts/linux/smoke.sh(#257) for 60 s, no input. Runs in order: main, this PR (with other PRs in between), main. The new lib tests ran under Wine, one test per process.Regression run
main (first run):
this PR:
The second
mainrun: 1374 frames,exit: 0x0, no device removal, no crash. Under Wine,peak commitreads 0 MB, so these blocks do not check memory.Not tested
AI use
@raylitebull on GitHub · 2026-11-25 10:47 UTC · original
Code review on
529d13f:Result<Arc<Compiled>, String>fromconsole_to_dxil*avoids cloning multi-megabyte DXIL byte vectors across graphics/compute pipeline builds (repeated_console_shader_requests_share_dxilconfirms shared pointer storage).PR description(two-passreal.rscallers still clone only on fallback) and CI workflow approved (running).Remaining before merge: Fix
PR description,Build and testgreen, and dual-vendor verification on529d13f.@tiagonleal on GitHub · 2026-11-25 12:31 UTC · original
Verification on NVIDIA RTX 5070 Ti (Windows 11), head
529d13f557a1619813b1220e70c97a534320decdTested
529d13f557a1619813b1220e70c97a534320decd(git rev-parse HEADof a clean worktree, no local changes; merge-base withmain568e7db7729c8fa6c8f0f4b32d798faaf11462bb). The PR was open and the head unchanged when I started and again before writing this. The earlier verifications in the thread were on other heads.cargo testdefault), DXC from the Windows SDK 10.0.26100.0 (dxcompiler/dxil 1.8.2502.11).crates/xcl/tests/console_shaders.rs, so I ran that target and not only--lib:cargo test -p xcl --test console_shaders -- --test-threads=4 --nocapture: 3 passed, 0 failed, 4 ignored (21 s including an incremental build; the 4 ignored carry#[ignore]in the file).cargo test -p xcl --lib gpu::recomp::pso -- --test-threads=4 --nocapture: 17 passed, 0 failed, 1 ignored.cargo test -p xcl --lib hle::d3d12x -- --test-threads=4 --nocapture: 177 passed, 0 failed, 2 ignored (covers thereal.rscallers).cargo test -p xcl --lib -- --test-threads=4 --nocapture(whole lib): 1095 passed, 4 failed, 26 ignored. The 4 failures aregpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0to_3withCreateComputePipelineState: Not enough memory resources are available to complete this operation. (0x8007000E). The same four fail with the same message on the merge-base568e7db(1094 passed, 4 failed, 26 ignored there; the one extra pass here isrepeated_console_shader_requests_share_dxil), so they are not from this PR.SKIPPEDlines in the whole-lib run:shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode is required), 0x887A002D; and 23 GPU tests withno wave64orrefused (unsupported V_MUL_F16 / V_PK_MUL_F16 / V_CVT_F16_F32 ...)on this wave32-only GPU.Not tested
xcl-smokeregression run; this is a unit/integration-test run only, so I did not check that the shared DXIL is reached at run time.cargo test --workspace; the 4 ignored tests inconsole_shaders; release profile.AI use
Run and written with Claude Code (Claude Fable 5.2 and Claude Sonnet 5.5).
@Lum7nt on GitHub · 2026-11-25 12:50 UTC · original
Native Windows / AMD comparison on clean PR head
529d13f557a1619813b1220e70c97a534320decdand main568e7db7729c8fa6c8f0f4b32d798faaf11462bb: Radeon RX 9070 XT, driver32.0.32029.2010, DXC 1.9.2609.5. WithXCL_ADAPTER=9070 XTandXCL_HEAP_WINDOWS=1, both were run with:cargo test --offline --locked --workspace --release --no-fail-fast -- --test-threads=4No retail title or game-sample tests were run for this comparison. AI use: OpenAI Codex (GPT-6; exact variant unavailable) ran the checks and drafted this report.
@DavidM1911 on GitHub · 2026-11-26 07:28 UTC · original
Re-verification on RTX 3060 Ti (Windows 11): still a merge conflict with current
mainon the new head — needs another rebase before it can be tested.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.