Skip to content
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

Fix double comp #646

Merged
merged 1 commit into from
Mar 18, 2024
Merged

Fix double comp #646

merged 1 commit into from
Mar 18, 2024

Conversation

fdc-ntflx
Copy link
Collaborator

Context

Explain context and other details for this pull request.

Checklist

  • ./gradlew build compiles code correctly
  • Added new tests where applicable
  • ./gradlew test passes all tests
  • Extended README or added javadocs where applicable

Copy link

Test Results

501 tests  ±0   495 ✅ ±0   7m 29s ⏱️ +2s
129 suites ±0     6 💤 ±0 
129 files   ±0     0 ❌ ±0 

Results for commit 51737d9. ± Comparison against base commit e86e77a.

Copy link

github-actions bot commented Mar 18, 2024

Test Results

501 tests  ±0   495 ✅ ±0   7m 29s ⏱️ +2s
129 suites ±0     6 💤 ±0 
129 files   ±0     0 ❌ ±0 

Results for commit 988abfa. ± Comparison against base commit e86e77a.

♻️ This comment has been updated with latest results.

@@ -611,7 +612,7 @@ private Optional<TaskExecutorGroupKey> findBestGroupByFitnessCalculator(Scheduli
// one with size and one without. Due to this, issues may arise during task migrations as it's not
// predictable which TEs will be chosen by the scheduler. While, instead, we want to always use TEs from the latest ASGs.
.sorted((entry1, entry2) -> {
int fitnessComparison = entry2.getValue().compareTo(entry1.getValue());
int fitnessComparison = DoublePrecisionComparator.compare(entry2.getValue(), entry1.getValue());
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: unit test

public static int compare(Double value1, Double value2) {
double valueDifference = value1 - value2;

if (Math.abs(valueDifference) < 1E-14) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

btw do we need such high precision on these?

Copy link
Collaborator

@sundargates sundargates left a comment

Choose a reason for hiding this comment

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

LGTM!

@fdc-ntflx fdc-ntflx merged commit 4a06adb into master Mar 18, 2024
6 of 7 checks passed
@fdc-ntflx fdc-ntflx deleted the fix-double-comp branch March 18, 2024 22:27
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.

None yet

3 participants