perf(efficient_did): cross-cell kcov-table hoisting + per-group W lifecycle (100k: 86 -> 18 min)#629
Conversation
…ecycle (100k: 86->18 min) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X4AzrFUMqJxcUumSH31mSr
|
Overall Assessment ✅ Looks good. No unmitigated P0 or P1 findings. Executive Summary
Methodology No findings. Severity: N/A Code Quality No findings. Severity: N/A Performance P3-informational, tracked in TODO.md. Impact: The PR resolves the prior kernel-covariance bottleneck and adds a new tracked follow-up for Maintainability No findings. Severity: N/A Tech Debt No blocking findings. Severity: P3-informational Security No findings. Severity: N/A Documentation/Tests P3-informational. Impact: Coverage is strong for the new hoisting contracts, especially Verification note: targeted pytest command could not run because |
Summary
s_group * KCov(Y_u1 - Y_v1, Y_u2 - Y_v2 | group)keyed only by wide-outcome columns, so the tables the v3.7 tiled pass rebuilt per cell dedup to one table of distinct product columns per comparison group per unit-tile (~26x fewer kernel GEMM columns on a PT-All fit).assert_array_equal); masked entries resolve to an all-zero column.aggregate="all"): 2k 7.7 -> 7.0s, 10k 57.2 -> 35.7s (1.6x), 30k 358 -> 129s (2.8x), 100k 85.6 min -> 17.8 min (~4.8x) at the same ~4 GB peak RSS; the kernel-covariance stage itself is 40x faster (21.2 -> 0.5s at 10k). Results move only at floating-point reassociation level (post-treatment cells ~1e-12 relative, overall ATT ~1e-13); the no-covariates path is byte-identical;omega_ridge=0still routes the entire legacy path; apt_assumption="post"covariate fit builds no tables at all._ridge_solve_weights(batched LU; Rust batched-Cholesky candidate).Methodology references (required if estimator / math changes)
docs/methodology/REGISTRY.md.Validation
tests/test_methodology_efficient_did.py(newTestKcovTableHoisting: per-group table oracle vs the per-cell_kcov_batchconstruction, unweighted + survey-weighted, rel 1e-12; reversed-orientation ordered-key lock; multi-y1_coldefensive case; value-exact assembly-vs-legacy-loop; H==1 no-keys),tests/test_efficient_did.py(build-count-proportional-to-tiles proof,pt_assumption="post"zero-builds guard, mid-size tile twin with forced product chunking). All existing locks (dense-reference oracle, 1-byte tile twins, 1-ulp stability, HRS anchors) pass unmodified. Full suite: 8507 passed (1 known pre-existing order-dependent dCDH failure); targeted suites 461 passed on both backends; tutorial 15 re-executed clean via nbmake.docs/performance-plan.md(BEFORE = pristine main fcd7768 via baseline-worktree PYTHONPATH; 3-rep medians; ATT/SE delta report included).Security / privacy
Generated with Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01X4AzrFUMqJxcUumSH31mSr