Skip to content

Conversation

@alsepkow
Copy link
Contributor

@alsepkow alsepkow commented Oct 7, 2025

Update Dot expected values to be computed using doubles to improve precision of the final result.
Additionally, this PR adds logic to compute an absolute epsilon tolerance for the final result of each Dot operation by summing absolute epsilons calculated on each multiply and addition in the dot product. The summation portion is re-ordered to a worst-case ordering when computing the absolute epsilon error tolerance as the DX spec allows for this.

Copy link

@inbelic inbelic left a comment

Choose a reason for hiding this comment

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

LGTM, can we update the commit description to include "the why"

@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

Copy link
Member

@damyanp damyanp left a comment

Choose a reason for hiding this comment

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

LGTM, but I haven't deeply reviewed the mathmatics of this, so if you'd like some more review of that you may need to solicit another review.

@alsepkow
Copy link
Contributor Author

alsepkow commented Oct 24, 2025 via email

// Finally, compute and add in the ULP on our final sum of epsilons.
AbsoluteEpsilon += computeAbsoluteEpsilon<T>(AbsoluteEpsilon, ULPTolerance);

Op.ValidationConfig.Tolerance = static_cast<float>(AbsoluteEpsilon);
Copy link
Contributor

Choose a reason for hiding this comment

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

So absolute epsilons for double tests are expressed as float? Couldn't that be an issue for tests of very small values and denorms in double precision?

Copy link
Contributor

Choose a reason for hiding this comment

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

You could update ValidationConfig to use double instead of float to solve this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ValidationConfig.Tolerance is used to pass into helpers in HLSLTestUtils that expect a float. So, I'd just have to update that to cast instead. Doesn't seem like a meaningful change.

For your first point I'm not sure. I'm not familiar enough. As-is the trig functions are the only other tests using a non-zero epsilon of 0.0008f. Is that still a concern? How small is very small? Should we approach this when we follow up with a wider set of inputs? If we have concerns around that I think I would rather follow up on them after implementing the rest of the pending exec tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

4 participants