perf(callaway): stop materializing per-cell unit-label arrays in influence_func_info#640
perf(callaway): stop materializing per-cell unit-label arrays in influence_func_info#640igerber wants to merge 1 commit into
Conversation
|
Overall Assessment ✅ Looks good. No unmitigated P0/P1 findings. Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Tests not run; this was a static review against the diff and surrounding source. |
65cf161 to
9186e3d
Compare
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment ✅ Looks good. No unmitigated P0/P1 findings. Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Tests not run; this was a static review of the diff and surrounding source. |
…uence_func_info Every (g,t) cell's internal IF record carried treated_units / control_units label arrays (all_units[positions], two O(n_control) allocations per cell) that no in-package code path ever read — the only consumers were the precomputed-less fallbacks of the combined-IF assembly and the multiplier bootstrap, which every in-package caller bypasses by threading precomputed structures. Labels stay recoverable as all_units[treated_idx]. The two fallbacks now raise an actionable ValueError when reached without label arrays instead of silently KeyErroring. Applies to CallawaySantAnna (panel, vectorized, RCS, reference cells) and StaggeredTripleDifference producers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
9186e3d to
a8ca356
Compare
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment ✅ Looks good. No unmitigated P0/P1 findings. Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Tests not run; this was a static re-review of the diff and surrounding source. |
Summary
treated_units/control_unitslabel arrays (all_units[positions]— two O(n_control) fancy-index allocations per cell) that no in-package code path ever read. Producers (CallawaySantAnna panel + vectorized + RCS + reference cells, StaggeredTripleDifference) stop materializing them; labels remain recoverable asall_units[treated_idx].precomputed-less fallbacks of the combined-IF assembly (staggered_aggregation.pygeneral-path local branch) and the multiplier bootstrap (staggered_bootstrap.py) — unreachable from any in-package fit (all callers threadprecomputed/ global unit ids; verified acrossstaggered.py,staggered_triple_diff.py,efficient_did.py). Those fallbacks now raise an actionableValueErrorwhen reached without label arrays instead of a bareKeyError(no-silent-failures posture)._influence_func_infowhitebox surface keepstreated_idx/control_idx/treated_inf/control_inf; no public API or numerical change.Methodology references (required if estimator / math changes)
Validation
TestCombinedIFFrozenParity, which byte-copies the pre-rewrite path) and all direct-call tests thread global unit ids, so they exercise the unchanged branches;tests/test_staggered_aggregation.py,tests/test_staggered.py,tests/test_se_accuracy.py,tests/test_methodology_staggered_triple_diff.py,tests/test_survey_phase5.py(399 tests) plustests/test_methodology_callaway.py+tests/test_csdid_ported.py(144) all pass locally.Security / privacy
Generated with Claude Code