Skip to content

Conversation

@alsepkow
Copy link
Contributor

@alsepkow alsepkow commented Dec 9, 2025

This PR adjusts the tolerances for half precision trig functions with DXIL vectors. The D3D spec only notes the tolerance range for fp32. That fp32 error tolerance is not sufficient for halfs. After some further discussion we opted to use 0.003 as the tolerance for most half precision trig ops. For trig ops with a range that approaches infinity in either direction, we instead use 2 ULP.

Fixes #7936

Copy link
Contributor

@tex3d tex3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might still be a bit tight for the general case, but if this is enough for current HW, we can update it if necessary in the future.

@alsepkow alsepkow enabled auto-merge (squash) December 9, 2025 02:03
@alsepkow alsepkow merged commit c8a39c7 into microsoft:main Dec 9, 2025
13 checks passed
@github-project-automation github-project-automation bot moved this from New to Done in HLSL Roadmap Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Long Vector 16-bit trig function tolerances

3 participants