Repository navigation
varinfo: require recorded values for container queries - #1541
Conversation
|
DynamicPPL.jl documentation for PR #1541 is available at: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1541 +/- ##
=======================================
Coverage 85.07% 85.07%
=======================================
Files 52 52
Lines 4663 4663
=======================================
Hits 3967 3967
Misses 696 696 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ec59d30 to
93152f0
Compare
BenchmarksPerformance Ratio: gradient time divided by log-density time. For very small models these ratios are noisy across runs and machines; raw primal and gradient timings are more reliable. The benchmarks are aimed at DynamicPPL developers and mainly catch obvious allocation or type-stability regressions. See benchmark notes for details. Primal times: EnvironmentJulia Version 1.13.4 Commit c1ac32ab733 (2026-11-13 17:30 UTC) Build Info: Official https://julialang.org release Platform Info: OS: Linux (x86_64-linux-gnu) CPU: 4 × AMD EPYC 9V74 80-Core Processor WORD_SIZE: 64 LLVM: libLLVM-20.1.8 (ORCJIT, znver4) GC: Built with stock GC Threads: 1 default, 1 interactive, 1 GC (on 4 virtual cores) |
Without a `VectorValueAccumulator`, `keys`, `haskey`, `length`, `values` and `isempty` on a `VarInfo` reported an empty collection, and `is_transformed(vi)` returned `false`. They now throw an `ArgumentError`: an absent value accumulator is not an empty collection. The `subset` example gains its missing opening fence, so it now runs as a doctest. Assisted-by: Claude Code <noreply@anthropic.com>
93152f0 to
9c26048
Compare
|
I have reviewed and everything looks good to me! |
Split of #1529 (part 2 of 12). Without a
VectorValueAccumulator,keys,haskey,length,valuesandisemptyon aVarInforeported an empty collection, andis_transformed(vi)returnedfalse. On main this is a silently wrong answer: afterinit!!(model, VarInfo(), ...),keys(vi)returns()even though the model has just sampled its variables. They now throw anArgumentError, because a missing accumulator is not an empty collection. For example,keys(VarInfo())returned()and now throws; useVarInfo(VectorValueAccumulator(), DynamicPPL.default_accumulators()...)to record values.Tests cover the throwing queries, including under
ThreadSafeVarInfo; thesubsetexample now runs as a doctest. HISTORY lists the change as breaking.