Skip to content

Tests: cover upper_lanes hazards, CFG jumps, VALU ops, and MIMG DMASK - #1518

Open
amazedturnip wants to merge 1 commit into
xcl-dev:mainfrom
amazedturnip:xcl/tests-recomp-upper-lanes-hazards-cfg-and-dmask-c-165734
Open

amazedturnip wants to merge 1 commit into
xcl-dev:mainfrom
amazedturnip:xcl/tests-recomp-upper-lanes-hazards-cfg-and-dmask-c-165734

Conversation

@amazedturnip

Copy link
Copy Markdown
Contributor

Add an integration test suite (crates/xcl/tests/upper_lanes_contract.rs) covering previously untested public APIs (UpperLanes::hazards, UpperLanes::resolved, upper_lanes::slot) and analysis paths in crates/xcl/src/gpu/recomp/upper_lanes.rs. The 5 tests verify DS_PERMUTE_B32 vs DS_BPERMUTE_B32, indirect jumps vs fetch-shader S_SWAPPC_B64 and resolved far_target jumps, binary VALU ops with absorbing constants and VOP3 modifier bailouts, DPP16 partial ROW_MASK/BANK_MASK, S_MOVRELD_B32, SGPR-lane V_WRITELANE_B32, MIMG DMASK/D16/TFE truncation, and empty/unreachable code.

What is in it

  • crates/xcl/tests/upper_lanes_contract.rs: add 5 integration tests covering upper_lanes::slot, UpperLanes::hazards / UpperLanes::resolved and DS_PERMUTE_B32 vs DS_BPERMUTE_B32, indirect jumps vs fetch-shader S_SWAPPC_B64 and resolved far_target jumps, binary VALU ops / absorbing constants / VOP3 modifier bailout / DPP16 partial ROW_MASK and BANK_MASK, and S_MOVRELD_B32 / SGPR-lane V_WRITELANE_B32 / MIMG DMASK/D16/TFE truncation / empty and unreachable code.

Tested

  • Hardware / OS / Rust: AMD Ryzen 7 9800X3D 8-Core Processor, Windows 11 Pro 10.0.26100 (Build 26100), rustc 1.94.1 (e408947bf 2026-03-25), stable-x86_64-pc-windows-msvc, debug build
  • AMD (AMD Radeon(TM) Graphics (driver 32.0.21043.19003, DXC 1.9.2609, native wave64), XCL_ADAPTER=radeon): cargo test --workspace -- --test-threads=2 — 775 passed, 0 failed, 41 ignored (SKIPPED GPU tests: none)
  • Verification / negative control: new test suite — verified 3x deterministic

Not tested

  • retail Xbox Series X|S title (not available on this host)
  • non-Windows hosts (Windows x64 crate only)
  • NVIDIA wave32 GPU (not run in this pass; verified on AMD Radeon native wave64)

AI use

  • Antigravity CLI (Gemini 4 Hydrogen (Medium)) assisted with diagnosis, implementation, tests, review, and description; all tests executed locally on AMD Radeon (native wave64).

Add integration tests for upper_lanes::analyze, UpperLanes::hazards, UpperLanes::resolved, and upper_lanes::slot covering constant/SGPR lane slots, hazard and resolution classification, DS_PERMUTE_B32 vs DS_BPERMUTE_B32, indirect vs fetch-shader S_SWAPPC_B64 and resolved far jumps, binary VALU ops with absorbing constants and VOP3 modifier bailouts, DPP16 partial ROW_MASK/BANK_MASK, S_MOVRELD_B32, SGPR-lane V_WRITELANE_B32 invalidation, MIMG DMASK/D16/TFE register-count truncation, and empty/unreachable code.
@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

@ivall ivall added the off-goal Does not bear on the current goal (world loading); waits until it is reached label Nov 24, 2026
@Decodere

Copy link
Copy Markdown
Contributor

Independent desktop NVIDIA verification of PR #1518 at head 6e3795d7090b74de65a7992d2b8e5f00490c3295 (1 commit; exact parent & merge-base: 9e3831e1f570d3646e53ab753b19ec07eb8f1485, pre-#2555 ancestor of main).

Environment

  • GPU: NVIDIA GeForce RTX 4060 (8 GB / 7956 MiB reported by D3D12, Wave32-only Ada), driver 32.0.16.2114 (NVIDIA 621.14, WDDM 3.2)
  • CPU / RAM / OS: Intel Core i5-11400F (6C / 12T), 32 GB RAM (31.9 GiB usable), Windows 11 Home 26200 (Developer Mode off)
  • Toolchain: rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC, DXC 1.9.2609.5, --release

Targeted tests & build (6e3795d7)

Command Result
cargo test --release -p xcl --test upper_lanes_contract -- --nocapture (3 consecutive runs) 5 passed; 0 failed; 0 ignored; 0 filtered out × 3 (0.00s, 0.00s, 0.00s, 0 skipped; slot_extracts_constant_lanes_and_rejects_sgpr_or_other_insts, hazards_and_resolved_classify_all_read_kinds_and_ds_permute, cfg_indirect_jumps_vs_fetch_swappc_and_resolved_far_jump, binary_valu_ops_absorbing_constants_vop3_modifiers_and_dpp16_masks, movreld_sgpr_writelane_mimg_dmask_and_unreachable_code)
cargo build --release -p xcl Clean build (1.33s incremental --test compile + 0.06s incremental --release build, exit 0, 0 new warnings)

Paired quiet 60 s retail smoke (title: 29640639)

(Note: scripts/smoke.ps1 at 9e3831e1 predates 9683e7a6 and printed the local folder basename on title:; replaced below with the standard 9683e7a6 title hash 29640639, with all measured fields verbatim.)

Exact parent & merge-base (9e3831e1f570d3646e53ab753b19ec07eb8f1485):

xcl-smoke v1
commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1549 (PresentX 1549)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14715 MB

PR #1518 (6e3795d7090b74de65a7992d2b8e5f00490c3295):

xcl-smoke v1
commit: 6e3795d7090b74de65a7992d2b8e5f00490c3295
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1568 (PresentX 1568)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14710 MB

Limits of coverage

  • This PR is test-only (crates/xcl/tests/upper_lanes_contract.rs, 0 production-code changes); all 5/5 CPU-side upper_lanes contract tests passed 3/3 (0 skipped).
  • The 60 s retail smoke confirms non-regression of the unchanged runtime binary at this commit (single-run frame/commit delta vs. parent reflects normal startup variance, not this PR).

AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).

@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Triage (#1607) – head 6e3795d

No open or merged PR adds the same tests. Several open PRs change upper_lanes.rs (e.g. #917, #927, #1022, #1616) and may change behaviour these assertions pin; main only changed two helpers to pub(super) since this PR's base, so the API it uses is unchanged.
The tests exercise only public items of gpu::recomp::upper_lanes; CONTRIBUTING puts unit tests in the module's own tests block, which is where this would usually go.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

off-goal Does not bear on the current goal (world loading); waits until it is reached

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants