Skip to content

Conversation

@triceo
Copy link
Collaborator

@triceo triceo commented Dec 21, 2025

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 (long and BigDecimal only). 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.

Copy link
Contributor

Copilot AI left a 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 UndoScoreImpacter with ScoreImpact interface
  • Consolidating scorer implementations into a unified Scorer class

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.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@ge0ffrey
Copy link
Contributor

Note there is probably a merge conflict on IndexerFactory with #1999
As usual, the later one merged will have to figure it out?

@triceo
Copy link
Collaborator Author

triceo commented Dec 26, 2025

Note there is probably a merge conflict on IndexerFactory with #1999 As usual, the later one merged will have to figure it out?

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.

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.

2 participants