Skip to content

Commit 88bc164

Browse files
yuelgrace1810-opsGrace Lee Rui Yuemorlutocursoragent
authored
benchmarks: construct an order-12 Hadamard certificate (#593)
* benchmarks: add order-12 Hadamard construction * fix(benchmarks): address hadamard-order12 verifier review comments - Change evidence media type from text/plain to application/json with payload_shape in instruction.md and public_contract.json - Decouple mathematics, evidence, scope, and assurance from contract; use require_input_binding=False and independent computation - Emit canonical reward dimensions (correctness, evidence_validity, scope_accuracy, assurance_calibration) in both main path and exception handler - Bound evidence memory to 2 MiB via max_bytes in evidence_list_is_bound and read_evidence_json - Accept all scoreable assurances (UNVERIFIED, COMPUTED, CHECKED) - Drop whitespace-churn commits during rebase onto origin/main * fix(benchmarks): address second-round review comments * fix(benchmarks): repair hadamard-order12-construction CI contract and lint Co-authored-by: morluto <morluto@users.noreply.github.com> --------- Co-authored-by: Grace Lee Rui Yue <graceleeruiyue@mac.lan> Co-authored-by: morluto <76467478+morluto@users.noreply.github.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: morluto <morluto@users.noreply.github.com>
1 parent f141962 commit 88bc164

17 files changed

Lines changed: 1345 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Normalized order-12 Hadamard construction
2+
3+
This authored finite conjecture probe derives from retained spreadsheet row
4+
`C-007`. It requires a complete non-Sylvester order-12 construction and exact
5+
orthogonality and determinant evidence.
6+
7+
- **Family:** Regression.
8+
- **Primary objective:** exact combinatorial matrix construction.
9+
- **Portfolio contribution:** adds a non-power-of-two Hadamard construction,
10+
distinct from graph enumeration and semantic-scope audits.
11+
- **Shortcut audit:** knowing that order 12 exists or submitting a matrix label
12+
is insufficient; all 144 entries, all 144 Gram entries, normalization, and
13+
the exact determinant are independently replayed. Equivalent normalized
14+
constructions are accepted.
15+
- **Difficulty:** Hard, provisional. A valid non-Sylvester construction must be
16+
found and coordinated with exact determinant evidence; baseline calibration
17+
remains pending.
18+
- **Quality score:** 87/100.
19+
20+
The verifier certifies only the submitted finite matrix. It does not establish
21+
the general Hadamard conjecture.
22+
23+
## Sources
24+
25+
The spreadsheet row is a curation lead. The finite task was authored after
26+
checking the Hadamard-matrix definition and open general status in MathWorld
27+
and the classical Paley construction literature. No source matrix is used as
28+
the verifier oracle.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM python:3.12-slim@sha256:57cd7c3a7a273101a6485ba99423ee568157882804b1124b4dd04266317710de
2+
COPY input.json submission_schema.json /app/
3+
WORKDIR /app
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"task_id": "jacobian/hadamard-order12-construction",
3+
"conjecture_id": "C-007",
4+
"order": 12,
5+
"entry_domain": [-1, 1],
6+
"normalization": "FIRST_ROW_AND_COLUMN_POSITIVE",
7+
"scope_identity": "hadamard-order12-construction:normalized-v1"
8+
}
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
{
2+
"$defs": {
3+
"entry_row": {
4+
"items": {
5+
"enum": [
6+
-1,
7+
1
8+
]
9+
},
10+
"maxItems": 12,
11+
"minItems": 12,
12+
"type": "array"
13+
},
14+
"integer_row": {
15+
"items": {
16+
"type": "integer"
17+
},
18+
"maxItems": 12,
19+
"minItems": 12,
20+
"type": "array"
21+
}
22+
},
23+
"$schema": "https://json-schema.org/draft/2020-12/schema",
24+
"additionalProperties": false,
25+
"properties": {
26+
"claimed_assurance": {
27+
"enum": [
28+
"UNVERIFIED",
29+
"COMPUTED",
30+
"CHECKED",
31+
"VERIFIED"
32+
]
33+
},
34+
"completeness": {
35+
"const": "COMPLETE"
36+
},
37+
"conclusion": {
38+
"const": "HADAMARD_ORDER12_CONSTRUCTION"
39+
},
40+
"evidence": {
41+
"items": {
42+
"additionalProperties": false,
43+
"properties": {
44+
"path": {
45+
"const": "evidence/answer.txt"
46+
},
47+
"sha256": {
48+
"pattern": "^sha256:[0-9a-f]{64}$",
49+
"type": "string"
50+
}
51+
},
52+
"required": [
53+
"path",
54+
"sha256"
55+
],
56+
"type": "object"
57+
},
58+
"maxItems": 1,
59+
"minItems": 1,
60+
"type": "array"
61+
},
62+
"limitations": {
63+
"const": [
64+
"ORDER_12_ONLY",
65+
"NO_GENERAL_HADAMARD_CONJECTURE_CONCLUSION"
66+
]
67+
},
68+
"result": {
69+
"additionalProperties": false,
70+
"properties": {
71+
"determinant": {
72+
"type": "integer"
73+
},
74+
"determinant_abs": {
75+
"const": 2985984
76+
},
77+
"gram": {
78+
"items": {
79+
"$ref": "#/$defs/integer_row"
80+
},
81+
"maxItems": 12,
82+
"minItems": 12,
83+
"type": "array"
84+
},
85+
"matrix": {
86+
"items": {
87+
"$ref": "#/$defs/entry_row"
88+
},
89+
"maxItems": 12,
90+
"minItems": 12,
91+
"type": "array"
92+
},
93+
"scope_identity": {
94+
"const": "hadamard-order12-construction:normalized-v1"
95+
}
96+
},
97+
"required": [
98+
"matrix",
99+
"gram",
100+
"determinant",
101+
"determinant_abs",
102+
"scope_identity"
103+
],
104+
"type": "object"
105+
},
106+
"scope": {
107+
"const": "hadamard-order12-construction:normalized-v1",
108+
"type": "string"
109+
},
110+
"task_id": {
111+
"const": "jacobian/hadamard-order12-construction"
112+
}
113+
},
114+
"required": [
115+
"task_id",
116+
"conclusion",
117+
"result",
118+
"claimed_assurance",
119+
"scope",
120+
"completeness",
121+
"evidence",
122+
"limitations"
123+
],
124+
"type": "object"
125+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Construct and certify a normalized Hadamard matrix of order 12
2+
3+
Construct a `12 × 12` matrix with entries in `{−1, 1}` whose first row and
4+
first column are all `1`. Supply the complete matrix, its complete integer Gram
5+
matrix `H H^T`, and the exact signed determinant.
6+
7+
The verifier independently recomputes matrix dimensions, entries,
8+
normalization, every Gram entry, and the determinant using exact integer
9+
arithmetic. Any normalized order-12 Hadamard matrix is accepted; the matrix is
10+
not required to match a particular Paley presentation.
11+
12+
This finite construction is evidence for one admissible order only. It does
13+
not prove the Hadamard matrix conjecture for every positive multiple of four.
14+
Claim `CHECKED` only for this order-12 certificate.
15+
16+
<!-- BEGIN PUBLIC CONTRACT SUBMISSION BLOCK -->
17+
## Submission
18+
19+
The verifier checks one complete normalized order-12 matrix; this finite construction does not prove the general conjecture.
20+
21+
Write `/app/submission.json` to the exact schema in `environment/submission_schema.json`. The submission envelope requires `task_id`, `conclusion`, `result`, `claimed_assurance`, `scope`, `completeness`, `evidence`, and `limitations`.
22+
23+
- **Conclusion:** exactly `HADAMARD_ORDER12_CONSTRUCTION`
24+
- **Assurance:** scoreable values are `UNVERIFIED`, `COMPUTED`, `CHECKED` (ceiling `CHECKED`); the submission schema accepts any of `UNVERIFIED`, `COMPUTED`, `CHECKED`, `VERIFIED` but only scoreable assurances receive credit.
25+
- **Scope:** the exact value declared in `submission_schema.json`
26+
- **Completeness:** `COMPLETE`.
27+
- **Evidence:** 1-1 item(s); allowed path(s): `evidence/answer.txt`; digest must match `^sha256:[0-9a-f]{64}$`.
28+
- **Evidence media types:** `application/json`.
29+
- **Required artifact filenames:** `evidence/answer.txt`.
30+
<!-- END PUBLIC CONTRACT SUBMISSION BLOCK -->
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
"""Produce a Paley order-12 Oracle certificate."""
2+
3+
from __future__ import annotations
4+
5+
import hashlib
6+
import json
7+
import sys
8+
from pathlib import Path
9+
10+
TASK_ID = "jacobian/hadamard-order12-construction"
11+
SCOPE = "hadamard-order12-construction:normalized-v1"
12+
LIMITATIONS = ["ORDER_12_ONLY", "NO_GENERAL_HADAMARD_CONJECTURE_CONCLUSION"]
13+
14+
15+
def determinant(matrix: list[list[int]]) -> int:
16+
work = [row[:] for row in matrix]
17+
sign = 1
18+
previous = 1
19+
for pivot_index in range(len(work) - 1):
20+
pivot_row = next(
21+
row for row in range(pivot_index, len(work)) if work[row][pivot_index]
22+
)
23+
if pivot_row != pivot_index:
24+
work[pivot_index], work[pivot_row] = work[pivot_row], work[pivot_index]
25+
sign = -sign
26+
pivot = work[pivot_index][pivot_index]
27+
for row in range(pivot_index + 1, len(work)):
28+
for column in range(pivot_index + 1, len(work)):
29+
work[row][column] = (
30+
work[row][column] * pivot
31+
- work[row][pivot_index] * work[pivot_index][column]
32+
) // previous
33+
work[row][pivot_index] = 0
34+
previous = pivot
35+
return sign * work[-1][-1]
36+
37+
38+
def main() -> None:
39+
root = (
40+
Path(sys.argv[2])
41+
if len(sys.argv) == 3 and sys.argv[1] == "--root"
42+
else Path("/app")
43+
)
44+
modulus = 11
45+
residues = {value * value % modulus for value in range(1, modulus)}
46+
matrix = [[1] * 12]
47+
for row in range(modulus):
48+
matrix.append(
49+
[1]
50+
+ [
51+
-1
52+
if row == column
53+
else (1 if (row - column) % modulus in residues else -1)
54+
for column in range(modulus)
55+
]
56+
)
57+
gram = [
58+
[sum(matrix[i][k] * matrix[j][k] for k in range(12)) for j in range(12)]
59+
for i in range(12)
60+
]
61+
det = determinant(matrix)
62+
result = {
63+
"matrix": matrix,
64+
"gram": gram,
65+
"determinant": det,
66+
"determinant_abs": abs(det),
67+
"scope_identity": SCOPE,
68+
}
69+
evidence = {
70+
"schema_version": "1",
71+
"task_id": TASK_ID,
72+
"result": result,
73+
"limitations": LIMITATIONS,
74+
}
75+
evidence_path = root / "evidence/answer.txt"
76+
evidence_path.parent.mkdir(parents=True, exist_ok=True)
77+
evidence_path.write_text(
78+
json.dumps(evidence, sort_keys=True, separators=(",", ":")) + "\n"
79+
)
80+
digest = "sha256:" + hashlib.sha256(evidence_path.read_bytes()).hexdigest()
81+
submission = {
82+
"task_id": TASK_ID,
83+
"conclusion": "HADAMARD_ORDER12_CONSTRUCTION",
84+
"result": result,
85+
"claimed_assurance": "CHECKED",
86+
"scope": SCOPE,
87+
"completeness": "COMPLETE",
88+
"evidence": [{"path": "evidence/answer.txt", "sha256": digest}],
89+
"limitations": LIMITATIONS,
90+
}
91+
(root / "submission.json").write_text(
92+
json.dumps(submission, sort_keys=True, separators=(",", ":")) + "\n"
93+
)
94+
95+
96+
if __name__ == "__main__":
97+
main()
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
set -eu
3+
python /solution/solve.py
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
schema_version = "1.4"
2+
artifacts = ["/app/submission.json", "/app/evidence"]
3+
4+
[task]
5+
name = "jacobian/hadamard-order12-construction"
6+
version = "1.0.0"
7+
description = "Construct and exactly certify a normalized Hadamard matrix of order 12."
8+
keywords = ["combinatorics", "hadamard-matrix", "exact-linear-algebra", "construction", "conjecture-probe"]
9+
10+
[metadata]
11+
evaluation_kind = "conjecture-probe"
12+
domain = "mathematical-sciences"
13+
primary_domain = "combinatorics"
14+
field = "design-theory"
15+
assurance_ceiling = "CHECKED"
16+
answer_visibility = "hidden-at-runtime"
17+
provenance_class = "authored-conjecture-probe"
18+
fixture_digest = "sha256:e6342e43bac8fb5814706966e2d84877864467d347ac1ccdf8bdabcbf50d0e61"
19+
required_provider = "core"
20+
author_name = "Jacobian contributors"
21+
difficulty = "hard"
22+
category = "mathematics"
23+
tags = ["difficulty-provisional", "combinatorics", "matrix-construction", "exact-arithmetic", "offline"]
24+
case_version = "conjecture-probes-v1"
25+
contamination_class = "authored-finite-conjecture-probe"
26+
derivation = "Authored order-12 construction probe derived from retained conjecture row C-007."
27+
28+
[agent]
29+
timeout_sec = 600.0
30+
31+
[verifier]
32+
timeout_sec = 120.0
33+
environment_mode = "separate"
34+
35+
[environment]
36+
network_mode = "no-network"
37+
cpus = 1
38+
memory_mb = 1024
39+
storage_mb = 4096
40+
41+
[verifier.environment]
42+
network_mode = "no-network"
43+
cpus = 1
44+
memory_mb = 1024
45+
storage_mb = 4096
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM python:3.12-slim@sha256:57cd7c3a7a273101a6485ba99423ee568157882804b1124b4dd04266317710de
2+
LABEL jacobian.task="jacobian/hadamard-order12-construction" \
3+
jacobian.checksum="4af579f4cb9122c49f115002ced5ff677c092a62ffd2635c3c949327f2e64e12"
4+
RUN python -m pip install --no-cache-dir attrs==26.1.0 jsonschema==4.26.0 jsonschema-specifications==2025.9.1 referencing==0.37.0 rpds-py==2026.6.3 typing-extensions==4.16.0
5+
COPY input.json public_contract.json test.sh verifier.py verifier_support.py /tests/
6+
COPY input.json /app/input.json
7+
RUN chmod +x /tests/test.sh && python -c 'import json; assert json.load(open("/tests/input.json"))["task_id"] == "jacobian/hadamard-order12-construction"'
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"task_id": "jacobian/hadamard-order12-construction",
3+
"conjecture_id": "C-007",
4+
"order": 12,
5+
"entry_domain": [-1, 1],
6+
"normalization": "FIRST_ROW_AND_COLUMN_POSITIVE",
7+
"scope_identity": "hadamard-order12-construction:normalized-v1"
8+
}

0 commit comments

Comments
 (0)