Skip to content

Shaders: hardware test for s_bfe_u32 - #1048

Closed
LouisRiverstone wants to merge 1 commit into
Marvisak:mainfrom
LouisRiverstone:shaders/s-bfe-u32-test
Closed

LouisRiverstone wants to merge 1 commit into
Marvisak:mainfrom
LouisRiverstone:shaders/s-bfe-u32-test

Conversation

@LouisRiverstone

Copy link
Copy Markdown
Contributor

Fixes #803.

bfe_signed_and_unsigned_match_rdna2 builds v_bfe_i32, v_bfe_u32 and s_bfe_i32, but not s_bfe_u32 (SOP2 0x27), which shares a match arm with the signed form.

The test now also builds s_bfe_u32 and runs the unsigned cases through it with the scalar encoding (offset in bits 0..4, width in bits 16..22). It adds the case that separates it from the signed form: [0x80000000, offset 4, width 32] gives 0x08000000, where s_bfe_i32 gives 0xf8000000.

Test only, no production change.

Verify: cargo test -p victory-shader bfe_signed_and_unsigned (Windows, hardware GPU or WARP). I could not run it locally: the shader test module is Windows-only.

🤖 Generated with Claude Code

@ThomasHFWright

Copy link
Copy Markdown

Independent Linux/Wine hardware run of 7b57e8e8da92ba1e690f5bffc19ed64edec58ce0 on base ffe310e: the changed regression passes, exercising all existing bit-field cases plus the five new scalar unsigned cases, including width 32. Built and run from this PR alone, without instrumentation changes.

Rust 1.98.1, Windows MSVC target, Wine 11.22, RTX 5090 / NVIDIA 620.73.04, vkd3d-proton 30b0eb9bc12dc9f. Both requested backend paths completed, but this Wine/DXVK setup is not evidence of genuine Windows WARP coverage. No device/backend skip was reported. These are dispatch/readback checks.

Separately, I combined #1046, #1048, #1050, #1052 and #1053 (all patches applied cleanly) and ran all 14 generated workspace unit/integration test executables with all features. Combined: 345 passed, 5 failed, 6 ignored; matched baseline: 341 passed, 5 failed, 6 ignored. This full-suite result belongs to the combined tree. The five failures match baseline: empty pipeline library (#347), Wine Winsock export (#217), checksum-rejection expectation, nested Cargo fixture build, and Windows xtask launching host Git. Native Linux checks of that tree pass: shader 96 passed / 1 ignored, xtask 4 passed, asset policy clean.

Windows-target shader Clippy with all targets/features and -D warnings passes on this PR alone. Combined workspace Clippy finds a type-complexity warning in #1052, reported there.

Offline and offscreen; no game data, gameplay, native Windows or Wine doctests. Native d3dcompiler_47 supplied for full-suite GPU fixtures. Aggregate counts include existing early-return tests without optional console compilers/DXIL validator; these changed GPU tests executed. Coverage overlaps #1045, but its exact head was not tested here.

AI-assisted testing with Codex.

@ghost

ghost commented Nov 24, 2026

Copy link
Copy Markdown

Ran on RDNA2 hardware through vkd3d-proton on a Steam Deck (not native Windows): AMD Van Gogh, RADV 26.1.99, SteamOS 3.8.28, Proton 11.0-3 (wine-11.0) with its vkd3d-proton 212991fc. Windows MSVC test binary (rustc 1.100.0) built from head 7b57e8e on main ffe310e.

  • bfe_signed_and_unsigned_match_rdna2 passes, including the new s_bfe_u32 cases (width 32 too).
  • victory-shader lib tests: 119 passed, 1 failed, 1 ignored, the same as main. The one failure, stub_pipeline_is_created, fails on main on this host too (likely vkd3d-proton accepting the zero DXIL digest the test expects refused; environment, not this PR).
  • No hangs.

Not tested: native Windows AMD drivers; WARP (this setup has none, so the WARP leg ran on RADV too).

AI-assisted (Claude Code, Claude Opus 5.5); no game data.

@Zipettte

Copy link
Copy Markdown

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 7b57e8e: cargo test -p victory-shader passes, 120 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

@DeerSilver

Copy link
Copy Markdown

Tested head 7b57e8e merged onto main ffe310e (clean merge) on NVIDIA GeForce RTX 5060 Laptop GPU (Blackwell), driver 621.24, Windows 11 26300, Rust 1.98.1: pass. No game files: the test suite only.

  • The s_bfe_u32 cases this PR adds to bfe_signed_and_unsigned_match_rdna2 pass, on both the RTX 5060 (hardware) and WARP:
    • bfe_signed_and_unsigned_match_rdna2
  • With the D3D12 debug layer on (Graphics Tools; --all-features so victory-gpu enables it, plus a local, uncommitted EnableDebugLayer in emit::host::Host::new for the shader tests), the run logs no debug-layer message that main doesn't log too.
  • cargo test --workspace --all-features --locked: 346 passed, 0 failed, 6 ignored (main with all features: 346 / 6).
  • cargo clippy --workspace --all-targets --locked -- -D warnings, with and without --all-features: clean.

AI-assisted (Claude Code).

github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
mercuryVM added a commit to mercuryVM/VIctory that referenced this pull request Nov 24, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@mercuryVM mercuryVM left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tested 7b57e8e on Windows 11, RTX 5070, MSVC: merged into our fork together with #1050, cargo test -p victory-shader -- --test-threads=1 passes (189 passed, 2 ignored), and the workspace tests pass.

The width = 32 case with the top bit set is the one that separates s_bfe_u32 from the signed form: the result keeps every bit and nothing is sign-extended. That's a good addition.

AI-assisted (Claude Code).

KainanP pushed a commit to KainanP/VIctory that referenced this pull request Nov 24, 2026
…fied together

Merges Marvisak#156 Marvisak#162 Marvisak#168 Marvisak#169 Marvisak#368 Marvisak#379 Marvisak#456 Marvisak#587 Marvisak#990 Marvisak#1021 Marvisak#1048 Marvisak#1052 Marvisak#1053
Marvisak#1095 Marvisak#1142 Marvisak#1190 Marvisak#1211 Marvisak#1223 Marvisak#1259 Marvisak#1293 on top of the bundle of Marvisak#1402
(which is on Marvisak#1319, on main ffe310e), each head unchanged. Hunks that
conflicted in emit/lower.rs, emit/valu_tests.rs and emit/diff_tests.rs were
merged by keeping both sides (additions next to each other); a PR was kept
only if cargo clippy -p victory-shader --all-targets -- -D warnings still
passed with it. No instruction name is handled in two places.

Marvisak#98 is not in this version: an offline measurement on a retail dump showed
it loses 31 programs that validate on Marvisak#1402.

cargo clippy --workspace --all-targets --locked -- -D warnings, with and
without --all-features, is clean and cargo test --workspace --locked passes
(381 passed, 6 ignored; main has 342 passed, 6 ignored).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
@Marvisak

Copy link
Copy Markdown
Owner

Automated triage for the maintainers. Closing because this change is already in main, or main has since replaced the code it patches.

s_bfe_u32 is already probed in main: semantics_tests.rs scalar_probes runs SOP2 0x27 over offsets and widths 0..0x7F including 32, with SCC.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shaders: s_bfe_u32 (SOP2 0x27) has no scalar hardware test

6 participants