Repository navigation
Shaders: honor permlane EXEC and FI/BC flags (on #1014) - #1737
jaschinski97-ops wants to merge 5 commits into
Conversation
|
The RTX 5080 passed the Wave32 matrix. With app-local Microsoft WARP 1.0.22, Full counts on
Lane 4 read lane 14 instead of lane 30. With Windows 11 build 26300.10075. Built-in WARP reported a wave range of 4–4 and skipped the matrix. The app-local WARP DLL reported 4–128 and exercised both wave sizes. |
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (70564ae, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC, with dxil.dll validator):
cargo test -p victory-shader --lib permlane— 6 passed, 0 failed on both RTX 5090 hardware andVICTORY_D3D12_WARP=1cargo clippy -p victory-shader --all-targets— 0 warningscargo xtask policy— ok
Clean handling of permlane16/permlanex16 EXEC and FI/BC flags with thorough end-to-end GPU+WARP verification in permlane_tests.rs. Looks good.
AI-assisted (Gemini 4 Neon).
|
Automated triage for the maintainers. Needs rebase. This PR no longer merges cleanly into Previous verdict for this head: merge candidate. Generated by Claude Code |
catminou4
left a comment
There was a problem hiding this comment.
Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main 940d32f, cargo test -p victory-shader --locked.
145 passed / 0 failed / 2 ignored. Permlane EXEC + FI/BC flags honored (+1 test). Stacked on #1014 (also open, itself conflicting with main) — the permlane lowering it builds on is not on main yet, so landing order matters: #1014 first, then this.
|
Measured offline on the title's shaders (the method in #1247): merged onto main One thing to fix: on |
|
To square this with the macOS approval above: |
|
The lane-4 mismatch reproduces in independently compiled HLSL on Microsoft WARP 1.0.22. DXC compiled the control directly to Shader Model 6.6. I also reran the translated matrix on
With cross-row selection, Passing the source index directly cleared the original 400-case matrix on standalone WARP. A separate FI-disabled test with a divergent branch still had 728/25,600 incorrect lanes at Wave32 and 828/25,600 at Wave64 with that change (original lowering: 780 and 734). I would keep the direct-index change experimental. The native control isolates the original discrepancy to this DXC/WARP execution path. The cause of the divergent case remains open. The focused control is one commit on top of |
|
Status on current head a29e902, merged with main 940d32f:
The PR keeps the ISA semantics and regression assertions, and the software-backend limitation is explicit. No game-data or gameplay claim. AI-assisted follow-up. |
|
Re-checked head |
|
In case it saves you a step on the rebase: I merged current #[test]
fn permlane16_lowers() {
...
lowers(&words, 0).expect("v_permlanex16_b32 should lower");
-=======
+ }
#[test]
fn ds_bpermute_wave64_preserves_32_lane_half() {Nothing else conflicts. Results on that merge, on Windows 11 with an NVIDIA GeForce RTX 4070 + WARP (
I have the full merge as a patch against AI-assisted (Claude Code). |
|
The same merge on AMD, where the Wave64 half of the matrix can run. Head
Earlier on this PR I measured Offline tests only; no program names or data. |
|
@pawrenity @zed6000 Here is the missing divergent FI=0 readback, based directly on
With identity selectors, I also compiled the divergent case independently with DXC as To run the new fixture against the PR head or your local merge: git fetch https://github.com/steven-seagull27/VIctory.git codex/pr1737-divergent-fi0-readback
git cherry-pick a5c740754dcfaed72aa61bfaaf20aff8465bfdd4
cargo test -p victory-shader --lib permlane_fi_zero_under_divergent_exec -- --nocaptureThe test prints a numerator, denominator and first failing lane for each supported width. An RX 7900 XTX readback on the merged head would give us the missing AMD comparison. |
|
@steven-seagull27 Here's the AMD comparison: your fixture
With your RTX 5080 numbers, that gives 0 wrong on NVIDIA hardware (Wave32) and on AMD hardware in both Wave32 and Wave64, for divergent FI=0. The only adapter that disagrees is Microsoft.Warp 1.0.22, which your DXC-only controls already reproduce outside VIctory's emitter. That fits WARP's handling of reads from inactive lanes under divergence, not the PR's lowering. Offline tests only; no program names or data. |
|
@jaschinski97-ops I put a fast-forwardable branch on my fork for current I found a separate correctness issue affecting physical GPUs as well as WARP. Given a scalar that was set differently on either side of an EXEC split, a later scalar compare can select different host lanes. The old check treated that compare as wave-uniform and allowed a fetch-inactive cross-row shuffle to read a lane that had already left the host branch. With a 128-thread synthetic case and an EXEC mask of 1, all 128/128 outputs were wrong on both RTX 5080 and WARP 1.0.22. Lane 0 expected The new check refuses that shader and still translates a branch on a scalar expression computed entirely from uniform inputs. All nine focused tests passed on Windows. The RTX 5080 returned 0/51,200 mismatches in the straight-line Wave32 matrix and 0/25,600 in the divergent FI=0 matrix. Your original WARP permutation limitation still applies to this branch. @zed6000’s RX 7900 XTX Wave32 and Wave64 results were on the earlier divergent fixture. To take the branch from the PR head: git fetch https://github.com/steven-seagull27/VIctory.git refs/heads/codex/pr1737-current-main
git merge --ff-only FETCH_HEAD
cargo test --locked -p victory-shader --lib emit::permlane_tests:: -- --nocapture --test-threads=1WARP follow-up. I also tested a separate integration of this branch with @andrewpozdnakov7-jpg’s #2997. It reuses their four-lane bank reads and captures which lanes will enter the shuffle while all lanes can still vote. On both branch directions the guest keeps the old destination, or uses zero when bound control requests it, if the source took the other edge. Combined commit
Counts are mismatches per run, with 128 threads per group. All three fresh WARP processes agreed, including the original lane 4 → lane 30 case. Inbox WARP reported only four lanes and skipped both widths. A direct merge of the two PRs still had 64 straight-line mismatches per width and hundreds in the skip case. Banked reads alone fixed the straight case. Moving the vote before the split fixed the eligible divergent case. The software path explicitly declines partially populated waves and nested control flow where it cannot recover the incoming lane mask. Both have compile-time regressions. Across 192 native-path translations covering Wave32/Wave64, both DXIL and the complete binding records matched the direct merge byte for byte. All 18 focused Windows tests, strict shader Clippy and asset policy passed. To try the combined branch, fetch AI-assisted with Codex. Synthetic shaders and readbacks. |
Lower v_permlane16_b32 and v_permlanex16_b32 with console EXEC source activity and FI/BC semantics. A selected inactive source must preserve the old destination or return zero according to BC, unless FI requests inactive-lane fetches.
Builds on #1014 (original author commit retained), whose synthetic reverse-row/masked-EXEC case returned a source value instead of the required old destination. Updated against upstream main 940d32f, with its unrelated shader changes retained. Coordination: PR #1737 in #1633.
Ballot console EXEC together with host activity; use a safe active shuffle lane before selecting an inactive-source fallback.
Honor both instruction flags, both row operations and in-place aliasing; reject unsupported input modifiers.
Require full host participation for FI. The analysis includes per-lane loop-limit returns, unresolved divergence, uniform branches and genuine reconvergence.
Add synthetic GPU readback and control-flow regressions.
Validation: Windows 11, NVIDIA GeForce RTX 3080, driver 32.0.16.2140; Rust 1.98.1 Windows GNU.
GPU matrix: 400 dispatches / 51,200 lane results, both operations, all FI/BC combinations, aliasing, five selectors and five EXEC masks. All pass. Final 940d32f targeted run: all five permlane tests pass, including four control-flow regressions; the loop-abort case fails without its correction.
Shader Clippy, all targets, diagnostics+host, warnings denied: passed. Asset policy: passed. Independent review of the current-main merge: no blocking findings.
Native wave32 is tested. RTX 3080 cannot execute native wave64, which is capability-skipped. WARP reports four-lane waves here and skips the row matrix. This does not add wave64 emulation or establish game boot, FPS or complete RTX compatibility. Fixtures are synthetic; no title data was used.
AI-assisted with Codex, including parallel research and independent agent review. GPU processes were serialized centrally. GitHub Actions passes on head a29e902 (Windows MSVC).
Combined local validation (main 940d32f + all three contributions, integration cfa116d):
cargo clippy --locked --workspace --all-targets --all-features -- -D warnings: passed.cargo test --locked --workspace --all-features --no-fail-fast -- --test-threads=1: completed unfiltered; six tests fail. Shader suite: 271 passed, 3 failed, 3 ignored. GPU suite: 145 passed, 2 failed, 2 ignored. The five GPU/shader failures were independently reproduced on bare main 940d32f. The sixth isloads_binds_and_calls_probe: its unchanged fixture passes MSVC/DELAYLOADto the local GNU linker, which rejects it.The baseline failures are
dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_views,a_heap_buffer_read_by_element_takes_the_views_stride,a_heap_buffer_read_where_no_buffer_view_is_reads_zeros, andgathers_at_a_level_match_the_hardware. The full local workspace run is therefore explicitly not reported as passing.New regression tests and the repository asset policy pass. All three PRs also pass GitHub's Windows MSVC CI. Green CI does not substitute for the separately reported RTX readback evidence.
App-local WARP follow-up: an external native-HLSL control reports the same cross-row/ballot-selected-index mismatch as the translated shader on Microsoft WARP 1.0.22 (#1737 (comment)). This supports a DXC/WARP execution-path discrepancy; I have not independently reproduced that app-local build. A separate divergent-case discrepancy is still open. The local built-in WARP only supports four-lane waves and skips the matrix. No assertions are weakened to hide this limitation.
Refresh against main 67e8ae1 (2026-11-25)
Current-main refresh: head
abb811fmerges main67e8ae1401df112248aed36d0024483181b718b7without conflict. The permlane semantics are unchanged. All 6 permlane tests pass again, including 400 RTX 3080 Wave32 dispatches / 51,200 lane values; native Wave64 is unsupported on this card and built-in WARP (4..4 lanes) capability-skips this matrix. The app-local WARP caveat above remains open. Combined current-main validation also passes all 17 general emitter tests, all 20 interpolation tests and all 3 pipeline host-state tests, plus workspace Clippy for all targets/all features with warnings denied. This is targeted validation, not a new full-workspace native test result. GitHub Windows MSVC CI: https://github.com/Marvisak/VIctory/actions/runs/45652322993 (passed on this head).Coordination bookkeeping: the earlier claim label was incorrect; see the correction.