arm_manifest_path = args.arm_manifest.expanduser().resolve() if args.arm_manifest is not None else None master_contract_path = args.master_contract.expanduser().resolve() if args.master_contract is not None else None receipt = run_verification( repo_root=repo_root, website_root=website_root, standalone=standalone, fasta_path=fasta_path, arm_manifest_path=arm_manifest_path, master_contract_path=master_contract_path, ) raw_json = json.dumps(receipt, indent=2, ensure_ascii=False, allow_nan=False) + "\n" expected_bytes = raw_json.encode("utf-8") elapsed_s = time.perf_counter() - t0 c1 = receipt["part_f_exact_2pow20_portfolio"]["scenarios"]["W6_C1_standalone_over_honest_L1"] g32 = receipt["part_g_gate32_executable_adjudicator_self_tests"] if args.check: require_cond(out_path.is_file(), f"--check failed: receipt missing at {out_path}") existing_bytes = out_path.read_bytes() require_cond( existing_bytes == expected_bytes, f"--check failed: raw byte mismatch for {out_path.name} (existing={sha256_bytes(existing_bytes)}, fresh={sha256_bytes(expected_bytes)})", ) print( f"PASS (--check byte-exact): mode={receipt['verification_mode']} " f"C1_mod={c1['modular_pct']:.4f}% (+{c1['delta_vs_honest_l1_pct_pp']:.4f}pp) " f"gate34_tests={g32['passed_cases']}/{g32['total_cases']} " f"sha256={sha256_bytes(existing_bytes)} portable={receipt['portable_payload_sha256'][:12]} " f"elapsed={elapsed_s:.3f}s (optimize={sys.flags.optimize})" ) return if args.check_portable: fresh_portable = verify_portable_receipt_file(out_path, receipt) print( f"PASS (--check-portable): mode={receipt['verification_mode']} " f"receipt={out_path.name} portable_payload_sha256={fresh_portable} " f"elapsed={elapsed_s:.3f}s (optimize={sys.flags.optimize})" ) return out_path.parent.mkdir(parents=True, exist_ok=True) out_path.write_bytes(expected_bytes) print( f"PASS: mode={receipt['verification_mode']} wrote={out_path} " f"C1_mod={c1['modular_pct']:.4f}% (+{c1['delta_vs_honest_l1_pct_pp']:.4f}pp vs Honest L1) " f"gate34_tests={g32['passed_cases']}/{g32['total_cases']} " f"sha256={sha256_bytes(expected_bytes)} portable={receipt['portable_payload_sha256']} " f"elapsed={elapsed_s:.3f}s (optimize={sys.flags.optimize})" ) if __name__ == "__main__": main()