Recompiler: close four mask-taint soundness holes in mesh_wave::transfer #2147
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!2147
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2147"
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 06:16 UTC · original
Decodere:fix-336-mesh-wave-taint→main· +231 −11 · 1 files · 1 commits · openWhat is in it
Closes four mask-taint soundness holes in
mesh_wave::transfer()(crates/xcl/src/gpu/recomp/mesh_wave.rs, called byrecomp::geometry_wave32_hazards()):writes_lane_mask): TreatsV_ADD_CO_U32,V_ADD_CO_CI_U32,V_SUB_CO_U32,V_SUB_CO_CI_U32,V_SUBREV_CO_U32,V_SUBREV_CO_CI_U32,V_DIV_SCALE_F32,V_DIV_SCALE_F64,V_MAD_U64_U32, andV_MAD_I64_I32as lane-mask writers alongsideV_CMP*,SAVEEXEC, andWREXEC(leaving 32-bit lane readers likeV_READFIRSTLANE_B32/V_READLANE_B32excluded).reads_scc,keeps_destination): Propagatesstate.scctaint through SCC-reading SALU instructions (S_CSELECT_B32/B64,S_CMOV*,S_ADDC_U32,S_SUBB_U32), and for destination-preserving scalar ops (S_CMOV*,S_ADDK_I32,S_MULK_I32,S_BITSET0_B32/B64,S_BITSET1_B32/B64) folds any existing taint onwritesintoreads_maskand skips clearingwrites.reads_special_mask): Scans non-implicit scalar input operands forSRC_VCCZ(251),SRC_EXECZ(252), and taintedSRC_SCC(253) (skippingSRC0on non-plain SDWA/DPP encodings) so mask checks via special inline codes are not dropped.S_MOVREL*scalar moves: HandlesS_MOVRELS_B32/B64(definite overwrite ofSDSTwithM0orsrc..124taint),S_MOVRELD_B32/B64(never clearsSDST; taintsdst..124if source orM0is tainted), andS_MOVRELSD_2_B32(never clearsSDST; taintsdst..124ifM0orsrc..124is tainted), matchingemit.rsandx64_masks.rs.gpu::recomp::mesh_wave::testscovering all 4 holes (plus negative controls andgeometry_wave32_hazardschecks).Part of #336
Tested
Environment: Windows 11 Home 26200, Intel Core i5-11400F, 32 GB RAM, NVIDIA GeForce RTX 4060 8 GB (driver 621.14, wave32), Rust 1.100.0, DXC
1.9.2609.5(01b62ad4).cargo test -j 4 -p xcl --lib gpu::recomp::mesh_wave::tests -- --nocapture): 13 passed, 4 failed — all 4 new tests (valu_carry_and_div_scale_sdst_outputs_are_masks,scc_reading_and_rmw_scalar_ops_preserve_mask_taint,special_mask_sources_vccz_execz_and_scc_are_tainted,movrel_preserves_dst_and_tracks_indirect_sgpr_ranges) returned emptymask_scc_branchespre-fix.cargo test --release -p xcl --lib gpu::recomp::mesh_wave::tests -- --nocapture): 17 passed, 0 failed (pure CPU unit tests, CI WARP-safe).cargo build --release --workspaceandcargo test --release --workspace -- --test-threads=4 --nocapture): 1,158 passed, 0 failed, 46 ignored across 21 test binaries (1102inxcllib,56across the remaining 20 binaries), with 27SKIPPEDlines on this RTX 4060:no wave64(RTX 4060 is wave32-only)per-lane form: refused(wave32 f16 arithmetic, f16 packed, f32 conversions)no d3d12SDKLayers.dll/no D3D12 debug layercannot disable the driver cache(Windows Developer Mode not enabled)no heap windowsRegression run
Paired 60 s runs via
scripts/smoke.ps1on cleanorigin/main(6e1e2bef) and clean PR head (a614d310):Main (
6e1e2befc7430126b1e7b98b5c3fe93813c866b6):PR (
a614d310d5fdfe14df504f63d0a9ab7e04008913):Not tested
no wave64skips on RTX 4060), D3D12 debug layer tests (2 skips withoutd3d12SDKLayers.dll), driver cache disable toggle (1 skip without Windows Developer Mode), and heap-window OOM fallback (1 skip withoutXCL_HEAP_WINDOWS).title: 29640639, andmesh_wave::analyzeis a static analysis pass (used for hazard diagnostics, not runtime code generation).AI use
Google Antigravity (Gemini 4 Neon) wrote the
mesh_wave::transfer()fixes, unit tests, and this PR description. All pre-fix/post-fix unit tests, full release workspace tests, paired 60 s smoke runs, andscripts/pr_check.py --localvalidation were run locally on this machine.@DavidM1911 on GitHub · 2026-11-25 06:49 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!
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.