JuliaDiff / JuliaDiff/ChainRulesTestUtils.jl

default test tolerances assume Float64 precision and numbers ~ 1

Open
#269 1 comment 0 reactions 0 assignees View on GitHub

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

  1. The default rtol = 1e-9 assumes double precision. Better to follow isapprox here and use sqrt(eps(float(T)))?
  2. By setting a nonzero default atol you 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 follow isapprox here and default to atol = 0.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.