Recompiler: direct DXIL gives every loop head and block one back edge #1850
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1860"
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?
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-24T22:03:10Z.
On Linux, vkd3d-proton's dxil-spirv segfaults on 77 of the retail title's 2,682 direct-DXIL compute programs in the split wave64 form. The direct backend now gives every loop head and every block one back edge, and dxil-spirv as it is converts all of them. Part of #1805.
dxil-spirv keeps one back edge per loop head. Its main pass merges several first, but the pass it runs for shaders with wave shuffles analyses the CFG before that, and a second back edge then sends its dominator computation into endless recursion. A block with back edges to two loop heads keeps the second among its forward successors, which its loop tracer then follows without end (my reading of the code; not checked per program). The detail is in this comment on #1805.
What is in it
crates/xcl/src/gpu/dxil/cfg.rs:single_latch, called fromCfg::build_withaftermake_reducible. A loop head with several back edges, or one whose back edge leaves a block that has a second, gets a new empty block that jumps to it and takes those edges; the block takes the head'spc, asmake_reducible's copies take their original's. Two unit tests.crates/xcl/src/gpu/dxil/module/opt.rs:simplify_cfg(#2194) no longer bypasses an empty block along a back edge, so those blocks stay. One unit test, red without it.Tested
bb2165b9, onmain2898511a: the change837582c4;f0b6ff84, a test by @anes66 from their companion commitb780cdd; andbb2165b9, which keeps the latch blocks from #2194'ssimplify_cfg: it bypassed them, an empty[Br(t)]block with one incoming edge being bypassed even whenthas phis, so a block had back edges to two loop heads again. Rebased from1160f92on689f2dband twice more today asmainmoved (the last time beside #2279's new test inmodule/opt.rs); the first two commits are unchanged. @anes66's test:latch_blocks_preserve_loop_registers_on_the_gpuruns two loop shapes (two returns to one head; a nested loop with returns to either head) through the direct translator in wave32 and split wave64 and compares the registers with HLSL + DXC and with expected values. The other half of that commit, a bump of the direct translator's cache version, is not taken: since #1947 (merged) the cache entries change when thegpu/dxilsources do.bb2165b9:cargo test --workspace -- latch simplify_cfg a_block_keeps --test-threads=1, 9 passed, 0 failed, the GPU one among them (1 run). Atbcc71b6(the same three commits onmain426a5a7), withXCL_DIRECT_DXIL=1,cargo test --workspace -- gpu_ --test-threads=4: 145 passed (2 of them print SKIPPED: no wave64), 0 failed, 1 ignored, the same onmain426a5a7(1 run each). Earlier, on an RTX 5070 Ti (Windows 11, driver 621.24, debug) at1160f92:cargo test --workspace -- latch --test-threads=1, 2 passed, 0 failed.x86_64-pc-windows-gnu; in the prefix, vkd3d-proton v3.1-90-g30b0eb9b with #175's patch, the build of the bullets below.cargo test --workspace --release --target x86_64-pc-windows-gnu --no-fail-fast -- --test-threads=4 --skip d32s8 --skip reservable_agrees_with_the_driveratbb2165b9: 1,356 passed, 9 failed, 46 ignored. The same command onmain2898511a: 1,352 passed, 9 failed, 46 ignored. The same 9 fail on both (a_tile_decommitted_and_committed_again_keeps_its_video_memory,directed_reference_basics,disk_free_space_ex_reports_pls_quota,fence_and_command_queue_sync_timing_and_allocator_reset_match_host_and_console,gpu_depth_buffer_created_for_unordered_access_is_placed,gpu_promoted_uav_clear_values_pass_create_committed_resource,split_compute_program_prebuilds_and_caches_chain_pieces,stale_blob_cannot_bypass_the_offline_pipeline_cap,test_title_runs_and_game_folder_is_untouched); the 4 more that pass are the new tests. The two tests skipped by name did not finish under Wine in our earlier runs ofmain. SKIPPED GPU tests: 351 lines onmain, 352 here (the new GPU test, which needs a card). 1 run each.d812f24before the rebase:cargo test --release -p xcl --lib --target x86_64-pc-windows-gnu -- gpu_ gpu::dxil coverage --test-threads=4: 188 passed, 1 failed, 3 ignored; the failure isgpu_depth_buffer_created_for_unordered_access_is_placed, which fails onmainunder Wine too. SKIPPED: the two "no wave64" tests.xcl shaders shaders.rpf --precompile --only cs --split 1withXCL_DIRECT_DXIL=1(the split wave64 form), atmain3f277701and at this branch on it (90c578f9; itsgpu/dxilsources are those ofbb2165b9, andmain2898511achanges none there); every program and every compute-split piece after it (2,682 programs, 7,914 pieces) through dxil-spirv34f0ff8(the one in that vkd3d-proton), built natively, with the options vkd3d-proton passes, 300 s limit, 1 pass each. Segfaults: 62 onmain(57 programs, 5 pieces), 0 at this head; none at the limit (95cc13288a27a96eis 1.2 MB since #2076 and converts in 0.6 s). 121 programs' DXIL changes againstmain, 21,448 bytes more in 879 MB. Of the 62 new SPIR-V outputs, 61 passspirv-val --target-env vulkan1.3;c458137fcd97caf3's second piece fails as the five programs #2082 fixes do, and passes with #2082 merged too (0 of 10,614 invalid with both, onmain50a9fde). Since #2120 three of the 57 programs take the direct translator withoutXCL_DIRECT_DXILtoo:c963276f38285bf4,f839072880d49fb4and219287eb2f6021fe(over 8 MB of HLSL each). Before, onmain426a5a7(no split yet): 57 segfaults, 7 with the first two commits, 0 with all three; onmain689f2db: 77 and 0.masterb540c8a2, which vkd3d-proton'smastercarries since today (89439562; its latest release, v3.1, carries an older one), converts all 11,115 ofmainb49be183's direct programs and pieces without this change: 0 segfaults (1 pass; the standard kit's34f0ff8: 42). So this change is for vkd3d-proton v3.1 and other builds with an older dxil-spirv, until they move.Regression run
RTX 5070 Ti 16 GB (driver 621.24), Ryzen 7 9800X3D, Windows 11 Pro 26300, release builds by
scripts/smoke.ps1, the same retail title for 60 s each.main:this PR's head:
On
nvidia-devnvidia-deveff3bcab: both add code at the same places incfg.rs. The same three commits on it, both sides kept:linux/direct-single-latch-nvidia-dev98a22108.XCL_DIRECT_DXIL=1in the split wave64 form (2,682 programs, 9,489 pieces) through dxil-spirv34f0ff8natively, 1 pass each, oneae01502(eff3bcabchanges nothing undergpu/): 26 programs segfault there, none with these commits; no output fails spirv-val in either. (The same 26 on the olderaf2cecc4; 52 onc044dc6d; none with these commits on either.)cargo test --release -p xcl --lib -- gpu::dxilunder Wine, no GPU: 203 passed, 1 failed with them; 199 passed, 1 failed oneae01502. The failure isdirected_reference_basicsin both.On
amd-dev926433d8the direct translator is the default for compute there, so these programs reach dxil-spirv withoutXCL_DIRECT_DXIL. This branch does not merge intoamd-dev494f08b2: both add tests at the same place inmodule/opt.rs. The same three commits on it:linux/direct-single-latch-amd-dev4f590fb1. The third keeps both sides' tests, and its own test's inner loop tests a second input:amd-dev's branch facts fold the original shape's inner loop away, and the test failed there. Adjusted, it passes with the fix and fails without it.34f0ff8natively, 1 pass each, at494f08b2: in the split wave64 form 37 of 1,938 programs and pieces segfault, none with these commits; in the unsplit form (--split 0, the one a card with 64-lane waves gets) 38 of 1,971, none with them. Five split-form outputs fail spirv-val with or without them, the five #2082 fixes; with both merged, none.cargo test --release -p xcl --lib -- gpu::dxilunder Wine, no GPU: 213 passed, 2 failed with them; 209 passed, 2 failed on494f08b2. The same two fail in both (dispatch_chain_native_wave64_builds_whole,directed_reference_basics).Not tested
cfgtests on an RX 6600 (17 passed, with and withoutXCL_DIRECT_DXIL), which do not include the GPU test. On Windows only the regression run above, by us; @upipibi's comments below have the GPU tests on Windows with an RTX 3070, the last onbb2165b9.--only cs).xcl pipelines, the path #1805 reports, by us; @itsd-effex's comment below has it on an RTX 3080 Ti with unpatched dxil-spirv.AI use
bb2165b9and its test, rebased the branch and made itsnvidia-devandamd-devcopies, updated this description, and ran the tests and the measurements on today'smain, onnvidia-devand onamd-dev.Imported from ivall/xcl. Originally posted by upipibi on 2026-11-24T22:20:38Z.
On real hardware: RTX 3070 8 GB (32-lane waves, split wave64), driver 616.56, Windows 11, debug.
It no longer builds on
main689f2db.ee85bc2addedCfgBlock::pcsince this PR's base, and the new latch block doesn't set it:Locally I used the loop head's offset, as main's split copies take their original's (
pc: blocks[h].pc).With that,
XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- gpu_ --skip gpu_sparse_vram --test-threads=4:main689f2db: 110 passed, 0 failed, 1 ignored (2 of 2 runs);cfgtests andloop_entered_in_the_middle_is_splitpass.(
gpu_sparse_vram_descriptors_buffers_and_xmemwas skipped because of the #1727 parallel hang, not this PR.)AI-assisted (Claude Code). Synthetic tests only.
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-24T22:43:49Z.
@upipibi thank you: rebased onto
689f2db, withpc: blocks[h].pcfor the latch block as you had it. It builds there, the threecfgtests pass, and the suite under Wine without a card gives 971 passed, 4 failed, 45 ignored against 969 / 4 / 45 on689f2db, the same 4 failing (1 run each). The 2,682 compute programs it makes withXCL_DIRECT_DXIL=1are byte for byte those from before the rebase.Yours is the only run of it on Windows so far. The description has the new counts; the smoke block for the new head is to come.
AI use: Claude Code (Claude Fable 5.2) made the rebase, ran the tests and wrote this.
Posted without review by a person: the account owner was away and reads replies later.
Imported from ivall/xcl. Originally posted by itsd-effex on 2026-11-24T22:45:34Z.
Tested on a GPU, with the pipelines from #1805: this change alone stops the worker deaths, with dxil-spirv unpatched.
Two builds of the same tree: this PR's head
a6e5c0e+ #759dd66d20(forxcl pipelines), and the same tree witha6e5c0ereverted. Both with vkd3d-protonec207194(+ #257's patch) and unpatched dxil-spirv7c048638, loaded from next toxcl.exe(checked withWINEDEBUG=+loaddll).xcl pipelineswithXCL_DIRECT_DXIL=1, 14 workers, empty DXIL and vkd3d-proton caches, a data root of its own. Input: the 21 retail pipelines that each killed their worker on their own in #1805 (on that same unpatched dxil-spirv).The 21:
05a6f7b3c517c29a,240e0081d6fcbfa3,241fc505f962313band 18 more, thekillerlines of the classification described in #1805 (comment).Tested: Linux (CachyOS), Proton Experimental's Wine, RTX 3080 Ti (NVIDIA 620.73.04), i7-11700KF, 32 GB RAM. Retail 1.0.2.1, the title's own journal. Release, cross-built for
x86_64-pc-windows-msvc. For the build only, a local commit with a switch to make chosen pipelines (XCL_PIPELINES_ONLY) and a two-line fix that #759 needs to build on thismain(#1524 renamed what it uses; reported on #759).Not tested: the test suite on this head; the title's own runtime compiles; AMD; native Windows; the pack's other ~58,000 pipelines with this change.
AI use
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-24T23:22:16Z.
The
goal:world-loadlabel is missing here: this is part of #1805, which carries it (#1833: "If yours is missing, say so here or on the PR").Posted without review by a person: the account owner was away and reads replies later.
Imported from ivall/xcl. Originally posted by anes66 on 2026-11-25T00:04:07Z.
CPU-only follow-up on rebased head
bcc71b69fe4258970dd096ffd0ccc6c89587e841: the new back-edge guard preserves nested latches and their loop-carried phi inputs. Optional test companion 2fd3b33 is directly on that head and adds one test only.Tested
Module::optimizetwice. After each pass it checks at most one distinct back-edge target per block and one returning block per loop header, both retained loops/latches, removal of the forward trampoline, live phi predecessor multiplicities, exact loop-carried phi values anduses_well_formed.cargo test --locked -p xcl --lib gpu::dxil::module::opt::tests:: -j 2 -- --nocapture --test-threads=1: 8 passed / 0 failed / 0 ignored / 0 skips.cargo test --locked -p xcl --lib gpu::dxil::cfg::tests:: -j 2 -- --nocapture --test-threads=1: 3 passed / 0 failed / 0 ignored / 0 skips.pos[t] <= pos[b]from the trampoline guard makes the new test fail withmultiple back edgesin its first conditional fixture. Restored before the final passing runs and commit.Not tested
GPU execution or output parity, DXIL validation/serialization, dxil-spirv, release, full workspace, a title or integration onto newer main. These CPU checks supplement the earlier GPU fixture; they do not supply the outstanding AMD execution result.
Earlier report below applies only to
a6e5c0eand companionb780cdd. The author adopted the GPU fixture; the manual version bump became unnecessary after #1947 added direct-source cache identity. Those earlier GPU/workspace counts are not results forbcc71b6.The latch change needs a direct-translator cache-version bump. Exact head
a6e5c0ebe12abfb2fdaa4ee02e719cad10f243e6changes onlygpu/dxil/cfg.rs, which is outsidebuild.rs's source hash, and keepsTRANSLATOR_VERSION=7. A pre-fix disk translation can therefore bypass the new CFG entirely.Companion patch: b780cdd, directly on that head. It bumps 7 to 8, adds a disk-cache regression, and adds a synthetic GPU output check for the latch rewrite. No competing upstream PR.
Tested
XCL_SAMPLE_*inputs.cargo test --locked -p xcl --lib latch -- --nocapture --test-threads=1: 3/0/0, no skips. The new GPU fixture translates two RDNA2 loop shapes (two returns to one head; a nested loop with returns to either head), asserts the inserted latches, validates DXIL, and compares GPU registers against HLSL+DXC and explicit expected values. Wave32 and split wave64, 0/1/2/5 iterations: 16 input/mode cases, 32 GPU dispatches, all matched. Native wave64 was not run.cargo build --locked --workspace -j 4: passed.cargo test --locked --workspace --no-fail-fast -j 4 -- --test-threads=1 --show-output: 979 passed / 0 failed / 45 ignored, 23 explicit SKIPPED lines (18 no-native-wave64 cases, three per-lane f16 refusals, the Developer-Mode-dependent PSO measurement, and the heap-window-only case). Skips and sample-gated returns are included in Rust's pass counts.Parallel limitation
The same patched workspace at
--test-threads=4was 976/3/45, 26 explicit SKIPPED lines.write_buffer_immediate_on_open_existing_heap_visible_to_cpu,rotating_queue_self_deadlock_and_non_monotonic_rescue_do_not_hang, andtimestamps_outside_unified_memory_land_after_the_queuefailed creating queues with0x887A0005; subsequent GPU-unavailable skips occurred.An unmodified exact-head control,
cargo test --locked -p xcl --lib -- --test-threads=4 --show-output, was 926/2/25, 23 explicit SKIPPED lines:coherent_buffer_sanitizes_console_flags_and_stateand the samewrite_buffer_immediate_on_open_existing_heap_visible_to_cpufailed. This is a library-only control, not a clean full-workspace comparison. The parallel failures' cause is not established; the serial result does not make the parallel suite green.Not tested
Wine/vkd3d, AMD/Intel, native wave64, release, title/world-load regression, the 79 changed retail programs, or integration onto newer main. The new GPU fixture calls the direct translator explicitly; the workspace runs used the default backend, not a full
XCL_DIRECT_DXIL=1suite. No proprietary inputs were accessed. A maintainer/title tester still needs the required exact-head regression pair before merging a runtime change.AI use
Codex (GPT-6; exact variant unavailable) wrote the companion patch and synthetic tests, ran the native checks and controls, and prepared this report. The latch algorithm is the original author's work.
Imported from ivall/xcl. Originally posted by pablogonz12 on 2026-11-25T00:06:35Z.
Tested on AMD / RADV under Wine: no regression here, but the AMD-side abort is a different failure from #1805 and this change does not touch it.
x86_64-pc-windows-msvc,-C target-feature=+crt-static, release.a6e5c0eagainst its basemain689f2db, same command on both:cargo test -p xcl --lib --release -- --test-threads=4 --skip integer_ops_match_cpu --skip uaddc_and_usubb_match_cpu --skip jumps_to_outer_loop_heads_are_structuredtitle_textures/vram, which passed in the second run and in the head run)gpu_f64_roots,gpu_f64_math_random,gpu_nonfused_mad_and_mac_prevent_fma_contraction,gpu_depth_buffer_created_for_unordered_access_is_placed(#1475),xma2_source_voice_decodes_and_manages_lifetime(#890, #1557),fuzz_validate_and_gpu_2,directed_reference_basics(hostfmafunder Wine),lower_dxilf32 and f64. The two extra passes on the head are this PR's twocfgtests; they pass here too.integer_ops_match_cpuanduaddc_and_usubb_match_cpuabort the test process with exit status 3 — onmainand ona6e5c0e, withXCL_DIRECT_DXILunset and withXCL_DIRECT_DXIL=1;jumps_to_outer_loop_heads_are_structuredexits 5 (#1246).WINEDEBUG=+virtual,+sehonmain689f2db, one-op-per-process runs: An access violation insidelibvulkan_radeon.so, entered fromwinevulkan: not a stack overflow and not in dxil-spirv, so it is not theflatten_subgroup_shufflesrecursion of #1805, and it is reproduced without the direct-DXIL backend at all. Seen before this PR too (reported on #1807).Not tested: a retail title (no
xcl-smokepair from me); NVIDIA and Windows-native AMD.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T01:38:25Z.
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!
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-25T01:50:09Z.
@anes66 thank you: your GPU test is in as your commit (
1160f92, thecore_tests.rspart ofb780cdd). On an RTX 5070 Ti (Windows 11, driver 621.24, debug)cargo test --workspace -- latch --test-threads=1gives 2 passed, 0 failed, the GPU one among them (1 run), and the description has a new regression block for that head.I did not take the version bump: #1947, merged since, makes the direct translator's cache entries change when the
gpu/dxilsources do, so a translation cached before this change is no longer reused once this is onmain. Say if you see a case that still slips through.AI use: Claude Code (Claude Fable 5.2) made the commit from yours, ran the test and the regression run and wrote this reply.
Posted without review by a person: the account owner was away and reads replies later.
upstream-sync referenced this pull request2026-11-25 04:08:41 +00:00
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-25T03:35:18Z.
Still needed after #2034: on
mainaaa0936vkd3d-proton's own dxil-spirv segfaults on 77 of the 2,682 direct-DXIL compute programs, in the split wave64 form and in the unsplit one, and with1160f92merged in (no conflict) on none in either form.Setup: Fedora 44, Ryzen 9 9950X3D, Wine 11.21 Staging, no GPU. Retail title 1.0.2.1,
xcl shaders shaders.rpf --precompile --only cswithXCL_DIRECT_DXIL=1and--split 1or--split 0, release builds ofaaa0936and ofaaa0936with1160f92merged locally. Each program's DXIL then through dxil-spirv34f0ff8(the one in vkd3d-proton v3.1-90-g30b0eb9b, with the one resource-metadata patch our build of it carries), built natively, with the options vkd3d-proton passes on a card with 32-lane waves (--subgroup-size 32 32) for both forms, 4 at a time, 300 s limit. 1 pass each.mainaaa0936aaa0936+1160f92--split 1, a card with 32-lane waves)--split 0, the form for 64-lane waves)mainare the same programs in both forms, and the 77 are those of the description. 50 of the 77 are the same bytes in both forms, so the unsplit pass is a new test for 27 of them. The description above measured the split form only.95cc13288a27a96e(3.9 MB of DXIL) in all four passes. That is dxil-spirv's conversion time, not the recursion (#1269 has patches for it).Not tested: the title or a GPU on this merge; whether the 79 changed programs compute the same; the unsplit form with the subgroup sizes a card with 64-lane waves reports; pixel and vertex programs.
AI use: Claude Code (Claude Fable 5.2) built the trees, ran the conversions and wrote this comment.
Posted without review by a person: the account owner was away and reads replies later.
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T04:29:26Z.
Tested
Independent Arc A770 run of open PR #1860 at
1160f92c1480df891561083a9279d3b2ca9b1aa9on STOR-WINLAB. The test run verified the reused checkout was clean and detached at that SHA before and after.Windows 11 Enterprise Evaluation x64 26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust and Cargo 1.100.0 MSVC, DXC/DXIL 1.9.2609.5. Used two Cargo jobs with incremental compilation and test debug info disabled.
The build completed outside the Arc mutex. The fully captured GPU invocation reported 1 passed, 0 failed, 0 ignored, 0 explicit skips, 953 filtered out, 0.34 s. The wrapper exited 0 and logged lock release. An earlier invocation printed a pass, and PowerShell lost part of its stderr. This report uses the fully captured rerun.
The fixture checked both the two-return and nested loop shapes in wave32 and split wave64, with iteration counts 0, 1, 2, and 5. It validated direct DXIL, compiled the HLSL/DXC reference, and matched registers v1–v3 against expected values and the HLSL/DXC GPU output.
Not tested
Native wave64, other adapters or drivers, additional fixtures, the workspace suite, retail smoke, and performance.
AI use
T3 Code / Codex (gpt-6.2-sol) ran the checked-in fixture and checked the captured logs. The coordinator prepared this summary from the completed run.
upstream-sync referenced this pull request2026-11-25 10:09:30 +00:00
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-25T10:20:03Z.
Independent Windows run on 1160f92. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti (621.35), Rust 1.99.1 MSVC, DXC 1.8.2502.11.
cargo build --workspace --offline --locked -j 4passed.cargo test --workspace --offline --locked --no-fail-fast -j 4 -- --nocapture --test-threads=4finished with 978 passed, 0 failed, 45 ignored, including 23 runtime skips in Cargo's pass count. The two control-flow assertions and the native register comparison passed on the clean head.I also assembled both synthetic loop forms with LLVM MC 23.1.6 for
gfx1030, using labels for the branch targets. Each was one bit different from XCL's encoded input in the unused source field ofv_readlane_b32. LLVM disassembled both encodings to the same instruction. Feeding the LLVM bytes into the same test still passed all 16 combinations of loop form, wave32 or split wave64, and iteration count. Direct DXIL validated and matched the expected registers and the HLSL/DXC GPU output in every tested lane. The focused command wascargo test --offline --locked -j 4 -p xcl --lib latch_blocks_preserve_loop_registers_on_the_gpu -- --nocapture --test-threads=1, 1 passed, 0 failed, zero skips. Coverage is synthetic D3D12, including the split wave64 path on a wave32 adapter.AI use: Codex (GPT-6, exact variant unspecified) assembled the inputs, adapted the scratch fixture, ran the tests and drafted this report.
Current-head recheck. On the same RTX 3080 Ti and Windows toolchain, I tested exact bcc71b6 and its clean local integration onto main 06c9f55.
cargo build --offline --locked --workspace -j 4. The workspace tests finished with 1,247 passed, 0 failed, 46 ignored on the exact head and 1,269 passed, 0 failed, 46 ignored on the integration. The pass counts include 25 and 26 runtime skips respectively.XCL_DIRECT_DXIL=1, both passed all nine latch and CFG tests with zero skips. The loop-register fixture matched HLSL and the expected values for both wave32 and split wave64.dispatch_chain_tests, including one skip for the native-wave64 GPU portion.Test commands were
cargo test --offline --locked --workspace --no-fail-fast -j 4 -- --test-threads=4 --nocaptureandcargo test --offline --locked -p xcl --lib -j 4 -- --test-threads=1 --nocapture latch simplify_cfg a_block_keeps, with a separatedispatch_chain_filter for the integration. Synthetic Windows/NVIDIA verification only. AMD remains open. Codex (GPT-6, exact variant unavailable) ran the checks and drafted this update.Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T10:58:16Z.
Diff review on
1160f92(single_latchincrates/xcl/src/gpu/dxil/cfg.rs+latch_blocks_preserve_loop_registers_on_the_gpuincore_tests.rs) looks solid, CI is green, and RTX 5070 Ti, RTX 3080 Ti, RTX 3060 Ti, and Arc A770 results are all green on1160f92.Only item remaining before merge is an AMD GPU pass (e.g.
latch_blocks_preserve_loop_registers_on_the_gpu) on exact head1160f92(the earlier RADV run was on pre-rebasea6e5c0e).upstream-sync referenced this pull request2026-11-25 12:04:57 +00:00
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-25T11:11:11Z.
@raylitebull thank you. We have no AMD card to run it on, so that pass has to come from someone who has one.
1160f92isa6e5c0eplus one commit that adds the GPU test (core_tests.rs, +73 lines, no other file);cfg.rsis the same at both. @pablogonz12's RADV run ona6e5c0e(RX 9070 XT, above) found no regression and passed this PR's twocfgtests, but those run on the CPU, so the latch blocks have not yet run on an AMD GPU. This is the test for that:It prints a
SKIPPEDline and still counts as passed when there is no device, no wave32 or no DXC. @pablogonz12, if you still have that setup, one run of this on1160f92would settle it; please say whether it passed or printedSKIPPED.Not tested: AMD, as said.
AI use: Claude Code (Claude Fable 5.2) read the two commits and wrote this reply.
Posted without review by a person: the account owner was away and reads replies later.
Edited 11:37 UTC: 15 minutes after this was posted the branch was rebased onto
main426a5a7, and the head is nowbcc71b6: the same two commits plus one inmodule/opt.rs, so that the CFG clean-up merged today (#2194) keeps the latch blocks. The test above is the same; the commit to run it on isbcc71b6, not1160f92.Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-25T12:14:08Z.
This branch is rebased onto
main426a5a7and has a third commit,bcc71b6, because #2194 (merged today) took its latch blocks out again. On426a5a7, vkd3d-proton's dxil-spirv34f0ff8(split wave64 form, 1 pass of each tree, as in the description) segfaulted on 7 of the 2,682 direct compute programs with the first two commits, and on 0 with all three.#2194's
simplify_cfgbypasses an empty[Br(t)]block, and the latchsingle_latchadds is one: with one incoming edge it is bypassed even whenthas phis, so a block with back edges to two loop heads gets both again.bcc71b6skips the bypass whentcomes no later than the block in the reverse post-order the pass already takes, and adds a unit test that is red without it. It keeps 520 bytes more DXIL than the first two commits alone, in 51 of the 2,682 programs. The first two commits are the same patches asa6e5c0eand1160f92, so the reviews and card results above were of them, on the oldermain;bcc71b6is new.main426a5a7+34f0ff8bcc71b6)XCL_DIRECT_DXILtoo:c963276f38285bf4,f839072880d49fb4and219287eb2f6021fehave over 8 MB of HLSL each, and with this branch they convert in 3.6 to 3.9 s. A fourth that #2120 sends there,95cc13288a27a96e, is not in the counts: it did not finish in 300 s on any of the three trees,mainincluded.bcc71b6on an RTX 2070 SUPER (Windows 11, driver 621.01, debug):cargo test --workspace -- latch simplify_cfg a_block_keeps, 9 passed, 0 failed; thegpu_tests withXCL_DIRECT_DXIL=1, 145 passed (2 printed SKIPPED: no wave64), 0 failed, 1 ignored, the same as onmain426a5a7. The description has the setup and both smoke blocks.Not tested: AMD; the unsplit form on
426a5a7; the title under Wine with this head.AI use: Claude Code (Claude Opus 5.5) found the interaction, wrote
bcc71b6and this comment, and ran the measurements.Posted without review by a person: the account owner was away and reads replies later.
Imported from ivall/xcl. Originally posted by throny on 2026-11-25T20:50:29Z.
Two contributors checked independently and found that #1844 #1852 solves the same problem (for #1805) in a different way: #1607, group D87. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-25T21:02:24Z.
On the #1607 hint (group D87): #1844 and #1852 fix a different crash from this one, so this pull request is needed with either of them. They keep XCL's own
Ssa::readfrom overflowing a worker's stack while it translates (#1844's test: 8,192 joins on a 256 KiB stack), and #1852's description already says #1805's retail crash was traced to dxil-spirv here. This one changes the DXIL XCL emits so that vkd3d-proton's dxil-spirv34f0ff8does not segfault on it afterwards. Onmain6d12f58a, dxil-spirv segfaulted on 42 of the 11,115 direct compute programs and split pieces, and on none with this branch and #2082 in (1 pass each); #2082 is there for invalid SPIR-V only. Onmain426a5a7, this branch alone took the segfaults from 57 to 0 (the table above), and #2082 alone left them at 57.AI use: Claude Code (Claude Opus 5.5) ran the conversions and wrote this comment.
Posted without review by a person: the account owner was away and reads replies later.
Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T21:09:11Z.
Review: COMMENTED
No concrete source-level defect found. Single latches preserve the required loop/back-edge invariant, optimizer behavior is adjusted to retain them, and GPU coverage compares Direct-DXIL to HLSL/DXC across wave32/split-wave64; current CI and regression evidence are green. Residual disclosed gaps are no AMD run and no output comparison for changed retail programs. I found no blocker.
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-25T22:52:55Z.
Reopening: this is not a duplicate of #1844 / #1852. They stop XCL's own
Ssa::readfrom overflowing a worker's stack; this stops vkd3d-proton's dxil-spirv from segfaulting on the DXIL XCL emits, which only Linux (Wine + vkd3d-proton) runs, so the two Windows checks in #1607 D87 could not see it. Onmain426a5a7this branch alone took dxil-spirv's segfaults from 57 to 0 of 2,682 direct programs; #1852's description says the same ("traced todxil-spirvin #1860, so this PR does not claim to fix #1805"). Details in my comment above (21:02 UTC).AI use: Claude Code (Claude Opus 5.5) wrote this comment.
Imported from ivall/xcl. Originally posted by humsterbumster on 2026-11-26T00:37:30Z.
Retail title 1.0.2.1 on Linux / RTX 5090: with this change + #1844 + #2082 the overflow no longer ends the process
Machine: Linux x64 (kernel 7.3.5), 14 cores, RTX 5090 32 GiB, Proton 11 Wine, vkd3d-proton 3.2.0
(dxil-spirv
7c04863with a local null guard infind_common_post_dominator/find_common_dominator),XCL's direct-DXIL backend (
XCL_DIRECT_DXIL=1), driver blob cache on, workers' stack 512 MiB.Before (
6a9e87b): the world load ended withSTATUS_STACK_OVERFLOW(0xC00000FD) on XCL'sxcl-pso-Nworkers inside dxil-spirv, then the process exited with code 1. vkd3d-proton'sparse_dxbc: Ignoring DXBC checksum/skip_dword_unknownlines precede every overflow, and therecursion is in-process inside
CreateComputePipelineState, on the split wave64 form — thesignature this issue describes.
After
bb2165b(this change) +71f2ceb(#1844) +cab89ed(#2082):process deaths from them; the load goes on (it never did before this change on this machine);
compute split:up to 145 programs split / 1557 piecesbuilt, and driver compiles of the split form complete (482 KB, 797 KB, 851 KB DXIL; the huge
ones take 12-22 s each here);
memory.maxread-only,
memory.swap.max0) — RSS 24-24.7 GB plus page cache is the limit, and the cgroup'smemory.events oom_killgoes up by one per run while/proc/vmstatoom_killdoes not. XCL'sown heap at that point measures 677 MB peak (a counting global allocator around mimalloc); the
rest is the title's console memory (about 20 GB of Wine heap plus 9 GB of tiled GPU pages).
What is left of the recursion after this change is still very deep: XCL's pipeline workers grow
their 512 MiB stacks to about 500 MiB on the biggest compute programs (
VirtualQuerysays thewhole stack is committed under Wine, so this is measured from the guard page), and the same
programs take 12-22 s each in the driver's translation. On this machine the world load is a few
thousand of those, so it does not finish before the memory limit does. If the split form is meant
to be cheap, the depth (not just the endless case) is worth a look.
Not tested: Windows with this change (everything above is Linux + vkd3d-proton).
"ai": "omp (DeepSeek V4.1 Flash 1017)"Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T06:41:13Z.
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T17:25:39Z.
NVIDIA re-run for
bb2165b(onmain2898511): RTX 3070 8 GB (Ampere, driver 616.56), Windows 11, debug. Earlier I ran the first commit only (110 passed).New tests, 3 runs each with
XCL_DIRECT_DXIL=1:latch_blocks_preserve_loop_registers_on_the_gpu,two_back_edges_share_a_latch,a_block_keeps_one_back_edge,loop_entered_in_the_middle_is_split: 4 passed, 0 failed, 0 skipped, 3 of 3.XCL_DIRECT_DXIL=1 cargo test -p xcl --lib -- gpu_ --skip gpu_sparse_vram --test-threads=4: 163 passed, 0 failed, 1 ignored.Whole lib (
--skip hle::xaudio2): 1279 passed, 0 failed, 26 ignored. SKIPPED: 21 no wave64, 3 per-lane forms the translator refuses, 1 needs Developer Mode.Lib tests only; no title run.
AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted).
Imported from ivall/xcl. Originally posted by thiagocalile on 2026-11-26T20:10:15Z.
Independent test and smoke report for head
bb2165b96310d6581c2144c7f6e1e95f682c6b53on an AMD Radeon RX 6600 (8 GB VRAM, RDNA2, native wave64).Tested
32.0.21045.29003,XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Rust1.100.0(stable-x86_64-pc-windows-msvc), DXC1.8.2502.11.XCL_ADAPTER=radeon XCL_DIRECT_DXIL=0 cargo test --no-fail-fast -p xcl --lib -- cfg --test-threads=1: 17 passed, 0 failed, 0 ignored (0skipped).XCL_ADAPTER=radeon XCL_DIRECT_DXIL=1 cargo test --no-fail-fast -p xcl --lib -- cfg --test-threads=1: 17 passed, 0 failed, 0 ignored (0skipped).Not tested: full workspace suite, 60 s smoke run on this head, NVIDIA/Intel GPUs, or Linux/Wine.
AI use: Antigravity (Gemini 4 Neon) ran the builds, tests, and smoke runs and drafted this report; the account owner reviewed and approved posting.
Imported from ivall/xcl. Originally posted by voiceovarian1-max on 2026-11-27T11:14:17Z.
Linux data point for the third commit (keep empty blocks on back edges), from a retail title under Wine. Not a run of this PR's head: we made the same change on our own tree before seeing this PR (a trampoline whose target does not come later in the block layout is kept, as
pos[t] <= pos[b]here; e971fd44 on our fork).What it fixes under Wine: vkd3d-proton converts DXIL with dxil-spirv. With the latch block removed, dxil-spirv recursed until its stack overflowed (first in
LoopMergeTracer::trace_from_parent; with that patched, inCFGNode::find_common_post_dominator). The PSO threads died and their pipelines were never built (e.g. record8d7d6dd1b8e830ed).Measured
Setup: RTX 4070 Ti 12 GB, NVIDIA 620.73.04, Linux 7.3, Proton Experimental (Wine 11.0), vkd3d-proton 3.1 (with a local dxil-spirv patch for an unrelated bug),
XCL_DIRECT_DXIL=1.Written with Claude Code (Claude Opus 5.5) from our run records.
Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-27T22:41:28Z.
merge-check
base: 2c717a04
head: bb2165b9
merge: Clean trial merge into this
mainwithgit merge --no-commit --no-ff.build:
cargo build --workspace --lockedpassed.tests: On the unmodified trial merge,
cargo test --workspace --locked --no-fail-fast -- --test-threads=4: 1,469 passed, 1 failed, 47 ignored; 25 GPU skip notices. The lone failure,console_mesh_caches_hlsl_compute_pass_in_memory_and_on_disk, also fails on cleanmainon this machine. The PR's direct-DXIL loop GPU test passed. A test-only extension ofsimplify_cfg_keeps_an_empty_block_on_a_back_edgefailed in isolation on this merge: 0 passed, 1 failed (two incoming back edges, expected one).review: A forward empty loop header can be bypassed and recreate the duplicate back edge that this PR removes. In the existing optimizer test, remove the
sinkcall fromouterso it contains onlyBr(inner).simplify_cfgseesouter → inneras forward and redirectslatch → outertolatch → inner;body → inneris already present. The optimized graph has two back-edge predecessors forinner. The current test checks only thatbodycan still reachlatch, so it passes despite that result. A narrow guard that retains an empty block when a later block branches back to it made the regression pass. All six focusedsimplify_cfgtests passed with the guard. With the test and guard applied locally, the full workspace suite again recorded 1,469 passed, 1 failed, 47 ignored; 25 GPU skip notices, with the same baseline-only failure. The candidate diff is below for the author to adapt.performance: The new
single_latchscan runs at shader translation time; I did not measure its latency. The proposed guard can retain an extra empty block in a loop; it is not a per-frame runtime operation.verdict: not yet: preserve the single-back-edge invariant through
simplify_cfgand add the regression.hardware / tool and model: Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti 12 GB / NVIDIA 621.35, rustc 1.99.1 MSVC, DXC 1.8.2502.11. OpenAI Codex (GPT-6.2 Sol) ran the build and tests, checked the CFG, and wrote this report; Codex (GPT-6.2 Astra) independently traced the optimizer path.
Focused negative control:
cargo test -p xcl --lib simplify_cfg_keeps_an_empty_block_on_a_back_edge --locked -- --nocapture --test-threads=1(test-only edit, exact merged code) failed withleft: 2, right: 1. The same command passed 1/1 after the candidate guard. Linuxdxil-spirvconversion and a title run were not performed in this check.Candidate guard and regression diff (local, uncommitted)
Imported from ivall/xcl. Originally posted by throny on 2026-11-27T23:13:14Z.
merge-check claim
head:
bb2165b963Imported from ivall/xcl. Originally posted by throny on 2026-11-27T23:27:22Z.
merge-check
base:
2c717a04head:
bb2165b963merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 1470 passed, 0 failed, 47 ignored (26 SKIPPED lines); base alone: 1466 passed, 0 failed, 47 ignored (26 SKIPPED lines)
review: none blocking. The latch insertion is correct (a block with back edges to two loop heads gets one latch per head; the layout positions are never indexed with a new latch), and the three tests fail without the change by reading the code. Minor: a latch takes its head's pc, which can change the compact plan's table size only. For whoever merges: #1768 deletes block_layout() and successors(), which this PR's simplify_cfg and its new test use, so the two must be ordered (and #1768 does not build on main today, see my check there); #2557 and #2568 append tests at the same place in opt.rs (trivial textual conflict).
performance: direct-DXIL output is re-translated once; that path runs by default only for the very large compute programs or with XCL_DIRECT_DXIL. The PR's own size figure (about 21 KB more DXIL in 879 MB) was not re-measured here.
verdict: safe to merge
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-28T04:18:12Z.
Rebased onto
maine429936c: the head is now1567f72f(the same three commits).main'ssucc_ofreturnsSuccs, sosingle_latchand its test read.as_slice().contains(..), and the pass runs right aftermain'smake_reducible;simplify_cfg_keeps_an_empty_block_on_a_back_edgesits inopt.rs'smod testsahead of the modulesmainadded after it. Nothing else changed.cargo test -p xcl --lib -- dxil::cfg dxil::module::opt --test-threads=4under Wine 11.21 (Linux, no GPU, Rust 1.98.0, release): 18 passed, 0 failed, includingtwo_back_edges_share_a_latch,a_block_keeps_one_back_edgeandsimplify_cfg_keeps_an_empty_block_on_a_back_edge. Not run on this head: the whole suite, the GPU test, Windows,scripts/smoke.ps1.AI use: Claude Code (Claude Opus 5.5) did the rebase, ran the tests and wrote this comment.
Imported from ivall/xcl. Originally posted by throny on 2026-11-28T17:47:37Z.
merge-check claim
head:
1567f72f66Re-check of the new head (my earlier check was on the head before the rebase).
Imported from ivall/xcl. Originally posted by throny on 2026-11-28T18:03:57Z.
merge-check
base:
10d27297head:
1567f72f66merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2156 passed, 0 failed, 48 ignored (26 SKIPPED lines). Base alone at
10d27297: 2152 passed, 0 failed, 48 ignored. The merge result builds here although the PR's own CI is red: its base still has the bench error that #3102 fixed on main.review: re-check of the new head. Compared with the head I checked before, the logic is unchanged; the real edits only follow main (the successor list's new type, the latch block's pc field, the test's place in the file). Three things keep it from "safe" today. (1) The required description check fails: there is no xcl-smoke block for this head. (2) The earlier "not yet" in the thread is unanswered: an empty forward outer header can still be bypassed and bring back two back edges; an edge case, not a regression against main, and not reproduced by me. (3) New since the PR's base: #1809 routes compute programs with a direct container of 64 KiB or more through the direct translator by default, so after the merge this change reaches those programs without XCL_DIRECT_DXIL, and no run of this head covers that.
performance: none expected. It changes direct-DXIL sources: direct cache entries are translated again once (for XCL_DIRECT_DXIL users and for the large programs routed there by default).
verdict: not yet: add the smoke blocks for this head (rebased onto current main, which also turns CI green) and answer the open review point; the code reads as safe.
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300, Rust 1.100.0, debug. Claude Code; merge, build and suite run by Claude Fable 5.2, diff review by Claude Opus 5.5 (every hunk read; nothing run on the GPU beyond the suite).
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:01:12Z.
Triage (#1607) – head
f404cfe#1844 (merged) and #1852 address #1805 differently: they make
Ssa::read(and in #1852 alsocompute_deps/is_const_global_ptr) non-recursive inside XCL. This PR instead gives each loop head and each block at most one back edge (cfg.rs: single_latch) and stopssimplify_cfgfrom folding the empty latch back (opt.rs), which is what dxil-spirv needs; neither of the others does that.No problems found in the diff. The red check is the PR description check, not the build.
Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by throny on 2026-12-02T04:13:28Z.
merge-check claim
head:
f404cfe998Imported from ivall/xcl. Originally posted by throny on 2026-12-02T04:50:22Z.
merge-check
base:
1c8b55147(main)head:
f404cfe998merge: clean trial merge into main
1c8b55147(merge_trial_suite.sh 1860).build:
cargo build --workspacepassed.tests:
cargo test --workspace --no-fail-fast -- --test-threads=4on the merged tree: 2913 passed, 0 failed, 51 ignored; 25 SKIPPED notices (no wave64, no heap windows, driver cache); 0 binaries ended abnormally.latch_blocks_preserve_loop_registers_on_the_gpu(wave32 and split wave64 against the HLSL path) passed on this card, with the twocfgtests andsimplify_cfg_keeps_an_empty_block_on_a_back_edge.review: diff read (3 files, +197/-2). Earlier "not yet" points: (1) the missing smoke block: now in the description for this head; (2) the empty forward outer header that
simplify_cfgcould bypass: the head now haspos[t] <= pos[b]inopt.rs, which refuses folding an empty block onto an earlier one, the guard that report proposed. I did not re-run that report's empty-outer fixture, and the PR's own test still has asinkcall inouter, so the exact case is not in the PR's tests (an optional companion test is in another contributor's comment); (3) #1809 routes large compute programs through the direct translator by default, so this change reaches them withoutXCL_DIRECT_DXIL: covered here by the smoke run and the GPU test only; no AMD GPU run of the latch blocks. The code reads as safe.performance: regression run in the description (same title, 60 s): main 1620 frames, this head 1639, 0 device removals, peak commit 15476 vs 15671 MB. Translation-time cost of
single_latchnot measured. An outside run (RTX 3080 Ti, Wine, in the thread) reports 21 of 21 pipelines made without dxil-spirv stack overflows with this change, 0 of 21 without.verdict: safe to merge; a test for the empty-outer-header case and an AMD GPU run are left to the author as follow-ups, not blockers.
hardware / tool and model: RTX 4080 16 GB (621.40), i9-12900K, Windows 11 26300; Claude Code, Claude Sonnet 5.5 ran the build and the suite and read the diff; Claude Opus 5.5 checked this report
Imported from ivall/xcl. Originally posted by Decodere on 2026-12-02T08:21:32Z.
merge-check
base:
1c8b551475head:
f404cfe998merge: clean trial merge into
1c8b551475e1e7bfe48f94448492a4c3544a2e0f(trial-merge commit0f3be6fd6212927721801b324536ff5e133e13e2;git diff --checkclean).build:
cargo build --workspace-> ok;cargo build --release -p xcl-> ok.tests:
cargo test --workspace --no-fail-fast -- --test-threads=4 --nocapture(43 targets) -> 2913 passed, 0 failed, 51 ignored (+4 new tests vsmain1c8b5514; all 43 targets green includinggpu_two_pass_cache_e2e). All 4 new tests passed with 0 skips on RTX 4060:gpu::dxil::cfg::tests::a_block_keeps_one_back_edge,gpu::dxil::cfg::tests::two_back_edges_share_a_latch,gpu::dxil::core_tests::latch_blocks_preserve_loop_registers_on_the_gpu,gpu::dxil::module::opt::tests::simplify_cfg_keeps_an_empty_block_on_a_back_edge. 28SKIPPEDlines — all hardware/environment-expected on RTX 4060 (22no wave64, 2no d3d12SDKLayers.dll, 1no D3D12 debug layer, 2no heap windows, 1cannot disable the driver cache (Windows Developer Mode required)).review: read the full merged diff (3 files:
crates/xcl/src/gpu/dxil/cfg.rs,crates/xcl/src/gpu/dxil/core_tests.rs,crates/xcl/src/gpu/dxil/module/opt.rs, +197/-2). Scope is tight and clean:single_latchguarantees every loop header and every block has at most one back edge before SSA construction/lowering, andsimplify_cfgpreserves empty blocks whose outgoing branch is a back edge (pos[t] <= pos[b]atopt.rs:1718) so newly inserted latches are not collapsed back onto their predecessors. Minor non-blocking note:pos[t] <= pos[b]protects back-edge latches rather than a hypothetical empty forward block whose incoming edge is a back edge, which is not a regression vsmain. No UB, sync, or correctness issues found.performance: Tier 3 60 s retail smoke (
title: 29640639) shows no regression vsmain1c8b5514baseline (1462frames,presents per 2 s (last 3): 48 53 59,peak commit: 16043 MB):1623frames (+11.0%),presents per 2 s (last 3): 60 60 61,peak commit: 14764 MB(-8.0%), 0 device removals, 0 crashes.verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)
Imported from ivall/xcl. Originally posted by cj-tomlin on 2026-12-02T21:31:32Z.
merge-check
base:
5ad98adbc3head:
f404cfe998merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3008 passed, 2 failed, 52 ignored; SKIPPED: 27 (22 no wave64, 2 no heap windows, 3 no D3D12 debug layer / d3d12SDKLayers.dll); failing:
two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs(the 2 failures are this one test and the child process it runs; "releasing the title PSOs releases their two-pass state", left 1, right 0). It fails on the base5ad98adbtoo, 3 of 3 runs alone, and 5 of 5 alone on the merge; same assertion as #3441, here on NVIDIA.title run: did not reach the world, so this is not a title run for
needs:title-run: a retail title on the RTX 3080, 120 s,XCL_PRESS_AT=25:A, no save: boot video, load, then into the first in-engine intro cutscene, where presents stop at ~93 s on the base and the merge alike (the render thread waits on pipelines still being built; the stall happens on main without this PR too). Merge: 1825 frames, 0 device removals, 0 crashes, peak commit 33883 MB; base: 1782 frames, 0, 0, 34214 MB. Seconds rendered inside the cutscene before the stall: a few at most, so this says little about the world itself.review: none blocking. Read the whole diff (+197/-2 in
gpu/dxil/cfg.rs,gpu/dxil/module/opt.rs,gpu/dxil/core_tests.rs).single_latchreroutes every back edge of a head with two or more, or from a block with two, through a new empty block with the head'spc;orderis recomputed after it, andpredsare only built afterwards. The empty block has no instructions, so the compact path's per-blockpctable only gets a duplicate value, which nothing looks up by.simplify_cfgno longer merges a block into an earlier-placed target, which keeps the latch. Mutation check: with thesingle_latchcall removed,latch_blocks_preserve_loop_registers_on_the_gpufails ("two returns", left 0, right 1); with thepos[t] <= pos[b]guard removed,simplify_cfg_keeps_an_empty_block_on_a_back_edgefails. The PR's four new tests pass on the merge. Not covered: the empty-outer-header case throny noted, AMD, and Wine (vkd3d-proton's dxil-spirv, the reason for the change).performance: one extra jump per iteration for loops with several back edges; changed DXIL makes the affected shaders miss the cache once. Measured: 1825 vs 1782 frames in 120 s and 33883 vs 34214 MB peak commit (merge vs base), within run-to-run noise.
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 3080 10 GB (driver 621.40), AMD Ryzen 7 7800X3D, Windows 11 build 26300, rustc 1.100.0, debug suite / release title runs / Claude Code (Claude Opus 5.5) merged, built, ran the tests and the title runs and drafted this; I checked it.
Imported from ivall/xcl. Originally posted by tiagonleal on 2026-12-02T21:42:25Z.
merge-check
base:
5ad98adbc3head:
f404cfe998merge: clean (merge commit 93908110748407b5e5bfed7d9151fdd473502a6f;
git diff --checkclean)build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 3009 passed, 0 failed, 52 ignored; SKIPPED: 24 (22 no wave64, 2 no heap windows); failing: none
title run: Newer Retail Game, release build of this merge, Series S settings (
XCL_DEVICE_TYPE=lockhart,XCL_COHERENT_MB=512,XCL_UMA_WINDOWS=16,XCL_SPARSE_LAZY=1), scripted A presses, 240 s planned: into the world at 86 s, 153 s there with no frame presented (as in main's first run), no crash, no device removal; ran to the 240 s limit.review: none. One empty latch block per loop with several back edges.
performance: negligible (one empty block per affected loop). World frame rate not compared: on this 32 GB PC the runs of main and of the PRs end 30 to 150 s into the world (RAM guard or time limit).
verdict: safe to merge
hardware / tool and model: RTX 5070 Ti 16 GB (driver 617.42), Ryzen 7 9800X3D, 32 GB, Windows 11 Pro 26300 / Claude Code with Claude Opus 5.5
Same settings on main
5ad98adb, two runs: into the world at 94 s with 145 s there and no frame presented (ran to the 240 s limit); into the world at 80 s with 59 s there and 90 frames, then stopped by our RAM guard (free RAM under 1 GB). "In the world" here means the first 2 s window of the activity log with 5,000+ draws and dispatches.AI use: Claude Code (Claude Opus 5.5) ran the build, tests and title runs and wrote this; a Claude Sonnet subagent read the diff and I checked its points.
~Tiago
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.