Skip to content

Update the RxInfer notebooks and assignments to RxInfer 6.1 (ReactiveMP v7) - #309

Merged
fonsp merged 5 commits into
bmlip:mainfrom
bvdmitri:reactivemp-v7
Oct 27, 2026
Merged

fonsp merged 5 commits into
bmlip:mainfrom
bvdmitri:reactivemp-v7

Conversation

@bvdmitri

@bvdmitri bvdmitri commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

@fonsp this updates the course notebooks and assignments to RxInfer 6.1, which runs on ReactiveMP v7. Could you take a look?

Changes

  • Factor Graphs: the @call_rule cells now use getresult(@call_message_update_rule(node = f, target = ..., m = (...))). In v7, + is n-ary: its terms are passed as the group in and the backward message goes to (:in, 1). The messages are the same as before.
  • PP2: Probit is still exported by RxInfer, since it now lives in StandardMessagePassingRules, which RxInfer loads. The sentence that introduces it now says so.
  • Dynamic Models: an unused import RxInfer.ReactiveMP: getinterface, materialize! is removed.
  • Notebook environments: the eight notebooks that load RxInfer now pin RxInfer = "~6.1.0". They were resolved on Julia 1.12.7, the same version as pluto-deployment-environment. Those notebooks are Factor Graphs, Dynamic Models, Intelligent Agents and Active Inference, PP1–PP4 and RxInfer tips and tricks.
    • PP2's whole environment was updated within its existing compat bounds. DataFrames pulled in PrettyTables 2.4, which conflicts with RxInfer 6.1.
  • Assignments: A1, A2 and the resit pinned RxInfer 4.6/4.7, because tools/update_notebook_packages.jl only updates lectures, probprog and minis. They now pin RxInfer = "~6.1.0" too, resolved on Julia 1.12.7.
    • The resit's environment was on Julia 1.10.10 and was updated as a whole within its compat bounds.
    • Their only RxInfer code is 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") to tools/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

bvdmitri and others added 5 commits September 30, 2026 09:48
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>
@bvdmitri bvdmitri changed the title Update the RxInfer notebooks to RxInfer 6.1 (ReactiveMP v7) Update the RxInfer notebooks and assignments to RxInfer 6.1 (ReactiveMP v7) Oct 22, 2026

@fonsp fonsp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this looks great, thank you!

@fonsp
fonsp merged commit c1dcbe3 into bmlip:main Oct 27, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants