rdna2-hwprobe: colour export and blend probe; RDNA2 keeps shader Inf/NaN in fp16 and R11G11B10 targets #360
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!360
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/360/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 13:35 UTC · original
SchmashinPrunes:rdna2-cb-infnan→main· +375 −1 · 6 files · 1 commits · closed without mergingThis answers the blendclamp OPEN item in docs/BLOCKERS.md, "shader Inf/NaN mapping unverified": "check the CB/export NaN and Inf behaviour ... on an RDNA2 card with tools/rdna2-hwprobe".
Library / area:
tools/rdna2-hwprobe(no runtime code),docs/BLOCKERS.mdExports changed (exports.txt rows): none
Source of the behaviour:
What the probe does
RADV's ISA dump shows that RGBA16F and R11G11B10 are exported with
v_cvt_pkrtz_f16_f32+exp mrt0 ... compr, and RGBA32F with a 32-bit export. So this covers the packed fp16 export plus the colour unit. A title shader that exports 32-bit floats to an fp16 target is not covered.What RDNA2 does
0x7c00(Inf)0x7c0, 0x7c0, 0x3e0(Inf)0xfe000x7e0, 0x7e0, 0x3f00x7bff0x7bf, 0x7bf, 0x3df0x7bff/0x7bfe0x7bf/ –0x78din R11G11B10.For blendclamp: the console keeps shader-written Inf and NaN in these targets, both unblended and through additive blending. So the eager passes and
TOMBOX_BLEND_CLAMP=ps(Inf → max, NaN → +max) are less exact than no clamp for Inf/NaN. Only finite overflow saturates, which matches the WARP/NVIDIA measurement already in BLOCKERS.Other drivers, same machine: NVK on an RTX 4060 Ti matches RDNA2 for Inf and for MIN/MAX NaN handling. But its blended finite sums round to nearest and overflow to Inf (40000 + 40000 =
0x7c00). It also keeps or rewrites NaN payloads, keeps −0, and flushes fp32 denormals when blending is on. That is Mesa's NVIDIA driver, not the Windows driver measured in BLOCKERS, but it is another case of finite overflow depending on the vendor.Change
tools/rdna2-hwprobe/, all new:cb_probe.cpp, the Vulkan program: it takes a device-name substring and runs on any Vulkan 1.3 driver;cb_probe.vertandcb_probe.frag;cb_probe.py, with three modes:genwrites the inputs;showprints every stored value;checkcompares a recording with the gfx1036 rules above, prints each difference and exits non-zero.README.txt: a section with the build and run commands and the results.docs/BLOCKERS.md: the blendclamp OPEN line is replaced by the measurement. The R32G32B32A32 line is left as it is, since #320 handles it.Tests
On the gfx1036 machine, following the README:
cb_probe RADV cb.in 340 cb.outtwice gave identical output.python3 cb_probe.py check cb.outprinted "0 results differ from the gfx1036 rules".pr_gate.py --base origin/main --head HEAD: 6 files checked, 0 problems. There's no Rust change, so the cargo tests are not affected.cargo testunaffected (no crate changes)🤖 Generated with Claude Code
@omonkeyz on GitHub · 2026-11-25 13:50 UTC · original
Applied on main in
dfd120b(cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.Pull request closed