Skip to content

Test Wave32 spilled lane masks at control-flow joins - #1784

Open
rezioliver-collab wants to merge 1 commit into
Marvisak:mainfrom
talleyrand222:test/wave32-spilled-mask-join-main
Open

rezioliver-collab wants to merge 1 commit into
Marvisak:mainfrom
talleyrand222:test/wave32-spilled-mask-join-main

Conversation

@rezioliver-collab

@rezioliver-collab rezioliver-collab commented Nov 24, 2026 •

Copy link
Copy Markdown

main already tracks a Wave32 lane mask spilled to a VGPR lane and read back. Its unit test checks the restored mask in the structuring pass. This PR adds a Windows D3D12 regression for what happens when a uniform branch chooses between that restored mask and a different mask computed on the other path. Existing spill-tracking test on main

The synthetic shader dispatches one 64-thread group spanning two Wave32 waves. The restored mask selects thread IDs below 40. The direct mask selects IDs below 24. Each selected thread writes 5 and every other thread writes 1 to its own slot in a zeroed buffer, so the readback catches a wrong mask or a missing store.

Verification

  • After the rebase onto 940d32f, the Windows SDK DXIL validator (1.8.2502.11) accepted the shader. An RTX 5080 returned all 64 expected values for each selector. The local WARP adapter reported no Wave32 support and skipped dispatch.
  • In a separate checkout, disabling the restored-mask lookup made this test fail during lowering with a lane-mask join of an untracked mask, the same error seen on ffe310e before spill tracking landed.
  • Both workspace Clippy configurations and the asset-policy check passed locally. GitHub CI passed on the rebased commit. CI run
Full local Windows workspace tests

The unmodified main run had 696 passing tests, 5 failures and 10 ignored tests. The rebased branch had 697 passing tests, the same 5 failures and 10 ignored tests. The added pass was wave32_spilled_mask_at_join.

  • descriptor::host::tests::dynamic_slots_are_held_until_released
  • emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride
  • emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros
  • emit::synthetic_tests::gathers_at_a_level_match_the_hardware
  • memory::tests::lists_share_a_table_and_copies_keep_their_views

AI-assisted with OpenAI Codex.

@DesertGamer

Copy link
Copy Markdown

VIctory V2: community PRs, merged and tested

Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.

Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).

⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.

Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2

Unofficial community fork of Marvisak/VIctory, GPL-3.0.

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally on macOS arm64 (rustc 1.98.1): PR head merged cleanly into current main (70564ae), cargo test -p victory-shader --locked → 118 passed, 0 failed. GPU execution tests (valu_tests/host) are #[cfg(all(test, windows))] and run only on Windows; macOS covers lowering/structure unit tests.

Wave32 spilled lane masks at control-flow joins: wave32_spilled_mask_at_join lowers through try_lower_valu_cs. +2 macOS tests.

Marvisak commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Merge candidate (worth a look). Now that it merges cleanly: this adds wave32_spilled_mask_at_join to emit/valu_tests.rs, a 64-thread Wave32 compute shader where a uniform branch joins a lane mask restored by v_readlane_b32 with one computed directly, reading each thread's output back for both branch selectors. I checked the hand-encoded instructions (v_cmp_gt_u32, v_writelane/v_readlane, the s_cmp_eq_u32/s_cbranch_scc0/s_branch offsets, s_and_saveexec_b32, s_or_b32, v_lshlrev_b32, the MUBUF offen bits): branch targets and expected values match. Lowering runs unconditionally, so CI exercises the lower.rs lane-mask join path even without a GPU. The small try_lower_valu_cs refactor leaves the existing helper's behaviour unchanged. CI: passing.


Generated by Claude Code

@rezioliver-collab
rezioliver-collab force-pushed the test/wave32-spilled-mask-join-main branch from 79d6f36 to ca8652e Compare November 25, 2026 13:51
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 25, 2026
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants