GPU: fail closed on unresolved control flow and errored FSSMs in effects #2352
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!2352
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2352/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?
@Decodere on GitHub · 2026-11-25 16:19 UTC · original
Decodere:fix-2176-effects-fail-closed→main· +108 −5 · 1 files · 1 commits · merged 2026-11-25 18:17 UTCPart of #2088
Part of #1452
Follow-up to #2176 (
crates/xcl/src/gpu/effects.rs).gpu::effects::big_and_image_onlyallowshle::d3d12x::pso_asyncto skip waiting on a big compute pipeline while the driver compiles it only wheneffects::ofproves the shader writes nothing outside images. This PR closes three fail-open gaps ineffects::ofandeffects::compute_codeso unrecognized or incomplete control flow and errored FSSM containers never misclassify a memory-writing compute shader as image-only.What is in it
gpu::effects::of(crates/xcl/src/gpu/effects.rs): decode intoVec<Decoded>, track anyrdna2::F_TERMINATOR(S_ENDPGM,S_ENDPGM_SAVED,S_ENDPGM_ORDERED_PS_DONE), stop on trailing decode errors orS_CODE_ENDpadding only after a terminator, require both a decoded terminator and a non-fallthrough tail (F_TERMINATOR,S_BRANCH, or resolvedfar_target), runrdna2::resolve_far_jumps(&mut insts), and returnNoneif anyF_BRANCH | F_INDIRECTinstruction lacks a resolvedrdna2::branch_targetpointing to a decoded instruction PC.gpu::effects::compute_code(crates/xcl/src/gpu/effects.rs): fail closed (None) when the matched hardware-CS (hw == 6) FSSM hasf.error.is_some()(e.g. XBCHrsizemismatch wherexbox::parse_xbchstill callsanalyze_fssmand populatesf.programs).gpu::effects::tests(crates/xcl/src/gpu/effects.rs): 3 pure-CPU unit tests covering early-S_ENDPGMundecodable-gap branch targets, tail fallthrough into undecoded bytes, missing terminators,S_ENDPGM_SAVED+ trailing data, unresolvedS_SETPC_B64/S_SWAPPC_B64, out-of-rangeS_BRANCH/S_CALL_B64, valid and out-of-range resolved far jumps with trailingS_CODE_ENDpadding, and XBCHrsize-errored FSSMs inbig_and_image_only.Tested
rustc 1.100.0, DXC1.9.2609.5, release profile (--release).cargo test --release -p xcl --lib gpu::effects::tests:: -- --nocapture: 4 passed, 3 failed (all 3 new tests failed onorigin/main).cargo test --release -p xcl --lib gpu::effects::tests:: -- --nocapture: 7 passed, 0 failed, 0 ignored (0.01 s).cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture: 1275 passed, 0 failed, 46 ignored across 23 test binaries (28 pre-existingSKIPPEDlines: 21 no wave64 on RTX 4060, 3 per-lane wave32 refused, 2 no D3D12 debug layer, 1 no heap windows, 1 cannot disable driver cache; 0 skipped ingpu::effects::tests).Regression run
main:
PR:
Not tested
gpu::effectsis pure-CPU static RDNA2/FSSM analysis).title: 29640639or wild XBCH containers with mismatchedrsizeheaders (covered synthetically viaxbox::tests::sample/xbox::tests::fssm).AI use
gpu/effects.rs,gpu/rdna2.rs, andgpu/xbox.rs, wrote the fail-closed logic and failing-first unit tests, and ran the workspace and paired smoke tests.@SlopTart on GitHub · 2026-11-25 16:49 UTC · original
Tested: current PR head merged onto current
origin/main(clean,440e8021), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo targetx86_64-pc-windows-gnurun under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).No Linux/Wine report in the thread yet; adding one.
radv/amdgpu: The CS has been rejected (-14),D3D12 device removed: 0x887a0005) before any test verdict. dmesg shows nothing beyond the usual amdgpu fini chatter, no ring faults. Clean rerun immediately after, so disclosed as a rig event, not a result.gpu_suite (rerun): 144 passed / 3 failed / 1 ignored, exactly this rig's known baseline (fuzz seed 1003 of #2115,gpu_nonfused_mad_and_mac_prevent_fma_contraction,gpu_depth_buffer_created_for_unordered_access_is_placed). No delta from the PR.gpu_filter), targeted in one run:branch_past_early_end_gap_and_fallthrough_say_nothing,errored_fssm_is_rejected_by_big_and_image_only,unresolved_indirect_and_oob_branches_fail_closed_while_far_jump_passes:3 passed; 0 failed.Not tested: retail titles (no title data on this lane, counts only).
AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
@DavidM1911 on GitHub · 2026-11-25 18:37 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!
@SashaTun on GitHub · 2026-11-25 18:33 UTC · original · edited 2026-11-25 18:43 UTC
Test report on an NVIDIA card (Windows, retail title).
Tested
Commit:
440e80211d54443756b8aade8111517db50f7475(fix-2176-effects-fail-closed), clean checkout of the PR head, no uncommitted changes.Hardware: NVIDIA GeForce RTX 5060 (8 GB), driver
32.0.16.2101; 31.9 GB RAM; Windows 11 build 26200 x64.Toolchain: Rust
1.100.0(stable-x86_64-pc-windows-msvc); DXC 1.9 (Windows SDK10.0.26100.0); release profile; noXCL_SAMPLE_*variables.Command:
cargo test --release --workspace --no-fail-fast -- --test-threads=4→ 1271 passed, 4 failed, 46 ignored; 28
SKIPPEDlines (21 of themno wave64— this card runs 32-wide waves only).The 4 failures are
gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_{0,1,2,3}, all with the same error:CreateComputePipelineState: 0x8007000E(out of memory) — the 8 GB VRAM wall. The same 4 failures occur onmain68a284aon this card, so they are not from this PR.Regression run on a retail title (
scripts/smoke.ps1, 60 s, same title, same duration, same card, both runs from a clean data directory):The PR's run shows no device removal and no crash, 973 frames against
main's 912 (≥ 80 %) and a peak commit of 14 728 MB againstmain's 15 022 MB (≤ 125 %). A second run of the same head commit gave 989 frames and a peak commit of 14 553 MB, the same shape.Not tested
main, so the tree tested here is the branch head as it stands.mainhas one further failure on this card that this branch does not contain:gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier, a test added after the branch point. It is not card-specific -main's own CI fails on it too - and I am reporting it separately.main, 30 fps on the PR head). That is not attributed to this PR — it only changes the effects decoder, and the branch is older thanmain— but I could not measure the world load, so I cannot say where the difference comes from.AI use
MiniMax Code (MiniMax-M3.1-Flash) built the commits, ran the test suite and the smoke runs, and wrote this report from the real output.