JuliaDiff / JuliaDiff/ForwardDiff.jl

`construct_seeds` for types where `typeof(one(T)) !=T` is broken

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

Nobody has claimed this yet.

Dominant language
Julia
Stars
1k
Forks
160
PR merge metrics
No merged PRs in 30d

Description

as far as i understand, the type of one(T) is not necessarily T (https://github.com/JuliaPhysics/Measurements.jl/issues/134 for example). but construct_seeds uses this:
https://github.com/JuliaDiff/ForwardDiff.jl/blob/50ec9a1ccb0a4390edc88398aa322656d58e7202/src/partials.jl#L9-L12
Maybe using oneunit there is more correct?

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/partials.jl at lines 9-12 and inspect how construct_seeds derives seed values for types whose one(T) has a different type. Compare that behavior with the oneunit possibility and the Measurements.jl example linked in the issue; done means the affected type case is handled correctly without breaking existing seed construction.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.