Skip to content

Fix CSA adaptive bank growth reference sync#48

Merged
isty2e merged 1 commit into
mainfrom
fix/csa-adaptive-bank-growth-state
Jul 2, 2026
Merged

Fix CSA adaptive bank growth reference sync#48
isty2e merged 1 commit into
mainfrom
fix/csa-adaptive-bank-growth-state

Conversation

@isty2e

@isty2e isty2e commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

CSA adaptive bank growth can append entries after the reference bank has already been initialized. The previous boundary sync treated len(reference_bank.entries) == len(bank.entries) as the initialization check, so an adaptive append made the active bank longer than the reference bank and caused the reference bank to be rebuilt from the active bank.

This change gives ReferenceBank an explicit initialization state and uses that state at the boundary sync. Once the first complete reference snapshot exists, adaptive growth no longer re-sorts or rebuilds it just because the active bank grew.

Impact

  • Preserves the original reference-bank snapshot across adaptive bank growth.
  • Keeps clustering labels, seed-selection status, and progression masks aligned with appended bank entries.
  • Keeps old checkpoint snapshots readable by deriving the initialization state when the field is absent.

Fixes #25

Validation

  • uv run --python 3.11 --extra test pytest tests -q
  • uv run --python 3.11 --extra test ruff check pyproject.toml src tests
  • uv run --python 3.11 --extra test basedpyright src tests
  • git diff --cached --check

@isty2e isty2e marked this pull request as ready for review July 2, 2026 13:59
@isty2e isty2e merged commit 4acbc36 into main Jul 2, 2026
3 checks passed
@isty2e isty2e deleted the fix/csa-adaptive-bank-growth-state branch July 2, 2026 13:59
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.

[High] CSA adaptive bank growth desynchronizes cluster labels, selection state, and progression masks

1 participant