Recompiler: direct DXIL's signature dependencies are complete across loops #1966
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!1966
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1966/head"
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?
@b3IKK on GitHub · 2026-11-25 00:01 UTC · original
b3IKK:dxil/view-id-deps-loop-fixpoint→main· +134 −44 · 3 files · 1 commits · merged 2026-11-25 01:36 UTCPart of #1892 (its first point; the second is not in this PR, see Not tested).
compute_depsingpu/dxil/graphics.rsworks out which input components each output component depends on, fordx.viewIdStateand thePSV0tables of the direct DXIL translator's vertex, pixel and mesh programs. A loop makes a value depend on itself, and the function broke that recursion by answering an empty set for a value whose own set was still being worked out, then kept whatever it derived from that answer.With
acc = phi [X, entry], [next, loop]andnext = acc + 1: asking foraccfirst reachesnextwhileaccis open,nextis remembered as depending on nothing, and an output written fromnextloses inputX. Which outputs are affected depends only on the order the stores are met in.The sets now record which pass worked them out and whether that is still going on. A pass that had to answer for an open value or block is followed by another, each value starting from what the last pass knew of it, until no set grows. Code without a loop cuts nothing and is done after one pass, as before.
What is in it
crates/xcl/src/gpu/dxil/graphics.rs:compute_depskeepsKnown { set, pass, open }per value and per block, and repeats its walk over the output stores while a pass both cut a cycle and grew a set.crates/xcl/src/gpu/dxil/kernel.rs:TRANSLATOR_VERSION7 → 8, since the tables of programs with loops change. Other open direct-DXIL PRs bump the same line (my #1720 among them), so whichever merges second needs the next number.crates/xcl/src/gpu/dxil/graphics_tests.rs:a_loop_value_first_reached_through_its_phi_keeps_the_phis_inputsbuilds the loop above with outputsA = accandB = nextand askscompute_depsdirectly. Onmainit fails withoutput B depends on input X through the loop; its inputs: {}.#1770 rewrites the same function's sets as bit masks and keeps the single pass, so the two conflict; this change is small enough to redo on top of it if that one goes first.
Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1).\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 991 passed, 0 failed, 45 ignored (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses,no heap windows, andcannot disable the driver cache (Windows Developer Mode is required))cargo test -p xcl --lib -- gpu::dxil::graphics: 25 passed, 0 failed, also withXCL_DIRECT_DXIL=all. That includesvs_control_dependence_matches_dxc, whose loop and branches still give the samePSV0bytes as DXC, so the extra passes add nothing DXC does not have there.main20cf130before the change: 0 passed, 1 failed (the message above)Regression run
main (
8e87fc7, clean tree, no local changes):PR (
25298fb, clean tree, no local changes):(These two runs use the default settings, where vertex and pixel programs go through HLSL and DXC, so they do not run the changed code. One more run of the PR's build with
XCL_DIRECT_DXIL=allset: 1629 frames,60 60 60, 0 crashes, 0 device removals, and no "rejected" line in the log. I did not count how many of the programs it translated have loops.)Not tested
compute_depson large programs with loops, which now takes at least two passes.AI use
scripts/smoke.ps1runs.github-bot referenced this pull request2026-11-26 05:16:03 +00:00
@GustavoEllwanger on GitHub · 2026-11-25 00:26 UTC · original
Tested exact head
25298fb70155f9b7c724560b7af4455bc9a4a450on AMD RDNA3 (RX 7600).Tested
cargo build --workspace: passed.XCL_HEAP_WINDOWS=1 cargo test -p xcl --test gpu_compute_e2e heap_window_out_of_memory_falls_back_to_the_switch_form -- --nocapture: 1 passed, 0 failed (RX 7600).cargo test --workspace --no-fail-fast -- --test-threads=4 --skip fuzz_validate_and_gpu_1: 990 passed, 0 failed, 45 ignored, 1 filtered out, 0 wave64/mesh capability skips.gpu::dxil::graphics::tests::a_loop_value_first_reached_through_its_phi_keeps_the_phis_inputs: passed.SKIPPEDlines reported in the default run (not counted as coverage): 6 per-lane#1426refusals (f16_programs_on_the_gpu/f32_programs_on_the_gpu), 1pso_measurement_compiles_an_exact_synthetic_record(Windows Developer Mode not enabled,0x887A002D), 1heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows, separately verified above withXCL_HEAP_WINDOWS=1).fuzz_validate_and_gpu_1was skipped on RX 7600 due to the pre-existingamdxc64seed 722 failure documented in210f773. WithXCL_ADAPTER=warp,fuzz_validate_and_gpu_1validated all 500/500 modules (500..1000,GPU-compared 0).XCL_SAMPLE_*variables were unset.Not tested
XCL_SAMPLE_*game-data tests.AI use
Antigravity (Gemini 4 Neon) ran the commands and drafted this report; only the measured results above are posted.
@futurepro62 on GitHub · 2026-11-25 00:25 UTC · original · edited 2026-11-25 00:36 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
25298fb(on its base8e87fc7).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 980 passed, 0 failed, 43 ignored. SKIPPED (no wave64):a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,a_per_lane_2d_or_3d_group_runs_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.a_loop_value_first_reached_through_its_phi_keeps_the_phis_inputs.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 990 passed, 0 failed, 45 ignored. SKIPPED:f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipleaves out tests that fail on main80f4819too, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651), the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests andconst_and_null_mask_operands_agree_with_hlsl_on_the_gpu(follow-up on #1651) fail becauserunner::skip_testturns their skips into failures underXCL_REQUIRE_GPU=mesh, andgpu::dxil::fuzz_testsseeds 70, 545, 1019 and 1507 failCreateComputePipelineStatewithE_OUTOFMEMORYon this card (drivers 616.64 and 621.40). On AMD:fuzz_validate_and_gpu_1fails on seed 540 (res[833]0x7 vs CPU 0x6). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
@raylitebull on GitHub · 2026-11-25 01:07 UTC · original
Both AMD and NVIDIA passes look solid on
25298fb.Remaining before merge: please rebase onto
main(resolving thekernel.rsTRANSLATOR_VERSIONbump after#1950and#1947, which now auto-hashesgpu/dxilsources viaXCL_DIRECT_DXIL_SOURCE_ID) soBuild and test (Windows, no GPU)can run cleanly.@DavidM1911 on GitHub · 2026-11-25 03:09 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!