Commit 2bf3f93
Address PR #355 R3 P3: clarify hybrid bootstrap docs + pin boot_idx slice
Two P3s from R3; PR was already ✅ Looks good — these are close-out
polish.
P3 docs/tests — secondary surfaces described the full-design path as
"Rao-Wu rescaled bootstrap" but only REGISTRY.md surfaced the material
caveat that SDID still uses unit-level pairs-bootstrap resampling
(``boot_idx = rng.choice(n_total)``) and then applies Rao-Wu rescaled
weights on top — a hybrid composition, not a standalone Rao-Wu
bootstrap. Update survey-theory.md (splits SunAbraham/TROP's standalone
Rao-Wu bullet from SDID's hybrid bullet) and CHANGELOG.md's PR #352
Added entry to use the hybrid-composition wording mirroring REGISTRY.
P3 tests — the methodology-critical ``boot_idx`` × ``generate_rao_wu_weights``
interaction was only guarded by the slow coverage MC. Add
``test_bootstrap_full_design_rao_wu_boot_idx_slice`` (in
``TestBootstrapSE``) which monkeypatches ``generate_rao_wu_weights`` to
return a known vector of distinct per-unit values
(``arange(1, n_total+1)``), captures the ``rw_control_draw`` vectors
fed into the weighted FW helper via a capturing wrapper on
``compute_sdid_unit_weights_survey``, and asserts every captured vector
lies within ``known_rw[:n_control]`` (positions 1..n_control). This
catches two bug classes:
- slice-order regression: if someone swaps rw-then-slice for
slice-then-rw, the captured vectors would include values from the
treated slice ``known_rw[n_control:]`` and the assertion fires.
- rw-drift regression: if the Rao-Wu call site bypasses
``generate_rao_wu_weights`` (e.g., a refactor silently uses the
pweight-only branch for full-design fits), the captured vector would
be the user's w_control (all 1.0 in this test) instead of the known
Rao-Wu output.
Verified: 294 targeted tests pass across test_methodology_sdid /
test_survey_phase5 / test_weighted_fw / test_guides / test_rust_backend.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 2b2e8f0 commit 2bf3f93
3 files changed
Lines changed: 97 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
722 | 722 | | |
723 | 723 | | |
724 | 724 | | |
725 | | - | |
| 725 | + | |
726 | 726 | | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
737 | 742 | | |
738 | 743 | | |
739 | 744 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
740 | 740 | | |
741 | 741 | | |
742 | 742 | | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
743 | 823 | | |
744 | 824 | | |
745 | 825 | | |
| |||
0 commit comments