Skip to content

Conversation

@Sam-61s
Copy link
Contributor

@Sam-61s Sam-61s commented Jan 28, 2026

Combine multiple failing multipleOf constraints at the same instance location
into a single error message by computing their LCM. Tests included.

Closes #139

Copy link
Collaborator

@jdesrosiers jdesrosiers left a comment

Choose a reason for hiding this comment

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

Great start. I've asked for a couple refinements inline.

"errors": []
},
{
"description": "multiple multipleOf constraints (combined)",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good test! But, this needs a better name. This is checking the LCM logic right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why'd you delete this test? This was a necessary test for the LCM logic. It just needed a better name. The other test is not sufficient to test LCM. An implementation that naively multiplied the value of all multipleOf values would pass that test. This test would catch that bug.

@Sam-61s
Copy link
Contributor Author

Sam-61s commented Jan 28, 2026

Hii @jdesrosiers,
I think I've resolved all the inline refinements.

Updated multipleOf handler to combine constraints as we iterate.
Adjusted the tests in multipleOf.json to keep only the essential case and renamed the combined test to clearly reflect the LCM behavior.

Please let me know if you’d like any further changes.

@Sam-61s
Copy link
Contributor Author

Sam-61s commented Jan 29, 2026

@jdesrosiers I've added the test with multipleOf: 4, 6, 8 to catch the multiplication bug. Should I keep both tests (the 3, 2 case and the 4, 6, 8 case), or remove the 3, 2 test and keep only the 4, 6, 8 one? The 3, 2 test is a simpler two-value case, but the 4, 6, 8 test already validates LCM. What do you prefer?

@jdesrosiers
Copy link
Collaborator

Just the one test might be enough. I can't think of a case where the 2-value case would fail but the 3-value would pass. I think just the three-value case would be fine.

@Sam-61s
Copy link
Contributor Author

Sam-61s commented Jan 29, 2026

I’ve kept only the three-value test case (multipleOf: 4, 6, 8) to validate proper LCM handling and catch the multiplication bug.
Please let me know if anything else needs tweaking.

Copy link
Collaborator

@jdesrosiers jdesrosiers left a comment

Choose a reason for hiding this comment

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

Thanks!

@jdesrosiers jdesrosiers merged commit 626bdc0 into hyperjump-io:main Jan 29, 2026
1 check passed
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.

Combine multipleOf messages

2 participants