Tests: pin direct DXIL bitstream, compact, and lowering invariants #2345
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2355"
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 safesearch77 on 2026-11-25T16:27:54Z.
Add six pure-CPU unit tests across existing Direct DXIL
*_tests.rsmodules (bitreader_tests.rs,compact_tests.rs,robustness_tests.rs, reusinggraphics_tests::part) pinning bitstream serialisation, compact block-class planning and auto-nesting, split-Wave64 whole-live exchange elision, 64-bit integer compare lowering, and POPS ROV flag inference.No runtime files are modified (
*_tests.rsonly), and every test runs purely in memory without requiring a GPU ordxcompiler.dll.What is in it
crates/xcl/src/gpu/dxil/bitreader_tests.rs:phis_encode_signed_relative_ids_and_prune_unreachable_predecessors: verifiesFUNC_CODE_INST_PHIsigned-VBR forward (-1 -> 3) and backward (+1 -> 2) relative value IDs across loop back-edges, and verifies unreachable predecessor blocks and their incoming phi edges are omitted fromFUNC_CODE_DECLAREBLOCKSandFUNC_CODE_INST_PHI.alloca_explicit_type_bit_and_unused_symbol_elision: verifiesFUNC_CODE_INST_ALLOCAsets the LLVM 3.7 explicit-type bit (1 << 6) alongsidelog2(align) + 1with distinct pointee types (i32vsi64), and verifies unreferenced globals and unreferenced externaldx.opdeclarations are elided fromMODULE_CODE_GLOBALVAR,MODULE_CODE_FUNCTION, andBLOCK_VALUE_SYMTAB.crates/xcl/src/gpu/dxil/compact_tests.rs:plan_splits_getpc_static_samplers_and_loop_headers: verifiescompact::plansplits byte-identical blocks whens_getpc_b64sits at distinct PCs, whenstatic_samplersbinds distinct constantS#words (while merging matchingS#words), or when only one copy is a natural loop header spendingVAR_BUDGET, plus checks packedPlan::words().auto_nest_threshold_switches_at_512_classes_in_emitted_ir: verifiescompact::emit_with_nest(..., Nest::Auto)emits a single flat switch at511classes (AUTO_NEST_MIN_CLASSES - 1) and transitions at512classes (AUTO_NEST_MIN_CLASSES) to two-level dispatch (1outer switch +16inner switches of32targets).crates/xcl/src/gpu/dxil/robustness_tests.rs&crates/xcl/src/gpu/dxil/graphics_tests.rs:graphics::tests::parttopub(in crate::gpu::dxil)sorobustness_testsreuses it without duplicating container parsing.split_wave64_whole_live_elides_exchange_barriers_for_lane_local_masks: verifies split-Wave64 compute lowering keeps only thexcl_wtwave counter (1addrspace-3 global,4TGSM bytes,1barrier) whenVCCis read per-lane (v_cndmask_b32), while allocatingxcl_x64_s(2addrspace-3 globals,12TGSM bytes,3barriers) whenVCCis read as a scalar SGPR (s_mov_b32), and verifies 64-bit integer compares (v_cmp_lt_i64) do not setD3D_SHADER_REQUIRES_INT64_OPS(0x8000) inSFI0.pops_pixel_shader_gates_rov_sfi0_flag_on_surviving_uav_handles: verifies pixel-shaderD3D_SHADER_REQUIRES_ROVS(0x1000inSFI0) underHEAP_WINDOWSis set iff POPS (src_pops_exiting_wave_id) is used and anIsROVheap UAVannotateHandlesurvives dead-code elimination.Tested
rustc --edition 2021 --testharness overgpu::dxilon commitb2da28c, base0829441):34 passed; 0 failed(bitreader_tests:6 passed,compact_tests:10 passed,robustness_tests:10 passed,graphics::tests:8 passed).cargo check --offline --target x86_64-pc-windows-gnu --workspace --tests(0errors,0new warnings).python3 scripts/pr_check.py --local(description ok,*_tests.rs-only diff).Not tested
cargo test --workspace -- --test-threads=4GPU suite (authored and executed on a Linux CPU host without a D3D12 GPU ordxcompiler.dll; all 6 added tests are pure-CPU unit tests that run on the standard no-GPU Windows CI runner).*_tests.rschange; no runtime code modified).AI use
cargo check --workspace --testsandscripts/pr_check.py --local.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T18:37:31Z.
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 SlopTart on 2026-11-25T19:05:59Z.
Tested: current PR head merged onto current
origin/main(clean), 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).gpu_suite, cold cache: 143 passed / 4 failed. The fourth failure besides the baseline trio isgpu_geometry_wave32_prefix_count_over_a_mask, which passes 3/3 solo at--test-threads=1on this tree and passes in-suite on other trees; order-dependent flake family, not attributable to this PR. The tests this PR pins all ran inside the suite and passed.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.
upstream-sync referenced this pull request2026-11-25 20:06:50 +00:00
upstream-sync referenced this pull request2026-11-25 20:06:52 +00:00
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:39:19Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:54:28Z.
Triage (#1607) – head
b2da28cNo open or merged PR adds these tests. The diff only adds tests, plus a widened visibility on
graphics_tests::part. The APIs it calls (Module::phi/add_incoming,compact::emit_with_nest,AUTO_NEST_MIN_CLASSES,kernel::compute_init,try_finish_graphics) exist on main.Some assertions pin exact implementation counts, which will need updating whenever the lowering changes. Examples: 1 TGSM global / 4 bytes / 1 barrier for the split-wave64 setup in
robustness_tests.rs, and the exact alloca and phi record layouts inbitreader_tests.rs.split_wave64_whole_live_elides_exchange_barriers_for_lane_local_masksprints its ownSKIPPEDline whenXCL_X64_ALL_MASKSis set.The PR conflicts with main in
compact_tests.rs(appended tests).Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.