diff --git a/research/t740-one-donor-operator/PROOF.md b/research/t740-one-donor-operator/PROOF.md new file mode 100644 index 0000000000..0cb3adbfdb --- /dev/null +++ b/research/t740-one-donor-operator/PROOF.md @@ -0,0 +1,167 @@ +# Five residual phases in the pinned owner-zero word + +This is a statement about the exact eight-stream data operator specified by the +retained T740 replay inputs. Fix owner replica 0, port 0, its complete chronology, +all hosted slices, and all translation phases. Change only the residual phase +operators of children 8, 10, 12, 13 and 14. The first four have no hosted axes; +child 14 has 31 hosted axes and one residual axis. Their residual ranks are +respectively 48, 48, 48, 48 and 1. + +For a character \(x\in\mathbb F_2^{73}\), let \(z_c(x)\) be the multiplier +by which the residual phase of child \(c\) changes. These five multipliers may +first be treated as independent indeterminates. In particular, the operator +calculation below does not require a proposed axis list or a rank bound. + +## Exact ambient-character calculation + +Write a binary parity as an integer in \(\{0,1\}\). For every binary vector +\(v\), its lift modulo four satisfies + +\[ +\langle v,x\rangle_{\mathbb F_2} +\equiv \sum_i v_i x_i-2\sum_{i mod 2 = sum_i v_i*x_i - 2 sum_(i> i & 1] + cross = sum(1 << (BITS * i + j) for offset, i in enumerate(indices) + for j in indices[offset + 1:]) + return vector, 0, cross + + +def add_phase(left, right): + # Low-bit carries enter the high linear coefficient; cross coefficients + # are already even and therefore add by XOR. + return (left[0] ^ right[0], + left[1] ^ right[1] ^ (left[0] & right[0]), + left[2] ^ right[2]) + + +def scale_phase(value, coefficient): + coefficient %= 4 + if coefficient == 0: + return ZERO_PHASE + if coefficient == 1: + return value + if coefficient == 2: + return 0, value[0], 0 + return value[0], value[1] ^ value[0], value[2] + + +def sum_phase(values): + result = ZERO_PHASE + for value in values: + result = add_phase(result, value) + return result + + +def symbolic_replay(data, prepared): + recipe, order, hosts, residual = prepared + template = data["template"] + # Keys are (five-variable squarefree monomial mask, low linear bits, + # high linear bits, even quadratic bits). Coefficients are integers. + matrix = [[{(0, 0, 0, 0): 1} if row == column else {} + for column in range(8)] for row in range(8)] + seen_sites = Counter() + peak = 8 + + def measure(): + nonlocal peak + peak = max(peak, sum(len(entry) for row in matrix for entry in row)) + + def phase(row, exponent, monomial=0): + for column in range(8): + changed = {} + for (mask, low, high, cross), coefficient in matrix[row][column].items(): + require(not mask & monomial, "phase variable encountered twice on a path") + key = (mask | monomial, *add_phase((low, high, cross), exponent)) + changed[key] = coefficient + matrix[row][column] = changed + measure() + + def shear(destination, source, coefficient): + require(destination != source and type(coefficient) is int, "shear") + for column in range(8): + result = matrix[destination][column] + for key, value in matrix[source][column].items(): + result[key] = result.get(key, 0) + coefficient * value + matrix[destination][column] = {key: value for key, value in result.items() if value} + measure() + + blocks = {} + current = None + for event in template["execution_schedule"]: + if event["kind"] in ("bank_padding_cover_sweep", "translate_every_live_family"): + continue + if event["kind"] == "local_cover_sweep": + current = event["stage"] + require(current not in blocks, "duplicate local block") + blocks[current] = [] + require(current is not None, "event before first block") + blocks[current].append(event) + require(set(blocks) == set(range(9)), "nine data blocks") + q = parity_phase(recipe["q"]) + visited = Counter() + for time, (stage, replica) in enumerate(order): + for stream, axes in hosts.get(time, []): + phase(stream, sum_phase(parity_phase(axis) for axis in axes)) + if replica != 0: + continue + visited[stage] += 1 + for event in blocks[stage]: + kind = event["kind"] + if kind == "local_cover_sweep": + local = [item for item in template["recipe"] + if item["kind"] == "local" and item["stage"] == stage] + require(len(local) == 1, "local recipe ambiguity") + local = local[0] + x, y = 2 * local["pair"], 2 * local["pair"] + 1 + for side, row in enumerate((x, y)): + before = (scale_phase(q, 1 - side) if stage == 0 else + add_phase(((1 << (9 + 8 * (stage - 1))) - 1, 0, 0), + scale_phase(q, -side))) + phase(row, scale_phase(before, -1)) + if local["reverse"]: + shear(x, y, -1) + else: + shear(y, x, 1) + for side, row in enumerate((x, y)): + after = add_phase(((1 << (9 + 8 * stage)) - 1, 0, 0), + scale_phase(q, -side)) + phase(row, after) + elif kind == "idle_cover_sweep": + for side, child in enumerate(event["child_indices"]): + exponent = sum_phase(parity_phase(axis) for axis in residual[child]) + exponent = add_phase(exponent, scale_phase(parity_phase( + recipe["idle_children"][child]["translation_after"]), 2)) + monomial = 0 + if child in SITES: + seen_sites[child] += 1 + monomial = 1 << SITES.index(child) + phase(2 * event["pair"] + side, exponent, monomial) + elif kind == "bridge": + destination, source, coefficient = event["dst"], event["src"], event["coefficient"] + shear(2 * destination, 2 * source, coefficient) + shear(2 * source + 1, 2 * destination + 1, -coefficient) + elif kind == "terminal_Y_translations": + for pair in event["pairs"]: + phase(2 * pair + 1, scale_phase(q, 2)) + elif kind == "terminal": + for pair in range(event["pairs"]): + matrix[2 * pair], matrix[2 * pair + 1] = ( + matrix[2 * pair + 1], + [{key: -value for key, value in entry.items()} + for entry in matrix[2 * pair]]) + else: + raise ValueError("unknown data event: " + kind) + require(visited == Counter({stage: 1 for stage in range(9)}), "data block chronology") + require(seen_sites == Counter({child: 1 for child in SITES}), "five phase injection sites") + normalizer = scale_phase(((1 << BITS) - 1, 0, 0), -1) + for row in range(8): + phase(row, normalizer) + polynomial = [] + for row in range(8): + for column in range(8): + for (mask, low, high, cross), coefficient in matrix[row][column].items(): + require((low, high, cross) == ZERO_PHASE, "uncancelled ambient character phase") + polynomial.append([row, column, mask, coefficient]) + return sorted(polynomial), peak + + +def assignment_census(polynomial): + accepted = [] + roots = ((1, 0), (0, 1), (-1, 0), (0, -1)) + for exponents in product(range(4), repeat=len(SITES)): + matrix = [[(0, 0) for _ in range(8)] for _ in range(8)] + for row, column, mask, coefficient in polynomial: + exponent = sum(exponents[i] for i in range(len(SITES)) if mask >> i & 1) % 4 + real, imaginary = roots[exponent] + before = matrix[row][column] + matrix[row][column] = (before[0] + coefficient * real, + before[1] + coefficient * imaginary) + if all(matrix[row][column] == (int(row == column), 0) + for row in range(8) for column in range(8)): + accepted.append(list(exponents)) + return {"total": 4 ** len(SITES), "accepted": len(accepted), + "accepted_exponents": accepted} + + +def build(): + data = inputs() + prepared = context(data) + polynomial, peak = symbolic_replay(data, prepared) + forcing = [[child, row] for child, row in zip(SITES, (6, 7, 1, 0, 3))] + for child, row in forcing: + diagonal = [term for term in polynomial if term[:2] == [row, row]] + require(diagonal == [[row, row, 1 << SITES.index(child), 1]], "forcing diagonal") + census = assignment_census(polynomial) + require(census["accepted_exponents"] == [[0] * 5], "nontrivial accepted phase assignment") + return { + "sites": list(SITES), "ambient_bits": BITS, "owner": 0, "port": 0, + "residual_ranks": [[child, len(prepared[3][child])] for child in SITES], + "polynomial_matrix": polynomial, "character_dependent_terms": 0, + "forcing_diagonal": forcing, "exact_phase_assignments": census, + }, peak + + +def main(): + observed, peak = build() + expected = json.loads((PACKAGE / "RESULT.json").read_bytes()) + for key, value in observed.items(): + require(expected.get(key) == value, "independent receipt mismatch: " + key) + print(json.dumps({"independent": "pass", "polynomial_terms": len(observed["polynomial_matrix"]), + "peak_terms": peak, "phase_assignments": observed["exact_phase_assignments"]}, + sort_keys=True)) + + +if __name__ == "__main__": + main() diff --git a/research/t740-one-donor-operator/test_verify.py b/research/t740-one-donor-operator/test_verify.py new file mode 100644 index 0000000000..39e4eabebb --- /dev/null +++ b/research/t740-one-donor-operator/test_verify.py @@ -0,0 +1,131 @@ +#!/usr/bin/env python3 +"""Small independent controls for the source-bound one-donor operator.""" + +from copy import deepcopy +from pathlib import Path +import sys +import unittest +from unittest.mock import patch + +sys.dont_write_bytecode = True +sys.path.insert(0, str(Path(__file__).resolve().parent)) +import verify as v + + +def identity(): + return [[(int(row == column), 0) for column in range(8)] for row in range(8)] + + +def normalize_numeric(matrix, character): + """Remove i^popcount(character) without using either replay's phase code.""" + exponent = -character.bit_count() % 4 + rotations = ( + lambda real, imag: (real, imag), + lambda real, imag: (-imag, real), + lambda real, imag: (-real, -imag), + lambda real, imag: (imag, -real), + ) + return [[rotations[exponent](*entry) for entry in row] for row in matrix] + + +class OperatorControls(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.source, cls.context, cls.blocks = v.load_context() + matrix, _ = v.symbolic_replay(cls.context, cls.blocks) + cls.rows = v.normalized_rows(matrix) + + def test_quadratic_parity_and_same_phase_distinct_bases(self): + separate = v.phase_add(v.phase_axis(1), v.phase_axis(2)) + difference = v.phase_add(v.phase_axis(3), v.phase_scale(separate, -1)) + self.assertEqual(v.phase_value(difference, 0), 0) + for bit in range(73): + self.assertEqual(v.phase_value(difference, 1 << bit), 0) + # All coordinate characters miss this nonzero quadratic term. + self.assertEqual(v.phase_value(difference, 3), 2) + high_pair = v.phase_axis((1 << 72) | 1) + self.assertEqual(v.phase_value(high_pair, (1 << 72) | 1), 0) + self.assertEqual(v.phase_value(high_pair, 1 << 72), 1) + + coordinate = [1 << bit for bit in range(6)] + complement = [63 ^ axis for axis in coordinate] + self.assertNotEqual(coordinate, complement) + for i, left in enumerate(complement): + for j, right in enumerate(complement): + self.assertEqual((left & right).bit_count() % 2, int(i == j)) + self.assertEqual(v.sum_axes(coordinate), v.sum_axes(complement)) + # Independence is essential to the rank consequence: repetition is free mod 4. + self.assertEqual(v.sum_axes([1, 1, 1, 1]), v.ZERO_PHASE) + + def test_exact_nontrivial_specialization_and_identity(self): + receipt = v.certify(self.context, self.blocks) + self.assertEqual(receipt["residual_ranks"], + [[8, 48], [10, 48], [12, 48], [13, 48], [14, 1]]) + self.assertEqual(v.specialize(self.rows, (0, 0, 0, 0, 0)), identity()) + expected = [[(0, 0) for _ in range(8)] for _ in range(8)] + diagonal = [(0, 1), (0, -1), (1, 0), (-1, 0), + (1, 0), (1, 0), (0, 1), (-1, 0)] + for index, entry in enumerate(diagonal): + expected[index][index] = entry + expected[0][2] = (-1, 1) + expected[3][1] = (1, -1) + expected[5][1] = (2, 0) + expected[5][3] = (-2, 0) + self.assertEqual(v.specialize(self.rows, (1, 2, 3, 1, 2)), expected) + + def test_actual_donor_axis_removal_matches_formal_phase(self): + donor_axes = self.context["residual"][14] + self.assertEqual(donor_axes, [1 << 72]) + character = donor_axes[0] + before = self.source.replay(self.context, self.context["residual"], + character, self.blocks) + self.assertEqual(normalize_numeric(before, character), identity()) + changed = deepcopy(self.context["residual"]) + changed[14].pop() + after = self.source.replay(self.context, changed, character, self.blocks) + actual = normalize_numeric(after, character) + self.assertNotEqual(actual, identity()) + self.assertEqual(actual, v.specialize(self.rows, (0, 0, 0, 0, 3))) + + def test_omitted_hosted_prefix_is_detected(self): + changed = deepcopy(self.context) + time = next(time for time, events in changed["hosts"].items() if events) + removed = changed["hosts"][time].pop(0) + self.assertTrue(removed[1]) + # Keep hosted_axes metadata intact: replay must detect the missing action. + with self.assertRaisesRegex(ValueError, "uncancelled ambient character phase"): + v.certify(changed, self.blocks) + + def test_omitted_bridge_is_detected(self): + changed = deepcopy(self.blocks) + stage, index = next( + (stage, index) + for stage, events in changed.items() + for index, event in enumerate(events) + if event["kind"] == "bridge" and event["coefficient"] != 0 + ) + changed[stage].pop(index) + with self.assertRaisesRegex( + ValueError, "uncancelled ambient character phase|source-bound five-site matrix"): + v.certify(self.context, changed) + + def test_changed_source_bytes_are_rejected(self): + target = v.ROOT / v.SOURCE / "verify.py" + original_read = Path.read_bytes + intercepted = [] + + def changed_read(path): + data = original_read(path) + if path == target: + intercepted.append(path) + return data + b"\n# synthetic source-pin fault\n" + return data + + with patch.object(Path, "read_bytes", changed_read): + with self.assertRaisesRegex(ValueError, "source hash: .*verify[.]py"): + v.authenticate() + self.assertEqual(intercepted, [target]) + + +if __name__ == "__main__": + unittest.main() diff --git a/research/t740-one-donor-operator/verify.py b/research/t740-one-donor-operator/verify.py new file mode 100644 index 0000000000..0938cbb5b7 --- /dev/null +++ b/research/t740-one-donor-operator/verify.py @@ -0,0 +1,278 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: Apache-2.0 +# Copyright 2026 thakrarsagar. Developed with substantial OpenAI Codex assistance. +"""All-character five-site operator certificate for one authenticated T740 group. + +Baseline phases use degree-two Z4 polynomials on Boolean Fourier coordinates. +Five additional commuting indeterminates record the changed residual phases. +The resulting matrix cancels every ambient character polynomial exactly. +""" + +import argparse +from collections import defaultdict +import hashlib +from itertools import product +import json +from pathlib import Path +from types import ModuleType + +HERE = Path(__file__).resolve().parent +ROOT = HERE.parents[1] +SOURCE = "research/idle-star-paired-axis-census" +ALLOCATION = "research/rank7-joint-endframes/allocation" +PHASES = "research/adaptive-kernel-demotion/inputs/DATA-PHASES.json" +BITS = 73 +SITES = (8, 10, 12, 13, 14) +ZERO_PHASE = (0, 0, 0) + + +def require(condition, message): + if not condition: + raise ValueError(message) + + +def authenticate(root=ROOT): + data = {} + for pin in json.loads((HERE / "SOURCES.json").read_bytes())["files"]: + if pin["usage"] != "input": + continue + path = pin["path"] + require(not Path(path).is_absolute() and ".." not in Path(path).parts, + "relative source path") + body = (Path(root) / path).read_bytes() + require(hashlib.sha256(body).hexdigest() == pin["sha256"], "source hash: " + path) + data[path] = body + return data + + +def load_context(root=ROOT): + """Reuse authenticated source loading/projection, not its numerical replay.""" + data = authenticate(root) + source = ModuleType("retained_idle_axis_operator") + source.__file__ = str(Path(root) / SOURCE / "verify.py") + exec(compile(data[SOURCE + "/verify.py"], source.__file__, "exec"), source.__dict__) + source.authenticate() + + def decode(path): + return source.decode(data[path]) + + base = decode(SOURCE + "/vendor/BASE-FILL.json.gz")["rows"] + journal = decode(SOURCE + "/vendor/EXCHANGE.json") + rows = source.project_all_ports(base, source.journal_edits(base, journal))[0] + order = [[stage, owner + 74 * copy] + for stage, owner in decode(ALLOCATION + "/ORDER.json") for copy in range(10)] + dispatch = {(stage, owner): tag for stage, owner, tag in decode(ALLOCATION + "/DISPATCH.json")} + providers = decode(SOURCE + "/vendor/PROVIDERS.json") + plan = decode(ALLOCATION + "/vendor/PLAN.json.gz") + template = decode(ALLOCATION + "/vendor/TEMPLATE.json.gz") + recipes = decode(PHASES)["recipes"] + context = source.prepare_port(0, rows, order, dispatch, providers, plan, template, recipes) + require(len(rows) == 30, "owner-zero port-zero hosted rows") + return source, context, source.stage_blocks(template) + + +def phase_add(left, right): + """Add Z4 linear coefficients and even cross coefficients exactly.""" + a, b, c = left + d, e, f = right + return a ^ d, b ^ e ^ (a & d), c ^ f + + +def phase_scale(value, coefficient): + require(type(coefficient) is int, "integer phase coefficient") + result = ZERO_PHASE + for _ in range(coefficient % 4): + result = phase_add(result, value) + return result + + +def phase_axis(vector, bits=BITS): + """Parity(v & chi) = sum chi_i - 2 sum_{i> index & 1] + # Cross positions always use the fixed ambient stride, even in small tests. + cross = sum(1 << (left * BITS + right) + for offset, left in enumerate(positions) for right in positions[offset + 1:]) + return vector, 0, cross + + +def phase_value(value, character): + require(type(character) is int and 0 <= character < 1 << BITS, "Fourier character") + low, high, cross = value + result = (low & character).bit_count() + 2 * (high & character).bit_count() + while cross: + bit = cross & -cross + left, right = divmod(bit.bit_length() - 1, BITS) + if character >> left & 1 and character >> right & 1: + result += 2 + cross ^= bit + return result % 4 + + +def initial_matrix(): + return [[{(0, 0, 0, 0): 1} if row == column else {} + for column in range(8)] for row in range(8)] + + +def phase_row(matrix, stream, exponent, variable=0): + for column in range(8): + changed = defaultdict(int) + for (mask, low, high, cross), coefficient in matrix[stream][column].items(): + require(not mask & variable, "formal site occurs at most once along a path") + changed[(mask | variable,) + phase_add((low, high, cross), exponent)] += coefficient + matrix[stream][column] = {key: value for key, value in changed.items() if value} + + +def shear(matrix, destination, source, coefficient): + require(destination != source and coefficient in (-1, 1), "retained stream shear") + for column in range(8): + for key, value in matrix[source][column].items(): + matrix[destination][column][key] = matrix[destination][column].get(key, 0) + coefficient * value + matrix[destination][column] = { + key: value for key, value in matrix[destination][column].items() if value} + + +def sum_axes(axes): + result = ZERO_PHASE + for axis in axes: + result = phase_add(result, phase_axis(axis)) + return result + + +def data_event(matrix, event, context, variables, seen): + recipe, template = context["recipe"], context["template"] + kind, q = event["kind"], phase_axis(recipe["q"]) + if kind == "local_cover_sweep": + stage = event["stage"] + local = next(item for item in template["recipe"] + if item["kind"] == "local" and item["stage"] == stage) + left, right = 2 * local["pair"], 2 * local["pair"] + 1 + for side, stream in enumerate((left, right)): + before = (phase_scale(q, 1 - side) if stage == 0 else + phase_add(((1 << (9 + 8 * (stage - 1))) - 1, 0, 0), phase_scale(q, -side))) + phase_row(matrix, stream, phase_scale(before, -1)) + if local["reverse"]: + shear(matrix, left, right, -1) + else: + shear(matrix, right, left, 1) + for side, stream in enumerate((left, right)): + phase_row(matrix, stream, + phase_add(((1 << (9 + 8 * stage)) - 1, 0, 0), phase_scale(q, -side))) + elif kind == "idle_cover_sweep": + for side, child in enumerate(event["child_indices"]): + exponent = sum_axes(context["residual"][child]) + translation = recipe["idle_children"][child]["translation_after"] + exponent = phase_add(exponent, phase_scale(phase_axis(translation), 2)) + variable = variables.get(child, 0) + if variable: + require(child not in seen, "one residual insertion per selected site") + seen.add(child) + phase_row(matrix, 2 * event["pair"] + side, exponent, variable) + elif kind == "bridge": + destination, source, coefficient = event["dst"], event["src"], event["coefficient"] + shear(matrix, 2 * destination, 2 * source, coefficient) + shear(matrix, 2 * source + 1, 2 * destination + 1, -coefficient) + elif kind == "terminal_Y_translations": + for pair in event["pairs"]: + phase_row(matrix, 2 * pair + 1, phase_scale(q, 2)) + elif kind == "terminal": + for pair in range(event["pairs"]): + matrix[2 * pair], matrix[2 * pair + 1] = matrix[2 * pair + 1], matrix[2 * pair] + for column in range(8): + matrix[2 * pair + 1][column] = { + key: -value for key, value in matrix[2 * pair + 1][column].items()} + else: + raise ValueError("unknown source event: " + kind) + + +def symbolic_replay(context, blocks, sites=SITES): + require(len(sites) == len(set(sites)), "distinct formal phase sites") + variables = {child: 1 << index for index, child in enumerate(sites)} + matrix, seen, peak = initial_matrix(), set(), 8 + for time, (stage, owner) in enumerate(context["order"]): + for stream, axes in context["hosts"].get(time, ()): + phase_row(matrix, stream, sum_axes(axes)) + if owner == 0: + for event in blocks[stage]: + data_event(matrix, event, context, variables, seen) + peak = max(peak, sum(len(entry) for row in matrix for entry in row)) + require(seen == set(sites), "all selected residual sites reached") + inverse_baseline = phase_scale(((1 << BITS) - 1, 0, 0), -1) + for stream in range(8): + phase_row(matrix, stream, inverse_baseline) + return matrix, peak + + +def normalized_rows(matrix): + rows = [] + for row, entries in enumerate(matrix): + for column, entry in enumerate(entries): + for (mask, low, high, cross), coefficient in entry.items(): + require(not (low or high or cross), "uncancelled ambient character phase") + rows.append([row, column, mask, coefficient]) + return sorted(rows) + + +def specialize(rows, exponents): + require(len(exponents) == len(SITES) and all(type(x) is int for x in exponents), + "five integer phase exponents") + units = ((1, 0), (0, 1), (-1, 0), (0, -1)) + matrix = [[(0, 0) for _ in range(8)] for _ in range(8)] + for row, column, mask, coefficient in rows: + exponent = sum(exponents[index] for index in range(len(SITES)) if mask >> index & 1) + real, imag = units[exponent % 4] + before_real, before_imag = matrix[row][column] + matrix[row][column] = (before_real + coefficient * real, before_imag + coefficient * imag) + return matrix + + +def certify(context, blocks): + expected_ranks = [[8, 48], [10, 48], [12, 48], [13, 48], [14, 1]] + require([[child, len(context["residual"][child])] for child in SITES] == expected_ranks, + "source residual ranks") + for child in SITES: + combined = context["hosted_axes"].get(child, []) + context["residual"][child] + require(all((a & b).bit_count() % 2 == int(i == j) + for i, a in enumerate(combined) for j, b in enumerate(combined)), + "hosted and residual axes form an orthonormal basis") + matrix, peak = symbolic_replay(context, blocks) + rows = normalized_rows(matrix) + expected = [[0, 0, 8, 1], [0, 2, 0, -1], [0, 2, 8, 1], [1, 1, 4, 1], + [2, 2, 0, 1], [3, 1, 4, 1], [3, 1, 16, -1], [3, 3, 16, 1], + [4, 4, 0, 1], [5, 1, 0, 1], [5, 1, 16, -1], [5, 3, 0, -1], + [5, 3, 16, 1], [5, 5, 0, 1], [6, 6, 1, 1], [7, 7, 2, 1]] + require(rows == expected, "source-bound five-site matrix") + identity = [[(int(row == column), 0) for column in range(8)] for row in range(8)] + accepted = [list(values) for values in product(range(4), repeat=len(SITES)) + if specialize(rows, values) == identity] + require(accepted == [[0, 0, 0, 0, 0]], "independent residual phase rigidity") + return dict(schema=1, sites=list(SITES), ambient_bits=BITS, owner=0, port=0, + residual_ranks=expected_ranks, polynomial_matrix=rows, + character_dependent_terms=0, + forcing_diagonal=[[8, 6], [10, 7], [12, 1], [13, 0], [14, 3]], + exact_phase_assignments=dict(total=1024, accepted=len(accepted), accepted_exponents=accepted), + peak_symbolic_terms=peak, + rank_consequence="each selected residual rank is unchanged for independent replacement axes", + rank_proof="uniform-character phase average has squared magnitude 2^(-rank)") + + +def build(): + _source, context, blocks = load_context() + return certify(context, blocks) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--emit", action="store_true") + args = parser.parse_args() + receipt = build() + if args.emit: + print(json.dumps(receipt, indent=2, sort_keys=True)) + else: + require(receipt == json.loads((HERE / "RESULT.json").read_bytes()), "retained result mismatch") + print("PASS_T740_ONE_DONOR_OPERATOR sites=5 ambient_bits=73 formal_terms=16 rank_change=0") + + +if __name__ == "__main__": + main()