"""Convert the sealed public supports to a standard-library C handoff. The C program evaluates all three-prime phase vectors on every event support. Only deterministic metadata and statistics go to stdout, with no timings. """ import hashlib import json import subprocess import sys from pathlib import Path def main(): assert len(sys.argv) == 3, 'Pass input JSON and compiled C executable' raw = Path(sys.argv[1]).read_bytes() data = json.loads(raw) assert data['job_id'] == 741 and data['all_construction_and_kernel_gates_passed'] lines = [str(len(data['words']))] for w in data['words']: lines.append(' '.join(map(str, [w['width'], len(w['slots']), int(w['retain_events']), len(w['lengths'])] + w['primes']))) lines.append(' '.join(map(str, w['slots']))) lines.append(' '.join(map(str, w['lengths']))) r = subprocess.run([str(Path(sys.argv[2]).resolve())], input='\n'.join(lines) + '\n', text=True, capture_output=True, timeout=600) assert r.returncode == 0, r.stderr result = json.loads(r.stdout) assert len(result['words']) == len(data['words']) for i, w in enumerate(result['words']): assert w['word_index'] == i w['label'] = data['words'][i]['label'] w['primes'] = data['words'][i]['primes'] comparisons = [] for pair in data['matched_pairs']: i, j = pair['word_indices'] a, b = result['words'][i]['statistics'][0], result['words'][j]['statistics'][0] comparisons.append({'trial': pair['trial'], 'tree_distributions_differ': a['tree_distribution'] != b['tree_distribution'], 'tree_minima_differ': a['minimum_tree'] != b['minimum_tree'], 'exact_distributions_differ': a['exact_distribution'] != b['exact_distribution'], 'exact_minima_differ': a['minimum_exact'] != b['minimum_exact'], 'loss_distributions_differ': a['loss_distribution'] != b['loss_distribution']}) result.update({'job_id': 741, 'pilot': data['pilot'], 'input_sha256': hashlib.sha256(raw).hexdigest(), 'seed': data['seed'], 'matched_pairs': len(comparisons), 'pair_comparisons': comparisons, 'actual_205_tree_certificate_failed': result['words'][1]['statistics'][0]['minimum_tree'] <= 0, 'matched_tree_order_sensitivity_observed': any(c['tree_distributions_differ'] for c in comparisons), 'scope': 'Exact finite three-prime support margin; artificial controls, no LP, scaling law or infinitude.'}) print(json.dumps(result, indent=2)) if __name__ == '__main__': main()