Skip to content

test(callaway): machine-precision golden tolerances — SE-audit C6 closure#658

Merged
igerber merged 1 commit into
mainfrom
test/csdid-c6-dr-tightening
Jul 8, 2026
Merged

test(callaway): machine-precision golden tolerances — SE-audit C6 closure#658
igerber merged 1 commit into
mainfrom
test/csdid-c6-dr-tightening

Conversation

@igerber

@igerber igerber commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Closes the SE-audit C6 remainder ("only dr-tightening remains"). Measurement-first: the no-covariate DR golden agreed with R did at ~6e-11 ATT / ~2e-11 relative SE (no-covariate DR is deterministic algebra — no propensity IRLS enters), yet the test asserted ATT only, within 0.02, and never asserted the SE. Both are now pinned at 1e-8 with the SE assertion added.
  • The reg (0.02) and ipw (0.05) ATT bands — both predating the DRDID estimation-effect IF terms that brought the SEs to machine agreement — are tightened to 1e-8 on measured ~3e-11/~4e-11. The ipw SE keeps its documented 1e-6 IRLS-vs-glm platform headroom; the covariate-DR scenario keeps its documented 2e-3 band (measured ~9.5e-4 — the known DR small-sample numerics via the propensity nuisance).
  • TODO SE-audit row updated in place: C6 marked closed with the measured values; C7/C8 flagged as needing re-derivation from a fresh loose-tolerance inventory (their definitions lived in the audit session's scratchpad).

Methodology references (required if estimator / math changes)

  • Method name(s): Callaway-Sant'Anna ATT(g,t), DRDID dr/reg/ipw panel estimators — test-tolerance changes only, no code
  • Paper / source link(s): existing golden fixtures from R did 2.5.1 (benchmarks/data/csdid_golden_values.json, unchanged)
  • Any intentional deviations from the source (and why): None

Validation

  • Tests added/updated: tests/test_csdid_ported.py (3 golden tests tightened; 1 new SE assertion). Full file passes (72).
  • Backtest / simulation / notebook evidence (if applicable): in-session measurement sweep of all four dr/reg/ipw golden scenarios (values quoted above).

Security / privacy

  • Confirm no secrets/PII in this PR: Yes

Generated with Claude Code

…sure

The no-covariate DR golden asserted ATT only, within 0.02, and never
asserted the SE; measured agreement with R did on the fixture is
~6e-11 ATT / ~2e-11 relative SE (no-covariate DR is deterministic
algebra — no propensity IRLS enters), so both are pinned at 1e-8 with
the previously-missing SE assertion added. The reg (0.02) and ipw
(0.05) ATT bands — predating the DRDID estimation-effect IF terms —
tighten to 1e-8 on measured ~3e-11/~4e-11. The covariate-DR scenario
keeps its documented 2e-3 band (~1e-3 DR small-sample numerics via the
propensity nuisance). TODO SE-audit row updated: C6 closed; C7/C8
definitions need re-derivation from a fresh loose-tolerance inventory.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Overall Assessment

✅ Looks good — no unmitigated P0/P1 findings.

Executive Summary

  • PR changes only CHANGELOG.md, TODO.md, and tests/test_csdid_ported.py; no estimator, weighting, variance, SE, assumptions, or defaults changed.
  • Affected methods are Callaway-Sant’Anna ATT(g,t) golden tests for no-covariate DR, covariate reg, and covariate ipw.
  • Registry and fixture generator support the tightened R did::att_gt() parity checks; no undocumented methodology mismatch found.
  • No new inline inference, partial NaN guard, control-group, or parameter-propagation anti-patterns found.
  • Targeted tests could not be run locally because pytest is not installed in this environment.

Methodology

  • Severity: P3 informational
    Impact: The tightened assertions at tests/test_csdid_ported.py:L950-L1042 are consistent with the CallawaySantAnna registry’s IF-based SE contract and R did::att_gt() parity target (docs/methodology/REGISTRY.md:L474-L545, docs/methodology/REGISTRY.md:L782-L790). The changed scenarios are generated from R did::att_gt(..., bstrap=FALSE, cband=FALSE) in benchmarks/R/generate_csdid_test_values.R:L71-L83 and benchmarks/R/generate_csdid_test_values.R:L95-L140.
    Concrete fix: None required.

Code Quality

  • No findings. The modified tests do not introduce inference computation, new public parameters, or changed estimator control flow.

Performance

  • No findings. The PR only tightens small golden-value assertions over existing fixture cells.

Maintainability

  • No findings. The comments are verbose but useful for preserving why the tolerance choices differ across DR/reg/ipw paths.

Tech Debt

  • Severity: P3 informational
    Impact: C7/C8 remain deferred, but the PR tracks that explicitly in TODO.md:L63; this is acceptable deferred work and not a blocker.
    Concrete fix: No action for this PR; re-derive C7/C8 from a fresh loose-tolerance inventory when that follow-up is picked up.

Security

  • No findings. No executable production code, credentials, network calls, or secret-bearing files are changed.

Documentation/Tests

  • Severity: P3 informational
    Impact: The added SE assertion and tightened tolerances are documented in CHANGELOG.md:L52-L59 and the test docstrings. I could not execute the targeted tests because pytest is unavailable (pytest: command not found; python -m pytest: no module named pytest).
    Concrete fix: Ensure CI runs the touched golden tests, especially TestCSDIDGoldenValues::{test_golden_default_dgp_dr,test_golden_default_dgp_reg,test_golden_default_dgp_ipw}.

@igerber igerber added the ready-for-ci Triggers CI test workflows label Jul 8, 2026
@igerber igerber merged commit c4aaab2 into main Jul 8, 2026
25 of 26 checks passed
@igerber igerber deleted the test/csdid-c6-dr-tightening branch July 8, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-ci Triggers CI test workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant