Repository navigation
docs(shader): cut the f16 SDWA clamp entry to its NaN test gap - #17974
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
The overlap with #16899 is textual. #16899 adds its "SDWA unary-f16 byte selectors" entry directly above the entry this pull request edits in |
gabichuuuuu
left a comment
There was a problem hiding this comment.
Read 8d145ef744 against main.
Correctness. The entry on main says the clamp and DST_SEL order is "not measured on hardware" and closes "when measured with clamp on RDNA2 or a PS5"; the PR records the measurement on gfx1036 and narrows the open part to NaN results. docs/dev/HW_ORACLE.md and core/libs/prx/libSceAgcDriver/tests/execution/SdwaFloatSelectors.cpp exist on main, and the test pins its clamp results through ClampExpected with a per-row ClampChecked mask (SdwaFloatSelectors.cpp:131-175, :236-241), so "the tests pin no NaN result" is plausible; I did not decode every masked cell to prove it. The measurement itself cannot be checked from the code. The other shader.md PRs (#17807, #18026) edit different entries.
Not run here; this is from reading the code.
AI-assisted: yes.
What
Cuts the "f16 VOP2 SDWA clamp with byte selectors" entry in
docs/dev/debt/shader.mdto what is still open. It changes no code.The entry said the order of clamp and destination select was not measured on hardware. The order is: the f16 result is clamped as without SDWA, then written into
DST_SELasDST_Usays. The RDNA2 ISA doesn't state it; ACO and LLVM assume it.The order is now measured on RDNA2 for every selector triple that has a byte selector, NaN results included. The entry's closing condition was "measured with clamp on RDNA2 or a PS5", so that part is closed.
What stays open is that the tests pin no NaN result. The entry now leads with that and closes when a measured NaN row is pinned in
SdwaFloatSelectors.cpp.Tested
All runs were on an AMD Ryzen 5 7600X iGPU (RDNA2, gfx1036), AMD Windows driver 32.0.21045.16010, Windows 11 Pro build 26200. They went through
tools/hw-oraclewith the HIP runtime, in wave32.The existing test's kernel on hardware. The 17 instruction words of
ClampCodeinSdwaFloatSelectors.cppran natively with the test's 32Rows. All 183 checked values equalClampExpected, under all four combinations of IEEE 0/1 and DX10_CLAMP 0/1.The order itself. Each kernel holds 8 cases. For each case it computes:
UNUSED_PRESERVE);v_bfe_u32(v_mov_b32for a DWORD selector).The VOP3 result, inserted into the
DST_SELfield asDST_UNUSEDsays, is the expected value.v_add_f16,v_sub_f16,v_subrev_f16,v_mul_f16,v_max_f16,v_min_f16andv_ldexp_f16.SRC0_SELxSRC1_SELxDST_SELtriple that holds a byte selector, 2,212 cases in all. Each case got oneDST_UNUSEDmode, chosen at random.Result: 141,568 of 141,568 lane results match.
DST_SELandDST_UNUSEDsay.The scripts and per-lane results: anyps5-sdwa-f16-clamp-rdna2-evidence.zip.
python3 tools/check_conventions.py --base origin/main: all conventions checks passed.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)