Shaders: a select or carry-in on an untracked mask tests this lane's bit #1084
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1084"
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 Marvisak/VIctory. Originally posted by undeadhuman37 on 2026-11-24T15:36:50Z.
v_cndmask_b32andv_*_co_ci_u32were refused when their scalar mask was not one thatstructurefollows (a plain SGPR number). In compute with console lanes, the lane now tests its own bit of the register (the pair in wave64); inline 0 and -1 masks are constants.Credit: this is taken from #585 (the mask part only). Its descriptor-dimension hunk is left out; that belongs with the resource work. It overlaps #585, so whichever merges first, the other should drop this hunk.
Measured offline over the shader corpus (26148 programs):
Tests: a synthetic hardware test fails before the change and passes after (run earlier on a GPU, not re-run for this PR). WARP cannot pin a wave size, so the test skips it.
cargo clippy -p victory-shader --all-targets -- -D warningsis clean on this rebase.No game data. AI-assisted: written with Claude Code (Claude Sonnet 5.5).
🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T16:29:02Z.
Review: APPROVED
v_cndmask_b32 and *_ci_u32 no longer hard-fail on untracked scalar masks: inline 0/-1 constants fold to bools, tracked masks keep the structure path, and plain SGPR masks fall back to per-lane bit tests (with wave64 hi dword and WAVE_OPS flag). The added guard extends cross-lane detection to these ops when the mask is untracked. The execution test is Windows-gated; lowering suite green here. Local verification: macOS arm64, rustc 1.98.1, PR head merged into main
ffe310e,cargo test -p <crate> --locked. Shader execution tests (valu_tests/host) are#[cfg(all(test, windows))], so macOS covers lowering/decode/unit tests only. victory-shader: 96 passed, 0 failed.Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T16:28:35Z.
I replayed 105 distinct compute shaders that VIctory had refused during one local RTX 5070 mission-loading trace, after a fence-confirmed texture readback. I matched the local inputs to the logged identifiers and compared the same inputs on
ffe310eand48a41fb. The replay ran the translator offline on Windows.On main, 47 of the 105 stopped at the untracked-mask select. All 47 advanced on this PR. Their next reported reasons were:
Both builds still refused all 105 inputs before producing DXIL. This confirms the specific lowering change reaches this mission’s shaders and identifies which refusal appears next. The replay did not execute any of these shaders or measure frame time. AI-assisted.
Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T16:29:47Z.
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
48a41fb:cargo test -p victory-shaderpasses, 121 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
Imported from Marvisak/VIctory. Originally posted by jtrudeau1530 on 2026-11-24T17:14:26Z.
Tested a local adaptation of
48a41fbtogether with #660 on an RX 7900 XT under Wine/vkd3d-proton. The adaptation reads the wave64 high word from the consuming instruction, requires it before the tracked-mask shortcut, and uses the exact low/high pair for that shortcut. Missing high-word metadata remains refused rather than becoming zero.Synthetic GPU readbacks pass for all 128 threads with native wave32 and wave64 for
v_cndmask_b32,v_add_co_ci_u32,v_sub_co_ci_u32, andv_subrev_co_ci_u32. The tests use unequal low/high words, rewrite only the high word between two uses, and cover inline 0/-1, root-driven uniforms_cselect, and tracked compares. Numeric masks alone must enable WAVE_OPS and pin the native wave size; no indexing instruction accidentally enables that path. Microsoft DXIL validation is mandatory. The same all-lane fixture on the unchanged parent fails at the original untracked-mask refusal.Missing-high, rewritten-mask and divergent-carry negatives also remain refused. The latter now propagates the existing lane-mask-as-data refusal at the consuming store; its assertion checks the exact Unsupported location and reason. Hardware tests are explicitly invoked and fail if the physical adapter or validator is unavailable. This is compute-path validation of the adaptation, not a game-rendering or frame-time result, and does not resolve the later refusal groups reported above.
Imported from Marvisak/VIctory. Originally posted by justlovett0 on 2026-11-24T18:48:28Z.
Verified + integrated, with a runtime caveat. Stack: main
ffe310e+ #175/#994/#747/#302/#193/#704/#309/#953/#1067/#986/#1260/#1267/#1254/#1276/#189 (wave64 emulation), RTX 3080 10 GB / Win10 21H2 (19044.7846) / driver 621.24 (32.0.16.2124). Re-census of captured runtime containers; world stable ~9 min, 0 device removals.Merged cleanly. Note: the offline untracked-mask gain did not transfer to our captured runtime containers — the "a lane mask read as data" (7) and "a lane mask holding lanes elsewhere read as data" (6) classes persist on the runtime "Wrapped" containers. The fix works on the offline archive; our runtime masks differ (likely loaded from memory rather than the spill/select patterns). Flagging so the offline count isn't read as a runtime guarantee.
AI use: Qwen Code; local measurements. No game data posted.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:34:20Z.
Automated triage for the maintainers.
Needs rebase. This PR does not merge cleanly into current
main(ac2525d). Conflicting files:crates/victory-shader/src/emit/lower.rs,crates/victory-shader/src/emit/valu_tests.rs.The content has not been reviewed yet; it will be once the branch is rebased onto
main.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by kais7654 on 2026-11-25T15:30:52Z.
Picking this up: rebased your commit
48a41fbonto current main (940d32f),authorship preserved — https://github.com/Marvisak/VIctory/compare/main...kais7654:VIctory:shader/untracked-mask-lane-bit
The merge conflicts were with the stride-heap and lane-detection work
that landed since; I resolved them along the lines discussed above
(
lane_bitsetsWAVE_OPSitself, so the mask path needs no separateflag), and the test now runs through main's single-threaded GPU harness.
Clippy clean with -D warnings; the mask test passes on hardware.
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.