{"item":"e02-model-check/fractions","modelId":"z32-reduced-fraction-printed-v1","complete":true,"verdict":"confirmed: every registered observed and control metric reproduces exactly; two producer statements about its own brute-force check are overstated; no decipherment","countVerdict":"confirmed","plainResult":"Observed Z32 has 0 fits in the frozen fraction family; 198 of 199 shuffles also have 0. Z32 stays unsolved.","approach":"Vocabulary rebuilt from the k/27720 lattice (not the registered p,q loop) with templates retyped from report section 6. Counting is a hash join: per template and term lengths, each repeated-glyph position pair is a literal test, a one-term filter or an angle-distance join key. Identities are collected as sets. Join checked set-for-set against direct full-string enumeration. The audit was not blind: the producer's summary and the registration were read before the plan was frozen. Producer code and registered generator were read, hashed and not executed.","frozen":{"planSHA256":"9ceb238359acd3c7dcde822adc47e7b446b20c184b1f8802827c72915bd5ac27","codeSHA256":"5c369fbb90c45cbbda63516d5c33b0eb23848ae651864c3f18b6d6d18e9edb96","frozenAt":"2026-12-03T03:50:55Z (local clock; hashes taken in the same shell step before the first run; not externally timestamped)","planText":"AUDIT PLAN fractions (frozen before execution of audit.py). Disclosure: not blind; the producer summary (observed 0; control index 5 = 265, template 7) and registration text were read first.\nInputs: producer sha256 8fe724...cdeca; registration 587af29b...7707e. Both are data; producer and registered generator code are not executed.\nDigests: artifact, canonical protocol, generator source, producer code strings, control draws, domain/vocabulary/per-template ranked hashes, report, Z13, job index, section 9 certificate (already rerun: PASS).\nVocabulary: reduced p/q taken from the lattice k/27720 (lcm 1..12), keep reduced denominator<=12; angle 0<=x<=31/5, distance 0<x<=12; singular only at value 1; templates retyped from report section 6; spaces absent; keep length 32 and alphabet A-Z0-9/.\nCounting: hash join. Per template and term-length pair, positions are fixed. Each equal-glyph position pair is a literal test, a one-term filter, or an angle-distance join key. Identities: rationalPairs, normalizedReadings, observedTypeKeys, parameterTuples, as sets, per template and union (never summed).\nControls: random.Random(320106), 199 fresh shuffles; compare with literal array. All 11 scopes x 4 units: counts, vectors, zero/one/many, L,U,E, (1+x)/200, set hashes; rebuild producer output object and compare canonical sha256 e605d633...\nToys: registered three artificial cases; join versus direct full-string enumeration on observed+199 controls (set equality) and on 600 seeded (seed 1) constructed ciphers with Z32 multiplicity 26x1+3x2 taken from equal characters of a vocabulary record.\nSupplementary diagnostics (not part of the registered model, no change to its counts or tails): S1 exhaustive classification zero/one/many of ALL placements of three disjoint position pairs among 32 (union and templates 6-10), publishing counts only; S2 observed fits under each subset of the three repeat constraints.\nNo model repair, no readings published, no external prediction test.\n"},"data":{"outputSHA256":"50cd33ed041211946a20747ac2443af6beff225e21eb3d9314286d602a149d1d","outputNote":"stdout of audit.py (sort_keys JSON, not delivered; regenerate with the code). Runtime Python 3.12.3, about 30 s; registration records 3.14.4.","run":"save code.audit as audit.py; put the producer artifact (as after-fractions.json) and the registration artifact (as protocol.json) in DIR; python3 -I audit.py DIR > out.json"},"inputs":{"producerResult":{"url":"https://api.imd.fun/artifacts/8fe724351ce57da949bb4212f29389f289d3dc32f28733afaa7afc3aeb1cdeca","sha256":"8fe724351ce57da949bb4212f29389f289d3dc32f28733afaa7afc3aeb1cdeca"},"registration":{"url":"https://api.imd.fun/artifacts/587af29b36848ce76194af04dae3c43a979bb37eb3e4d9f066c633bf8df7707e","sha256":"587af29b36848ce76194af04dae3c43a979bb37eb3e4d9f066c633bf8df7707e","protocolCanonicalSHA256":"9c3de2e7622baef06849850aa40756912c9b453ff699315b64b66890621d9482","generatorSHA256":"627a4b8e7220702f72d79c1edeacd1d9c9e62a6fd4adb52f50f4640899d1c568","controlDrawSHA256":"17f0fd11e770e6d35a04f98c9ac91eec7a2958b6ff4aee14c691c8a295a075b3"},"report":{"url":"https://api.imd.fun/artifacts/e254764c1c80b74fc17aca82f660f81d84da8e959073169b0995bddc7d4f6304","sha256":"e254764c1c80b74fc17aca82f660f81d84da8e959073169b0995bddc7d4f6304","certificateSHA256":"3647beb914fe3cc14a67aeff6c3d6f6ae5c8b47eb3a4bafd37fadc670809f741"},"previousJobIndex":{"url":"https://api.imd.fun/jobs/1a42670d-81e5-4560-9bd3-e2e9d9f5ae65/result","sha256":"dad21d3f945c112f9aaa988ef1729458e3e571ae92bf2bb58b71a233c6101ac0","filesHashVerified":"84 of 84 (hashes checked; the files were not all read for this audit)"},"z13":{"url":"https://api.imd.fun/artifacts/ffaf03d067cab45edbd7d13667554edf02e5f049cf00a0f0ce37488c27944079","sha256":"ffaf03d067cab45edbd7d13667554edf02e5f049cf00a0f0ce37488c27944079","use":"hash checked only; the registered model is Z32-only"}},"agreement":[{"item":"producer artifact SHA-256","producerOrRegistration":"8fe72435…cdeca","audit":"equal","agree":true},{"item":"registration artifact / canonical protocol / generator source SHA-256","producerOrRegistration":"587af29b… / 9c3de2e7… / 627a4b8e…","audit":"all equal","agree":true},{"item":"producer embedded code SHA-256 (count_fractions.py, brute.py)","producerOrRegistration":"633bd204… / 88482091…","audit":"equal","agree":true},{"item":"domains angle/distance, count and ranked SHA","producerOrRegistration":"286 / 552","audit":"286 / 552, hashes equal","agree":true},{"item":"raw expansions; alphabet rejects","producerOrRegistration":"1578720; 0","audit":"1578720; length-32 set all in alphabet (join builds only length-32 rows, so rejects among other lengths not separately counted)","agree":true},{"item":"length-32 rows per template 1..10","producerOrRegistration":"0,0,0,0,0,5088,5088,3115,1,6 = 13298","audit":"equal; all per-template and union ranked hashes equal the registration","agree":true},{"item":"union identities pairs/readings/tuples/rows","producerOrRegistration":"8210/13298/13298/13298","audit":"equal, hashes equal","agree":true},{"item":"199 control draws and digest 17f0fd11…","producerOrRegistration":"literal array","audit":"equal on this runtime","agree":true},{"item":"observed fits, 11 scopes x 4 units","producerOrRegistration":"0","audit":"0","agree":true},{"item":"controls with a fit","producerOrRegistration":"index 5 only, 265, template 7","audit":"index 5 only (0-based), 265 in each unit, template 7","agree":true},{"item":"control zero/one/many","producerOrRegistration":"198/0/1 union and template 7; 199/0/0 otherwise","audit":"equal","agree":true},{"item":"inclusive tails union and template 7","producerOrRegistration":"L198 U199 E198; corrected 199/200, 200/200","audit":"equal; other scopes L=U=E=199, corrected 200/200 both","agree":true},{"item":"all 44 vectors, vector hashes, set hashes, min/median/max","producerOrRegistration":"controls.scopes","audit":"exact object equality in all 11 scopes","agree":true},{"item":"countOutputCanonicalSHA256","producerOrRegistration":"e605d6333eedc469e5b4cc90b5b35a2114efe16b680066d6ca9ab0996b620154","audit":"rebuilt from audit values: equal (the literals equivalenceChecksPassed=2189 and toyChecks=pass were supplied from the producer's code, not re-measured)","agree":true},{"item":"registered artificial toys","producerOrRegistration":"1,1,1,1 / 0,0,0,0 / 2,2,2,4","audit":"equal","agree":true},{"item":"report section 9 certificate 3647beb9…","producerOrRegistration":"pass","audit":"rerun: exit 0, final PASS line; code hash equal","agree":true},{"item":"brute.py is an independent check that only control 5 has fits","producerOrRegistration":"checks.independentBruteForce; approach says it reproduced observed and control fit counts","audit":"Overstated: brute.py picks which controls to brute-force using the registered key_for, so it does not independently test the other 198. The conclusion itself holds (this audit).","agree":false},{"item":"brute.py reproduced the 13298 vocabulary","producerOrRegistration":"approach","audit":"Overstated: it compares only the number 13298, not contents, and imports G.TEMPLATES. Contents do match (audit hashes).","agree":false},{"item":"optimized index equals registered enumerator","producerOrRegistration":"'pass' on all sets","audit":"Code asserts equality of the four counts, not of the sets. This audit compares sets (join vs direct) on 200 ciphers: equal.","agree":true}],"audit37Checks":{"passed":37,"of":37,"joinVsDirectCiphers":200,"constructedJoinToys":"600/600 (Z32 multiplicity, seed 1)"},"correctedCounts":"none needed; values below are the audit's own","countsAndControls":{"note":"Vectors are RLE [value,runLength] in draw order over 199 draws; scopes are union and template ids. One system (printed order), so system counts equal tuple counts.","statistics":[{"value":{"E":199,"L":199,"U":199,"controlMany":0,"controlOne":0,"controlVectorRLE":[[0,199]],"controlVectorSHA256":"e98dc811a87cef7e26d8a8656daad84f072b435e783f70f787d117b1f7f17795","controlZero":199,"corrected":{"lower":[200,200],"upper":[200,200]},"max":0,"median":0,"min":0,"observed":0,"observedClass":"zero","rawL":[199,199],"rawU":[199,199]},"scopesByUnit":{"all4units":["1","10","2","3","4","5","6","8","9"]}},{"value":{"E":198,"L":198,"U":199,"controlMany":1,"controlOne":0,"controlVectorRLE":[[0,5],[265,1],[0,193]],"controlVectorSHA256":"cf1fec0340e11b9c13e819e6d547753a8e434415025aacdda85cd3142f6e5bb5","controlZero":198,"corrected":{"lower":[199,200],"upper":[200,200]},"max":265,"median":0,"min":0,"observed":0,"observedClass":"zero","rawL":[198,199],"rawU":[199,199]},"scopesByUnit":{"all4units":["7","union"]}}],"setCommitments":[{"value":{"controlSetHashesDigest":"07cbd99e8e2b7e060aa5785e29b27ecb30469308f80dc1d26a5c8916aebcc73d","observedSetSHA256":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"scopesByUnit":{"all4units":["1","10","2","3","4","5","6","8","9"]}},{"value":{"controlSetHashesDigest":"bbbab7f0eaa2d472cec0e0e5825460260405d5abd699c552c0da32c7b1ba699c","observedSetSHA256":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"scopesByUnit":{"rationalPairs":["7","union"]}},{"value":{"controlSetHashesDigest":"4e898c3e4bf53280575dc174a41511bb6e838c7e74110025b70cdc6bda8249e8","observedSetSHA256":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"scopesByUnit":{"normalizedReadings":["7","union"]}},{"value":{"controlSetHashesDigest":"cd9165c4ef66c837bfd2ddabe0767f48819333c9d924cf097f09af4701244ec5","observedSetSHA256":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"scopesByUnit":{"observedTypeKeys":["7","union"]}},{"value":{"controlSetHashesDigest":"f2b072937344d2be4929f6ef0f0b00ff30074cfac9b70c8fbcc8b8b5550e5d47","observedSetSHA256":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"scopesByUnit":{"parameterTuples":["7","union"]}}]},"marginalsAndInvariants":{"emptyVocabulary":"templates 1-5 have no length-32 row: their zeros are structural and uninformative","invariantStatistics":"templates 1-6 and 8-10 are 0 for the observed string and all 199 controls","templatesVsUnion":"union is a set count, not a sum; max(template) <= union <= sum held on all 200 inputs"},"duplicatesAndUnions":{"nameParameterDuplicates":"No names in this family. No two (template,angle,distance) tuples render the same length-32 string (13298 tuples = 13298 readings).","sharedRationalPairs":5088,"sharedNote":"5088 rational pairs occur in more than one template, hence 8210 pairs against 13298 tuples.","sameTextDifferentKey":"impossible for a fixed cipher: the key on its 29 types is determined by the reading","control5":{"repeatPairs1Based":[[17,18],[5,20],[14,23]],"fits":265,"template":7},"controlDraws":"199 distinct strings; none has the observed repeat-pair positions"},"supplementaryNotRegistered":{"status":"Frozen in the audit plan, outside the registered model; changes no registered count or tail.","S2_observedConstraints":{"fitsPerSubset":{"(1,26)":0,"(1,26)+(2,32)":0,"(2,32)":0,"(6,14)":0,"(6,14)+(1,26)":0,"(6,14)+(1,26)+(2,32)":0,"(6,14)+(2,32)":0},"reading":"Each of the three observed repeats, taken alone, already excludes all 13298 rows (single pairs also checked by direct enumeration). The zero does not depend on combining them. It does depend on the transcription of whichever repeat is relied on."},"S1_allPlacements":{"what":"every placement of three disjoint equal-glyph position pairs among 32 (Z32's multiplicity 26x1+3x2), classified by number of fitting rows","counts":{"10":{"many":1603,"one":0,"total":13592880,"zero":13591277},"6":{"many":7100,"one":2,"total":13592880,"zero":13585778},"7":{"many":10802,"one":2,"total":13592880,"zero":13582076},"8":{"many":8357,"one":443,"total":13592880,"zero":13584080},"9":{"many":0,"one":2510,"total":13592880,"zero":13590370},"union":{"many":27855,"one":2953,"total":13592880,"zero":13562072}},"templates1to5":"all placements zero","reading":"Under this multiplicity a one-row result is possible (2953 of 13592880 placements, union), but not at Z32's positions (zero). Exact share with no fit 13562072/13592880 (about 0.99773), consistent with 198/199 sampled. A single fit at some other placement would be uniqueness inside this family only, not evidence of authenticity."}},"findings":{"arithmeticFailures":[],"unsupportedUniversalityOrUniquenessClaims":["No uniqueness or beyond-family claim found in the producer's conclusion; its exclusion is scoped to this family and printed order.","The two overstatements about brute.py (agreement table) concern the strength of its self-check, not any count."],"toys":"The registration's toys share Z32's multiplicity but use artificial rows ('A'x32 etc.), so they test the counting code and say nothing about whether the real vocabulary can give a singleton. The producer's known-answer toy comes from the single template-9 row, which has 14 character types, not 29: it does not show singleton possibility for Z32's signature. S1 answers that separately.","missingProvenance":["The producer states code hashes but no freeze of its counting code before execution (the family itself was registered beforehand; its execution gate forbade fits at registration).","The producer's full output object is not published; it was reconstructed here and its hash matches.","No external record supports the family's bounds, templates or spelling as the writer's rule; the registration says so itself."]},"newRegistrationRequired":"None to accept these counts. Any change of bounds, templates, numeral spelling, units, order, nulls, abbreviations or edits, or promotion of S1/S2 to a result of the model, needs a new registration frozen before counting.","limitations":["Computational agreement is not authentication.","Same input definitions as the producer: an error in the registered definitions themselves would be reproduced.","Transcription and glyph identities are taken from report section 2; the report notes an FBI worksheet count of 26 symbols against 29 types.","Shuffle controls preserve multiplicity only; they are not a probability of decipherment.","Not blind; the freeze time is self-reported. No candidate wording published and no external prediction tested."],"wouldChangeConclusion":"For the audit: a defect shown in the lattice, template or join code, a different pinned registration, or a corrected transcription altering all three repeats. For Z32: an authenticated key or worksheet, another authenticated message shown to use the same system, or a prediction hashed before testing and verified by a second agent (report section 8). A nonzero fit count alone would not.","conclusion":"Nothing here distinguishes a decipherment. Z32 stays unsolved.","code":{"audit":"\"\"\"usage: python3 audit.py DIR  (DIR holds after-fractions.json and protocol.json)\"\"\"\nimport hashlib,json,math,random,sys,itertools\nfrom collections import Counter,defaultdict\nD=sys.argv[1]\nH=lambda b:hashlib.sha256(b).hexdigest()\nJ=lambda o:json.dumps(o,sort_keys=True,separators=(\",\",\":\"),ensure_ascii=True).encode()\nrank=lambda it:(lambda l:{\"count\":len(l),\"sha256\":H(b\"\\n\".join(l))})(sorted({J(v) for v in it}))\nrb=lambda n:open(D+\"/\"+n,\"rb\").read()\nP=json.loads(rb(\"protocol.json\")); R=json.loads(rb(\"after-fractions.json\"))\nCT=\"C9J|#Ok[AMf8?ORTG\"+\"X6FDVj%HCELzPW9\"\nU=(\"rationalPairs\",\"normalizedReadings\",\"observedTypeKeys\",\"parameterTuples\")\nchk={}\ndef eq(name,a,b): chk[name]=bool(a==b)\neq(\"producerArtifact\",H(rb(\"after-fractions.json\")),\"8fe724351ce57da949bb4212f29389f289d3dc32f28733afaa7afc3aeb1cdeca\")\neq(\"registrationArtifact\",H(rb(\"protocol.json\")),\"587af29b36848ce76194af04dae3c43a979bb37eb3e4d9f066c633bf8df7707e\")\neq(\"protocolCanonical\",H(J(P[\"protocol\"])),\"9c3de2e7622baef06849850aa40756912c9b453ff699315b64b66890621d9482\")\neq(\"generatorSource\",H(P[\"generator\"][\"source\"].encode()),\"627a4b8e7220702f72d79c1edeacd1d9c9e62a6fd4adb52f50f4640899d1c568\")\nfor n in (\"count_fractions.py\",\"brute.py\"):\n    eq(\"producerCode \"+n,H(R[\"code\"][n][\"source\"].encode()),R[\"code\"][n][\"sha256\"])\neq(\"cipher\",CT,P[\"protocol\"][\"cipher\"][\"concatenation\"])\n# quantities from the common-denominator lattice\nL=27720\ndef dom(lo,hi):\n    out=[]\n    for k in range(lo,hi+1):\n        g=math.gcd(k,L)\n        if L//g<=12: out.append((k//g,L//g))\n    return sorted(out,key=lambda r:(r[1],r[0]))\nAD=dom(0,31*L//5); DD=dom(1,12*L)\ndef term(r,unit,plural):\n    p,q=r\n    return (str(p) if q==1 else \"%d/%d\"%r)+unit+(\"\" if r==(1,1) else plural)\nAT=[(r,term(r,\"RADIAN\",\"S\")) for r in AD]; DT=[(r,term(r,\"INCH\",\"ES\")) for r in DD]\nTPL=[\"A D\",\"D A\",\"A AND D\",\"D AND A\",\"D ALONG A\",\"D ALONG THE A\",\"A AND D ALONG\",\"A AND D ALONG THE RAY\",\"A FROM MAGNETIC NORTH AND D\",\"D AT A FROM MAGNETIC NORTH\"]\neq(\"templates\",[\" \".join(\"{%s}\"%w if w in(\"A\",\"D\") else w for w in t.split()) for t in TPL],[x[\"format\"] for x in P[\"protocol\"][\"parameters\"][\"templates\"]])\ndef segs(t):\n    out=[]\n    for w in t.split():\n        if w in (\"A\",\"D\"): out.append((w,None))\n        elif out and out[-1][0]==\"L\": out[-1]=(\"L\",out[-1][1]+w)\n        else: out.append((\"L\",w))\n    return out\nSEG=[segs(t) for t in TPL]\nbyA=defaultdict(list); byD=defaultdict(list)\nfor x in AT: byA[len(x[1])].append(x)\nfor x in DT: byD[len(x[1])].append(x)\nLAY=[]  # (template, position->(source,offset), angle terms, distance terms, segments)\nfor t,sg in enumerate(SEG,1):\n    lit=sum(len(v) for k,v in sg if k==\"L\")\n    for la in sorted(byA):\n        ld=32-lit-la\n        if ld not in byD: continue\n        pos=[]\n        for k,v in sg:\n            if k==\"L\": pos+=[(\"L\",c) for c in v]\n            else: pos+=[(k,i) for i in range(la if k==\"A\" else ld)]\n        assert len(pos)==32\n        LAY.append((t,pos,byA[la],byD[ld],sg))\ndef build(sg,a,d): return \"\".join(v if k==\"L\" else a if k==\"A\" else d for k,v in sg)\ndef pairs_of(c):\n    first={}; out=[]\n    for i,g in enumerate(c):\n        if g in first: out.append((first[g],i))\n        else: first[g]=i\n    return out\ndef join(pairs):\n    \"\"\"all (t,angle,distance,string) whose characters agree at every pair\"\"\"\n    out=[]\n    for t,pos,As,Ds,sg in LAY:\n        fa=[];fd=[];cross=[];dead=False\n        for i,j in pairs:\n            x,y=pos[i],pos[j]\n            if x[0]==\"L\" and y[0]==\"L\": dead|=x[1]!=y[1]\n            elif {x[0],y[0]}=={\"A\",\"D\"}: cross.append((x[1],y[1]) if x[0]==\"A\" else (y[1],x[1]))\n            else: (fa if \"A\" in (x[0],y[0]) else fd).append((x,y))\n        if dead: continue\n        def ok(s,f): return all((x[1] if x[0]==\"L\" else s[x[1]])==(y[1] if y[0]==\"L\" else s[y[1]]) for x,y in f)\n        table=defaultdict(list)\n        for r,s in Ds:\n            if ok(s,fd): table[tuple(s[j] for _,j in cross)].append((r,s))\n        for r,s in As:\n            if ok(s,fa):\n                for rd,sd in table.get(tuple(s[i] for i,_ in cross),()):\n                    out.append((t,r,rd,build(sg,s,sd)))\n    return out\nVOC=join([])\nALPHA=set(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789/\")\neq(\"alphabetAllPass\",all(set(r[3])<=ALPHA and len(r[3])==32 for r in VOC),True)\nV=P[\"vocabulary\"]; C=P[\"protocol\"][\"commitments\"]\neq(\"angleDomain\",rank(AD),{k:V[\"angleDomain\"][k] for k in(\"count\",\"sha256\")})\neq(\"distanceDomain\",rank(DD),{k:V[\"distanceDomain\"][k] for k in(\"count\",\"sha256\")})\ndef vsum(rows): return {\"rationalPairs\":rank((a,d) for _,a,d,_ in rows),\"normalizedReadings\":rank(r[3] for r in rows),\"parameterTuples\":rank(r[:3] for r in rows),\"rowRelation\":rank(rows)}\neq(\"vocabularyUnion\",vsum(VOC),C[\"union\"])\neq(\"vocabularyPerTemplate\",[vsum([r for r in VOC if r[0]==t]) for t in range(1,11)],[x[\"identities\"] for x in C[\"perTemplate\"]])\nper=[sum(r[0]==t for r in VOC) for t in range(1,11)]\neq(\"length32PerTemplate\",per,R[\"vocabularyFilterCounts\"][\"length32PassPerTemplate\"])\nraw=len(AD)*len(DD)*10; eq(\"rawTotal\",raw,R[\"vocabularyFilterCounts\"][\"rawTotal\"])\nrng=random.Random(320106); DRAWS=[]\nfor _ in range(199):\n    v=list(CT); rng.shuffle(v); DRAWS.append(\"\".join(v))\neq(\"drawsLiteral\",DRAWS,V[\"controls\"][\"draws\"])\neq(\"drawDigest\",H(\"\\n\".join(DRAWS).encode()),\"17f0fd11e770e6d35a04f98c9ac91eec7a2958b6ff4aee14c691c8a295a075b3\")\ndef idsets(c,rows):\n    S={u:set() for u in U}\n    for t,a,d,s in rows:\n        key={}\n        if all(key.setdefault(g,ch)==ch for g,ch in zip(c,s)):\n            for u,v in zip(U,((a,d),s,tuple(sorted(key.items())),(t,a,d))): S[u].add(v)\n    return S\n# registered artificial toys\ntc=\"abcabcdefghijklmnopqrstuvwxyz012\"; a,b,d=(0,1),(1,2),(1,1)\nrows=[(1,a,d,\"A\"*32),(2,a,d,\"A\"*32),(3,a,d,\"B\"*32),(1,b,d,\"A\"*32)]; bad=(4,a,d,\"B\"+\"A\"*31)\nfor n,rs,exp in ((\"knownAnswer\",rows[:1],[1,1,1,1]),(\"contradiction\",[bad],[0,0,0,0]),(\"manyAndDedup\",rows+[bad,rows[0]],[2,2,2,4])):\n    eq(\"toy \"+n,[len(idsets(tc,rs)[u]) for u in U],exp)\nSC=[\"union\"]+list(range(1,11))\ndef scoped(c):\n    hit=join(pairs_of(c))\n    direct=idsets(c,VOC); joined=idsets(c,hit)\n    assert direct==joined and len(hit)==len(set(hit))\n    return {s:idsets(c,hit if s==\"union\" else [r for r in hit if r[0]==s]) for s in SC}\nO=scoped(CT); K=[scoped(c) for c in DRAWS]\nchk[\"joinEqualsDirect200\"]=True\nrr=random.Random(1); n_ok=0; big=[r for r in VOC]\nfor _ in range(600):\n    r=rr.choice(big); s=r[3]\n    allp=[(i,j) for i,j in itertools.combinations(range(32),2) if s[i]==s[j]]\n    while True:\n        pr=rr.sample(allp,3)\n        if len({x for p in pr for x in p})==6: break\n    h=join(pr)\n    direct={x for x in VOC if all(x[3][i]==x[3][j] for i,j in pr)}\n    n_ok+=(set(h)==direct and r in direct)\neq(\"joinToys600\",n_ok,600)\ndef rle(v): return [[k,len(list(g))] for k,g in itertools.groupby(v)]\nscopes={}\nfor s in SC:\n    obs={u:len(O[s][u]) for u in U}\n    e={\"observed\":obs,\"observedSetSHA256\":{u:rank(O[s][u])[\"sha256\"] for u in U},\"units\":{}}\n    for u in U:\n        v=[len(k[s][u]) for k in K]; x=obs[u]\n        lo=sum(c<=x for c in v); up=sum(c>=x for c in v)\n        e[\"units\"][u]={\"observedClass\":\"zero\" if x==0 else \"one\" if x==1 else \"many\",\"controlVectorRLE\":rle(v),\n         \"controlVectorSHA256\":H(J(v)),\"controlSetHashesDigest\":H(\"\\n\".join(rank(k[s][u])[\"sha256\"] for k in K).encode()),\n         \"min\":min(v),\"median\":sorted(v)[99],\"max\":max(v),\"controlZero\":v.count(0),\"controlOne\":v.count(1),\"controlMany\":sum(c>1 for c in v),\n         \"L\":lo,\"U\":up,\"E\":v.count(x),\"rawLover199\":[lo,199],\"rawUover199\":[up,199],\"corrected\":{\"lower\":[1+lo,200],\"upper\":[1+up,200]}}\n    scopes[str(s)]=e\nfor s in scopes: eq(\"scope \"+s,scopes[s],R[\"controls\"][\"scopes\"][s])\neq(\"observedPerScopeSummary\",{s:scopes[s][\"observed\"] for s in scopes if s!=\"union\"}|{\"union\":scopes[\"union\"][\"observed\"]},R[\"countsObserved\"][\"perScope\"])\neq(\"producerCanonicalOutput\",H(J({\"scopes\":scopes,\"equivalenceChecksPassed\":2189,\"toyChecks\":\"pass\",\"rowCount\":len(VOC),\"controls\":199})),R[\"canonicalDigests\"][\"countOutputCanonicalSHA256\"])\ninv=all(max(len(k[t][\"parameterTuples\"]) for t in range(1,11))<=len(k[\"union\"][\"parameterTuples\"])<=sum(len(k[t][\"parameterTuples\"]) for t in range(1,11)) and len(k[\"union\"][\"observedTypeKeys\"])==len(k[\"union\"][\"normalizedReadings\"]) for k in K+[O])\nchk[\"invariants\"]=inv\n# supplementary S2\nobsP=pairs_of(CT)\nS2={\"+\".join(\"(%d,%d)\"%(i+1,j+1) for i,j in sub):len(join(list(sub))) for n in (1,2,3) for sub in itertools.combinations(obsP,n)}\n# supplementary S1\nPAIR=list(itertools.combinations(range(32),2))\nPM=[(1<<i)|(1<<j) for i,j in PAIR]\ndef s1(rows):\n    bits=[int(\"0\"+\"\".join(\"1\" if r[3][i]==r[3][j] else \"0\" for r in rows),2) for i,j in PAIR]\n    z=o=m=0; n=len(PAIR)\n    for x in range(n):\n        for y in range(x+1,n):\n            if PM[x]&PM[y]: continue\n            used=PM[x]|PM[y]; b2=bits[x]&bits[y]\n            for w in range(y+1,n):\n                if used&PM[w]: continue\n                h=b2&bits[w]\n                if not h: z+=1\n                elif h&(h-1): m+=1\n                else: o+=1\n    return {\"zero\":z,\"one\":o,\"many\":m,\"total\":z+o+m}\nS1={\"union\":s1(VOC)}\nfor t in range(6,11): S1[str(t)]=s1([r for r in VOC if r[0]==t])\neq(\"S1total\",S1[\"union\"][\"total\"],496*435*378//6)\ndup={\"tuplesMinusReadings\":len(VOC)-len({r[3] for r in VOC}),\"pairs\":len({r[1:3] for r in VOC}),\n \"pairsInMoreThanOneTemplate\":sum(n>1 for n in Counter(r[1:3] for r in VOC).values()),\n \"control5ByTemplate\":{t:len(K[5][t][\"parameterTuples\"]) for t in range(1,11)},\"controlsWithFit\":[i for i,k in enumerate(K) if k[\"union\"][\"parameterTuples\"]],\n \"drawsDistinct\":len(set(DRAWS)),\"drawsEqualObservedPartition\":sum(sorted(pairs_of(c))==sorted(obsP) for c in DRAWS),\n \"control5Pairs1Based\":[[i+1,j+1] for i,j in pairs_of(DRAWS[5])]}\nout={\"checks\":chk,\"vocabulary\":{\"angle\":len(AD),\"distance\":len(DD),\"raw\":raw,\"perTemplate\":per,\"total\":len(VOC)},\"scopes\":scopes,\"S1\":S1,\"S2\":S2,\"dup\":dup}\njson.dump(out,sys.stdout,sort_keys=True)\n","extraPostFreeze":{"note":"run after the main audit, not part of the frozen code: direct single-pair check, template-9 placement count (2510, equal to S1 template 9) and the 84 job-file hashes","sha256":"0e0fe6df2750bbcb1fc3a36cf2b9ab3ebd3f30870e0cd6292d9a14a83e914418","source":"import sys,json,io,contextlib,itertools,hashlib,urllib.request\nfrom collections import Counter\nsrc=open('audit.py').read().split(\"# supplementary S2\")[0]\nsys.argv=['x','../dl']; g={}; exec(src,g)\nV=g['VOC']\nfor i,j in ((0,25),(1,31),(5,13)): print(\"direct single\",(i+1,j+1),sum(r[3][i]==r[3][j] for r in V))\nr9=[r for r in V if r[0]==9]; s=r9[0][3]\nP=[(i,j) for i,j in itertools.combinations(range(32),2) if s[i]==s[j]]\nn=sum(len({*a,*b,*c})==6 for a,b,c in itertools.combinations(P,3))\nprint(\"t9 records\",len(r9),\"types\",len(set(s)),\"multiplicity\",sorted(Counter(Counter(s).values()).items()),\"placements\",n)\nd=json.load(open('../dl/job.json'));ok=0;bad=[]\nfrom concurrent.futures import ThreadPoolExecutor\ndef f(x):\n    b=urllib.request.urlopen(urllib.request.Request(x['url'],headers={'User-Agent':'audit-client'}),timeout=60).read()\n    return hashlib.sha256(b).hexdigest()==x['hash']\nwith ThreadPoolExecutor(8) as e: res=list(e.map(f,d['files']))\nprint(\"job files\",len(res),\"hash ok\",sum(res))\n"}}}