Skip to content

Conversation

@abpolym
Copy link
Member

@abpolym abpolym commented Nov 1, 2025

Relevant issue: #294

I would like to get a first review on the code.
The code now checks for misnamed interfaces, including extra interfaces etc (see issue).

Potential things to do:

  • Aliases are not considered right now
  • Tests are missing
  • basic test_rule macro invokation test in test_rules.jl is breaking due to specification of a node that is unknown when the rule for that node is being called

@abpolym abpolym requested a review from bvdmitri November 1, 2025 04:52
@abpolym abpolym linked an issue Nov 1, 2025 that may be closed by this pull request

q_names, q_types, q_init_block = rule_macro_parse_fn_args(inputs; specname = :marginals, prefix = :q_, proxy = :Marginal)

fform_type = Core.eval(__module__, fformtype)
Copy link
Member

Choose a reason for hiding this comment

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

Let's not use eval, is very dangerous especially when macro generating the code (you have eval inside of eval). Is using the fuppertype (defined above) not sufficient?

Copy link
Member

Choose a reason for hiding this comment

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

I also think that the tests are failing exactly because of the eval, since it evaluates inside the ReactiveMP, but the structure in tests is defined outside of ReactiveMP

Copy link
Member

Choose a reason for hiding this comment

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

We should also add a test, that actually checks that the error is being thrown by defining a rule with wrong interfaces

@github-actions
Copy link
Contributor

🤖 Code Formatting

Your PR still has some code formatting issues. I've updated PR #559 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.

Copy link
Member

@bvdmitri bvdmitri left a comment

Choose a reason for hiding this comment

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

I still have some idea for this PR so lets not merge just yet

@codecov
Copy link

codecov bot commented Nov 18, 2025

Codecov Report

❌ Patch coverage is 85.18519% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.58%. Comparing base (8a0be85) to head (2958770).
⚠️ Report is 55 commits behind head on main.

Files with missing lines Patch % Lines
src/helpers/macrohelpers.jl 77.35% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #545      +/-   ##
==========================================
+ Coverage   76.17%   79.58%   +3.40%     
==========================================
  Files         207      211       +4     
  Lines        6149     6249     +100     
==========================================
+ Hits         4684     4973     +289     
+ Misses       1465     1276     -189     

☔ 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.

Copy link
Member

@bvdmitri bvdmitri left a comment

Choose a reason for hiding this comment

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

Thanks @abpolym and @wouterwln for helping with this!

@bvdmitri bvdmitri merged commit 9b9c229 into main Nov 20, 2025
7 of 8 checks passed
@bvdmitri bvdmitri deleted the 294-rule-marginalrule-and-average_energy-should-check-interface-names branch November 20, 2025 13:05
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.

@rule, @marginalrule and @average_energy should check interface names

4 participants