Commit 7b028fb
HonestDiD: surface ARP vertex-enumeration pathologies via RuntimeWarning
`_enumerate_vertices` was swallowing `np.linalg.LinAlgError` on every
basis with `try / except / continue`, and `_compute_arp_test` returned
False (conservative non-rejection) when the returned list was empty.
Users had no way to tell whether the test "did not reject" because the
data didn't support rejection or because the vertex search was
numerically pathological (singular A_sys on every basis, degenerate
moment-inequality system).
Instrument `_enumerate_vertices` with three counters (`n_total`,
`n_linalg_error`, `n_infeasible`) and emit a `RuntimeWarning` at
function exit when:
1. `vertices == []` after `n_total > 0` bases tried — enumeration
exhausted; caller will fall back to conservative non-rejection.
2. `vertices != []` but `n_linalg_error / n_total >= 0.5` —
enumeration heavily constrained; recovered vertices may be
numerically fragile.
`RuntimeWarning` (not `UserWarning`) marks this as a numerical /
algorithmic signal rather than a user-input issue. `stacklevel=3` so the
warning surfaces at `_compute_arp_test`'s caller, matching the codebase
convention for one-level-deep helper warnings.
No changes to the return type, the caller (`_compute_arp_test`), or
the algorithm semantics — the previous silent-skip behavior is fully
preserved, the diagnostic is purely additive.
Tier-A row in the post-Wave-2 backlog (TODO.md, item 6, PR #334
reference). Adds new `TestARPVertexEnumeration` class in
test_methodology_honest_did.py with three cases: exhausted enumeration,
heavy rejection, healthy enumeration.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent a7a1df2 commit 7b028fb
2 files changed
Lines changed: 108 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
1890 | 1891 | | |
1891 | 1892 | | |
1892 | 1893 | | |
1893 | | - | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
1894 | 1898 | | |
1895 | 1899 | | |
1896 | 1900 | | |
1897 | 1901 | | |
| 1902 | + | |
1898 | 1903 | | |
1899 | 1904 | | |
1900 | 1905 | | |
| |||
1913 | 1918 | | |
1914 | 1919 | | |
1915 | 1920 | | |
| 1921 | + | |
1916 | 1922 | | |
1917 | 1923 | | |
1918 | 1924 | | |
1919 | 1925 | | |
1920 | 1926 | | |
1921 | 1927 | | |
1922 | 1928 | | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
1923 | 1958 | | |
1924 | 1959 | | |
1925 | 1960 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
495 | 497 | | |
496 | 498 | | |
497 | 499 | | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
0 commit comments