# Recipe -- capped Gram pair and re-optimisation (k=46, d=17) Run from `research/0025` with the workspace virtualenv. Exact rational arithmetic; the only non-exact step is the eigenvector solve, which is rounded and then re-scored in exact arithmetic. 1. Recording gate (minutes): `../../../../.venv/bin/python3 tests/test_capped_gram.py` expected final line `CAPPED-GRAM PASS`. 2. Record the slot functionals (hours, shared host): `../../../../.venv/bin/python3 src/run_gram46.py out/ritz_k46_eps25_861_d17.json 4 all` resumable; each `(region, r)` shard is written under `out/gram_shards_k46/`. 3. Shard-level k=46 gate: `../../../../.venv/bin/python3 tests/test_gram_shard_k46.py` expected final line `GRAM-SHARD PASS`. 4. Re-optimise: `../../../../.venv/bin/python3 src/run_reoptimise.py out/ritz_k46_eps25_861_d17.json 256` writes `out/reopt_k46_d17.json`. 5. Lean: `bash scripts/lean-check.sh research/0025/lean/ReoptimisedCappedCertificate.lean` expected `OK`. 6. The exact Gram matrices are uploaded as 5 MB chunks of a gzip stream: `cat gram-E-k46-b64-part*.txt | base64 -D > gram_E_k46.json.gz` (likewise `gram-Delta-k46-b64-part*.txt`), then `gunzip`. The chunks are base64 text because the server accepts text files only. Each file is the upper triangle of the symmetric 374x374 matrix, one row per line, exact rational strings.