Skip to content

docs(v4): PR 4c-ii-b of the 4.0 cut - methodology/benchmark prose, tracking rows and the oracle fixture's mpd_twin prune - #872

Merged
igerber merged 1 commit into
mainfrom
feat/v4-pr4c-ii-b-docs-benchmarks
Oct 26, 2026
Merged

igerber merged 1 commit into
mainfrom
feat/v4-pr4c-ii-b-docs-benchmarks

Conversation

@igerber

@igerber igerber commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Summary

Methodology references (required if estimator / math changes)

  • Method name(s): N/A - prose, tracking files and benchmark scripts only; no diff_diff/ change.
  • Paper / source link(s): N/A
  • Any intentional deviations from the source (and why): None

Validation

  • Tests added/updated: no test logic changes; the oracle fixture prune and the lane-metadata cleanup are pinned by tests/test_twfe_event_study_decoupling.py (31 passed on python and rust). Gates on this branch: naming guard (docs lane), tracking files, variance-conventions table gate, changelog fragments, docs IA, doc snippets, guides, doc-deps, the review-script section map, the ledger matrix: 1354 passed.
  • Backtest / simulation / notebook evidence (if applicable): local R parity run of the new arm (run_benchmarks.py --estimator multiperiod --scale small, R + fixest 0.14.2): Python vs R headline ATT differ by 2e-12, SE relative difference 0.0%, per-period effects correlation 1.000 (max att diff 3e-11), compare_estimates PASS; the p-value/CI differ as before because R uses nobs - k while the surface uses its shared post-row df (not gated).

Security / privacy

  • Confirm no secrets/PII in this PR: Yes

Changelog

  • changelog.d/ fragment added (or N/A - no user-visible change): Yes - changelog.d/20261025-v4-pr4c-ii-b-docs-benchmarks.md (### Internal)

Follow-ups

  • Cut sequence continues with item 5 (storage flip) once this PR lands.

…acking rows and the oracle fixture's mpd_twin prune

The docs/benchmarks half of the MultiPeriodDiD removal (split from PR
4c-ii-a because the single diff exceeded the AI review input budget).

REGISTRY / REPORTING / survey-theory / METHODOLOGY_REVIEW and the remaining
user-doc prose (benchmarks.rst, survey-roadmap, performance-plan,
CONTRIBUTING, the repo debugging notes, the rust rank-deficiency comment)
stop describing the removed class as live. TODO rows 33/35/38/95/99 reworded;
three DEFERRED rows that governed the class retired.

Benchmarks: new live arm benchmarks/python/benchmark_twfe_event_study.py
(spec="within", cluster=unit; parity vs R fixest::feols(... | unit) verified
locally - ATT 2e-12, SE 0.0%, period-effect correlation 1.000);
benchmark_multiperiod.py and benchmarks/refresh_2026_07 stay frozen for the
pinned 3.x-wheel harness (header comment says so); speed_review and
benchmark_honest drop the removed names.

Oracle fixture: the mpd_twin records and the lane metadata's MPD twin fields
are pruned (TWFE records byte-identical); the capture script is TWFE-only
and documents the per-lane capture SHAs; README section updated.
@igerber

igerber commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

Supersedes #871 (auto-closed when #870's branch was deleted; could not be reopened after the rebase onto main).

@github-actions

Copy link
Copy Markdown

Overall assessment

✅ Looks good — no unmitigated P0/P1 findings identified.

Executive summary

  • The new TWFE benchmark preserves the intended unit-FE design and covariance-aware post-period average.
  • Empty post-period selections raise; undefined SEs produce NaN inference through safe_inference().
  • All 13 retained TWFE oracle records and provenance are unchanged.
  • A changelog fragment is present.
  • Static checks passed. Numerical tests and direct paper retrieval were unavailable in this environment.

Methodology

No new methodology defects identified. The within/pooled specifications and averaging formula agree with the registry and implementation docstrings (benchmarks/python/benchmark_twfe_event_study.py:L137-L163; docs/methodology/REGISTRY.md:L250-L282).

  • P3 — Informational: documented inference convention.
    Impact: Python and R can report different p-values/CIs because their degrees of freedom differ. The registry explicitly documents this convention (docs/methodology/REGISTRY.md:L593-L617).
    Concrete fix: None required.

Source review included the registry, docstrings, committed R specification, and local Rambachan–Roth/Roth paper reviews. Direct access to the cited NBER paper failed because network DNS was unavailable.

Code Quality

No findings. The new averaging code retains cross-period covariances using np.ix_ and delegates inference to the shared helper.

Performance

No findings in the changed code. Historical benchmark tables retain explicit provenance.

Maintainability

No findings. Removed lane fields have been removed from their callers and fixture metadata consistently.

Tech Debt

  • P3 — Informational: independent R regression fixture remains tracked.
    Impact: Historical self-captures protect against numerical drift but cannot detect defects predating capture (TODO.md:L97).
    Concrete fix: No action required for this PR; the tracked follow-up specifies committed fixest goldens for both specifications, including unbalanced and covariate panels.

Security

No findings in the changed files.

Documentation/Tests

No release-note finding: the PR includes a changelog.d/ fragment.

Verification completed:

  • Parsed all six changed Python files successfully.
  • Reconstructed the previous fixture from the supplied diff and verified that only MPD records/echo keys were removed.

Numerical verification could not run: NumPy, pandas, SciPy, pytest, and Rscript are unavailable. The PR’s reported numerical validation was therefore not independently reproduced.

@igerber igerber added the ready-for-ci Triggers CI test workflows label Oct 26, 2026
@igerber
igerber merged commit 6a6d4a5 into main Oct 26, 2026
45 of 47 checks passed
@igerber
igerber deleted the feat/v4-pr4c-ii-b-docs-benchmarks branch October 26, 2026 13:30
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