Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## prefixes #1503 +/- ##
============================================
+ Coverage 89.95% 90.20% +0.25%
============================================
Files 51 49 -2
Lines 7106 7058 -48
============================================
- Hits 6392 6367 -25
+ Misses 714 691 -23 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🔵 Needs a closer look
The architecture-wide breaking API migration affects generated evaluators, extensions, threading, and downstream integrations.
Pull request overview
Replaces model-attached context hierarchies with explicit evaluation inputs, implementing issue #1469’s one-way evaluation flow.
Changes:
- Introduces
Contextfor RNG, initialization, and transforms. - Removes legacy context hierarchy and updates compiler/evaluation APIs.
- Migrates tests, extensions, documentation, and benchmarks.
File summaries
| File | Description |
|---|---|
Project.toml |
Raises Compat minimum. |
HISTORY.md |
Records context migration. |
src/DynamicPPL.jl |
Updates exports and includes. |
src/accumulators.jl |
Clarifies thread-safe promotion. |
src/compiler.jl |
Passes context into evaluators. |
src/contexts.jl |
Removes context hierarchy. |
src/contexts/default.jl |
Removes DefaultContext. |
src/contexts/init.jl |
Replaces InitContext with Context. |
src/debug_utils.jl |
Updates evaluator inspection. |
src/logdensityfunction.jl |
Updates context terminology. |
src/model.jl |
Removes model-attached contexts. |
src/submodel.jl |
Propagates explicit contexts. |
src/test_utils.jl |
Removes context test utilities. |
src/test_utils/contexts.jl |
Deletes obsolete utilities. |
src/varinfo.jl |
Uses explicit contexts. |
ext/DynamicPPLBridgeStanExt.jl |
Migrates Stan evaluation. |
ext/DynamicPPLInputProvenanceExt.jl |
Updates model reconstruction. |
test/compiler.jl |
Updates compiler expectations. |
test/conditionfix.jl |
Migrates condition/fix evaluation. |
test/context_implementations.jl |
Tests explicit input/output separation. |
test/contexts/init.jl |
Migrates initialization tests. |
test/debug_utils.jl |
Updates debug tests. |
test/ext/DynamicPPLBridgeStanExt.jl |
Adds explicit-context coverage. |
test/ext/DynamicPPLForwardDiffExt.jl |
Adds numeric and AD coverage. |
test/model.jl |
Migrates model evaluation tests. |
test/runtests.jl |
Updates test ordering/imports. |
test/submodels.jl |
Migrates submodel tests. |
test/threadsafe.jl |
Migrates thread-safe tests. |
test/utils.jl |
Updates utility evaluation. |
test/varinfo.jl |
Migrates VarInfo tests. |
docs/src/accs/threadsafe.md |
Updates thread-safe example. |
docs/src/accs/values.md |
Updates accumulator examples. |
docs/src/api.md |
Documents the new API. |
docs/src/evaluation.md |
Explains explicit evaluation flow. |
docs/src/migration.md |
Provides migration guidance. |
docs/src/onboarding.md |
Updates contributor guidance. |
docs/src/tilde.md |
Updates tilde-pipeline documentation. |
benchmarks/benchmarks.jl |
Adds indexed-submodel benchmark. |
Review details
- Files reviewed: 37/38 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
DynamicPPL.jl documentation for PR #1503 is available at: |
BenchmarksPerformance Ratio: gradient time divided by log-density time. Primal times are for main (94e4e4a) and this PR (3febd24). For very small models the gradient ratios vary across runs and machines, so compare the raw timings instead. The benchmarks are meant for DynamicPPL developers and mainly catch obvious allocation and type-stability regressions; see the benchmark notes for details. EnvironmentJulia Version 1.13.1 Commit 96ca370cf0e (2026-09-25 19:34 UTC) Build Info: Official https://julialang.org release Platform Info: OS: Linux (x86_64-linux-gnu) CPU: 4 × AMD EPYC 7763 64-Core Processor WORD_SIZE: 64 LLVM: libLLVM-20.1.8 (ORCJIT, znver3) GC: Built with stock GC Threads: 1 default, 1 interactive, 1 GC (on 4 virtual cores) |
19a65fe to
a69238e
Compare
d58dff1 to
9aa95bb
Compare
Assisted-by: Codex <codex@openai.com>
Assisted-by: Codex <codex@openai.com>
Assisted-by: Codex <codex@openai.com>
Assisted-by: Claude Code <noreply@anthropic.com>
Assisted-by: Codex <codex@openai.com>
Assisted-by: Codex <codex@openai.com>
Assisted-by: Codex <codex@openai.com>
Assisted-by: Codex <codex@openai.com>
This removes model-attached contexts and the parent/leaf context hierarchy. Evaluation receives an explicit
Contextholding the RNG, initialisation strategy and transform strategy; it reads inputs only from the model and that context, writes evaluation outputs only to theVarInfo, and returns the model's value separately:HISTORY.mdand the migration guide give each removed name's replacement, e.g.evaluate!!(contextualize(m, ctx), vi)→evaluate!!(m, ctx, vi).Turing.jl needs changes. Particle MCMC calls the removed
setleafcontext. TheSMCContexttilde_assume!!overload becomes an initialisation strategy evaluated withContext(particle.rng, strategy, UnlinkAll()), and itsget_param_eltypeoverload moves to that strategy. Its context-dispatchedtilde_observe!!andstore_coloneq_value!!overloads are no longer called; the varinfo copy they make moves toProduceLogLikelihoodAccumulator'saccumulate_observe!!.make_evaluate_args_and_kwargstakesctx.Gibbs reads
model.args, which bindings no longer update;build_values_vntshould merge only arguments without LHS variables beneathconditioned(model)andfixed(model), and keyword splats are now nested inmodel.defaults.gibbs_conditional.jl:120reads the removedmodel.context. Bindings now override argument values and wholemissingarguments remain latent (see #1501), which removes the stated reason forcheck_no_missing_arguments.In tests,
ADTypeCheckContextbecomes an accumulator that checks the element type of the values it sees,conditioned(model.context)becomesconditioned(model),Dictbindings become pairs orNamedTuples, andInitFromParamsrejectsmissingvalues.@vntand@templateare no longer exported, so partial bindings use an@oftemplate, andget_param_eltype(vi, ctx)becomesget_param_eltype(strategy).Closes #1469.