Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## bindings #1502 +/- ##
============================================
+ Coverage 89.63% 89.95% +0.32%
============================================
Files 52 51 -1
Lines 7165 7106 -59
============================================
- Hits 6422 6392 -30
+ Misses 743 714 -29 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
DynamicPPL.jl documentation for PR #1502 is available at: |
There was a problem hiding this comment.
🔵 Needs a closer look
It changes core compiler and nested-model evaluation semantics, warranting final human validation across downstream integrations.
Pull request overview
Moves prefix and template metadata from PrefixContext into Model, simplifying context handling while preserving nested-submodel storage shapes.
Changes:
- Adds model-owned prefix/template propagation.
- Removes
PrefixContextand related APIs. - Adds prefix, conditioning, fixing, and dynamic-template tests.
File summaries
| File | Description |
|---|---|
HISTORY.md |
Documents the breaking context removal. |
docs/src/api.md |
Updates context API documentation. |
ext/DynamicPPLInputProvenanceExt.jl |
Preserves prefix metadata when tracing models. |
src/DynamicPPL.jl |
Removes obsolete exports and inclusion. |
src/compiler.jl |
Reads prefix metadata directly from models. |
src/contexts.jl |
Removes prefix-specific context assumptions. |
src/contexts/prefix.jl |
Deletes the former prefix context implementation. |
src/model.jl |
Stores and applies prefixes and templates on Model. |
src/submodel.jl |
Propagates model-owned prefixes through submodels. |
test/prefix.jl |
Tests prefix composition and stored values. |
test/runtests.jl |
Registers the new test suite. |
Review details
- Files reviewed: 11/11 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.
BenchmarksPerformance Ratio: gradient time divided by log-density time. Primal times are for main (94e4e4a) and this PR (5aff9d6). 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) |
782a8e4 to
5070aa5
Compare
| for name in keys(values.data) | ||
| name === AbstractPPL.getsym(prefix) || throw( | ||
| for name in (addresses === nothing ? keys(values) : addresses) | ||
| AbstractPPL.subsumes(prefix, name) || throw( |
There was a problem hiding this comment.
there is a corner case here, where, e.g., name is p[1, 1].x and perfix is p[1]; for matrix and linear indexing, p[1] and p[1, 1] are aliases, but the current code will reject.
Assisted-by: Codex <codex@openai.com>
Repair the stale metadata_site test reference inherited from bindings. Assisted-by: Codex <codex@openai.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>
The public observation hook now takes the model's single prefix value, `tilde_observe!!(prefix, right, left, vn, template, vi)`, instead of a prefix and a separate prefix template. The model is still not passed, so observations do not box it; timings and allocations are unchanged. Assisted-by: Codex <codex@openai.com>
This stores prefixes and their prefix templates on
Model, removingPrefixContextandextract_prefixes. A prefix template keeps the parent's storage shape for nested submodels: for a modelmwith LHS variablex,prefix(m, @varname(a[end]); template=zeros(2))placesxata[2].xin a two-element parent array. Prefix indices are scalar integers (a scalarCartesianIndexis canonicalised, andbegin/endresolve against the template); a slice or range prefix throws, and so does an auto-prefixed submodel on a sliced LHS (a[1:2] ~ to_submodel(m)); useto_submodel(m, false)there. Bindings use absolute prefixed names and must be at or below the model's prefix.DynamicPPL.getprefix(model)returns the combined prefix (nothingwhen absent). Observation calls take that prefix instead of a context:tilde_observe!!(ctx, dist, value, vn, template, vi)→tilde_observe!!(prefix, dist, value, vn, template, vi). This adopts template propagation as the solution to the prefix and shape problems in #1221.Closes #1221.