fix(tilting): one coordinate row per distinct target - #235
Merged
thomaspinder merged 1 commit intoJul 29, 2026
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/150-entropic-tilting #235 +/- ##
=========================================================
Coverage 94.6% 94.6%
=========================================================
Files 44 44
Lines 3077 3095 +18
Branches 355 359 +4
=========================================================
+ Hits 2911 2929 +18
Misses 117 117
Partials 49 49 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
thomaspinder
force-pushed
the
feat/150-entropic-tilting
branch
from
July 29, 2026 13:41
4cd35a4 to
3739b1e
Compare
`target_label` names the quantity a target constrains, not the value asked of it, so passing the same target twice gave the `target` coordinate two identical labels and `.sel(target=...)` two rows. `build_moments` now canonicalises the target list before the solve and returns it alongside `(G, t)`: - A target repeated verbatim is redundancy, not a mistake — one moment column achieves it exactly as the duplicated pair would — so the repeat is dropped silently, first occurrence kept, order preserved. - Two *different* targets sharing a label (same event, two probabilities; same mean, two values) are contradictory. They used to surface late as a joint-infeasibility failure from the dual, naming neither the label nor the values that clash; they now raise immediately with both. `tilt_result` labels the coordinate from the returned list, so `achieved` / `requested` / `event_draws` and `TiltedForecastResult .targets` all stay aligned with the columns of `G`. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Egjd7ToFeb9TQqFnfRQZxV
thomaspinder
force-pushed
the
fix/214-duplicate-target-labels
branch
from
July 29, 2026 13:49
b347489 to
85e0088
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up on the tilting branch (#213), stacked on
feat/150-entropic-tilting:Passing the same target twice produced duplicate
targetcoordinate labels — correct numbers, but.sel(target=...)returned multiple rows. Newdedupe_targets(called before any moment column is built) implements a two-way split:ValueErrornaming the label and both requested values — previously this surfaced only post-solve as an opaque "not jointly achievable" that named neither. The label pins the quantity; two values for it are contradictory constraints, and now they fail early and legibly.build_momentsreturns the deduped list soachieved/requested/event_draws/the coordinate all align;reverse_stress(single target) is a no-op pass-through.Closes #214
Gates
82 tilting+reverse-stress tests green (+8); branch fast suite 683 passed; ruff/ty clean.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Egjd7ToFeb9TQqFnfRQZxV