JuliaDiff / JuliaDiff/ChainRulesCore.jl
Why is composite + primal test allocating 48 bytes rather than 32?
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 267
- Forks
- 66
- PR merge metrics
- No merged PRs in 30d
Description
Looks fine (on julia 1.4)
julia> bk
(x = 1, y = 0.5)
julia> @btime Foo($(bk)...)
7.639 ns (1 allocation: 32 bytes)
Foo(1, 0.5)
julia> ChainRulesCore.construct(Foo, bk)
Foo(1, 0.5)
julia> @btime ChainRulesCore.construct($Foo, $bk)
7.502 ns (1 allocation: 32 bytes)
But the tests:
Originally posted in https://github.com/_render_node/MDIzOlB1bGxSZXF1ZXN0UmV2aWV3VGhyZWFkMjQ3NDY4MTg1OnYy/pull_request_review_threads/discussion
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 by reproducing the allocation benchmark under Julia 1.4, then inspect test/differentials/composite.jl around lines 180-182. Compare the test's construction path with the shown Foo and ChainRulesCore.construct benchmarks. Done means identifying the reason for the 48-byte result and making the test's expectation accurately reflect the supported behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- performance, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100