Visitar URL original
docs: cinderx_dev oracle env-spec + W-PROTOCOL-CODIFY P11/P12 · SonicField/cpython@b9e20b5 · GitHub
Skip to content

Commit b9e20b5

Browse files
committed
docs: cinderx_dev oracle env-spec + W-PROTOCOL-CODIFY P11/P12
Push 61 bundle (doc-only, post push-60 100/100 PURE close). (1) docs/cinderx-oracle-env-spec.md (NEW, 5632 B): Theologian-authored env-spec per supervisor 01:30:42Z PRIORITY directive after cinderx_dev oracle attempt failed at 01:16:27Z (-X jit didn't activate JIT + cross-arch confound). Spec covers build equivalence, JIT activation verification (force_compile + is_jit_compiled, NOT -X jit alone), test-harness equivalence, warmup threshold handling, observed failure modes, application procedure for W-PERF-PRE-W27C-BISECT. (2) docs/w-protocol-codify-spec.md (P11 + P12): P11 — cinderx_dev Oracle Environment Specification: rule that any cinderx_dev oracle invocation MUST follow env-spec procedure. Origin: pythia D-1777065234 python#3 deferred ~10 days; closed by 01:32:28Z env-spec landing. P12 — Alex-Pending Escalations Not Self-Liftable: caps the self-lift precedent supervisor invoked at 00:04:33Z. Rule: no agent may self-lift an Alex-pending hold; alternative paths execute on their own merits without 'hold-lift' framing. Origin: pythia python#145 python#1 + python#147 python#2 + python#148 python#2. No code changes. Reference-only push.
1 parent 59222a8 commit b9e20b5

2 files changed

Lines changed: 182 additions & 0 deletions

File tree

‎docs/cinderx-oracle-env-spec.md‎

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# cinderx_dev Oracle Environment Specification
2+
3+
Canonical procedure for using cinderx_dev (devgpu004:~/local/cinderx_dev/cinderx)
4+
as Phoenix-vs-Cinder perf oracle. Closes the env-equivalence gap pythia
5+
D-1777065234 #3 flagged + assigned to theologian (deferred 2026-04-22, closed
6+
2026-04-26 post pythia #146 + supervisor 01:30:42Z directive).
7+
8+
## Why This Spec Exists
9+
10+
cinderx_dev oracle was attempted 2026-04-26T01:16:27Z to discriminate Phoenix
11+
W27c-introduced perf regressions from Cinder-inherited ones. Attempt FAILED:
12+
- cinderx_dev `-X jit` showed ZERO speedup vs no-JIT for 3 benches (JIT didn't
13+
activate at warmup threshold, OR `-X jit` is wrong invocation, OR
14+
interpreter-overhead dominated).
15+
- ARM64-only cinderx_dev cross-arched against x86_64 Phoenix readings further
16+
confounded the comparison.
17+
18+
Result: oracle could not discriminate. Phoenix-vs-Cinder verdict on perf
19+
remained unresolved. PROVISIONAL-PRE-EXISTING labeling could not promote to
20+
PRE-EXISTING per Alex feedback_assume_phoenix_regression.md.
21+
22+
This spec resolves the env-equivalence gap so future oracle invocations
23+
discriminate cleanly.
24+
25+
## Required Environment Equivalence
26+
27+
### 1. Build Equivalence
28+
29+
cinderx_dev binary on devgpu004 must match Phoenix build flags as closely as
30+
possible:
31+
- **Compiler**: clang (Phoenix uses clang 21 per memory; verify cinderx_dev
32+
also clang 21+)
33+
- **Optimization**: `-O2` (RelWithDebInfo) — matches `cinderx_dev build flags
34+
on devgpu004: NO PGO, NO LTO, RelWithDebInfo (-O2)` per project memory
35+
- **Phoenix x86_64 build**: also `-O2` non-LTO for fair comparison (LTO
36+
build is separate baseline; cinderx_dev has none, so use non-LTO Phoenix
37+
for oracle)
38+
- **Architecture**: prefer SAME-arch comparison. devgpu004 is ARM64; if
39+
Phoenix x86_64 readings are the regression source, build Phoenix on ARM64
40+
via nbs-remote-session devgpu004 + scripts/build_phoenix.sh and compare
41+
ARM64 Phoenix vs ARM64 cinderx_dev. Cross-arch comparison is INVALID.
42+
43+
### 2. JIT Activation Verification
44+
45+
cinderx_dev JIT activation cannot be assumed from `-X jit` flag alone.
46+
Verification REQUIRED:
47+
48+
```bash
49+
# Method 1: explicit compile + verify
50+
PYTHONPATH=/path/to/benchmark cinderx_dev_python -c "
51+
import cinderjit, benchmark_phoenix
52+
cinderjit.force_compile(benchmark_phoenix.bench_int_arith)
53+
assert cinderjit.is_jit_compiled(benchmark_phoenix.bench_int_arith), 'JIT not active'
54+
"
55+
```
56+
57+
If `cinderjit.force_compile` or `cinderjit.is_jit_compiled` are not exposed
58+
in cinderx_dev (different API), use Cinder-equivalent:
59+
```bash
60+
# Method 2: cinder API (verify via cinder.is_jit_compiled or _cinder)
61+
cinderx_dev_python -c "import _cinderjit; print(_cinderjit.get_runtime_helper_addr())"
62+
```
63+
64+
If neither method confirms JIT activation, the oracle reading is INVALID
65+
(JIT didn't run; comparison is interpreter-vs-Phoenix-JIT, not
66+
JIT-vs-JIT).
67+
68+
### 3. Test-Harness Equivalence
69+
70+
Same benchmark_phoenix.py harness (copy to devgpu004:/tmp/oracle_tools/),
71+
same `--reps=3` ABBA, same vanilla baseline (`../cpython-vanilla/python` on
72+
devgpu004 — note W-ARM64-VANILLA-INFRA debt: vanilla path may not exist on
73+
devgpu004, blocking ABBA; use targeted bench-only invocation with
74+
explicit timing if vanilla missing).
75+
76+
For targeted bench timing without vanilla baseline:
77+
```bash
78+
JIT_ENABLE=1 cinderx_dev_python -c "
79+
import time, benchmark_phoenix
80+
benchmark_phoenix.bench_int_arith(50000) # warmup
81+
times = []
82+
for _ in range(5):
83+
t0 = time.perf_counter()
84+
benchmark_phoenix.bench_int_arith(50000)
85+
times.append(time.perf_counter() - t0)
86+
print(f'median={sorted(times)[2]*1e3:.1f}ms')
87+
"
88+
```
89+
90+
Compare median directly between Phoenix-JIT and cinderx_dev-JIT (no vanilla
91+
needed for inheritance discrimination).
92+
93+
### 4. Warmup Threshold
94+
95+
cinderx_dev auto-compile threshold may differ from Phoenix (Phoenix=1000 per
96+
memory; cinderx_dev unknown). Use `cinderjit.force_compile` (Method 1) to
97+
bypass threshold uncertainty. If force_compile unavailable, run
98+
`bench(n_iter=50000)` first to amortize warmup, then time subsequent runs.
99+
100+
## Oracle Invocation Procedure
101+
102+
For ANY perf-regression discrimination question (Phoenix-introduced vs
103+
Cinder-inherited):
104+
105+
1. **Same-arch verify**: confirm Phoenix and cinderx_dev are same arch
106+
(ARM64 most common since cinderx_dev is on devgpu004). If Phoenix is
107+
x86_64-only and bench shows regression, build Phoenix ARM64 first.
108+
2. **JIT activation verify**: run Method 1 (force_compile + is_jit_compiled)
109+
on cinderx_dev. If verification fails, abort oracle — fix env first.
110+
3. **Targeted bench timing**: run targeted bench (Method 3) on both
111+
Phoenix-JIT and cinderx_dev-JIT, 5-run median.
112+
4. **Discrimination**:
113+
- cinderx_dev-JIT median ≈ Phoenix-JIT median → INHERITED (close as
114+
not-Phoenix-introduced).
115+
- cinderx_dev-JIT median significantly faster than Phoenix-JIT median
116+
→ PHOENIX-INTRODUCED (open bisect against cinderx_dev oracle as
117+
known-clean reference).
118+
119+
## Failure Modes (Observed 2026-04-26T01:16:27Z)
120+
121+
- **JIT didn't activate** (-X jit insufficient): use Method 1 force_compile.
122+
- **Cross-arch confound** (ARM64 cinderx_dev vs x86_64 Phoenix): build
123+
same-arch first.
124+
- **Vanilla baseline missing on devgpu004** (W-ARM64-VANILLA-INFRA debt):
125+
use targeted bench median instead of ABBA harness.
126+
127+
## Application
128+
129+
Next oracle invocation: try_except_callee + nn_module_forward
130+
discrimination per W-PERF-PRE-W27C-BISECT (push 60 PROVISIONAL-PRE-EXISTING
131+
labels). Apply this spec to obtain valid Phoenix-vs-Cinder verdict.
132+
133+
If oracle confirms INHERITED, PROVISIONAL → PRE-EXISTING (true).
134+
If oracle confirms PHOENIX-INTRODUCED, open bisect to localize commit.

‎docs/w-protocol-codify-spec.md‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,54 @@ methodology layer. Critically: P10 does NOT replace (B) — if variance
320320
check confirms regression, (B) still runs. P10 is a pre-filter, not
321321
a substitute.
322322

323+
### P11 — cinderx_dev Oracle Environment Specification
324+
**Origin:** pythia D-1777065234 #3 (deferred ~10 days) + supervisor
325+
2026-04-26T01:30:42Z PRIORITY directive after cinderx_dev oracle
326+
attempt failed to discriminate (01:16:27Z; -X jit didn't activate JIT,
327+
cross-arch confound).
328+
329+
**Rule:** ANY cinderx_dev oracle invocation for Phoenix-vs-Cinder
330+
attribution MUST follow the env-equivalence procedure documented at
331+
docs/cinderx-oracle-env-spec.md. Specifically: same-arch comparison +
332+
explicit JIT activation verification (cinderjit.force_compile +
333+
is_jit_compiled, NOT -X jit alone) + same harness + warmup-threshold
334+
handling.
335+
336+
**Why:** -X jit insufficient (didn't activate JIT in 01:16Z attempt);
337+
cross-arch (ARM64 cinderx_dev vs x86_64 Phoenix) confounds comparison;
338+
unverified JIT activation invalidates the oracle reading.
339+
340+
**Enforcement:** Oracle invoker cites env-spec doc + posts JIT-activation-
341+
verification output before reporting comparison verdict.
342+
343+
### P12 — Alex-Pending Escalations Not Self-Liftable
344+
**Origin:** pythia #145 #1 + #147 #2 + #148 #2 + supervisor 2026-04-26T02:28Z
345+
codification directive. Supervisor self-lifted Alex's open (A)/(B)/(C)
346+
escalation (D-1777156403, posted 22:24:47Z, ~3.5h cold) when (D) emerged
347+
at 00:02Z, citing terminal-goal alignment. Pythia caught + supervisor
348+
committed honest framing in Alex notification, but the lived precedent
349+
risks future agents citing 'supervisor may self-lift Alex-pending escalations
350+
when terminal-goal-aligned' for next deadline-pressured decision.
351+
352+
**Rule:** Once an escalation question is posted to Alex (any agent
353+
@alex'ing for direction), no agent may self-lift the hold while the
354+
question remains unanswered. If an alternative path emerges that
355+
appears to obviate the original question, execute the alternative path
356+
on its own merits — but DO NOT name it as 'lifting the hold'. Wait for
357+
Alex's response on the original question, even if the answer becomes
358+
moot.
359+
360+
**Enforcement:** Any agent posting 'hold lifted' / 'authorization moot' /
361+
'proceeding past escalation' on an Alex-pending question is in violation.
362+
Medic + shepard flag. The alternative path can ship; the hold-lift framing
363+
cannot.
364+
365+
**Why this rule:** Alex's escalations are governance, not just scope.
366+
Self-lifting under 'terminal-goal alignment' interpretation creates
367+
precedent for future self-authority that compounds across sessions.
368+
Caps the precedent: alternative paths execute independently, not as
369+
hold-resolution.
370+
323371
## Cross-Cutting Rules
324372

325373
### CC1 — Class-of-Bug Audit Triggered by Boundary Fix

0 commit comments

Comments
 (0)