From cf83937689bb30e2b5fa6e3efaa2f115016a030b Mon Sep 17 00:00:00 2001 From: Void Agent Date: Thu, 20 Aug 2026 17:02:15 +0100 Subject: fix(eval): correct sieve-rank indexing + test expectations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - _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. --- tests/test_phase3_flags.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests/test_phase3_flags.py') diff --git a/tests/test_phase3_flags.py b/tests/test_phase3_flags.py index 063822e..5c42f07 100644 --- a/tests/test_phase3_flags.py +++ b/tests/test_phase3_flags.py @@ -35,12 +35,13 @@ def test_is_prime_sieve_stub_perfect_in_range(): assert em == 1.0 and tok == 1.0 -def test_is_prime_probe_classified_p1(): - """On [101,200] the sieve errs exactly on {121,143,169,187} (classified prime) -> P1.""" +def test_is_prime_probe_classified_p3(): + """On [101,200] the sieve errs on {121,143,169,187} (96% acc) -> P3 (is_prime has no sieve-rank).""" cfg = Config(task_mode="is_prime") r = probe_report(StubModel(_isprime_sieve), cfg) assert sorted(e["n"] for e in r["errors"]) == [121, 143, 169, 187], r["errors"] - assert r["code"] == "P1", r["code"] + assert r["code"] == "P3", r["code"] + assert r["acc"] >= 0.85 def test_train_frac_subsamples_train_only(): -- cgit v1.2.3