From b63b79cb9ce761700283f00bec4000c021fd881e Mon Sep 17 00:00:00 2001 From: PSBigBig + MiniPS Date: Sun, 31 May 2026 14:03:23 +0800 Subject: [PATCH] Delete Polaris/frontier-challenges/millennium-problems/releases/Seven_Millennium_Problems_effective_layer_reproducible_speedrun/WFGY_Seven_Millennium_Speedrun_Colab_Runner.ipynb --- ...ven_Millennium_Speedrun_Colab_Runner.ipynb | 213 ------------------ 1 file changed, 213 deletions(-) delete mode 100644 Polaris/frontier-challenges/millennium-problems/releases/Seven_Millennium_Problems_effective_layer_reproducible_speedrun/WFGY_Seven_Millennium_Speedrun_Colab_Runner.ipynb diff --git a/Polaris/frontier-challenges/millennium-problems/releases/Seven_Millennium_Problems_effective_layer_reproducible_speedrun/WFGY_Seven_Millennium_Speedrun_Colab_Runner.ipynb b/Polaris/frontier-challenges/millennium-problems/releases/Seven_Millennium_Problems_effective_layer_reproducible_speedrun/WFGY_Seven_Millennium_Speedrun_Colab_Runner.ipynb deleted file mode 100644 index 6234c9c9..00000000 --- a/Polaris/frontier-challenges/millennium-problems/releases/Seven_Millennium_Problems_effective_layer_reproducible_speedrun/WFGY_Seven_Millennium_Speedrun_Colab_Runner.ipynb +++ /dev/null @@ -1,213 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "id": "27bd3472", - "metadata": {}, - "source": [ - "# WFGY Seven Millennium Problems Speedrun ยท Colab Runner\n", - "\n", - "Upload `Seven_Millennium_Problems_effective_layer_reproducible_speedrun.zip`, then run all cells.\n", - "\n", - "This notebook checks SHA256, extracts the package, runs the public speedrun runner, runs C03 writeback validation, runs C04 two-way statement validation, measures runtime, prints terminal-style output, and downloads a small results ZIP.\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "6ea58f91", - "metadata": {}, - "outputs": [], - "source": [ - "# Cell 1 โ€” Upload the speedrun ZIP and verify SHA256\n", - "from google.colab import files\n", - "from pathlib import Path\n", - "import hashlib, os, zipfile, json, time, subprocess, textwrap, shutil\n", - "\n", - "EXPECTED_SHA256 = \"FA767D99BFCD55041FDBCC86C5BD62F781DF9B39C617E5B28E3BD461C3FFE042\"\n", - "EXPECTED_FILENAME_HINT = \"Seven_Millennium_Problems_effective_layer_reproducible_speedrun.zip\"\n", - "\n", - "print(\"๐Ÿš€ WFGY Seven Millennium Problems Speedrun ยท Colab Runner\")\n", - "print(\"๐Ÿ“ฆ Please upload:\", EXPECTED_FILENAME_HINT)\n", - "\n", - "uploaded = files.upload()\n", - "if not uploaded:\n", - " raise SystemExit(\"No file uploaded.\")\n", - "\n", - "zip_path = Path(next(iter(uploaded.keys()))).resolve()\n", - "print(\"\\nUploaded file:\", zip_path.name)\n", - "print(\"File size:\", zip_path.stat().st_size, \"bytes\")\n", - "\n", - "h = hashlib.sha256()\n", - "with zip_path.open(\"rb\") as f:\n", - " for chunk in iter(lambda: f.read(1024 * 1024), b\"\"):\n", - " h.update(chunk)\n", - "actual_sha = h.hexdigest().upper()\n", - "print(\"SHA256:\", actual_sha)\n", - "\n", - "if actual_sha != EXPECTED_SHA256:\n", - " print(\"โš ๏ธ SHA256 mismatch.\")\n", - " print(\"Expected:\", EXPECTED_SHA256)\n", - " print(\"Actual: \", actual_sha)\n", - " raise SystemExit(\"Checksum mismatch. Stop before validation.\")\n", - "\n", - "print(\"โœ… SHA256 PASS\")\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "0e4d2522", - "metadata": {}, - "outputs": [], - "source": [ - "# Cell 2 โ€” Extract package and locate root folder\n", - "WORKDIR = Path(\"/content/wfgy_speedrun_work\")\n", - "if WORKDIR.exists():\n", - " shutil.rmtree(WORKDIR)\n", - "WORKDIR.mkdir(parents=True, exist_ok=True)\n", - "\n", - "with zipfile.ZipFile(zip_path, \"r\") as z:\n", - " z.extractall(WORKDIR)\n", - "\n", - "# Find package root by locating the public runner.\n", - "runner_candidates = list(WORKDIR.rglob(\"tools/run_public_rpg_speedrun.py\"))\n", - "if not runner_candidates:\n", - " raise SystemExit(\"Cannot find tools/run_public_rpg_speedrun.py inside ZIP.\")\n", - "\n", - "PACKAGE_ROOT = runner_candidates[0].parents[1]\n", - "print(\"โœ… Extracted package root:\", PACKAGE_ROOT)\n", - "print(\"Top-level package folders:\")\n", - "for p in sorted(PACKAGE_ROOT.iterdir()):\n", - " if p.is_dir():\n", - " print(\" -\", p.name)\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "6090e3dd", - "metadata": {}, - "outputs": [], - "source": [ - "# Cell 3 โ€” Run public speedrun, C03 validator, and C04 validator with timing\n", - "import datetime\n", - "\n", - "def run_cmd(label, cmd, cwd):\n", - " print(\"\\n\" + \"=\" * 88)\n", - " print(f\"โ–ถ {label}\")\n", - " print(\"Command:\", \" \".join(cmd))\n", - " print(\"Start:\", datetime.datetime.now().isoformat(timespec=\"seconds\"))\n", - " t0 = time.perf_counter()\n", - " proc = subprocess.run(cmd, cwd=str(cwd), text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)\n", - " elapsed = time.perf_counter() - t0\n", - " print(proc.stdout)\n", - " print(f\"โฑ๏ธ {label} elapsed_seconds: {elapsed:.3f}\")\n", - " print(\"Return code:\", proc.returncode)\n", - " if proc.returncode != 0:\n", - " raise SystemExit(f\"{label} failed\")\n", - " return {\"label\": label, \"cmd\": cmd, \"elapsed_seconds\": elapsed, \"returncode\": proc.returncode, \"stdout\": proc.stdout}\n", - "\n", - "results = []\n", - "wall_t0 = time.perf_counter()\n", - "\n", - "results.append(run_cmd(\n", - " \"Public RPG Speedrun Runner\",\n", - " [\"python\", \"tools/run_public_rpg_speedrun.py\", \"--root\", \".\", \"--no-emoji\", \"--summary-json\", \"PUBLIC_RPG_RUN_SUMMARY.json\"],\n", - " PACKAGE_ROOT,\n", - "))\n", - "\n", - "results.append(run_cmd(\n", - " \"C03 Original Theorem Writeback Validator\",\n", - " [\"python\", \"tools/validate_c03_writeback.py\", \"--root\", \".\"],\n", - " PACKAGE_ROOT,\n", - "))\n", - "\n", - "results.append(run_cmd(\n", - " \"C04 Two-Way Official Statement Validation Data Validator\",\n", - " [\"python\", \"tools/validate_two_way_statement_validation.py\", \"--root\", \".\"],\n", - " PACKAGE_ROOT,\n", - "))\n", - "\n", - "wall_elapsed = time.perf_counter() - wall_t0\n", - "print(\"\\n\" + \"=\" * 88)\n", - "print(\"๐Ÿ COLAB SPEEDRUN VALIDATION COMPLETE\")\n", - "print(f\"Total wall-clock elapsed_seconds: {wall_elapsed:.3f}\")\n" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "ebbb2c5e", - "metadata": {}, - "outputs": [], - "source": [ - "# Cell 4 โ€” Print compact final summary and package result ZIP for download\n", - "summary_path = PACKAGE_ROOT / \"PUBLIC_RPG_RUN_SUMMARY.json\"\n", - "summary = {}\n", - "if summary_path.exists():\n", - " summary = json.loads(summary_path.read_text(encoding=\"utf-8\"))\n", - "\n", - "final_report = {\n", - " \"uploaded_file\": zip_path.name,\n", - " \"sha256\": actual_sha,\n", - " \"sha256_pass\": actual_sha == EXPECTED_SHA256,\n", - " \"package_root\": str(PACKAGE_ROOT),\n", - " \"total_elapsed_seconds_from_cells\": sum(r[\"elapsed_seconds\"] for r in results),\n", - " \"commands\": [{\"label\": r[\"label\"], \"elapsed_seconds\": r[\"elapsed_seconds\"], \"returncode\": r[\"returncode\"]} for r in results],\n", - " \"public_rpg_summary\": summary,\n", - " \"final_colab_status\": \"PASS\",\n", - "}\n", - "\n", - "out_dir = Path(\"/content/wfgy_speedrun_results\")\n", - "if out_dir.exists():\n", - " shutil.rmtree(out_dir)\n", - "out_dir.mkdir(parents=True, exist_ok=True)\n", - "\n", - "(out_dir / \"COLAB_VALIDATION_REPORT.json\").write_text(json.dumps(final_report, indent=2, ensure_ascii=False), encoding=\"utf-8\")\n", - "\n", - "log_text = []\n", - "for r in results:\n", - " log_text.append(\"=\" * 88)\n", - " log_text.append(r[\"label\"])\n", - " log_text.append(f\"elapsed_seconds: {r['elapsed_seconds']:.3f}\")\n", - " log_text.append(r[\"stdout\"])\n", - "(out_dir / \"COLAB_TERMINAL_OUTPUT.txt\").write_text(\"\\n\".join(log_text), encoding=\"utf-8\")\n", - "\n", - "# Copy package-generated summary if present.\n", - "if summary_path.exists():\n", - " shutil.copy2(summary_path, out_dir / \"PUBLIC_RPG_RUN_SUMMARY.json\")\n", - "\n", - "print(\"โœ… Final Colab status: PASS\")\n", - "print(\"SHA256:\", actual_sha)\n", - "print(\"Total command elapsed seconds:\", f\"{final_report['total_elapsed_seconds_from_cells']:.3f}\")\n", - "\n", - "# Show key lines from summary when available.\n", - "if summary:\n", - " print(\"\\nPublic RPG summary keys:\")\n", - " for key in [\"all_bosses_passed\", \"total_open_strict_debt_cells\", \"final_status\", \"c03_writeback_status\", \"two_way_statement_validation_status\", \"official_statement_intake_debt\", \"two_way_statement_validation_debt\"]:\n", - " if key in summary:\n", - " print(f\"{key}: {summary[key]}\")\n", - "\n", - "result_zip = shutil.make_archive(\"/content/WFGY_Seven_Millennium_Speedrun_Colab_Results\", \"zip\", out_dir)\n", - "print(\"\\n๐Ÿ“ฆ Result ZIP:\", result_zip)\n", - "files.download(result_zip)\n" - ] - } - ], - "metadata": { - "colab": { - "provenance": [], - "toc_visible": true - }, - "kernelspec": { - "display_name": "Python 3", - "name": "python3" - }, - "language_info": { - "name": "python" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -}