Skip to content

Adjust test tol to resolve false positive test failures#507

Merged
CompRhys merged 3 commits intomainfrom
torch-tol
Mar 17, 2026
Merged

Adjust test tol to resolve false positive test failures#507
CompRhys merged 3 commits intomainfrom
torch-tol

Conversation

@CompRhys
Copy link
Copy Markdown
Member

reduce tol to fp32 levels of 1e-6 rtol and 1e-7 atol.

allow for a zero force provided not all are zero.

@CompRhys CompRhys requested a review from thomasloux March 17, 2026 13:37
out_pp = model_pp(sim_state)
out_pf = model_pf(sim_state)

assert (out_pp["forces"] != 0.0).all()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

!= on float value is not great, could you replace it by >=tol with tol=1e-6 for instance

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is a check for exact zero's which would be a logic failure as opposed to numerically close to zero which would be fine. It being brittle is okay the problem was that seemingly we got one force that evaluated as equal to zero in the latest torch

Copy link
Copy Markdown
Collaborator

@thomasloux thomasloux Mar 17, 2026

Choose a reason for hiding this comment

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

ok then could you just add a short comment about that, because it's really unusual to do that, good for me otherwise

@CompRhys CompRhys requested a review from thomasloux March 17, 2026 17:18
@CompRhys CompRhys dismissed thomasloux’s stale review March 17, 2026 17:29

made changes - timezone issues do not wait

@CompRhys CompRhys enabled auto-merge (squash) March 17, 2026 17:29
@CompRhys CompRhys merged commit 44f7beb into main Mar 17, 2026
64 of 68 checks passed
@CompRhys CompRhys deleted the torch-tol branch March 17, 2026 17:35
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