shader: lower v_sat_pk_u8_i16 in the direct compute path #3095
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3095
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3095"
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?
@R0D4X on GitHub · 2026-11-27 15:03 UTC · original
R0D4X:feat/native-sat-pk-u8-i16→main· +204 −0 · 4 files · 2 commits · merged 2026-11-27 17:45 UTCFixes #3093. Refs #2935.
What this changes
0x62) and VOP3A (0x1e2)v_sat_pk_u8_i16insrc/gfx1013_direct_compute.inl:src0, clamps each to[0, 255], packs them intoD[7:0]andD[15:8], and zeroesD[31:16].clamp,omod,abs,neg,op_sel, SDWA, DPP, and nonzero unusedsrc1/src2on the VOP3A form.Tests & docs added
tests/native_sat_pk_u8_i16_check.py&tests/cmake/native_sat_pk_u8_i16.cmake: DXIL compile & disassembly controls, six VOP3A modifier/unused-source refusal encodings, andnative_store_replayhardware dispatches (dense with0xABCD0000preload to verify high-half zeroing, plus sparseEXEC, across 16 patterns x 2 encodings = 2,048 words + 16 guards).docs/experiments/native-sat-pk-u8-i16.md: semantics and reproduction commands.Verification
Commit:
01460537on Windows 11 x64 (10.0.26300.9974), MSVC19.44.35230, Windows SDK & DXC10.0.26100.0,NVIDIA GeForce RTX 5080(10de:2c02, driver32.0.16.2124), SM 6.6 wave32:ctest --preset dev --no-tests=error -R '^native_sat_pk_u8_i16_|^native_cvt_pk16_' -V: 4/4 passed, 0 skippednative_sat_pk_u8_i16_hardware:sparse=Falseandsparse=Truematched 2048 result words and 16 guards.ctest --preset release --no-tests=error -R '^native_sat_pk_u8_i16_|^native_cvt_pk16_': 4/4 passed, 0 skippeddocs_links_check.py,bidi_controls_check.py,git diff --check): all passed.Scope: Covers synthetic
v_sat_pk_u8_i16wave32 compute fixtures throughcompile_dxilandnative_store_replay; does not establish full-title startup or runtime execution.@tedin7 on GitHub · 2026-11-27 17:45 UTC · original · reviewed
Review of
7945e57929(the change from01460537, updated with main; the PR's own diff is unchanged).Code: each signed 16-bit half is sign-extended (
shl 16+ashr 16for the low half,ashr 16for the high half), clamped to [0, 255], and packed into D[7:0] and D[15:8] with D[31:16] zero. The VOP3A form refuses op_sel and nonzero src1/src2; clamp, abs and neg are refused by the shared modifier guard, and the controls check all six refusals. The test preloads the destination with 0xABCD0000, so it proves the high half is cleared, and the CPU reference is computed independently of the lowering. No other open PR covers this opcode in the direct compute path (#3033 is the gfx2hlsl path).Windows results are in the comment below.
Commands:
git diff origin/main...pull/3095/head -- src/ tests/(read), plus the Windows commands listed in the comment.AI-assisted; commands listed were executed locally.
@tedin7 on GitHub · 2026-11-27 17:45 UTC · original
Windows Server 2025 verification of
7945e579294228ee27c11657164a6bc97a59e426(D3D12 WARP, MSVC 14.44.35207):cmake --build --preset dev --target compile_dxil native_store_replay;ctest --preset dev -R <native sweep>: 100% tests passed out of 126 (73 passed, 53 hardware legs skipped)cmake --build --preset release --target compile_dxil native_store_replay;ctest --preset release -R <native sweep>: 100% tests passed out of 126 (73 passed, 53 skipped)<native sweep>= everynative_*test exceptnative_startup_request_cache_hardware, which fails on WARP-only hosts with or without this PR (wave lane count 32 requested, WARP offers 4; the test comes from #2955).native_sat_pk_u8_i16_controlspassed in both presets; the_hardwareleg skips on WARP because it needs a physical wave32 adapter.AI-assisted; commands listed were executed locally.