diff --git a/README.md b/README.md index b9337c296e5a70d9a1970abfd3735ab1db6d13d6..028cba976b7ac1295970f9db5680d95bf9b5222d 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,8 @@ pretty_name: "openai/math as Harbor environments" We ported the math problems from OpenAI's [openai/math](https://github.com/openai/math) release (commit `adc7f12`) into [Harbor](https://github.com/harbor-framework/harbor) environments. The release formalizes **405** of its results as Lean statements. This dataset contains -**355 environments**, the ones whose official proof we verified end to end in the environment, -covering 209 result families across 17 fields. The other 50 are listed +**369 environments**, the ones whose official proof we verified end to end in the environment, +covering 214 result families across 17 fields. The other 36 are listed under [Validation](#validation) with the reason each could not be validated. ## How a task works @@ -107,66 +107,51 @@ official proof was accepted are included. | Oracle result | Tasks | Meaning | |---|---|---| -| accepted | 355 | OpenAI's proof is accepted: the environment is verified end to end | -| missing-package | 16 | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | +| accepted | 369 | OpenAI's proof is accepted: the environment is verified end to end | +| missing-package | 21 | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | | definition-mismatch | 2 | OpenAI's proof writes a definition with the same text but it compiles differently, so the exact-match check fails | -| memory | 5 | OpenAI's proof needs more than the sandbox's 8 GB of memory to build | -| disk | 4 | OpenAI's proof is too large for the sandbox's 10 GB disk | -| not completed | 22 | grading did not complete in our run | +| memory | 10 | OpenAI's proof needs more than the sandbox's 8 GB of memory to build | +| not completed | 2 | grading did not complete in our run | -Grading an accepted proof took 16 minutes at the median. Each task's result is in its `task.toml` (`oracle_result`) and in `manifest.parquet`. +Grading an accepted proof took 8 minutes at the median. Each task's result is in its `task.toml` (`oracle_result`) and in `manifest.parquet`. -
50 statements not included (click to expand) +
36 statements not included (click to expand) | Statement | Why it could not be validated | |---|---| | `arnold-counterexample` | OpenAI's proof needs more than the sandbox's 8 GB of memory to build | -| `atomic-gaussian` | grading did not complete in our run | | `catalan` | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | | `coarse-assembly` | OpenAI's proof needs more than the sandbox's 8 GB of memory to build | -| `continuum-coulomb-hardness` | OpenAI's proof is too large for the sandbox's 10 GB disk | -| `cycle-clique-ramsey` | grading did not complete in our run | +| `continuum-coulomb-hardness` | OpenAI's proof needs more than the sandbox's 8 GB of memory to build | +| `cycle-clique-ramsey` | OpenAI's proof needs more than the sandbox's 8 GB of memory to build | | `defocusing-nls` | left out by design: OAI.DefocusingNLS.sobolevProduct: open definition the theorem statements depend on | | `dirichlet-seven-eighths` | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | | `duke-prime-degree` | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | | `einstein-four` | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | -| `erdos-reciprocal` | OpenAI's proof is too large for the sandbox's 10 GB disk | +| `erdos-reciprocal` | grading did not complete in our run | | `hecke-seven-eighths` | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | -| `invariant-ising` | grading did not complete in our run | | `jacobsthal` | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | | `jacobsthal-improved` | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | | `joint-dickman` | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | -| `koebe-circle-domains` | OpenAI's proof is too large for the sandbox's 10 GB disk | +| `koebe-circle-domains` | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | | `matrix-multiplication` | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | | `mub-six` | grading did not complete in our run | | `nuclear-ultrapower` | OpenAI's proof needs more than the sandbox's 8 GB of memory to build | | `occupied-overlap` | OpenAI's proof writes a definition with the same text but it compiles differently, so the exact-match check fails | | `ordinary-two-point-correlations` | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | -| `ostmann-complete` | grading did not complete in our run | +| `ostmann-complete` | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | | `ostmann-primes` | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | -| `patterson-first-moment` | OpenAI's proof is too large for the sandbox's 10 GB disk | -| `planar-packing` | grading did not complete in our run | -| `polycyclic-recognition` | grading did not complete in our run | +| `patterson-first-moment` | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | +| `planar-packing` | OpenAI's proof needs more than the sandbox's 8 GB of memory to build | +| `polycyclic-recognition` | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | | `quasi-riemann-hypothesis` | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | -| `ramsey-five` | grading did not complete in our run | | `riesz-quantitative` | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | -| `sat-computability` | grading did not complete in our run | -| `sharp-log-ramsey` | grading did not complete in our run | | `siegel-zeros` | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | -| `simple-amenable` | grading did not complete in our run | -| `simple-overgroups` | grading did not complete in our run | -| `sk-barriers` | grading did not complete in our run | -| `sk-high-temperature` | grading did not complete in our run | -| `sk-ratio` | grading did not complete in our run | -| `smooth-yau` | grading did not complete in our run | | `snaky-certificate` | OpenAI's proof needs more than the sandbox's 8 GB of memory to build | -| `snaky-conditional` | grading did not complete in our run | -| `snaky-twenty-one` | grading did not complete in our run | +| `snaky-twenty-one` | OpenAI's proof needs more than the sandbox's 8 GB of memory to build | | `spin-angle` | OpenAI's proof writes a definition with the same text but it compiles differently, so the exact-match check fails | -| `standard-map-components` | grading did not complete in our run | -| `strong-kadison-kastler` | grading did not complete in our run | -| `surface-immersion` | grading did not complete in our run | -| `taming-compatibility` | grading did not complete in our run | +| `surface-immersion` | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | +| `taming-compatibility` | OpenAI's proof needs more than the sandbox's 8 GB of memory to build | | `totient-asymptotic` | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | | `totient-companion-zero` | OpenAI's proof uses a Lean library beyond Mathlib that the sandbox does not include | | `universal-tensor-squares` | OpenAI's proof needs more than the sandbox's 8 GB of memory to build | @@ -175,7 +160,7 @@ Grading an accepted proof took 16 minutes at the median. Each task's result is i The verifier was also tested against submissions that try to cheat (`sorry` in several disguises, fake axioms, `native_decide`, weakened statements, redefined definitions, planted reward files, code -that runs during grading). All scored 0. A no-op agent scores 0. +that runs during grading, a build that fills the verifier's disk). All scored 0. A no-op agent scores 0. ## Notes diff --git a/generator/README.md b/generator/README.md index 0f74bcd51fff2ec2f70390a4688caf3bd816f6ff..87bd6bdf6bd51a7731fa47b128e9c2eead94b21b 100644 --- a/generator/README.md +++ b/generator/README.md @@ -50,7 +50,7 @@ per challenge, all from the data: |---|---|---| | Definition holes | 9 configs | Comparator checks only the name and type of a `definition_names` entry, never its body, so a solution could redefine `ProperColoring := False` and prove the theorem trivially. A hole whose body is written out is removed from the config, so it must match exactly (8 configs). A hole whose body is `sorry` stays open only if its name appears nowhere else in the file (`ElementaryPositivity`, whose type is the claim). `DefocusingNLS` has a `sorry` inside a definition the theorems use and is excluded. | | Reference proofs needing other Lean libraries | 23 | PrimeNumberTheoremAnd, StrongPNT, RellichKondrachov and others. Every statement imports only Mathlib, so agents are unaffected; only those official proofs cannot be built in this image. | -| Grading time | all | 1 h plus 15 min per MB of the reference proof, at most 6 h. | +| Grading time | all | 3 h plus 15 min per MB of the reference proof, at most 6 h. | The 137 result families without Lean statements have no machine-checkable target and are not part of the dataset. @@ -67,7 +67,8 @@ agent sandbox (snapshot) verifier sandbox (same snapshot, fre collect hook: pack_submission.py 3. iptables: grader uid gets no sockets -> /logs/artifacts/submission.tar ----------> 4. Comparator as `grader`: landrun builds, statement (one plain file crosses) + axiom check, kernel replay - 5. kill grader processes, root writes reward.txt + 5. kill grader processes, delete the build, + root writes reward.txt ``` Harbor's `[verifier] environment_mode = "separate"` (0.24+) provides the second sandbox. Both @@ -88,6 +89,7 @@ after 10 minutes, which is less than the image build takes, hence `snapshot.py`. | Re-export the trusted Challenge module | its theorems are `sorry` | `import-challenge` | | Plant `reward.txt` or a fake `comparator` in the agent sandbox | grading runs in a separate fresh sandbox | `agent-side-reward` | | Lean code run while the verifier builds the proof (`run_cmd`, `#eval`, macros) writes `reward.txt`, runs a shell or opens a connection | landrun (read-only file system except `.lake`, execution limited to Lean and git, TCP denied), unprivileged `grader` user, iptables owner rule; root writes the reward only after killing every grader process | `compile-time-reward` | +| Exhaust the verifier's disk or memory so grading cannot finish | Lake by-products are emptied as the build runs; the build is deleted before the verdict is written, so a full disk still yields reward 0; memory and time are bounded (8 GB, `grade_timeout_sec`) and a killed build scores 0 | `fill-disk` | | Symlinks, path traversal, device files, hard links, huge archives | the collect hook packs only regular files; `grade.py` accepts only regular `Submission.lean` and `Submission/**.lean` whose path components are Lean identifiers | `symlink`, `tests/test_grade_unpack.py` | | Read OpenAI's proof | not in the image; the agent phase has no network | network probe (below) | | A background process in the agent sandbox interfering with grading | Harbor stops the agent sandbox before the verifier starts and empties the verifier's log directory first; on Daytona the two sandboxes share no files | by construction | @@ -117,7 +119,7 @@ All through `harbor run` on Daytona with the separate verifier; none involves a | Oracle over every task (official proofs) | 1 where the proof fits the image | see the dataset card and each task's `oracle_result` | | All 405 statements built in one sandbox (`lake build`, 3 threads) | compile | 405 of 405; median 5 s, 90th percentile 7 s, slowest 220 s | | No-op agent | 0 | 0, "no submission" | -| 11 adversarial submissions (`attacks.py`) | 0 | 0 on all eleven, each rejected for the intended reason; the build-time probe printed `write denied`, and neither a shell nor git's HTTP helper could be executed | +| 12 adversarial submissions (`attacks.py`) | 0 | 0 on all twelve, each rejected for the intended reason (`fill-disk` on Oct 9 with the final grader: "ran out of disk space" after 85 s); the build-time probe printed `write denied`, and neither a shell nor git's HTTP helper could be executed | | Agent-phase view (oracle agent printing its environment) | no network | DNS fails, HTTPS to github.com times out, a direct-IP connection is refused; `LEAN_NUM_THREADS=3` is set; `/tests` is absent | | Oracle with `--allow-agent-host github.com` | 1 | 1 (positive control for the network check) | | landrun and iptables in a Daytona sandbox | both enforce | as described above | @@ -144,9 +146,13 @@ details matter: ## Limits - **Daytona's per-sandbox caps: 4 CPUs, 8 GB memory, 10 GB disk.** The 10 GB is working space on - top of the image. Compiled output of a large proof can exceed it: reference proofs up to about - 1.8 MB of Lean source grade fine, while 3.5 MB and 4.8 MB ones ran out of disk. The oracle results - record which tasks are affected. Higher per-sandbox limits remove the constraint. + top of the image. Lake compiles every module to C as well as to `.olean`; grading never reads the + C, but for the largest proofs it reached 9.4 GB and filled the disk. `grade.py` therefore empties + the generated `.c` files every 15 seconds while the build runs (as the `grader` user; Lake keeps + the recorded hash and does not rebuild), and deletes the build before writing its verdict, so a + build that still fills the disk scores 0 instead of leaving Harbor waiting for a verifier that + can no longer report. Some proofs still need more than 8 GB of memory or 6 hours; the oracle + results record which. Higher per-sandbox limits remove the constraint. - **The agent sandbox contains Comparator,** since agent and verifier share one image. Nothing in it is secret: the statement and the rules are public, and `lake build` plus `#print axioms` already tell an agent whether a proof is complete. diff --git a/generator/openai_math_harbor/adapter.py b/generator/openai_math_harbor/adapter.py index b3c01d78527fa8c13bd2d6243486f24c33193a5d..368805d56b5a2fe856969ca3cc85e1841b47d98e 100644 --- a/generator/openai_math_harbor/adapter.py +++ b/generator/openai_math_harbor/adapter.py @@ -221,13 +221,15 @@ def validation_block(written: list[dict]) -> str: if not results: return "The oracle has not been run on this build of the dataset." counts: dict[str, list[str]] = {} + # No verdict: not run yet, or the run was interrupted (`error: ...`) rather than graded. + pending = [w["task"] for w in written if w.get("oracle_result") not in ORACLE_MEANING] for w in results: - counts.setdefault(w["oracle_result"], []).append(w["task"]) - order = [k for k in ORACLE_MEANING if k in counts] + sorted(k for k in counts if k not in ORACLE_MEANING) + if w["oracle_result"] in ORACLE_MEANING: + counts.setdefault(w["oracle_result"], []).append(w["task"]) + order = [k for k in ORACLE_MEANING if k in counts] rows = ["| Oracle result | Tasks | Meaning |", "|---|---|---|"] for key in order: - rows.append(f"| {key} | {len(counts[key])} | {ORACLE_MEANING.get(key, 'grading did not complete')} |") - pending = [w["task"] for w in written if not w.get("oracle_result")] + rows.append(f"| {key} | {len(counts[key])} | {ORACLE_MEANING[key]} |") if pending: rows.append(f"| not completed | {len(pending)} | grading did not complete in our run |") lines = ["\n".join(rows), ""] @@ -236,7 +238,7 @@ def validation_block(written: list[dict]) -> str: if secs: lines.append(f"Grading an accepted proof took {secs[len(secs) // 2] // 60} minutes at the median. " "Each task's result is in its `task.toml` (`oracle_result`) and in `manifest.parquet`.") - unexplained = sorted(t for k in counts if k not in ORACLE_MEANING or k in ("rejected", "timeout") for t in counts[k]) + unexplained = sorted(t for k in ("rejected", "timeout") for t in counts.get(k, [])) if unexplained: lines.append("Other: " + ", ".join(f"`{t}`" for t in unexplained) + ".") return "\n".join(lines) @@ -339,7 +341,7 @@ def main() -> None: if args.only_validated and entry["oracle_result"] != "accepted": shutil.rmtree(args.out / "tasks" / entry["task"]) not_validated.append({"task": entry["task"], "challenge": c.name, "family": c.family.number, - "reason": entry["oracle_result"] or "pending"}) + "reason": entry["oracle_result"] if entry["oracle_result"] in ORACLE_MEANING else "not completed"}) continue written.append(entry) (args.out / "manifest.json").write_text(json.dumps({ diff --git a/generator/openai_math_harbor/attacks.py b/generator/openai_math_harbor/attacks.py index 500baaaddffd9508ef186aac9255e814627d6298..ca22553387ea22438156f7f66be8967da9267c63 100644 --- a/generator/openai_math_harbor/attacks.py +++ b/generator/openai_math_harbor/attacks.py @@ -109,6 +109,21 @@ def openaiMathProbeRun (cmd : String) (args : Array String) : IO String := do return _write("/workspace/Submission.lean", lean) +def attack_fill_disk(t: Path) -> str: + # Lean code run at build time writes 12 GB into .lake (the one place landrun lets the build + # write), more than the verifier's 10 GB disk. Grading must still finish with reward 0: a full + # disk once made the verifier unable to report, leaving Harbor waiting until its timeout. + probe = """ +#eval show IO Unit from do + let chunk := "".pushn 'x' (1 <<< 20) + let h ← IO.FS.Handle.mk ".lake/openai-math-fill" .write + for _ in [0:12288] do + h.putStr chunk +""" + lean = _challenge(t).replace("import Mathlib\n", "import Mathlib\n" + probe, 1) + return _write("/workspace/Submission.lean", lean) + + def attack_agent_side_reward(t: Path) -> str: # Plant rewards and fake comparator output in the agent sandbox; the verifier runs elsewhere. return ( @@ -169,6 +184,7 @@ ATTACKS = { "weaken-statement": (attack_weaken_statement, "same theorem name, statement changed to True"), "import-challenge": (attack_import_challenge, "import the trusted Challenge module and re-export it"), "compile-time-reward": (attack_compile_time_reward, "Lean code run at build time plants reward.txt and dials the daemon"), + "fill-disk": (attack_fill_disk, "Lean code run at build time fills the verifier's disk"), "agent-side-reward": (attack_agent_side_reward, "plant reward files and a fake comparator in the agent sandbox"), "symlink": (attack_symlink, "submit symlinks instead of files"), } diff --git a/generator/openai_math_harbor/report.py b/generator/openai_math_harbor/report.py index e797e33062bce6576e9cdf6689054128bca3d1cf..bd047fda468241967bf64a4d20e6d03bfbc5d15e 100644 --- a/generator/openai_math_harbor/report.py +++ b/generator/openai_math_harbor/report.py @@ -17,7 +17,7 @@ from pathlib import Path # Checked in order against grading.json's reason and the Comparator log. CAUSES = [ - ("disk", ("no space left on device",)), + ("disk", ("no space left on device", "ran out of disk space")), # The reference proof states a definition with the same text as the challenge, but compiled in # its own library's context it elaborates to a different term, so exact matching fails. ("definition-mismatch", ("Const does not match between challenge and target",)), diff --git a/generator/openai_math_harbor/templates/dataset_README.md b/generator/openai_math_harbor/templates/dataset_README.md index 02542e313342350fe53b11ff71f0a483383bb64c..79169fcdbf934c878b0194ad7f5f5c8c40bf3640 100644 --- a/generator/openai_math_harbor/templates/dataset_README.md +++ b/generator/openai_math_harbor/templates/dataset_README.md @@ -111,7 +111,7 @@ $not_validated The verifier was also tested against submissions that try to cheat (`sorry` in several disguises, fake axioms, `native_decide`, weakened statements, redefined definitions, planted reward files, code -that runs during grading). All scored 0. A no-op agent scores 0. +that runs during grading, a build that fills the verifier's disk). All scored 0. A no-op agent scores 0. ## Notes diff --git a/generator/openai_math_harbor/templates/tests/grade.py b/generator/openai_math_harbor/templates/tests/grade.py index 9f4ee2489c3ce97bcc183d7695059602472bf911..95f89f56da7f59e7af65dcf71b8ef3792ee87399 100644 --- a/generator/openai_math_harbor/templates/tests/grade.py +++ b/generator/openai_math_harbor/templates/tests/grade.py @@ -35,6 +35,7 @@ import subprocess import sys import tarfile import tempfile +import threading import time from pathlib import Path @@ -46,6 +47,7 @@ RUN_ROOT = Path("/var/lib/oai-grade") GRADER = "grader" SUCCESS_LINE = "Your solution is okay!" GRADE_THREADS = "2" +SCRATCH_SWEEP_SEC = 15 # Lake and Comparator wording when a build process is killed for running out of memory. OOM_MARKERS = ("Lean exited with code 137", "Child exited with 137") @@ -240,6 +242,49 @@ def out_of_memory(out: str) -> bool: return any(m in out for m in OOM_MARKERS) +def out_of_disk(out: str) -> bool: + return "no space left on device" in out.lower() + + +# Run as the grader user by `empty_build_scratch`. argv: the .lake/build/ir directory. +EMPTY_SCRATCH = r""" +import os, sys +for dirpath, _, files in os.walk(sys.argv[1]): + for name in files: + if not name.endswith(".setup.json"): + continue + base = os.path.join(dirpath, name[:-len(".setup.json")]) + try: + # Lake writes X.c.hash once Lean, and leanir if the module needs it, are done with X; + # both read X.setup.json, so it may only be emptied after that. + if os.stat(base + ".c.hash").st_mtime < os.stat(base + ".setup.json").st_mtime: + continue + for path in (base + ".setup.json", base + ".c"): + if os.path.getsize(path): + os.truncate(path, 0) + except OSError: + pass +""" + + +def empty_build_scratch(run: Path, stop: threading.Event) -> None: + """Until ``stop`` is set, empty files Lake leaves in .lake/build/ir that grading never reads. + + For every module Lake writes a `.setup.json` (its imports with the path of every .olean they + pull in, about 5.5 MB with Mathlib) and the module compiled to C. Neither is used once the + module is built, and for proofs of 1,000-2,000 modules they filled the 10 GB disk before the + build finished. Lake keeps the recorded hashes, so emptied files do not trigger a rebuild. + This runs as the grader user, so it can touch nothing the build could not. + """ + ir = str(run / ".lake" / "build" / "ir") + while not stop.wait(SCRATCH_SWEEP_SEC): + try: + subprocess.run(["runuser", "-u", GRADER, "--", sys.executable, "-c", EMPTY_SCRATCH, ir], + capture_output=True, timeout=600) + except subprocess.TimeoutExpired: + pass + + def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> tuple[int | None, str]: env = { "PATH": f"{toolchain_bin()}:/usr/local/bin:/usr/bin:/bin", @@ -254,10 +299,17 @@ def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> "runuser", "-u", GRADER, "--", "env", "-i", *(f"{k}={v}" for k, v in env.items()), "lake", "env", "comparator", "config.json", ] - code, stdout, stderr = run_with_timeout( - cmd, cwd=run, timeout_sec=timeout_sec, - kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), - ) + stop = threading.Event() + sweeper = threading.Thread(target=empty_build_scratch, args=(run, stop), daemon=True) + sweeper.start() + try: + code, stdout, stderr = run_with_timeout( + cmd, cwd=run, timeout_sec=timeout_sec, + kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), + ) + finally: + stop.set() + sweeper.join() return code, stdout + "\n--- stderr ---\n" + stderr @@ -297,6 +349,8 @@ def classify(code: int | None, out: str) -> tuple[int | None, str]: if code is None: return 0, "timed out while building or checking the submission" tail = [l for l in out.splitlines() if l.strip() and "has local changes" not in l][-25:] + if out_of_disk(out): + return 0, "rejected: the build ran out of disk space (10 GB) | " + " | ".join(tail)[-3000:] if out_of_memory(out): return 0, "rejected: the build was killed, most likely out of memory (8 GB) | " + " | ".join(tail)[-3000:] return 0, "rejected: " + " | ".join(tail)[-4000:] @@ -311,6 +365,7 @@ def main() -> int: task = json.loads((TESTS / "task.json").read_text()) details: dict = {"task": task["challenge"], "started_at": time.time()} reward: int | None = None + log = "" try: RUN_ROOT.mkdir(mode=0o711, parents=True, exist_ok=True) deadline = time.time() + int(task["grade_timeout_sec"]) @@ -325,26 +380,33 @@ def main() -> int: # Two Lean processes in parallel can exceed 8 GB on a heavy module. Retry once with one, # in a fresh directory: the first attempt's .lake was written by the submission's own # build and must not be trusted for the challenge. + shutil.rmtree(run, ignore_errors=True) run = fresh_run(task) unpack_submission(run) code, out = run_comparator(run, int(deadline - time.time()), threads="1") log += "\n\n=== retried with one Lean process after running out of memory ===\n\n" + out kill_grader() details["retried_single_thread"] = True - (VERIFIER_DIR / "comparator.log").write_text(log) reward, details["reason"] = classify(code, out) details["comparator_exit"] = code except Rejected as exc: reward, details["reason"] = 0, f"rejected: {exc}" except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + except Exception as exc: + reward, details["reason"] = None, f"grading error: {type(exc).__name__}: {exc}" finally: try: kill_grader() except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + # Free the build before writing anything. A build that filled the disk would otherwise + # make these writes fail, and with no space left the sandbox cannot report that the + # verifier exited, so Harbor waits until its own timeout and records no verdict. + shutil.rmtree(RUN_ROOT, ignore_errors=True) details["reward"] = reward details["finished_at"] = time.time() + (VERIFIER_DIR / "comparator.log").write_text(log) (VERIFIER_DIR / "grading.json").write_text(json.dumps(details, indent=2)) print(json.dumps(details, indent=2)) if reward is not None: diff --git a/generator/tests/test_grade_unpack.py b/generator/tests/test_grade_unpack.py index c8eb8b143a0faba44b28ac1d9c2358f50f36b84a..13b60944a8bc4feef60b640a20be45be553c8035 100644 --- a/generator/tests/test_grade_unpack.py +++ b/generator/tests/test_grade_unpack.py @@ -136,6 +136,33 @@ class UnpackTest(unittest.TestCase): self.assertEqual(reward, 0) self.assertIn("out of memory", reason) + def test_empty_scratch_only_touches_finished_modules(self): + import os, subprocess, sys + ir = self.tmp / "ir" / "Submission"; ir.mkdir(parents=True) + def module(name, hash_age=None): + for ext in (".setup.json", ".c"): + (ir / (name + ext)).write_text("x" * 100) + os.utime(ir / (name + ".setup.json"), (1000, 1000)) + if hash_age is not None: + (ir / (name + ".c.hash")).write_text("1") + os.utime(ir / (name + ".c.hash"), (1000 + hash_age, 1000 + hash_age)) + module("Done", hash_age=5) # Lake finished: hash written after the setup + module("Building") # Lean or leanir may still read the setup + module("Stale", hash_age=-5) # hash older than the setup: a rebuild is in progress + subprocess.run([sys.executable, "-c", grade.EMPTY_SCRATCH, str(self.tmp / "ir")], check=True) + size = lambda n: (ir / n).stat().st_size + self.assertEqual((size("Done.setup.json"), size("Done.c")), (0, 0)) + self.assertEqual((size("Building.setup.json"), size("Building.c")), (100, 100)) + self.assertEqual((size("Stale.setup.json"), size("Stale.c")), (100, 100)) + self.assertEqual(size("Done.c.hash"), 1) + + def test_out_of_disk_detection(self): + out = "Building Submission\nerror: resource exhausted (error code: 28, no space left on device)\n" + reward, reason = grade.classify(1, out) + self.assertEqual(reward, 0) + self.assertIn("out of disk", reason) + self.assertTrue(grade.out_of_disk("OSError: [Errno 28] No space left on device")) + def test_classify(self): ok = "Building Challenge\nBuilding Submission\nYour solution is okay!\n" self.assertEqual(grade.classify(0, ok)[0], 1) diff --git a/manifest.json b/manifest.json index dca74664592ced2aae5607ce92b5d8743acb9844..29a7eb1f26168e49c558c20185f573ff540ceb61 100644 --- a/manifest.json +++ b/manifest.json @@ -18,7 +18,7 @@ "packages": [], "grade_timeout_sec": 10850, "oracle_result": "accepted", - "oracle_grade_seconds": 463 + "oracle_grade_seconds": 47 }, { "task": "affine-bernstein", @@ -36,7 +36,7 @@ "packages": [], "grade_timeout_sec": 12598, "oracle_result": "accepted", - "oracle_grade_seconds": 1091 + "oracle_grade_seconds": 1429 }, { "task": "algorithmic-thin-trees", @@ -54,7 +54,7 @@ "packages": [], "grade_timeout_sec": 14901, "oracle_result": "accepted", - "oracle_grade_seconds": 2906 + "oracle_grade_seconds": 2392 }, { "task": "amplitude-damping", @@ -72,7 +72,7 @@ "packages": [], "grade_timeout_sec": 11055, "oracle_result": "accepted", - "oracle_grade_seconds": 1119 + "oracle_grade_seconds": 432 }, { "task": "artin-cat0", @@ -90,7 +90,7 @@ "packages": [], "grade_timeout_sec": 11173, "oracle_result": "accepted", - "oracle_grade_seconds": 792 + "oracle_grade_seconds": 193 }, { "task": "artin-parabolic-intersections", @@ -111,7 +111,7 @@ "packages": [], "grade_timeout_sec": 13770, "oracle_result": "accepted", - "oracle_grade_seconds": 1711 + "oracle_grade_seconds": 2200 }, { "task": "asymptotically-minimal-littlewood", @@ -129,7 +129,25 @@ "packages": [], "grade_timeout_sec": 11189, "oracle_result": "accepted", - "oracle_grade_seconds": 919 + "oracle_grade_seconds": 346 + }, + { + "task": "atomic-gaussian", + "challenge": "AtomicGaussian", + "family": "090", + "family_title": "Universal optimality of the triangular lattice", + "subject": "Convex and metric geometry", + "theorems": [ + "OAI.AtomicTriangular.sharp_gaussian_minorants_atomic" + ], + "definition_holes": [], + "fixed_definitions": [], + "n_modules": 215, + "bytes": 8527615, + "packages": [], + "grade_timeout_sec": 18474, + "oracle_result": "accepted", + "oracle_grade_seconds": 10626 }, { "task": "auslander-reiten", @@ -147,7 +165,7 @@ "packages": [], "grade_timeout_sec": 12914, "oracle_result": "accepted", - "oracle_grade_seconds": 2615 + "oracle_grade_seconds": 2177 }, { "task": "backward-intertwiners", @@ -165,7 +183,7 @@ "packages": [], "grade_timeout_sec": 11036, "oracle_result": "accepted", - "oracle_grade_seconds": 823 + "oracle_grade_seconds": 337 }, { "task": "balanced-box-routing", @@ -183,7 +201,7 @@ "packages": [], "grade_timeout_sec": 10948, "oracle_result": "accepted", - "oracle_grade_seconds": 299 + "oracle_grade_seconds": 141 }, { "task": "balanced-ryser", @@ -201,7 +219,7 @@ "packages": [], "grade_timeout_sec": 14307, "oracle_result": "accepted", - "oracle_grade_seconds": 1733 + "oracle_grade_seconds": 1384 }, { "task": "balanced-three-stack", @@ -219,7 +237,7 @@ "packages": [], "grade_timeout_sec": 11246, "oracle_result": "accepted", - "oracle_grade_seconds": 1956 + "oracle_grade_seconds": 392 }, { "task": "ball-packing", @@ -237,7 +255,7 @@ "packages": [], "grade_timeout_sec": 14876, "oracle_result": "accepted", - "oracle_grade_seconds": 4562 + "oracle_grade_seconds": 2433 }, { "task": "ball-packing-necessity", @@ -255,7 +273,7 @@ "packages": [], "grade_timeout_sec": 12306, "oracle_result": "accepted", - "oracle_grade_seconds": 1874 + "oracle_grade_seconds": 1186 }, { "task": "barnette-hamiltonian", @@ -273,7 +291,7 @@ "packages": [], "grade_timeout_sec": 11141, "oracle_result": "accepted", - "oracle_grade_seconds": 752 + "oracle_grade_seconds": 337 }, { "task": "bass-torsion-free", @@ -291,7 +309,7 @@ "packages": [], "grade_timeout_sec": 11720, "oracle_result": "accepted", - "oracle_grade_seconds": 1087 + "oracle_grade_seconds": 650 }, { "task": "bass-trace", @@ -309,7 +327,7 @@ "packages": [], "grade_timeout_sec": 11697, "oracle_result": "accepted", - "oracle_grade_seconds": 1120 + "oracle_grade_seconds": 633 }, { "task": "benjamini-schramm", @@ -329,7 +347,7 @@ "packages": [], "grade_timeout_sec": 16950, "oracle_result": "accepted", - "oracle_grade_seconds": 3592 + "oracle_grade_seconds": 2752 }, { "task": "bernoulli-nonflat-in-seven", @@ -347,7 +365,7 @@ "packages": [], "grade_timeout_sec": 11376, "oracle_result": "accepted", - "oracle_grade_seconds": 1160 + "oracle_grade_seconds": 664 }, { "task": "biholder-transport", @@ -365,7 +383,7 @@ "packages": [], "grade_timeout_sec": 13682, "oracle_result": "accepted", - "oracle_grade_seconds": 3094 + "oracle_grade_seconds": 2398 }, { "task": "bin-packing-gap", @@ -383,7 +401,7 @@ "packages": [], "grade_timeout_sec": 17601, "oracle_result": "accepted", - "oracle_grade_seconds": 1412 + "oracle_grade_seconds": 1119 }, { "task": "binary-edit-lower", @@ -401,7 +419,7 @@ "packages": [], "grade_timeout_sec": 11218, "oracle_result": "accepted", - "oracle_grade_seconds": 790 + "oracle_grade_seconds": 280 }, { "task": "binary-matching", @@ -419,7 +437,7 @@ "packages": [], "grade_timeout_sec": 11355, "oracle_result": "accepted", - "oracle_grade_seconds": 1132 + "oracle_grade_seconds": 524 }, { "task": "binary-sweep", @@ -437,7 +455,7 @@ "packages": [], "grade_timeout_sec": 11836, "oracle_result": "accepted", - "oracle_grade_seconds": 1210 + "oracle_grade_seconds": 768 }, { "task": "bipartite-crossing", @@ -455,7 +473,7 @@ "packages": [], "grade_timeout_sec": 11604, "oracle_result": "accepted", - "oracle_grade_seconds": 790 + "oracle_grade_seconds": 448 }, { "task": "bogomolov-pop-injectivity", @@ -473,7 +491,7 @@ "packages": [], "grade_timeout_sec": 10939, "oracle_result": "accepted", - "oracle_grade_seconds": 445 + "oracle_grade_seconds": 159 }, { "task": "boltzmann-nonuniqueness", @@ -491,7 +509,7 @@ "packages": [], "grade_timeout_sec": 17397, "oracle_result": "accepted", - "oracle_grade_seconds": 1584 + "oracle_grade_seconds": 1339 }, { "task": "boone-higman", @@ -509,7 +527,7 @@ "packages": [], "grade_timeout_sec": 12318, "oracle_result": "accepted", - "oracle_grade_seconds": 976 + "oracle_grade_seconds": 379 }, { "task": "borsuk-nine", @@ -527,7 +545,7 @@ "packages": [], "grade_timeout_sec": 13972, "oracle_result": "accepted", - "oracle_grade_seconds": 893 + "oracle_grade_seconds": 1206 }, { "task": "bounded-recovery", @@ -545,7 +563,7 @@ "packages": [], "grade_timeout_sec": 11131, "oracle_result": "accepted", - "oracle_grade_seconds": 1002 + "oracle_grade_seconds": 494 }, { "task": "bounded-tree-potentials", @@ -563,7 +581,7 @@ "packages": [], "grade_timeout_sec": 11336, "oracle_result": "accepted", - "oracle_grade_seconds": 758 + "oracle_grade_seconds": 358 }, { "task": "bounded-treewidth-l1", @@ -581,7 +599,7 @@ "packages": [], "grade_timeout_sec": 11437, "oracle_result": "accepted", - "oracle_grade_seconds": 791 + "oracle_grade_seconds": 283 }, { "task": "brenier", @@ -613,7 +631,7 @@ "packages": [], "grade_timeout_sec": 12179, "oracle_result": "accepted", - "oracle_grade_seconds": 2528 + "oracle_grade_seconds": 440 }, { "task": "brennan", @@ -631,7 +649,7 @@ "packages": [], "grade_timeout_sec": 11423, "oracle_result": "accepted", - "oracle_grade_seconds": 1116 + "oracle_grade_seconds": 507 }, { "task": "brennan-sharp", @@ -649,7 +667,7 @@ "packages": [], "grade_timeout_sec": 11440, "oracle_result": "accepted", - "oracle_grade_seconds": 895 + "oracle_grade_seconds": 354 }, { "task": "buffered-ising", @@ -667,7 +685,7 @@ "packages": [], "grade_timeout_sec": 10922, "oracle_result": "accepted", - "oracle_grade_seconds": 2053 + "oracle_grade_seconds": 127 }, { "task": "c0-absorption", @@ -685,7 +703,7 @@ "packages": [], "grade_timeout_sec": 11129, "oracle_result": "accepted", - "oracle_grade_seconds": 1155 + "oracle_grade_seconds": 256 }, { "task": "c1-entropy-counterexample", @@ -703,7 +721,7 @@ "packages": [], "grade_timeout_sec": 11668, "oracle_result": "accepted", - "oracle_grade_seconds": 1331 + "oracle_grade_seconds": 647 }, { "task": "ch-obstruction", @@ -721,7 +739,7 @@ "packages": [], "grade_timeout_sec": 10979, "oracle_result": "accepted", - "oracle_grade_seconds": 1476 + "oracle_grade_seconds": 124 }, { "task": "cks-bondi-penrose", @@ -740,7 +758,7 @@ "packages": [], "grade_timeout_sec": 13346, "oracle_result": "accepted", - "oracle_grade_seconds": 1456 + "oracle_grade_seconds": 1417 }, { "task": "cannon-geometric-action", @@ -758,7 +776,7 @@ "packages": [], "grade_timeout_sec": 13413, "oracle_result": "accepted", - "oracle_grade_seconds": 970 + "oracle_grade_seconds": 1075 }, { "task": "cayley-percolation", @@ -776,7 +794,7 @@ "packages": [], "grade_timeout_sec": 13179, "oracle_result": "accepted", - "oracle_grade_seconds": 1048 + "oracle_grade_seconds": 698 }, { "task": "character-criterion", @@ -794,7 +812,7 @@ "packages": [], "grade_timeout_sec": 11832, "oracle_result": "accepted", - "oracle_grade_seconds": 1889 + "oracle_grade_seconds": 991 }, { "task": "choiceless-polynomial-time", @@ -812,7 +830,7 @@ "packages": [], "grade_timeout_sec": 11523, "oracle_result": "accepted", - "oracle_grade_seconds": 574 + "oracle_grade_seconds": 286 }, { "task": "circulant-hadamard", @@ -830,7 +848,7 @@ "packages": [], "grade_timeout_sec": 11160, "oracle_result": "accepted", - "oracle_grade_seconds": 1652 + "oracle_grade_seconds": 235 }, { "task": "classical-on", @@ -848,7 +866,7 @@ "packages": [], "grade_timeout_sec": 11324, "oracle_result": "accepted", - "oracle_grade_seconds": 1392 + "oracle_grade_seconds": 752 }, { "task": "clique-free-log", @@ -866,7 +884,7 @@ "packages": [], "grade_timeout_sec": 11006, "oracle_result": "accepted", - "oracle_grade_seconds": 794 + "oracle_grade_seconds": 193 }, { "task": "coboundary-expanders", @@ -884,7 +902,7 @@ "packages": [], "grade_timeout_sec": 12113, "oracle_result": "accepted", - "oracle_grade_seconds": 1082 + "oracle_grade_seconds": 437 }, { "task": "common-bases-fpras", @@ -902,7 +920,7 @@ "packages": [], "grade_timeout_sec": 12002, "oracle_result": "accepted", - "oracle_grade_seconds": 950 + "oracle_grade_seconds": 347 }, { "task": "commuting-derivations", @@ -920,7 +938,7 @@ "packages": [], "grade_timeout_sec": 10921, "oracle_result": "accepted", - "oracle_grade_seconds": 426 + "oracle_grade_seconds": 81 }, { "task": "compact-banach", @@ -938,7 +956,7 @@ "packages": [], "grade_timeout_sec": 10986, "oracle_result": "accepted", - "oracle_grade_seconds": 1439 + "oracle_grade_seconds": 303 }, { "task": "complete-crossing", @@ -956,7 +974,7 @@ "packages": [], "grade_timeout_sec": 12117, "oracle_result": "accepted", - "oracle_grade_seconds": 800 + "oracle_grade_seconds": 344 }, { "task": "complete-crouzeix", @@ -974,7 +992,7 @@ "packages": [], "grade_timeout_sec": 11386, "oracle_result": "accepted", - "oracle_grade_seconds": 1153 + "oracle_grade_seconds": 546 }, { "task": "complex-cancellation", @@ -992,7 +1010,7 @@ "packages": [], "grade_timeout_sec": 11018, "oracle_result": "accepted", - "oracle_grade_seconds": 971 + "oracle_grade_seconds": 355 }, { "task": "conductivity", @@ -1010,7 +1028,7 @@ "packages": [], "grade_timeout_sec": 14056, "oracle_result": "accepted", - "oracle_grade_seconds": 1871 + "oracle_grade_seconds": 1793 }, { "task": "conjugate-points", @@ -1028,7 +1046,7 @@ "packages": [], "grade_timeout_sec": 11951, "oracle_result": "accepted", - "oracle_grade_seconds": 1609 + "oracle_grade_seconds": 595 }, { "task": "contingency-tables", @@ -1048,7 +1066,7 @@ "packages": [], "grade_timeout_sec": 18988, "oracle_result": "accepted", - "oracle_grade_seconds": 3243 + "oracle_grade_seconds": 3262 }, { "task": "continuous-circle-weight", @@ -1066,7 +1084,7 @@ "packages": [], "grade_timeout_sec": 11617, "oracle_result": "accepted", - "oracle_grade_seconds": 1217 + "oracle_grade_seconds": 530 }, { "task": "continuum-transition", @@ -1084,7 +1102,7 @@ "packages": [], "grade_timeout_sec": 11427, "oracle_result": "accepted", - "oracle_grade_seconds": 1607 + "oracle_grade_seconds": 942 }, { "task": "coordinate-sweeps", @@ -1103,7 +1121,7 @@ "packages": [], "grade_timeout_sec": 11777, "oracle_result": "accepted", - "oracle_grade_seconds": 1051 + "oracle_grade_seconds": 383 }, { "task": "coordinate-trace", @@ -1121,7 +1139,7 @@ "packages": [], "grade_timeout_sec": 11676, "oracle_result": "accepted", - "oracle_grade_seconds": 1254 + "oracle_grade_seconds": 427 }, { "task": "cotype", @@ -1139,7 +1157,7 @@ "packages": [], "grade_timeout_sec": 11253, "oracle_result": "accepted", - "oracle_grade_seconds": 1088 + "oracle_grade_seconds": 444 }, { "task": "coulomb-counterexample", @@ -1157,7 +1175,7 @@ "packages": [], "grade_timeout_sec": 11220, "oracle_result": "accepted", - "oracle_grade_seconds": 891 + "oracle_grade_seconds": 349 }, { "task": "coulomb-ionization", @@ -1175,7 +1193,7 @@ "packages": [], "grade_timeout_sec": 14952, "oracle_result": "accepted", - "oracle_grade_seconds": 2115 + "oracle_grade_seconds": 2150 }, { "task": "coulomb-radii", @@ -1193,7 +1211,7 @@ "packages": [], "grade_timeout_sec": 14272, "oracle_result": "accepted", - "oracle_grade_seconds": 2054 + "oracle_grade_seconds": 1444 }, { "task": "courtade-kumar", @@ -1211,7 +1229,7 @@ "packages": [], "grade_timeout_sec": 11095, "oracle_result": "accepted", - "oracle_grade_seconds": 468 + "oracle_grade_seconds": 251 }, { "task": "covering-density", @@ -1229,7 +1247,7 @@ "packages": [], "grade_timeout_sec": 12384, "oracle_result": "accepted", - "oracle_grade_seconds": 1458 + "oracle_grade_seconds": 762 }, { "task": "critical-percolation", @@ -1247,7 +1265,7 @@ "packages": [], "grade_timeout_sec": 13419, "oracle_result": "accepted", - "oracle_grade_seconds": 2360 + "oracle_grade_seconds": 1685 }, { "task": "critical-sk", @@ -1267,7 +1285,7 @@ "packages": [], "grade_timeout_sec": 11601, "oracle_result": "accepted", - "oracle_grade_seconds": 892 + "oracle_grade_seconds": 322 }, { "task": "critical-sk-mixing", @@ -1285,7 +1303,7 @@ "packages": [], "grade_timeout_sec": 15840, "oracle_result": "accepted", - "oracle_grade_seconds": 2139 + "oracle_grade_seconds": 2056 }, { "task": "critical-strip-mass", @@ -1303,7 +1321,7 @@ "packages": [], "grade_timeout_sec": 13317, "oracle_result": "accepted", - "oracle_grade_seconds": 1959 + "oracle_grade_seconds": 1033 }, { "task": "critical-z3", @@ -1321,7 +1339,7 @@ "packages": [], "grade_timeout_sec": 11215, "oracle_result": "accepted", - "oracle_grade_seconds": 859 + "oracle_grade_seconds": 230 }, { "task": "crouzeix-hilbert", @@ -1339,7 +1357,7 @@ "packages": [], "grade_timeout_sec": 11451, "oracle_result": "accepted", - "oracle_grade_seconds": 1215 + "oracle_grade_seconds": 657 }, { "task": "cubic-torus", @@ -1357,7 +1375,7 @@ "packages": [], "grade_timeout_sec": 17093, "oracle_result": "accepted", - "oracle_grade_seconds": 2541 + "oracle_grade_seconds": 1840 }, { "task": "cycle-decomposition", @@ -1375,7 +1393,7 @@ "packages": [], "grade_timeout_sec": 11698, "oracle_result": "accepted", - "oracle_grade_seconds": 827 + "oracle_grade_seconds": 295 }, { "task": "cylinder-covering", @@ -1393,7 +1411,7 @@ "packages": [], "grade_timeout_sec": 13511, "oracle_result": "accepted", - "oracle_grade_seconds": 2016 + "oracle_grade_seconds": 1626 }, { "task": "daugavet-moduli", @@ -1413,7 +1431,7 @@ "packages": [], "grade_timeout_sec": 10981, "oracle_result": "accepted", - "oracle_grade_seconds": 462 + "oracle_grade_seconds": 230 }, { "task": "degree-rigidity", @@ -1431,7 +1449,7 @@ "packages": [], "grade_timeout_sec": 14330, "oracle_result": "accepted", - "oracle_grade_seconds": 1821 + "oracle_grade_seconds": 2006 }, { "task": "deligne-drinfeld", @@ -1449,7 +1467,7 @@ "packages": [], "grade_timeout_sec": 12022, "oracle_result": "accepted", - "oracle_grade_seconds": 921 + "oracle_grade_seconds": 563 }, { "task": "depth-five", @@ -1467,7 +1485,7 @@ "packages": [], "grade_timeout_sec": 11592, "oracle_result": "accepted", - "oracle_grade_seconds": 1051 + "oracle_grade_seconds": 462 }, { "task": "depth-three", @@ -1485,7 +1503,7 @@ "packages": [], "grade_timeout_sec": 11723, "oracle_result": "accepted", - "oracle_grade_seconds": 776 + "oracle_grade_seconds": 398 }, { "task": "diamond-distortion", @@ -1503,7 +1521,7 @@ "packages": [], "grade_timeout_sec": 11225, "oracle_result": "accepted", - "oracle_grade_seconds": 771 + "oracle_grade_seconds": 268 }, { "task": "diluted-spin", @@ -1521,7 +1539,7 @@ "packages": [], "grade_timeout_sec": 13284, "oracle_result": "accepted", - "oracle_grade_seconds": 1537 + "oracle_grade_seconds": 1199 }, { "task": "dimension-ten-channel", @@ -1539,7 +1557,7 @@ "packages": [], "grade_timeout_sec": 13567, "oracle_result": "accepted", - "oracle_grade_seconds": 2360 + "oracle_grade_seconds": 1785 }, { "task": "dimension-ten-pair", @@ -1557,7 +1575,7 @@ "packages": [], "grade_timeout_sec": 12972, "oracle_result": "accepted", - "oracle_grade_seconds": 1766 + "oracle_grade_seconds": 1663 }, { "task": "direct-crouzeix", @@ -1576,7 +1594,7 @@ "packages": [], "grade_timeout_sec": 11082, "oracle_result": "accepted", - "oracle_grade_seconds": 1202 + "oracle_grade_seconds": 429 }, { "task": "directed-feedback", @@ -1594,7 +1612,7 @@ "packages": [], "grade_timeout_sec": 18455, "oracle_result": "accepted", - "oracle_grade_seconds": 1662 + "oracle_grade_seconds": 1607 }, { "task": "directional-ballisticity", @@ -1612,7 +1630,7 @@ "packages": [], "grade_timeout_sec": 15311, "oracle_result": "accepted", - "oracle_grade_seconds": 1730 + "oracle_grade_seconds": 1803 }, { "task": "directional-walk", @@ -1630,7 +1648,7 @@ "packages": [], "grade_timeout_sec": 11656, "oracle_result": "accepted", - "oracle_grade_seconds": 968 + "oracle_grade_seconds": 459 }, { "task": "discrete-lipschitz-free", @@ -1648,7 +1666,7 @@ "packages": [], "grade_timeout_sec": 10956, "oracle_result": "accepted", - "oracle_grade_seconds": 662 + "oracle_grade_seconds": 199 }, { "task": "disk-maximal", @@ -1666,7 +1684,7 @@ "packages": [], "grade_timeout_sec": 11673, "oracle_result": "accepted", - "oracle_grade_seconds": 756 + "oracle_grade_seconds": 415 }, { "task": "dixmier", @@ -1684,7 +1702,7 @@ "packages": [], "grade_timeout_sec": 10943, "oracle_result": "accepted", - "oracle_grade_seconds": 332 + "oracle_grade_seconds": 112 }, { "task": "dixmier-all-discrete", @@ -1702,7 +1720,7 @@ "packages": [], "grade_timeout_sec": 10963, "oracle_result": "accepted", - "oracle_grade_seconds": 471 + "oracle_grade_seconds": 194 }, { "task": "doubling-hilbert", @@ -1720,7 +1738,7 @@ "packages": [], "grade_timeout_sec": 10941, "oracle_result": "accepted", - "oracle_grade_seconds": 454 + "oracle_grade_seconds": 179 }, { "task": "dutta-domain", @@ -1738,7 +1756,7 @@ "packages": [], "grade_timeout_sec": 12968, "oracle_result": "accepted", - "oracle_grade_seconds": 1913 + "oracle_grade_seconds": 1966 }, { "task": "dyadic-avoidance", @@ -1756,7 +1774,7 @@ "packages": [], "grade_timeout_sec": 11132, "oracle_result": "accepted", - "oracle_grade_seconds": 796 + "oracle_grade_seconds": 198 }, { "task": "edit-approximation", @@ -1774,7 +1792,7 @@ "packages": [], "grade_timeout_sec": 17632, "oracle_result": "accepted", - "oracle_grade_seconds": 3183 + "oracle_grade_seconds": 2717 }, { "task": "edit-distance", @@ -1792,7 +1810,7 @@ "packages": [], "grade_timeout_sec": 12317, "oracle_result": "accepted", - "oracle_grade_seconds": 1069 + "oracle_grade_seconds": 320 }, { "task": "egyptian-fractions", @@ -1818,7 +1836,7 @@ "packages": [], "grade_timeout_sec": 12262, "oracle_result": "accepted", - "oracle_grade_seconds": 763 + "oracle_grade_seconds": 832 }, { "task": "eilenberg-ganea", @@ -1836,7 +1854,7 @@ "packages": [], "grade_timeout_sec": 12346, "oracle_result": "accepted", - "oracle_grade_seconds": 4559 + "oracle_grade_seconds": 3411 }, { "task": "elasticity-uniqueness", @@ -1854,7 +1872,7 @@ "packages": [], "grade_timeout_sec": 12247, "oracle_result": "accepted", - "oracle_grade_seconds": 1681 + "oracle_grade_seconds": 755 }, { "task": "elementary-positivity", @@ -1872,7 +1890,7 @@ "packages": [], "grade_timeout_sec": 13926, "oracle_result": "accepted", - "oracle_grade_seconds": 2371 + "oracle_grade_seconds": 2005 }, { "task": "entangled-games", @@ -1890,7 +1908,7 @@ "packages": [], "grade_timeout_sec": 11118, "oracle_result": "accepted", - "oracle_grade_seconds": 786 + "oracle_grade_seconds": 276 }, { "task": "entropy-photon-number", @@ -1908,7 +1926,7 @@ "packages": [], "grade_timeout_sec": 12060, "oracle_result": "accepted", - "oracle_grade_seconds": 998 + "oracle_grade_seconds": 517 }, { "task": "euclidean-five-color", @@ -1928,7 +1946,7 @@ "packages": [], "grade_timeout_sec": 12193, "oracle_result": "accepted", - "oracle_grade_seconds": 1407 + "oracle_grade_seconds": 597 }, { "task": "euclidean-ramsey", @@ -1946,7 +1964,7 @@ "packages": [], "grade_timeout_sec": 11059, "oracle_result": "accepted", - "oracle_grade_seconds": 1062 + "oracle_grade_seconds": 303 }, { "task": "euclidean-ramsey-circle", @@ -1964,7 +1982,7 @@ "packages": [], "grade_timeout_sec": 11086, "oracle_result": "accepted", - "oracle_grade_seconds": 883 + "oracle_grade_seconds": 304 }, { "task": "euclidean-ramsey-nine", @@ -1982,7 +2000,7 @@ "packages": [], "grade_timeout_sec": 10869, "oracle_result": "accepted", - "oracle_grade_seconds": 600 + "oracle_grade_seconds": 137 }, { "task": "euclidean-ramsey-quadratic", @@ -2000,7 +2018,7 @@ "packages": [], "grade_timeout_sec": 11069, "oracle_result": "accepted", - "oracle_grade_seconds": 672 + "oracle_grade_seconds": 297 }, { "task": "euclidean-ramsey-spherical", @@ -2018,7 +2036,7 @@ "packages": [], "grade_timeout_sec": 11065, "oracle_result": "accepted", - "oracle_grade_seconds": 735 + "oracle_grade_seconds": 222 }, { "task": "euclidean-ramsey-transitive", @@ -2036,7 +2054,7 @@ "packages": [], "grade_timeout_sec": 11065, "oracle_result": "accepted", - "oracle_grade_seconds": 1235 + "oracle_grade_seconds": 352 }, { "task": "even-barker", @@ -2054,7 +2072,7 @@ "packages": [], "grade_timeout_sec": 11169, "oracle_result": "accepted", - "oracle_grade_seconds": 743 + "oracle_grade_seconds": 251 }, { "task": "exact-fourier", @@ -2072,7 +2090,7 @@ "packages": [], "grade_timeout_sec": 11563, "oracle_result": "accepted", - "oracle_grade_seconds": 765 + "oracle_grade_seconds": 480 }, { "task": "exact-infiniteness", @@ -2091,7 +2109,7 @@ "packages": [], "grade_timeout_sec": 16851, "oracle_result": "accepted", - "oracle_grade_seconds": 4206 + "oracle_grade_seconds": 4325 }, { "task": "exact-quantum-factoring", @@ -2109,7 +2127,7 @@ "packages": [], "grade_timeout_sec": 12978, "oracle_result": "accepted", - "oracle_grade_seconds": 1227 + "oracle_grade_seconds": 1235 }, { "task": "fkcrt", @@ -2127,7 +2145,7 @@ "packages": [], "grade_timeout_sec": 12489, "oracle_result": "accepted", - "oracle_grade_seconds": 1071 + "oracle_grade_seconds": 489 }, { "task": "factor-generation", @@ -2145,7 +2163,7 @@ "packages": [], "grade_timeout_sec": 12311, "oracle_result": "accepted", - "oracle_grade_seconds": 3699 + "oracle_grade_seconds": 2800 }, { "task": "falconer-all-dimensions", @@ -2163,7 +2181,7 @@ "packages": [], "grade_timeout_sec": 18862, "oracle_result": "accepted", - "oracle_grade_seconds": 4645 + "oracle_grade_seconds": 5233 }, { "task": "filling-coefficient", @@ -2181,7 +2199,7 @@ "packages": [], "grade_timeout_sec": 11427, "oracle_result": "accepted", - "oracle_grade_seconds": 1115 + "oracle_grade_seconds": 480 }, { "task": "finite-circle", @@ -2199,7 +2217,7 @@ "packages": [], "grade_timeout_sec": 11212, "oracle_result": "accepted", - "oracle_grade_seconds": 902 + "oracle_grade_seconds": 285 }, { "task": "finite-congruence-graph", @@ -2217,7 +2235,7 @@ "packages": [], "grade_timeout_sec": 10820, "oracle_result": "accepted", - "oracle_grade_seconds": 466 + "oracle_grade_seconds": 19 }, { "task": "finite-entropy-separation", @@ -2235,7 +2253,7 @@ "packages": [], "grade_timeout_sec": 11507, "oracle_result": "accepted", - "oracle_grade_seconds": 1422 + "oracle_grade_seconds": 1014 }, { "task": "finite-factor", @@ -2253,7 +2271,7 @@ "packages": [], "grade_timeout_sec": 11802, "oracle_result": "accepted", - "oracle_grade_seconds": 1338 + "oracle_grade_seconds": 745 }, { "task": "finitistic-asymmetry", @@ -2271,7 +2289,7 @@ "packages": [], "grade_timeout_sec": 12826, "oracle_result": "accepted", - "oracle_grade_seconds": 2003 + "oracle_grade_seconds": 1462 }, { "task": "fixed-clause-threshold", @@ -2289,7 +2307,7 @@ "packages": [], "grade_timeout_sec": 10994, "oracle_result": "accepted", - "oracle_grade_seconds": 655 + "oracle_grade_seconds": 145 }, { "task": "forced-navier-stokes-computation", @@ -2307,7 +2325,7 @@ "packages": [], "grade_timeout_sec": 11246, "oracle_result": "accepted", - "oracle_grade_seconds": 547 + "oracle_grade_seconds": 302 }, { "task": "forest-space", @@ -2325,7 +2343,7 @@ "packages": [], "grade_timeout_sec": 10975, "oracle_result": "accepted", - "oracle_grade_seconds": 741 + "oracle_grade_seconds": 175 }, { "task": "formula-hitting", @@ -2343,7 +2361,7 @@ "packages": [], "grade_timeout_sec": 10911, "oracle_result": "accepted", - "oracle_grade_seconds": 637 + "oracle_grade_seconds": 63 }, { "task": "foulkes-howe", @@ -2361,7 +2379,7 @@ "packages": [], "grade_timeout_sec": 10977, "oracle_result": "accepted", - "oracle_grade_seconds": 1045 + "oracle_grade_seconds": 276 }, { "task": "four-row-permanent", @@ -2379,7 +2397,7 @@ "packages": [], "grade_timeout_sec": 10822, "oracle_result": "accepted", - "oracle_grade_seconds": 788 + "oracle_grade_seconds": 90 }, { "task": "free-ising", @@ -2397,7 +2415,7 @@ "packages": [], "grade_timeout_sec": 15777, "oracle_result": "accepted", - "oracle_grade_seconds": 2215 + "oracle_grade_seconds": 2094 }, { "task": "free-uniform-spanning-forest", @@ -2415,7 +2433,7 @@ "packages": [], "grade_timeout_sec": 11762, "oracle_result": "accepted", - "oracle_grade_seconds": 1286 + "oracle_grade_seconds": 624 }, { "task": "gamma-passage", @@ -2433,7 +2451,7 @@ "packages": [], "grade_timeout_sec": 11652, "oracle_result": "accepted", - "oracle_grade_seconds": 800 + "oracle_grade_seconds": 466 }, { "task": "gaussian-finite-entropy", @@ -2451,7 +2469,7 @@ "packages": [], "grade_timeout_sec": 10905, "oracle_result": "accepted", - "oracle_grade_seconds": 870 + "oracle_grade_seconds": 165 }, { "task": "gaussian-information", @@ -2472,7 +2490,7 @@ "packages": [], "grade_timeout_sec": 11504, "oracle_result": "accepted", - "oracle_grade_seconds": 1216 + "oracle_grade_seconds": 572 }, { "task": "gaussian-moat", @@ -2490,7 +2508,7 @@ "packages": [], "grade_timeout_sec": 11338, "oracle_result": "accepted", - "oracle_grade_seconds": 1157 + "oracle_grade_seconds": 422 }, { "task": "gaussian-propeller", @@ -2508,7 +2526,7 @@ "packages": [], "grade_timeout_sec": 11325, "oracle_result": "accepted", - "oracle_grade_seconds": 1095 + "oracle_grade_seconds": 496 }, { "task": "gaussian-replacement", @@ -2536,7 +2554,7 @@ "packages": [], "grade_timeout_sec": 11484, "oracle_result": "accepted", - "oracle_grade_seconds": 1104 + "oracle_grade_seconds": 486 }, { "task": "general-mahler", @@ -2554,7 +2572,7 @@ "packages": [], "grade_timeout_sec": 12728, "oracle_result": "accepted", - "oracle_grade_seconds": 5069 + "oracle_grade_seconds": 5721 }, { "task": "generalized-star-height", @@ -2572,7 +2590,7 @@ "packages": [], "grade_timeout_sec": 11270, "oracle_result": "accepted", - "oracle_grade_seconds": 852 + "oracle_grade_seconds": 235 }, { "task": "gotsman-linial", @@ -2590,7 +2608,7 @@ "packages": [], "grade_timeout_sec": 10954, "oracle_result": "accepted", - "oracle_grade_seconds": 728 + "oracle_grade_seconds": 72 }, { "task": "graham-spherical", @@ -2608,7 +2626,7 @@ "packages": [], "grade_timeout_sec": 10834, "oracle_result": "accepted", - "oracle_grade_seconds": 751 + "oracle_grade_seconds": 92 }, { "task": "grothendieck-elementary-expansion", @@ -2626,7 +2644,7 @@ "packages": [], "grade_timeout_sec": 11322, "oracle_result": "accepted", - "oracle_grade_seconds": 1113 + "oracle_grade_seconds": 436 }, { "task": "group-ring-determinant", @@ -2644,7 +2662,7 @@ "packages": [], "grade_timeout_sec": 11412, "oracle_result": "accepted", - "oracle_grade_seconds": 1695 + "oracle_grade_seconds": 788 }, { "task": "hadamard-cube-fiber", @@ -2662,7 +2680,7 @@ "packages": [], "grade_timeout_sec": 10835, "oracle_result": "accepted", - "oracle_grade_seconds": 462 + "oracle_grade_seconds": 64 }, { "task": "halving-lines", @@ -2680,7 +2698,7 @@ "packages": [], "grade_timeout_sec": 11598, "oracle_result": "accepted", - "oracle_grade_seconds": 894 + "oracle_grade_seconds": 410 }, { "task": "hard-sphere", @@ -2698,7 +2716,7 @@ "packages": [], "grade_timeout_sec": 13924, "oracle_result": "accepted", - "oracle_grade_seconds": 1367 + "oracle_grade_seconds": 1832 }, { "task": "harmonic-artin", @@ -2716,7 +2734,7 @@ "packages": [], "grade_timeout_sec": 13321, "oracle_result": "accepted", - "oracle_grade_seconds": 1612 + "oracle_grade_seconds": 1678 }, { "task": "harmonic-growth", @@ -2734,7 +2752,7 @@ "packages": [], "grade_timeout_sec": 12315, "oracle_result": "accepted", - "oracle_grade_seconds": 1761 + "oracle_grade_seconds": 799 }, { "task": "heilbronn-triangle", @@ -2753,7 +2771,7 @@ "packages": [], "grade_timeout_sec": 11713, "oracle_result": "accepted", - "oracle_grade_seconds": 1117 + "oracle_grade_seconds": 640 }, { "task": "heisenberg", @@ -2771,7 +2789,7 @@ "packages": [], "grade_timeout_sec": 11798, "oracle_result": "accepted", - "oracle_grade_seconds": 1829 + "oracle_grade_seconds": 1106 }, { "task": "henon-emden", @@ -2789,7 +2807,7 @@ "packages": [], "grade_timeout_sec": 11381, "oracle_result": "accepted", - "oracle_grade_seconds": 1094 + "oracle_grade_seconds": 584 }, { "task": "hilbert-crouzeix", @@ -2810,7 +2828,7 @@ "packages": [], "grade_timeout_sec": 10833, "oracle_result": "accepted", - "oracle_grade_seconds": 927 + "oracle_grade_seconds": 136 }, { "task": "honeycomb-bridge-finiteness", @@ -2828,7 +2846,7 @@ "packages": [], "grade_timeout_sec": 11090, "oracle_result": "accepted", - "oracle_grade_seconds": 711 + "oracle_grade_seconds": 192 }, { "task": "honeycomb-free-energy", @@ -2846,7 +2864,7 @@ "packages": [], "grade_timeout_sec": 10837, "oracle_result": "accepted", - "oracle_grade_seconds": 812 + "oracle_grade_seconds": 51 }, { "task": "hot-spots", @@ -2864,7 +2882,7 @@ "packages": [], "grade_timeout_sec": 12043, "oracle_result": "accepted", - "oracle_grade_seconds": 1437 + "oracle_grade_seconds": 578 }, { "task": "hyperbolic-cones", @@ -2882,7 +2900,7 @@ "packages": [], "grade_timeout_sec": 10996, "oracle_result": "accepted", - "oracle_grade_seconds": 849 + "oracle_grade_seconds": 350 }, { "task": "hyperbolic-obstruction", @@ -2900,7 +2918,7 @@ "packages": [], "grade_timeout_sec": 12987, "oracle_result": "accepted", - "oracle_grade_seconds": 1194 + "oracle_grade_seconds": 1278 }, { "task": "hyperinvariant-subspaces", @@ -2918,7 +2936,7 @@ "packages": [], "grade_timeout_sec": 11816, "oracle_result": "accepted", - "oracle_grade_seconds": 1437 + "oracle_grade_seconds": 870 }, { "task": "independent-products", @@ -2939,7 +2957,7 @@ "packages": [], "grade_timeout_sec": 10960, "oracle_result": "accepted", - "oracle_grade_seconds": 656 + "oracle_grade_seconds": 250 }, { "task": "independent-sets", @@ -2957,7 +2975,7 @@ "packages": [], "grade_timeout_sec": 14830, "oracle_result": "accepted", - "oracle_grade_seconds": 1201 + "oracle_grade_seconds": 1204 }, { "task": "individual-strong-infiniteness", @@ -2975,7 +2993,7 @@ "packages": [], "grade_timeout_sec": 11054, "oracle_result": "accepted", - "oracle_grade_seconds": 965 + "oracle_grade_seconds": 355 }, { "task": "infinite-matroid", @@ -2993,7 +3011,7 @@ "packages": [], "grade_timeout_sec": 10957, "oracle_result": "accepted", - "oracle_grade_seconds": 667 + "oracle_grade_seconds": 111 }, { "task": "infinite-matroid-corollaries", @@ -3012,7 +3030,7 @@ "packages": [], "grade_timeout_sec": 10973, "oracle_result": "accepted", - "oracle_grade_seconds": 637 + "oracle_grade_seconds": 155 }, { "task": "interpolated-factors", @@ -3030,7 +3048,35 @@ "packages": [], "grade_timeout_sec": 11924, "oracle_result": "accepted", - "oracle_grade_seconds": 1971 + "oracle_grade_seconds": 1361 + }, + { + "task": "invariant-ising", + "challenge": "InvariantIsing", + "family": "234", + "family_title": "All-temperature pressure for orthogonally invariant Ising spin glasses", + "subject": "Probability and statistical mechanics", + "theorems": [ + "OAI.InvariantIsing.limiting_pressure_of_extreme_limits_unconditional", + "OAI.InvariantIsing.limiting_wasserstein_field_pressure_of_extreme_limits_unconditional", + "OAI.InvariantIsing.positive_temperature_pressure_unconditional", + "OAI.InvariantIsing.ground_state_limit_unconditional", + "OAI.InvariantIsing.random_pressure_tendsto_in_measure_unconditional", + "OAI.InvariantIsing.random_pressure_limit_unconditional", + "OAI.InvariantIsing.random_pressure_tendsto_ae_unconditional", + "OAI.InvariantIsing.random_field_pressure_tendsto_ae_unconditional", + "OAI.InvariantIsing.gaussianPattern_pressure_limit_unconditional", + "OAI.InvariantIsing.gaussianPattern_ground_limit_unconditional", + "OAI.InvariantIsing.gaussianPattern_norm_limits_unconditional" + ], + "definition_holes": [], + "fixed_definitions": [], + "n_modules": 2123, + "bytes": 10537287, + "packages": [], + "grade_timeout_sec": 20283, + "oracle_result": "accepted", + "oracle_grade_seconds": 5030 }, { "task": "irrational-rotation", @@ -3049,7 +3095,7 @@ "packages": [], "grade_timeout_sec": 14080, "oracle_result": "accepted", - "oracle_grade_seconds": 1441 + "oracle_grade_seconds": 2128 }, { "task": "irrational-triangle-billiard", @@ -3067,7 +3113,7 @@ "packages": [], "grade_timeout_sec": 11334, "oracle_result": "accepted", - "oracle_grade_seconds": 820 + "oracle_grade_seconds": 347 }, { "task": "ising-finiteness", @@ -3085,7 +3131,7 @@ "packages": [], "grade_timeout_sec": 12144, "oracle_result": "accepted", - "oracle_grade_seconds": 958 + "oracle_grade_seconds": 327 }, { "task": "isometric-immersion", @@ -3103,7 +3149,7 @@ "packages": [], "grade_timeout_sec": 13342, "oracle_result": "accepted", - "oracle_grade_seconds": 1242 + "oracle_grade_seconds": 698 }, { "task": "kl-invariance", @@ -3121,7 +3167,7 @@ "packages": [], "grade_timeout_sec": 12448, "oracle_result": "accepted", - "oracle_grade_seconds": 1717 + "oracle_grade_seconds": 1231 }, { "task": "k-median-recovery", @@ -3139,7 +3185,7 @@ "packages": [], "grade_timeout_sec": 14148, "oracle_result": "accepted", - "oracle_grade_seconds": 1362 + "oracle_grade_seconds": 1418 }, { "task": "k-median-refined-recovery", @@ -3157,7 +3203,7 @@ "packages": [], "grade_timeout_sec": 13122, "oracle_result": "accepted", - "oracle_grade_seconds": 1849 + "oracle_grade_seconds": 1462 }, { "task": "k-median-threshold", @@ -3175,7 +3221,7 @@ "packages": [], "grade_timeout_sec": 13713, "oracle_result": "accepted", - "oracle_grade_seconds": 2259 + "oracle_grade_seconds": 2180 }, { "task": "k-server", @@ -3203,7 +3249,7 @@ "packages": [], "grade_timeout_sec": 12404, "oracle_result": "accepted", - "oracle_grade_seconds": 587 + "oracle_grade_seconds": 322 }, { "task": "kadison-ringrose", @@ -3221,7 +3267,7 @@ "packages": [], "grade_timeout_sec": 13314, "oracle_result": "accepted", - "oracle_grade_seconds": 1352 + "oracle_grade_seconds": 1426 }, { "task": "kadison-similarity", @@ -3241,7 +3287,7 @@ "packages": [], "grade_timeout_sec": 16012, "oracle_result": "accepted", - "oracle_grade_seconds": 3415 + "oracle_grade_seconds": 4111 }, { "task": "kahler-splitting", @@ -3259,7 +3305,7 @@ "packages": [], "grade_timeout_sec": 11454, "oracle_result": "accepted", - "oracle_grade_seconds": 1239 + "oracle_grade_seconds": 468 }, { "task": "kaplansky-direct-finiteness", @@ -3277,7 +3323,7 @@ "packages": [], "grade_timeout_sec": 11289, "oracle_result": "accepted", - "oracle_grade_seconds": 1170 + "oracle_grade_seconds": 704 }, { "task": "kaplansky-finitely-presented", @@ -3295,7 +3341,7 @@ "packages": [], "grade_timeout_sec": 11300, "oracle_result": "accepted", - "oracle_grade_seconds": 1470 + "oracle_grade_seconds": 723 }, { "task": "kaplansky-quasitrace", @@ -3313,7 +3359,7 @@ "packages": [], "grade_timeout_sec": 12150, "oracle_result": "accepted", - "oracle_grade_seconds": 993 + "oracle_grade_seconds": 492 }, { "task": "kaplansky-stable-finiteness", @@ -3331,7 +3377,7 @@ "packages": [], "grade_timeout_sec": 12365, "oracle_result": "accepted", - "oracle_grade_seconds": 1007 + "oracle_grade_seconds": 720 }, { "task": "kervaire", @@ -3349,7 +3395,7 @@ "packages": [], "grade_timeout_sec": 11257, "oracle_result": "accepted", - "oracle_grade_seconds": 1057 + "oracle_grade_seconds": 506 }, { "task": "laughlin", @@ -3367,7 +3413,7 @@ "packages": [], "grade_timeout_sec": 13474, "oracle_result": "accepted", - "oracle_grade_seconds": 6718 + "oracle_grade_seconds": 6435 }, { "task": "laughlin-fock", @@ -3385,7 +3431,7 @@ "packages": [], "grade_timeout_sec": 18377, "oracle_result": "accepted", - "oracle_grade_seconds": 6546 + "oracle_grade_seconds": 6157 }, { "task": "laughlin-gap", @@ -3403,7 +3449,7 @@ "packages": [], "grade_timeout_sec": 12905, "oracle_result": "accepted", - "oracle_grade_seconds": 5587 + "oracle_grade_seconds": 4594 }, { "task": "laughlin-planar", @@ -3421,7 +3467,7 @@ "packages": [], "grade_timeout_sec": 13554, "oracle_result": "accepted", - "oracle_grade_seconds": 7126 + "oracle_grade_seconds": 5977 }, { "task": "lieb-thirring", @@ -3439,7 +3485,7 @@ "packages": [], "grade_timeout_sec": 11388, "oracle_result": "accepted", - "oracle_grade_seconds": 1327 + "oracle_grade_seconds": 478 }, { "task": "lipschitz-equivalence", @@ -3457,7 +3503,7 @@ "packages": [], "grade_timeout_sec": 11228, "oracle_result": "accepted", - "oracle_grade_seconds": 1251 + "oracle_grade_seconds": 460 }, { "task": "lipschitz-hilbert", @@ -3476,7 +3522,7 @@ "packages": [], "grade_timeout_sec": 19136, "oracle_result": "accepted", - "oracle_grade_seconds": 2945 + "oracle_grade_seconds": 2873 }, { "task": "list-hadwiger", @@ -3494,7 +3540,7 @@ "packages": [], "grade_timeout_sec": 11612, "oracle_result": "accepted", - "oracle_grade_seconds": 715 + "oracle_grade_seconds": 402 }, { "task": "little-finitistic", @@ -3512,7 +3558,7 @@ "packages": [], "grade_timeout_sec": 12645, "oracle_result": "accepted", - "oracle_grade_seconds": 1694 + "oracle_grade_seconds": 1382 }, { "task": "littlewood-finite-flatness", @@ -3530,7 +3576,7 @@ "packages": [], "grade_timeout_sec": 11204, "oracle_result": "accepted", - "oracle_grade_seconds": 855 + "oracle_grade_seconds": 316 }, { "task": "log-brunn-minkowski", @@ -3548,7 +3594,7 @@ "packages": [], "grade_timeout_sec": 11905, "oracle_result": "accepted", - "oracle_grade_seconds": 898 + "oracle_grade_seconds": 432 }, { "task": "log-concave-query", @@ -3566,7 +3612,7 @@ "packages": [], "grade_timeout_sec": 13500, "oracle_result": "accepted", - "oracle_grade_seconds": 1278 + "oracle_grade_seconds": 1273 }, { "task": "log-kodaira-fiber-negative", @@ -3584,7 +3630,7 @@ "packages": [], "grade_timeout_sec": 10959, "oracle_result": "accepted", - "oracle_grade_seconds": 813 + "oracle_grade_seconds": 296 }, { "task": "mahler-conjecture", @@ -3602,7 +3648,7 @@ "packages": [], "grade_timeout_sec": 11696, "oracle_result": "accepted", - "oracle_grade_seconds": 968 + "oracle_grade_seconds": 514 }, { "task": "markov-type", @@ -3620,7 +3666,7 @@ "packages": [], "grade_timeout_sec": 11788, "oracle_result": "accepted", - "oracle_grade_seconds": 926 + "oracle_grade_seconds": 277 }, { "task": "mass-action", @@ -3638,7 +3684,7 @@ "packages": [], "grade_timeout_sec": 11095, "oracle_result": "accepted", - "oracle_grade_seconds": 751 + "oracle_grade_seconds": 255 }, { "task": "matching-affine-lift", @@ -3656,7 +3702,7 @@ "packages": [], "grade_timeout_sec": 11089, "oracle_result": "accepted", - "oracle_grade_seconds": 905 + "oracle_grade_seconds": 380 }, { "task": "matching-entropy", @@ -3674,7 +3720,7 @@ "packages": [], "grade_timeout_sec": 10941, "oracle_result": "accepted", - "oracle_grade_seconds": 607 + "oracle_grade_seconds": 156 }, { "task": "matching-entropy-bounds", @@ -3692,7 +3738,7 @@ "packages": [], "grade_timeout_sec": 11111, "oracle_result": "accepted", - "oracle_grade_seconds": 808 + "oracle_grade_seconds": 363 }, { "task": "matching-fpras", @@ -3710,7 +3756,7 @@ "packages": [], "grade_timeout_sec": 13582, "oracle_result": "accepted", - "oracle_grade_seconds": 1267 + "oracle_grade_seconds": 1243 }, { "task": "matching-psd", @@ -3728,7 +3774,7 @@ "packages": [], "grade_timeout_sec": 11066, "oracle_result": "accepted", - "oracle_grade_seconds": 855 + "oracle_grade_seconds": 382 }, { "task": "matrix-fields", @@ -3746,7 +3792,7 @@ "packages": [], "grade_timeout_sec": 21600, "oracle_result": "accepted", - "oracle_grade_seconds": 4564 + "oracle_grade_seconds": 4284 }, { "task": "matrix-removal", @@ -3764,7 +3810,7 @@ "packages": [], "grade_timeout_sec": 11090, "oracle_result": "accepted", - "oracle_grade_seconds": 710 + "oracle_grade_seconds": 215 }, { "task": "matroid-prophet", @@ -3782,7 +3828,7 @@ "packages": [], "grade_timeout_sec": 11399, "oracle_result": "accepted", - "oracle_grade_seconds": 745 + "oracle_grade_seconds": 310 }, { "task": "matroid-secretary", @@ -3802,7 +3848,7 @@ "packages": [], "grade_timeout_sec": 11857, "oracle_result": "accepted", - "oracle_grade_seconds": 973 + "oracle_grade_seconds": 478 }, { "task": "maximal-seshadri-constants", @@ -3820,7 +3866,7 @@ "packages": [], "grade_timeout_sec": 13044, "oracle_result": "accepted", - "oracle_grade_seconds": 2446 + "oracle_grade_seconds": 2150 }, { "task": "memory-precision", @@ -3838,7 +3884,7 @@ "packages": [], "grade_timeout_sec": 11502, "oracle_result": "accepted", - "oracle_grade_seconds": 957 + "oracle_grade_seconds": 420 }, { "task": "metric-entropy-duality", @@ -3856,7 +3902,7 @@ "packages": [], "grade_timeout_sec": 11041, "oracle_result": "accepted", - "oracle_grade_seconds": 557 + "oracle_grade_seconds": 77 }, { "task": "metric-k-median", @@ -3874,7 +3920,7 @@ "packages": [], "grade_timeout_sec": 13032, "oracle_result": "accepted", - "oracle_grade_seconds": 1451 + "oracle_grade_seconds": 1760 }, { "task": "midpoint-lenses", @@ -3892,7 +3938,7 @@ "packages": [], "grade_timeout_sec": 10916, "oracle_result": "accepted", - "oracle_grade_seconds": 634 + "oracle_grade_seconds": 139 }, { "task": "min-uncut", @@ -3910,7 +3956,7 @@ "packages": [], "grade_timeout_sec": 16196, "oracle_result": "accepted", - "oracle_grade_seconds": 1335 + "oracle_grade_seconds": 1263 }, { "task": "nagata", @@ -3930,7 +3976,7 @@ "packages": [], "grade_timeout_sec": 12248, "oracle_result": "accepted", - "oracle_grade_seconds": 505 + "oracle_grade_seconds": 296 }, { "task": "naimark", @@ -3956,7 +4002,7 @@ "packages": [], "grade_timeout_sec": 11887, "oracle_result": "accepted", - "oracle_grade_seconds": 2857 + "oracle_grade_seconds": 2390 }, { "task": "navier-stokes-alternating", @@ -3974,7 +4020,7 @@ "packages": [], "grade_timeout_sec": 11147, "oracle_result": "accepted", - "oracle_grade_seconds": 874 + "oracle_grade_seconds": 471 }, { "task": "navier-stokes-velocity", @@ -3992,7 +4038,7 @@ "packages": [], "grade_timeout_sec": 11728, "oracle_result": "accepted", - "oracle_grade_seconds": 1274 + "oracle_grade_seconds": 925 }, { "task": "nodal-length", @@ -4010,7 +4056,7 @@ "packages": [], "grade_timeout_sec": 12135, "oracle_result": "accepted", - "oracle_grade_seconds": 1261 + "oracle_grade_seconds": 915 }, { "task": "noiseless-regression", @@ -4028,7 +4074,7 @@ "packages": [], "grade_timeout_sec": 10980, "oracle_result": "accepted", - "oracle_grade_seconds": 758 + "oracle_grade_seconds": 225 }, { "task": "odd-kaplansky", @@ -4046,7 +4092,7 @@ "packages": [], "grade_timeout_sec": 11549, "oracle_result": "accepted", - "oracle_grade_seconds": 1336 + "oracle_grade_seconds": 901 }, { "task": "one-way-liveness", @@ -4064,7 +4110,7 @@ "packages": [], "grade_timeout_sec": 10955, "oracle_result": "accepted", - "oracle_grade_seconds": 624 + "oracle_grade_seconds": 95 }, { "task": "optimal-max-cut", @@ -4082,7 +4128,7 @@ "packages": [], "grade_timeout_sec": 18776, "oracle_result": "accepted", - "oracle_grade_seconds": 1488 + "oracle_grade_seconds": 1492 }, { "task": "ordinary-elliott", @@ -4100,7 +4146,7 @@ "packages": [], "grade_timeout_sec": 13561, "oracle_result": "accepted", - "oracle_grade_seconds": 1590 + "oracle_grade_seconds": 2016 }, { "task": "parity-lifts", @@ -4118,7 +4164,7 @@ "packages": [], "grade_timeout_sec": 10962, "oracle_result": "accepted", - "oracle_grade_seconds": 839 + "oracle_grade_seconds": 137 }, { "task": "partial-permutation", @@ -4136,7 +4182,7 @@ "packages": [], "grade_timeout_sec": 11021, "oracle_result": "accepted", - "oracle_grade_seconds": 802 + "oracle_grade_seconds": 352 }, { "task": "partition-consistency", @@ -4154,7 +4200,7 @@ "packages": [], "grade_timeout_sec": 12151, "oracle_result": "accepted", - "oracle_grade_seconds": 823 + "oracle_grade_seconds": 344 }, { "task": "partition-principle", @@ -4172,7 +4218,7 @@ "packages": [], "grade_timeout_sec": 21600, "oracle_result": "accepted", - "oracle_grade_seconds": 2843 + "oracle_grade_seconds": 2875 }, { "task": "perceptron-free-energy", @@ -4190,7 +4236,7 @@ "packages": [], "grade_timeout_sec": 14271, "oracle_result": "accepted", - "oracle_grade_seconds": 1268 + "oracle_grade_seconds": 1308 }, { "task": "perfect-completeness", @@ -4208,7 +4254,7 @@ "packages": [], "grade_timeout_sec": 21600, "oracle_result": "accepted", - "oracle_grade_seconds": 2380 + "oracle_grade_seconds": 2718 }, { "task": "periodic-group", @@ -4226,7 +4272,7 @@ "packages": [], "grade_timeout_sec": 12417, "oracle_result": "accepted", - "oracle_grade_seconds": 1008 + "oracle_grade_seconds": 528 }, { "task": "periodic-tiling-three", @@ -4244,7 +4290,7 @@ "packages": [], "grade_timeout_sec": 11395, "oracle_result": "accepted", - "oracle_grade_seconds": 928 + "oracle_grade_seconds": 409 }, { "task": "permanent-cubic", @@ -4262,7 +4308,7 @@ "packages": [], "grade_timeout_sec": 11624, "oracle_result": "accepted", - "oracle_grade_seconds": 1031 + "oracle_grade_seconds": 591 }, { "task": "petty-projection-volume", @@ -4280,7 +4326,7 @@ "packages": [], "grade_timeout_sec": 11396, "oracle_result": "accepted", - "oracle_grade_seconds": 979 + "oracle_grade_seconds": 459 }, { "task": "pi-exponent", @@ -4298,7 +4344,7 @@ "packages": [], "grade_timeout_sec": 14689, "oracle_result": "accepted", - "oracle_grade_seconds": 2882 + "oracle_grade_seconds": 2846 }, { "task": "pinched-kahler", @@ -4318,7 +4364,7 @@ "packages": [], "grade_timeout_sec": 11629, "oracle_result": "accepted", - "oracle_grade_seconds": 1351 + "oracle_grade_seconds": 909 }, { "task": "pinned-distances", @@ -4336,7 +4382,7 @@ "packages": [], "grade_timeout_sec": 11465, "oracle_result": "accepted", - "oracle_grade_seconds": 926 + "oracle_grade_seconds": 467 }, { "task": "planar-anderson-spectrum", @@ -4354,7 +4400,7 @@ "packages": [], "grade_timeout_sec": 10831, "oracle_result": "accepted", - "oracle_grade_seconds": 582 + "oracle_grade_seconds": 96 }, { "task": "planar-falconer", @@ -4372,7 +4418,7 @@ "packages": [], "grade_timeout_sec": 13176, "oracle_result": "accepted", - "oracle_grade_seconds": 1803 + "oracle_grade_seconds": 1590 }, { "task": "planar-first-passage", @@ -4390,7 +4436,7 @@ "packages": [], "grade_timeout_sec": 11568, "oracle_result": "accepted", - "oracle_grade_seconds": 768 + "oracle_grade_seconds": 462 }, { "task": "planar-l1", @@ -4408,7 +4454,7 @@ "packages": [], "grade_timeout_sec": 12210, "oracle_result": "accepted", - "oracle_grade_seconds": 713 + "oracle_grade_seconds": 421 }, { "task": "planar-unit-distances", @@ -4426,7 +4472,7 @@ "packages": [], "grade_timeout_sec": 12010, "oracle_result": "accepted", - "oracle_grade_seconds": 1123 + "oracle_grade_seconds": 513 }, { "task": "plane-coloring", @@ -4444,7 +4490,7 @@ "packages": [], "grade_timeout_sec": 10816, "oracle_result": "accepted", - "oracle_grade_seconds": 677 + "oracle_grade_seconds": 99 }, { "task": "posterior-replicas", @@ -4462,7 +4508,7 @@ "packages": [], "grade_timeout_sec": 11444, "oracle_result": "accepted", - "oracle_grade_seconds": 1090 + "oracle_grade_seconds": 621 }, { "task": "power-free-values", @@ -4480,7 +4526,7 @@ "packages": [], "grade_timeout_sec": 11824, "oracle_result": "accepted", - "oracle_grade_seconds": 1054 + "oracle_grade_seconds": 692 }, { "task": "prime-gaps", @@ -4498,7 +4544,7 @@ "packages": [], "grade_timeout_sec": 11777, "oracle_result": "accepted", - "oracle_grade_seconds": 727 + "oracle_grade_seconds": 560 }, { "task": "product-brown", @@ -4516,7 +4562,7 @@ "packages": [], "grade_timeout_sec": 11878, "oracle_result": "accepted", - "oracle_grade_seconds": 853 + "oracle_grade_seconds": 889 }, { "task": "projection-counterexample", @@ -4534,7 +4580,7 @@ "packages": [], "grade_timeout_sec": 10918, "oracle_result": "accepted", - "oracle_grade_seconds": 576 + "oracle_grade_seconds": 142 }, { "task": "projection-moments", @@ -4552,7 +4598,7 @@ "packages": [], "grade_timeout_sec": 11263, "oracle_result": "accepted", - "oracle_grade_seconds": 919 + "oracle_grade_seconds": 343 }, { "task": "projection-volume", @@ -4570,7 +4616,7 @@ "packages": [], "grade_timeout_sec": 10915, "oracle_result": "accepted", - "oracle_grade_seconds": 601 + "oracle_grade_seconds": 182 }, { "task": "qac-parity", @@ -4588,7 +4634,7 @@ "packages": [], "grade_timeout_sec": 10937, "oracle_result": "accepted", - "oracle_grade_seconds": 693 + "oracle_grade_seconds": 171 }, { "task": "quadric-bundles", @@ -4606,7 +4652,7 @@ "packages": [], "grade_timeout_sec": 11343, "oracle_result": "accepted", - "oracle_grade_seconds": 886 + "oracle_grade_seconds": 408 }, { "task": "quantitative-van-der-waerden", @@ -4624,7 +4670,7 @@ "packages": [], "grade_timeout_sec": 11378, "oracle_result": "accepted", - "oracle_grade_seconds": 811 + "oracle_grade_seconds": 170 }, { "task": "quintic-lienard", @@ -4642,7 +4688,7 @@ "packages": [], "grade_timeout_sec": 11534, "oracle_result": "accepted", - "oracle_grade_seconds": 1484 + "oracle_grade_seconds": 829 }, { "task": "radial-density-interval", @@ -4660,7 +4706,7 @@ "packages": [], "grade_timeout_sec": 11428, "oracle_result": "accepted", - "oracle_grade_seconds": 1163 + "oracle_grade_seconds": 678 }, { "task": "radial-transition", @@ -4678,7 +4724,25 @@ "packages": [], "grade_timeout_sec": 11423, "oracle_result": "accepted", - "oracle_grade_seconds": 1222 + "oracle_grade_seconds": 888 + }, + { + "task": "ramsey-five", + "challenge": "RamseyFive", + "family": "170", + "family_title": "Sharp logarithmic exponents for off-diagonal Ramsey numbers", + "subject": "Combinatorics", + "theorems": [ + "OAI.SharpRamseyFive.main" + ], + "definition_holes": [], + "fixed_definitions": [], + "n_modules": 482, + "bytes": 3634776, + "packages": [], + "grade_timeout_sec": 14071, + "oracle_result": "accepted", + "oracle_grade_seconds": 2034 }, { "task": "randomized-mean-payoff", @@ -4696,7 +4760,7 @@ "packages": [], "grade_timeout_sec": 11970, "oracle_result": "accepted", - "oracle_grade_seconds": 1082 + "oracle_grade_seconds": 809 }, { "task": "rational-hitting", @@ -4714,7 +4778,7 @@ "packages": [], "grade_timeout_sec": 11430, "oracle_result": "accepted", - "oracle_grade_seconds": 666 + "oracle_grade_seconds": 472 }, { "task": "real-l1-renorming", @@ -4732,7 +4796,7 @@ "packages": [], "grade_timeout_sec": 10961, "oracle_result": "accepted", - "oracle_grade_seconds": 304 + "oracle_grade_seconds": 172 }, { "task": "recursive-potentials", @@ -4750,7 +4814,7 @@ "packages": [], "grade_timeout_sec": 11201, "oracle_result": "accepted", - "oracle_grade_seconds": 617 + "oracle_grade_seconds": 218 }, { "task": "reflexive-fixed-points", @@ -4768,7 +4832,7 @@ "packages": [], "grade_timeout_sec": 11232, "oracle_result": "accepted", - "oracle_grade_seconds": 664 + "oracle_grade_seconds": 221 }, { "task": "regular-parity", @@ -4786,7 +4850,7 @@ "packages": [], "grade_timeout_sec": 10938, "oracle_result": "accepted", - "oracle_grade_seconds": 623 + "oracle_grade_seconds": 185 }, { "task": "relative-generation", @@ -4804,7 +4868,7 @@ "packages": [], "grade_timeout_sec": 12350, "oracle_result": "accepted", - "oracle_grade_seconds": 3956 + "oracle_grade_seconds": 2953 }, { "task": "rokhlin", @@ -4827,7 +4891,7 @@ "packages": [], "grade_timeout_sec": 12066, "oracle_result": "accepted", - "oracle_grade_seconds": 1397 + "oracle_grade_seconds": 627 }, { "task": "ruled-covering", @@ -4845,7 +4909,7 @@ "packages": [], "grade_timeout_sec": 10976, "oracle_result": "accepted", - "oracle_grade_seconds": 963 + "oracle_grade_seconds": 265 }, { "task": "ryser-covering", @@ -4863,7 +4927,7 @@ "packages": [], "grade_timeout_sec": 11816, "oracle_result": "accepted", - "oracle_grade_seconds": 702 + "oracle_grade_seconds": 355 }, { "task": "ryser-odd-extensions", @@ -4881,7 +4945,25 @@ "packages": [], "grade_timeout_sec": 11826, "oracle_result": "accepted", - "oracle_grade_seconds": 649 + "oracle_grade_seconds": 205 + }, + { + "task": "sat-computability", + "challenge": "SATComputability", + "family": "235", + "family_title": "Random-SAT thresholds, sharp variance and computability", + "subject": "Probability and statistical mechanics", + "theorems": [ + "OAI.FixedClauseThreshold.Computability.main" + ], + "definition_holes": [], + "fixed_definitions": [], + "n_modules": 592, + "bytes": 4186949, + "packages": [], + "grade_timeout_sec": 14568, + "oracle_result": "accepted", + "oracle_grade_seconds": 1515 }, { "task": "sat-sharpness", @@ -4899,7 +4981,7 @@ "packages": [], "grade_timeout_sec": 11013, "oracle_result": "accepted", - "oracle_grade_seconds": 561 + "oracle_grade_seconds": 167 }, { "task": "sat-variance", @@ -4917,7 +4999,25 @@ "packages": [], "grade_timeout_sec": 11069, "oracle_result": "accepted", - "oracle_grade_seconds": 700 + "oracle_grade_seconds": 245 + }, + { + "task": "sk-barriers", + "challenge": "SKBarriers", + "family": "227", + "family_title": "The dynamical phase transition in the Sherrington\u2013Kirkpatrick model", + "subject": "Probability and statistical mechanics", + "theorems": [ + "OAI.SK.main" + ], + "definition_holes": [], + "fixed_definitions": [], + "n_modules": 574, + "bytes": 2610000, + "packages": [], + "grade_timeout_sec": 13149, + "oracle_result": "accepted", + "oracle_grade_seconds": 1847 }, { "task": "sk-full-support", @@ -4935,7 +5035,43 @@ "packages": [], "grade_timeout_sec": 11690, "oracle_result": "accepted", - "oracle_grade_seconds": 964 + "oracle_grade_seconds": 656 + }, + { + "task": "sk-high-temperature", + "challenge": "SKHighTemperature", + "family": "227", + "family_title": "The dynamical phase transition in the Sherrington\u2013Kirkpatrick model", + "subject": "Probability and statistical mechanics", + "theorems": [ + "OAI.SKGap.sk_main" + ], + "definition_holes": [], + "fixed_definitions": [], + "n_modules": 556, + "bytes": 4702297, + "packages": [], + "grade_timeout_sec": 15032, + "oracle_result": "accepted", + "oracle_grade_seconds": 2268 + }, + { + "task": "sk-ratio", + "challenge": "SKRatio", + "family": "227", + "family_title": "The dynamical phase transition in the Sherrington\u2013Kirkpatrick model", + "subject": "Probability and statistical mechanics", + "theorems": [ + "OAI.SKRatio.ratio_cutoff" + ], + "definition_holes": [], + "fixed_definitions": [], + "n_modules": 260, + "bytes": 2087158, + "packages": [], + "grade_timeout_sec": 12678, + "oracle_result": "accepted", + "oracle_grade_seconds": 7778 }, { "task": "sk-value", @@ -4953,7 +5089,7 @@ "packages": [], "grade_timeout_sec": 12139, "oracle_result": "accepted", - "oracle_grade_seconds": 1378 + "oracle_grade_seconds": 650 }, { "task": "sle-lower-positivity", @@ -4971,7 +5107,7 @@ "packages": [], "grade_timeout_sec": 12837, "oracle_result": "accepted", - "oracle_grade_seconds": 1070 + "oracle_grade_seconds": 527 }, { "task": "saxl", @@ -4989,7 +5125,7 @@ "packages": [], "grade_timeout_sec": 11089, "oracle_result": "accepted", - "oracle_grade_seconds": 943 + "oracle_grade_seconds": 504 }, { "task": "second-kahn-kalai", @@ -5007,7 +5143,7 @@ "packages": [], "grade_timeout_sec": 11059, "oracle_result": "accepted", - "oracle_grade_seconds": 573 + "oracle_grade_seconds": 76 }, { "task": "self-similar", @@ -5025,7 +5161,7 @@ "packages": [], "grade_timeout_sec": 11271, "oracle_result": "accepted", - "oracle_grade_seconds": 832 + "oracle_grade_seconds": 382 }, { "task": "self-similar-corollaries", @@ -5044,7 +5180,7 @@ "packages": [], "grade_timeout_sec": 11303, "oracle_result": "accepted", - "oracle_grade_seconds": 1090 + "oracle_grade_seconds": 399 }, { "task": "sensitivity-separation", @@ -5062,7 +5198,7 @@ "packages": [], "grade_timeout_sec": 10943, "oracle_result": "accepted", - "oracle_grade_seconds": 787 + "oracle_grade_seconds": 133 }, { "task": "separable-quotient-negative", @@ -5080,7 +5216,7 @@ "packages": [], "grade_timeout_sec": 11402, "oracle_result": "accepted", - "oracle_grade_seconds": 974 + "oracle_grade_seconds": 545 }, { "task": "seymour-second-neighborhood", @@ -5098,7 +5234,7 @@ "packages": [], "grade_timeout_sec": 10971, "oracle_result": "accepted", - "oracle_grade_seconds": 649 + "oracle_grade_seconds": 59 }, { "task": "sharp-cat0-filling", @@ -5116,7 +5252,25 @@ "packages": [], "grade_timeout_sec": 12896, "oracle_result": "accepted", - "oracle_grade_seconds": 1201 + "oracle_grade_seconds": 1023 + }, + { + "task": "sharp-log-ramsey", + "challenge": "SharpLogRamsey", + "family": "170", + "family_title": "Sharp logarithmic exponents for off-diagonal Ramsey numbers", + "subject": "Combinatorics", + "theorems": [ + "OAI.SharpLogRamsey.main" + ], + "definition_holes": [], + "fixed_definitions": [], + "n_modules": 408, + "bytes": 2902698, + "packages": [], + "grade_timeout_sec": 13412, + "oracle_result": "accepted", + "oracle_grade_seconds": 1307 }, { "task": "sharp-threshold", @@ -5134,7 +5288,7 @@ "packages": [], "grade_timeout_sec": 11082, "oracle_result": "accepted", - "oracle_grade_seconds": 662 + "oracle_grade_seconds": 221 }, { "task": "short-egyptian-fractions", @@ -5152,7 +5306,7 @@ "packages": [], "grade_timeout_sec": 11145, "oracle_result": "accepted", - "oracle_grade_seconds": 818 + "oracle_grade_seconds": 357 }, { "task": "sidorenko-counterexample", @@ -5170,7 +5324,7 @@ "packages": [], "grade_timeout_sec": 11895, "oracle_result": "accepted", - "oracle_grade_seconds": 1285 + "oracle_grade_seconds": 837 }, { "task": "signed-finite-band", @@ -5188,7 +5342,7 @@ "packages": [], "grade_timeout_sec": 11557, "oracle_result": "accepted", - "oracle_grade_seconds": 785 + "oracle_grade_seconds": 376 }, { "task": "signed-sweep-moment", @@ -5206,7 +5360,43 @@ "packages": [], "grade_timeout_sec": 11878, "oracle_result": "accepted", - "oracle_grade_seconds": 1266 + "oracle_grade_seconds": 796 + }, + { + "task": "simple-amenable", + "challenge": "SimpleAmenable", + "family": "253", + "family_title": "An infinite finitely presented simple amenable group", + "subject": "Group theory", + "theorems": [ + "OAI.SimpleAmenable.main" + ], + "definition_holes": [], + "fixed_definitions": [], + "n_modules": 550, + "bytes": 3943717, + "packages": [], + "grade_timeout_sec": 14349, + "oracle_result": "accepted", + "oracle_grade_seconds": 1969 + }, + { + "task": "simple-overgroups", + "challenge": "SimpleOvergroups", + "family": "250", + "family_title": "The Boone\u2013Higman conjecture and higher finiteness", + "subject": "Group theory", + "theorems": [ + "OAI.SimpleFInftyOvergroups.main" + ], + "definition_holes": [], + "fixed_definitions": [], + "n_modules": 238, + "bytes": 4013491, + "packages": [], + "grade_timeout_sec": 14412, + "oracle_result": "accepted", + "oracle_grade_seconds": 1221 }, { "task": "single-fold", @@ -5224,7 +5414,7 @@ "packages": [], "grade_timeout_sec": 11103, "oracle_result": "accepted", - "oracle_grade_seconds": 851 + "oracle_grade_seconds": 344 }, { "task": "single-lattice-covering", @@ -5242,7 +5432,7 @@ "packages": [], "grade_timeout_sec": 11831, "oracle_result": "accepted", - "oracle_grade_seconds": 1015 + "oracle_grade_seconds": 519 }, { "task": "singleton-loop-matching", @@ -5260,7 +5450,7 @@ "packages": [], "grade_timeout_sec": 11447, "oracle_result": "accepted", - "oracle_grade_seconds": 1239 + "oracle_grade_seconds": 576 }, { "task": "smooth-initial-form", @@ -5278,7 +5468,7 @@ "packages": [], "grade_timeout_sec": 11061, "oracle_result": "accepted", - "oracle_grade_seconds": 852 + "oracle_grade_seconds": 334 }, { "task": "smooth-obstruction", @@ -5296,7 +5486,44 @@ "packages": [], "grade_timeout_sec": 12186, "oracle_result": "accepted", - "oracle_grade_seconds": 1158 + "oracle_grade_seconds": 472 + }, + { + "task": "smooth-yau", + "challenge": "SmoothYau", + "family": "350", + "family_title": "Yau's nodal conjecture: surfaces and counterexamples", + "subject": "Differential geometry", + "theorems": [ + "OAI.YauCounterexamples.sphere_three", + "OAI.YauCounterexamples.sphere_two_torus_two" + ], + "definition_holes": [], + "fixed_definitions": [], + "n_modules": 436, + "bytes": 4544098, + "packages": [], + "grade_timeout_sec": 14889, + "oracle_result": "accepted", + "oracle_grade_seconds": 1965 + }, + { + "task": "snaky-conditional", + "challenge": "SnakyConditional", + "family": "187", + "family_title": "Snaky in 21 Maker moves", + "subject": "Combinatorics", + "theorems": [ + "OAI.SnakyConditional.snaky_winning_strategy_with_legal_states" + ], + "definition_holes": [], + "fixed_definitions": [], + "n_modules": 209, + "bytes": 7279627, + "packages": [], + "grade_timeout_sec": 17351, + "oracle_result": "accepted", + "oracle_grade_seconds": 3069 }, { "task": "soft-channel204", @@ -5314,7 +5541,7 @@ "packages": [], "grade_timeout_sec": 11246, "oracle_result": "accepted", - "oracle_grade_seconds": 775 + "oracle_grade_seconds": 323 }, { "task": "solenoidal-sheet-programs", @@ -5332,7 +5559,7 @@ "packages": [], "grade_timeout_sec": 11065, "oracle_result": "accepted", - "oracle_grade_seconds": 690 + "oracle_grade_seconds": 244 }, { "task": "spherical-field", @@ -5350,7 +5577,7 @@ "packages": [], "grade_timeout_sec": 11928, "oracle_result": "accepted", - "oracle_grade_seconds": 1292 + "oracle_grade_seconds": 698 }, { "task": "split-tangent-integrability", @@ -5368,7 +5595,7 @@ "packages": [], "grade_timeout_sec": 11524, "oracle_result": "accepted", - "oracle_grade_seconds": 529 + "oracle_grade_seconds": 360 }, { "task": "square-difference", @@ -5386,7 +5613,7 @@ "packages": [], "grade_timeout_sec": 11792, "oracle_result": "accepted", - "oracle_grade_seconds": 978 + "oracle_grade_seconds": 524 }, { "task": "square-root-degree", @@ -5404,7 +5631,25 @@ "packages": [], "grade_timeout_sec": 10942, "oracle_result": "accepted", - "oracle_grade_seconds": 316 + "oracle_grade_seconds": 207 + }, + { + "task": "standard-map-components", + "challenge": "StandardMapComponents", + "family": "146", + "family_title": "Sinai's positive-entropy conjecture for the standard map", + "subject": "Dynamical systems and ergodic theory", + "theorems": [ + "OAI.StandardMapEntropy.main_components" + ], + "definition_holes": [], + "fixed_definitions": [], + "n_modules": 274, + "bytes": 2886579, + "packages": [], + "grade_timeout_sec": 13397, + "oracle_result": "accepted", + "oracle_grade_seconds": 1312 }, { "task": "standard-map-entropy", @@ -5422,7 +5667,7 @@ "packages": [], "grade_timeout_sec": 11988, "oracle_result": "accepted", - "oracle_grade_seconds": 1548 + "oracle_grade_seconds": 1510 }, { "task": "standard-map-lyapunov", @@ -5440,7 +5685,7 @@ "packages": [], "grade_timeout_sec": 12045, "oracle_result": "accepted", - "oracle_grade_seconds": 1561 + "oracle_grade_seconds": 1019 }, { "task": "steinitz-bergstrom", @@ -5458,7 +5703,7 @@ "packages": [], "grade_timeout_sec": 11444, "oracle_result": "accepted", - "oracle_grade_seconds": 875 + "oracle_grade_seconds": 440 }, { "task": "strict-means", @@ -5476,7 +5721,25 @@ "packages": [], "grade_timeout_sec": 11446, "oracle_result": "accepted", - "oracle_grade_seconds": 1180 + "oracle_grade_seconds": 845 + }, + { + "task": "strong-kadison-kastler", + "challenge": "StrongKadisonKastler", + "family": "289", + "family_title": "The strong Kadison\u2013Kastler conjecture", + "subject": "Operator algebras", + "theorems": [ + "OAI.KadisonKastler.universal_strong_stability" + ], + "definition_holes": [], + "fixed_definitions": [], + "n_modules": 2652, + "bytes": 14567629, + "packages": [], + "grade_timeout_sec": 21600, + "oracle_result": "accepted", + "oracle_grade_seconds": 10799 }, { "task": "strong-thin-tree", @@ -5494,7 +5757,7 @@ "packages": [], "grade_timeout_sec": 11497, "oracle_result": "accepted", - "oracle_grade_seconds": 974 + "oracle_grade_seconds": 487 }, { "task": "strongly-rayleigh-dpp", @@ -5517,7 +5780,7 @@ "packages": [], "grade_timeout_sec": 11261, "oracle_result": "accepted", - "oracle_grade_seconds": 889 + "oracle_grade_seconds": 364 }, { "task": "structural-crouzeix", @@ -5535,7 +5798,7 @@ "packages": [], "grade_timeout_sec": 11428, "oracle_result": "accepted", - "oracle_grade_seconds": 1228 + "oracle_grade_seconds": 546 }, { "task": "subpolynomial-lp", @@ -5553,7 +5816,7 @@ "packages": [], "grade_timeout_sec": 11132, "oracle_result": "accepted", - "oracle_grade_seconds": 893 + "oracle_grade_seconds": 381 }, { "task": "subsphere-current", @@ -5571,7 +5834,7 @@ "packages": [], "grade_timeout_sec": 11229, "oracle_result": "accepted", - "oracle_grade_seconds": 463 + "oracle_grade_seconds": 258 }, { "task": "superstring", @@ -5589,7 +5852,7 @@ "packages": [], "grade_timeout_sec": 11646, "oracle_result": "accepted", - "oracle_grade_seconds": 784 + "oracle_grade_seconds": 297 }, { "task": "switch-chain", @@ -5609,7 +5872,7 @@ "packages": [], "grade_timeout_sec": 11629, "oracle_result": "accepted", - "oracle_grade_seconds": 924 + "oracle_grade_seconds": 413 }, { "task": "symmetric-domains", @@ -5627,7 +5890,7 @@ "packages": [], "grade_timeout_sec": 12703, "oracle_result": "accepted", - "oracle_grade_seconds": 1307 + "oracle_grade_seconds": 1240 }, { "task": "symmetric-mahler-equality", @@ -5645,7 +5908,7 @@ "packages": [], "grade_timeout_sec": 11997, "oracle_result": "accepted", - "oracle_grade_seconds": 986 + "oracle_grade_seconds": 662 }, { "task": "symmetric-polar", @@ -5663,7 +5926,7 @@ "packages": [], "grade_timeout_sec": 11289, "oracle_result": "accepted", - "oracle_grade_seconds": 1068 + "oracle_grade_seconds": 686 }, { "task": "tachikawa", @@ -5681,7 +5944,7 @@ "packages": [], "grade_timeout_sec": 11938, "oracle_result": "accepted", - "oracle_grade_seconds": 1382 + "oracle_grade_seconds": 974 }, { "task": "talagrand-discrete-convexity", @@ -5699,7 +5962,7 @@ "packages": [], "grade_timeout_sec": 10956, "oracle_result": "accepted", - "oracle_grade_seconds": 439 + "oracle_grade_seconds": 72 }, { "task": "talagrand-expectation-threshold", @@ -5717,7 +5980,7 @@ "packages": [], "grade_timeout_sec": 10973, "oracle_result": "accepted", - "oracle_grade_seconds": 213 + "oracle_grade_seconds": 64 }, { "task": "thomason-model-structures", @@ -5736,7 +5999,7 @@ "packages": [], "grade_timeout_sec": 13387, "oracle_result": "accepted", - "oracle_grade_seconds": 1608 + "oracle_grade_seconds": 599 }, { "task": "thompson-nonamenability", @@ -5754,7 +6017,7 @@ "packages": [], "grade_timeout_sec": 11135, "oracle_result": "accepted", - "oracle_grade_seconds": 146 + "oracle_grade_seconds": 141 }, { "task": "thorp-first-reciprocal", @@ -5772,7 +6035,7 @@ "packages": [], "grade_timeout_sec": 11130, "oracle_result": "accepted", - "oracle_grade_seconds": 637 + "oracle_grade_seconds": 344 }, { "task": "thorp-remaining", @@ -5790,7 +6053,7 @@ "packages": [], "grade_timeout_sec": 12040, "oracle_result": "accepted", - "oracle_grade_seconds": 730 + "oracle_grade_seconds": 472 }, { "task": "thorp-routing", @@ -5808,7 +6071,7 @@ "packages": [], "grade_timeout_sec": 16723, "oracle_result": "accepted", - "oracle_grade_seconds": 1374 + "oracle_grade_seconds": 1031 }, { "task": "thorp-weighted-compatibility", @@ -5826,7 +6089,7 @@ "packages": [], "grade_timeout_sec": 10921, "oracle_result": "accepted", - "oracle_grade_seconds": 294 + "oracle_grade_seconds": 171 }, { "task": "three-machine", @@ -5844,7 +6107,7 @@ "packages": [], "grade_timeout_sec": 11566, "oracle_result": "accepted", - "oracle_grade_seconds": 467 + "oracle_grade_seconds": 338 }, { "task": "three-state-supercritical", @@ -5863,7 +6126,7 @@ "packages": [], "grade_timeout_sec": 11144, "oracle_result": "accepted", - "oracle_grade_seconds": 212 + "oracle_grade_seconds": 180 }, { "task": "three-state-tree-clauses", @@ -5882,7 +6145,7 @@ "packages": [], "grade_timeout_sec": 11145, "oracle_result": "accepted", - "oracle_grade_seconds": 204 + "oracle_grade_seconds": 328 }, { "task": "three-torus", @@ -5900,7 +6163,7 @@ "packages": [], "grade_timeout_sec": 12348, "oracle_result": "accepted", - "oracle_grade_seconds": 669 + "oracle_grade_seconds": 645 }, { "task": "tingley-sphere-isometry", @@ -5918,7 +6181,7 @@ "packages": [], "grade_timeout_sec": 11144, "oracle_result": "accepted", - "oracle_grade_seconds": 129 + "oracle_grade_seconds": 94 }, { "task": "torsion-free-hyperbolic", @@ -5936,7 +6199,7 @@ "packages": [], "grade_timeout_sec": 11233, "oracle_result": "accepted", - "oracle_grade_seconds": 289 + "oracle_grade_seconds": 216 }, { "task": "torsion-free-zero-divisors", @@ -5954,7 +6217,7 @@ "packages": [], "grade_timeout_sec": 12657, "oracle_result": "accepted", - "oracle_grade_seconds": 805 + "oracle_grade_seconds": 560 }, { "task": "trace-reconstruction", @@ -5974,7 +6237,7 @@ "packages": [], "grade_timeout_sec": 12269, "oracle_result": "accepted", - "oracle_grade_seconds": 415 + "oracle_grade_seconds": 316 }, { "task": "tree-edit", @@ -5992,7 +6255,7 @@ "packages": [], "grade_timeout_sec": 11018, "oracle_result": "accepted", - "oracle_grade_seconds": 202 + "oracle_grade_seconds": 167 }, { "task": "triangle-face", @@ -6010,7 +6273,7 @@ "packages": [], "grade_timeout_sec": 11093, "oracle_result": "accepted", - "oracle_grade_seconds": 216 + "oracle_grade_seconds": 174 }, { "task": "triangle-removal", @@ -6028,7 +6291,7 @@ "packages": [], "grade_timeout_sec": 12122, "oracle_result": "accepted", - "oracle_grade_seconds": 935 + "oracle_grade_seconds": 986 }, { "task": "triangular-covering", @@ -6046,7 +6309,7 @@ "packages": [], "grade_timeout_sec": 10886, "oracle_result": "accepted", - "oracle_grade_seconds": 203 + "oracle_grade_seconds": 140 }, { "task": "triangular-energy", @@ -6100,7 +6363,7 @@ "packages": [], "grade_timeout_sec": 11249, "oracle_result": "accepted", - "oracle_grade_seconds": 630 + "oracle_grade_seconds": 621 }, { "task": "truffet-counterexample", @@ -6118,7 +6381,7 @@ "packages": [], "grade_timeout_sec": 10809, "oracle_result": "accepted", - "oracle_grade_seconds": 68 + "oracle_grade_seconds": 46 }, { "task": "two-way-complementation", @@ -6136,7 +6399,7 @@ "packages": [], "grade_timeout_sec": 10973, "oracle_result": "accepted", - "oracle_grade_seconds": 96 + "oracle_grade_seconds": 106 }, { "task": "two-way-determinization", @@ -6154,7 +6417,7 @@ "packages": [], "grade_timeout_sec": 11140, "oracle_result": "accepted", - "oracle_grade_seconds": 197 + "oracle_grade_seconds": 137 }, { "task": "type-system-normalization", @@ -6172,7 +6435,7 @@ "packages": [], "grade_timeout_sec": 12221, "oracle_result": "accepted", - "oracle_grade_seconds": 186 + "oracle_grade_seconds": 187 }, { "task": "uniform-commutator", @@ -6208,7 +6471,7 @@ "packages": [], "grade_timeout_sec": 11462, "oracle_result": "accepted", - "oracle_grade_seconds": 520 + "oracle_grade_seconds": 534 }, { "task": "uniform-k-server", @@ -6244,7 +6507,7 @@ "packages": [], "grade_timeout_sec": 11239, "oracle_result": "accepted", - "oracle_grade_seconds": 470 + "oracle_grade_seconds": 392 }, { "task": "unique-games-theorem", @@ -6280,7 +6543,7 @@ "packages": [], "grade_timeout_sec": 11595, "oracle_result": "accepted", - "oracle_grade_seconds": 416 + "oracle_grade_seconds": 502 }, { "task": "variable-wl", @@ -6298,7 +6561,7 @@ "packages": [], "grade_timeout_sec": 11864, "oracle_result": "accepted", - "oracle_grade_seconds": 429 + "oracle_grade_seconds": 456 }, { "task": "velocity-hemisphere", @@ -6334,7 +6597,7 @@ "packages": [], "grade_timeout_sec": 12071, "oracle_result": "accepted", - "oracle_grade_seconds": 696 + "oracle_grade_seconds": 725 }, { "task": "vertex-cover", @@ -6389,7 +6652,7 @@ "packages": [], "grade_timeout_sec": 11488, "oracle_result": "accepted", - "oracle_grade_seconds": 529 + "oracle_grade_seconds": 358 }, { "task": "weak-hessian", @@ -6443,7 +6706,7 @@ "packages": [], "grade_timeout_sec": 11533, "oracle_result": "accepted", - "oracle_grade_seconds": 338 + "oracle_grade_seconds": 329 }, { "task": "weisfeiler-leman", @@ -6461,7 +6724,7 @@ "packages": [], "grade_timeout_sec": 11626, "oracle_result": "accepted", - "oracle_grade_seconds": 401 + "oracle_grade_seconds": 301 }, { "task": "witnessed-choice", @@ -6479,7 +6742,7 @@ "packages": [], "grade_timeout_sec": 11806, "oracle_result": "accepted", - "oracle_grade_seconds": 585 + "oracle_grade_seconds": 485 }, { "task": "yau-counterexample", @@ -6513,12 +6776,6 @@ "family": "347", "reason": "memory" }, - { - "task": "atomic-gaussian", - "challenge": "AtomicGaussian", - "family": "090", - "reason": "pending" - }, { "task": "catalan", "challenge": "Catalan", @@ -6535,13 +6792,13 @@ "task": "continuum-coulomb-hardness", "challenge": "ContinuumCoulombHardness", "family": "275", - "reason": "disk" + "reason": "memory" }, { "task": "cycle-clique-ramsey", "challenge": "CycleCliqueRamsey", "family": "189", - "reason": "pending" + "reason": "memory" }, { "task": "dirichlet-seven-eighths", @@ -6565,7 +6822,7 @@ "task": "erdos-reciprocal", "challenge": "ErdosReciprocal", "family": "159", - "reason": "disk" + "reason": "not completed" }, { "task": "hecke-seven-eighths", @@ -6573,12 +6830,6 @@ "family": "003", "reason": "missing-package" }, - { - "task": "invariant-ising", - "challenge": "InvariantIsing", - "family": "234", - "reason": "pending" - }, { "task": "jacobsthal", "challenge": "Jacobsthal", @@ -6601,13 +6852,13 @@ "task": "koebe-circle-domains", "challenge": "KoebeCircleDomains", "family": "071", - "reason": "disk" + "reason": "missing-package" }, { "task": "mub-six", "challenge": "MUBSix", "family": "266", - "reason": "pending" + "reason": "not completed" }, { "task": "matrix-multiplication", @@ -6637,7 +6888,7 @@ "task": "ostmann-complete", "challenge": "OstmannComplete", "family": "013", - "reason": "pending" + "reason": "missing-package" }, { "task": "ostmann-primes", @@ -6649,19 +6900,19 @@ "task": "patterson-first-moment", "challenge": "PattersonFirstMoment", "family": "023", - "reason": "disk" + "reason": "missing-package" }, { "task": "planar-packing", "challenge": "PlanarPacking", "family": "090", - "reason": "pending" + "reason": "memory" }, { "task": "polycyclic-recognition", "challenge": "PolycyclicRecognition", "family": "255", - "reason": "pending" + "reason": "missing-package" }, { "task": "quasi-riemann-hypothesis", @@ -6669,89 +6920,29 @@ "family": "003", "reason": "missing-package" }, - { - "task": "ramsey-five", - "challenge": "RamseyFive", - "family": "170", - "reason": "pending" - }, { "task": "riesz-quantitative", "challenge": "RieszQuantitative", "family": "081", "reason": "missing-package" }, - { - "task": "sat-computability", - "challenge": "SATComputability", - "family": "235", - "reason": "pending" - }, - { - "task": "sk-barriers", - "challenge": "SKBarriers", - "family": "227", - "reason": "pending" - }, - { - "task": "sk-high-temperature", - "challenge": "SKHighTemperature", - "family": "227", - "reason": "pending" - }, - { - "task": "sk-ratio", - "challenge": "SKRatio", - "family": "227", - "reason": "pending" - }, - { - "task": "sharp-log-ramsey", - "challenge": "SharpLogRamsey", - "family": "170", - "reason": "pending" - }, { "task": "siegel-zeros", "challenge": "SiegelZeros", "family": "003", "reason": "missing-package" }, - { - "task": "simple-amenable", - "challenge": "SimpleAmenable", - "family": "253", - "reason": "pending" - }, - { - "task": "simple-overgroups", - "challenge": "SimpleOvergroups", - "family": "250", - "reason": "pending" - }, - { - "task": "smooth-yau", - "challenge": "SmoothYau", - "family": "350", - "reason": "pending" - }, { "task": "snaky-certificate", "challenge": "SnakyCertificate", "family": "187", "reason": "memory" }, - { - "task": "snaky-conditional", - "challenge": "SnakyConditional", - "family": "187", - "reason": "pending" - }, { "task": "snaky-twenty-one", "challenge": "SnakyTwentyOne", "family": "187", - "reason": "pending" + "reason": "memory" }, { "task": "spin-angle", @@ -6759,29 +6950,17 @@ "family": "238", "reason": "definition-mismatch" }, - { - "task": "standard-map-components", - "challenge": "StandardMapComponents", - "family": "146", - "reason": "pending" - }, - { - "task": "strong-kadison-kastler", - "challenge": "StrongKadisonKastler", - "family": "289", - "reason": "pending" - }, { "task": "surface-immersion", "challenge": "SurfaceImmersion", "family": "333", - "reason": "pending" + "reason": "missing-package" }, { "task": "taming-compatibility", "challenge": "TamingCompatibility", "family": "342", - "reason": "pending" + "reason": "memory" }, { "task": "totient-asymptotic", diff --git a/manifest.parquet b/manifest.parquet index 7cab14642b886b502548d65e115b94623c02ad01..dd61f3ac92284af1a4b81704e50f5604775b42fb 100644 --- a/manifest.parquet +++ b/manifest.parquet @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3afe9e43520364a939417dd85aeec87f892c6c81fe54c6f9d0bb67650c4021d0 -size 44329 +oid sha256:5e4b47df11e93d77c06b8899337e1a0043f1193c9c5b18b19f0eecc9ee3acf94 +size 45681 diff --git a/registry.json b/registry.json index e3fa7bb98556660a648e5e3b594af1e1c2fc39e2..f8414fdfa289f7fee283cc0590f9ced5baca00f5 100644 --- a/registry.json +++ b/registry.json @@ -2,7 +2,7 @@ { "name": "openai-math", "version": "1.0", - "description": "355 Lean 4 theorem-proving tasks from openai/math, graded by Comparator in a separate sandbox.", + "description": "369 Lean 4 theorem-proving tasks from openai/math, graded by Comparator in a separate sandbox.", "tasks": [ { "name": "abhyankar-sathaye", @@ -32,6 +32,10 @@ "name": "asymptotically-minimal-littlewood", "path": "tasks/asymptotically-minimal-littlewood" }, + { + "name": "atomic-gaussian", + "path": "tasks/atomic-gaussian" + }, { "name": "auslander-reiten", "path": "tasks/auslander-reiten" @@ -664,6 +668,10 @@ "name": "interpolated-factors", "path": "tasks/interpolated-factors" }, + { + "name": "invariant-ising", + "path": "tasks/invariant-ising" + }, { "name": "irrational-rotation", "path": "tasks/irrational-rotation" @@ -1024,6 +1032,10 @@ "name": "radial-transition", "path": "tasks/radial-transition" }, + { + "name": "ramsey-five", + "path": "tasks/ramsey-five" + }, { "name": "randomized-mean-payoff", "path": "tasks/randomized-mean-payoff" @@ -1068,6 +1080,10 @@ "name": "ryser-odd-extensions", "path": "tasks/ryser-odd-extensions" }, + { + "name": "sat-computability", + "path": "tasks/sat-computability" + }, { "name": "sat-sharpness", "path": "tasks/sat-sharpness" @@ -1076,10 +1092,22 @@ "name": "sat-variance", "path": "tasks/sat-variance" }, + { + "name": "sk-barriers", + "path": "tasks/sk-barriers" + }, { "name": "sk-full-support", "path": "tasks/sk-full-support" }, + { + "name": "sk-high-temperature", + "path": "tasks/sk-high-temperature" + }, + { + "name": "sk-ratio", + "path": "tasks/sk-ratio" + }, { "name": "sk-value", "path": "tasks/sk-value" @@ -1120,6 +1148,10 @@ "name": "sharp-cat0-filling", "path": "tasks/sharp-cat0-filling" }, + { + "name": "sharp-log-ramsey", + "path": "tasks/sharp-log-ramsey" + }, { "name": "sharp-threshold", "path": "tasks/sharp-threshold" @@ -1140,6 +1172,14 @@ "name": "signed-sweep-moment", "path": "tasks/signed-sweep-moment" }, + { + "name": "simple-amenable", + "path": "tasks/simple-amenable" + }, + { + "name": "simple-overgroups", + "path": "tasks/simple-overgroups" + }, { "name": "single-fold", "path": "tasks/single-fold" @@ -1160,6 +1200,14 @@ "name": "smooth-obstruction", "path": "tasks/smooth-obstruction" }, + { + "name": "smooth-yau", + "path": "tasks/smooth-yau" + }, + { + "name": "snaky-conditional", + "path": "tasks/snaky-conditional" + }, { "name": "soft-channel204", "path": "tasks/soft-channel204" @@ -1184,6 +1232,10 @@ "name": "square-root-degree", "path": "tasks/square-root-degree" }, + { + "name": "standard-map-components", + "path": "tasks/standard-map-components" + }, { "name": "standard-map-entropy", "path": "tasks/standard-map-entropy" @@ -1200,6 +1252,10 @@ "name": "strict-means", "path": "tasks/strict-means" }, + { + "name": "strong-kadison-kastler", + "path": "tasks/strong-kadison-kastler" + }, { "name": "strong-thin-tree", "path": "tasks/strong-thin-tree" diff --git a/tasks/abhyankar-sathaye/task.toml b/tasks/abhyankar-sathaye/task.toml index 3b68e62f4686ddedaf29faae3aae57789ba0212d..785f32ed6dc7c1099a4be509f575e70badb90478 100644 --- a/tasks/abhyankar-sathaye/task.toml +++ b/tasks/abhyankar-sathaye/task.toml @@ -23,7 +23,7 @@ reference_modules = 15 reference_lean_bytes = 55824 reference_requires_packages = [] oracle_result = "accepted" -oracle_grade_seconds = 463 +oracle_grade_seconds = 47 difficulty = "research" [agent] diff --git a/tasks/abhyankar-sathaye/tests/grade.py b/tasks/abhyankar-sathaye/tests/grade.py index 9f4ee2489c3ce97bcc183d7695059602472bf911..95f89f56da7f59e7af65dcf71b8ef3792ee87399 100644 --- a/tasks/abhyankar-sathaye/tests/grade.py +++ b/tasks/abhyankar-sathaye/tests/grade.py @@ -35,6 +35,7 @@ import subprocess import sys import tarfile import tempfile +import threading import time from pathlib import Path @@ -46,6 +47,7 @@ RUN_ROOT = Path("/var/lib/oai-grade") GRADER = "grader" SUCCESS_LINE = "Your solution is okay!" GRADE_THREADS = "2" +SCRATCH_SWEEP_SEC = 15 # Lake and Comparator wording when a build process is killed for running out of memory. OOM_MARKERS = ("Lean exited with code 137", "Child exited with 137") @@ -240,6 +242,49 @@ def out_of_memory(out: str) -> bool: return any(m in out for m in OOM_MARKERS) +def out_of_disk(out: str) -> bool: + return "no space left on device" in out.lower() + + +# Run as the grader user by `empty_build_scratch`. argv: the .lake/build/ir directory. +EMPTY_SCRATCH = r""" +import os, sys +for dirpath, _, files in os.walk(sys.argv[1]): + for name in files: + if not name.endswith(".setup.json"): + continue + base = os.path.join(dirpath, name[:-len(".setup.json")]) + try: + # Lake writes X.c.hash once Lean, and leanir if the module needs it, are done with X; + # both read X.setup.json, so it may only be emptied after that. + if os.stat(base + ".c.hash").st_mtime < os.stat(base + ".setup.json").st_mtime: + continue + for path in (base + ".setup.json", base + ".c"): + if os.path.getsize(path): + os.truncate(path, 0) + except OSError: + pass +""" + + +def empty_build_scratch(run: Path, stop: threading.Event) -> None: + """Until ``stop`` is set, empty files Lake leaves in .lake/build/ir that grading never reads. + + For every module Lake writes a `.setup.json` (its imports with the path of every .olean they + pull in, about 5.5 MB with Mathlib) and the module compiled to C. Neither is used once the + module is built, and for proofs of 1,000-2,000 modules they filled the 10 GB disk before the + build finished. Lake keeps the recorded hashes, so emptied files do not trigger a rebuild. + This runs as the grader user, so it can touch nothing the build could not. + """ + ir = str(run / ".lake" / "build" / "ir") + while not stop.wait(SCRATCH_SWEEP_SEC): + try: + subprocess.run(["runuser", "-u", GRADER, "--", sys.executable, "-c", EMPTY_SCRATCH, ir], + capture_output=True, timeout=600) + except subprocess.TimeoutExpired: + pass + + def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> tuple[int | None, str]: env = { "PATH": f"{toolchain_bin()}:/usr/local/bin:/usr/bin:/bin", @@ -254,10 +299,17 @@ def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> "runuser", "-u", GRADER, "--", "env", "-i", *(f"{k}={v}" for k, v in env.items()), "lake", "env", "comparator", "config.json", ] - code, stdout, stderr = run_with_timeout( - cmd, cwd=run, timeout_sec=timeout_sec, - kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), - ) + stop = threading.Event() + sweeper = threading.Thread(target=empty_build_scratch, args=(run, stop), daemon=True) + sweeper.start() + try: + code, stdout, stderr = run_with_timeout( + cmd, cwd=run, timeout_sec=timeout_sec, + kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), + ) + finally: + stop.set() + sweeper.join() return code, stdout + "\n--- stderr ---\n" + stderr @@ -297,6 +349,8 @@ def classify(code: int | None, out: str) -> tuple[int | None, str]: if code is None: return 0, "timed out while building or checking the submission" tail = [l for l in out.splitlines() if l.strip() and "has local changes" not in l][-25:] + if out_of_disk(out): + return 0, "rejected: the build ran out of disk space (10 GB) | " + " | ".join(tail)[-3000:] if out_of_memory(out): return 0, "rejected: the build was killed, most likely out of memory (8 GB) | " + " | ".join(tail)[-3000:] return 0, "rejected: " + " | ".join(tail)[-4000:] @@ -311,6 +365,7 @@ def main() -> int: task = json.loads((TESTS / "task.json").read_text()) details: dict = {"task": task["challenge"], "started_at": time.time()} reward: int | None = None + log = "" try: RUN_ROOT.mkdir(mode=0o711, parents=True, exist_ok=True) deadline = time.time() + int(task["grade_timeout_sec"]) @@ -325,26 +380,33 @@ def main() -> int: # Two Lean processes in parallel can exceed 8 GB on a heavy module. Retry once with one, # in a fresh directory: the first attempt's .lake was written by the submission's own # build and must not be trusted for the challenge. + shutil.rmtree(run, ignore_errors=True) run = fresh_run(task) unpack_submission(run) code, out = run_comparator(run, int(deadline - time.time()), threads="1") log += "\n\n=== retried with one Lean process after running out of memory ===\n\n" + out kill_grader() details["retried_single_thread"] = True - (VERIFIER_DIR / "comparator.log").write_text(log) reward, details["reason"] = classify(code, out) details["comparator_exit"] = code except Rejected as exc: reward, details["reason"] = 0, f"rejected: {exc}" except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + except Exception as exc: + reward, details["reason"] = None, f"grading error: {type(exc).__name__}: {exc}" finally: try: kill_grader() except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + # Free the build before writing anything. A build that filled the disk would otherwise + # make these writes fail, and with no space left the sandbox cannot report that the + # verifier exited, so Harbor waits until its own timeout and records no verdict. + shutil.rmtree(RUN_ROOT, ignore_errors=True) details["reward"] = reward details["finished_at"] = time.time() + (VERIFIER_DIR / "comparator.log").write_text(log) (VERIFIER_DIR / "grading.json").write_text(json.dumps(details, indent=2)) print(json.dumps(details, indent=2)) if reward is not None: diff --git a/tasks/affine-bernstein/task.toml b/tasks/affine-bernstein/task.toml index 5295f6c1f1fe7389d5f53910a8cc8556abe438c8..5e61893faf32f66352cc85db9cf457f9a7a61f17 100644 --- a/tasks/affine-bernstein/task.toml +++ b/tasks/affine-bernstein/task.toml @@ -23,7 +23,7 @@ reference_modules = 322 reference_lean_bytes = 1998143 reference_requires_packages = [] oracle_result = "accepted" -oracle_grade_seconds = 1091 +oracle_grade_seconds = 1429 difficulty = "research" [agent] diff --git a/tasks/affine-bernstein/tests/grade.py b/tasks/affine-bernstein/tests/grade.py index 9f4ee2489c3ce97bcc183d7695059602472bf911..95f89f56da7f59e7af65dcf71b8ef3792ee87399 100644 --- a/tasks/affine-bernstein/tests/grade.py +++ b/tasks/affine-bernstein/tests/grade.py @@ -35,6 +35,7 @@ import subprocess import sys import tarfile import tempfile +import threading import time from pathlib import Path @@ -46,6 +47,7 @@ RUN_ROOT = Path("/var/lib/oai-grade") GRADER = "grader" SUCCESS_LINE = "Your solution is okay!" GRADE_THREADS = "2" +SCRATCH_SWEEP_SEC = 15 # Lake and Comparator wording when a build process is killed for running out of memory. OOM_MARKERS = ("Lean exited with code 137", "Child exited with 137") @@ -240,6 +242,49 @@ def out_of_memory(out: str) -> bool: return any(m in out for m in OOM_MARKERS) +def out_of_disk(out: str) -> bool: + return "no space left on device" in out.lower() + + +# Run as the grader user by `empty_build_scratch`. argv: the .lake/build/ir directory. +EMPTY_SCRATCH = r""" +import os, sys +for dirpath, _, files in os.walk(sys.argv[1]): + for name in files: + if not name.endswith(".setup.json"): + continue + base = os.path.join(dirpath, name[:-len(".setup.json")]) + try: + # Lake writes X.c.hash once Lean, and leanir if the module needs it, are done with X; + # both read X.setup.json, so it may only be emptied after that. + if os.stat(base + ".c.hash").st_mtime < os.stat(base + ".setup.json").st_mtime: + continue + for path in (base + ".setup.json", base + ".c"): + if os.path.getsize(path): + os.truncate(path, 0) + except OSError: + pass +""" + + +def empty_build_scratch(run: Path, stop: threading.Event) -> None: + """Until ``stop`` is set, empty files Lake leaves in .lake/build/ir that grading never reads. + + For every module Lake writes a `.setup.json` (its imports with the path of every .olean they + pull in, about 5.5 MB with Mathlib) and the module compiled to C. Neither is used once the + module is built, and for proofs of 1,000-2,000 modules they filled the 10 GB disk before the + build finished. Lake keeps the recorded hashes, so emptied files do not trigger a rebuild. + This runs as the grader user, so it can touch nothing the build could not. + """ + ir = str(run / ".lake" / "build" / "ir") + while not stop.wait(SCRATCH_SWEEP_SEC): + try: + subprocess.run(["runuser", "-u", GRADER, "--", sys.executable, "-c", EMPTY_SCRATCH, ir], + capture_output=True, timeout=600) + except subprocess.TimeoutExpired: + pass + + def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> tuple[int | None, str]: env = { "PATH": f"{toolchain_bin()}:/usr/local/bin:/usr/bin:/bin", @@ -254,10 +299,17 @@ def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> "runuser", "-u", GRADER, "--", "env", "-i", *(f"{k}={v}" for k, v in env.items()), "lake", "env", "comparator", "config.json", ] - code, stdout, stderr = run_with_timeout( - cmd, cwd=run, timeout_sec=timeout_sec, - kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), - ) + stop = threading.Event() + sweeper = threading.Thread(target=empty_build_scratch, args=(run, stop), daemon=True) + sweeper.start() + try: + code, stdout, stderr = run_with_timeout( + cmd, cwd=run, timeout_sec=timeout_sec, + kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), + ) + finally: + stop.set() + sweeper.join() return code, stdout + "\n--- stderr ---\n" + stderr @@ -297,6 +349,8 @@ def classify(code: int | None, out: str) -> tuple[int | None, str]: if code is None: return 0, "timed out while building or checking the submission" tail = [l for l in out.splitlines() if l.strip() and "has local changes" not in l][-25:] + if out_of_disk(out): + return 0, "rejected: the build ran out of disk space (10 GB) | " + " | ".join(tail)[-3000:] if out_of_memory(out): return 0, "rejected: the build was killed, most likely out of memory (8 GB) | " + " | ".join(tail)[-3000:] return 0, "rejected: " + " | ".join(tail)[-4000:] @@ -311,6 +365,7 @@ def main() -> int: task = json.loads((TESTS / "task.json").read_text()) details: dict = {"task": task["challenge"], "started_at": time.time()} reward: int | None = None + log = "" try: RUN_ROOT.mkdir(mode=0o711, parents=True, exist_ok=True) deadline = time.time() + int(task["grade_timeout_sec"]) @@ -325,26 +380,33 @@ def main() -> int: # Two Lean processes in parallel can exceed 8 GB on a heavy module. Retry once with one, # in a fresh directory: the first attempt's .lake was written by the submission's own # build and must not be trusted for the challenge. + shutil.rmtree(run, ignore_errors=True) run = fresh_run(task) unpack_submission(run) code, out = run_comparator(run, int(deadline - time.time()), threads="1") log += "\n\n=== retried with one Lean process after running out of memory ===\n\n" + out kill_grader() details["retried_single_thread"] = True - (VERIFIER_DIR / "comparator.log").write_text(log) reward, details["reason"] = classify(code, out) details["comparator_exit"] = code except Rejected as exc: reward, details["reason"] = 0, f"rejected: {exc}" except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + except Exception as exc: + reward, details["reason"] = None, f"grading error: {type(exc).__name__}: {exc}" finally: try: kill_grader() except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + # Free the build before writing anything. A build that filled the disk would otherwise + # make these writes fail, and with no space left the sandbox cannot report that the + # verifier exited, so Harbor waits until its own timeout and records no verdict. + shutil.rmtree(RUN_ROOT, ignore_errors=True) details["reward"] = reward details["finished_at"] = time.time() + (VERIFIER_DIR / "comparator.log").write_text(log) (VERIFIER_DIR / "grading.json").write_text(json.dumps(details, indent=2)) print(json.dumps(details, indent=2)) if reward is not None: diff --git a/tasks/algorithmic-thin-trees/task.toml b/tasks/algorithmic-thin-trees/task.toml index fa5b93b5b749e59beb5be3a2de94d6f8e46ab513..adc6d53158ab595ce2197c519d41d2a6a3d83b11 100644 --- a/tasks/algorithmic-thin-trees/task.toml +++ b/tasks/algorithmic-thin-trees/task.toml @@ -23,7 +23,7 @@ reference_modules = 736 reference_lean_bytes = 4556988 reference_requires_packages = [] oracle_result = "accepted" -oracle_grade_seconds = 2906 +oracle_grade_seconds = 2392 difficulty = "research" [agent] diff --git a/tasks/algorithmic-thin-trees/tests/grade.py b/tasks/algorithmic-thin-trees/tests/grade.py index 9f4ee2489c3ce97bcc183d7695059602472bf911..95f89f56da7f59e7af65dcf71b8ef3792ee87399 100644 --- a/tasks/algorithmic-thin-trees/tests/grade.py +++ b/tasks/algorithmic-thin-trees/tests/grade.py @@ -35,6 +35,7 @@ import subprocess import sys import tarfile import tempfile +import threading import time from pathlib import Path @@ -46,6 +47,7 @@ RUN_ROOT = Path("/var/lib/oai-grade") GRADER = "grader" SUCCESS_LINE = "Your solution is okay!" GRADE_THREADS = "2" +SCRATCH_SWEEP_SEC = 15 # Lake and Comparator wording when a build process is killed for running out of memory. OOM_MARKERS = ("Lean exited with code 137", "Child exited with 137") @@ -240,6 +242,49 @@ def out_of_memory(out: str) -> bool: return any(m in out for m in OOM_MARKERS) +def out_of_disk(out: str) -> bool: + return "no space left on device" in out.lower() + + +# Run as the grader user by `empty_build_scratch`. argv: the .lake/build/ir directory. +EMPTY_SCRATCH = r""" +import os, sys +for dirpath, _, files in os.walk(sys.argv[1]): + for name in files: + if not name.endswith(".setup.json"): + continue + base = os.path.join(dirpath, name[:-len(".setup.json")]) + try: + # Lake writes X.c.hash once Lean, and leanir if the module needs it, are done with X; + # both read X.setup.json, so it may only be emptied after that. + if os.stat(base + ".c.hash").st_mtime < os.stat(base + ".setup.json").st_mtime: + continue + for path in (base + ".setup.json", base + ".c"): + if os.path.getsize(path): + os.truncate(path, 0) + except OSError: + pass +""" + + +def empty_build_scratch(run: Path, stop: threading.Event) -> None: + """Until ``stop`` is set, empty files Lake leaves in .lake/build/ir that grading never reads. + + For every module Lake writes a `.setup.json` (its imports with the path of every .olean they + pull in, about 5.5 MB with Mathlib) and the module compiled to C. Neither is used once the + module is built, and for proofs of 1,000-2,000 modules they filled the 10 GB disk before the + build finished. Lake keeps the recorded hashes, so emptied files do not trigger a rebuild. + This runs as the grader user, so it can touch nothing the build could not. + """ + ir = str(run / ".lake" / "build" / "ir") + while not stop.wait(SCRATCH_SWEEP_SEC): + try: + subprocess.run(["runuser", "-u", GRADER, "--", sys.executable, "-c", EMPTY_SCRATCH, ir], + capture_output=True, timeout=600) + except subprocess.TimeoutExpired: + pass + + def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> tuple[int | None, str]: env = { "PATH": f"{toolchain_bin()}:/usr/local/bin:/usr/bin:/bin", @@ -254,10 +299,17 @@ def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> "runuser", "-u", GRADER, "--", "env", "-i", *(f"{k}={v}" for k, v in env.items()), "lake", "env", "comparator", "config.json", ] - code, stdout, stderr = run_with_timeout( - cmd, cwd=run, timeout_sec=timeout_sec, - kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), - ) + stop = threading.Event() + sweeper = threading.Thread(target=empty_build_scratch, args=(run, stop), daemon=True) + sweeper.start() + try: + code, stdout, stderr = run_with_timeout( + cmd, cwd=run, timeout_sec=timeout_sec, + kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), + ) + finally: + stop.set() + sweeper.join() return code, stdout + "\n--- stderr ---\n" + stderr @@ -297,6 +349,8 @@ def classify(code: int | None, out: str) -> tuple[int | None, str]: if code is None: return 0, "timed out while building or checking the submission" tail = [l for l in out.splitlines() if l.strip() and "has local changes" not in l][-25:] + if out_of_disk(out): + return 0, "rejected: the build ran out of disk space (10 GB) | " + " | ".join(tail)[-3000:] if out_of_memory(out): return 0, "rejected: the build was killed, most likely out of memory (8 GB) | " + " | ".join(tail)[-3000:] return 0, "rejected: " + " | ".join(tail)[-4000:] @@ -311,6 +365,7 @@ def main() -> int: task = json.loads((TESTS / "task.json").read_text()) details: dict = {"task": task["challenge"], "started_at": time.time()} reward: int | None = None + log = "" try: RUN_ROOT.mkdir(mode=0o711, parents=True, exist_ok=True) deadline = time.time() + int(task["grade_timeout_sec"]) @@ -325,26 +380,33 @@ def main() -> int: # Two Lean processes in parallel can exceed 8 GB on a heavy module. Retry once with one, # in a fresh directory: the first attempt's .lake was written by the submission's own # build and must not be trusted for the challenge. + shutil.rmtree(run, ignore_errors=True) run = fresh_run(task) unpack_submission(run) code, out = run_comparator(run, int(deadline - time.time()), threads="1") log += "\n\n=== retried with one Lean process after running out of memory ===\n\n" + out kill_grader() details["retried_single_thread"] = True - (VERIFIER_DIR / "comparator.log").write_text(log) reward, details["reason"] = classify(code, out) details["comparator_exit"] = code except Rejected as exc: reward, details["reason"] = 0, f"rejected: {exc}" except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + except Exception as exc: + reward, details["reason"] = None, f"grading error: {type(exc).__name__}: {exc}" finally: try: kill_grader() except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + # Free the build before writing anything. A build that filled the disk would otherwise + # make these writes fail, and with no space left the sandbox cannot report that the + # verifier exited, so Harbor waits until its own timeout and records no verdict. + shutil.rmtree(RUN_ROOT, ignore_errors=True) details["reward"] = reward details["finished_at"] = time.time() + (VERIFIER_DIR / "comparator.log").write_text(log) (VERIFIER_DIR / "grading.json").write_text(json.dumps(details, indent=2)) print(json.dumps(details, indent=2)) if reward is not None: diff --git a/tasks/amplitude-damping/task.toml b/tasks/amplitude-damping/task.toml index 7bc55f1ee5b2ed7419a34a684089e374aa4cb420..90874f7ccba3e07a331485887ad9d6e085379ac5 100644 --- a/tasks/amplitude-damping/task.toml +++ b/tasks/amplitude-damping/task.toml @@ -23,7 +23,7 @@ reference_modules = 35 reference_lean_bytes = 283452 reference_requires_packages = [] oracle_result = "accepted" -oracle_grade_seconds = 1119 +oracle_grade_seconds = 432 difficulty = "research" [agent] diff --git a/tasks/amplitude-damping/tests/grade.py b/tasks/amplitude-damping/tests/grade.py index 9f4ee2489c3ce97bcc183d7695059602472bf911..95f89f56da7f59e7af65dcf71b8ef3792ee87399 100644 --- a/tasks/amplitude-damping/tests/grade.py +++ b/tasks/amplitude-damping/tests/grade.py @@ -35,6 +35,7 @@ import subprocess import sys import tarfile import tempfile +import threading import time from pathlib import Path @@ -46,6 +47,7 @@ RUN_ROOT = Path("/var/lib/oai-grade") GRADER = "grader" SUCCESS_LINE = "Your solution is okay!" GRADE_THREADS = "2" +SCRATCH_SWEEP_SEC = 15 # Lake and Comparator wording when a build process is killed for running out of memory. OOM_MARKERS = ("Lean exited with code 137", "Child exited with 137") @@ -240,6 +242,49 @@ def out_of_memory(out: str) -> bool: return any(m in out for m in OOM_MARKERS) +def out_of_disk(out: str) -> bool: + return "no space left on device" in out.lower() + + +# Run as the grader user by `empty_build_scratch`. argv: the .lake/build/ir directory. +EMPTY_SCRATCH = r""" +import os, sys +for dirpath, _, files in os.walk(sys.argv[1]): + for name in files: + if not name.endswith(".setup.json"): + continue + base = os.path.join(dirpath, name[:-len(".setup.json")]) + try: + # Lake writes X.c.hash once Lean, and leanir if the module needs it, are done with X; + # both read X.setup.json, so it may only be emptied after that. + if os.stat(base + ".c.hash").st_mtime < os.stat(base + ".setup.json").st_mtime: + continue + for path in (base + ".setup.json", base + ".c"): + if os.path.getsize(path): + os.truncate(path, 0) + except OSError: + pass +""" + + +def empty_build_scratch(run: Path, stop: threading.Event) -> None: + """Until ``stop`` is set, empty files Lake leaves in .lake/build/ir that grading never reads. + + For every module Lake writes a `.setup.json` (its imports with the path of every .olean they + pull in, about 5.5 MB with Mathlib) and the module compiled to C. Neither is used once the + module is built, and for proofs of 1,000-2,000 modules they filled the 10 GB disk before the + build finished. Lake keeps the recorded hashes, so emptied files do not trigger a rebuild. + This runs as the grader user, so it can touch nothing the build could not. + """ + ir = str(run / ".lake" / "build" / "ir") + while not stop.wait(SCRATCH_SWEEP_SEC): + try: + subprocess.run(["runuser", "-u", GRADER, "--", sys.executable, "-c", EMPTY_SCRATCH, ir], + capture_output=True, timeout=600) + except subprocess.TimeoutExpired: + pass + + def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> tuple[int | None, str]: env = { "PATH": f"{toolchain_bin()}:/usr/local/bin:/usr/bin:/bin", @@ -254,10 +299,17 @@ def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> "runuser", "-u", GRADER, "--", "env", "-i", *(f"{k}={v}" for k, v in env.items()), "lake", "env", "comparator", "config.json", ] - code, stdout, stderr = run_with_timeout( - cmd, cwd=run, timeout_sec=timeout_sec, - kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), - ) + stop = threading.Event() + sweeper = threading.Thread(target=empty_build_scratch, args=(run, stop), daemon=True) + sweeper.start() + try: + code, stdout, stderr = run_with_timeout( + cmd, cwd=run, timeout_sec=timeout_sec, + kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), + ) + finally: + stop.set() + sweeper.join() return code, stdout + "\n--- stderr ---\n" + stderr @@ -297,6 +349,8 @@ def classify(code: int | None, out: str) -> tuple[int | None, str]: if code is None: return 0, "timed out while building or checking the submission" tail = [l for l in out.splitlines() if l.strip() and "has local changes" not in l][-25:] + if out_of_disk(out): + return 0, "rejected: the build ran out of disk space (10 GB) | " + " | ".join(tail)[-3000:] if out_of_memory(out): return 0, "rejected: the build was killed, most likely out of memory (8 GB) | " + " | ".join(tail)[-3000:] return 0, "rejected: " + " | ".join(tail)[-4000:] @@ -311,6 +365,7 @@ def main() -> int: task = json.loads((TESTS / "task.json").read_text()) details: dict = {"task": task["challenge"], "started_at": time.time()} reward: int | None = None + log = "" try: RUN_ROOT.mkdir(mode=0o711, parents=True, exist_ok=True) deadline = time.time() + int(task["grade_timeout_sec"]) @@ -325,26 +380,33 @@ def main() -> int: # Two Lean processes in parallel can exceed 8 GB on a heavy module. Retry once with one, # in a fresh directory: the first attempt's .lake was written by the submission's own # build and must not be trusted for the challenge. + shutil.rmtree(run, ignore_errors=True) run = fresh_run(task) unpack_submission(run) code, out = run_comparator(run, int(deadline - time.time()), threads="1") log += "\n\n=== retried with one Lean process after running out of memory ===\n\n" + out kill_grader() details["retried_single_thread"] = True - (VERIFIER_DIR / "comparator.log").write_text(log) reward, details["reason"] = classify(code, out) details["comparator_exit"] = code except Rejected as exc: reward, details["reason"] = 0, f"rejected: {exc}" except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + except Exception as exc: + reward, details["reason"] = None, f"grading error: {type(exc).__name__}: {exc}" finally: try: kill_grader() except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + # Free the build before writing anything. A build that filled the disk would otherwise + # make these writes fail, and with no space left the sandbox cannot report that the + # verifier exited, so Harbor waits until its own timeout and records no verdict. + shutil.rmtree(RUN_ROOT, ignore_errors=True) details["reward"] = reward details["finished_at"] = time.time() + (VERIFIER_DIR / "comparator.log").write_text(log) (VERIFIER_DIR / "grading.json").write_text(json.dumps(details, indent=2)) print(json.dumps(details, indent=2)) if reward is not None: diff --git a/tasks/artin-cat0/task.toml b/tasks/artin-cat0/task.toml index da64eb5d41d785287aafbfa77dca565ff591ee1f..e6e7b8f51af2625df8bdcfb23b0c214f408513d5 100644 --- a/tasks/artin-cat0/task.toml +++ b/tasks/artin-cat0/task.toml @@ -23,7 +23,7 @@ reference_modules = 20 reference_lean_bytes = 414894 reference_requires_packages = [] oracle_result = "accepted" -oracle_grade_seconds = 792 +oracle_grade_seconds = 193 difficulty = "research" [agent] diff --git a/tasks/artin-cat0/tests/grade.py b/tasks/artin-cat0/tests/grade.py index 9f4ee2489c3ce97bcc183d7695059602472bf911..95f89f56da7f59e7af65dcf71b8ef3792ee87399 100644 --- a/tasks/artin-cat0/tests/grade.py +++ b/tasks/artin-cat0/tests/grade.py @@ -35,6 +35,7 @@ import subprocess import sys import tarfile import tempfile +import threading import time from pathlib import Path @@ -46,6 +47,7 @@ RUN_ROOT = Path("/var/lib/oai-grade") GRADER = "grader" SUCCESS_LINE = "Your solution is okay!" GRADE_THREADS = "2" +SCRATCH_SWEEP_SEC = 15 # Lake and Comparator wording when a build process is killed for running out of memory. OOM_MARKERS = ("Lean exited with code 137", "Child exited with 137") @@ -240,6 +242,49 @@ def out_of_memory(out: str) -> bool: return any(m in out for m in OOM_MARKERS) +def out_of_disk(out: str) -> bool: + return "no space left on device" in out.lower() + + +# Run as the grader user by `empty_build_scratch`. argv: the .lake/build/ir directory. +EMPTY_SCRATCH = r""" +import os, sys +for dirpath, _, files in os.walk(sys.argv[1]): + for name in files: + if not name.endswith(".setup.json"): + continue + base = os.path.join(dirpath, name[:-len(".setup.json")]) + try: + # Lake writes X.c.hash once Lean, and leanir if the module needs it, are done with X; + # both read X.setup.json, so it may only be emptied after that. + if os.stat(base + ".c.hash").st_mtime < os.stat(base + ".setup.json").st_mtime: + continue + for path in (base + ".setup.json", base + ".c"): + if os.path.getsize(path): + os.truncate(path, 0) + except OSError: + pass +""" + + +def empty_build_scratch(run: Path, stop: threading.Event) -> None: + """Until ``stop`` is set, empty files Lake leaves in .lake/build/ir that grading never reads. + + For every module Lake writes a `.setup.json` (its imports with the path of every .olean they + pull in, about 5.5 MB with Mathlib) and the module compiled to C. Neither is used once the + module is built, and for proofs of 1,000-2,000 modules they filled the 10 GB disk before the + build finished. Lake keeps the recorded hashes, so emptied files do not trigger a rebuild. + This runs as the grader user, so it can touch nothing the build could not. + """ + ir = str(run / ".lake" / "build" / "ir") + while not stop.wait(SCRATCH_SWEEP_SEC): + try: + subprocess.run(["runuser", "-u", GRADER, "--", sys.executable, "-c", EMPTY_SCRATCH, ir], + capture_output=True, timeout=600) + except subprocess.TimeoutExpired: + pass + + def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> tuple[int | None, str]: env = { "PATH": f"{toolchain_bin()}:/usr/local/bin:/usr/bin:/bin", @@ -254,10 +299,17 @@ def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> "runuser", "-u", GRADER, "--", "env", "-i", *(f"{k}={v}" for k, v in env.items()), "lake", "env", "comparator", "config.json", ] - code, stdout, stderr = run_with_timeout( - cmd, cwd=run, timeout_sec=timeout_sec, - kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), - ) + stop = threading.Event() + sweeper = threading.Thread(target=empty_build_scratch, args=(run, stop), daemon=True) + sweeper.start() + try: + code, stdout, stderr = run_with_timeout( + cmd, cwd=run, timeout_sec=timeout_sec, + kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), + ) + finally: + stop.set() + sweeper.join() return code, stdout + "\n--- stderr ---\n" + stderr @@ -297,6 +349,8 @@ def classify(code: int | None, out: str) -> tuple[int | None, str]: if code is None: return 0, "timed out while building or checking the submission" tail = [l for l in out.splitlines() if l.strip() and "has local changes" not in l][-25:] + if out_of_disk(out): + return 0, "rejected: the build ran out of disk space (10 GB) | " + " | ".join(tail)[-3000:] if out_of_memory(out): return 0, "rejected: the build was killed, most likely out of memory (8 GB) | " + " | ".join(tail)[-3000:] return 0, "rejected: " + " | ".join(tail)[-4000:] @@ -311,6 +365,7 @@ def main() -> int: task = json.loads((TESTS / "task.json").read_text()) details: dict = {"task": task["challenge"], "started_at": time.time()} reward: int | None = None + log = "" try: RUN_ROOT.mkdir(mode=0o711, parents=True, exist_ok=True) deadline = time.time() + int(task["grade_timeout_sec"]) @@ -325,26 +380,33 @@ def main() -> int: # Two Lean processes in parallel can exceed 8 GB on a heavy module. Retry once with one, # in a fresh directory: the first attempt's .lake was written by the submission's own # build and must not be trusted for the challenge. + shutil.rmtree(run, ignore_errors=True) run = fresh_run(task) unpack_submission(run) code, out = run_comparator(run, int(deadline - time.time()), threads="1") log += "\n\n=== retried with one Lean process after running out of memory ===\n\n" + out kill_grader() details["retried_single_thread"] = True - (VERIFIER_DIR / "comparator.log").write_text(log) reward, details["reason"] = classify(code, out) details["comparator_exit"] = code except Rejected as exc: reward, details["reason"] = 0, f"rejected: {exc}" except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + except Exception as exc: + reward, details["reason"] = None, f"grading error: {type(exc).__name__}: {exc}" finally: try: kill_grader() except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + # Free the build before writing anything. A build that filled the disk would otherwise + # make these writes fail, and with no space left the sandbox cannot report that the + # verifier exited, so Harbor waits until its own timeout and records no verdict. + shutil.rmtree(RUN_ROOT, ignore_errors=True) details["reward"] = reward details["finished_at"] = time.time() + (VERIFIER_DIR / "comparator.log").write_text(log) (VERIFIER_DIR / "grading.json").write_text(json.dumps(details, indent=2)) print(json.dumps(details, indent=2)) if reward is not None: diff --git a/tasks/artin-parabolic-intersections/task.toml b/tasks/artin-parabolic-intersections/task.toml index 15a0fed7c7d27654a8ecb8042a6fab98e43ec13b..4d1a1b67986c1baf6064720b653f8fe0500b672c 100644 --- a/tasks/artin-parabolic-intersections/task.toml +++ b/tasks/artin-parabolic-intersections/task.toml @@ -23,7 +23,7 @@ reference_modules = 782 reference_lean_bytes = 3300665 reference_requires_packages = [] oracle_result = "accepted" -oracle_grade_seconds = 1711 +oracle_grade_seconds = 2200 difficulty = "research" [agent] diff --git a/tasks/artin-parabolic-intersections/tests/grade.py b/tasks/artin-parabolic-intersections/tests/grade.py index 9f4ee2489c3ce97bcc183d7695059602472bf911..95f89f56da7f59e7af65dcf71b8ef3792ee87399 100644 --- a/tasks/artin-parabolic-intersections/tests/grade.py +++ b/tasks/artin-parabolic-intersections/tests/grade.py @@ -35,6 +35,7 @@ import subprocess import sys import tarfile import tempfile +import threading import time from pathlib import Path @@ -46,6 +47,7 @@ RUN_ROOT = Path("/var/lib/oai-grade") GRADER = "grader" SUCCESS_LINE = "Your solution is okay!" GRADE_THREADS = "2" +SCRATCH_SWEEP_SEC = 15 # Lake and Comparator wording when a build process is killed for running out of memory. OOM_MARKERS = ("Lean exited with code 137", "Child exited with 137") @@ -240,6 +242,49 @@ def out_of_memory(out: str) -> bool: return any(m in out for m in OOM_MARKERS) +def out_of_disk(out: str) -> bool: + return "no space left on device" in out.lower() + + +# Run as the grader user by `empty_build_scratch`. argv: the .lake/build/ir directory. +EMPTY_SCRATCH = r""" +import os, sys +for dirpath, _, files in os.walk(sys.argv[1]): + for name in files: + if not name.endswith(".setup.json"): + continue + base = os.path.join(dirpath, name[:-len(".setup.json")]) + try: + # Lake writes X.c.hash once Lean, and leanir if the module needs it, are done with X; + # both read X.setup.json, so it may only be emptied after that. + if os.stat(base + ".c.hash").st_mtime < os.stat(base + ".setup.json").st_mtime: + continue + for path in (base + ".setup.json", base + ".c"): + if os.path.getsize(path): + os.truncate(path, 0) + except OSError: + pass +""" + + +def empty_build_scratch(run: Path, stop: threading.Event) -> None: + """Until ``stop`` is set, empty files Lake leaves in .lake/build/ir that grading never reads. + + For every module Lake writes a `.setup.json` (its imports with the path of every .olean they + pull in, about 5.5 MB with Mathlib) and the module compiled to C. Neither is used once the + module is built, and for proofs of 1,000-2,000 modules they filled the 10 GB disk before the + build finished. Lake keeps the recorded hashes, so emptied files do not trigger a rebuild. + This runs as the grader user, so it can touch nothing the build could not. + """ + ir = str(run / ".lake" / "build" / "ir") + while not stop.wait(SCRATCH_SWEEP_SEC): + try: + subprocess.run(["runuser", "-u", GRADER, "--", sys.executable, "-c", EMPTY_SCRATCH, ir], + capture_output=True, timeout=600) + except subprocess.TimeoutExpired: + pass + + def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> tuple[int | None, str]: env = { "PATH": f"{toolchain_bin()}:/usr/local/bin:/usr/bin:/bin", @@ -254,10 +299,17 @@ def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> "runuser", "-u", GRADER, "--", "env", "-i", *(f"{k}={v}" for k, v in env.items()), "lake", "env", "comparator", "config.json", ] - code, stdout, stderr = run_with_timeout( - cmd, cwd=run, timeout_sec=timeout_sec, - kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), - ) + stop = threading.Event() + sweeper = threading.Thread(target=empty_build_scratch, args=(run, stop), daemon=True) + sweeper.start() + try: + code, stdout, stderr = run_with_timeout( + cmd, cwd=run, timeout_sec=timeout_sec, + kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), + ) + finally: + stop.set() + sweeper.join() return code, stdout + "\n--- stderr ---\n" + stderr @@ -297,6 +349,8 @@ def classify(code: int | None, out: str) -> tuple[int | None, str]: if code is None: return 0, "timed out while building or checking the submission" tail = [l for l in out.splitlines() if l.strip() and "has local changes" not in l][-25:] + if out_of_disk(out): + return 0, "rejected: the build ran out of disk space (10 GB) | " + " | ".join(tail)[-3000:] if out_of_memory(out): return 0, "rejected: the build was killed, most likely out of memory (8 GB) | " + " | ".join(tail)[-3000:] return 0, "rejected: " + " | ".join(tail)[-4000:] @@ -311,6 +365,7 @@ def main() -> int: task = json.loads((TESTS / "task.json").read_text()) details: dict = {"task": task["challenge"], "started_at": time.time()} reward: int | None = None + log = "" try: RUN_ROOT.mkdir(mode=0o711, parents=True, exist_ok=True) deadline = time.time() + int(task["grade_timeout_sec"]) @@ -325,26 +380,33 @@ def main() -> int: # Two Lean processes in parallel can exceed 8 GB on a heavy module. Retry once with one, # in a fresh directory: the first attempt's .lake was written by the submission's own # build and must not be trusted for the challenge. + shutil.rmtree(run, ignore_errors=True) run = fresh_run(task) unpack_submission(run) code, out = run_comparator(run, int(deadline - time.time()), threads="1") log += "\n\n=== retried with one Lean process after running out of memory ===\n\n" + out kill_grader() details["retried_single_thread"] = True - (VERIFIER_DIR / "comparator.log").write_text(log) reward, details["reason"] = classify(code, out) details["comparator_exit"] = code except Rejected as exc: reward, details["reason"] = 0, f"rejected: {exc}" except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + except Exception as exc: + reward, details["reason"] = None, f"grading error: {type(exc).__name__}: {exc}" finally: try: kill_grader() except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + # Free the build before writing anything. A build that filled the disk would otherwise + # make these writes fail, and with no space left the sandbox cannot report that the + # verifier exited, so Harbor waits until its own timeout and records no verdict. + shutil.rmtree(RUN_ROOT, ignore_errors=True) details["reward"] = reward details["finished_at"] = time.time() + (VERIFIER_DIR / "comparator.log").write_text(log) (VERIFIER_DIR / "grading.json").write_text(json.dumps(details, indent=2)) print(json.dumps(details, indent=2)) if reward is not None: diff --git a/tasks/asymptotically-minimal-littlewood/task.toml b/tasks/asymptotically-minimal-littlewood/task.toml index 1be341ffaa9f39da7ebd4db8914a55e3b25b19c3..5c07789aec972fdec6219576ce0cc30a4377ed6a 100644 --- a/tasks/asymptotically-minimal-littlewood/task.toml +++ b/tasks/asymptotically-minimal-littlewood/task.toml @@ -23,7 +23,7 @@ reference_modules = 24 reference_lean_bytes = 432620 reference_requires_packages = [] oracle_result = "accepted" -oracle_grade_seconds = 919 +oracle_grade_seconds = 346 difficulty = "research" [agent] diff --git a/tasks/asymptotically-minimal-littlewood/tests/grade.py b/tasks/asymptotically-minimal-littlewood/tests/grade.py index 9f4ee2489c3ce97bcc183d7695059602472bf911..95f89f56da7f59e7af65dcf71b8ef3792ee87399 100644 --- a/tasks/asymptotically-minimal-littlewood/tests/grade.py +++ b/tasks/asymptotically-minimal-littlewood/tests/grade.py @@ -35,6 +35,7 @@ import subprocess import sys import tarfile import tempfile +import threading import time from pathlib import Path @@ -46,6 +47,7 @@ RUN_ROOT = Path("/var/lib/oai-grade") GRADER = "grader" SUCCESS_LINE = "Your solution is okay!" GRADE_THREADS = "2" +SCRATCH_SWEEP_SEC = 15 # Lake and Comparator wording when a build process is killed for running out of memory. OOM_MARKERS = ("Lean exited with code 137", "Child exited with 137") @@ -240,6 +242,49 @@ def out_of_memory(out: str) -> bool: return any(m in out for m in OOM_MARKERS) +def out_of_disk(out: str) -> bool: + return "no space left on device" in out.lower() + + +# Run as the grader user by `empty_build_scratch`. argv: the .lake/build/ir directory. +EMPTY_SCRATCH = r""" +import os, sys +for dirpath, _, files in os.walk(sys.argv[1]): + for name in files: + if not name.endswith(".setup.json"): + continue + base = os.path.join(dirpath, name[:-len(".setup.json")]) + try: + # Lake writes X.c.hash once Lean, and leanir if the module needs it, are done with X; + # both read X.setup.json, so it may only be emptied after that. + if os.stat(base + ".c.hash").st_mtime < os.stat(base + ".setup.json").st_mtime: + continue + for path in (base + ".setup.json", base + ".c"): + if os.path.getsize(path): + os.truncate(path, 0) + except OSError: + pass +""" + + +def empty_build_scratch(run: Path, stop: threading.Event) -> None: + """Until ``stop`` is set, empty files Lake leaves in .lake/build/ir that grading never reads. + + For every module Lake writes a `.setup.json` (its imports with the path of every .olean they + pull in, about 5.5 MB with Mathlib) and the module compiled to C. Neither is used once the + module is built, and for proofs of 1,000-2,000 modules they filled the 10 GB disk before the + build finished. Lake keeps the recorded hashes, so emptied files do not trigger a rebuild. + This runs as the grader user, so it can touch nothing the build could not. + """ + ir = str(run / ".lake" / "build" / "ir") + while not stop.wait(SCRATCH_SWEEP_SEC): + try: + subprocess.run(["runuser", "-u", GRADER, "--", sys.executable, "-c", EMPTY_SCRATCH, ir], + capture_output=True, timeout=600) + except subprocess.TimeoutExpired: + pass + + def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> tuple[int | None, str]: env = { "PATH": f"{toolchain_bin()}:/usr/local/bin:/usr/bin:/bin", @@ -254,10 +299,17 @@ def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> "runuser", "-u", GRADER, "--", "env", "-i", *(f"{k}={v}" for k, v in env.items()), "lake", "env", "comparator", "config.json", ] - code, stdout, stderr = run_with_timeout( - cmd, cwd=run, timeout_sec=timeout_sec, - kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), - ) + stop = threading.Event() + sweeper = threading.Thread(target=empty_build_scratch, args=(run, stop), daemon=True) + sweeper.start() + try: + code, stdout, stderr = run_with_timeout( + cmd, cwd=run, timeout_sec=timeout_sec, + kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), + ) + finally: + stop.set() + sweeper.join() return code, stdout + "\n--- stderr ---\n" + stderr @@ -297,6 +349,8 @@ def classify(code: int | None, out: str) -> tuple[int | None, str]: if code is None: return 0, "timed out while building or checking the submission" tail = [l for l in out.splitlines() if l.strip() and "has local changes" not in l][-25:] + if out_of_disk(out): + return 0, "rejected: the build ran out of disk space (10 GB) | " + " | ".join(tail)[-3000:] if out_of_memory(out): return 0, "rejected: the build was killed, most likely out of memory (8 GB) | " + " | ".join(tail)[-3000:] return 0, "rejected: " + " | ".join(tail)[-4000:] @@ -311,6 +365,7 @@ def main() -> int: task = json.loads((TESTS / "task.json").read_text()) details: dict = {"task": task["challenge"], "started_at": time.time()} reward: int | None = None + log = "" try: RUN_ROOT.mkdir(mode=0o711, parents=True, exist_ok=True) deadline = time.time() + int(task["grade_timeout_sec"]) @@ -325,26 +380,33 @@ def main() -> int: # Two Lean processes in parallel can exceed 8 GB on a heavy module. Retry once with one, # in a fresh directory: the first attempt's .lake was written by the submission's own # build and must not be trusted for the challenge. + shutil.rmtree(run, ignore_errors=True) run = fresh_run(task) unpack_submission(run) code, out = run_comparator(run, int(deadline - time.time()), threads="1") log += "\n\n=== retried with one Lean process after running out of memory ===\n\n" + out kill_grader() details["retried_single_thread"] = True - (VERIFIER_DIR / "comparator.log").write_text(log) reward, details["reason"] = classify(code, out) details["comparator_exit"] = code except Rejected as exc: reward, details["reason"] = 0, f"rejected: {exc}" except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + except Exception as exc: + reward, details["reason"] = None, f"grading error: {type(exc).__name__}: {exc}" finally: try: kill_grader() except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + # Free the build before writing anything. A build that filled the disk would otherwise + # make these writes fail, and with no space left the sandbox cannot report that the + # verifier exited, so Harbor waits until its own timeout and records no verdict. + shutil.rmtree(RUN_ROOT, ignore_errors=True) details["reward"] = reward details["finished_at"] = time.time() + (VERIFIER_DIR / "comparator.log").write_text(log) (VERIFIER_DIR / "grading.json").write_text(json.dumps(details, indent=2)) print(json.dumps(details, indent=2)) if reward is not None: diff --git a/tasks/atomic-gaussian/environment/Dockerfile b/tasks/atomic-gaussian/environment/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..aa57529d28879aaf8f823eaf61743b87a7bb8310 --- /dev/null +++ b/tasks/atomic-gaussian/environment/Dockerfile @@ -0,0 +1,8 @@ +# Shared by every openai/math task (agent and separate verifier). See lean_setup.sh. +FROM ubuntu:24.04 +ENV ELAN_HOME=/opt/elan \ + PATH=/opt/elan/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ + LANG=C.UTF-8 +COPY lean_setup.sh fetch_mathlib.sh lakefile.lean lake-manifest.json pack_submission.py /opt/build/ +RUN bash /opt/build/lean_setup.sh +WORKDIR /workspace diff --git a/tasks/atomic-gaussian/environment/fetch_mathlib.sh b/tasks/atomic-gaussian/environment/fetch_mathlib.sh new file mode 100644 index 0000000000000000000000000000000000000000..1cc7232e51d27e7b0d9e0b136da9632d889f9c55 --- /dev/null +++ b/tasks/atomic-gaussian/environment/fetch_mathlib.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +# Unpack Mathlib's prebuilt cache in batches and truncate the files that importing Mathlib never +# reads (generated C and .ilean editor indexes), keeping their .hash files so Lake still sees every +# module as built. Lean + full Mathlib otherwise needs ~11 GB, more than a 10 GB sandbox disk. +set -euo pipefail +cd /opt/lean-env +trim() { + find .lake/packages -path '*/.lake/build/*' \( -name '*.c' -o -name '*.ilean' \) -size +0 -exec truncate -s 0 {} + + rm -rf "${HOME:-/root}/.cache/mathlib" +} +for dir in .lake/packages/mathlib/Mathlib/*/; do + name=$(basename "$dir") + echo "== Mathlib/$name" + lake exe cache get ".lake/packages/mathlib/Mathlib/$name" >/dev/null + trim + df -h / | tail -1 +done +lake exe cache get +trim diff --git a/tasks/atomic-gaussian/environment/lake-manifest.json b/tasks/atomic-gaussian/environment/lake-manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..99b5eaa62153fd75dd2a9b1abdfac3738e914c88 --- /dev/null +++ b/tasks/atomic-gaussian/environment/lake-manifest.json @@ -0,0 +1,116 @@ +{ + "version": "1.2.0", + "packagesDir": ".lake/packages", + "packages": [ + { + "url": "https://github.com/leanprover-community/mathlib4.git", + "type": "git", + "subDir": null, + "scope": "", + "rev": "d13f23b723b8a846827a245b89c10fc7d3f11612", + "name": "mathlib", + "manifestFile": "lake-manifest.json", + "inputRev": "d13f23b723b8a846827a245b89c10fc7d3f11612", + "inherited": false, + "configFile": "lakefile.lean" + }, + { + "url": "https://github.com/leanprover-community/plausible", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "118aa17ee84656b8bd727fef7c458ee8c833385c", + "name": "plausible", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "url": "https://github.com/leanprover-community/LeanSearchClient", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "ddf04cf3949fa556442341e87d47f9f6e6074707", + "name": "LeanSearchClient", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "url": "https://github.com/leanprover-community/import-graph", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "e928b72544873815af278d38681b31c0293588e3", + "name": "importGraph", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "url": "https://github.com/leanprover-community/ProofWidgets4", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "106ff4fafc74ef4ac99d81dbf3ab399118f497a5", + "name": "proofwidgets", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.lean" + }, + { + "url": "https://github.com/leanprover-community/aesop", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "355695d523e41d0554926416cba2a2b3544fbbc9", + "name": "aesop", + "manifestFile": "lake-manifest.json", + "inputRev": "master", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "url": "https://github.com/leanprover-community/quote4", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "6a489d9af5d0c47e5b259e2e8bcdfc1811b5a259", + "name": "Qq", + "manifestFile": "lake-manifest.json", + "inputRev": "master", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "url": "https://github.com/leanprover-community/batteries", + "type": "git", + "subDir": null, + "scope": "leanprover-community", + "rev": "f2effa3d803fda822b1f97b806c47cf2adfbcbc2", + "name": "batteries", + "manifestFile": "lake-manifest.json", + "inputRev": "main", + "inherited": true, + "configFile": "lakefile.toml" + }, + { + "url": "https://github.com/leanprover/lean4-cli", + "type": "git", + "subDir": null, + "scope": "leanprover", + "rev": "e92c9f15fdfacc8536f31cfb3b7ad26c3c8cd204", + "name": "Cli", + "manifestFile": "lake-manifest.json", + "inputRev": "v4.34.0", + "inherited": true, + "configFile": "lakefile.toml" + } + ], + "name": "openai_math", + "lakeDir": ".lake" +} \ No newline at end of file diff --git a/tasks/atomic-gaussian/environment/lakefile.lean b/tasks/atomic-gaussian/environment/lakefile.lean new file mode 100644 index 0000000000000000000000000000000000000000..0330e313d8613d18833b17d46138a44a23269a68 --- /dev/null +++ b/tasks/atomic-gaussian/environment/lakefile.lean @@ -0,0 +1,12 @@ +import Lake +open Lake DSL + +-- Mathlib at the commit openai/math pins. Agents write `Submission.lean` and `Submission/**.lean`. +package openai_math where + leanOptions := #[⟨`autoImplicit, false⟩] + +require mathlib from git + "https://github.com/leanprover-community/mathlib4.git" @ "d13f23b723b8a846827a245b89c10fc7d3f11612" + +-- `Submission` and every `Submission.*` module it imports. +lean_lib Submission diff --git a/tasks/atomic-gaussian/environment/lean_setup.sh b/tasks/atomic-gaussian/environment/lean_setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..5a6a070b2935a67d97d15a2b4bde73baea197533 --- /dev/null +++ b/tasks/atomic-gaussian/environment/lean_setup.sh @@ -0,0 +1,126 @@ +#!/usr/bin/env bash +# Builds the image shared by every openai/math task, for both the agent and the separate verifier: +# - Lean v4.34.1 and Mathlib d13f23b, the versions openai/math pins (Mathlib only, no OAI library) +# - Comparator, lean4export and landrun, used only by the verifier's grade.py +# - every challenge statement, at /opt/openai-math/challenges/.lean +# - /workspace, a Lake project where the agent writes Submission.lean +# All revisions are pinned. The openai/math library (the reference proofs) is never installed. +set -euxo pipefail +export DEBIAN_FRONTEND=noninteractive + +LEAN_TOOLCHAIN=leanprover/lean4:v4.34.1 +OPENAI_MATH_REV=adc7f1241b42e322a6451854ab7e4b4c146bf78a +COMPARATOR_REV=d03acab154d269c06e60e4de7e4cc85deebff94b # "bump toolchain to v4.34.0"; built with v4.34.1 +LANDRUN_REV=811cfff51ceaf3d9843708aa6d22e9b84ccac8b4 +GO_VERSION=1.24.7 + +apt-get update -qq +apt-get install -y -qq --no-install-recommends git curl ca-certificates build-essential xz-utils \ + zstd python3 procps iproute2 iptables tmux >/dev/null +rm -rf /var/lib/apt/lists/* +git config --system --add safe.directory '*' + +export ELAN_HOME=/opt/elan PATH=/opt/elan/bin:$PATH +curl -sSfL https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh \ + | sh -s -- -y --default-toolchain "$LEAN_TOOLCHAIN" --no-modify-path + +# --- Verifier tools, built before Mathlib so the build trees are gone before the big download --- +curl -sSfL "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" | tar -C /tmp -xz +GOBIN=/usr/local/bin GOPATH=/tmp/gopath GOCACHE=/tmp/gocache \ + /tmp/go/bin/go install "github.com/zouuup/landrun/cmd/landrun@${LANDRUN_REV}" +rm -rf /tmp/go /tmp/gopath /tmp/gocache + +git clone -q https://github.com/leanprover/comparator.git /tmp/comparator +( + cd /tmp/comparator + git checkout -q "$COMPARATOR_REV" + # Comparator passes only PATH/HOME/LEAN_ABORT_ON_PANIC into its landrun sandbox. Also pass + # LEAN_NUM_THREADS: Lean sees every host CPU (64) rather than the sandbox's 4, so without it Lake + # starts one Mathlib-loaded `lean` per module and an 8 GB sandbox runs out of memory. It bounds + # parallelism only and does not affect what is checked. + sed -i 's/envPass := #\["PATH", "HOME", "LEAN_ABORT_ON_PANIC"\]/envPass := #["PATH", "HOME", "LEAN_ABORT_ON_PANIC", "LEAN_NUM_THREADS"]/; s/envPass := #\["PATH", "HOME", "LEAN_PATH", "LEAN_ABORT_ON_PANIC"\]/envPass := #["PATH", "HOME", "LEAN_PATH", "LEAN_ABORT_ON_PANIC", "LEAN_NUM_THREADS"]/' Main.lean + test "$(grep -c '"LEAN_NUM_THREADS"' Main.lean)" -eq 2 + echo "$LEAN_TOOLCHAIN" > lean-toolchain + lake build lean4export comparator + install -m 0755 .lake/build/bin/comparator /usr/local/bin/comparator + install -m 0755 .lake/packages/lean4export/.lake/build/bin/lean4export /usr/local/bin/lean4export +) +rm -rf /tmp/comparator + +# --- Lean project with Mathlib --- +# Packages are shallow clones at the manifest revisions, so Lake sees the right HEAD and never fetches. +mkdir -p /opt/lean-env/.lake/packages +cd /opt/lean-env +echo "$LEAN_TOOLCHAIN" > lean-toolchain +cp /opt/build/lakefile.lean /opt/build/lake-manifest.json . +python3 - <<'PY' +import json, subprocess +for p in json.load(open("lake-manifest.json"))["packages"]: + d = f".lake/packages/{p['name']}" + subprocess.run(["git", "init", "-q", d], check=True) + subprocess.run(["git", "-C", d, "remote", "add", "origin", p["url"]], check=True) + subprocess.run(["git", "-C", d, "fetch", "-q", "--depth", "1", "origin", p["rev"]], check=True) + subprocess.run(["git", "-C", d, "checkout", "-q", "FETCH_HEAD"], check=True) +PY +# Linking native executables (Comparator above, Mathlib's cache tool here) is the only use of the +# static libraries, LLVM and gcc; `lean` and `lake build` of a library need none of them. Dropping +# them before the Mathlib download keeps the build, and the image, under Daytona's 10 GB disk. +lake exe cache --help >/dev/null 2>&1 || true +find /opt/elan/toolchains/*/lib -name '*.a' -delete +rm -f /opt/elan/toolchains/*/lib/libLLVM* /opt/elan/toolchains/*/lib/libclang-cpp* +apt-get purge -y -qq $(dpkg-query -W -f '${binary:Package}\n' build-essential 'gcc-13*' 'g++-13*' \ + 'cpp-13*' 'libstdc++-13-dev*' 'libgcc-13-dev*' 2>/dev/null) >/dev/null || true +apt-get autoremove -y -qq >/dev/null || true +bash /opt/build/fetch_mathlib.sh +rm -f /opt/lean-env/.lake/packages/mathlib/.lake/build/bin/cache + +# --- Challenge statements (public; the reference proofs are not fetched) --- +git init -q /tmp/oai && cd /tmp/oai +git remote add origin https://github.com/openai/math.git +git config core.sparseCheckout true +echo "lean/ComparatorChallenges/" > .git/info/sparse-checkout +git fetch -q --depth 1 --filter=blob:none origin "$OPENAI_MATH_REV" +git checkout -q FETCH_HEAD +mkdir -p /opt/openai-math/challenges +cp lean/ComparatorChallenges/*.lean /opt/openai-math/challenges/ +cd / && rm -rf /tmp/oai +install -m 0755 /opt/build/pack_submission.py /opt/openai-math/pack_submission.py + +# --- Agent workspace and the verifier's unprivileged user --- +mkdir -p /workspace/.lake +cp /opt/lean-env/lakefile.lean /opt/lean-env/lake-manifest.json /opt/lean-env/lean-toolchain /workspace/ +ln -s /opt/lean-env/.lake/packages /workspace/.lake/packages +useradd --uid 2000 --create-home --shell /usr/sbin/nologin grader +mkdir -p /var/lib/oai-grade && chmod 0711 /var/lib/oai-grade + +# Smoke test. The first build may rebuild a few dependency modules the cache lacks (they persist in +# the image); a second build must compile nothing but Submission, or agents would pay for it. +cd /workspace +printf 'import Mathlib\n\nexample : (2 : ℕ) + 2 = 4 := by norm_num\n' > Submission.lean +lake build Submission 2>&1 | grep -E 'Built|error' | grep -v 'Built Submission' | head -20 || true +echo '-- second build' >> Submission.lean +lake build Submission 2>&1 | tee /tmp/smoke.log +if grep 'Built' /tmp/smoke.log | grep -qv 'Built Submission'; then + echo "the prebuilt Mathlib is incomplete: a second build still compiled dependencies" >&2; exit 1 +fi +rm -rf Submission.lean .lake/build /tmp/smoke.log + +# Mathlib's cache tool unpacks files as 0600. The verifier builds as the unprivileged `grader` user, +# so everything must be world-readable (and stays root-owned, so not writable). +chmod -R a+rX /opt/elan /opt/lean-env /opt/openai-math +# Same smoke test as `grader`, in a scratch project like the one grade.py lays out. +smoke=$(mktemp -d /var/lib/oai-grade/smoke.XXXX) +cp /opt/lean-env/lakefile.lean /opt/lean-env/lake-manifest.json /opt/lean-env/lean-toolchain "$smoke/" +mkdir "$smoke/.lake" && ln -s /opt/lean-env/.lake/packages "$smoke/.lake/packages" +printf 'import Mathlib\n\nexample : (2 : ℕ) + 2 = 4 := by norm_num\n' > "$smoke/Submission.lean" +chmod 0755 "$smoke" && chown grader "$smoke/.lake" +(cd "$smoke" && runuser -u grader -- env -i PATH="$(echo /opt/elan/toolchains/*/bin):/usr/bin:/bin" HOME="$smoke" \ + lake build Submission) 2>&1 | tee /tmp/smoke.log +if grep 'Built' /tmp/smoke.log | grep -qv 'Built Submission' || ! grep -q 'Build completed successfully' /tmp/smoke.log; then + echo "the grader user cannot build against the prebuilt Mathlib" >&2; exit 1 +fi +rm -rf "$smoke" /tmp/smoke.log + +rm -rf /opt/build /root/.cache +df -h / | tail -1 +du -sh /opt/elan /opt/lean-env diff --git a/tasks/atomic-gaussian/environment/pack_submission.py b/tasks/atomic-gaussian/environment/pack_submission.py new file mode 100644 index 0000000000000000000000000000000000000000..689dff39666b1453a328498760d185e309d9b99e --- /dev/null +++ b/tasks/atomic-gaussian/environment/pack_submission.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python3 +"""Pack the agent's proof into one file for the verifier. + +Harbor runs this as a [[verifier.collect]] hook in the agent's sandbox after the agent finishes. +It clears /logs/artifacts and writes /logs/artifacts/submission.tar holding only regular +`Submission.lean` and `Submission/**.lean` files. Symlinks and other entries are skipped, never +followed, so only one plain file crosses to the verifier sandbox. + +The agent's sandbox is untrusted, so the verifier re-checks every entry of the archive. This step +only keeps the transfer small and free of links. +""" + +from __future__ import annotations + +import os +import shutil +import stat +import tarfile +from pathlib import Path + +WORKSPACE = Path("/workspace") +OUT_DIR = Path("/logs/artifacts") +MAX_TOTAL_BYTES = 768 << 20 + + +def clear(directory: Path) -> None: + directory.mkdir(parents=True, exist_ok=True) + for entry in directory.iterdir(): + if entry.is_dir() and not entry.is_symlink(): + shutil.rmtree(entry) + else: + entry.unlink() + + +def regular(path: Path) -> bool: + try: + return stat.S_ISREG(path.lstat().st_mode) + except OSError: + return False + + +def main() -> None: + clear(OUT_DIR) + tmp = OUT_DIR / "submission.tar.part" + total = 0 + with tarfile.open(tmp, "w", format=tarfile.PAX_FORMAT) as tar: + root = WORKSPACE / "Submission.lean" + if regular(root): + total += root.lstat().st_size + if total > MAX_TOTAL_BYTES: + raise SystemExit("submission exceeds the size limit") + tar.add(root, arcname="Submission.lean", recursive=False) + tree = WORKSPACE / "Submission" + if tree.is_dir() and not tree.is_symlink(): + for dirpath, dirnames, filenames in os.walk(tree, followlinks=False): + dirnames[:] = [d for d in dirnames if not (Path(dirpath) / d).is_symlink()] + for name in sorted(filenames): + path = Path(dirpath) / name + if not name.endswith(".lean") or not regular(path): + continue + total += path.lstat().st_size + if total > MAX_TOTAL_BYTES: + raise SystemExit("submission exceeds the size limit") + tar.add(path, arcname=str(path.relative_to(WORKSPACE)), recursive=False) + tmp.rename(OUT_DIR / "submission.tar") + print(f"packed {total} bytes") + + +if __name__ == "__main__": + main() diff --git a/tasks/atomic-gaussian/instruction.md b/tasks/atomic-gaussian/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..cc4830e5f7311aa5ffb67a2bac04f1aa17bb5790 --- /dev/null +++ b/tasks/atomic-gaussian/instruction.md @@ -0,0 +1,303 @@ +# openai/math challenge `AtomicGaussian` (family 090) + +Prove the following result from OpenAI's [openai/math](https://github.com/openai/math) release in +Lean 4, with a proof the Lean kernel accepts. + +Context: this statement belongs to family 090 of the release, *Universal optimality of the triangular lattice* +(Convex and metric geometry). The family as a whole: Proves that the triangular lattice minimizes the lower limit of energy per particle for every nonnegative completely monotone potential of squared distance among locally finite planar configurations of centered-disk density one. It also minimizes unit-background renormalized Riesz energies for $0 (f x : ℂ)) w + +end AtomicTriangular + +namespace AtomicTriangular.Construction + +def b : ℝ := Real.sqrt 3 / 2 + +def h : ℝ := 17 / 50 + +def H : ℝ := 27 / 50 + +def eta : ℝ := 1 / 5 + +def kappa : ℝ := Real.pi / 36 + +def residues : Finset ℤ := {0,1,3,4,7,9,12,13,16,19,21,25,27,28,31} + +def residue (a : Fin 15) : ℤ := ![0,1,3,4,7,9,12,13,16,19,21,25,27,28,31] a + +def Node : Type := {n : ℤ // 0 < n ∧ n % 36 ∈ residues} + +def FiniteNodes : Finset ℤ := {1,3,4,7,9,12,13,16,19,21} + +def sineFactor (a : Fin 15) (s : ℂ) : ℂ := + 2 * Complex.sin ((kappa : ℂ) * (s - (residue a : ℂ))) + +def P (s : ℂ) : ℂ := ∏ a : Fin 15, (sineFactor a s)^2 + +def dBasis (n : Node) : ℂ → ℂ := dslope P (n.val : ℂ) + +def cBasis (n : Node) : ℂ → ℂ := dslope (dBasis n) (n.val : ℂ) + +def finiteC (a : Fin 15) (s : ℂ) : ℂ := + 4 * (kappa : ℂ)^2 * ∏ r ∈ Finset.univ.erase a, (sineFactor r s)^2 + +def finiteD (a : Fin 15) (s : ℂ) : ℂ := + 2 * (kappa : ℂ) * sineFactor a s * + Complex.cos ((kappa : ℂ) * (s - (residue a : ℂ))) * + ∏ r ∈ Finset.univ.erase a, (sineFactor r s)^2 + +def phase (s : ℂ) : ℂ := Complex.exp ((Real.pi : ℂ) * Complex.I * s / 18) + +def atomFactor (a : Fin 15) : Polynomial ℂ := + -C (phase (residue a)) + C 2 * X - C (phase (-residue a)) * X^2 + +def atomPolynomial : Polynomial ℂ := ∏ a : Fin 15, atomFactor a + +def cAtomPolynomial (a : Fin 15) : Polynomial ℂ := + C (4 * (kappa : ℂ)^2) * ∏ r ∈ Finset.univ.erase a, atomFactor r + +def dAtomPolynomial (a : Fin 15) : Polynomial ℂ := + C (Complex.I * (kappa : ℂ)) * + (C (phase (residue a)) - C (phase (-residue a)) * X^2) * + ∏ r ∈ Finset.univ.erase a, atomFactor r + +def fourierCoeff (j : Fin 31) : ℂ := atomPolynomial.coeff j.val + +def frequency (j : Fin 31) : ℝ := ((j.val : ℝ)-15)/18 + +def waveDerivative (k : ℕ) (s : ℂ) : ℂ := + ∑ j : Fin 31, fourierCoeff j * (I*Real.pi*frequency j)^k * + exp (I*Real.pi*frequency j*s) + +def Q (n : ℤ) : ℝ := (waveDerivative 2 n).re / 2 + +def D (n : ℤ) : ℝ := (waveDerivative 3 n).re / (6 * Q n) + +end AtomicTriangular.Construction + +namespace AtomicTriangular.FiniteCertificate +open Construction + +def cShiftPolynomial (a : Fin 15) : Polynomial ℂ := X * cAtomPolynomial a + +def cCoefficient (a : Fin 15) (j : Fin 31) : ℂ := (cShiftPolynomial a).coeff j.val + +def dCoefficient (a : Fin 15) (j : Fin 31) : ℂ := (dAtomPolynomial a).coeff j.val + +end AtomicTriangular.FiniteCertificate + +namespace AtomicTriangular.Construction + +abbrev Plane := EuclideanSpace ℝ (Fin 2) + +def radial (x : Plane) : ℝ := b*‖x‖^2 + +def waveDen (k t : ℝ) : ℝ := k^2+t^2 + +def Xwave (k t : ℝ) : ℝ := (4/3)/waveDen k t + +def lambda (k t : ℝ) : ℂ := ((k:ℂ)+I*t)/(b*waveDen k t : ℝ) + +def zeta (k v t : ℝ) : ℂ := -(t:ℂ)*(Xwave k t:ℂ)+I*(k*Xwave k t-v:ℝ) + +def transformedWave (k v t : ℝ) (s : ℂ) : ℂ := lambda k t*exp (I*Real.pi*zeta k v t*s) + +def finiteColumn (col : Fin 23) (j : Fin 31) : ℂ := + if hc : col.val<22 then + if col.val%2=0 then FiniteCertificate.cCoefficient ⟨col.val/2,by omega⟩ j + else FiniteCertificate.dCoefficient ⟨col.val/2,by omega⟩ j + else fourierCoeff j + +def finiteNode (n : Fin 10) : ℤ := residue ⟨n.val+1,by omega⟩ + +def jetMultiplier (k v : ℝ) (n : ℤ) (d : Fin 2) (t : ℝ) : ℂ := + (Q n:ℂ)⁻¹*transformedWave k v t n * + (if d.val=0 then -1 else (D n:ℂ)-I*Real.pi*zeta k v t) + +def jet (k v : ℝ) (n : ℤ) (d : Fin 2) (S : Fin 31 → ℂ) : ℝ := + (∑ j : Fin 31, jetMultiplier k v n d (frequency j)*S j).re + +def fullJetMatrix : Matrix (Fin 20) (Fin 23) ℝ := fun i col => + jet (if col.val=22 then h else H) H + (finiteNode ⟨i.val/2,by omega⟩) ⟨i.val%2,by omega⟩ (finiteColumn col) + +def R : Matrix (Fin 20) (Fin 20) ℝ := fun i j => fullJetMatrix i ⟨j.val+2,by omega⟩ + +def R0 : Matrix (Fin 20) (Fin 3) ℝ := fun i j => + fullJetMatrix i (if j.val<2 then ⟨j.val,by omega⟩ else 22) + +abbrev TailNode := {n : Node // n.val ∉ FiniteNodes} + +structure InputCoefficients where + C : ℝ + finiteC : Fin 11 → ℝ + finiteD : Fin 11 → ℝ + tailC : TailNode → ℝ + tailD : TailNode → ℝ + summable : Summable (fun n => |tailC n|+|tailD n|) + +def tailInput (a : InputCoefficients) (s : ℂ) : ℂ := + (a.C:ℂ)*P s + ∑' n : TailNode, ((a.tailC n:ℂ)*cBasis n.val s+(a.tailD n:ℂ)*dBasis n.val s) + +def finiteInput (a : InputCoefficients) (s : ℂ) : ℂ := + ∑ j : Fin 11, ((a.finiteC j:ℂ)*finiteC ⟨j.val,by omega⟩ s + + (a.finiteD j:ℂ)*finiteD ⟨j.val,by omega⟩ s) + +def inputComplex (a : InputCoefficients) (x : Plane) : ℂ := + exp (-(Real.pi:ℂ)*h*(radial x:ℂ))*tailInput a (radial x) + + exp (-(Real.pi:ℂ)*H*(radial x:ℂ))*finiteInput a (radial x) + +def Z : ℝ := 391/1000 + +def targetCoefficient (n : Fin 10) : ℝ := Q 1 / Q (finiteNode n) * Real.exp (Real.pi*eta*(finiteNode n)) + +def Yf : Matrix (Fin 20) (Fin 8) ℝ := fun i j => + if i.val<8 then + targetCoefficient ⟨i.val/2,by omega⟩ * + (if i.val%2=0 then (if j.val=i.val then 1 else 0) + else (if j.val=i.val then -1 else if j.val=i.val-1 then Real.pi*eta-D (finiteNode ⟨i.val/2,by omega⟩) else 0)) + else 0 + +def gamma (side : Fin 2) : Matrix (Fin 3) (Fin 8) ℝ := fun i j => + if j.val=1 then (if i.val=0 then 11/25 else if i.val=1 then 0 else if side.val=0 then -(3/500) else 3/500) else 0 + +def Uplus : Matrix (Fin 20) (Fin 8) ℝ := + (1-R)⁻¹*(Yf+R0*(gamma 1+gamma 0)) + +def Uminus : Matrix (Fin 20) (Fin 8) ℝ := + (1+R)⁻¹*(Yf+R0*(gamma 1-gamma 0)) + +def finiteSolution (side : Fin 2) : Matrix (Fin 20) (Fin 8) ℝ := + if side.val=0 then (1/2:ℝ) • (Uplus+Uminus) else (1/2:ℝ) • (Uplus-Uminus) + +def Acoefficient (side : Fin 2) : Matrix (Fin 23) (Fin 8) ℝ := fun i j => + if hi : i.val<2 then gamma side ⟨i.val,by omega⟩ j + else if h22 : i.val=22 then gamma side 2 j + else finiteSolution side ⟨i.val-2,by omega⟩ j + +def gaussianZ (α : ℝ) : ℝ := 1/(Real.pi*(α/b-h)) + +def actualParameter (z : ℝ) : Fin 8 → ℝ := + ![z,1,z*Real.exp (-2/z),Real.exp (-2/z),z*Real.exp (-3/z),Real.exp (-3/z), + z*Real.exp (-6/z),Real.exp (-6/z)] + +def normalizingDen (z : ℝ) := Q 1*z*Real.exp (1/z) + +end AtomicTriangular.Construction + +namespace AtomicTriangular.Construction + +def finiteCoordinates (a : InputCoefficients) (i : Fin 22) : ℝ := + if i.val % 2 = 0 then a.finiteC ⟨i.val / 2, by omega⟩ + else a.finiteD ⟨i.val / 2, by omega⟩ + +def HasAtomicConstruction (α : ℝ) (f : Plane → ℝ) : Prop := + IsUnit (1 - R) ∧ IsUnit (1 + R) ∧ + (1 - R) * Uplus = Yf + R0 * (gamma 1 + gamma 0) ∧ + (1 + R) * Uminus = Yf + R0 * (gamma 1 - gamma 0) ∧ + ∃ (a : Fin 2 → InputCoefficients) (u : Fin 2 → Fin 20 → ℝ), + (∀ side, + (a side).C = (if side.val = 0 then -(3/500) else 3/500) ∧ + (a side).finiteC 0 = 11/25 ∧ (a side).finiteD 0 = 0 ∧ + ∀ i : Fin 22, + finiteCoordinates (a side) i = + (∑ j : Fin 8, Acoefficient side ⟨i.val, by omega⟩ j * + actualParameter (gaussianZ α) j) + + (if hi : i.val < 2 then 0 else u side ⟨i.val - 2, by omega⟩)) ∧ + (∀ side, + (∑ i : Fin 20, |u side i|) < 1/10^5 ∧ + Summable (fun n : TailNode => |(a side).tailC n| + |(a side).tailD n|) ∧ + (∑' n : TailNode, (|(a side).tailC n| + |(a side).tailD n|)) < 3/10^9) ∧ + (∀ x : Plane, (f x : ℂ) = + (inputComplex (a 0) x + 𝓕 (inputComplex (a 1)) x) / + (normalizingDen (gaussianZ α) : ℂ)) + +end AtomicTriangular.Construction + +namespace AtomicTriangular + +theorem sharp_gaussian_minorants_atomic (α : ℝ) (hα : 0 < α) : + ∃ f : SchwartzMap Plane ℝ, + Radial f ∧ (∀ x, f x ≤ gaussian α x) ∧ + (∀ w, (realFourier f w).im = 0 ∧ 0 ≤ (realFourier f w).re) ∧ + (∀ a ∈ A, a ≠ 0 → f a = gaussian α a) ∧ + (∀ w ∈ dualA, w ≠ 0 → realFourier f w = 0) ∧ + (1 ≤ α → Construction.HasAtomicConstruction α f) := by + sorry + +end AtomicTriangular + +end + +end OAI +``` + +## What to submit + +Write `/workspace/Submission.lean`. Start from a copy of the challenge: + +```bash +cp /opt/openai-math/challenges/AtomicGaussian.lean /workspace/Submission.lean +``` + +then replace every `sorry` with a proof. The file is graded on three things: + +- **Same statements.** The theorem `OAI.AtomicTriangular.sharp_gaussian_minorants_atomic` must keep exactly the statement shown above: same names, + namespaces, binders and types. Every definition the statements use must stay exactly as written. + Change nothing except the proofs. +- **Standard axioms only.** Proofs may use only `propext`, `Quot.sound` and `Classical.choice`. + `sorry`, `admit`, new `axiom`s and `native_decide` (it introduces an axiom of its own) are rejected. +- **Keep the challenge's declarations as they are.** Put new lemmas and instances *after* the + definitions the statements use, or in a separate `Submission/*.lean` module. A declaration added + before them can change how they elaborate, and then they no longer match the challenge. +- **Kernel-checked.** The proofs are re-checked by the Lean kernel, not just the elaborator. + +Long proofs can be split into modules under `/workspace/Submission/` (module names +`Submission.Foo`, `Submission.Foo.Bar`) imported from `Submission.lean`. Only `.lean` files at +those two paths are graded. + +## Environment + +- Lean `v4.34.1` and Mathlib at commit `d13f23b` are installed and prebuilt; `/workspace` is a + Lake project. +- The sandbox has 4 CPUs and 8 GB of memory; `LEAN_NUM_THREADS=3` keeps `lake build` to three + parallel jobs. Check your work with `cd /workspace && lake build Submission`. Add `#print axioms ` to see + which axioms a proof uses. +- There is no internet access. OpenAI's own proofs are not installed. + +## Grading + +When you finish, `Submission.lean` and `Submission/**.lean` are copied to a fresh machine and +checked with [Comparator](https://github.com/leanprover/comparator), the Lean FRO's proof checker. +The reward is 1 if Comparator accepts the proof and 0 otherwise. A partial proof scores 0. diff --git a/tasks/atomic-gaussian/solution/closure.txt b/tasks/atomic-gaussian/solution/closure.txt new file mode 100644 index 0000000000000000000000000000000000000000..9587af88fe52e81f5f5d27193f128fbaca957137 --- /dev/null +++ b/tasks/atomic-gaussian/solution/closure.txt @@ -0,0 +1,215 @@ +OAI.Analysis.Triangular.Auxiliary.Bernstein +OAI.Analysis.Triangular.Auxiliary.ExponentialTail +OAI.Analysis.Triangular.Auxiliary.IntegralBounds +OAI.Analysis.Triangular.Auxiliary.MatrixNorm +OAI.Analysis.Triangular.Auxiliary.PolynomialShift +OAI.Analysis.Triangular.Basic +OAI.Analysis.Triangular.Certificate.Inverse +OAI.Analysis.Triangular.Certificate.JetMatrix +OAI.Analysis.Triangular.Certificate.MatrixInterval +OAI.Analysis.Triangular.Certificate.Param +OAI.Analysis.Triangular.Certificate.ParamA +OAI.Analysis.Triangular.Certificate.ParamActual +OAI.Analysis.Triangular.Certificate.ParamInterval +OAI.Analysis.Triangular.Certificate.ParamNorm +OAI.Analysis.Triangular.Certificate.ParamNormBase +OAI.Analysis.Triangular.Certificate.ParamRHS +OAI.Analysis.Triangular.Certificate.ParamU +OAI.Analysis.Triangular.Certificate.Polytope +OAI.Analysis.Triangular.Certificate.PolytopeInterval +OAI.Analysis.Triangular.Certificate.TargetInterval +OAI.Analysis.Triangular.Certificate.WaveExpData +OAI.Analysis.Triangular.Certificate.WaveIntervals +OAI.Analysis.Triangular.Certificate.WaveJetsData +OAI.Analysis.Triangular.Construction.ActualCorrection +OAI.Analysis.Triangular.Construction.ActualInput +OAI.Analysis.Triangular.Construction.ActualInterpolation +OAI.Analysis.Triangular.Construction.ActualTail +OAI.Analysis.Triangular.Construction.AtomicCurvature +OAI.Analysis.Triangular.Construction.BlockOperators +OAI.Analysis.Triangular.Construction.CoefficientAddition +OAI.Analysis.Triangular.Construction.ConcreteSchur +OAI.Analysis.Triangular.Construction.CurvatureAnalytic +OAI.Analysis.Triangular.Construction.CurvatureBoxes +OAI.Analysis.Triangular.Construction.CurvatureEnvelope +OAI.Analysis.Triangular.Construction.CurvatureSums +OAI.Analysis.Triangular.Construction.DirectCoordinates +OAI.Analysis.Triangular.Construction.DirectWaveJets +OAI.Analysis.Triangular.Construction.FarCurvature +OAI.Analysis.Triangular.Construction.FiniteAssembly +OAI.Analysis.Triangular.Construction.FiniteCoordinates +OAI.Analysis.Triangular.Construction.FiniteInterpolation +OAI.Analysis.Triangular.Construction.FiniteJets +OAI.Analysis.Triangular.Construction.FinitePairBridge +OAI.Analysis.Triangular.Construction.FiniteProjection +OAI.Analysis.Triangular.Construction.FiniteRemainder +OAI.Analysis.Triangular.Construction.FiniteSystem +OAI.Analysis.Triangular.Construction.FiniteTargetBridge +OAI.Analysis.Triangular.Construction.L1Kernel +OAI.Analysis.Triangular.Construction.L1Matrix +OAI.Analysis.Triangular.Construction.NodeJets +OAI.Analysis.Triangular.Construction.Normalization +OAI.Analysis.Triangular.Construction.NormalizedJets +OAI.Analysis.Triangular.Construction.PeriodicJets +OAI.Analysis.Triangular.Construction.Repetition +OAI.Analysis.Triangular.Construction.RepetitionBound +OAI.Analysis.Triangular.Construction.RepetitionOperators +OAI.Analysis.Triangular.Construction.Schur +OAI.Analysis.Triangular.Construction.SpectralJetBridge +OAI.Analysis.Triangular.Construction.SpectralProduct +OAI.Analysis.Triangular.Construction.TailCoordinates +OAI.Analysis.Triangular.Construction.TailEnumeration +OAI.Analysis.Triangular.Construction.TailInterpolation +OAI.Analysis.Triangular.Construction.TailJetVector +OAI.Analysis.Triangular.Energy.Basic +OAI.Analysis.Triangular.Energy.Mixtures +OAI.Analysis.Triangular.Envelope.Analytic +OAI.Analysis.Triangular.Envelope.Basic +OAI.Analysis.Triangular.Envelope.EnvelopeBoxes +OAI.Analysis.Triangular.Envelope.EnvelopeNorm0 +OAI.Analysis.Triangular.Envelope.EnvelopeNorm1 +OAI.Analysis.Triangular.Envelope.EnvelopeNorm2 +OAI.Analysis.Triangular.Envelope.EnvelopeNorms +OAI.Analysis.Triangular.Envelope.EnvelopePsiB +OAI.Analysis.Triangular.Envelope.EnvelopePsiC +OAI.Analysis.Triangular.Envelope.EnvelopePsiD +OAI.Analysis.Triangular.Envelope.EnvelopeSums +OAI.Analysis.Triangular.Envelope.EnvelopeSumsBase +OAI.Analysis.Triangular.Envelope.EnvelopeWaves +OAI.Analysis.Triangular.Envelope.JetEnvelopeAnalytic +OAI.Analysis.Triangular.Envelope.KernelBounds +OAI.Analysis.Triangular.Envelope.TailEnvelopeSeries +OAI.Analysis.Triangular.Envelope.TargetEnvelope +OAI.Analysis.Triangular.Lattice.LatticeGeometry +OAI.Analysis.Triangular.Main +OAI.Analysis.Triangular.Schwartz.FourierCLM +OAI.Analysis.Triangular.Schwartz.FourierPair +OAI.Analysis.Triangular.Schwartz.Gaussian +OAI.Analysis.Triangular.Schwartz.GaussianPair +OAI.Analysis.Triangular.Schwartz.InputCLM +OAI.Analysis.Triangular.Schwartz.Realness +OAI.Analysis.Triangular.Schwartz.Regularity +OAI.Analysis.Triangular.Schwartz.SpectralCLM +OAI.Analysis.Triangular.Schwartz.SpectralEnvelope +OAI.Analysis.Triangular.Schwartz.TailSpectral +OAI.Analysis.Triangular.Signs.DeletedAccuracy +OAI.Analysis.Triangular.Signs.DeletedExponential +OAI.Analysis.Triangular.Signs.DeletedJets +OAI.Analysis.Triangular.Signs.DeletedQuotient +OAI.Analysis.Triangular.Signs.Exceptional +OAI.Analysis.Triangular.Signs.ExceptionalComparison +OAI.Analysis.Triangular.Signs.ExceptionalInterval +OAI.Analysis.Triangular.Signs.ExceptionalSign0 +OAI.Analysis.Triangular.Signs.ExceptionalSign1 +OAI.Analysis.Triangular.Signs.ExceptionalSign2 +OAI.Analysis.Triangular.Signs.ExceptionalSign3 +OAI.Analysis.Triangular.Signs.FarSigns +OAI.Analysis.Triangular.Signs.GaussianDeleted +OAI.Analysis.Triangular.Signs.NearSigns +OAI.Analysis.Triangular.Signs.OrdinaryComparison +OAI.Analysis.Triangular.Signs.RemainderBoxes +OAI.Analysis.Triangular.Signs.RemainderData0 +OAI.Analysis.Triangular.Signs.RemainderData1 +OAI.Analysis.Triangular.Signs.RemainderData2 +OAI.Analysis.Triangular.Signs.RemainderData3 +OAI.Analysis.Triangular.Signs.RemainderData4 +OAI.Analysis.Triangular.Signs.RemainderData5 +OAI.Analysis.Triangular.Signs.RemainderData6 +OAI.Analysis.Triangular.Signs.RemainderNorm +OAI.Analysis.Triangular.Signs.RemainderPre +OAI.Analysis.Triangular.Signs.RemainderSums0 +OAI.Analysis.Triangular.Signs.RemainderSums1 +OAI.Analysis.Triangular.Signs.RemainderSums2 +OAI.Analysis.Triangular.Signs.RemainderSums3 +OAI.Analysis.Triangular.Signs.RemainderSums4 +OAI.Analysis.Triangular.Signs.RemainderSums5 +OAI.Analysis.Triangular.Signs.RemainderSums6 +OAI.Analysis.Triangular.Signs.SignBase +OAI.Analysis.Triangular.Signs.Signs00 +OAI.Analysis.Triangular.Signs.Signs01 +OAI.Analysis.Triangular.Signs.Signs02 +OAI.Analysis.Triangular.Signs.Signs03 +OAI.Analysis.Triangular.Signs.Signs04 +OAI.Analysis.Triangular.Signs.Signs05 +OAI.Analysis.Triangular.Signs.Signs06 +OAI.Analysis.Triangular.Signs.Signs10 +OAI.Analysis.Triangular.Signs.Signs11 +OAI.Analysis.Triangular.Signs.Signs12 +OAI.Analysis.Triangular.Signs.Signs13 +OAI.Analysis.Triangular.Signs.Signs14 +OAI.Analysis.Triangular.Signs.Signs15 +OAI.Analysis.Triangular.Signs.Signs16 +OAI.Analysis.Triangular.Signs.SineBarrierBase +OAI.Analysis.Triangular.Signs.SineGlobal +OAI.Analysis.Triangular.Signs.SineGrid0 +OAI.Analysis.Triangular.Signs.SineGrid1 +OAI.Analysis.Triangular.Signs.SineGrid2 +OAI.Analysis.Triangular.Signs.SineGridAnalytic +OAI.Analysis.Triangular.Signs.SineGridChecks +OAI.Analysis.Triangular.Signs.SineGridCover +OAI.Analysis.Triangular.Signs.SineGridDefs +OAI.Analysis.Triangular.Taylor.CoefficientSpectral +OAI.Analysis.Triangular.Taylor.CurvatureData00 +OAI.Analysis.Triangular.Taylor.CurvatureData01 +OAI.Analysis.Triangular.Taylor.CurvatureData10 +OAI.Analysis.Triangular.Taylor.CurvatureData11 +OAI.Analysis.Triangular.Taylor.FiniteTaylorError +OAI.Analysis.Triangular.Taylor.FiniteTaylorIdentity +OAI.Analysis.Triangular.Taylor.Taylor +OAI.Analysis.Triangular.Taylor.TaylorExp +OAI.Analysis.Triangular.Taylor.TaylorExp00 +OAI.Analysis.Triangular.Taylor.TaylorExp01 +OAI.Analysis.Triangular.Taylor.TaylorExp10 +OAI.Analysis.Triangular.Taylor.TaylorExp11 +OAI.Analysis.Triangular.Taylor.TaylorPhase +OAI.Analysis.Triangular.Taylor.TaylorRows00 +OAI.Analysis.Triangular.Taylor.TaylorRows01 +OAI.Analysis.Triangular.Taylor.TaylorRows02 +OAI.Analysis.Triangular.Taylor.TaylorRows03 +OAI.Analysis.Triangular.Taylor.TaylorRows04 +OAI.Analysis.Triangular.Taylor.TaylorRows05 +OAI.Analysis.Triangular.Taylor.TaylorRows06 +OAI.Analysis.Triangular.Taylor.TaylorRows10 +OAI.Analysis.Triangular.Taylor.TaylorRows11 +OAI.Analysis.Triangular.Taylor.TaylorRows12 +OAI.Analysis.Triangular.Taylor.TaylorRows13 +OAI.Analysis.Triangular.Taylor.TaylorRows14 +OAI.Analysis.Triangular.Taylor.TaylorRows15 +OAI.Analysis.Triangular.Taylor.TaylorRows16 +OAI.Analysis.Triangular.Taylor.TaylorRowsBase +OAI.Analysis.Triangular.Taylor.TaylorSpectrum +OAI.Analysis.Triangular.Taylor.TaylorWave +OAI.Analysis.Triangular.Taylor.TaylorWave00 +OAI.Analysis.Triangular.Taylor.TaylorWave000 +OAI.Analysis.Triangular.Taylor.TaylorWave001 +OAI.Analysis.Triangular.Taylor.TaylorWave002 +OAI.Analysis.Triangular.Taylor.TaylorWave003 +OAI.Analysis.Triangular.Taylor.TaylorWave004 +OAI.Analysis.Triangular.Taylor.TaylorWave005 +OAI.Analysis.Triangular.Taylor.TaylorWave006 +OAI.Analysis.Triangular.Taylor.TaylorWave01 +OAI.Analysis.Triangular.Taylor.TaylorWave010 +OAI.Analysis.Triangular.Taylor.TaylorWave011 +OAI.Analysis.Triangular.Taylor.TaylorWave012 +OAI.Analysis.Triangular.Taylor.TaylorWave013 +OAI.Analysis.Triangular.Taylor.TaylorWave014 +OAI.Analysis.Triangular.Taylor.TaylorWave015 +OAI.Analysis.Triangular.Taylor.TaylorWave016 +OAI.Analysis.Triangular.Taylor.TaylorWave10 +OAI.Analysis.Triangular.Taylor.TaylorWave100 +OAI.Analysis.Triangular.Taylor.TaylorWave101 +OAI.Analysis.Triangular.Taylor.TaylorWave102 +OAI.Analysis.Triangular.Taylor.TaylorWave103 +OAI.Analysis.Triangular.Taylor.TaylorWave104 +OAI.Analysis.Triangular.Taylor.TaylorWave105 +OAI.Analysis.Triangular.Taylor.TaylorWave106 +OAI.Analysis.Triangular.Taylor.TaylorWave11 +OAI.Analysis.Triangular.Taylor.TaylorWave110 +OAI.Analysis.Triangular.Taylor.TaylorWave111 +OAI.Analysis.Triangular.Taylor.TaylorWave112 +OAI.Analysis.Triangular.Taylor.TaylorWave113 +OAI.Analysis.Triangular.Taylor.TaylorWave114 +OAI.Analysis.Triangular.Taylor.TaylorWave115 +OAI.Analysis.Triangular.Taylor.TaylorWave116 +OAI.Analysis.Triangular.Taylor.VariationBound +OAI.Analysis.Triangular.Taylor.WaveFunction diff --git a/tasks/atomic-gaussian/solution/reference.py b/tasks/atomic-gaussian/solution/reference.py new file mode 100644 index 0000000000000000000000000000000000000000..5a70dac71c5a6043e3d69a2bd3a4796a8b474bd3 --- /dev/null +++ b/tasks/atomic-gaussian/solution/reference.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python3 +"""Place openai/math's reference proof as a submission (used by the oracle's solve.sh). + +Standalone: the adapter copies this file into every task's solution/ directory. + + reference.py + +Each module in closure.txt (``OAI.A.B``) is copied from ``/OAI/A/B.lean`` to +``/Submission/OAI/A/B.lean`` with ``import OAI.X`` rewritten to +``import Submission.OAI.X``; ``Submission.lean`` imports the solution module. Declaration names +are namespaces, not module paths, so the theorems keep the names the challenge expects. +""" + +from __future__ import annotations + +import re +import sys +from pathlib import Path + +_IMPORT = re.compile(r"^(\s*(?:public\s+|private\s+)?(?:meta\s+)?import\s+(?:all\s+)?)(OAI(?:\.|\s|$))") +_HEADER_LINE = re.compile(r"^\s*(?:module\b|prelude\b|--|$)") + + +def rename_imports(text: str) -> str: + """Rewrite ``import OAI...`` to ``import Submission.OAI...`` in the import header only.""" + out, in_header, in_comment = [], True, False + for line in text.splitlines(keepends=True): + if in_header: + stripped = line.strip() + if in_comment: + in_comment = "-/" not in stripped + elif stripped.startswith("/-"): + in_comment = "-/" not in stripped[2:] + elif _IMPORT.match(line): + line = _IMPORT.sub(lambda m: m.group(1) + "Submission." + m.group(2), line, count=1) + elif not _HEADER_LINE.match(line) and not re.match(r"^\s*(?:public\s+|private\s+)?(?:meta\s+)?import\s", line): + in_header = False + out.append(line) + return "".join(out) + + +def module_path(root: Path, module: str) -> Path: + return root.joinpath(*module.split(".")).with_suffix(".lean") + + +def place(lean_dir: Path, modules: list[str], solution_module: str, workspace: Path) -> None: + for module in modules: + dst = module_path(workspace / "Submission", module) + dst.parent.mkdir(parents=True, exist_ok=True) + dst.write_text(rename_imports(module_path(lean_dir, module).read_text(encoding="utf-8")), encoding="utf-8") + (workspace / "Submission.lean").write_text(f"import Submission.{solution_module}\n", encoding="utf-8") + + +if __name__ == "__main__": + lean_dir, closure_txt, solution_module, workspace = sys.argv[1:5] + modules = [m.strip() for m in Path(closure_txt).read_text().splitlines() if m.strip()] + place(Path(lean_dir), modules, solution_module, Path(workspace)) + print(f"placed {len(modules)} reference modules for {solution_module}") diff --git a/tasks/atomic-gaussian/solution/solve.sh b/tasks/atomic-gaussian/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..4001635e665037a0dbbc914d2725783d1ea4430e --- /dev/null +++ b/tasks/atomic-gaussian/solution/solve.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# Oracle: submit openai/math's own proof of AtomicGaussian, i.e. module OAI.Analysis.Triangular.Main and the +# 215 OAI modules it imports, placed under Submission/ (see reference.py). +set -euo pipefail +if [ -f /solution/reference.tar.gz ]; then + tar -xzf /solution/reference.tar.gz -C /workspace +else + # Fetch only those files at the pinned commit. The task blocks the network while the agent runs, + # so run the oracle with `harbor run ... --allow-agent-host github.com`. + tmp=$(mktemp -d) + git -C "$tmp" init -q + git -C "$tmp" remote add origin https://github.com/openai/math.git + git -C "$tmp" config core.sparseCheckout true + sed -e 's#\.#/#g' -e 's#^#/lean/#' -e 's#$#.lean#' /solution/closure.txt > "$tmp/.git/info/sparse-checkout" + git -C "$tmp" fetch -q --depth 1 --filter=blob:none origin adc7f1241b42e322a6451854ab7e4b4c146bf78a + git -C "$tmp" checkout -q FETCH_HEAD + python3 /solution/reference.py "$tmp/lean" /solution/closure.txt OAI.Analysis.Triangular.Main /workspace + rm -rf "$tmp" +fi +echo "placed the reference proof of AtomicGaussian" diff --git a/tasks/atomic-gaussian/task.toml b/tasks/atomic-gaussian/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..49f4933979a7c239388e9b84e5a44757bb195501 --- /dev/null +++ b/tasks/atomic-gaussian/task.toml @@ -0,0 +1,49 @@ +schema_version = "1.4" + +[task] +name = "openai-math/atomic-gaussian" +version = "1.0.0" +description = "Prove AtomicGaussian (openai/math family 090: Universal optimality of the triangular lattice) in Lean 4 with Mathlib; graded by Comparator in a separate sandbox." +keywords = ["lean4", "mathlib", "theorem-proving", "openai-math", "convex-and-metric-geometry"] + +[metadata] +source = "https://github.com/openai/math" +source_commit = "adc7f1241b42e322a6451854ab7e4b4c146bf78a" +source_license = "Apache-2.0" +source_notice = "tests/Challenge.lean is lean/ComparatorChallenges/AtomicGaussian.lean from openai/math, (c) OpenAI, unchanged; see NOTICE at the dataset root" +challenge = "AtomicGaussian" +family = "090" +family_title = "Universal optimality of the triangular lattice" +subject = "Convex and metric geometry" +theorems = ["OAI.AtomicTriangular.sharp_gaussian_minorants_atomic"] +definition_holes = [] +fixed_definitions = [] +reference_module = "OAI.Analysis.Triangular.Main" +reference_modules = 215 +reference_lean_bytes = 8527615 +reference_requires_packages = [] +oracle_result = "accepted" +oracle_grade_seconds = 10626 +difficulty = "research" + +[agent] +timeout_sec = 14400 +network_mode = "no-network" + +[environment] +build_timeout_sec = 5400 +cpus = 4 +memory_mb = 8192 +storage_mb = 10240 +workdir = "/workspace" +# Lean sees all host CPUs rather than the sandbox's 4; this bounds `lake build` to 3 parallel jobs. +env = { LEAN_NUM_THREADS = "3" } + +[verifier] +timeout_sec = 19374 +environment_mode = "separate" +network_mode = "no-network" + +[[verifier.collect]] +command = "python3 /opt/openai-math/pack_submission.py" +timeout_sec = 300 diff --git a/tasks/atomic-gaussian/tests/Challenge.lean b/tasks/atomic-gaussian/tests/Challenge.lean new file mode 100644 index 0000000000000000000000000000000000000000..648c5a91452283eb94868bac124b0a46e16c41b0 --- /dev/null +++ b/tasks/atomic-gaussian/tests/Challenge.lean @@ -0,0 +1,252 @@ +import Mathlib + +namespace OAI + +noncomputable section +open scoped BigOperators FourierTransform SchwartzMap +open Complex Polynomial + +namespace AtomicTriangular + +abbrev Plane := EuclideanSpace ℝ (Fin 2) + +def b : ℝ := Real.sqrt 3 / 2 + +def triangularPoint (jk : ℤ × ℤ) : Plane := + (Real.sqrt b)⁻¹ • + (EuclideanSpace.single 0 ((jk.1 : ℝ) + (jk.2 : ℝ) / 2) + + EuclideanSpace.single 1 ((jk.2 : ℝ) * b)) + +def A : Set Plane := Set.range triangularPoint + +def dualA : Set Plane := {w | ∀ a ∈ A, ∃ n : ℤ, inner ℝ a w = (n : ℝ)} + +def gaussian (α : ℝ) (x : Plane) : ℝ := Real.exp (-Real.pi * α * ‖x‖ ^ 2) + +def Radial (f : Plane → ℝ) : Prop := ∀ x y, ‖x‖ = ‖y‖ → f x = f y + +def realFourier (f : Plane → ℝ) (w : Plane) : ℂ := 𝓕 (fun x => (f x : ℂ)) w + +end AtomicTriangular + +namespace AtomicTriangular.Construction + +def b : ℝ := Real.sqrt 3 / 2 + +def h : ℝ := 17 / 50 + +def H : ℝ := 27 / 50 + +def eta : ℝ := 1 / 5 + +def kappa : ℝ := Real.pi / 36 + +def residues : Finset ℤ := {0,1,3,4,7,9,12,13,16,19,21,25,27,28,31} + +def residue (a : Fin 15) : ℤ := ![0,1,3,4,7,9,12,13,16,19,21,25,27,28,31] a + +def Node : Type := {n : ℤ // 0 < n ∧ n % 36 ∈ residues} + +def FiniteNodes : Finset ℤ := {1,3,4,7,9,12,13,16,19,21} + +def sineFactor (a : Fin 15) (s : ℂ) : ℂ := + 2 * Complex.sin ((kappa : ℂ) * (s - (residue a : ℂ))) + +def P (s : ℂ) : ℂ := ∏ a : Fin 15, (sineFactor a s)^2 + +def dBasis (n : Node) : ℂ → ℂ := dslope P (n.val : ℂ) + +def cBasis (n : Node) : ℂ → ℂ := dslope (dBasis n) (n.val : ℂ) + +def finiteC (a : Fin 15) (s : ℂ) : ℂ := + 4 * (kappa : ℂ)^2 * ∏ r ∈ Finset.univ.erase a, (sineFactor r s)^2 + +def finiteD (a : Fin 15) (s : ℂ) : ℂ := + 2 * (kappa : ℂ) * sineFactor a s * + Complex.cos ((kappa : ℂ) * (s - (residue a : ℂ))) * + ∏ r ∈ Finset.univ.erase a, (sineFactor r s)^2 + +def phase (s : ℂ) : ℂ := Complex.exp ((Real.pi : ℂ) * Complex.I * s / 18) + +def atomFactor (a : Fin 15) : Polynomial ℂ := + -C (phase (residue a)) + C 2 * X - C (phase (-residue a)) * X^2 + +def atomPolynomial : Polynomial ℂ := ∏ a : Fin 15, atomFactor a + +def cAtomPolynomial (a : Fin 15) : Polynomial ℂ := + C (4 * (kappa : ℂ)^2) * ∏ r ∈ Finset.univ.erase a, atomFactor r + +def dAtomPolynomial (a : Fin 15) : Polynomial ℂ := + C (Complex.I * (kappa : ℂ)) * + (C (phase (residue a)) - C (phase (-residue a)) * X^2) * + ∏ r ∈ Finset.univ.erase a, atomFactor r + +def fourierCoeff (j : Fin 31) : ℂ := atomPolynomial.coeff j.val + +def frequency (j : Fin 31) : ℝ := ((j.val : ℝ)-15)/18 + +def waveDerivative (k : ℕ) (s : ℂ) : ℂ := + ∑ j : Fin 31, fourierCoeff j * (I*Real.pi*frequency j)^k * + exp (I*Real.pi*frequency j*s) + +def Q (n : ℤ) : ℝ := (waveDerivative 2 n).re / 2 + +def D (n : ℤ) : ℝ := (waveDerivative 3 n).re / (6 * Q n) + +end AtomicTriangular.Construction + +namespace AtomicTriangular.FiniteCertificate +open Construction + +def cShiftPolynomial (a : Fin 15) : Polynomial ℂ := X * cAtomPolynomial a + +def cCoefficient (a : Fin 15) (j : Fin 31) : ℂ := (cShiftPolynomial a).coeff j.val + +def dCoefficient (a : Fin 15) (j : Fin 31) : ℂ := (dAtomPolynomial a).coeff j.val + +end AtomicTriangular.FiniteCertificate + +namespace AtomicTriangular.Construction + +abbrev Plane := EuclideanSpace ℝ (Fin 2) + +def radial (x : Plane) : ℝ := b*‖x‖^2 + +def waveDen (k t : ℝ) : ℝ := k^2+t^2 + +def Xwave (k t : ℝ) : ℝ := (4/3)/waveDen k t + +def lambda (k t : ℝ) : ℂ := ((k:ℂ)+I*t)/(b*waveDen k t : ℝ) + +def zeta (k v t : ℝ) : ℂ := -(t:ℂ)*(Xwave k t:ℂ)+I*(k*Xwave k t-v:ℝ) + +def transformedWave (k v t : ℝ) (s : ℂ) : ℂ := lambda k t*exp (I*Real.pi*zeta k v t*s) + +def finiteColumn (col : Fin 23) (j : Fin 31) : ℂ := + if hc : col.val<22 then + if col.val%2=0 then FiniteCertificate.cCoefficient ⟨col.val/2,by omega⟩ j + else FiniteCertificate.dCoefficient ⟨col.val/2,by omega⟩ j + else fourierCoeff j + +def finiteNode (n : Fin 10) : ℤ := residue ⟨n.val+1,by omega⟩ + +def jetMultiplier (k v : ℝ) (n : ℤ) (d : Fin 2) (t : ℝ) : ℂ := + (Q n:ℂ)⁻¹*transformedWave k v t n * + (if d.val=0 then -1 else (D n:ℂ)-I*Real.pi*zeta k v t) + +def jet (k v : ℝ) (n : ℤ) (d : Fin 2) (S : Fin 31 → ℂ) : ℝ := + (∑ j : Fin 31, jetMultiplier k v n d (frequency j)*S j).re + +def fullJetMatrix : Matrix (Fin 20) (Fin 23) ℝ := fun i col => + jet (if col.val=22 then h else H) H + (finiteNode ⟨i.val/2,by omega⟩) ⟨i.val%2,by omega⟩ (finiteColumn col) + +def R : Matrix (Fin 20) (Fin 20) ℝ := fun i j => fullJetMatrix i ⟨j.val+2,by omega⟩ + +def R0 : Matrix (Fin 20) (Fin 3) ℝ := fun i j => + fullJetMatrix i (if j.val<2 then ⟨j.val,by omega⟩ else 22) + +abbrev TailNode := {n : Node // n.val ∉ FiniteNodes} + +structure InputCoefficients where + C : ℝ + finiteC : Fin 11 → ℝ + finiteD : Fin 11 → ℝ + tailC : TailNode → ℝ + tailD : TailNode → ℝ + summable : Summable (fun n => |tailC n|+|tailD n|) + +def tailInput (a : InputCoefficients) (s : ℂ) : ℂ := + (a.C:ℂ)*P s + ∑' n : TailNode, ((a.tailC n:ℂ)*cBasis n.val s+(a.tailD n:ℂ)*dBasis n.val s) + +def finiteInput (a : InputCoefficients) (s : ℂ) : ℂ := + ∑ j : Fin 11, ((a.finiteC j:ℂ)*finiteC ⟨j.val,by omega⟩ s + + (a.finiteD j:ℂ)*finiteD ⟨j.val,by omega⟩ s) + +def inputComplex (a : InputCoefficients) (x : Plane) : ℂ := + exp (-(Real.pi:ℂ)*h*(radial x:ℂ))*tailInput a (radial x) + + exp (-(Real.pi:ℂ)*H*(radial x:ℂ))*finiteInput a (radial x) + +def Z : ℝ := 391/1000 + +def targetCoefficient (n : Fin 10) : ℝ := Q 1 / Q (finiteNode n) * Real.exp (Real.pi*eta*(finiteNode n)) + +def Yf : Matrix (Fin 20) (Fin 8) ℝ := fun i j => + if i.val<8 then + targetCoefficient ⟨i.val/2,by omega⟩ * + (if i.val%2=0 then (if j.val=i.val then 1 else 0) + else (if j.val=i.val then -1 else if j.val=i.val-1 then Real.pi*eta-D (finiteNode ⟨i.val/2,by omega⟩) else 0)) + else 0 + +def gamma (side : Fin 2) : Matrix (Fin 3) (Fin 8) ℝ := fun i j => + if j.val=1 then (if i.val=0 then 11/25 else if i.val=1 then 0 else if side.val=0 then -(3/500) else 3/500) else 0 + +def Uplus : Matrix (Fin 20) (Fin 8) ℝ := + (1-R)⁻¹*(Yf+R0*(gamma 1+gamma 0)) + +def Uminus : Matrix (Fin 20) (Fin 8) ℝ := + (1+R)⁻¹*(Yf+R0*(gamma 1-gamma 0)) + +def finiteSolution (side : Fin 2) : Matrix (Fin 20) (Fin 8) ℝ := + if side.val=0 then (1/2:ℝ) • (Uplus+Uminus) else (1/2:ℝ) • (Uplus-Uminus) + +def Acoefficient (side : Fin 2) : Matrix (Fin 23) (Fin 8) ℝ := fun i j => + if hi : i.val<2 then gamma side ⟨i.val,by omega⟩ j + else if h22 : i.val=22 then gamma side 2 j + else finiteSolution side ⟨i.val-2,by omega⟩ j + +def gaussianZ (α : ℝ) : ℝ := 1/(Real.pi*(α/b-h)) + +def actualParameter (z : ℝ) : Fin 8 → ℝ := + ![z,1,z*Real.exp (-2/z),Real.exp (-2/z),z*Real.exp (-3/z),Real.exp (-3/z), + z*Real.exp (-6/z),Real.exp (-6/z)] + +def normalizingDen (z : ℝ) := Q 1*z*Real.exp (1/z) + +end AtomicTriangular.Construction + +namespace AtomicTriangular.Construction + +def finiteCoordinates (a : InputCoefficients) (i : Fin 22) : ℝ := + if i.val % 2 = 0 then a.finiteC ⟨i.val / 2, by omega⟩ + else a.finiteD ⟨i.val / 2, by omega⟩ + +def HasAtomicConstruction (α : ℝ) (f : Plane → ℝ) : Prop := + IsUnit (1 - R) ∧ IsUnit (1 + R) ∧ + (1 - R) * Uplus = Yf + R0 * (gamma 1 + gamma 0) ∧ + (1 + R) * Uminus = Yf + R0 * (gamma 1 - gamma 0) ∧ + ∃ (a : Fin 2 → InputCoefficients) (u : Fin 2 → Fin 20 → ℝ), + (∀ side, + (a side).C = (if side.val = 0 then -(3/500) else 3/500) ∧ + (a side).finiteC 0 = 11/25 ∧ (a side).finiteD 0 = 0 ∧ + ∀ i : Fin 22, + finiteCoordinates (a side) i = + (∑ j : Fin 8, Acoefficient side ⟨i.val, by omega⟩ j * + actualParameter (gaussianZ α) j) + + (if hi : i.val < 2 then 0 else u side ⟨i.val - 2, by omega⟩)) ∧ + (∀ side, + (∑ i : Fin 20, |u side i|) < 1/10^5 ∧ + Summable (fun n : TailNode => |(a side).tailC n| + |(a side).tailD n|) ∧ + (∑' n : TailNode, (|(a side).tailC n| + |(a side).tailD n|)) < 3/10^9) ∧ + (∀ x : Plane, (f x : ℂ) = + (inputComplex (a 0) x + 𝓕 (inputComplex (a 1)) x) / + (normalizingDen (gaussianZ α) : ℂ)) + +end AtomicTriangular.Construction + +namespace AtomicTriangular + +theorem sharp_gaussian_minorants_atomic (α : ℝ) (hα : 0 < α) : + ∃ f : SchwartzMap Plane ℝ, + Radial f ∧ (∀ x, f x ≤ gaussian α x) ∧ + (∀ w, (realFourier f w).im = 0 ∧ 0 ≤ (realFourier f w).re) ∧ + (∀ a ∈ A, a ≠ 0 → f a = gaussian α a) ∧ + (∀ w ∈ dualA, w ≠ 0 → realFourier f w = 0) ∧ + (1 ≤ α → Construction.HasAtomicConstruction α f) := by + sorry + +end AtomicTriangular + +end + +end OAI diff --git a/tasks/atomic-gaussian/tests/grade.py b/tasks/atomic-gaussian/tests/grade.py new file mode 100644 index 0000000000000000000000000000000000000000..95f89f56da7f59e7af65dcf71b8ef3792ee87399 --- /dev/null +++ b/tasks/atomic-gaussian/tests/grade.py @@ -0,0 +1,418 @@ +#!/usr/bin/env python3 +"""Grade one openai/math challenge with Comparator. + +This runs as root in a separate verifier sandbox that never executed agent code. The only input the +agent controls is /logs/artifacts/submission.tar. Everything else comes from /tests (this task's +trusted challenge and Comparator config) and from the image. + +Steps: + 1. Unpack submission.tar, accepting only regular `Submission.lean` / `Submission/**.lean` files. + 2. Lay out a fresh Lake project: the trusted lakefile, Challenge.lean from /tests, the submission, + and the image's prebuilt Mathlib (root-owned, read-only to the grader). + 3. Run `lake env comparator config.json` as the unprivileged `grader` user, with no network. + Comparator builds Challenge and Submission inside landrun, checks that every listed theorem + has exactly the challenge's statement, that only the permitted axioms are used, and replays + the proof through the Lean kernel. + 4. Kill everything the grader started, then write the verdict. + +reward.txt is 1 only when Comparator prints its success line and exits 0. A rejected or +non-compiling submission scores 0. A broken grading setup (the trusted Challenge fails to build, +the network block cannot be installed) writes no reward, so Harbor reports an error instead of a +score. +""" + +from __future__ import annotations + +import json +import os +import pwd +import re +import shutil +import signal +import socket +import stat +import subprocess +import sys +import tarfile +import tempfile +import threading +import time +from pathlib import Path + +TESTS = Path("/tests") +VERIFIER_DIR = Path("/logs/verifier") +SUBMISSION_TAR = Path("/logs/artifacts/submission.tar") +LEAN_ENV = Path("/opt/lean-env") +RUN_ROOT = Path("/var/lib/oai-grade") +GRADER = "grader" +SUCCESS_LINE = "Your solution is okay!" +GRADE_THREADS = "2" +SCRATCH_SWEEP_SEC = 15 +# Lake and Comparator wording when a build process is killed for running out of memory. +OOM_MARKERS = ("Lean exited with code 137", "Child exited with 137") + +MAX_FILES = 20_000 +MAX_FILE_BYTES = 64 << 20 +MAX_TOTAL_BYTES = 768 << 20 +# Submission.lean, or Submission/A/B.lean where each component is a Lean identifier: it starts with +# a letter or `_` and continues with letters, digits (subscripts like `₁` included), `_`, `'`, `!`, `?`. +# Unicode is allowed because Lean identifiers allow it (openai/math has a module named `Kappa₁`). +_COMPONENT = r"[^\W\d][\w'!?]*" +MEMBER = re.compile(rf"^Submission(?:/{_COMPONENT})*\.lean$") +MEMBER_DIR = re.compile(rf"^Submission(?:/{_COMPONENT})*/?$") + +LAKEFILE = """import Lake +open Lake DSL + +package openai_math where + leanOptions := #[⟨`autoImplicit, false⟩] + +require mathlib from git + "https://github.com/leanprover-community/mathlib4.git" @ "d13f23b723b8a846827a245b89c10fc7d3f11612" + +lean_lib Challenge + +-- `Submission` and every `Submission.*` module it imports. +lean_lib Submission +""" + + +class Rejected(Exception): + """The submission is invalid: reward 0.""" + + +class GradingError(Exception): + """The grading setup is broken: no reward, so the trial shows as errored.""" + + +def toolchain_bin() -> Path: + bins = sorted(Path("/opt/elan/toolchains").glob("*/bin")) + if len(bins) != 1: + raise GradingError(f"expected one Lean toolchain, found {bins}") + return bins[0] + + +def unpack_submission(dest: Path) -> dict: + """Copy the submission's .lean files into ``dest``; reject anything else.""" + try: + st = SUBMISSION_TAR.lstat() + except FileNotFoundError: + raise Rejected("no submission: /workspace/Submission.lean was not found after the agent finished") + if not SUBMISSION_TAR.is_file() or SUBMISSION_TAR.is_symlink() or st.st_size > MAX_TOTAL_BYTES + (64 << 20): + raise Rejected("submission archive is not a regular file of acceptable size") + + files, total = [], 0 + try: + with tarfile.open(SUBMISSION_TAR, "r:") as tar: + for count, member in enumerate(tar): + if count > MAX_FILES * 2: + raise Rejected(f"submission has more than {MAX_FILES} entries") + name = member.name.removeprefix("./") + if member.isdir(): + if not MEMBER_DIR.match(name): + raise Rejected(f"unexpected directory in submission: {name!r}") + continue + if not member.isreg(): + raise Rejected(f"only regular .lean files are accepted, got {name!r}") + if not MEMBER.match(name): + raise Rejected(f"unexpected file in submission: {name!r} (only Submission.lean and Submission/**.lean)") + if member.size > MAX_FILE_BYTES: + raise Rejected(f"{name} is larger than {MAX_FILE_BYTES >> 20} MB") + total += member.size + if total > MAX_TOTAL_BYTES or len(files) >= MAX_FILES: + raise Rejected("submission is too large") + data = tar.extractfile(member).read(MAX_FILE_BYTES + 1) + try: + data.decode("utf-8") + except UnicodeDecodeError: + raise Rejected(f"{name} is not valid UTF-8") + target = dest / name + if target.exists(): + raise Rejected(f"duplicate entry {name!r}") + target.parent.mkdir(parents=True, exist_ok=True) + target.write_bytes(data) + target.chmod(0o644) + files.append(name) + except tarfile.TarError as exc: + raise Rejected(f"submission archive is unreadable: {exc}") + if "Submission.lean" not in files: + raise Rejected("no submission: /workspace/Submission.lean was not found after the agent finished") + for d in (dest / "Submission",): + if d.exists(): + for p in [d, *d.rglob("*")]: + if p.is_dir(): + p.chmod(0o755) + return {"files": len(files), "bytes": total} + + +def write_project(run: Path, config: dict) -> None: + (run / "lakefile.lean").write_text(LAKEFILE) + shutil.copy(LEAN_ENV / "lake-manifest.json", run / "lake-manifest.json") + shutil.copy(LEAN_ENV / "lean-toolchain", run / "lean-toolchain") + shutil.copy(TESTS / "Challenge.lean", run / "Challenge.lean") + comparator_config = { + "challenge_module": "Challenge", + "solution_module": "Submission", + "theorem_names": config["theorem_names"], + "definition_names": config["definition_names"], + "permitted_axioms": config["permitted_axioms"], + "enable_nanoda": False, + } + (run / "config.json").write_text(json.dumps(comparator_config, indent=2)) + lake = run / ".lake" + lake.mkdir() + (lake / "packages").symlink_to(LEAN_ENV / ".lake" / "packages") + for p in run.iterdir(): + if p.name != ".lake": + os.chmod(p, 0o644 if p.is_file() else 0o755, follow_symlinks=False) + uid = pwd.getpwnam(GRADER).pw_uid + os.chown(lake, uid, uid) + os.chmod(run, 0o755) + + +def fresh_run(task: dict) -> Path: + """A new, empty Lake project for one grading attempt.""" + run = Path(tempfile.mkdtemp(prefix="run.", dir=RUN_ROOT)) + write_project(run, task["comparator"]) + return run + + +def ensure_readable(roots: tuple[str, ...] = ("/opt/elan", str(LEAN_ENV))) -> int: + """Make the prebuilt toolchain and packages readable by the grader (never writable). + + The image already does this; this only repairs an image built without it. It must touch + nothing that is already right: these files live in the image's lower overlay layer, and a + `chmod` on one copies it whole into the sandbox's writable layer. A blanket `chmod -R` took + 535 s and used 8.7 GB of the 10 GB working disk. This walk only reads metadata (lstat). + Returns the number of entries changed. + """ + changed = 0 + for root in roots: + for dirpath, dirnames, filenames in os.walk(root, followlinks=False): + for name in [*dirnames, *filenames]: + path = os.path.join(dirpath, name) + st = os.lstat(path) + if stat.S_ISDIR(st.st_mode): + want = (st.st_mode | 0o555) & ~0o022 + elif stat.S_ISREG(st.st_mode): + want = (st.st_mode | 0o444) & ~0o022 + else: + continue + if stat.S_IMODE(st.st_mode) != stat.S_IMODE(want): + os.chmod(path, stat.S_IMODE(want)) + changed += 1 + return changed + + +def block_grader_network() -> None: + """Reject every socket the grader user opens, loopback included. + + landrun already denies TCP to the sandboxed build. This rule also covers the grader's own + processes outside landrun and services listening inside the sandbox. + """ + uid = str(pwd.getpwnam(GRADER).pw_uid) + for tool in ("iptables", "ip6tables"): + rule = ["OUTPUT", "-m", "owner", "--uid-owner", uid, "-j", "REJECT"] + if subprocess.run([tool, "-C", *rule], capture_output=True).returncode == 0: + continue + res = subprocess.run([tool, "-I", *rule], capture_output=True, text=True) + if res.returncode != 0: + raise GradingError(f"cannot install the {tool} rule for {GRADER}: {res.stderr.strip()}") + probe = subprocess.run( + ["runuser", "-u", GRADER, "--", sys.executable, "-c", + "import socket,sys\n" + "s=socket.socket(); s.settimeout(3)\n" + "sys.exit(0 if s.connect_ex(('127.0.0.1', 2280)) == 0 else 1)"], + capture_output=True, + ) + if probe.returncode == 0: + raise GradingError("the grader user can still open loopback connections") + + +def kill_grader() -> None: + for _ in range(20): + subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True) + if subprocess.run(["pgrep", "-u", GRADER], capture_output=True).returncode != 0: + return + time.sleep(0.5) + raise GradingError("could not stop the grader's processes") + + +def out_of_memory(out: str) -> bool: + return any(m in out for m in OOM_MARKERS) + + +def out_of_disk(out: str) -> bool: + return "no space left on device" in out.lower() + + +# Run as the grader user by `empty_build_scratch`. argv: the .lake/build/ir directory. +EMPTY_SCRATCH = r""" +import os, sys +for dirpath, _, files in os.walk(sys.argv[1]): + for name in files: + if not name.endswith(".setup.json"): + continue + base = os.path.join(dirpath, name[:-len(".setup.json")]) + try: + # Lake writes X.c.hash once Lean, and leanir if the module needs it, are done with X; + # both read X.setup.json, so it may only be emptied after that. + if os.stat(base + ".c.hash").st_mtime < os.stat(base + ".setup.json").st_mtime: + continue + for path in (base + ".setup.json", base + ".c"): + if os.path.getsize(path): + os.truncate(path, 0) + except OSError: + pass +""" + + +def empty_build_scratch(run: Path, stop: threading.Event) -> None: + """Until ``stop`` is set, empty files Lake leaves in .lake/build/ir that grading never reads. + + For every module Lake writes a `.setup.json` (its imports with the path of every .olean they + pull in, about 5.5 MB with Mathlib) and the module compiled to C. Neither is used once the + module is built, and for proofs of 1,000-2,000 modules they filled the 10 GB disk before the + build finished. Lake keeps the recorded hashes, so emptied files do not trigger a rebuild. + This runs as the grader user, so it can touch nothing the build could not. + """ + ir = str(run / ".lake" / "build" / "ir") + while not stop.wait(SCRATCH_SWEEP_SEC): + try: + subprocess.run(["runuser", "-u", GRADER, "--", sys.executable, "-c", EMPTY_SCRATCH, ir], + capture_output=True, timeout=600) + except subprocess.TimeoutExpired: + pass + + +def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> tuple[int | None, str]: + env = { + "PATH": f"{toolchain_bin()}:/usr/local/bin:/usr/bin:/bin", + "HOME": str(run), + "LANG": "C.UTF-8", + "LEAN_ABORT_ON_PANIC": "1", + # Lean sees every host CPU, not the sandbox's 4; bound Lake's parallel builds so a large + # proof fits in 8 GB. Needs the image's Comparator, which passes this into landrun. + "LEAN_NUM_THREADS": threads, + } + cmd = [ + "runuser", "-u", GRADER, "--", "env", "-i", *(f"{k}={v}" for k, v in env.items()), + "lake", "env", "comparator", "config.json", + ] + stop = threading.Event() + sweeper = threading.Thread(target=empty_build_scratch, args=(run, stop), daemon=True) + sweeper.start() + try: + code, stdout, stderr = run_with_timeout( + cmd, cwd=run, timeout_sec=timeout_sec, + kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), + ) + finally: + stop.set() + sweeper.join() + return code, stdout + "\n--- stderr ---\n" + stderr + + +def run_with_timeout(cmd: list[str], cwd: Path, timeout_sec: int, kill_extra=None) -> tuple[int | None, str, str]: + """Run ``cmd``; on timeout kill its whole process tree and return code None. + + `timeout(1)` only signals its direct child, so Lean processes started by Lake under landrun + kept the output pipe open and the grader waited past Harbor's own limit. Here the command + gets its own session; on timeout its process group is killed, and ``kill_extra`` (every + process of the grader user) catches anything that left the group. + """ + proc = subprocess.Popen(cmd, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + text=True, errors="replace", start_new_session=True) + try: + stdout, stderr = proc.communicate(timeout=timeout_sec) + return proc.returncode, stdout, stderr + except subprocess.TimeoutExpired: + try: + os.killpg(proc.pid, signal.SIGKILL) + except ProcessLookupError: + pass + if kill_extra: + kill_extra() + stdout, stderr = proc.communicate() + return None, stdout, stderr + + +def classify(code: int | None, out: str) -> tuple[int | None, str]: + """Map Comparator's result to (reward, reason). reward None means a grading error.""" + if code == 0 and SUCCESS_LINE in out: + return 1, "accepted: statements match, only permitted axioms, kernel replay passed" + if "Building Submission" not in out: + # Comparator stopped before it touched the submission: the trusted challenge or the + # toolchain is broken (or too slow), which says nothing about the agent's proof. + return None, ("timed out before the submission was built" if code is None + else "the trusted Challenge failed to build or export") + if code is None: + return 0, "timed out while building or checking the submission" + tail = [l for l in out.splitlines() if l.strip() and "has local changes" not in l][-25:] + if out_of_disk(out): + return 0, "rejected: the build ran out of disk space (10 GB) | " + " | ".join(tail)[-3000:] + if out_of_memory(out): + return 0, "rejected: the build was killed, most likely out of memory (8 GB) | " + " | ".join(tail)[-3000:] + return 0, "rejected: " + " | ".join(tail)[-4000:] + + +def main() -> int: + VERIFIER_DIR.mkdir(parents=True, exist_ok=True) + os.chmod(VERIFIER_DIR, 0o755) + for name in ("reward.txt", "reward.json"): + (VERIFIER_DIR / name).unlink(missing_ok=True) + + task = json.loads((TESTS / "task.json").read_text()) + details: dict = {"task": task["challenge"], "started_at": time.time()} + reward: int | None = None + log = "" + try: + RUN_ROOT.mkdir(mode=0o711, parents=True, exist_ok=True) + deadline = time.time() + int(task["grade_timeout_sec"]) + run = fresh_run(task) + details["permission_fixes"] = ensure_readable() + block_grader_network() + details["submission"] = unpack_submission(run) + code, out = run_comparator(run, int(deadline - time.time())) + log = out + kill_grader() + if code not in (0, None) and out_of_memory(out) and deadline - time.time() > 60: + # Two Lean processes in parallel can exceed 8 GB on a heavy module. Retry once with one, + # in a fresh directory: the first attempt's .lake was written by the submission's own + # build and must not be trusted for the challenge. + shutil.rmtree(run, ignore_errors=True) + run = fresh_run(task) + unpack_submission(run) + code, out = run_comparator(run, int(deadline - time.time()), threads="1") + log += "\n\n=== retried with one Lean process after running out of memory ===\n\n" + out + kill_grader() + details["retried_single_thread"] = True + reward, details["reason"] = classify(code, out) + details["comparator_exit"] = code + except Rejected as exc: + reward, details["reason"] = 0, f"rejected: {exc}" + except GradingError as exc: + reward, details["reason"] = None, f"grading error: {exc}" + except Exception as exc: + reward, details["reason"] = None, f"grading error: {type(exc).__name__}: {exc}" + finally: + try: + kill_grader() + except GradingError as exc: + reward, details["reason"] = None, f"grading error: {exc}" + # Free the build before writing anything. A build that filled the disk would otherwise + # make these writes fail, and with no space left the sandbox cannot report that the + # verifier exited, so Harbor waits until its own timeout and records no verdict. + shutil.rmtree(RUN_ROOT, ignore_errors=True) + details["reward"] = reward + details["finished_at"] = time.time() + (VERIFIER_DIR / "comparator.log").write_text(log) + (VERIFIER_DIR / "grading.json").write_text(json.dumps(details, indent=2)) + print(json.dumps(details, indent=2)) + if reward is not None: + (VERIFIER_DIR / "reward.txt").write_text(f"{reward}\n") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/tasks/atomic-gaussian/tests/task.json b/tasks/atomic-gaussian/tests/task.json new file mode 100644 index 0000000000000000000000000000000000000000..a055934acab737e7e1879becb6ca3679f453b79d --- /dev/null +++ b/tasks/atomic-gaussian/tests/task.json @@ -0,0 +1,15 @@ +{ + "challenge": "AtomicGaussian", + "comparator": { + "theorem_names": [ + "OAI.AtomicTriangular.sharp_gaussian_minorants_atomic" + ], + "definition_names": [], + "permitted_axioms": [ + "propext", + "Quot.sound", + "Classical.choice" + ] + }, + "grade_timeout_sec": 18474 +} \ No newline at end of file diff --git a/tasks/atomic-gaussian/tests/test.sh b/tasks/atomic-gaussian/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..172bae347e1bef3e7b6f12e7db887e33034b1130 --- /dev/null +++ b/tasks/atomic-gaussian/tests/test.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Runs in the separate verifier sandbox, which never ran agent code. See grade.py. +exec python3 /tests/grade.py diff --git a/tasks/auslander-reiten/task.toml b/tasks/auslander-reiten/task.toml index 7c705b4350a3e8a0040dec3a3224cc954c482f83..3b1dca317e7e1382c8e1e657d56b57cbaeec1c8d 100644 --- a/tasks/auslander-reiten/task.toml +++ b/tasks/auslander-reiten/task.toml @@ -23,7 +23,7 @@ reference_modules = 732 reference_lean_bytes = 2349871 reference_requires_packages = [] oracle_result = "accepted" -oracle_grade_seconds = 2615 +oracle_grade_seconds = 2177 difficulty = "research" [agent] diff --git a/tasks/auslander-reiten/tests/grade.py b/tasks/auslander-reiten/tests/grade.py index 9f4ee2489c3ce97bcc183d7695059602472bf911..95f89f56da7f59e7af65dcf71b8ef3792ee87399 100644 --- a/tasks/auslander-reiten/tests/grade.py +++ b/tasks/auslander-reiten/tests/grade.py @@ -35,6 +35,7 @@ import subprocess import sys import tarfile import tempfile +import threading import time from pathlib import Path @@ -46,6 +47,7 @@ RUN_ROOT = Path("/var/lib/oai-grade") GRADER = "grader" SUCCESS_LINE = "Your solution is okay!" GRADE_THREADS = "2" +SCRATCH_SWEEP_SEC = 15 # Lake and Comparator wording when a build process is killed for running out of memory. OOM_MARKERS = ("Lean exited with code 137", "Child exited with 137") @@ -240,6 +242,49 @@ def out_of_memory(out: str) -> bool: return any(m in out for m in OOM_MARKERS) +def out_of_disk(out: str) -> bool: + return "no space left on device" in out.lower() + + +# Run as the grader user by `empty_build_scratch`. argv: the .lake/build/ir directory. +EMPTY_SCRATCH = r""" +import os, sys +for dirpath, _, files in os.walk(sys.argv[1]): + for name in files: + if not name.endswith(".setup.json"): + continue + base = os.path.join(dirpath, name[:-len(".setup.json")]) + try: + # Lake writes X.c.hash once Lean, and leanir if the module needs it, are done with X; + # both read X.setup.json, so it may only be emptied after that. + if os.stat(base + ".c.hash").st_mtime < os.stat(base + ".setup.json").st_mtime: + continue + for path in (base + ".setup.json", base + ".c"): + if os.path.getsize(path): + os.truncate(path, 0) + except OSError: + pass +""" + + +def empty_build_scratch(run: Path, stop: threading.Event) -> None: + """Until ``stop`` is set, empty files Lake leaves in .lake/build/ir that grading never reads. + + For every module Lake writes a `.setup.json` (its imports with the path of every .olean they + pull in, about 5.5 MB with Mathlib) and the module compiled to C. Neither is used once the + module is built, and for proofs of 1,000-2,000 modules they filled the 10 GB disk before the + build finished. Lake keeps the recorded hashes, so emptied files do not trigger a rebuild. + This runs as the grader user, so it can touch nothing the build could not. + """ + ir = str(run / ".lake" / "build" / "ir") + while not stop.wait(SCRATCH_SWEEP_SEC): + try: + subprocess.run(["runuser", "-u", GRADER, "--", sys.executable, "-c", EMPTY_SCRATCH, ir], + capture_output=True, timeout=600) + except subprocess.TimeoutExpired: + pass + + def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> tuple[int | None, str]: env = { "PATH": f"{toolchain_bin()}:/usr/local/bin:/usr/bin:/bin", @@ -254,10 +299,17 @@ def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> "runuser", "-u", GRADER, "--", "env", "-i", *(f"{k}={v}" for k, v in env.items()), "lake", "env", "comparator", "config.json", ] - code, stdout, stderr = run_with_timeout( - cmd, cwd=run, timeout_sec=timeout_sec, - kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), - ) + stop = threading.Event() + sweeper = threading.Thread(target=empty_build_scratch, args=(run, stop), daemon=True) + sweeper.start() + try: + code, stdout, stderr = run_with_timeout( + cmd, cwd=run, timeout_sec=timeout_sec, + kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), + ) + finally: + stop.set() + sweeper.join() return code, stdout + "\n--- stderr ---\n" + stderr @@ -297,6 +349,8 @@ def classify(code: int | None, out: str) -> tuple[int | None, str]: if code is None: return 0, "timed out while building or checking the submission" tail = [l for l in out.splitlines() if l.strip() and "has local changes" not in l][-25:] + if out_of_disk(out): + return 0, "rejected: the build ran out of disk space (10 GB) | " + " | ".join(tail)[-3000:] if out_of_memory(out): return 0, "rejected: the build was killed, most likely out of memory (8 GB) | " + " | ".join(tail)[-3000:] return 0, "rejected: " + " | ".join(tail)[-4000:] @@ -311,6 +365,7 @@ def main() -> int: task = json.loads((TESTS / "task.json").read_text()) details: dict = {"task": task["challenge"], "started_at": time.time()} reward: int | None = None + log = "" try: RUN_ROOT.mkdir(mode=0o711, parents=True, exist_ok=True) deadline = time.time() + int(task["grade_timeout_sec"]) @@ -325,26 +380,33 @@ def main() -> int: # Two Lean processes in parallel can exceed 8 GB on a heavy module. Retry once with one, # in a fresh directory: the first attempt's .lake was written by the submission's own # build and must not be trusted for the challenge. + shutil.rmtree(run, ignore_errors=True) run = fresh_run(task) unpack_submission(run) code, out = run_comparator(run, int(deadline - time.time()), threads="1") log += "\n\n=== retried with one Lean process after running out of memory ===\n\n" + out kill_grader() details["retried_single_thread"] = True - (VERIFIER_DIR / "comparator.log").write_text(log) reward, details["reason"] = classify(code, out) details["comparator_exit"] = code except Rejected as exc: reward, details["reason"] = 0, f"rejected: {exc}" except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + except Exception as exc: + reward, details["reason"] = None, f"grading error: {type(exc).__name__}: {exc}" finally: try: kill_grader() except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + # Free the build before writing anything. A build that filled the disk would otherwise + # make these writes fail, and with no space left the sandbox cannot report that the + # verifier exited, so Harbor waits until its own timeout and records no verdict. + shutil.rmtree(RUN_ROOT, ignore_errors=True) details["reward"] = reward details["finished_at"] = time.time() + (VERIFIER_DIR / "comparator.log").write_text(log) (VERIFIER_DIR / "grading.json").write_text(json.dumps(details, indent=2)) print(json.dumps(details, indent=2)) if reward is not None: diff --git a/tasks/backward-intertwiners/task.toml b/tasks/backward-intertwiners/task.toml index f62e01de2f250bccd5c31bf54e192eb199f8b5b7..d9021e0e6e38199a8b92b1f71ff3814df8e0122c 100644 --- a/tasks/backward-intertwiners/task.toml +++ b/tasks/backward-intertwiners/task.toml @@ -23,7 +23,7 @@ reference_modules = 23 reference_lean_bytes = 262844 reference_requires_packages = [] oracle_result = "accepted" -oracle_grade_seconds = 823 +oracle_grade_seconds = 337 difficulty = "research" [agent] diff --git a/tasks/backward-intertwiners/tests/grade.py b/tasks/backward-intertwiners/tests/grade.py index 9f4ee2489c3ce97bcc183d7695059602472bf911..95f89f56da7f59e7af65dcf71b8ef3792ee87399 100644 --- a/tasks/backward-intertwiners/tests/grade.py +++ b/tasks/backward-intertwiners/tests/grade.py @@ -35,6 +35,7 @@ import subprocess import sys import tarfile import tempfile +import threading import time from pathlib import Path @@ -46,6 +47,7 @@ RUN_ROOT = Path("/var/lib/oai-grade") GRADER = "grader" SUCCESS_LINE = "Your solution is okay!" GRADE_THREADS = "2" +SCRATCH_SWEEP_SEC = 15 # Lake and Comparator wording when a build process is killed for running out of memory. OOM_MARKERS = ("Lean exited with code 137", "Child exited with 137") @@ -240,6 +242,49 @@ def out_of_memory(out: str) -> bool: return any(m in out for m in OOM_MARKERS) +def out_of_disk(out: str) -> bool: + return "no space left on device" in out.lower() + + +# Run as the grader user by `empty_build_scratch`. argv: the .lake/build/ir directory. +EMPTY_SCRATCH = r""" +import os, sys +for dirpath, _, files in os.walk(sys.argv[1]): + for name in files: + if not name.endswith(".setup.json"): + continue + base = os.path.join(dirpath, name[:-len(".setup.json")]) + try: + # Lake writes X.c.hash once Lean, and leanir if the module needs it, are done with X; + # both read X.setup.json, so it may only be emptied after that. + if os.stat(base + ".c.hash").st_mtime < os.stat(base + ".setup.json").st_mtime: + continue + for path in (base + ".setup.json", base + ".c"): + if os.path.getsize(path): + os.truncate(path, 0) + except OSError: + pass +""" + + +def empty_build_scratch(run: Path, stop: threading.Event) -> None: + """Until ``stop`` is set, empty files Lake leaves in .lake/build/ir that grading never reads. + + For every module Lake writes a `.setup.json` (its imports with the path of every .olean they + pull in, about 5.5 MB with Mathlib) and the module compiled to C. Neither is used once the + module is built, and for proofs of 1,000-2,000 modules they filled the 10 GB disk before the + build finished. Lake keeps the recorded hashes, so emptied files do not trigger a rebuild. + This runs as the grader user, so it can touch nothing the build could not. + """ + ir = str(run / ".lake" / "build" / "ir") + while not stop.wait(SCRATCH_SWEEP_SEC): + try: + subprocess.run(["runuser", "-u", GRADER, "--", sys.executable, "-c", EMPTY_SCRATCH, ir], + capture_output=True, timeout=600) + except subprocess.TimeoutExpired: + pass + + def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> tuple[int | None, str]: env = { "PATH": f"{toolchain_bin()}:/usr/local/bin:/usr/bin:/bin", @@ -254,10 +299,17 @@ def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> "runuser", "-u", GRADER, "--", "env", "-i", *(f"{k}={v}" for k, v in env.items()), "lake", "env", "comparator", "config.json", ] - code, stdout, stderr = run_with_timeout( - cmd, cwd=run, timeout_sec=timeout_sec, - kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), - ) + stop = threading.Event() + sweeper = threading.Thread(target=empty_build_scratch, args=(run, stop), daemon=True) + sweeper.start() + try: + code, stdout, stderr = run_with_timeout( + cmd, cwd=run, timeout_sec=timeout_sec, + kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), + ) + finally: + stop.set() + sweeper.join() return code, stdout + "\n--- stderr ---\n" + stderr @@ -297,6 +349,8 @@ def classify(code: int | None, out: str) -> tuple[int | None, str]: if code is None: return 0, "timed out while building or checking the submission" tail = [l for l in out.splitlines() if l.strip() and "has local changes" not in l][-25:] + if out_of_disk(out): + return 0, "rejected: the build ran out of disk space (10 GB) | " + " | ".join(tail)[-3000:] if out_of_memory(out): return 0, "rejected: the build was killed, most likely out of memory (8 GB) | " + " | ".join(tail)[-3000:] return 0, "rejected: " + " | ".join(tail)[-4000:] @@ -311,6 +365,7 @@ def main() -> int: task = json.loads((TESTS / "task.json").read_text()) details: dict = {"task": task["challenge"], "started_at": time.time()} reward: int | None = None + log = "" try: RUN_ROOT.mkdir(mode=0o711, parents=True, exist_ok=True) deadline = time.time() + int(task["grade_timeout_sec"]) @@ -325,26 +380,33 @@ def main() -> int: # Two Lean processes in parallel can exceed 8 GB on a heavy module. Retry once with one, # in a fresh directory: the first attempt's .lake was written by the submission's own # build and must not be trusted for the challenge. + shutil.rmtree(run, ignore_errors=True) run = fresh_run(task) unpack_submission(run) code, out = run_comparator(run, int(deadline - time.time()), threads="1") log += "\n\n=== retried with one Lean process after running out of memory ===\n\n" + out kill_grader() details["retried_single_thread"] = True - (VERIFIER_DIR / "comparator.log").write_text(log) reward, details["reason"] = classify(code, out) details["comparator_exit"] = code except Rejected as exc: reward, details["reason"] = 0, f"rejected: {exc}" except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + except Exception as exc: + reward, details["reason"] = None, f"grading error: {type(exc).__name__}: {exc}" finally: try: kill_grader() except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + # Free the build before writing anything. A build that filled the disk would otherwise + # make these writes fail, and with no space left the sandbox cannot report that the + # verifier exited, so Harbor waits until its own timeout and records no verdict. + shutil.rmtree(RUN_ROOT, ignore_errors=True) details["reward"] = reward details["finished_at"] = time.time() + (VERIFIER_DIR / "comparator.log").write_text(log) (VERIFIER_DIR / "grading.json").write_text(json.dumps(details, indent=2)) print(json.dumps(details, indent=2)) if reward is not None: diff --git a/tasks/balanced-box-routing/task.toml b/tasks/balanced-box-routing/task.toml index d45536988c10a57179803f38edaf6d89d3bd7fec..2f5ed9beb045d1826904b77d6a6552407645252c 100644 --- a/tasks/balanced-box-routing/task.toml +++ b/tasks/balanced-box-routing/task.toml @@ -23,7 +23,7 @@ reference_modules = 7 reference_lean_bytes = 164970 reference_requires_packages = [] oracle_result = "accepted" -oracle_grade_seconds = 299 +oracle_grade_seconds = 141 difficulty = "research" [agent] diff --git a/tasks/balanced-box-routing/tests/grade.py b/tasks/balanced-box-routing/tests/grade.py index 9f4ee2489c3ce97bcc183d7695059602472bf911..95f89f56da7f59e7af65dcf71b8ef3792ee87399 100644 --- a/tasks/balanced-box-routing/tests/grade.py +++ b/tasks/balanced-box-routing/tests/grade.py @@ -35,6 +35,7 @@ import subprocess import sys import tarfile import tempfile +import threading import time from pathlib import Path @@ -46,6 +47,7 @@ RUN_ROOT = Path("/var/lib/oai-grade") GRADER = "grader" SUCCESS_LINE = "Your solution is okay!" GRADE_THREADS = "2" +SCRATCH_SWEEP_SEC = 15 # Lake and Comparator wording when a build process is killed for running out of memory. OOM_MARKERS = ("Lean exited with code 137", "Child exited with 137") @@ -240,6 +242,49 @@ def out_of_memory(out: str) -> bool: return any(m in out for m in OOM_MARKERS) +def out_of_disk(out: str) -> bool: + return "no space left on device" in out.lower() + + +# Run as the grader user by `empty_build_scratch`. argv: the .lake/build/ir directory. +EMPTY_SCRATCH = r""" +import os, sys +for dirpath, _, files in os.walk(sys.argv[1]): + for name in files: + if not name.endswith(".setup.json"): + continue + base = os.path.join(dirpath, name[:-len(".setup.json")]) + try: + # Lake writes X.c.hash once Lean, and leanir if the module needs it, are done with X; + # both read X.setup.json, so it may only be emptied after that. + if os.stat(base + ".c.hash").st_mtime < os.stat(base + ".setup.json").st_mtime: + continue + for path in (base + ".setup.json", base + ".c"): + if os.path.getsize(path): + os.truncate(path, 0) + except OSError: + pass +""" + + +def empty_build_scratch(run: Path, stop: threading.Event) -> None: + """Until ``stop`` is set, empty files Lake leaves in .lake/build/ir that grading never reads. + + For every module Lake writes a `.setup.json` (its imports with the path of every .olean they + pull in, about 5.5 MB with Mathlib) and the module compiled to C. Neither is used once the + module is built, and for proofs of 1,000-2,000 modules they filled the 10 GB disk before the + build finished. Lake keeps the recorded hashes, so emptied files do not trigger a rebuild. + This runs as the grader user, so it can touch nothing the build could not. + """ + ir = str(run / ".lake" / "build" / "ir") + while not stop.wait(SCRATCH_SWEEP_SEC): + try: + subprocess.run(["runuser", "-u", GRADER, "--", sys.executable, "-c", EMPTY_SCRATCH, ir], + capture_output=True, timeout=600) + except subprocess.TimeoutExpired: + pass + + def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> tuple[int | None, str]: env = { "PATH": f"{toolchain_bin()}:/usr/local/bin:/usr/bin:/bin", @@ -254,10 +299,17 @@ def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> "runuser", "-u", GRADER, "--", "env", "-i", *(f"{k}={v}" for k, v in env.items()), "lake", "env", "comparator", "config.json", ] - code, stdout, stderr = run_with_timeout( - cmd, cwd=run, timeout_sec=timeout_sec, - kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), - ) + stop = threading.Event() + sweeper = threading.Thread(target=empty_build_scratch, args=(run, stop), daemon=True) + sweeper.start() + try: + code, stdout, stderr = run_with_timeout( + cmd, cwd=run, timeout_sec=timeout_sec, + kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), + ) + finally: + stop.set() + sweeper.join() return code, stdout + "\n--- stderr ---\n" + stderr @@ -297,6 +349,8 @@ def classify(code: int | None, out: str) -> tuple[int | None, str]: if code is None: return 0, "timed out while building or checking the submission" tail = [l for l in out.splitlines() if l.strip() and "has local changes" not in l][-25:] + if out_of_disk(out): + return 0, "rejected: the build ran out of disk space (10 GB) | " + " | ".join(tail)[-3000:] if out_of_memory(out): return 0, "rejected: the build was killed, most likely out of memory (8 GB) | " + " | ".join(tail)[-3000:] return 0, "rejected: " + " | ".join(tail)[-4000:] @@ -311,6 +365,7 @@ def main() -> int: task = json.loads((TESTS / "task.json").read_text()) details: dict = {"task": task["challenge"], "started_at": time.time()} reward: int | None = None + log = "" try: RUN_ROOT.mkdir(mode=0o711, parents=True, exist_ok=True) deadline = time.time() + int(task["grade_timeout_sec"]) @@ -325,26 +380,33 @@ def main() -> int: # Two Lean processes in parallel can exceed 8 GB on a heavy module. Retry once with one, # in a fresh directory: the first attempt's .lake was written by the submission's own # build and must not be trusted for the challenge. + shutil.rmtree(run, ignore_errors=True) run = fresh_run(task) unpack_submission(run) code, out = run_comparator(run, int(deadline - time.time()), threads="1") log += "\n\n=== retried with one Lean process after running out of memory ===\n\n" + out kill_grader() details["retried_single_thread"] = True - (VERIFIER_DIR / "comparator.log").write_text(log) reward, details["reason"] = classify(code, out) details["comparator_exit"] = code except Rejected as exc: reward, details["reason"] = 0, f"rejected: {exc}" except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + except Exception as exc: + reward, details["reason"] = None, f"grading error: {type(exc).__name__}: {exc}" finally: try: kill_grader() except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + # Free the build before writing anything. A build that filled the disk would otherwise + # make these writes fail, and with no space left the sandbox cannot report that the + # verifier exited, so Harbor waits until its own timeout and records no verdict. + shutil.rmtree(RUN_ROOT, ignore_errors=True) details["reward"] = reward details["finished_at"] = time.time() + (VERIFIER_DIR / "comparator.log").write_text(log) (VERIFIER_DIR / "grading.json").write_text(json.dumps(details, indent=2)) print(json.dumps(details, indent=2)) if reward is not None: diff --git a/tasks/balanced-ryser/task.toml b/tasks/balanced-ryser/task.toml index 5322f1252c09da27326521c2792424caa2ace634..9ed3930fccd9d1531a7d7e4203a7f953637e23eb 100644 --- a/tasks/balanced-ryser/task.toml +++ b/tasks/balanced-ryser/task.toml @@ -23,7 +23,7 @@ reference_modules = 698 reference_lean_bytes = 3897149 reference_requires_packages = [] oracle_result = "accepted" -oracle_grade_seconds = 1733 +oracle_grade_seconds = 1384 difficulty = "research" [agent] diff --git a/tasks/balanced-ryser/tests/grade.py b/tasks/balanced-ryser/tests/grade.py index 9f4ee2489c3ce97bcc183d7695059602472bf911..95f89f56da7f59e7af65dcf71b8ef3792ee87399 100644 --- a/tasks/balanced-ryser/tests/grade.py +++ b/tasks/balanced-ryser/tests/grade.py @@ -35,6 +35,7 @@ import subprocess import sys import tarfile import tempfile +import threading import time from pathlib import Path @@ -46,6 +47,7 @@ RUN_ROOT = Path("/var/lib/oai-grade") GRADER = "grader" SUCCESS_LINE = "Your solution is okay!" GRADE_THREADS = "2" +SCRATCH_SWEEP_SEC = 15 # Lake and Comparator wording when a build process is killed for running out of memory. OOM_MARKERS = ("Lean exited with code 137", "Child exited with 137") @@ -240,6 +242,49 @@ def out_of_memory(out: str) -> bool: return any(m in out for m in OOM_MARKERS) +def out_of_disk(out: str) -> bool: + return "no space left on device" in out.lower() + + +# Run as the grader user by `empty_build_scratch`. argv: the .lake/build/ir directory. +EMPTY_SCRATCH = r""" +import os, sys +for dirpath, _, files in os.walk(sys.argv[1]): + for name in files: + if not name.endswith(".setup.json"): + continue + base = os.path.join(dirpath, name[:-len(".setup.json")]) + try: + # Lake writes X.c.hash once Lean, and leanir if the module needs it, are done with X; + # both read X.setup.json, so it may only be emptied after that. + if os.stat(base + ".c.hash").st_mtime < os.stat(base + ".setup.json").st_mtime: + continue + for path in (base + ".setup.json", base + ".c"): + if os.path.getsize(path): + os.truncate(path, 0) + except OSError: + pass +""" + + +def empty_build_scratch(run: Path, stop: threading.Event) -> None: + """Until ``stop`` is set, empty files Lake leaves in .lake/build/ir that grading never reads. + + For every module Lake writes a `.setup.json` (its imports with the path of every .olean they + pull in, about 5.5 MB with Mathlib) and the module compiled to C. Neither is used once the + module is built, and for proofs of 1,000-2,000 modules they filled the 10 GB disk before the + build finished. Lake keeps the recorded hashes, so emptied files do not trigger a rebuild. + This runs as the grader user, so it can touch nothing the build could not. + """ + ir = str(run / ".lake" / "build" / "ir") + while not stop.wait(SCRATCH_SWEEP_SEC): + try: + subprocess.run(["runuser", "-u", GRADER, "--", sys.executable, "-c", EMPTY_SCRATCH, ir], + capture_output=True, timeout=600) + except subprocess.TimeoutExpired: + pass + + def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> tuple[int | None, str]: env = { "PATH": f"{toolchain_bin()}:/usr/local/bin:/usr/bin:/bin", @@ -254,10 +299,17 @@ def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> "runuser", "-u", GRADER, "--", "env", "-i", *(f"{k}={v}" for k, v in env.items()), "lake", "env", "comparator", "config.json", ] - code, stdout, stderr = run_with_timeout( - cmd, cwd=run, timeout_sec=timeout_sec, - kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), - ) + stop = threading.Event() + sweeper = threading.Thread(target=empty_build_scratch, args=(run, stop), daemon=True) + sweeper.start() + try: + code, stdout, stderr = run_with_timeout( + cmd, cwd=run, timeout_sec=timeout_sec, + kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), + ) + finally: + stop.set() + sweeper.join() return code, stdout + "\n--- stderr ---\n" + stderr @@ -297,6 +349,8 @@ def classify(code: int | None, out: str) -> tuple[int | None, str]: if code is None: return 0, "timed out while building or checking the submission" tail = [l for l in out.splitlines() if l.strip() and "has local changes" not in l][-25:] + if out_of_disk(out): + return 0, "rejected: the build ran out of disk space (10 GB) | " + " | ".join(tail)[-3000:] if out_of_memory(out): return 0, "rejected: the build was killed, most likely out of memory (8 GB) | " + " | ".join(tail)[-3000:] return 0, "rejected: " + " | ".join(tail)[-4000:] @@ -311,6 +365,7 @@ def main() -> int: task = json.loads((TESTS / "task.json").read_text()) details: dict = {"task": task["challenge"], "started_at": time.time()} reward: int | None = None + log = "" try: RUN_ROOT.mkdir(mode=0o711, parents=True, exist_ok=True) deadline = time.time() + int(task["grade_timeout_sec"]) @@ -325,26 +380,33 @@ def main() -> int: # Two Lean processes in parallel can exceed 8 GB on a heavy module. Retry once with one, # in a fresh directory: the first attempt's .lake was written by the submission's own # build and must not be trusted for the challenge. + shutil.rmtree(run, ignore_errors=True) run = fresh_run(task) unpack_submission(run) code, out = run_comparator(run, int(deadline - time.time()), threads="1") log += "\n\n=== retried with one Lean process after running out of memory ===\n\n" + out kill_grader() details["retried_single_thread"] = True - (VERIFIER_DIR / "comparator.log").write_text(log) reward, details["reason"] = classify(code, out) details["comparator_exit"] = code except Rejected as exc: reward, details["reason"] = 0, f"rejected: {exc}" except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + except Exception as exc: + reward, details["reason"] = None, f"grading error: {type(exc).__name__}: {exc}" finally: try: kill_grader() except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + # Free the build before writing anything. A build that filled the disk would otherwise + # make these writes fail, and with no space left the sandbox cannot report that the + # verifier exited, so Harbor waits until its own timeout and records no verdict. + shutil.rmtree(RUN_ROOT, ignore_errors=True) details["reward"] = reward details["finished_at"] = time.time() + (VERIFIER_DIR / "comparator.log").write_text(log) (VERIFIER_DIR / "grading.json").write_text(json.dumps(details, indent=2)) print(json.dumps(details, indent=2)) if reward is not None: diff --git a/tasks/balanced-three-stack/task.toml b/tasks/balanced-three-stack/task.toml index 375a51d06f12ebfac34332a204b3b32c94d7475a..4051a79adeed758f6263aeb3432c77f39b4fe7c9 100644 --- a/tasks/balanced-three-stack/task.toml +++ b/tasks/balanced-three-stack/task.toml @@ -23,7 +23,7 @@ reference_modules = 60 reference_lean_bytes = 495983 reference_requires_packages = [] oracle_result = "accepted" -oracle_grade_seconds = 1956 +oracle_grade_seconds = 392 difficulty = "research" [agent] diff --git a/tasks/balanced-three-stack/tests/grade.py b/tasks/balanced-three-stack/tests/grade.py index 9f4ee2489c3ce97bcc183d7695059602472bf911..95f89f56da7f59e7af65dcf71b8ef3792ee87399 100644 --- a/tasks/balanced-three-stack/tests/grade.py +++ b/tasks/balanced-three-stack/tests/grade.py @@ -35,6 +35,7 @@ import subprocess import sys import tarfile import tempfile +import threading import time from pathlib import Path @@ -46,6 +47,7 @@ RUN_ROOT = Path("/var/lib/oai-grade") GRADER = "grader" SUCCESS_LINE = "Your solution is okay!" GRADE_THREADS = "2" +SCRATCH_SWEEP_SEC = 15 # Lake and Comparator wording when a build process is killed for running out of memory. OOM_MARKERS = ("Lean exited with code 137", "Child exited with 137") @@ -240,6 +242,49 @@ def out_of_memory(out: str) -> bool: return any(m in out for m in OOM_MARKERS) +def out_of_disk(out: str) -> bool: + return "no space left on device" in out.lower() + + +# Run as the grader user by `empty_build_scratch`. argv: the .lake/build/ir directory. +EMPTY_SCRATCH = r""" +import os, sys +for dirpath, _, files in os.walk(sys.argv[1]): + for name in files: + if not name.endswith(".setup.json"): + continue + base = os.path.join(dirpath, name[:-len(".setup.json")]) + try: + # Lake writes X.c.hash once Lean, and leanir if the module needs it, are done with X; + # both read X.setup.json, so it may only be emptied after that. + if os.stat(base + ".c.hash").st_mtime < os.stat(base + ".setup.json").st_mtime: + continue + for path in (base + ".setup.json", base + ".c"): + if os.path.getsize(path): + os.truncate(path, 0) + except OSError: + pass +""" + + +def empty_build_scratch(run: Path, stop: threading.Event) -> None: + """Until ``stop`` is set, empty files Lake leaves in .lake/build/ir that grading never reads. + + For every module Lake writes a `.setup.json` (its imports with the path of every .olean they + pull in, about 5.5 MB with Mathlib) and the module compiled to C. Neither is used once the + module is built, and for proofs of 1,000-2,000 modules they filled the 10 GB disk before the + build finished. Lake keeps the recorded hashes, so emptied files do not trigger a rebuild. + This runs as the grader user, so it can touch nothing the build could not. + """ + ir = str(run / ".lake" / "build" / "ir") + while not stop.wait(SCRATCH_SWEEP_SEC): + try: + subprocess.run(["runuser", "-u", GRADER, "--", sys.executable, "-c", EMPTY_SCRATCH, ir], + capture_output=True, timeout=600) + except subprocess.TimeoutExpired: + pass + + def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> tuple[int | None, str]: env = { "PATH": f"{toolchain_bin()}:/usr/local/bin:/usr/bin:/bin", @@ -254,10 +299,17 @@ def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> "runuser", "-u", GRADER, "--", "env", "-i", *(f"{k}={v}" for k, v in env.items()), "lake", "env", "comparator", "config.json", ] - code, stdout, stderr = run_with_timeout( - cmd, cwd=run, timeout_sec=timeout_sec, - kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), - ) + stop = threading.Event() + sweeper = threading.Thread(target=empty_build_scratch, args=(run, stop), daemon=True) + sweeper.start() + try: + code, stdout, stderr = run_with_timeout( + cmd, cwd=run, timeout_sec=timeout_sec, + kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), + ) + finally: + stop.set() + sweeper.join() return code, stdout + "\n--- stderr ---\n" + stderr @@ -297,6 +349,8 @@ def classify(code: int | None, out: str) -> tuple[int | None, str]: if code is None: return 0, "timed out while building or checking the submission" tail = [l for l in out.splitlines() if l.strip() and "has local changes" not in l][-25:] + if out_of_disk(out): + return 0, "rejected: the build ran out of disk space (10 GB) | " + " | ".join(tail)[-3000:] if out_of_memory(out): return 0, "rejected: the build was killed, most likely out of memory (8 GB) | " + " | ".join(tail)[-3000:] return 0, "rejected: " + " | ".join(tail)[-4000:] @@ -311,6 +365,7 @@ def main() -> int: task = json.loads((TESTS / "task.json").read_text()) details: dict = {"task": task["challenge"], "started_at": time.time()} reward: int | None = None + log = "" try: RUN_ROOT.mkdir(mode=0o711, parents=True, exist_ok=True) deadline = time.time() + int(task["grade_timeout_sec"]) @@ -325,26 +380,33 @@ def main() -> int: # Two Lean processes in parallel can exceed 8 GB on a heavy module. Retry once with one, # in a fresh directory: the first attempt's .lake was written by the submission's own # build and must not be trusted for the challenge. + shutil.rmtree(run, ignore_errors=True) run = fresh_run(task) unpack_submission(run) code, out = run_comparator(run, int(deadline - time.time()), threads="1") log += "\n\n=== retried with one Lean process after running out of memory ===\n\n" + out kill_grader() details["retried_single_thread"] = True - (VERIFIER_DIR / "comparator.log").write_text(log) reward, details["reason"] = classify(code, out) details["comparator_exit"] = code except Rejected as exc: reward, details["reason"] = 0, f"rejected: {exc}" except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + except Exception as exc: + reward, details["reason"] = None, f"grading error: {type(exc).__name__}: {exc}" finally: try: kill_grader() except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + # Free the build before writing anything. A build that filled the disk would otherwise + # make these writes fail, and with no space left the sandbox cannot report that the + # verifier exited, so Harbor waits until its own timeout and records no verdict. + shutil.rmtree(RUN_ROOT, ignore_errors=True) details["reward"] = reward details["finished_at"] = time.time() + (VERIFIER_DIR / "comparator.log").write_text(log) (VERIFIER_DIR / "grading.json").write_text(json.dumps(details, indent=2)) print(json.dumps(details, indent=2)) if reward is not None: diff --git a/tasks/ball-packing/task.toml b/tasks/ball-packing/task.toml index 318e817bb9e7b347e190550445e4dcb41e9570a7..6e61e1c99f2c6188a267b0c0b47cfe0c614999a7 100644 --- a/tasks/ball-packing/task.toml +++ b/tasks/ball-packing/task.toml @@ -23,7 +23,7 @@ reference_modules = 169 reference_lean_bytes = 4529811 reference_requires_packages = [] oracle_result = "accepted" -oracle_grade_seconds = 4562 +oracle_grade_seconds = 2433 difficulty = "research" [agent] diff --git a/tasks/ball-packing/tests/grade.py b/tasks/ball-packing/tests/grade.py index 9f4ee2489c3ce97bcc183d7695059602472bf911..95f89f56da7f59e7af65dcf71b8ef3792ee87399 100644 --- a/tasks/ball-packing/tests/grade.py +++ b/tasks/ball-packing/tests/grade.py @@ -35,6 +35,7 @@ import subprocess import sys import tarfile import tempfile +import threading import time from pathlib import Path @@ -46,6 +47,7 @@ RUN_ROOT = Path("/var/lib/oai-grade") GRADER = "grader" SUCCESS_LINE = "Your solution is okay!" GRADE_THREADS = "2" +SCRATCH_SWEEP_SEC = 15 # Lake and Comparator wording when a build process is killed for running out of memory. OOM_MARKERS = ("Lean exited with code 137", "Child exited with 137") @@ -240,6 +242,49 @@ def out_of_memory(out: str) -> bool: return any(m in out for m in OOM_MARKERS) +def out_of_disk(out: str) -> bool: + return "no space left on device" in out.lower() + + +# Run as the grader user by `empty_build_scratch`. argv: the .lake/build/ir directory. +EMPTY_SCRATCH = r""" +import os, sys +for dirpath, _, files in os.walk(sys.argv[1]): + for name in files: + if not name.endswith(".setup.json"): + continue + base = os.path.join(dirpath, name[:-len(".setup.json")]) + try: + # Lake writes X.c.hash once Lean, and leanir if the module needs it, are done with X; + # both read X.setup.json, so it may only be emptied after that. + if os.stat(base + ".c.hash").st_mtime < os.stat(base + ".setup.json").st_mtime: + continue + for path in (base + ".setup.json", base + ".c"): + if os.path.getsize(path): + os.truncate(path, 0) + except OSError: + pass +""" + + +def empty_build_scratch(run: Path, stop: threading.Event) -> None: + """Until ``stop`` is set, empty files Lake leaves in .lake/build/ir that grading never reads. + + For every module Lake writes a `.setup.json` (its imports with the path of every .olean they + pull in, about 5.5 MB with Mathlib) and the module compiled to C. Neither is used once the + module is built, and for proofs of 1,000-2,000 modules they filled the 10 GB disk before the + build finished. Lake keeps the recorded hashes, so emptied files do not trigger a rebuild. + This runs as the grader user, so it can touch nothing the build could not. + """ + ir = str(run / ".lake" / "build" / "ir") + while not stop.wait(SCRATCH_SWEEP_SEC): + try: + subprocess.run(["runuser", "-u", GRADER, "--", sys.executable, "-c", EMPTY_SCRATCH, ir], + capture_output=True, timeout=600) + except subprocess.TimeoutExpired: + pass + + def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> tuple[int | None, str]: env = { "PATH": f"{toolchain_bin()}:/usr/local/bin:/usr/bin:/bin", @@ -254,10 +299,17 @@ def run_comparator(run: Path, timeout_sec: int, threads: str = GRADE_THREADS) -> "runuser", "-u", GRADER, "--", "env", "-i", *(f"{k}={v}" for k, v in env.items()), "lake", "env", "comparator", "config.json", ] - code, stdout, stderr = run_with_timeout( - cmd, cwd=run, timeout_sec=timeout_sec, - kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), - ) + stop = threading.Event() + sweeper = threading.Thread(target=empty_build_scratch, args=(run, stop), daemon=True) + sweeper.start() + try: + code, stdout, stderr = run_with_timeout( + cmd, cwd=run, timeout_sec=timeout_sec, + kill_extra=lambda: subprocess.run(["pkill", "-9", "-u", GRADER], capture_output=True), + ) + finally: + stop.set() + sweeper.join() return code, stdout + "\n--- stderr ---\n" + stderr @@ -297,6 +349,8 @@ def classify(code: int | None, out: str) -> tuple[int | None, str]: if code is None: return 0, "timed out while building or checking the submission" tail = [l for l in out.splitlines() if l.strip() and "has local changes" not in l][-25:] + if out_of_disk(out): + return 0, "rejected: the build ran out of disk space (10 GB) | " + " | ".join(tail)[-3000:] if out_of_memory(out): return 0, "rejected: the build was killed, most likely out of memory (8 GB) | " + " | ".join(tail)[-3000:] return 0, "rejected: " + " | ".join(tail)[-4000:] @@ -311,6 +365,7 @@ def main() -> int: task = json.loads((TESTS / "task.json").read_text()) details: dict = {"task": task["challenge"], "started_at": time.time()} reward: int | None = None + log = "" try: RUN_ROOT.mkdir(mode=0o711, parents=True, exist_ok=True) deadline = time.time() + int(task["grade_timeout_sec"]) @@ -325,26 +380,33 @@ def main() -> int: # Two Lean processes in parallel can exceed 8 GB on a heavy module. Retry once with one, # in a fresh directory: the first attempt's .lake was written by the submission's own # build and must not be trusted for the challenge. + shutil.rmtree(run, ignore_errors=True) run = fresh_run(task) unpack_submission(run) code, out = run_comparator(run, int(deadline - time.time()), threads="1") log += "\n\n=== retried with one Lean process after running out of memory ===\n\n" + out kill_grader() details["retried_single_thread"] = True - (VERIFIER_DIR / "comparator.log").write_text(log) reward, details["reason"] = classify(code, out) details["comparator_exit"] = code except Rejected as exc: reward, details["reason"] = 0, f"rejected: {exc}" except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + except Exception as exc: + reward, details["reason"] = None, f"grading error: {type(exc).__name__}: {exc}" finally: try: kill_grader() except GradingError as exc: reward, details["reason"] = None, f"grading error: {exc}" + # Free the build before writing anything. A build that filled the disk would otherwise + # make these writes fail, and with no space left the sandbox cannot report that the + # verifier exited, so Harbor waits until its own timeout and records no verdict. + shutil.rmtree(RUN_ROOT, ignore_errors=True) details["reward"] = reward details["finished_at"] = time.time() + (VERIFIER_DIR / "comparator.log").write_text(log) (VERIFIER_DIR / "grading.json").write_text(json.dumps(details, indent=2)) print(json.dumps(details, indent=2)) if reward is not None: