Skip to content

fix(csa): preserve diverse seed eligibility - #107

Merged
isty2e merged 1 commit into
mainfrom
fix/csa-seed-rounding
Jul 28, 2026
Merged

fix(csa): preserve diverse seed eligibility#107
isty2e merged 1 commit into
mainfrom
fix/csa-seed-rounding

Conversation

@isty2e

@isty2e isty2e commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Fixes #106.

pick_diverse_low_value_seed() assumes at least one observed distance score is greater than or equal to their arithmetic mean. Float accumulation can violate that assumption by one ULP, leaving the eligible set empty even when every distance is finite and non-negative.

The normal selection path is unchanged. If rounding empties the eligible set, selection falls back to all candidates at the maximum observed distance and applies the existing objective-value ordering. The regression test uses six repeated 1 / 58 distances, which reproduce the failure on main.

Verification:

  • uv run --extra test pytest -q tests/csa/test_csa_selection.py
  • Ruff check and format
  • basedpyright on the changed source and test
  • pre-commit on both files

@isty2e
isty2e merged commit ff48fa4 into main Jul 28, 2026
8 checks passed
@isty2e
isty2e deleted the fix/csa-seed-rounding branch July 28, 2026 03:15
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.

CSA seed selection can empty the eligible set through float rounding

1 participant