Skip to content

fix(calibration): tolerate a symfluence without get_calibration_slice (0.2.4) - #8

Merged
DarriEy merged 1 commit into
mainfrom
release/calibration-window-fallback
Jul 28, 2026
Merged

fix(calibration): tolerate a symfluence without get_calibration_slice (0.2.4)#8
DarriEy merged 1 commit into
mainfrom
release/calibration-window-fallback

Conversation

@DarriEy

@DarriEy DarriEy commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Why

This package calls InMemoryModelWorker.get_calibration_slice(), added to symfluence after the 0.9.2 currently on PyPI.

The call sites live inside the except Exception in compute_gradient / evaluate_with_gradient. So against a released symfluence the AttributeError is swallowed — no crash, no traceback — and the differentiable loss quietly stops being restricted to the calibration period. That is precisely the evaluation-period leakage this package was just fixed for, reintroduced silently by a version mismatch.

Publishing the fix without this would therefore ship a package that appears to work and does not.

What

_calibration_slice(worker): use the shared implementation whenever the core provides it, otherwise compute the window locally.

This decouples releasing this fix from cutting a symfluence release, and keeps users pinned to an older core correct rather than silently wrong. Once a symfluence carrying the shared helper is on PyPI the fallback becomes dead code and can be dropped.

Verification

New tests/test_calibration_slice_fallback.py (7 tests):

  • the fallback selects the same window the shared implementation does — pinned by direct comparison, so upgrading symfluence cannot move results
  • unset / malformed / non-overlapping periods return None rather than degrading to "score everything"

Checked across all seven model packages: both paths return an identical slice.

Bumps version to 0.2.4.

Related

Follows the calibration-window fixes merged in symfluence-org/SYMFLUENCE#392 and #393 and the seven model-package PRs.

🤖 Generated with Claude Code

… (0.2.4)

This package calls InMemoryModelWorker.get_calibration_slice(), which
landed in symfluence after the 0.9.2 currently on PyPI. The call sites sit
inside the except Exception in compute_gradient / evaluate_with_gradient,
so on a released symfluence the AttributeError would be swallowed: no
crash, no traceback, and the loss would quietly stop being restricted to
the calibration period — reintroducing exactly the leakage this package was
just fixed for.

Add _calibration_slice(worker): use the shared implementation whenever the
core provides it, otherwise compute the window locally. That decouples
publishing this fix from cutting a symfluence release, and keeps users
pinned to an older core correct rather than silently wrong.

Verified the two paths return an identical slice, and that an unset,
malformed or non-overlapping period yields None rather than "score
everything".

Bumps version to 0.2.4.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@DarriEy
DarriEy force-pushed the release/calibration-window-fallback branch from d24576a to 4eabc8d Compare July 28, 2026 21:38
@DarriEy
DarriEy merged commit 8da9b35 into main Jul 28, 2026
2 checks passed
@DarriEy
DarriEy deleted the release/calibration-window-fallback branch July 28, 2026 21:56
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.

1 participant