Repository navigation
Conversation
A band is a tolerance on one target's relative error that the solve should hold rather than trade away. For each banded row the objective adds target_band_penalty * max(|relative error| - tolerance, 0). That is zero inside the band, so it leaves the fit alone there, and outside it is a linear penalty. The relative error is the critical-target gate's, (estimate - target) / target. relative_error_loss, final_loss and the trajectory are unchanged; options["target_band"] records each banded row's final violation. Threaded through the Adam and proximal paths, the L0 budget search, calibrate, refit_l0_selection and calibrate_l0_refit. Off by default (target_band_penalty=0). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every row the critical-target gate judges (US_CRITICAL_TARGET_FIT_REQUIREMENTS, matched by the gate's own matcher) gets a band at 0.9 of its gate tolerance, with penalty 1. The band reaches the dense solve, the L0 refit and the exact-k ladder. --critical-target-band-penalty 0 turns it off; --critical-target-band-margin sets the fraction. Tests check that the band and the gate agree on every requirement, and that malformed flags are refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
solve.py is a spec input, so its bytes move the seed protocol and map hashes, the F0 coverage evidence, the multispine pool spec digest, the calibrate parity pins and the loader golden vector. The calibrate repin tool accepted (outputs unchanged); only the source digest moved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… edge cases The Opus review of a8e6ba3 approved with minor findings; this commit fixes them. - Solver: only banded rows enter the band term, so an unbanded target too small for float32 can no longer divide 0 by 0 in the gradient. A banded target that rounds to zero in float32 is refused. - Solver: a band whose every row the constraint matrix skipped is refused, like a band on no row. A partly skipped band lists the skipped names in options["target_band"]["skipped_banded_targets"]. - Retention and slope comments say what holds. Retention compares fit plus band, so it can keep an iterate slightly outside a band. The slope bound holds with the default loss scales. - Release: the CLI help and the comment no longer read as a guarantee. - Release: the diagnostics build block and the calibrating telemetry stage record the band's penalty, margin and banded row count. - Ladder: the config may pin critical_target_band_penalty and critical_target_band_margin, which are forwarded to the builder. Without them the builder's defaults apply. The docstring notes that the exact-k incumbent gate scores fit loss alone. - Tests: - every solve main() runs receives the band (a structural check over _main, plus the _main harness for the L0 and exact-k branches), and the ladder forwards it on all three calls (a spy and a structural check); - the band holds on the prox, budget-search and conserve-mass paths, and in the L0 refit; - the skip and float32 edge cases; - the launcher's band keys; - a differential against the real _critical_target_fit_failures replaces the circular band-vs-gate test. - us_critical_targets: a note on why the band is not a microcosm#492 per-target loss knob. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The seed protocol and map hashes, the F0 coverage evidence (41/41), the multispine pool spec digest, the calibrate parity pins and the loader golden vector all attest solve.py's bytes. The calibrate repin tool accepted, so outputs did not move. The provenance comments gain a #1330 entry that says US release solves change this time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tighter-band test, wording - D1: the launcher band test passed k=8, which the builder's --exact-k refuses; it now uses "N". - D2: the _main harness asserts that the build block the diagnostics writer receives, and the calibrating telemetry stage, carry the band record. - D3: a row two requirements match (the Social Security name with the itemized family and role) takes the tighter tolerance, checked against the real gate. - D4: retention keeps an iterate outside a band whenever the fit it gains exceeds the penalty times the violation it adds (no "slightly"). Past the band, the band's pull runs in the same direction as the target's own fit term rather than outweighing it. - Re-pins for solve.py's docstring bytes: seed protocol and map, F0 coverage (41/41), multispine spec digest, calibrate parity pins, loader golden. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Draft. This adds critical-target bands to US calibration. Max ruled on 2026-10-20 (d1749, revised) to fix the solve rather than hand-weight the SSA family. The PR stays a draft until the d1386 validation rerun below reports.
Why
The d1386 Route A release failed its critical-target gate. The Social Security benefits total came out 6.4% under SSA's figure, and the retirement total 8.5% under.
--target-family-loss-multiplier ssa=4fixed the number in an experiment, but it is a hand-tune that reweights a whole family to rescue one row.What
Solver (
microcosm.calibrate.solve):target_band_tolerancesandtarget_band_penalty. For each banded row the objective addspenalty * max(|relative error| - tolerance, 0):(estimate - target) / target, orestimate - targetwhen the target is 0;_optimize: the tracked objective and the closing comparison;_optimize_proximal;calibrate;refit_l0_selection;calibrate_l0_refit, in both phases.relative_error_loss,final_lossand the loss trajectory.options["target_band"]records each banded row's tolerance, final relative error and violation, the maximum violation, and any banded targets the constraint matrix skipped.penalty, in the same direction as the target's own fit term.Exact-k ladder (
us_runtime/exact_k_ladder.py): forwards the band to its three calibrate/refit calls.Release (
tools/build_us_fiscal_refresh_release.py):_critical_target_band_tolerancesbands every row that the 18US_CRITICAL_TARGET_FIT_REQUIREMENTSmatch, using the gate's own_critical_requirement_matches_target. A row matches by name, or by family plus role. Each band is the tightest matching tolerance times a margin.--critical-target-band-penalty: default 1; 0 turns the band off; finite and ≥ 0.--critical-target-band-margin: default 0.9; in (0, 1].calibration_diagnostics.jsonbuild.critical_target_bandand thecalibratingtelemetry stage record{penalty, margin, banded_rows}.non_sch_d_capital_gainsshipped at $74.6B against $10.2B. Banding it would let the weights absorb a defect instead of failing the build loudly. Its 9 rows were at most 10.8% off in the failed release, inside the gate. The validation rerun checks them.Exact-k ladder releases (
tools/build_us_exact_k_ladder_release.py):calibration.critical_target_band_penaltyandcalibration.critical_target_band_margin, which are forwarded to the builder. Without them the builder's defaults apply.Re-pins.
solve.pyis a spec input, so these moved:The calibrate repin tool accepted, so the parity outputs didn't move.
Invariants
These hold for every input.
The band term is ≥ 0, and it is 0 exactly when every banded row is inside its tolerance (
test_property_violation_is_the_distance_outside_the_band).Units don't matter: scaling a row's estimate and target together leaves its violation unchanged (
test_property_violation_does_not_depend_on_units).The torch and numpy forms agree: the torch term the solver minimizes equals
penalty * target_band_violations(...)(test_property_torch_term_matches_the_numpy_reference, a differential test).No band, no change: tolerances with penalty 0, or a band that never binds, gives weights bit-identical to a solve without a band (
test_tolerances_without_a_penalty_change_nothing,test_a_band_that_never_binds_changes_nothing).Band and gate agree.
test_the_band_covers_exactly_what_the_real_gate_judgesis a differential against the real_critical_target_fit_failures. Its fixture covers:With each banded row's error at 1.001× its gate tolerance, the gate fails exactly the banded rows; at 0.999×, it fails none.
Malformed input is refused:
Tests
test_target_bands.py, 23 tests:test_us_release_critical_target_band.py:_maincan run receives**band_kwargs, and that the ladder forwards the band on all three calls._mainharness (test_main_writes_diagnostics_before_post_calibration_gate_failure): the L0 and exact-k branches receive the band, and the diagnostics record it.test_solve.py, the graph parity pins and thetest_spec_engine_*suites.Review
a8e6ba3fdapproved, with no blocker or major findings.c51e64774addresses its minor findings and nits;277b321d2re-pins.277b321d2requested changes for one finding, D1 (major): a new launcher test passedk=8, which the builder refuses. It confirmed F1–F12 fixed.e6beb31a4:solve.pybytes alone.Validation rerun (2026-10-21, code
e6beb31a4): the gate holds, but the fit converges far more slowlyThe d1386 release was rerun from this branch with the band at its defaults (penalty 1, margin 0.9) and no multiplier. It ran on the saved target frame, inside reservation route-a-band-exp-2026-10-21. All three runs are scored on the failed release's loss weights.
893/route-a-rerun-20261018/experiments/band/band-comparison-e6beb31a4584.txt.experiments/band/synthetic/band_dynamics.py. So the cause on the real problem is unconfirmed.--target-family-loss-multiplier ssa=4, which fixed Social Security with no fit cost. This PR's next step is to replace the fixed penalty with an adaptive multiplier: each critical row's penalty starts at 0 and rises only while that row is outside its band.Plan
solve.pybytes)a8e6ba3fd), findings addressedc51e64774..277b321d2(REQUEST_CHANGES on D1; fixed)e6beb31a4(Opus 5.5, APPROVE)🤖 Generated with Claude Code