Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jonahkagan
Copy link
Contributor

Alternate idea to fix #2100 that mimics the logic from supersimple.discrepancy

deltas = {
choice.id: int(reported[choice.id]) - int(audited[choice.id])
for choice in contest.choices
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jonahkagan jonahkagan force-pushed the jonah/fix-ess-cvr-error branch from 6ddd24c to bef3648 Compare August 21, 2025 17:12
return None
else:
deltas = {
choice.id: 1 - int(audited[choice.id]) for choice in contest.choices
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a little weird, though it's closer to what the math does. The math treats an overvote as a vote for the winner and a vote for the loser, whereas this logic treats an overvote as a vote for every candidate.

Copy link
Contributor

@arsalansufi arsalansufi left a comment

Choose a reason for hiding this comment

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

I know we're opening up a broader discussion about overvote handling, but what you've presented in this PR does seem sound and at least consistent with the current math

# delta. Otherwise, return discrepancies as usual, but substituting in
# overvotes/undervotes.
if has_overvote:
if audited_votes > 1:
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm I know this is just pulled from the audit math but do we need to account for the case that a contest allows for more than 1 vote?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ES&S CVRs only suport vote-for-1 so far: https://github.com/votingworks/arlo/blob/jonah/fix-ess-cvr-error/server/api/cvrs.py#L851-L853

We might want to add an assertion here and in the audit math about that assumption in case it changes

choice.id: 1 - int(audited[choice.id]) for choice in contest.choices
}
elif has_undervote:
if audited_votes < 1:
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm assuming undervote here refers to a completely undervoted, i.e., blank contest. And not a vote for N where someone didn't vote for 0 but just some number less than N

@arsalansufi
Copy link
Contributor

Pausing for now per #2100 (comment)

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.

3 participants