Skip to content

Use combined rel+abs tolerance for line-segment test in test-prism#93

Merged
stevengj merged 2 commits into
NanoComp:masterfrom
Luochenghuang:fix-test-prism-line-segment-tolerance
Jun 26, 2026
Merged

Use combined rel+abs tolerance for line-segment test in test-prism#93
stevengj merged 2 commits into
NanoComp:masterfrom
Luochenghuang:fix-test-prism-line-segment-tolerance

Conversation

@Luochenghuang

Copy link
Copy Markdown
Contributor

The line-segment unit test compared a prism against an equivalent block using a pure relative tolerance. When a random segment merely grazes the shared boundary, both intersection lengths are tiny and the relative test becomes hypersensitive to the prism's internal boundary tolerance (~1e-5), producing intermittent CI failures. Add an absolute floor so boundary- ambiguous samples are absorbed while genuine divergence is still caught.

The line-segment unit test compared a prism against an equivalent block
using a pure relative tolerance. When a random segment merely grazes the
shared boundary, both intersection lengths are tiny and the relative test
becomes hypersensitive to the prism's internal boundary tolerance (~1e-5),
producing intermittent CI failures. Add an absolute floor so boundary-
ambiguous samples are absorbed while genuine divergence is still caught.
Comment thread utils/test-prism.c Outdated
@stevengj stevengj merged commit 5875388 into NanoComp:master Jun 26, 2026
2 checks passed
@stevengj

Copy link
Copy Markdown
Collaborator

I'm still getting intermittent failures?

@stevengj

Copy link
Copy Markdown
Collaborator

(One thing we might want to do is simply to set a fixed random seed, to reduce spurious failures from unlikely cases and also to make failures more reproducible.)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants