Shaders: lower V_SAT_PK_U8_I16 #3146
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3146
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/3146/head"
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?
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 10:15 UTC · original
andrewpozdnakov7-jpg:fix/sat-pack-u8-i16→main· +48 −0 · 2 files · 1 commits · closed without merging
V_SAT_PK_U8_I16decodes in both VOP1 and VOP3 forms, but shader translation on main returnsUnsupported. Interpret both input halves as signed i16, clamp each to [0, 255], and pack the bytes into the low half of the result. AMD RDNA 2 ISA, section 12.8The synthetic shader checks all 81 pairs of nine boundary values for each encoding, including the cleared upper 16 bits. The same test reproduced
Unsupportedon main and passed on WARP after the change. All 36 VALU tests passed on WARP. Strict Clippy for victory-shader andcargo xtask policypassed.AI-assisted with Codex. Please retain the Git author when cherry-picking or rebasing. If folded into another commit, please add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.@andrewpozdnakov7-jpg on GitHub · 2026-11-26 10:28 UTC · original
The original PR is #499. The full-dword result is confirmed by the RDNA2 hardware report. I sent the tested, author-preserving replay there and am closing this duplicate.
@oni-swr on GitHub · 2026-11-26 10:28 UTC · original
WARP test report: head
078c53a6(parent / main63bcca43)Coordinated under #1633 (claim: #1633).
Environment (software adapter only, no physical GPU used): Windows 11 Pro 10.0.26200 (UBR 9974);
d3d10warp.dll10.0.26100.9818; SDKdxil.dll1.8.2502.11 (Windows SDK 10.0.26100.0,VICTORY_DXIL);dxc.exe/dxcompiler.dll1.8.2502.11; rustc/cargo 1.98.1.VICTORY_D3D12_WARP=1 VICTORY_WARP=1(the second forces the victory-shader test host onto WARP, which otherwise also opens the default hardware adapter). A temporary local probe confirmed DXGI reports the adapter asMicrosoft Basic Render Driver(flags 0x2 software, vendor 0x1414, 0 dedicated VRAM). Everyhardwarelabel in the output below therefore also ran on WARP. Shared env for all commands:CARGO_TARGET_DIR=D:\victory-3146-3142-warp-target,-j 4.Parent control (
63bcca4+ this PR'svalu_tests.rsonly):cargo test -p victory-shader --lib -j 4 -- sat_pk_u8_i16 --nocapture-> the PR's test fails withbuild: Unsupported { offset: 36, what: "v_sat_pk_u8_i16" }(0 passed, 2 failed incl. my local sweep below). Matches the PR description.Head
078c53a6:sat_pk_u8_i16_clamps_signed_halves_into_low_bytes ... ok(81 pairs x VOP1 and VOP3).Unsupported.cargo test -p victory-shader --lib -j 4 -- emit::valu_tests: 37 passed, 0 failed (includes the local sweep).cargo test -p victory-shader --lib -j 4: 301 passed, 4 failed, 3 ignored. The 4 failures (synthetic_tests::{gathers_at_a_level_match_the_hardware, permutes_mask_high_address_bits_and_divergent_branches, permutes_read_the_lane_named_and_zero_from_lanes_left_out, a_mask_joined_with_data_at_a_uniform_loop_is_its_number}) are the same four that fail on the parent (299 passed, 6 failed there: those 4 plus the two new tests). They are hardware-only checks, which I forced onto WARP, so they are not attributable to this PR.cargo test -p victory-gpu --lib --features diagnostics -j 4: 246 passed, 0 failed, 1 ignored, 3 of 3 runs. One earlier run on the parent showed 1 failure (descriptor::host::tests::a_slot_rewritten_while_its_view_is_prepared_views_the_new_record) that did not recur in 3 further parent runs, so I treat it as a flake unrelated to this PR.Not run: Clippy,
cargo xtask policy, any real-GPU run, and anything using game files.Result: the lowering matches the ISA semantics on WARP for both encodings; no defect found.
AI use: tested by Claude Code (Claude Sonnet 5.5), coordinated by Claude Code (Claude Opus 5.5). No game files, dumps, shader names or hashes were used.
Pull request closed