|
| 1 | +# c2 Substrate Fallback Procedure (devgpu004 decay scenario) |
| 2 | + |
| 3 | +**Authored:** 2026-05-12 ~13:00Z by generalist (per supervisor 12:55:33Z dispatch, pythia #353 |
| 4 | +extended-block-contingency commitment). |
| 5 | + |
| 6 | +**Scope:** read-only investigation + procedure draft for the case where devgpu004 substrate |
| 7 | +(HEAD 97e33890648e on `/home/alexturner/local/phoenix/cpython` + ARM64 binary |
| 8 | +`1444034d3af09fb18ef341b1fe6e8886` + `/tmp/c2-series-1419c1261e/` patches) becomes |
| 9 | +unavailable BEFORE Alex `data_staging` broadcast lands and c2 push completes. |
| 10 | + |
| 11 | +**No actual spawn until decay observed.** This document is a contingency, not an active plan. |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +## (a) Alternative ARM64 host availability |
| 16 | + |
| 17 | +**No alternative ARM64 host is documented in the Phoenix repo.** |
| 18 | + |
| 19 | +Surveyed: `cpython/docs/`, `CLAUDE.md`. Only `devgpu004.kcm2.facebook.com` (aarch64) appears |
| 20 | +in operational records. `devgpu009.ncg6.facebook.com` is x86_64 (per |
| 21 | +`docs/benchmarks/abba_x86_64_20260416.md`) and not a substitute. |
| 22 | + |
| 23 | +**Action required if decay:** escalate to Alex for alt ARM64 host provisioning. The team |
| 24 | +does not autonomously provision new dev hosts — Phoenix-team-internal coordination needed. |
| 25 | +Likely candidates by naming convention (UNVERIFIED, requires Alex confirmation): |
| 26 | +`devgpu00{1,2,3,5,6,7,8}.kcm2` or any other `*.kcm2` aarch64 box she has access to. |
| 27 | + |
| 28 | +**Pre-warmed state on alt host (none):** zero alt ARM64 substrate exists today. A fresh |
| 29 | +spawn would start from a 524 MB bundle clone (see (b)) plus full clean build (~10–15 min |
| 30 | +per prior precedent on devgpu004). |
| 31 | + |
| 32 | +--- |
| 33 | + |
| 34 | +## (b) Bundle file size + transport mechanism |
| 35 | + |
| 36 | +| Artifact | Size | Path (x86_64 origin) | Use | |
| 37 | +|---|---|---|---| |
| 38 | +| 4-patch series for c2 chain | 65 KB total (4 files, largest 37.6 KB) | `/tmp/c2-series-1419c1261e/` | Apply onto c1-tree to reach c2 | |
| 39 | +| Git bundle of 4-commit chain (`56fed762a5..1419c1261e`, `--branches`) | 67 KB | `/tmp/c2-test.bundle` (sample) | Single-file alternative to patch series | |
| 40 | +| Full-repo bundle (existing snapshot, ~3 weeks stale) | 524 MB | `/data/users/alexturner/phoenix/phoenix-arm64.bundle` | Bare-host bootstrap | |
| 41 | + |
| 42 | +**Transport mechanism (verified working 2026-05-12):** |
| 43 | + |
| 44 | +- Direct `scp <local> devgpu004.kcm2.facebook.com:<remote>` succeeds from the x86_64 dev |
| 45 | + host without a proxy — md5 round-trip on `/tmp/c2-series-1419c1261e/` matched byte-for-byte |
| 46 | + in this session. (CLAUDE.md "Push & Remote Access Protocol" claim that direct ssh/scp is |
| 47 | + blocked is stale for the patch-series case — direct works.) |
| 48 | +- For `git push` to GitHub the canonical wrapper is still `nbs-local-run |
| 49 | + /data/users/alexturner/phoenix/push.sh`; that constraint is unchanged and unrelated to |
| 50 | + ARM64 substrate respawn. |
| 51 | +- `nbs-ts send <session-handle> '<cmd>'` for in-session commands on devgpu004 — verified |
| 52 | + via session `99e77ed3` in this cycle. |
| 53 | +- Dual recovery for c2 itself: (1) reflog/dangling commit on x86_64 |
| 54 | + (`63718ca58b21029dd22a4f860579a7d1666500d6`) (2) format-patch |
| 55 | + `0004-Phase-5.B-commit-2-delete-legacy-parser.cpp-text-map.patch` (37,620 bytes, |
| 56 | + sha256 `226442c922e1bb4bd5fb35914ccf3d01b0b17edfcb4258cfe5ea1a7d24a8616e` per testkeeper |
| 57 | + Step 0 11:50:19Z; identical content re-emitted today as |
| 58 | + `0004-...patch`). |
| 59 | +- Full-repo bundle is ~3 weeks stale (Apr 23) — usable as a starting point for a bare alt |
| 60 | + host but the c1+c2 chain still needs the 4-patch (or refreshed bundle) on top. |
| 61 | + |
| 62 | +Patch-id of c2 (invariant across all reproductions): `8fc3493dbe2655a2d15e6aa6ec4a7901cfada9b2`. |
| 63 | +This is the canonical content check that must hold on any spawned ARM64 substrate. |
| 64 | + |
| 65 | +--- |
| 66 | + |
| 67 | +## (c) Saved-binary md5 (current operational reference) |
| 68 | + |
| 69 | +| Field | Value | |
| 70 | +|---|---| |
| 71 | +| Path on devgpu004 | `/home/alexturner/local/phoenix/cpython/python` | |
| 72 | +| md5 | `1444034d3af09fb18ef341b1fe6e8886` | |
| 73 | +| Size | 56,223,088 bytes | |
| 74 | +| Built from | ARM64 HEAD `d5fd126080c3e8f565b15b3863cd0390f717bc71` (tree-equivalent to x86_64 `1419c1261e`) | |
| 75 | +| Build mtime | 2026-05-12 05:12 (devgpu004 local) | |
| 76 | +| Build mode | release (no `--pydebug`, per build script defaults) | |
| 77 | +| Build wrapper | `scripts/build_phoenix.sh --clean` | |
| 78 | +| Verifier | `python --version` → `Python 3.12.13` | |
| 79 | + |
| 80 | +For a respawn, parity is established when a fresh build on an alt host produces a binary |
| 81 | +whose tree-equivalent commit has patch-id `8fc3493dbe2655a2d15e6aa6ec4a7901cfada9b2` and |
| 82 | +whose `python --version` matches `3.12.13`. Binary md5 will NOT match across hosts (build |
| 83 | +timestamps + machine-id differ); md5 is useful only as a same-host integrity check. |
| 84 | + |
| 85 | +**No off-host binary backup exists today.** If devgpu004 loses its filesystem, the binary |
| 86 | +must be rebuilt from sources. Build time on devgpu004 was ~5 minutes for clean release per |
| 87 | +this session (12:09–12:13Z observed). |
| 88 | + |
| 89 | +--- |
| 90 | + |
| 91 | +## (d) Build-env compatibility check |
| 92 | + |
| 93 | +Verified on devgpu004 in this cycle (session `99e77ed3`): |
| 94 | + |
| 95 | +| Tool | Path | Version | PATH-discovery | |
| 96 | +|---|---|---|---| |
| 97 | +| `cmake` | `/home/alexturner/.local/bin/cmake` | `4.3.2` | **NOT in default login PATH.** Must `export PATH="$HOME/.local/bin:$PATH"` before invoking `scripts/build_phoenix.sh`. First build attempt this cycle failed at the `cmake` configure step because of this. | |
| 98 | +| `clang` / `clang++` | `/usr/bin/` (assumed, found by configure) | configure-detected | OK in default PATH | |
| 99 | +| `make` | `/usr/bin/make` | OK in default PATH | |
| 100 | +| `git` | `/usr/bin/git` | OK in default PATH | |
| 101 | +| `module` (env modules) | shell function | available; no `cmake` modulefile present (`module avail cmake` empty) | |
| 102 | +| `sccache` | not surveyed | unknown — configure does not require it | |
| 103 | + |
| 104 | +**Build script entrypoint:** `scripts/build_phoenix.sh --clean` (release) / |
| 105 | +`scripts/build_phoenix.sh --clean --pydebug` (debug). Per `feedback_build_scripts`, never |
| 106 | +hand-roll. Per `feedback_pydebug_first_for_segv`, runtime SEGV first move = `--clean |
| 107 | +--pydebug`. |
| 108 | + |
| 109 | +**ARM64-specific build notes (per CLAUDE.md):** |
| 110 | + |
| 111 | +- Do NOT use `--with-lto` on ARM64 (too slow for dev builds — older guidance in |
| 112 | + `docs/devgpu004-sync.md` line 69; current `build_phoenix.sh` does not enable LTO by |
| 113 | + default). |
| 114 | +- `--pydebug` mandatory for ARM64 runtime correctness gates per |
| 115 | + `feedback_pydebug_gate`; release-build is fine for ABBA + Tier 1 but not for SEGV |
| 116 | + triage. |
| 117 | + |
| 118 | +**Working-tree path on devgpu004:** `/home/alexturner/local/phoenix/cpython` — current |
| 119 | +operational location. `docs/devgpu004-sync.md` recommends `/data/users/$USER/phoenix-cpython` |
| 120 | +for I/O speed; that recommendation is stale (current ops use `/home`, slow but |
| 121 | +authoritative). A respawn on a fresh alt host should follow current ops practice and use |
| 122 | +`/home/$USER/local/phoenix/cpython`. |
| 123 | + |
| 124 | +--- |
| 125 | + |
| 126 | +## Fallback procedure (decay-triggered) |
| 127 | + |
| 128 | +Trigger condition (any of): |
| 129 | + |
| 130 | +1. devgpu004 unreachable via SSH for >15 min after a previously-working session. |
| 131 | +2. `/tmp/c2-series-1419c1261e/` removed (e.g., `/tmp` reaped by host policy) AND no |
| 132 | + in-session shell holds the patches. |
| 133 | +3. ARM64 working tree at `/home/alexturner/local/phoenix/cpython` shows tree-state |
| 134 | + inconsistent with `d5fd126080` HEAD (e.g., uncommitted modifications, missing files). |
| 135 | + |
| 136 | +**Step 0 — confirm decay (do not spawn on hypothesis):** |
| 137 | + |
| 138 | +```bash |
| 139 | +ssh devgpu004.kcm2.facebook.com 'echo OK' || echo DECAY_PROBABLE |
| 140 | +ssh devgpu004.kcm2.facebook.com 'ls /tmp/c2-series-1419c1261e/ 2>&1; cd /home/alexturner/local/phoenix/cpython && git rev-parse HEAD && git status --short' |
| 141 | +``` |
| 142 | + |
| 143 | +Expected on healthy substrate: `OK`, 4 patch files, HEAD `d5fd126080...`, only the 5 |
| 144 | +benchmark `.txt` files untracked. |
| 145 | + |
| 146 | +**Step 1 — if patches missing but host healthy: re-transport from x86_64.** |
| 147 | + |
| 148 | +```bash |
| 149 | +# On x86_64 dev host: |
| 150 | +scp -r /tmp/c2-series-1419c1261e devgpu004.kcm2.facebook.com:/tmp/ |
| 151 | +# Verify md5 on both ends; the 4 sha256 hashes are recorded in |
| 152 | +# generalist 12:11Z chat post and in this cycle's nbs-ts log. |
| 153 | +``` |
| 154 | + |
| 155 | +If `/tmp/c2-series-1419c1261e` is also missing on x86_64: |
| 156 | + |
| 157 | +```bash |
| 158 | +# Regenerate from canonical x86_64 HEAD (1419c1261e): |
| 159 | +mkdir -p /tmp/c2-series-1419c1261e |
| 160 | +git format-patch 56fed762a5..1419c1261e -o /tmp/c2-series-1419c1261e/ |
| 161 | +# Then scp as above. |
| 162 | +``` |
| 163 | + |
| 164 | +**Step 2 — if working tree corrupted but host healthy: re-apply from c1.** |
| 165 | + |
| 166 | +```bash |
| 167 | +# On devgpu004 (assuming arm64-5b-c1-test still at 97e33890648e): |
| 168 | +cd /home/alexturner/local/phoenix/cpython |
| 169 | +git reset --hard 97e33890648e # back to c1 ARM64 baseline |
| 170 | +export PATH="$HOME/.local/bin:$PATH" |
| 171 | +git am /tmp/c2-series-1419c1261e/*.patch |
| 172 | +scripts/build_phoenix.sh --clean |
| 173 | +# Verify: HEAD patch-id == 8fc3493dbe2655a2d15e6aa6ec4a7901cfada9b2 |
| 174 | +``` |
| 175 | + |
| 176 | +**Step 3 — if devgpu004 fully unrecoverable: alt-host spawn (requires Alex coordination).** |
| 177 | + |
| 178 | +a. Escalate to Alex with this document, request alt ARM64 host. |
| 179 | +b. On alt host: |
| 180 | + ```bash |
| 181 | + # Initial clone — preferred: full bundle if accessible |
| 182 | + scp /data/users/alexturner/phoenix/phoenix-arm64.bundle <alt-host>:/tmp/ |
| 183 | + ssh <alt-host> 'cd /home/$USER/local/phoenix && git clone /tmp/phoenix-arm64.bundle cpython' |
| 184 | + # Then bring HEAD up to c1 (97e33890648e equivalent), apply 4-patch series, build. |
| 185 | + # Verify: cmake at ~/.local/bin or install (cmake 4.3.2 minimum tested). |
| 186 | + ``` |
| 187 | +c. ETA: ~30 min for clone + ~5 min build + verification. |
| 188 | + |
| 189 | +**Step 4 — verify spawn:** |
| 190 | + |
| 191 | +``` |
| 192 | +- HEAD patch-id: 8fc3493dbe2655a2d15e6aa6ec4a7901cfada9b2 (CANONICAL c2 content) |
| 193 | +- python --version: Python 3.12.13 |
| 194 | +- numstat: 6 files, 17 insertions(+), 869 deletions(-) |
| 195 | +- Files touched (all in Python/jit/lir/): |
| 196 | + c_helper_translations.{c,h}, inliner_c.c, lir_impl_internal.h, parser.{cpp,h} |
| 197 | +``` |
| 198 | + |
| 199 | +Report parity to chat with the new binary md5 + size + new HEAD SHA. Then re-enter the |
| 200 | +sequence at supervisor's "step 4" (ARM64 Tier 1). |
| 201 | + |
| 202 | +--- |
| 203 | + |
| 204 | +## What is NOT covered |
| 205 | + |
| 206 | +- Alt-host provisioning — out of scope for generalist; needs Alex. |
| 207 | +- Restoring x86_64 substrate decay — orthogonal; x86_64 substrate is at |
| 208 | + `/data/users/alexturner/phoenix/cpython` HEAD `1419c1261e`, with c2 reachable both as a |
| 209 | + current commit and as a dangling reflog entry (`63718ca58b`). Local-only loss would |
| 210 | + re-enter via the same patch series from any other team member's clone. |
| 211 | +- Concurrent-write conflicts — see `feedback_phxmem_zeroinit_trap` and |
| 212 | + related `feedback_falsifier_restore_clobbers_unstaged` for the script-level pitfalls. |
| 213 | +- ASGuard data_staging unblock — orthogonal, requires Alex broadcast (the original |
| 214 | + blocker driving this contingency). |
0 commit comments