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

🐛 attempt to fix banded scoring with exceptions #1359

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

imilchev
Copy link
Member

@imilchev imilchev commented Jul 8, 2024

Second attempt at fixing banded scoring, after #1350 didn't fully work

@imilchev imilchev marked this pull request as draft July 8, 2024 15:13
@@ -490,22 +468,22 @@ func (c *bandedScoreCalculator) Add(score *Score, impact *explorer.Impact) {

if category <= 10 {
c.critMax += score.Weight
if score.Value == 100 {
if score.Value < 100 {
Copy link
Member Author

Choose a reason for hiding this comment

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

based on my understanding the counter should only increase if the score is not Pass

Copy link
Contributor

Choose a reason for hiding this comment

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

based on the Calculate function, I think c.crit and the rest are supposed to count the number of failures:

		if c.crit != 0 {
			res.Value = uint32(math.Floor(float64(50) * pcrCrit))
		} else if c.high != 0 {
			res.Value = uint32(math.Floor(float64(50)*pcrHigh)) + 10

If there failures, we need to fall into the first category with failures.

So this all seems right to me

// 10 high checks
{Value: &explorer.ImpactValue{Value: 80}},
},
out: &Score{Value: 100, ScoreCompletion: 100, DataCompletion: 66, Weight: 20, Type: ScoreType_Result},
Copy link
Member Author

Choose a reason for hiding this comment

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

I added a case with all passing checks. I would expect if everything passed, then the policy score should also be 100. In the original code that is not the case. It works now, however, the values for the other cases changed too...

@@ -67,28 +67,6 @@ func AddSpecdScore(calculator ScoreCalculator, s *Score, found bool, impact *exp
return
}

// everything else is modify or activate

if impact.Scoring == explorer.ScoringSystem_IGNORE_SCORE {
Copy link
Member Author

Choose a reason for hiding this comment

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

in #1350 I already made sure all the calculators handle exceptions properly, so this workaround shouldn't be needed anymore

Copy link
Contributor

github-actions bot commented Jul 8, 2024

Test Results

  1 files  ±0   24 suites  ±0   20s ⏱️ -1s
385 tests +1  384 ✅ +1  1 💤 ±0  0 ❌ ±0 
386 runs  +1  385 ✅ +1  1 💤 ±0  0 ❌ ±0 

Results for commit d6623c9. ± Comparison against base commit 4b001a6.

@imilchev imilchev marked this pull request as ready for review July 9, 2024 14:06
@imilchev imilchev merged commit 8a40273 into main Jul 9, 2024
13 checks passed
@imilchev imilchev deleted the ivan/fix-banded-scoring branch July 9, 2024 14:06
@github-actions github-actions bot locked and limited conversation to collaborators Jul 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants