Skip to content

Commit 3b66a4d

Browse files
author
Grace Lee Rui Yue
committed
benchmarks: add Happy Ending convex-position audit
1 parent 7f5a035 commit 3b66a4d

16 files changed

Lines changed: 1365 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Happy Ending finite convex-position audit
2+
3+
This authored conjecture probe derives from retained spreadsheet row `C-017`.
4+
It freezes thirteen general-position integer points and requires exhaustive
5+
convex-subset enumeration plus a maximum witness.
6+
7+
- **Family:** Regression.
8+
- **Primary objective:** exact finite geometric optimization.
9+
- **Portfolio contribution:** adds orientation-based convex-position counting,
10+
distinct from matrix construction, cuboid scope classification, and graph
11+
domination.
12+
- **Shortcut audit:** a maximum size or one polygon is insufficient; counts for
13+
every subset size must match an independent enumeration of all 8,178
14+
nontrivial subsets. Alternative maximum witnesses and cyclic orders pass.
15+
- **Difficulty:** Hard, provisional. It requires robust exact orientation,
16+
hull, exhaustive counting, and witness coordination; calibration is pending.
17+
- **Quality score:** 88/100.
18+
19+
The verifier establishes only the frozen finite result and never the general
20+
Happy Ending formula.
21+
22+
## Sources
23+
24+
The spreadsheet row is a curation lead. The statement and current status were
25+
checked against MathWorld's *Happy Ending Problem* and the original
26+
Erdős–Szekeres literature. The point fixture is authored and absent from those
27+
sources.
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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"task_id": "jacobian/happy-ending-convex-position",
3+
"conjecture_id": "C-017",
4+
"scope_identity": "happy-ending-convex-position:points-v1",
5+
"points": [
6+
{"id": "P00", "x": -35, "y": 12},
7+
{"id": "P01", "x": 24, "y": 18},
8+
{"id": "P02", "x": -19, "y": -33},
9+
{"id": "P03", "x": -17, "y": -3},
10+
{"id": "P04", "x": 26, "y": 6},
11+
{"id": "P05", "x": -4, "y": -14},
12+
{"id": "P06", "x": -21, "y": 30},
13+
{"id": "P07", "x": 23, "y": -40},
14+
{"id": "P08", "x": 38, "y": 18},
15+
{"id": "P09", "x": 7, "y": 10},
16+
{"id": "P10", "x": 5, "y": 12},
17+
{"id": "P11", "x": 39, "y": 5},
18+
{"id": "P12", "x": 30, "y": -12}
19+
]
20+
}
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
{
2+
"$defs": {
3+
"count_row": {
4+
"additionalProperties": false,
5+
"properties": {
6+
"count": {
7+
"minimum": 0,
8+
"type": "integer"
9+
},
10+
"size": {
11+
"maximum": 13,
12+
"minimum": 3,
13+
"type": "integer"
14+
}
15+
},
16+
"required": [
17+
"size",
18+
"count"
19+
],
20+
"type": "object"
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": "HAPPY_ENDING_FINITE_CONVEX_POSITION"
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+
"THIRTEEN_FROZEN_POINTS",
65+
"NO_GENERAL_ERDOS_SZEKERES_CONCLUSION"
66+
]
67+
},
68+
"result": {
69+
"additionalProperties": false,
70+
"properties": {
71+
"convex_subset_counts": {
72+
"items": {
73+
"$ref": "#/$defs/count_row"
74+
},
75+
"maxItems": 11,
76+
"minItems": 11,
77+
"type": "array"
78+
},
79+
"general_position": {
80+
"const": true
81+
},
82+
"maximum_convex_size": {
83+
"maximum": 13,
84+
"minimum": 3,
85+
"type": "integer"
86+
},
87+
"maximum_witness_cyclic": {
88+
"items": {
89+
"pattern": "^P(?:0[0-9]|1[0-2])$",
90+
"type": "string"
91+
},
92+
"minItems": 3,
93+
"type": "array",
94+
"uniqueItems": true
95+
},
96+
"scope_identity": {
97+
"const": "happy-ending-convex-position:points-v1"
98+
}
99+
},
100+
"required": [
101+
"general_position",
102+
"convex_subset_counts",
103+
"maximum_convex_size",
104+
"maximum_witness_cyclic",
105+
"scope_identity"
106+
],
107+
"type": "object"
108+
},
109+
"scope": {
110+
"const": "happy-ending-convex-position:points-v1",
111+
"type": "string"
112+
},
113+
"task_id": {
114+
"const": "jacobian/happy-ending-convex-position"
115+
}
116+
},
117+
"required": [
118+
"task_id",
119+
"conclusion",
120+
"result",
121+
"claimed_assurance",
122+
"scope",
123+
"completeness",
124+
"evidence",
125+
"limitations"
126+
],
127+
"type": "object"
128+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Exhaustively audit convex-position subsets of a frozen point set
2+
3+
The thirteen labelled integer points in `/app/input.json` are claimed to be in
4+
general position. Verify that claim, count exactly how many subsets of each
5+
size `3` through `13` are in convex position, determine the maximum such size,
6+
and provide one maximum-size witness as point IDs in cyclic hull order.
7+
8+
A subset is in convex position when every selected point is a vertex of its
9+
convex hull. The verifier independently checks every orientation determinant,
10+
enumerates every subset, reconstructs the exact convex hulls, and validates the
11+
witness. The order of the count rows is irrelevant, and any valid cyclic order
12+
of any maximum witness is accepted.
13+
14+
This is a finite exact-geometry probe motivated by the Happy Ending
15+
conjecture. It does not determine the general Erdős–Szekeres number. Claim
16+
`CHECKED` only for the frozen thirteen-point scope.
17+
18+
<!-- BEGIN PUBLIC CONTRACT SUBMISSION BLOCK -->
19+
## Submission
20+
21+
The verifier exhaustively checks the frozen point set; the finite optimum does not establish the general Happy Ending formula.
22+
23+
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`.
24+
25+
- **Conclusion:** exactly `HAPPY_ENDING_FINITE_CONVEX_POSITION`
26+
- **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.
27+
- **Scope:** the exact value declared in `submission_schema.json`
28+
- **Completeness:** `COMPLETE`.
29+
- **Evidence:** 1-1 item(s); allowed path(s): `evidence/answer.txt`; digest must match `^sha256:[0-9a-f]{64}$`.
30+
- **Evidence media types:** `text/plain`.
31+
- **Required artifact filenames:** `evidence/answer.txt`.
32+
<!-- END PUBLIC CONTRACT SUBMISSION BLOCK -->
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
"""Produce the exhaustive finite convex-position Oracle certificate."""
2+
3+
from __future__ import annotations
4+
5+
import hashlib
6+
import itertools
7+
import json
8+
import sys
9+
from pathlib import Path
10+
11+
TASK_ID = "jacobian/happy-ending-convex-position"
12+
SCOPE = "happy-ending-convex-position:points-v1"
13+
LIMITATIONS = ["THIRTEEN_FROZEN_POINTS", "NO_GENERAL_ERDOS_SZEKERES_CONCLUSION"]
14+
15+
16+
def cross(a: tuple[int, int], b: tuple[int, int], c: tuple[int, int]) -> int:
17+
return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0])
18+
19+
20+
def hull(points: list[tuple[int, int]]) -> list[tuple[int, int]]:
21+
ordered = sorted(points)
22+
lower: list[tuple[int, int]] = []
23+
for point in ordered:
24+
while len(lower) >= 2 and cross(lower[-2], lower[-1], point) <= 0:
25+
lower.pop()
26+
lower.append(point)
27+
upper: list[tuple[int, int]] = []
28+
for point in reversed(ordered):
29+
while len(upper) >= 2 and cross(upper[-2], upper[-1], point) <= 0:
30+
upper.pop()
31+
upper.append(point)
32+
return lower[:-1] + upper[:-1]
33+
34+
35+
def main() -> None:
36+
root = (
37+
Path(sys.argv[2])
38+
if len(sys.argv) == 3 and sys.argv[1] == "--root"
39+
else Path("/app")
40+
)
41+
frozen = json.loads((root / "input.json").read_text())
42+
records = frozen["points"]
43+
points = [(record["x"], record["y"]) for record in records]
44+
ids = [record["id"] for record in records]
45+
counts = []
46+
maximum = 2
47+
witness: list[str] = []
48+
for size in range(3, 14):
49+
count = 0
50+
for subset in itertools.combinations(range(13), size):
51+
selected = [points[index] for index in subset]
52+
polygon = hull(selected)
53+
if len(polygon) == size:
54+
count += 1
55+
if size > maximum:
56+
maximum = size
57+
witness = [ids[points.index(point)] for point in polygon]
58+
counts.append({"size": size, "count": count})
59+
result = {
60+
"general_position": True,
61+
"convex_subset_counts": counts,
62+
"maximum_convex_size": maximum,
63+
"maximum_witness_cyclic": witness,
64+
"scope_identity": SCOPE,
65+
}
66+
evidence = {
67+
"schema_version": "1",
68+
"task_id": TASK_ID,
69+
"result": result,
70+
"limitations": LIMITATIONS,
71+
}
72+
evidence_path = root / "evidence/answer.txt"
73+
evidence_path.parent.mkdir(parents=True, exist_ok=True)
74+
evidence_path.write_text(
75+
json.dumps(evidence, sort_keys=True, separators=(",", ":")) + "\n"
76+
)
77+
digest = "sha256:" + hashlib.sha256(evidence_path.read_bytes()).hexdigest()
78+
submission = {
79+
"task_id": TASK_ID,
80+
"conclusion": "HAPPY_ENDING_FINITE_CONVEX_POSITION",
81+
"result": result,
82+
"claimed_assurance": "CHECKED",
83+
"scope": SCOPE,
84+
"completeness": "COMPLETE",
85+
"evidence": [{"path": "evidence/answer.txt", "sha256": digest}],
86+
"limitations": LIMITATIONS,
87+
}
88+
(root / "submission.json").write_text(
89+
json.dumps(submission, sort_keys=True, separators=(",", ":")) + "\n"
90+
)
91+
92+
93+
if __name__ == "__main__":
94+
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/happy-ending-convex-position"
6+
version = "1.0.0"
7+
description = "Count every convex-position subset of thirteen frozen integer points and certify a maximum witness."
8+
keywords = ["discrete-geometry", "erdos-szekeres", "convex-position", "orientation", "conjecture-probe"]
9+
10+
[metadata]
11+
evaluation_kind = "conjecture-probe"
12+
domain = "mathematical-sciences"
13+
primary_domain = "geometry-topology"
14+
field = "discrete-geometry"
15+
assurance_ceiling = "CHECKED"
16+
answer_visibility = "hidden-at-runtime"
17+
provenance_class = "authored-conjecture-probe"
18+
fixture_digest = "sha256:fa189aa5de5703c6eae54197b5f907eeaf3ebdba8326c3c71cbdd56e465a5b1e"
19+
required_provider = "core"
20+
author_name = "Jacobian contributors"
21+
difficulty = "hard"
22+
category = "mathematics"
23+
tags = ["difficulty-provisional", "discrete-geometry", "exact-orientation", "exhaustive", "offline"]
24+
case_version = "conjecture-probes-v1"
25+
contamination_class = "authored-finite-conjecture-probe"
26+
derivation = "Authored finite convex-position probe derived from retained conjecture row C-017."
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/happy-ending-convex-position" \
3+
jacobian.checksum="8e47ea2a372a6bfe52a4458878d590275d9a9970d24b0543bb601142058b325d"
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/happy-ending-convex-position"'
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"task_id": "jacobian/happy-ending-convex-position",
3+
"conjecture_id": "C-017",
4+
"scope_identity": "happy-ending-convex-position:points-v1",
5+
"points": [
6+
{"id": "P00", "x": -35, "y": 12},
7+
{"id": "P01", "x": 24, "y": 18},
8+
{"id": "P02", "x": -19, "y": -33},
9+
{"id": "P03", "x": -17, "y": -3},
10+
{"id": "P04", "x": 26, "y": 6},
11+
{"id": "P05", "x": -4, "y": -14},
12+
{"id": "P06", "x": -21, "y": 30},
13+
{"id": "P07", "x": 23, "y": -40},
14+
{"id": "P08", "x": 38, "y": 18},
15+
{"id": "P09", "x": 7, "y": 10},
16+
{"id": "P10", "x": 5, "y": 12},
17+
{"id": "P11", "x": 39, "y": 5},
18+
{"id": "P12", "x": 30, "y": -12}
19+
]
20+
}

0 commit comments

Comments
 (0)