JuliaDiff / JuliaDiff/ChainRulesTestUtils.jl
default test tolerances assume Float64 precision and numbers ~ 1
Open
Nobody has claimed this yet.
bug
good first issue
- Dominant language
- Julia
- Stars
- 50
- Forks
- 18
- PR merge metrics
- No merged PRs in 30d
Description
The default test tolerances here seem wrong:
https://github.com/JuliaDiff/ChainRulesTestUtils.jl/blob/6925da14c12e3d743c8d3620db8a8bee1433d5c3/src/testers.jl#L17
- The default
rtol = 1e-9assumes double precision. Better to followisapproxhere and usesqrt(eps(float(T)))? - By setting a nonzero default
atolyou are implicitly assuming quantities of order unity. This corresponds to an absurdly large tolerance if the functions happen to be scaled to have very small magnitude. Better to followisapproxhere and default toatol = 0.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/testers.jl at the linked default tolerance definition. Compare those defaults with Julia's isapprox behavior, especially for Float types and values far from order one. Done means the defaults no longer assume Float64 precision or unit-scale quantities, with existing tolerance-related tests or checks still passing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100