Repository navigation
Update the RxInfer notebooks and assignments to RxInfer 6.1 (ReactiveMP v7) - #309
Merged
Merged
Conversation
RxInfer's next release runs on ReactiveMP v7, where rules are called with `@call_message_update_rule` and nodes other than the standard ones live in packages of their own. Three notebooks change: - Factor Graphs: the four `@call_rule typeof(f)(:target, Marginalisation) (m_x = ...)` cells become `getresult(@call_message_update_rule(node = f, target = :target, m = (x = ...,)))`. The node is the function itself, `+` or `*`, not its type. The messages are the same as before. - PP2: `Probit` comes from `ProbitMessagePassingRules`, loaded next to RxInfer; the text says so. The classifier's posterior is the same as on v6. - Dynamic Models: drop an unused `import RxInfer.ReactiveMP: getinterface, materialize!`. Checked by running all eleven RxInfer notebooks headless in Pluto, on Julia 1.13 in one environment with RxInfer's `refactor/reactivemp-v7` branch, ReactiveMP v7 and its rule packages developed by path. None errors, apart from the cell in "RxInfer tips and tricks" that errors on purpose, whose message is unchanged. Against the notebooks' own environments on Julia 1.12 the printed results agree, except PP4's free energy with inferred Q, 358.0 before and 357.2 now, which comes from ReactiveMP v7's corrected variational rule for MvNormalMeanCovariance (its conclusion holds), and the Factor Graphs regression, whose data differs on Julia 1.13 because `hash(seed)` in `stable_rand` changed there (v6 and v7 agree exactly on the same Julia). Not mergeable yet: the embedded Pluto environments still pin RxInfer 5, and the v7 packages are not registered. Once they are, re-pin the notebooks (tools/update_notebook_packages.jl) and add ProbitMessagePassingRules to PP2's environment. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ReactiveMP v7's `+` is n-ary: its interfaces are `out` and the group `in`, not `in1` and `in2`. The two addition-node cells pass the terms as a tuple, and the backward message targets the first term, `(:in, 1)`, with `nothing` at its own position. The messages are the same as before, N(3, 2) and N(1, 2). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ProbitMessagePassingRules does not exist: the Probit node is part of StandardMessagePassingRules, which RxInfer loads, so the notebook loads RxInfer alone and says so. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
RxInfer 6.1.0 and ReactiveMP 7.0.0 are registered, so the eight notebooks that load RxInfer (Factor Graphs, Dynamic Models, Intelligent Agents and Active Inference, PP1-PP4, RxInfer tips and tricks) now pin RxInfer ~6.1.0, resolved on Julia 1.12.7 like pluto-deployment-environment. In PP2, DataFrames' PrettyTables 2.4 conflicted with RxInfer 6.1's PrettyTables 3 compat, so its environment was updated as a whole within the existing compat bounds. The assignments keep their own RxInfer 4 pins. All eight notebooks run headless in Pluto without errors, apart from the cell in "RxInfer tips and tricks" that errors on purpose. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A1, A2 and the resit pinned RxInfer 4.6/4.7 because tools/update_notebook_packages.jl only updates lectures, probprog and minis. They are templates whose only RxInfer code is `using RxInfer`, so they now pin RxInfer ~6.1.0 like the lecture notebooks, resolved on Julia 1.12.7. The resit's environment (Julia 1.10.10 before) was updated as a whole within its compat bounds. All three run headless in Pluto without errors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fonsp
approved these changes
Oct 27, 2026
fonsp
left a comment
Member
There was a problem hiding this comment.
Yes this looks great, thank you!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@fonsp this updates the course notebooks and assignments to RxInfer 6.1, which runs on ReactiveMP v7. Could you take a look?
Changes
@call_rulecells now usegetresult(@call_message_update_rule(node = f, target = ..., m = (...))). In v7,+is n-ary: its terms are passed as the groupinand the backward message goes to(:in, 1). The messages are the same as before.Probitis still exported by RxInfer, since it now lives in StandardMessagePassingRules, which RxInfer loads. The sentence that introduces it now says so.import RxInfer.ReactiveMP: getinterface, materialize!is removed.RxInfer = "~6.1.0". They were resolved on Julia 1.12.7, the same version aspluto-deployment-environment. Those notebooks are Factor Graphs, Dynamic Models, Intelligent Agents and Active Inference, PP1–PP4 and RxInfer tips and tricks.tools/update_notebook_packages.jlonly updateslectures,probprogandminis. They now pinRxInfer = "~6.1.0"too, resolved on Julia 1.12.7.using RxInfer; students write the models. A1 is picked up on 4 Dec, so no student has started on them yet.Verification
All eleven notebooks were run headless in Pluto on Julia 1.12.7. None errors, apart from the cell in "RxInfer tips and tricks" that errors on purpose (a Dirichlet prior with no conjugate product).
The assignment cells that students fill in are empty, so I also tested an A2-style model on RxInfer 6.1: an MvNormal likelihood with priors on μ and Σ, inferred with mean-field VMP. It recovers the true mean and covariance.
An earlier comparison against the old v6 environments found the same printed results, with one exception. In PP4, the free energy with inferred Q changes slightly from 358.0 to 357.2, because ReactiveMP v7 corrected the variational rule for
MvNormalMeanCovariance. The notebook's conclusion still holds.Possible follow-up: add
getfrom("assignments")totools/update_notebook_packages.jl, so future bumps include the assignments. That script's update level would also bump the assignments' other packages, so I left it out of this PR.🤖 Generated with Claude Code