Spaces:
Running
Running
File size: 10,473 Bytes
7af61d3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | # Methods
---
<!-- trackio-cell
{"type": "markdown", "id": "cell_39086762c0a0", "created_at": "2026-07-21T14:19:41+00:00", "title": "CPU source protocol"}
-->
The author notebooks are executed from the pinned repository with Python 3.12 and CPU NumPy/SciPy/NashPy dependencies. The author ICML plotting preset requires a local latex executable; execution copies disable only matplotlib text.usetex. Algorithms, seeds, state spaces, trial counts, and numerical cells are unchanged.
---
<!-- trackio-cell
{"type": "code", "id": "cell_d034287a19fd", "created_at": "2026-07-21T14:34:07+00:00", "title": "Clean repeat: normal-form source notebook", "command": ["python", "repro/src/execute_notebook.py", "upstream/normal-form.ipynb", "outputs/executed/normal-form.repeat.no-tex.executed.ipynb", "--disable-tex"], "exit_code": 0, "duration_s": 617.437}
-->
````bash
$ python repro/src/execute_notebook.py upstream/normal-form.ipynb outputs/executed/normal-form.repeat.no-tex.executed.ipynb --disable-tex
````
exit 0 路 617.4s
````python title=execute_notebook.py
"""Execute one released notebook while retaining partial evidence on failure."""
from __future__ import annotations
import argparse
import sys
import time
from pathlib import Path
import nbformat
from nbclient import NotebookClient
def main() -> int:
parser = argparse.ArgumentParser()
parser.add_argument("notebook")
parser.add_argument("output")
parser.add_argument(
"--disable-tex",
action="store_true",
help="Disable only the unavailable LaTeX renderer in an execution copy.",
)
args = parser.parse_args()
source = Path(args.notebook)
output = Path(args.output)
output.parent.mkdir(parents=True, exist_ok=True)
notebook = nbformat.read(source, as_version=4)
if args.disable_tex:
for cell in notebook.cells:
if cell.cell_type != "code":
continue
source_text = cell.source
cell.source = source_text.replace(
"plt.rcParams.update(bundles.icml2024())",
'plt.rcParams.update({**bundles.icml2024(), "text.usetex": False})',
)
client = NotebookClient(notebook, timeout=3600, kernel_name="python3")
started = time.monotonic()
try:
with client.setup_kernel(cwd=str(source.parent)):
for index, cell in enumerate(notebook.cells):
if cell.cell_type != "code":
continue
print(f"EXECUTING_CELL={index}", flush=True)
client.execute_cell(cell, index, store_history=True)
nbformat.write(notebook, output)
except Exception as exc:
nbformat.write(notebook, output)
print(f"EXECUTION_FAILED={type(exc).__name__}: {exc}", file=sys.stderr)
return 1
print(f"EXECUTION_SECONDS={time.monotonic() - started:.3f}")
return 0
if __name__ == "__main__":
raise SystemExit(main())
````
````output
[IPKernelApp] WARNING | Kernel is running over TCP without encryption. All communication (including code and outputs) is sent in plain text and is susceptible to eavesdropping. Use IPC transport or launch with kernel manager-provisioned CurveZMQ keys to enable transport encryption.
EXECUTING_CELL=0
EXECUTING_CELL=1
EXECUTING_CELL=2
EXECUTING_CELL=3
EXECUTING_CELL=4
EXECUTION_SECONDS=615.918
````
---
<!-- trackio-cell
{"type": "code", "id": "cell_fa77144c6a3d", "created_at": "2026-07-21T14:52:01+00:00", "title": "Clean repeat: Grid Soccer source notebook", "command": ["python", "repro/src/execute_notebook.py", "upstream/soccer.ipynb", "outputs/executed/soccer.repeat.no-tex.executed.ipynb", "--disable-tex"], "exit_code": 0, "duration_s": 1048.418}
-->
````bash
$ python repro/src/execute_notebook.py upstream/soccer.ipynb outputs/executed/soccer.repeat.no-tex.executed.ipynb --disable-tex
````
exit 0 路 1048.4s
````python title=execute_notebook.py
"""Execute one released notebook while retaining partial evidence on failure."""
from __future__ import annotations
import argparse
import sys
import time
from pathlib import Path
import nbformat
from nbclient import NotebookClient
def main() -> int:
parser = argparse.ArgumentParser()
parser.add_argument("notebook")
parser.add_argument("output")
parser.add_argument(
"--disable-tex",
action="store_true",
help="Disable only the unavailable LaTeX renderer in an execution copy.",
)
args = parser.parse_args()
source = Path(args.notebook)
output = Path(args.output)
output.parent.mkdir(parents=True, exist_ok=True)
notebook = nbformat.read(source, as_version=4)
if args.disable_tex:
for cell in notebook.cells:
if cell.cell_type != "code":
continue
source_text = cell.source
cell.source = source_text.replace(
"plt.rcParams.update(bundles.icml2024())",
'plt.rcParams.update({**bundles.icml2024(), "text.usetex": False})',
)
client = NotebookClient(notebook, timeout=3600, kernel_name="python3")
started = time.monotonic()
try:
with client.setup_kernel(cwd=str(source.parent)):
for index, cell in enumerate(notebook.cells):
if cell.cell_type != "code":
continue
print(f"EXECUTING_CELL={index}", flush=True)
client.execute_cell(cell, index, store_history=True)
nbformat.write(notebook, output)
except Exception as exc:
nbformat.write(notebook, output)
print(f"EXECUTION_FAILED={type(exc).__name__}: {exc}", file=sys.stderr)
return 1
print(f"EXECUTION_SECONDS={time.monotonic() - started:.3f}")
return 0
if __name__ == "__main__":
raise SystemExit(main())
````
````output
[IPKernelApp] WARNING | Kernel is running over TCP without encryption. All communication (including code and outputs) is sent in plain text and is susceptible to eavesdropping. Use IPC transport or launch with kernel manager-provisioned CurveZMQ keys to enable transport encryption.
EXECUTING_CELL=0
EXECUTING_CELL=1
EXECUTING_CELL=2
EXECUTING_CELL=3
EXECUTION_SECONDS=1046.858
````
---
<!-- trackio-cell
{"type": "artifact", "id": "cell_63cb088708f6", "created_at": "2026-07-21T14:52:01+00:00", "title": "Artifact: nash_history.csv", "path": "upstream/results/soccer/nash_history.csv", "size": 2582, "artifact_type": "dataset", "auto": true}
-->
**馃摝 Artifact** `upstream/results/soccer/nash_history.csv` 路 dataset 路 2.6 kB
https://huggingface.co/buckets/DineshAI/hXO2OP0T4w-artifacts#logbook-files/upstream/results/soccer/nash_history.csv
---
<!-- trackio-cell
{"type": "artifact", "id": "cell_1a23e2da7e15", "created_at": "2026-07-21T14:52:01+00:00", "title": "Artifact: afraid_history.csv", "path": "upstream/results/soccer/afraid_history.csv", "size": 2556, "artifact_type": "dataset", "auto": true}
-->
**馃摝 Artifact** `upstream/results/soccer/afraid_history.csv` 路 dataset 路 2.6 kB
https://huggingface.co/buckets/DineshAI/hXO2OP0T4w-artifacts#logbook-files/upstream/results/soccer/afraid_history.csv
---
<!-- trackio-cell
{"type": "code", "id": "cell_357a97a5012a", "created_at": "2026-07-21T14:53:26+00:00", "title": "Clean repeat: Predator-Prey source notebook", "command": ["python", "repro/src/execute_notebook.py", "upstream/predator-prey.ipynb", "outputs/executed/predator-prey.repeat.no-tex.executed.ipynb", "--disable-tex"], "exit_code": 0, "duration_s": 72.002}
-->
````bash
$ python repro/src/execute_notebook.py upstream/predator-prey.ipynb outputs/executed/predator-prey.repeat.no-tex.executed.ipynb --disable-tex
````
exit 0 路 72.0s
````python title=execute_notebook.py
"""Execute one released notebook while retaining partial evidence on failure."""
from __future__ import annotations
import argparse
import sys
import time
from pathlib import Path
import nbformat
from nbclient import NotebookClient
def main() -> int:
parser = argparse.ArgumentParser()
parser.add_argument("notebook")
parser.add_argument("output")
parser.add_argument(
"--disable-tex",
action="store_true",
help="Disable only the unavailable LaTeX renderer in an execution copy.",
)
args = parser.parse_args()
source = Path(args.notebook)
output = Path(args.output)
output.parent.mkdir(parents=True, exist_ok=True)
notebook = nbformat.read(source, as_version=4)
if args.disable_tex:
for cell in notebook.cells:
if cell.cell_type != "code":
continue
source_text = cell.source
cell.source = source_text.replace(
"plt.rcParams.update(bundles.icml2024())",
'plt.rcParams.update({**bundles.icml2024(), "text.usetex": False})',
)
client = NotebookClient(notebook, timeout=3600, kernel_name="python3")
started = time.monotonic()
try:
with client.setup_kernel(cwd=str(source.parent)):
for index, cell in enumerate(notebook.cells):
if cell.cell_type != "code":
continue
print(f"EXECUTING_CELL={index}", flush=True)
client.execute_cell(cell, index, store_history=True)
nbformat.write(notebook, output)
except Exception as exc:
nbformat.write(notebook, output)
print(f"EXECUTION_FAILED={type(exc).__name__}: {exc}", file=sys.stderr)
return 1
print(f"EXECUTION_SECONDS={time.monotonic() - started:.3f}")
return 0
if __name__ == "__main__":
raise SystemExit(main())
````
````output
[IPKernelApp] WARNING | Kernel is running over TCP without encryption. All communication (including code and outputs) is sent in plain text and is susceptible to eavesdropping. Use IPC transport or launch with kernel manager-provisioned CurveZMQ keys to enable transport encryption.
EXECUTING_CELL=0
EXECUTING_CELL=1
EXECUTION_SECONDS=70.454
````
---
<!-- trackio-cell
{"type": "artifact", "id": "cell_677f1c21d86e", "created_at": "2026-07-21T14:53:26+00:00", "title": "Artifact: history.csv", "path": "upstream/results/predator-prey/history.csv", "size": 1609, "artifact_type": "dataset", "auto": true}
-->
**馃摝 Artifact** `upstream/results/predator-prey/history.csv` 路 dataset 路 1.6 kB
https://huggingface.co/buckets/DineshAI/hXO2OP0T4w-artifacts#logbook-files/upstream/results/predator-prey/history.csv
|