menik1126 commited on
Commit
3a24375
·
1 Parent(s): 609c042

Add historical exact FOM 100/9 reference

Browse files
README.md CHANGED
@@ -17,6 +17,8 @@ configs:
17
  data_files: data/round_summary.jsonl
18
  - config_name: stage2_best_verified
19
  data_files: data/stage2_best_verified.jsonl
 
 
20
  ---
21
 
22
  # QLDPC FOM>12 Search Evidence
@@ -37,6 +39,16 @@ The latest source boundary contained 102 raw-score ties; only the 13 released
37
  rows completed the full replay used here. The dataset does not claim that all
38
  102 raw ties have the same evidence level.
39
 
 
 
 
 
 
 
 
 
 
 
40
 
41
  ## Snapshot summary
42
 
 
17
  data_files: data/round_summary.jsonl
18
  - config_name: stage2_best_verified
19
  data_files: data/stage2_best_verified.jsonl
20
+ - config_name: historical_exact_fom11
21
+ data_files: data/historical_exact_fom11.jsonl
22
  ---
23
 
24
  # QLDPC FOM>12 Search Evidence
 
39
  rows completed the full replay used here. The dataset does not claim that all
40
  102 raw ties have the same evidence level.
41
 
42
+ ## Historical exact-distance reference (2026-08-17)
43
+
44
+ The separate `historical_exact_fom11` configuration contains one
45
+ canonical-deduplicated `[[288,50,8]]` CSS-BB code with legacy exact FOM
46
+ `100/9 ~= 11.1111`. The Campaign 4 source reports `d_X=d_Z=8` and all 100
47
+ logical MILPs optimal. This is a historical exact non-winner, not a current
48
+ Stage 2 result. Its identity and matrices were replayed with the current code,
49
+ but the legacy run did not preserve a portable proof artifact under the modern
50
+ certificate schema. See
51
+ [`docs/HISTORICAL_EXACT_FOM11.md`](docs/HISTORICAL_EXACT_FOM11.md).
52
 
53
  ## Snapshot summary
54
 
data/historical_exact_fom11.jsonl ADDED
@@ -0,0 +1 @@
 
 
1
+ {"authority":{"modern_replayable_distance_certificate":false,"pipeline_promotion":false,"publication_certificate":false},"candidate_id":"5bf3e9dc496750d28d4e","canonical_digest":"5bf3e9dc496750d28d4e5d70a41fe57494465d03178204e90d9e75367de0200b","code":"[[288,50,8]]","construction":{"A_terms":[[0,0],[1,0],[0,5],[1,5]],"B_terms":[[0,0],[0,1],[5,0],[5,1]],"ell":18,"family":"css-bb","geometry":"rectangular","m":8},"distance":{"d_x":8,"d_z":8,"exact":8,"lower_bound":8,"status":"exact_per_legacy_all_optimal_milp","upper_bound":8},"evidence_level":"legacy_solver_exact_summary_with_modern_identity_replay","fom":{"exact":{"decimal":11.11111111111111,"denominator":9,"numerator":100},"gap_to_12":{"decimal":0.8888888888888888,"denominator":9,"numerator":8}},"identity":{"construction_sha256":"6e518c1b260f96cca3ed61b38df375cba565c086dc3979397d12cc31df33d917","identity_matrix_replay_verified":true,"registry_id":"qcode-css-verified-0660","registry_sha256":"536c733d68d344ed9fef9992bbeb1000900174ad0c500ddb7004126ae5c98408"},"limitations":"The legacy result preserves an all-logicals-optimal MILP summary but not a portable witness/proof artifact under the current hardened certificate schema.","matrices":{"hx_content_sha256":"1cacadd7b31719819d1d5f562e3d38776814fd30bf2bc75fd7f8f39d0ae3900e","hx_file_sha256":"2dc73d9bc5ce64bf98325d343feea4895d68036bcb9cf9882bb71f3633c497a3","hx_path":"matrices/5bf3e9dc496750d28d4e/Hx.mtx.gz","hx_shape":[144,288],"hz_content_sha256":"900df0398e710690b2dac093750ac07dfc04e3461402212292c3469ec94836ee","hz_file_sha256":"70cf6f60310168d951960fadb3c9002539bb7ed98b9f51007eda4de10c9b3ced","hz_path":"matrices/5bf3e9dc496750d28d4e/Hz.mtx.gz","hz_shape":[144,288]},"matrix_checks":{"commutation_violations":0,"css_commutation":true,"k_recomputed":50,"max_check_weight":8,"max_qubit_degree":8,"max_sector_qubit_degree":4,"rank_x":119,"rank_z":119},"parameters":{"k":50,"n":288},"record_kind":"historical_exact_distance_reference","record_sha256":"15b84ad44a3bf9a2e9c97d2be83dab26827780d8e05b753520fc1cb3d3385b38","source_stage":"campaign4_milp_exact","stage":"historical_campaign4","stage_2":false,"status":"LEGACY_MILP_EXACT_NON_WIN","target":{"certified_win":false,"inclusive_required_distance":9,"strict_predicate":"k*d*d > 12*n","strict_required_distance":9}}
docs/HISTORICAL_EXACT_FOM11.md ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Historical exact-distance reference with FOM 100/9
2
+
3
+ This configuration publishes one canonical-deduplicated CSS-BB code:
4
+
5
+ - parameters: `[[288,50,8]]`;
6
+ - exact FOM in the legacy result: `50*8^2/288 = 100/9 ~= 11.11111111`;
7
+ - source stage: `campaign4_milp_exact`;
8
+ - source status: both sectors reported distance 8, with all 100 logical MILPs optimal;
9
+ - target status: exact non-winner (`100/9 < 12`).
10
+
11
+ Two stored polynomial orientations reduce to the same canonical CSS code. The
12
+ release therefore contains one row, with provenance for both source rows.
13
+ The supplied `H_X` and `H_Z` matrices were reconstructed again from the
14
+ canonical polynomial representation; their ranks, CSS commutation, and
15
+ canonical registry identity were replayed successfully.
16
+
17
+ ## Evidence boundary
18
+
19
+ This is a **historical Campaign 4 legacy MILP-exact result**, not a current
20
+ Stage 2 certificate. The legacy JSONL preserves the solver summary
21
+ (`d_x=d_z=8`, 100/100 logical problems optimal), but it does not preserve a
22
+ portable proof/witness artifact bound under the current hardened certificate
23
+ schema. Consequently:
24
+
25
+ - `exact_distance=8` reports the historical all-optimal MILP result;
26
+ - `modern_replayable_distance_certificate=false`;
27
+ - `publication_certificate=false` and `pipeline_promotion=false`;
28
+ - the row must not be presented as a new Stage 2 strict win.
29
+
30
+ Run `python -B scripts/verify_historical_exact_fom11.py .` to verify file
31
+ hashes, reconstruct the matrices, check GF(2) ranks and CSS commutation, and
32
+ recompute the rational FOM. That verifier checks the published identity and
33
+ summary bindings; it does not recreate the omitted legacy MILP proof search.
34
+
35
+ ## 中文说明
36
+
37
+ 该配置发布一个规范去重后的 `[[288,50,8]]` CSS-BB 码,历史 MILP 结果中
38
+ 精确 FOM 为 `100/9 ~= 11.1111`,因此它是 exact non-winner。两个 X/Z
39
+ 方向共 100 个逻辑问题均记录为 optimal。矩阵、秩、对易关系和 registry
40
+ 身份已经重新回放核验。
41
+
42
+ 但这条记录来自历史 Campaign 4,并非当前 Stage 2 的现代证书;旧结果未
43
+ 保存符合当前 hardened schema 的可移植 proof artifact。因此数据中明确
44
+ 保留 `modern_replayable_distance_certificate=false`,不能把它描述成新的
45
+ Stage 2 认证胜者。
evidence/historical_exact_fom11.jsonl ADDED
@@ -0,0 +1 @@
 
 
1
+ {"authority":{"modern_replayable_distance_certificate":false,"pipeline_promotion":false,"publication_certificate":false},"candidate_id":"5bf3e9dc496750d28d4e","canonical_digest":"5bf3e9dc496750d28d4e5d70a41fe57494465d03178204e90d9e75367de0200b","evidence_sha256":"932d161aaa515fe049bec9f6c37d5c1d240347ba5c2ae1ee6741d6e209a0c536","identity_replay":{"canonical_digest":"5bf3e9dc496750d28d4e5d70a41fe57494465d03178204e90d9e75367de0200b","construction_sha256":"6e518c1b260f96cca3ed61b38df375cba565c086dc3979397d12cc31df33d917","css_commutation":true,"k_recomputed":50,"registry_id":"qcode-css-verified-0660","verified":true},"legacy_milp_summary":{"d_x":8,"d_x_computed":true,"d_z":8,"exact":true,"logicals_incumbent":0,"logicals_optimal":100,"num_logicals_checked":100,"timeout_per_logical_s":300,"total_logicals":100},"limitations":{"distance_claim":"Exact under the legacy Campaign 4 per-logical MILP result semantics.","portable_modern_certificate":"Not available: the source JSONL did not persist a modern bound-instance proof, solver-runtime binding, or independently replayable distance certificate.","safe_use":"Historical exact-distance reference and identity/matrix reproduction; not a current Stage 2 promotion artifact."},"record_kind":"historical_exact_distance_evidence","source":{"file_sha256":"763f0e57f313b6d54dd2232a2c7e5bb3de08bb5f1e8757844715fc41b90408d9","path":"results/campaign4_milp_verified.jsonl","records":[{"elapsed_s":4384.728747079003,"orientation":"canonical","raw_line_sha256":"9b3f9697c6c56f6c46dcbcba358b57f6f806306b91925f79ceaa797c7c642fd5","row_index_zero_based":660,"saved_at":"2026-03-09T10:36:27+00:00"},{"elapsed_s":4883.398503006996,"orientation":"equivalent_A_B_swapped_form","raw_line_sha256":"3eb80f4c23f371977736fe0714266dd43ad610593afc87a158a802e31321d8ab","row_index_zero_based":676,"saved_at":"2026-03-09T10:44:46+00:00"}]},"source_stage":"campaign4_milp_exact","stage_2":false}
manifests/SHA256SUMS CHANGED
@@ -1,6 +1,6 @@
1
  ffe79769ee48619a33c8049eef31be7f633ca00cf0fa1d4d852cbd1e4f9d8936 CITATION.cff
2
  c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 LICENSE
3
- 21f54159c99a91ea797a65d0b1882f93bd4c1eeba6dce556e39eff2cd431ffcb README.md
4
  95a5ec2a8c23f4aab17998c6fad05490a316c083983d7183feaad075e3dff397 THIRD_PARTY_NOTICES.md
5
  9476a8f02cd6c3e09e0ff73f4d5013f3b98902b3d157072c233f5012cd60d00b config/run_config.public.json
6
  6db5c6d622831117e5e8276d9d87d22b01889082b1f6fd74b770ed1b4abb6edb data/candidates.jsonl
@@ -122,3 +122,10 @@ a910a0b82c8e86b8784052f038e8287f3a45f2f6e807cd9804d293cddd07a385 data/stage2_be
122
  e20a073c69c2fa9fdb8182063ab592c3f3c757323b2d116142b3befc61d43034 docs/STAGE2_BEST_RESULT.md
123
  0aea4cf3413f06796db3b0c5f4bae97712c35db6b834f419a59e77bd10e00f9f evidence/stage2_best_verified.jsonl
124
  21669a77c80405f611407140fbe5b9b6895db729e1deae61eb93d23675f7178c manifests/stage2_best_verified.json
 
 
 
 
 
 
 
 
1
  ffe79769ee48619a33c8049eef31be7f633ca00cf0fa1d4d852cbd1e4f9d8936 CITATION.cff
2
  c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4 LICENSE
3
+ 48cb87c52461a7e60cab860750bbfff717f4aaaea3892a3725e12480e72f748c README.md
4
  95a5ec2a8c23f4aab17998c6fad05490a316c083983d7183feaad075e3dff397 THIRD_PARTY_NOTICES.md
5
  9476a8f02cd6c3e09e0ff73f4d5013f3b98902b3d157072c233f5012cd60d00b config/run_config.public.json
6
  6db5c6d622831117e5e8276d9d87d22b01889082b1f6fd74b770ed1b4abb6edb data/candidates.jsonl
 
122
  e20a073c69c2fa9fdb8182063ab592c3f3c757323b2d116142b3befc61d43034 docs/STAGE2_BEST_RESULT.md
123
  0aea4cf3413f06796db3b0c5f4bae97712c35db6b834f419a59e77bd10e00f9f evidence/stage2_best_verified.jsonl
124
  21669a77c80405f611407140fbe5b9b6895db729e1deae61eb93d23675f7178c manifests/stage2_best_verified.json
125
+ 630a79802d339c69ce3008be586d2e3c11fc1baefc43aa49282fe2b73eda6cf3 data/historical_exact_fom11.jsonl
126
+ a1d1a21f66b3c53858627dbe76b87bfe96756d0eb20471a913e71ecce76e4917 docs/HISTORICAL_EXACT_FOM11.md
127
+ 77e73fe488d9204044aa9e64af655db9f2f35eb0aefaf4fcc108d2b7f31c19e1 evidence/historical_exact_fom11.jsonl
128
+ a213484ae5bf13db227919e3edbfdbac3cb47745afa58f9abe31ee5cd77e3b20 manifests/historical_exact_fom11.json
129
+ 2dc73d9bc5ce64bf98325d343feea4895d68036bcb9cf9882bb71f3633c497a3 matrices/5bf3e9dc496750d28d4e/Hx.mtx.gz
130
+ 70cf6f60310168d951960fadb3c9002539bb7ed98b9f51007eda4de10c9b3ced matrices/5bf3e9dc496750d28d4e/Hz.mtx.gz
131
+ 1c5c46b3ee1893effa7b01009f8681e881e0e9e13f6a7f17ced21adba2d4e12d scripts/verify_historical_exact_fom11.py
manifests/historical_exact_fom11.json ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "authority": {
3
+ "modern_replayable_distance_certificate": false,
4
+ "pipeline_promotion": false,
5
+ "publication_certificate": false
6
+ },
7
+ "candidate": {
8
+ "canonical_digest": "5bf3e9dc496750d28d4e5d70a41fe57494465d03178204e90d9e75367de0200b",
9
+ "code": "[[288,50,8]]",
10
+ "exact_fom_denominator": 9,
11
+ "exact_fom_numerator": 100,
12
+ "registry_id": "qcode-css-verified-0660"
13
+ },
14
+ "created_date_utc": "2026-08-17",
15
+ "dataset_base_commit": "609c04215f4a656bf477a5c255596a2fd6ea4218",
16
+ "files": [
17
+ {
18
+ "bytes": 2291,
19
+ "path": "data/historical_exact_fom11.jsonl",
20
+ "rows": 1,
21
+ "sha256": "630a79802d339c69ce3008be586d2e3c11fc1baefc43aa49282fe2b73eda6cf3"
22
+ },
23
+ {
24
+ "bytes": 1924,
25
+ "path": "evidence/historical_exact_fom11.jsonl",
26
+ "rows": 1,
27
+ "sha256": "77e73fe488d9204044aa9e64af655db9f2f35eb0aefaf4fcc108d2b7f31c19e1"
28
+ },
29
+ {
30
+ "bytes": 2928,
31
+ "path": "matrices/5bf3e9dc496750d28d4e/Hx.mtx.gz",
32
+ "sha256": "2dc73d9bc5ce64bf98325d343feea4895d68036bcb9cf9882bb71f3633c497a3"
33
+ },
34
+ {
35
+ "bytes": 2812,
36
+ "path": "matrices/5bf3e9dc496750d28d4e/Hz.mtx.gz",
37
+ "sha256": "70cf6f60310168d951960fadb3c9002539bb7ed98b9f51007eda4de10c9b3ced"
38
+ },
39
+ {
40
+ "bytes": 2249,
41
+ "path": "docs/HISTORICAL_EXACT_FOM11.md",
42
+ "sha256": "a1d1a21f66b3c53858627dbe76b87bfe96756d0eb20471a913e71ecce76e4917"
43
+ },
44
+ {
45
+ "bytes": 6947,
46
+ "path": "scripts/verify_historical_exact_fom11.py",
47
+ "sha256": "1c5c46b3ee1893effa7b01009f8681e881e0e9e13f6a7f17ced21adba2d4e12d"
48
+ }
49
+ ],
50
+ "gate": "qcode-historical-campaign4-exact-reference-v1",
51
+ "manifest_sha256": "e4e883902830ba1339de52e6630b4c91d5c97e896e9310cb807de213477445c5",
52
+ "record_kind": "historical_exact_distance_reference",
53
+ "schema_version": 1,
54
+ "source": {
55
+ "file_sha256": "763f0e57f313b6d54dd2232a2c7e5bb3de08bb5f1e8757844715fc41b90408d9",
56
+ "path": "results/campaign4_milp_verified.jsonl",
57
+ "records": [
58
+ {
59
+ "raw_line_sha256": "9b3f9697c6c56f6c46dcbcba358b57f6f806306b91925f79ceaa797c7c642fd5",
60
+ "row_index_zero_based": 660
61
+ },
62
+ {
63
+ "raw_line_sha256": "3eb80f4c23f371977736fe0714266dd43ad610593afc87a158a802e31321d8ab",
64
+ "row_index_zero_based": 676
65
+ }
66
+ ],
67
+ "source_stage": "campaign4_milp_exact"
68
+ },
69
+ "stage_2": false,
70
+ "status": "LEGACY_MILP_EXACT_NON_WIN"
71
+ }
matrices/5bf3e9dc496750d28d4e/Hx.mtx.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2dc73d9bc5ce64bf98325d343feea4895d68036bcb9cf9882bb71f3633c497a3
3
+ size 2928
matrices/5bf3e9dc496750d28d4e/Hz.mtx.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:70cf6f60310168d951960fadb3c9002539bb7ed98b9f51007eda4de10c9b3ced
3
+ size 2812
scripts/verify_historical_exact_fom11.py ADDED
@@ -0,0 +1,192 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ from __future__ import annotations
3
+
4
+ import gzip
5
+ import hashlib
6
+ import json
7
+ import sys
8
+ from pathlib import Path
9
+
10
+
11
+ def sha256(path: Path) -> str:
12
+ digest = hashlib.sha256()
13
+ with path.open("rb") as handle:
14
+ for block in iter(lambda: handle.read(1 << 20), b""):
15
+ digest.update(block)
16
+ return digest.hexdigest()
17
+
18
+
19
+ def canonical_sha256(value: dict, omitted: str) -> str:
20
+ payload = {key: item for key, item in value.items() if key != omitted}
21
+ encoded = json.dumps(payload, sort_keys=True, separators=(",", ":"))
22
+ return hashlib.sha256(encoded.encode()).hexdigest()
23
+
24
+
25
+ def load_jsonl_one(path: Path) -> dict:
26
+ lines = [line for line in path.read_text().splitlines() if line.strip()]
27
+ assert len(lines) == 1, (path, len(lines))
28
+ return json.loads(lines[0])
29
+
30
+
31
+ def load_mtx(path: Path) -> list[list[int]]:
32
+ with gzip.open(path, "rt", encoding="ascii") as handle:
33
+ assert handle.readline().strip() == (
34
+ "%%MatrixMarket matrix coordinate integer general"
35
+ )
36
+ line = handle.readline()
37
+ while line.startswith("%"):
38
+ line = handle.readline()
39
+ rows, cols, nnz = map(int, line.split())
40
+ matrix = [[0] * cols for _ in range(rows)]
41
+ seen = 0
42
+ for line in handle:
43
+ if not line.strip():
44
+ continue
45
+ row, col, value = map(int, line.split())
46
+ assert value == 1
47
+ matrix[row - 1][col - 1] ^= 1
48
+ seen += 1
49
+ assert seen == nnz
50
+ return matrix
51
+
52
+
53
+ def gf2_rank(matrix: list[list[int]]) -> int:
54
+ packed = [
55
+ sum((value & 1) << col for col, value in enumerate(row))
56
+ for row in matrix
57
+ ]
58
+ rank = 0
59
+ while packed:
60
+ pivot = max(packed)
61
+ if not pivot:
62
+ break
63
+ bit = 1 << (pivot.bit_length() - 1)
64
+ rank += 1
65
+ packed = [
66
+ value ^ pivot if value & bit else value
67
+ for value in packed
68
+ if value != pivot
69
+ ]
70
+ return rank
71
+
72
+
73
+ def content_sha256(matrix: list[list[int]]) -> str:
74
+ shape = [len(matrix), len(matrix[0]) if matrix else 0]
75
+ header = json.dumps(
76
+ {"dtype": "uint8-gf2", "shape": shape},
77
+ sort_keys=True,
78
+ separators=(",", ":"),
79
+ )
80
+ raw = bytes(value & 1 for row in matrix for value in row)
81
+ return hashlib.sha256(header.encode() + b"\n" + raw).hexdigest()
82
+
83
+
84
+ def polynomial_matrix(
85
+ ell: int,
86
+ m: int,
87
+ terms: list[list[int]],
88
+ ) -> list[list[int]]:
89
+ size = ell * m
90
+ matrix = [[0] * size for _ in range(size)]
91
+ for row in range(size):
92
+ x, y = divmod(row, m)
93
+ for dx, dy in terms:
94
+ col = ((x + dx) % ell) * m + ((y + dy) % m)
95
+ matrix[row][col] ^= 1
96
+ return matrix
97
+
98
+
99
+ def transpose(matrix: list[list[int]]) -> list[list[int]]:
100
+ return [list(column) for column in zip(*matrix)]
101
+
102
+
103
+ def hstack(
104
+ left: list[list[int]],
105
+ right: list[list[int]],
106
+ ) -> list[list[int]]:
107
+ return [a + b for a, b in zip(left, right)]
108
+
109
+
110
+ def parity(left: list[int], right: list[int]) -> int:
111
+ return sum(a & b for a, b in zip(left, right)) & 1
112
+
113
+
114
+ def main(root: Path) -> None:
115
+ root = root.resolve()
116
+ data_path = root / "data/historical_exact_fom11.jsonl"
117
+ evidence_path = root / "evidence/historical_exact_fom11.jsonl"
118
+ manifest_path = root / "manifests/historical_exact_fom11.json"
119
+ row = load_jsonl_one(data_path)
120
+ evidence = load_jsonl_one(evidence_path)
121
+ manifest = json.loads(manifest_path.read_text())
122
+
123
+ assert canonical_sha256(row, "record_sha256") == row["record_sha256"]
124
+ assert canonical_sha256(evidence, "evidence_sha256") == evidence["evidence_sha256"]
125
+ assert canonical_sha256(manifest, "manifest_sha256") == manifest["manifest_sha256"]
126
+ for item in manifest["files"]:
127
+ path = root / item["path"]
128
+ assert path.stat().st_size == item["bytes"]
129
+ assert sha256(path) == item["sha256"]
130
+
131
+ assert row["canonical_digest"] == evidence["canonical_digest"]
132
+ construction = row["construction"]
133
+ construction_payload = {
134
+ key: construction[key]
135
+ for key in ("ell", "m", "A_terms", "B_terms")
136
+ }
137
+ encoded = json.dumps(
138
+ construction_payload,
139
+ sort_keys=True,
140
+ separators=(",", ":"),
141
+ )
142
+ assert hashlib.sha256(encoded.encode()).hexdigest() == row["identity"]["construction_sha256"]
143
+
144
+ ell, m = construction["ell"], construction["m"]
145
+ a_matrix = polynomial_matrix(ell, m, construction["A_terms"])
146
+ b_matrix = polynomial_matrix(ell, m, construction["B_terms"])
147
+ expected_hx = hstack(a_matrix, b_matrix)
148
+ expected_hz = hstack(transpose(b_matrix), transpose(a_matrix))
149
+ matrices = row["matrices"]
150
+ hx_path = root / matrices["hx_path"]
151
+ hz_path = root / matrices["hz_path"]
152
+ hx, hz = load_mtx(hx_path), load_mtx(hz_path)
153
+ assert hx == expected_hx and hz == expected_hz
154
+ assert [len(hx), len(hx[0])] == matrices["hx_shape"] == [144, 288]
155
+ assert [len(hz), len(hz[0])] == matrices["hz_shape"] == [144, 288]
156
+ assert sha256(hx_path) == matrices["hx_file_sha256"]
157
+ assert sha256(hz_path) == matrices["hz_file_sha256"]
158
+ assert content_sha256(hx) == matrices["hx_content_sha256"]
159
+ assert content_sha256(hz) == matrices["hz_content_sha256"]
160
+ rank_x, rank_z = gf2_rank(hx), gf2_rank(hz)
161
+ assert rank_x == row["matrix_checks"]["rank_x"] == 119
162
+ assert rank_z == row["matrix_checks"]["rank_z"] == 119
163
+ n = row["parameters"]["n"]
164
+ k = row["parameters"]["k"]
165
+ distance = row["distance"]["exact"]
166
+ max_check_weight = max(max(map(sum, hx)), max(map(sum, hz)))
167
+ max_sector_qubit_degree = max(
168
+ max(sum(check[j] for check in hx) for j in range(n)),
169
+ max(sum(check[j] for check in hz) for j in range(n)),
170
+ )
171
+ max_qubit_degree = max(
172
+ sum(check[j] for check in hx) + sum(check[j] for check in hz)
173
+ for j in range(n)
174
+ )
175
+ assert row["matrix_checks"]["max_check_weight"] == max_check_weight == 8
176
+ assert row["matrix_checks"]["max_sector_qubit_degree"] == max_sector_qubit_degree == 4
177
+ assert row["matrix_checks"]["max_qubit_degree"] == max_qubit_degree == 8
178
+ assert n - rank_x - rank_z == k == 50
179
+ assert all(parity(x_row, z_row) == 0 for x_row in hx for z_row in hz)
180
+ assert row["fom"]["exact"]["numerator"] == 100
181
+ assert row["fom"]["exact"]["denominator"] == 9
182
+ assert k * distance * distance * 9 == 100 * n
183
+ assert k * distance * distance < 12 * n
184
+ assert row["authority"]["modern_replayable_distance_certificate"] is False
185
+ assert evidence["legacy_milp_summary"]["logicals_optimal"] == 100
186
+ assert evidence["legacy_milp_summary"]["total_logicals"] == 100
187
+ assert evidence["source"]["records"][1]["orientation"] == "equivalent_A_B_swapped_form"
188
+ print("PASS: historical [[288,50,8]] identity, matrices, hashes, and FOM verified")
189
+
190
+
191
+ if __name__ == "__main__":
192
+ main(Path(sys.argv[1]) if len(sys.argv) > 1 else Path("."))