-
Notifications
You must be signed in to change notification settings - Fork 167
chore: refactor tuples and scoring #1992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
b4521d9 to
e361263
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors tuple access and scoring infrastructure in preparation for dropping int-based scores, making scoring bimorphic (supporting only long and BigDecimal). The changes replace direct field access on tuples with getter/setter methods and introduce a new ScoreImpact interface to replace the functional UndoScoreImpacter interface.
Key changes include:
- Replacing public tuple fields with accessor methods (
getA(),setA(), etc.) - Replacing
UndoScoreImpacterwithScoreImpactinterface - Consolidating scorer implementations into a unified
Scorerclass
Reviewed changes
Copilot reviewed 238 out of 238 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| UniEnumeratingStreamTest.java | Updated test to use UniTuple.getA() instead of direct field access |
| SimpleScoreInlinerTest.java | Changed variable names from undo1/undo2 to impact1/impact2 and updated method calls to undo() |
| SimpleLongScoreInlinerTest.java | Changed variable names from undo1/undo2 to impact1/impact2 and updated method calls to undo() |
| SimpleBigDecimalScoreInlinerTest.java | Changed variable names from undo1/undo2 to impact1/impact2 and updated method calls to undo() |
| HardSoftScoreInlinerTest.java | Changed variable names from undo1/undo2 to impact1/impact2 and updated method calls to undo() |
| HardSoftLongScoreInlinerTest.java | Changed variable names from undo1/undo2 to impact1/impact2 and updated method calls to undo() |
| HardSoftBigDecimalScoreInlinerTest.java | Changed variable names from undo1/undo2 to impact1/impact2 and updated method calls to undo() |
| HardMediumSoftScoreInlinerTest.java | Changed variable names from undo1/undo2 to impact1/impact2 and updated method calls to undo() |
| HardMediumSoftLongScoreInlinerTest.java | Changed variable names from undo1/undo2 to impact1/impact2 and updated method calls to undo() |
| HardMediumSoftBigDecimalScoreInlinerTest.java | Changed variable names from undo1/undo2 to impact1/impact2 and updated method calls to undo() |
| BendableScoreInlinerTest.java | Changed variable names from undo1/undo2 to impact1/impact2 and updated method calls to undo() |
| BendableLongScoreInlinerTest.java | Changed variable names from undo1/undo2 to impact1/impact2 and updated method calls to undo() |
| BendableBigDecimalScoreInlinerTest.java | Changed variable names from undo1/undo2 to impact1/impact2 and updated method calls to undo() |
| FlattenLastUniNodeTest.java | Updated tuple creation and field access to use factory methods and getters/setters |
| WeightedScoreImpacter.java | Changed return type from UndoScoreImpacter to ScoreImpact<Score_> |
| UndoScoreImpacter.java | Removed interface |
| ScoreImpact.java | New interface replacing UndoScoreImpacter |
| SimpleScoreContext.java | Refactored to use ScoreImpact and added inner record class |
| SimpleLongScoreContext.java | Refactored to use ScoreImpact and added inner record class |
| SimpleBigDecimalScoreContext.java | Refactored to use ScoreImpact and added inner record class |
| HardSoftScoreContext.java | Consolidated score impact methods and added inner record class |
| HardSoftLongScoreContext.java | Consolidated score impact methods and added inner record class |
| HardSoftBigDecimalScoreContext.java | Retained separate methods for hard/soft scoring and added multiple inner record classes |
| HardMediumSoftScoreContext.java | Consolidated score impact methods and added inner record class |
| HardMediumSoftLongScoreContext.java | Consolidated score impact methods and added inner record class |
| HardMediumSoftBigDecimalScoreContext.java | Retained separate methods for hard/medium/soft scoring and added multiple inner record classes |
| BendableScoreContext.java | Refactored to use ScoreImpact and added multiple inner record classes |
| BendableLongScoreContext.java | Refactored to use ScoreImpact and added multiple inner record classes |
| BendableBigDecimalScoreContext.java | Refactored to use ScoreImpact and added multiple inner record classes |
| AbstractScoreInliner.java | Updated constraint match handling to use ScoreImpact |
| UniScorer.java | Removed in favor of unified Scorer class |
| UniScoreImpacter.java | New interface extending ScoreImpacter |
| UniLongImpactHandler.java | New record implementing impact handling |
| UniIntImpactHandler.java | New record implementing impact handling |
| UniImpactHandler.java | New sealed interface for uni tuple impact handling |
| UniBigDecimalImpactHandler.java | New record implementing impact handling |
| BavetScoringUniConstraintStream.java | Refactored to use new impact handler architecture |
| TriScorer.java | Removed in favor of unified Scorer class |
| TriScoreImpacter.java | New interface extending ScoreImpacter |
| TriLongImpactHandler.java | New record implementing impact handling |
| TriIntImpactHandler.java | New record implementing impact handling |
| TriImpactHandler.java | New sealed interface for tri tuple impact handling |
| TriBigDecimalImpactHandler.java | New record implementing impact handling |
| BavetScoringTriConstraintStream.java | Refactored to use new impact handler architecture |
| QuadScorer.java | Removed in favor of unified Scorer class |
| QuadScoreImpacter.java | New interface extending ScoreImpacter |
| QuadLongImpactHandler.java | New record implementing impact handling |
| QuadIntImpactHandler.java | New record implementing impact handling |
| QuadImpactHandler.java | New sealed interface for quad tuple impact handling |
| QuadBigDecimalImpactHandler.java | New record implementing impact handling |
| BavetScoringQuadConstraintStream.java | Refactored to use new impact handler architecture |
| Scorer.java | New unified scorer class replacing tuple-specific scorers |
| ScoreImpacter.java | New functional interface for score impacting |
| ImpactHandler.java | New interface defining impact handler contract |
| BavetScoringConstraintStream.java | Removed helper methods in favor of impact handler architecture |
| BiScorer.java | Removed in favor of unified Scorer class |
| BiScoreImpacter.java | New interface extending ScoreImpacter |
| BiLongImpactHandler.java | New record implementing impact handling |
| BiIntImpactHandler.java | New record implementing impact handling |
| BiImpactHandler.java | New sealed interface for bi tuple impact handling |
| BiBigDecimalImpactHandler.java | New record implementing impact handling |
| BavetScoringBiConstraintStream.java | Refactored to use new impact handler architecture |
| Multiple tuple-related files | Updated tuple creation and field access to use factory methods and getters/setters |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
Note there is probably a merge conflict on IndexerFactory with #1999 |
At the moment, I do not know which one that will be. That said, this PR has 2000 lines of code changes - rebasing this would be a nightmare. |




Changes the tuples to be all backed by a single type.
Refactors scoring to use that single type.
This is in preparation for the future, when we will drop the
int-based scores, making the scoring bimorphic (longandBigDecimalonly). This will improve performance in the future, but did not cause regressions now.The PR is large, but that's because of all the copy-paste. This PR is, in fact, 2 or three conceptual changes, copied all over the place 20 times.