JuliaDiff / JuliaDiff/ForwardDiff.jl
DiffResults objects are not re-aliased properly
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 1k
- Forks
- 160
- PR merge metrics
- No merged PRs in 30d
Description
The DiffResults documentation clearly states that whenever a DiffResult object is used, it must be realiased at the end of the function call:
result = do_stuff!(result, args...)
See for instance the docstrings in https://juliadiff.org/DiffResults.jl/stable/#Mutating-a-DiffResult, or the issue DiffResults#17
This is not done by ForwardDiff, for instance here:
Am I right in deducing that it can lead to incorrectness?
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 with src/gradient.jl at the referenced lines 35-44 and read the DiffResults documentation on mutating a DiffResult, along with DiffResults#17. Trace whether ForwardDiff's current handling can retain stale aliases or produce incorrect results; done means the behavior is confirmed or disproved and the required change is clearly identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100