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

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

3 participants