Repository navigation
Conversation
The scalar 64-bit path refused all three. s_bfe_u64 and s_bfe_i64 take the field at src1[5:0] with width src1[22:16] and set SCC to whether the result is nonzero; the signed form sign-extends from the field's top bit. s_bfm_b64 builds ((1 << src0[5:0]) - 1) << src1[5:0] and does not write SCC. Widths of 64 and up are not defined by the ISA; they take every bit here so the lowering stays in range.
|
Verified on native Windows (no Wine): NVIDIA GeForce RTX 5090 (driver 621.24), Windows 11 10.0.26300, Rust 1.98.1, MSVC 14.44.35207, debug build. Three more than the baseline; Tree restored afterwards (full diff against a clean checkout); no game data, the tests are synthetic. AI-assisted (opencode): applied the patch to a built tree, ran |
catminou4
left a comment
There was a problem hiding this comment.
s_bfe_u64/s_bfe_i64/s_bfm_b64 lowering. The bfe packing (offset[5:0], width[22:16] with 7-bit width) matches the SOP2 encoding; width >= 64 takes the all-ones mask path, signed sign-extension is skipped for width 0/full, and SCC is set from the 64-bit nonzero — all verified by the 12-case hardware test including width-0 and sign cases. s_bfm_b64 correctly leaves SCC untouched (pinned by test). The macOS lowering test runs green. Local verification: macOS arm64, rustc 1.98.1, PR head merged into main ffe310e, cargo test -p victory-shader --locked. Shader execution tests (valu_tests/host/diff_tests) are #[cfg(all(test, windows))], so macOS covers lowering/decode/unit tests only. 97 passed, 0 failed.
|
An AMD run, since the PR says AMD hardware was not tested; under Proton on Linux:
This is RADV, not AMD's Windows driver, so it adds to a Windows run rather than replacing it. Synthetic tests only, no game files. AI-assisted (Claude Code, Opus 5.5); every run was on this machine. |
|
Native Windows run on AMD RDNA2: RX 6750 XT (RDNA2, gfx1031), AMD driver 32.0.21045.29003, i5-13400F, Windows 11, Rust 1.98.1 MSVC. Head a91e9ad on main ffe310e (clean merge).
Synthetic tests only, no game files. AI-assisted (Claude picked the PRs and wrote the batch script; I ran it on my machine). |
Offline measurement on a retail dump, and the shader tests on AdaResult: no count change against Offline. I merged head a91e9ad onto No program changes its failure reason either. That is the expected result for a fix whose instructions sit behind the earlier failures on Tests: with the same merge, No shader names or data are included, per the asset policy. AI-assisted (Claude Code). |
|
Automated triage for the maintainers. Recommended for a maintainer's look: this lowers s_bfe_u64, s_bfe_i64 and s_bfm_b64 (SOP2 0x29, 0x2a, 0x25) in the scalar 64-bit arm of Generated by Claude Code |
astrosteveo
left a comment
There was a problem hiding this comment.
Read the diff at a829945 and ran cargo test -p victory-shader --lib merged onto main 940d32f (no conflicts): Arch Linux, Wine 11.22, vkd3d-proton, RTX 5080, driver 620.73.04. main gives 243 passed and 4 failed there (host limits), this PR 246 passed and the same 4. The three more are scalar_64_bit_field_ops_lower, s_bfe_64_extracts_and_sets_scc and s_bfm_b64_builds_a_mask_and_keeps_scc.
The lowering matches the RDNA2 ISA as I read it: offset in bits 5:0, width in bits 22:16, SCC from the result for s_bfe and untouched by s_bfm.
The red CI looks unrelated. That run (00:50 UTC) failed only gathers_at_a_level_match_the_hardware and permutes_read_the_lane_named_and_zero_from_lanes_left_out, which main has skipped on machines without a GPU since #1911 and #1925. A push or "Update branch" should give a fresh result; a re-run keeps the old merge commit. Not checked: that Windows CI then passes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
The scalar 64-bit lowering path refused
s_bfe_u64,s_bfe_i64ands_bfm_b64. They now lower:s_bfe_u64/s_bfe_i64: the field is(src0 >> src1[5:0]) & ((1 << src1[22:16]) - 1); the signed form sign-extends from the field's top bit (width 0 gives 0). SCC is set to whether the result is nonzero.s_bfm_b64:((1 << src0[5:0]) - 1) << src1[5:0]. It does not write SCC, so SCC keeps its earlier value.A width of 64 or more (and a field running past bit 63) is not defined by the ISA; it takes every bit, with shift amounts masked, so the lowering cannot go out of range. No test depends on that case. The 32-bit
s_bfm_b32is left as it is.Why
A shader using any of these three failed to translate. They are the 64-bit counterparts of
s_bfe_u32/s_bfe_i32/s_bfm_b32, which already lower.Related PRs: #163 and #231 contained these ops but are not on main. #447 (64-bit literal sign extension) touches the same function but not these arms; this change is made on current main and does not depend on it. #166 covers different 64-bit bit ops.
Tested
Windows 11, NVIDIA GeForce RTX 5080, Rust 1.98.1 (hardware and WARP):
cargo test -p victory-shader --features host -- --test-threads=1: main 120 passed, 0 failed, 1 ignored; branch 123 passed, 0 failed, 1 ignored (3 new tests).s_bfe_64_extracts_and_sets_scc: runs both ops on the GPU for low dword, high dword and SCC (e.g.0xFEDCBA9876543210, offset 32, width 16 gives0xBA98unsigned and0xFFFFFFFFFFFFBA98signed; zero field gives 0 and SCC 0).s_bfm_b64_builds_a_mask_and_keeps_scc: masks such as width 40 / offset 8 give0x0000FFFFFFFFFF00, and SCC set by ans_cmpbefore the instruction is read back unchanged afterwards (both 0 and 1, including a nonzero mask).scalar_64_bit_field_ops_lower: hand-assembled encodings lower.AMD hardware: not tested.
Not tested
No game files were used.