Skip to content

Refactor addon system to annotations#596

Merged
bvdmitri merged 25 commits intorelease-6from
refactor-addons
Apr 7, 2026
Merged

Refactor addon system to annotations#596
bvdmitri merged 25 commits intorelease-6from
refactor-addons

Conversation

@bvdmitri
Copy link
Copy Markdown
Member

@bvdmitri bvdmitri commented Apr 7, 2026

Replaces the old addon system with a simpler, more efficient annotations system.

Highlights

  • Message and Marginal now carry an AnnotationDict (lazy-allocated) instead of a typed addons tuple. Type parameter A removed: Message{D, A} → Message{D}.
  • Rules no longer return (result, addons) tuples — just the result. The @Logscale macro writes directly into the dict via annotate!.
  • Annotation processors (AbstractAnnotations subtypes) handle post-rule and post-product processing externally via post_rule_annotations! / post_product_annotations!.
  • Built-in processors: LogScaleAnnotations (replaces AddonLogScale) and InputArgumentsAnnotations (replaces AddonMemory).
    AddonDebug is removed — use callbacks instead.
  • Shims: AddonLogScale() and AddonMemory() throw descriptive errors pointing users to the replacements.
  • @call_rule: return_addons / addons keyword removed — pass an AnnotationDict via the annotations keyword and read it back.

Docs

  • New "Annotations" section: overview, log-scale, input arguments
  • New "Migration guides" section with a v5 → v6 guide
  • CHANGELOG updated

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

🤖 Code Formatting

Your PR still has some code formatting issues. I've updated PR #597 with the necessary formatting changes.

You can merge that PR into this branch to fix the code style check.

Alternatively, you can run make format locally and push the changes yourself.

Co-authored-by: bvdmitri <6557701+bvdmitri@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 92.47312% with 14 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release-6@b8397a7). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/message.jl 77.27% 5 Missing ⚠️
src/ReactiveMP.jl 50.00% 1 Missing ⚠️
src/annotations.jl 97.50% 1 Missing ⚠️
src/marginal.jl 88.88% 1 Missing ⚠️
src/nodes/predefined/delta/delta.jl 0.00% 1 Missing ⚠️
src/nodes/predefined/delta/layouts/default.jl 0.00% 1 Missing ⚠️
src/nodes/predefined/distribution/distribution.jl 0.00% 1 Missing ⚠️
src/rule.jl 92.85% 1 Missing ⚠️
src/rules/mixture/out.jl 0.00% 1 Missing ⚠️
src/variables/data.jl 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             release-6     #596   +/-   ##
============================================
  Coverage             ?   81.73%           
============================================
  Files                ?      211           
  Lines                ?     6423           
  Branches             ?        0           
============================================
  Hits                 ?     5250           
  Misses               ?     1173           
  Partials             ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bvdmitri bvdmitri merged commit e47a371 into release-6 Apr 7, 2026
4 of 5 checks passed
@bvdmitri bvdmitri deleted the refactor-addons branch April 7, 2026 13:15
bvdmitri added a commit that referenced this pull request Apr 7, 2026
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.

1 participant