Skip to content

Commit ed8c9ba

Browse files
authored
Loosen affine-equivariance p-value tolerance (BLAS-dependent CI flake) (#777)
1 parent 82e4bd7 commit ed8c9ba

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/test_rddensity.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,12 @@ def test_affine_equivariance(self):
505505
r1 = _fit_quiet(RDDensityTest(cutoff=0.0), x)
506506
r2 = _fit_quiet(RDDensityTest(cutoff=10.0), 3.5 * x + 10.0)
507507
assert r1.t_stat == pytest.approx(r2.t_stat, rel=1e-9)
508-
assert r1.p_value == pytest.approx(r2.p_value, rel=1e-9)
508+
# p = 2*Phi(-|t|) inherits the t-stat's relative error amplified by
509+
# 2*|t|*phi(|t|)/p (~5.9x at this seed's |t|~2.26), so its tolerance
510+
# must sit above the t-stat's or BLAS-kernel rounding differences
511+
# across CI runners can trip it (run #3384: rel diff 1.15e-9 on
512+
# ubuntu py3.14 only).
513+
assert r1.p_value == pytest.approx(r2.p_value, rel=1e-8)
509514
# densities scale by 1/s
510515
assert r1.f_left == pytest.approx(r2.f_left * 3.5, rel=1e-9)
511516
assert df1 is not df2

0 commit comments

Comments
 (0)