Skip to content

Publish per-target final loss attribution - #716

Merged
anth-volk merged 2 commits into
mainfrom
target-loss-attribution-output
Aug 18, 2026
Merged

Publish per-target final loss attribution#716
anth-volk merged 2 commits into
mainfrom
target-loss-attribution-output

Conversation

@anth-volk

@anth-volk anth-volk commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #715

Summary

  • retain the aligned final target-loss weights, scales, and cap on calibration, score-only, and L0 final-refit results
  • publish authoritative per-target final-loss attribution in calibration diagnostics schema version 6
  • validate alignment, basis values, deterministic hashing, and contribution agreement before publishing attribution
  • degrade attribution failures to loud runtime and structured diagnostics warnings while preserving core diagnostics
  • keep unrelated serialization and output failures under their existing fatal behavior
  • update the independent data-contract schema pin and add representative v6 fixtures

Contract

Each valid target row adds target_loss_weight, target_loss_weight_share, target_loss_scale, final_capped_scaled_error, and final_loss_contribution. The top-level target_loss_basis records the formula, cap, target count, total weight, kinds, hash algorithm, and ordered-basis digest. Contributions reproduce final_loss at 1e-12 relative or absolute tolerance.

Consumer

Dashboard implementation: PolicyEngine/calibration-diagnostics#160.

The consumer mirrors Microcosm's schema-version-6 fixtures, hash algorithm, warning codes, and tolerance behavior. It prefers valid reported attribution, fails closed on partial or producer-withheld attribution, and reconstructs only version-pinned historical releases without backfilling artifacts.

Validation

  • focused calibration score and diagnostics tests: passed
  • complete packages/microcosm-calibrate tests: passed before the schema contract update
  • schema lockstep plus microcosm-data contract/release tests: passed after the v6 update
  • uv run ruff check .: passed
  • Ruff formatting check for touched packages: passed
  • git diff --check: passed
  • full repository CI, including unit/behavioral tests, lint, wheel builds, clean installs, import checks, and installed-wheel tests on Python 3.13 and 3.14: passed

@anth-volk
anth-volk marked this pull request as ready for review August 18, 2026 19:52
@anth-volk
anth-volk merged commit 7061fa8 into main Aug 18, 2026
4 checks passed
@anth-volk
anth-volk deleted the target-loss-attribution-output branch August 18, 2026 19:52
MaxGhenis added a commit that referenced this pull request Aug 19, 2026
Root cause of the wheels-gate divergence, closed: CI tests the PR merge
ref (branch + live main), and main's #716 changed
microcosm.calibrate.solve, which the seed protocol's kernel source
inventory attests. Every country's spec_sha256 therefore moved on CI
but not on the pre-merge branch — the diagnostic step's per-module hash
diff named the module and a byte diff of the installed file confirmed
it. Merged main, then recomputed and re-pinned: be, uk, US spec shas;
seed protocol implementation + compiled seed-map digests; the loader
golden vector; and regenerated the F0 coverage evidence
(41,380/41,380 fields, 40/40 inventory checks).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

Publish per-target final loss attribution in calibration diagnostics

1 participant