JuliaDiff / JuliaDiff/ChainRulesTestUtils.jl

`test_frule` confused about Tuples, and `Fix1`

Open
#231 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Julia
Stars
50
Forks
18
PR merge metrics
No merged PRs in 30d

Description

This seems to confuse the tester, it should not expect a tuple length 10 (the input) but shorter.

https://github.com/JuliaDiff/ChainRules.jl/pull/570/files#diff-14d216cb53721d9360bbbcc399d93fff67f2594bd388162abbbe82c59ad1ba9fR229

@test_skip test_frule(filter, >(0.5) ⊢ NoTangent(), xt10; check_inferred=false)
check_result.jl:104 
Expression: ActualPrimal === ExpectedPrimal 
Evaluated: NTuple{10, Float64} === NTuple{6, Float64}

Also notice that >(0.5) is not handled, hence the ⊢ NoTangent() work-around.

MethodError: no method matching zero(::Base.Fix2{typeof(>), Float64})

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 at check_result.jl:104 and reproduce the test_frule call shown in the issue, including the tuple-length mismatch and the MethodError for Base.Fix2 from >(0.5). Trace how the expected primal and function tangents are derived; done means the test handles the filtered tuple and the predicate without requiring the NoTangent() workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
testing
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.