feat(rdna2-ref): run half-precision transcendental instructions #503
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/503"
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?
Imported from LooperSalty/AnyXboxX. Originally posted by Lewandox on 2026-11-27T14:28:38Z.
Change
Port the 7 scalar half-precision (
f16) transcendental instructions ofemu/rdna2_exec_f16.pytocrates/anyxboxx-rdna2-ref(f16_trans.rs) inVOP1andVOP3:v_rcp_f16,v_sqrt_f16,v_rsq_f16,v_log_f16,v_exp_f16,v_sin_f16,v_cos_f16(including exact quadrant/turn reduction before multiplying by2\piforv_sin_f16andv_cos_f16, matchingsin(-0) = -0,sin(±65504) = +0,cos(±65504) = +1,cos(0.25) = +0).VOP3op_sel(source bit 0 and destination bit 3 while preserving the untouched half),abs/negon bit 15,clampto[0, 1], and shared refusals (SDWA/DPP,omod,op_selhigh half on constants).Linked issue: Refs #482 (part 3 of 3)
Verification
Oracle and test data
PrototypeScarlett/emu/rdna2_exec_f16.py(AMD RDNA 2 ISA section 12.8, opcodes 84–88 and 96–97).tests/test_rdna2_ref_f16_trans_parity.pycompares Rust against Python bit-for-bit on all 65,536 binary16 inputs (0x0000..=0xFFFF) for each of the 7 transcendentals (458,752 evaluations), plusVOP3modifier cases, shared refusals, and 200 seeded programs.tests/test_rdna2_ref_f16_trans_parity.pyfails becauseanyxboxx-rdna2-refrefuses all 7f16transcendental instructions witherror untranslated.Checklist
E_NOTIMPL), never a fake success.test_readme_sync.pychecks it; collected count stays1900+).AGENTS.mdallows; none used here.emu/rdna2_exec_f16.pyis in this repository).AI assistance: implemented and verified with AI coding assistance.
Imported from LooperSalty/AnyXboxX. Originally posted by LooperSalty on 2026-11-27T15:54:04Z.
Thanks! #501 and #502 were just merged and this PR now conflicts with main (same
anyxboxx-rdna2-reffiles). Could you rebase it on main? It is otherwise ready to merge.Imported from LooperSalty/AnyXboxX. Originally posted by Lewandox on 2026-11-27T16:07:23Z.
Rebased on \main\ and re-verified \cargo test -p anyxboxx-rdna2-ref\ (145 passed) — ready to merge!