Recompiler: direct DXIL's signature dependency sets are bit masks #1770
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!1770
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1770"
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?
@josh-wirick on GitHub · 2026-11-24 20:29 UTC · original
josh-wirick:dxil/viewid-deps-bitset→main· +145 −30 · 2 files · 1 commits · openThe direct DXIL translator (#1426) recomputes a vertex or pixel shader's input → output dependency tables (PSV0,
dx.viewIdState) from the code it emitted.compute_depskept the input components of every value as aBTreeSet<u32>, cloned and merged at each operand of each instruction, in hash maps keyed by value. On a retail pack that was 39 % of the time its vertex and pixel shaders took to translate. This PR keeps the algorithm and makes the sets bit masks. The DXIL is byte for byte the same. Part of #1269.What is in it
crates/xcl/src/gpu/dxil/graphics.rs,compute_deps:Comps: au128for components 0..128, words after that);The traversal order and what is memoised are unchanged.
crates/xcl/src/gpu/dxil/graphics_tests.rs: a test of the set type on both sides of component 128, and a test that an input placed past row 32 reaches the dependency table. The second one passes onmaintoo: it pins the behaviour the pack does not cover.Tested
AMD Radeon RX 9070 (driver 32.0.32029.2010), Ryzen 7 9700X, 32 GB RAM, Windows 11 build 26300, Rust 1.100.0, DXC 1.9.2602.17. Tests in debug, measurements and regression runs in release.
cargo build --workspace, thencargo test --workspace -- --test-threads=4on6f8cb8b: 860 passed, 0 failed, 42 ignored (SKIPPED GPU tests:heap_window_out_of_memory_falls_back_to_the_switch_form, no heap windows).Same output:
xcl shaders <pack> --direct --sample 0 --max-bytes 0 --dump <dir>onmainc160d86and on this commit, all 26 698 programs of a retail pack (26 229 translated, the same 469 refused in both).diff -rqof the two folders: all 52 168 files identical, 25 615 of them DXIL containers.Time, same command without
--dump, 8 threads, two runs each (main→ this PR):mainc160d86compute_deps, summed over the threadsThe first three rows come from timers added to both builds for the measurement; they are not part of this PR.
Regression run
Both runs with
XCL_PRESS_A_AT=10,14,18,22,26,30,34,38,42,46,50,54,58set beforescripts/smoke.ps1, so that the title takes the same path in both (in a first pair without it, a real key press reached the title at 12 s in one run and at 36 s in the other, and the runs were not comparable). The game folder is given through a junction namedretail-title.main:
PR:
Not tested
XCL_DIRECT_DXIL=all. The regression runs above use the default HLSL path, which does not send the title's shaders throughcompute_deps; for the changed code the evidence is the whole-pack comparison and the tests.finish_graphicson game data: the pack's NGG programs go through the compute entry. The mesh unit tests (ms_*_parts_match_dxc) pass.Noticed while measuring, not changed here:
Shader::infer_type_featurestakes about 39 s of the 800 s summed above (insts_use_typebuilds aVecper instruction), and #1544 already touches that code.AI use
🤖 Generated with Claude Code
@SzczepanGrela on GitHub · 2026-11-24 20:40 UTC · original
Code review and Linux/RADV GPU test report on PR head
6f8cb8b(clean merge ontomain4178e88, zero compiler warnings).Review
Comps(0..128inu128+Vec<u64>overflow,insert/extend/iterboundary math at 127/128/191/192),root_ofmemoization againstroot(), and denseVec<Option<Comps>>indexing incompute_deps. Traversal order and memoization semantics matchmain.Tested
7.3.0-5-cachyos), AMD Radeon RX 9070 (RDNA4, RADV GFX1201, Mesa26.2.5-arch3.1),GE-Proton11-12(Wine Staging 11.0,vkd3d-proton v3.1-1-g8293130eb), DXC1.9.2602.17. Cross-builtx86_64-pc-windows-gnu, release profile (--lib).gpu::dxil::graphics::tests::(--test-threads=1): 26 passed, 0 failed (0.12 s), includingcomponent_sets_insert_merge_and_list_in_order,dependencies_on_input_rows_past_32_reach_the_table, all VS/PS/MS DXC-match tests, and GPU draw tests (emitted_vs_ps_draw_a_triangle,emitted_ms_ps_draw_a_triangle,emitted_ms_primitive_attribute_reaches_the_pixel_shader,emitted_ps_samples_a_texture_with_implicit_lod).gpu::dxil:: --skip ops_tests(--test-threads=1): 62 passed, 0 failed, 1 ignored (0.30 s).gpu::recomp::tests::gpu_withXCL_DIRECT_DXIL=all(--test-threads=4, skipping the 3 Wine vtable-swap testsgpu_sparse_vram/gpu_uma/gpu_unified_memory_arenaand 3 pre-existing RADV failuresgpu_f64_roots/gpu_f64_math_random/gpu_nonfused_mad_and_mac_prevent_fma_contraction): 81 passed, 0 failed, 1 ignored (0.61 s).XCL_DIRECT_DXIL=all XCL_SPLIT_WAVE64=1(--test-threads=4): 81 passed, 0 failed, 1 ignored (0.63 s).Not tested
scripts/smoke.ps1(no retail title files locally).gpu::dxil::ops_tests::integer_ops_match_cpuanduaddc_and_usubb_match_cpuabort with exit code 3 under Wine/vkd3d-proton(unrelated compute op tests, does not exercisegraphics.rs::compute_deps).AI use
@FIJI1299 on GitHub · 2026-11-24 20:59 UTC · original
Test report on NVIDIA GeForce RTX 5070 (12 GB)
6f8cb8b)621.35), 32 GB DDR5 6000MT/s26300),rustc 1.100.0 (0ef1bc386 2026-11-09), Windows SDK10.0.26100.0(debug build).\scripts\test.ps1(cargo test --workspace -- --test-threads=4)xcl --lib:811 passed; 0 failed; 22 ignored(14.16s)8 passed; 0 failed; 12 ignored(1 + 1 + 6)819 passed; 0 failed; 34 ignored2 (no wave64),1 (no heap windows)smoke.ps1) withXCL_DIRECT_DXIL=all, shader pack sweep (xcl shaders --direct), release build, AMD GPUs.@LocranKing on GitHub · 2026-11-24 22:24 UTC · original
Independent Windows 11 + 8 GB Ampere (RTX 3060 Ti, wave32)
--releaseverification of exact head6f8cb8b321fb27b9bd0082486c6750b77f657448paired against its exact merge-basec160d86ef2efe3a07e4dfb473e4fa72eafb413c0: full suite green,--directvalidation identical across--split 0and--split 1, and clean 60 s retail smoke.Tested
26200, AMD Ryzen 5 5500, 31.8 GB RAM, NVIDIA GeForce RTX 3060 Ti (8024 MiB VRAM, Ampere, wave32 only), driver32.0.16.2101(621.01),rustc 1.100.0 (0ef1bc386 2026-11-09)(x86_64-pc-windows-msvc), DXC1.9.2602.17 (21d28f72)/dxil.dll 1.9.2602.17,--release.cargo build --release -p xcl: exit0.cargo test --workspace --release --no-fail-fast -- --test-threads=4 --nocapture): 860 passed, 0 failed, 42 ignored (+2over exact merge-basec160d86's858/0/42):gpu::dxil::graphics::tests::component_sets_insert_merge_and_list_in_order—okgpu::dxil::graphics::tests::dependencies_on_input_rows_past_32_reach_the_table—okSKIPPEDlines:2wave64 (gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware),2D3D12 debug layer (test_title_draws_with_a_root_signature_under_the_debug_layer,uploads_start_from_each_subresources_state),1heap windows (heap_window_out_of_memory_falls_back_to_the_switch_form).xcl shaders <retail-pack> --direct --sample 200 --seed 1269 --validate,175programs,25over16384 Bskipped):--split 0: 171 / 175 (97.7%) validated (CS 9/9,MS 69/69,PS 71/71,VS 22/22,GS 0/4unsupported ES+GS),0validator errors,0panics,0timeouts (p50 20.58 ms,p95 76.71 ms,max 125.53 ms,1.8 swall; vs2.2 swall onc160d86).--split 1: 171 / 175 (97.7%) validated,0validator errors,0panics,0timeouts (p50 23.02 ms,p95 80.53 ms,max 151.58 ms,1.0 swall; vs1.3 swall onc160d86).Regression run (
scripts/smoke.ps1 -Seconds 60,--release)Exact merge-base (
c160d86):PR
#1770(6f8cb8b):Not tested: AMD/Intel GPUs, wave64 hardware, D3D12 debug layer, or extended world-loading past 60 s.
AI use: Antigravity (
Gemini 4 Neon) built and ran the--releasetest suite,--directsweeps, and paired 60 s smoke run locally and drafted this report from the captured outputs.@DavidM1911 on GitHub · 2026-11-24 23:14 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@guinpereira on GitHub · 2026-11-24 23:18 UTC · original
Independent Windows/NVIDIA test report on exact PR head
6f8cb8b321fb27b9bd0082486c6750b77f657448.Tested
XCL_ADAPTER="rtx 5060 ti" .\scripts\test.ps1(cargo build --workspace, thencargo test --workspace -- --test-threads=4), debug: 860 passed, 0 failed, 42 ignored, exit 0.gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no wave64);heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows). AllXCL_SAMPLE_*inputs were unset; their optional data bodies did not run.c160d86ef2efe3a07e4dfb473e4fa72eafb413c0, and smoke baselinemain689f2db477c3c062cf162649781640ef8a977c18. Source checkouts were clean.xcl shaders <same local pack> --direct --sample 2000 --seed 1269 --validate --split 1 --threads 1. In each of six runs: 301 programs above 16384 bytes skipped; remaining 1699 programs: 1664 translated and validated, 35 unsupported, 0 validator errors, 0 panics, 0 timeouts. Unsupported: 33 ES+GS and 2 static-samplerimage_get_lod.--dump: all 1697 unique result files (DXIL / refusal text, repeated inputs deduplicated by output name) matched SHA-256 byte for byte; no missing or extra files.Timing limitation
Two subsequent pairs omitted dumps and alternated order. Parent: 53.961 / 57.969 s; PR: 56.254 / 35.438 s. Background desktop CPU activity and the wide variation prevent a reliable speedup claim. These are sampled CLI translation-plus-validation times, not cold driver PSO times or FPS.
Regression run
Same local title/data root, warmed cache, release, 60 s,
XCL_ADAPTER="rtx 5060 ti",XCL_PRESS_A_AT=10,14,18,22,26,30,34,38,42,46,50,54,58; main then PR, with no task-owned build or other measurement running. Script output copied verbatim:main:
PR:
Not tested
XCL_DIRECT_DXIL=all.compute_deps. Its main/PR builds also differ by upstream changes; only the exact-parent shader comparison isolates this PR. No FPS improvement claimed.AI use
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.