Skip to content

Prepare meds-algorithm 0.4.0a6 - #22

Merged
florian6973 merged 2 commits into
mainfrom
release-0.4.0a6
Nov 24, 2026
Merged

florian6973 merged 2 commits into
mainfrom
release-0.4.0a6

Conversation

@florian6973

@florian6973 florian6973 commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Downstream algorithms need the temporal-leakage conformance (#21) from PyPI. curiosity-meds currently pins meds-algorithm to git commit fa8cdfa, and PyPI rejects direct-URL dependencies, so it can't be released until this version is out.

What

Fix: future-blind check compared bit for bit

CI first failed in test_future_blind_rerun_passes_causal_and_fails_leaky (from #21): the leak-free toy scorer had 1 of 400 keys move by 5.55e-17, one unit in the last place. It failed reproducibly on the runners, with the same package versions that passed on main (numpy 2.5.4, polars 2.0.0) and locally.

Rewriting the future changes the row and chunk layout, and polars' float kernels can then round differently in the last bit on some CPUs. A bitwise check would fail leak-free downstream algorithms in the same way.

The check now uses a relative tolerance of 1e-12 (FUTURE_BLIND_RTOL, absolute 1e-15). That is far below the ~1e-7 move of the smallest leak measured in #21. A new test checks that this tolerance absorbs a one-ulp change but rejects a 1e-9 change. CONTRACT.md, TESTING.md and the release notes say so.

Checks (WSL Ubuntu, Python 3.12)

  • uv run ruff check . and uv run ruff format --check .: clean.
  • uv run pytest -q: 160 passed.
  • uv build and twine check --strict dist/*: wheel and sdist pass.

After merge

Tag v0.4.0a6 on main, then dispatch publish.yml: index=testpypi first, then index=pypi, as described in RELEASING.md. After that, bump the template's meds-algorithm pins to ==0.4.0a6.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NJQdbHt5icm1CgFVHsHTNx

Release the temporal-leakage conformance (#21), the process-group
termination fix (#15) and the raw-data access guard (#20) so
downstream algorithms can depend on them from PyPI instead of a git
commit (PyPI rejects direct-URL dependencies).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJQdbHt5icm1CgFVHsHTNx
On GitHub runners, test_future_blind_rerun_passes_causal_and_fails_leaky
failed for the leak-free toy scorer: 1 of 400 keys moved by 5.55e-17
(one unit in the last place) with the same package versions that passed
on main. Rewriting the future changes the row layout, and polars float
kernels can round differently in the last bit on some CPUs. Use a
relative tolerance of 1e-12 (absolute 1e-15): far below the ~1e-7 move
of the smallest leak measured in #21, so leaks are still caught, while
downstream algorithms are not failed for rounding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJQdbHt5icm1CgFVHsHTNx
@florian6973
florian6973 merged commit 06fd29a into main Nov 24, 2026
5 checks passed
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