tombox-xshader: f16 omod in denorm mode 1 and underflow flush after the scale, from gfx1036 measurements #363
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!363
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/363/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?
@SchmashinPrunes on GitHub · 2026-11-24 14:35 UTC · original
SchmashinPrunes:rdna2-f16-omod→main· +193 −1 · 5 files · 1 commits · closed without mergingThis follows up on the BLOCKERS entry "f16 output modifiers depend on the initial MODE". It said "the other f16 results follow the same output stage, but that is not measured". This PR measures all of them on RDNA2 and fixes two gaps the measurement shows.
Library / area:
tombox-xshader(hlsl/mode.rshres_mode,tests/exec.rs),tools/rdna2-hwprobe/omod_probe.py,docs/BLOCKERS.mdExports changed (exports.txt rows): none
Source of the behaviour:
omod_probe.py, which uses the existingverify_runner.Measurement
v_add,sub,subrev,mul,max,min,ldexp,fma,fmac,div_fixup,min3,max3andmed3_f16;v_rcp,sqrt,rsq,log,exp,frexp_mant,floor,ceil,trunc,rndne,fract,sinandcos_f16;v_cvt_f16_f32,_u16and_i16.mul:2,mul:4anddiv:2.omod_probe.py checkreproduces every result: 1,021,365 scaled, 3,095,433 unchanged, 0 differences. The rule:tb_om0already does this for −0.0x07ff div:2gives 0, not0x0400.Change
hres_modetested(tb_hw1 & 0x2c0) == 0, which needs both f16 denorm bits clear. A shader that sets denorm mode 1 (inputs kept, outputs flushed) lost its omod. The gate is now& 0x280.tb_omh). Before,0x0400 div:2stored the denormal0x0200where the hardware gives 0.Tests
f16_omod_follows_modegains:0x0400 div:2 → 0,0x8400 div:2 → 0x8000,0x07ff div:2 → 0, and0x0400 mul:2 → 0x0800.f89e410)--test exec f16_omodon WARP0x0400 div:2cargo test --locked -p tombox-xshader --release --no-fail-fastWith
TOMBOX_EXEC_HW=1on an RX 9060 XT, one case fails in the runtime-input rerun:v_add_f16(-0, -0)in the default MODE, which gives +0 there. That's the existing row #4 from main, it fails on main the same way, and it isn't touched by this change.Related: #309 passes the initial MODE from PGM_RSRC1. With it, a title shader that starts in denorm mode 1 would reach this gate without writing MODE.
tools/rdna2-hwprobe/README.txtgets a section with the commands. #360 and #361 also append to that file, so whichever lands later needs a trivial merge there.cargo test -p tombox-xshaderpasses🤖 Generated with Claude Code
@omonkeyz on GitHub · 2026-11-25 13:50 UTC · original
Applied on main in
5ad807c(cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.Pull request closed