Skip to content

Commit df748b1

Browse files
committed
dev(svd): relax tau threshold with small slack to reduce random failures
- Slightly increase tau tolerance to prevent flaky SVD tests
1 parent d0bf87b commit df748b1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/svd_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,17 @@ def get_total_singular(edges: Edges, free_names_u: FreeNamesU) -> tuple[int, int
3434
return even_singular, odd_singular
3535

3636

37-
def tau_for_cutoff(c: int | tuple[int, int], total: int, alpha: float = 0.8) -> float:
37+
def tau_for_cutoff(
38+
c: int | tuple[int, int], total: int, alpha: float = 0.8, slack: float = 1.05
39+
) -> float:
3840
cut = 0
3941
if isinstance(c, int):
4042
cut = c
4143
elif isinstance(c, tuple):
4244
cut = sum(c)
4345
lo, hi = 1e-8, 1e-1
4446
x = (total - cut) / max(1, total - 1)
45-
return lo + (hi - lo) * (x**alpha)
47+
return (lo + (hi - lo) * (x**alpha)) * slack
4648

4749

4850
def choose_free_names(n_edges: int, limit: int = 8) -> list[FreeNamesU]:

0 commit comments

Comments
 (0)