Skip to content

fix: improve error message for invalid factorization constraint set (#293) - #335

Open
ArpanC6 wants to merge 2 commits into
ReactiveBayes:mainfrom
ArpanC6:fix/293-constraint-error
Open

ArpanC6 wants to merge 2 commits into
ReactiveBayes:mainfrom
ArpanC6:fix/293-constraint-error

Conversation

@ArpanC6

@ArpanC6 ArpanC6 commented Oct 7, 2026

Copy link
Copy Markdown

Fixes #293

The error message thrown when a factorization constraint set is invalid was hard to interpret. The raw BoundedBitSetTuple matrix printed in the error gave users no real guidance on what went wrong or how to fix it.

I added a short hint to the error message explaining what a valid constraint set actually requires so users have something actionable to go on rather than just a matrix of booleans.

Hint

A valid constraint set requires that each interface belongs to exactly one factorization group. In the constraint matrix, each column must have exactly one non-zero entry per group. Make sure all variables appearing in your model are included in your factorization constraint.

Changes

  • src/plugins/variational_constraints/variational_constraints_engine.jl - added hint to error message
  • test/plugins/variational_constraints/variational_constraints_engine_tests.jl - added test asserting the hint is present

Test plan

  • New test passes locally.
  • Existing tests still pass.

@ArpanC6

ArpanC6 commented Oct 7, 2026 •

Copy link
Copy Markdown
Author

Hi @bvdmitri, the CI workflows are showing "Action required" for my PR #335. I see this is a fork-based PR from ArpanC6:fix/293-constraint-error. Could you please approve the workflow runs so CI can start? The change is small: a descriptive hint in the invalid factorization constraint set error message plus a regression test. Thanks!

Comment thread src/graph_engine.jl Outdated
Base.length(label::NodeLabel) = 1
Base.size(label::NodeLabel) = ()
Base.getindex(label::NodeLabel, any) = label
Base.getindex(label::NodeLabel, i1, is...) = label

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.

Why is this necessary for updating the error message?

Comment thread CHANGELOG.md Outdated

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.

We dont have CHANGELOG in this repository and this PR should not add it

@bvdmitri

bvdmitri commented Oct 8, 2026

Copy link
Copy Markdown
Member

This PR also seems to be a copy of https://github.com/ReactiveBayes/GraphPPL.jl/pull/303/changes

@ArpanC6
ArpanC6 force-pushed the fix/293-constraint-error branch from cc68b5a to 0b3221e Compare October 8, 2026 09:40
@ArpanC6

ArpanC6 commented Oct 8, 2026

Copy link
Copy Markdown
Author

@bvdmitri thanks for the review. I've rebased the branch and addressed all three points

  1. src/graph_engine.jl - the change was unrelated to this PR. It came in from the rebase onto upstream/main. It's no longer in the diff (the comment above is now marked Outdated).
  2. CHANGELOG.md - removed. I mistakenly added it during the rebase - this repository doesn't have a CHANGELOG.
  3. PR fix: support Colon() in middle of indices for NodeLabel (#275) #303 duplicate - the e84d5c5 and 284c117 commits were upstream commits that got pulled in during the rebase. I've rebased so the branch now contains only the two commits that are actually part of this change:

The diff is now just the error-message hint and its regression test. Could you please re-review and approve the workflow runs so CI can start? Thanks..

This branch has not been deployed

No deployments
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.

Possibly can improve constraint set error

2 participants