Skip to content

Commit 1a6537f

Browse files
author
Grace Lee Rui Yue
committed
benchmarks: simplify Zarankiewicz verifier flow
1 parent a73d2a6 commit 1a6537f

2 files changed

Lines changed: 27 additions & 7 deletions

File tree

  • benchmarks/datasets/conjecture-probes-v1/zarankiewicz-projective-plane-certificate/tests

benchmarks/datasets/conjecture-probes-v1/zarankiewicz-projective-plane-certificate/tests/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM python:3.12-slim@sha256:57cd7c3a7a273101a6485ba99423ee568157882804b1124b4dd04266317710de
22
LABEL jacobian.task="jacobian/zarankiewicz-projective-plane-certificate" \
3-
jacobian.checksum="f720affbe1b5e4c2d2b91fb06b0948e9619131ef9c2973cc58dfed6a40e854e2"
3+
jacobian.checksum="1dc69575adcc69cf13cd9dfe86a42ee3e1b6bfad7ffa86d64eee7f54134fa4b4"
44
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
55
COPY input.json public_contract.json test.sh verifier.py verifier_support.py /tests/
66
COPY input.json /app/input.json

benchmarks/datasets/conjecture-probes-v1/zarankiewicz-projective-plane-certificate/tests/verifier.py

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ def _pair_rows(value: Any, neighbors: list[set[int]]) -> bool:
9393
return seen == set(itertools.combinations(range(13), 2))
9494

9595

96-
def mathematics(result: Any) -> bool:
96+
def _result_components(result: Any):
9797
if not isinstance(result, dict):
98-
return False
98+
return None
9999
required = {
100100
"points",
101101
"lines",
@@ -109,29 +109,49 @@ def mathematics(result: Any) -> bool:
109109
"excluded_edge_count",
110110
}
111111
if set(result) != required:
112-
return False
112+
return None
113113
points = _triples(result["points"])
114114
lines = _triples(result["lines"])
115115
edges = _edges(result["edges"])
116116
if points is None or lines is None or edges is None:
117-
return False
117+
return None
118+
return points, lines, edges
119+
120+
121+
def _incidence_neighbors(
122+
points: list[tuple[int, int, int]],
123+
lines: list[tuple[int, int, int]],
124+
edges: set[tuple[int, int]],
125+
):
118126
classes = _all_projective_classes()
119127
if set(points) != classes or set(lines) != classes:
120-
return False
128+
return None
121129
expected = {
122130
(i, j)
123131
for i, p in enumerate(points)
124132
for j, line in enumerate(lines)
125133
if sum(a * b for a, b in zip(p, line, strict=True)) % 3 == 0
126134
}
127135
if edges != expected:
128-
return False
136+
return None
129137
left = [{j for i2, j in edges if i2 == i} for i in range(13)]
130138
right = [{i for i, j2 in edges if j2 == j} for j in range(13)]
131139
left_degrees = [len(x) for x in left]
132140
right_degrees = [len(x) for x in right]
133141
if left_degrees != [4] * 13 or right_degrees != [4] * 13:
142+
return None
143+
return left, right, left_degrees, right_degrees
144+
145+
146+
def mathematics(result: Any) -> bool:
147+
components = _result_components(result)
148+
if components is None:
149+
return False
150+
points, lines, edges = components
151+
incidence = _incidence_neighbors(points, lines, edges)
152+
if incidence is None:
134153
return False
154+
left, right, left_degrees, right_degrees = incidence
135155
if (
136156
result["left_degrees"] != left_degrees
137157
or result["right_degrees"] != right_degrees

0 commit comments

Comments
 (0)