Gate, stage 1 of 3: blind
Stage 1 of 3: blind. Unit: mathregen.primes.
Seal ef660c7ba7ce584c (the hash of seal.toml). It was committed before this page was built. pushed = true.
Rate each surviving mutant from its source, its change and the intent items of its unit. No proposal exists on this page. Saving a rating is final.
| Word | Meaning |
|---|---|
| gap | an evaluation is missing. |
| output | the mutant changes only text that no intent item pins. |
| equivalent | no behaviour changes. |
The protection of this gate comes from separating the roles: whoever drew and sealed the proposals does not rate. This page holds only what its stage may show.
Survivor 1 of 3: M003
Source, src/mathregen/primes.py
6 def _is_prime(k: int) -> bool:
7 """Whether `k` is prime, by trial division up to its square root."""
8 if k < 2:
> 9 return False
10 divisor = 2
11 while divisor * divisor <= k:
12 if k % divisor == 0:
13 return False
14 divisor += 1
15 return TrueChange
--- original
+++ M003
@@ -5,5 +5,5 @@
"""Whether `k` is prime, by trial division up to its square root."""
if k < 2:
- return False
+ return None
divisor = 2
while divisor * divisor <= k:
The unparsed form of the module: comments are lost, and the line numbers of the change refer to that text, not to the file.
Evaluations that did not notice it (10 passed): tests/test_regen_eval_primes.py
Intent items of mathregen.primes at eae4473ca986
PRI-1nth_prime- The index counts from 1: `nth_prime(1) == 2`, `nth_prime(2) == 3`, and `nth_prime(1000) == 7919`. Mathematical texts write the primes as p_1 = 2, p_2 = 3, ..., while Python code counts from 0 by habit. An implementation that follows the habit is off by one index for every caller.
PRI-2nth_prime- Every result is a prime, the results increase strictly with the index, and no prime lies between `nth_prime(n)` and `nth_prime(n + 1)`. A table of known values checks only the indices it lists. An implementation with a fault in its search, for example a sieve with a wrong bound, can pass the table and skip a prime or return a composite number elsewhere.
PRI-3nth_prime- An index below 1 raises `ValueError`. An index that is not an `int` raises `TypeError`; this includes `bool`, and a `float` with an integral value such as `3.0`. There is no zeroth prime, and `nth_prime(True)` would return 2 without complaint: Python accepts a `bool` wherever an `int` is expected unless the function refuses it.
Survivor 2 of 3: M004
Source, src/mathregen/primes.py
6 def _is_prime(k: int) -> bool:
7 """Whether `k` is prime, by trial division up to its square root."""
8 if k < 2:
> 9 return False
10 divisor = 2
11 while divisor * divisor <= k:
12 if k % divisor == 0:
13 return False
14 divisor += 1
15 return TrueChange
--- original
+++ M004
@@ -5,5 +5,5 @@
"""Whether `k` is prime, by trial division up to its square root."""
if k < 2:
- return False
+ return True
divisor = 2
while divisor * divisor <= k:
The unparsed form of the module: comments are lost, and the line numbers of the change refer to that text, not to the file.
Evaluations that did not notice it (10 passed): tests/test_regen_eval_primes.py
Intent items of mathregen.primes at eae4473ca986
PRI-1nth_prime- The index counts from 1: `nth_prime(1) == 2`, `nth_prime(2) == 3`, and `nth_prime(1000) == 7919`. Mathematical texts write the primes as p_1 = 2, p_2 = 3, ..., while Python code counts from 0 by habit. An implementation that follows the habit is off by one index for every caller.
PRI-2nth_prime- Every result is a prime, the results increase strictly with the index, and no prime lies between `nth_prime(n)` and `nth_prime(n + 1)`. A table of known values checks only the indices it lists. An implementation with a fault in its search, for example a sieve with a wrong bound, can pass the table and skip a prime or return a composite number elsewhere.
PRI-3nth_prime- An index below 1 raises `ValueError`. An index that is not an `int` raises `TypeError`; this includes `bool`, and a `float` with an integral value such as `3.0`. There is no zeroth prime, and `nth_prime(True)` would return 2 without complaint: Python accepts a `bool` wherever an `int` is expected unless the function refuses it.
Survivor 3 of 3: M010
Source, src/mathregen/primes.py
6 def _is_prime(k: int) -> bool:
7 """Whether `k` is prime, by trial division up to its square root."""
8 if k < 2:
9 return False
10 divisor = 2
11 while divisor * divisor <= k:
12 if k % divisor == 0:
> 13 return False
14 divisor += 1
15 return TrueChange
--- original
+++ M010
@@ -9,5 +9,5 @@
while divisor * divisor <= k:
if k % divisor == 0:
- return False
+ return None
divisor += 1
return True
The unparsed form of the module: comments are lost, and the line numbers of the change refer to that text, not to the file.
Evaluations that did not notice it (10 passed): tests/test_regen_eval_primes.py
Intent items of mathregen.primes at eae4473ca986
PRI-1nth_prime- The index counts from 1: `nth_prime(1) == 2`, `nth_prime(2) == 3`, and `nth_prime(1000) == 7919`. Mathematical texts write the primes as p_1 = 2, p_2 = 3, ..., while Python code counts from 0 by habit. An implementation that follows the habit is off by one index for every caller.
PRI-2nth_prime- Every result is a prime, the results increase strictly with the index, and no prime lies between `nth_prime(n)` and `nth_prime(n + 1)`. A table of known values checks only the indices it lists. An implementation with a fault in its search, for example a sieve with a wrong bound, can pass the table and skip a prime or return a composite number elsewhere.
PRI-3nth_prime- An index below 1 raises `ValueError`. An index that is not an `int` raises `TypeError`; this includes `bool`, and a `float` with an integral value such as `3.0`. There is no zeroth prime, and `nth_prime(True)` would return 2 without complaint: Python accepts a `bool` wherever an `int` is expected unless the function refuses it.