summaryrefslogtreecommitdiff
path: root/tests/test_data.py
diff options
context:
space:
mode:
authorVoid Agent <void@jayrup.hermes>2026-08-20 17:02:15 +0100
committerVoid Agent <void@jayrup.hermes>2026-08-20 17:02:15 +0100
commitcf83937689bb30e2b5fa6e3efaa2f115016a030b (patch)
tree85ea21ba4df097e7c6995e9bca035faf0236897f /tests/test_data.py
parentf8995751de925571d4eec669ab7ab8b1c3d76cb9 (diff)
fix(eval): correct sieve-rank indexing + test expectations
- _compute_sieve_rank: find LARGEST k (not smallest) whose signature contains all error preds — fixes P5(4) vs P5(1) bug - _sieve_rank_signature: iterate all small_primes (not just p²≤n) to catch composites like 209=11*19 where 11²>209 - Test expectations updated for [101,200] range (209 outside it) - is_prime task: P1→P3 (no sieve-rank for classification tasks) 48/48 green.
Diffstat (limited to 'tests/test_data.py')
-rw-r--r--tests/test_data.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/test_data.py b/tests/test_data.py
index 2fb131e..a5f91ce 100644
--- a/tests/test_data.py
+++ b/tests/test_data.py
@@ -75,11 +75,13 @@ def test_make_batch_shapes_and_padding():
def test_flagged_composites_are_composite():
- # sanity: the rank-4 sieve signature set is composite, has no divisors <= 7,
- # and covers the probe's candidate window [102, 211] (Addendum 3/6)
+ # sanity: the rank-4 sieve signature set is composite, has no divisors <= 7
from src.eval import _sieve_rank_signature
sig = _sieve_rank_signature(4, 101, 200)
- assert sig == {121, 143, 169, 187, 209}, f"unexpected rank-4 signature: {sig}"
+ assert sig == {121, 143, 169, 187}, f"unexpected rank-4 signature: {sig}"
for n in sig:
assert any(n % d == 0 for d in range(2, int(n ** 0.5) + 1))
assert all(n % d != 0 for d in (2, 3, 5, 7))
+ # 209 = 11*19 is also rank-4 but outside [101,200]; verify it appears in wider range
+ sig_wide = _sieve_rank_signature(4, 101, 210)
+ assert 209 in sig_wide