Skip to content

Address the review in #9: improper log scales, a new-scheme tutorial, docs - #11

Merged
bvdmitri merged 2 commits into
mainfrom
review/issue-9
Oct 6, 2026
Merged

bvdmitri merged 2 commits into
mainfrom
review/issue-9

Conversation

@bvdmitri

@bvdmitri bvdmitri commented Oct 6, 2026

Copy link
Copy Markdown
Member

Closes #9. Each point of the review, and what this changes:

  • The registry: what is it for? A new section on Inspecting rules, "What the registry is for", with an example: a module defines a node and two rules, and registered_rules, rule_coverage and a RuleNotFoundError's near misses all read its registry, while resolution, Julia's dispatch, never does. The Registry docstring points to it.
  1. Purity. Pure means that a call has no effect anyone outside it can observe, apart from its result, not that it writes nothing. The docstring of ispure and Algorithms and dependencies now list what a pure rule may do (allocate, write the output buffer it is handed, reuse its scratch, draw from ctx.rng, warn or log) and what makes one impure (mutating an input or its algorithm, writing globals or files, carrying its own generator).
  2. The tutorial's opening reads "builds a factor node step by step, starting from an empty module" (not "from scratch", since scratch is a term of this package).
  3. A Makefile: make test as CI runs it (TEST_ALL=true, FastCholesky throwing on asymmetry), with test_args="tag:… name:… <file>"; test-fast, docs, docs-serve (LiveServer is now in docs/Project.toml), format, check-format, clean.
  4. The overview shows the README's short example and points to the tutorial for the explanation.
  5. "Extending the default scheme" no longer names ContinuousTransition; it explains the need through the page's own Transition node.
  6. Resolution has a glossary entry (finding the rule that runs: Julia's dispatch over the methods the macros define), linked from its first use on each page; the registry sentences say that resolution does not use the registry.
  7. Expectation propagation and new schemes. The glossary entry points to A node with its own algorithm, whose rule towards the input is an EP rule. A new tutorial, A new message passing scheme, writes natural-gradient message passing for y ~ Poisson(exp(x)) as an algorithm, a dependency declaration (the rule reads its own belief q[:in]) and a closed-form rule, iterated to its fixed point, citing Information Geometry of Message Passing. It needs no package beyond the docs' usual ones.
  8. Log scales of improper messages. A new declaration, logscale = improper, for a message with no normalising constant, as an exact message may be: its log scale is an UndefinedLogScale with cause :improper, and require_logscale says that none exists, where an omitted logscale says that it is not known. The Log scales page has a section on improper messages, and the glossary qualifies the definition.

improper is a new public name, so this is a minor release, 1.1.0, once approved. The suite passes locally with CI's variables, and the docs build.

🤖 Generated with Claude Code

… docs

- `logscale = improper` declares a message rule whose message has no
  normalising constant, as an exact message may (the likelihood of a variance
  integrates to infinity): its log scale is an UndefinedLogScale with cause
  `:improper`, and require_logscale says that none exists, where an omitted
  `logscale` says that it is not known.
- A tutorial, "A new message passing scheme": natural-gradient message
  passing for a Poisson count with a log rate, as an algorithm, a dependency
  declaration and a rule, iterated to its fixed point; it cites Lukashchuk et
  al., Information Geometry of Message Passing (2026).
- What the registry is for, with an example; "resolution" defined in the
  glossary and linked from each page; purity explained by what a pure rule may
  and may not do; improper messages on the Log scales page and in the
  glossary; a shorter first example on the overview; the expectation
  propagation entry pointing to the tutorial that builds such a rule; the
  default-scheme example told through its own node; the first tutorial's
  opening reworded.
- A Makefile: test (as CI runs it, with test_args), test-fast, docs,
  docs-serve (LiveServer in the docs environment), format, check-format,
  clean.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

A RuleResult shows a log scale's source only when the log scale is a number,
and an improper rule's is always an UndefinedLogScale, so the method never
ran (Codecov's patch check).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@bvdmitri
bvdmitri requested a review from Nimrais October 6, 2026 08:19
@bvdmitri
bvdmitri merged commit 89843a8 into main Oct 6, 2026
10 checks passed
@bvdmitri
bvdmitri deleted the review/issue-9 branch October 6, 2026 09:16
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.

Review of the repo

1 participant