TuringLang / TuringLang/DynamicPPL.jl
Merge of two VNTs can drop results when one contains a PartialArray and the other a full Array
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 286
- Forks
- 41
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 34
Description
julia> vnt1 = @vnt begin x = [1.0, 2.0] end
VarNamedTuple
└─ x => [1.0, 2.0]
julia> vnt2 = @vnt begin
@template x = zeros(2)
x[1] = 3.0
end
VarNamedTuple
└─ x => PartialArray size=(2,) data::Vector{Float64}
└─ (1,) => 3.0
julia> merge(vnt1, vnt2)
VarNamedTuple
└─ x => PartialArray size=(2,) data::Vector{Float64}
└─ (1,) => 3.0
It is a bit unintuitive that x[2] is dropped here. This happens because merge can't line the two up: it just thinks "okay, one is a PA and one is an array and they're different things, so I'll just overwrite the first one". I don't really know what the solution to this is.
Contributor guide
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 example with @vnt, PartialArray, full arrays, and merge, then inspect the merge implementation and how these values represent indexed data. Done means merging the shown VNTs preserves both x[1] and x[2], with coverage for the behavior added where the existing merge tests live.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100