Commit 63568c0
committed
W3 Step 5 expansion: 4 injection classes + invariant python#7 (lifespan)
Push 44 W3 follow-up per supervisor 03:07:52Z + theologian 03:07:25Z:
- rc_oracle_self_test.sh: expand from 1 → 4 injection classes (A/B/C/D)
- _rc_oracle_adapter.h: add invariant python#7 (oracle lifespan policy)
to BRIDGE SPEC TEMPLATE (supersedes W12)
Per supervisor 03:07:52Z W4 vacuous-pass defeat directive:
"single-injection test is the W4 vacuous-pass class".
================================================================
PART 1: 4 INJECTION CLASSES (rc_oracle_self_test.sh)
================================================================
Generalized inject_class helper (sed → rebuild → diff → restore →
rebuild) replaces the hard-coded single-injection block.
Class A — refcount BALANCE under-count:
Skip FIRST phx_rc_emit_incref via line-comment.
Failure mode caught: under-count → leak under Py_REF_DEBUG.
Class B — refcount BALANCE over-count:
Skip FIRST phx_rc_emit_decref via line-comment.
Failure mode caught: over-count → leak (different mechanism than A).
Class C — refcount SEQUENCE:
Skip SECOND phx_rc_emit_incref (different call-site than A) via
line-comment.
Failure mode caught: HIR position-dependent divergence — same opcode
family as A but different injection position to test position
sensitivity.
Class D — TYPE LATTICE:
Change FIRST HIR_TYPE_OBJECT → HIR_TYPE_NULLPTR via sed.
Failure mode caught: type-annotation flip — wrong refcount semantics
for borrowed-vs-owned classification.
Each class:
1. sed transformation applied
2. cmp -s verifies source actually changed (catches stale sed pattern)
3. Rebuild C path
4. Run scripts/rc_diff_oracle.sh
5. PASS = non-empty diff (oracle CATCHES the divergence)
FAIL = empty diff under injection (oracle MISSED → non-functional)
6. Restore source from backup + rebuild
Default invocation runs all 4 classes sequentially. --class=A|B|C|D
runs single class. trap EXIT ensures restore on script error.
================================================================
PART 2: INVARIANT python#7 (_rc_oracle_adapter.h)
================================================================
Added to BRIDGE SPEC TEMPLATE INVARIANTS PRESERVED section per
theologian + supervisor 03:07:52Z (supersedes earlier W12 framing):
7. Oracle lifespan: utility decreases as emit methods diverge from
d81e580 baseline. RETIREMENT TRIGGER: when scripts/
rc_diff_oracle.sh on CLEAN run produces >30% pre/post divergence
noise, retire (archive script). ESTIMATED LIFESPAN: 30-50 pushes
from d81e580 (push 35) → retirement window ~push 65-85.
Re-evaluate at push 50 (testkeeper clean-diff noise % post).
Also added invariant python#6 inline (oracle scope conflated diff —
already in commit msg of a99db92 but missing from header file).
Falsifier section expanded to enumerate 4 classes (A/B/C/D) with
their distinct failure-mode coverage per Pythia python#58's vacuous-pass
concern.
================================================================
VERIFICATION
================================================================
bash -n scripts/rc_oracle_self_test.sh: SYNTAX OK (260 lines).
diff --cached --stat: 2 files, +142/-48 — only the 2 intended files
(verified explicit-staging discipline per supervisor 02:51:14Z).
Push 44 W3 batch grows to 3 commits:
a99db92 — W3 Steps 1-4 bundled (scratch lib + dispatcher)
4f591a1 — W3 Step 5 v1 (single class A)
THIS COMMIT — W3 Step 5 expansion (4 classes + invariant python#7)
ABBA cap 15 → 18.1 parent 4f591a1 commit 63568c0
2 files changed
Lines changed: 142 additions & 48 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
| 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 | + | |
44 | 70 | | |
45 | 71 | | |
46 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | | - | |
41 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
45 | 57 | | |
46 | 58 | | |
47 | 59 | | |
| |||
116 | 128 | | |
117 | 129 | | |
118 | 130 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 131 | + | |
123 | 132 | | |
124 | 133 | | |
125 | 134 | | |
126 | 135 | | |
127 | 136 | | |
128 | 137 | | |
129 | 138 | | |
130 | | - | |
131 | | - | |
132 | | - | |
| 139 | + | |
| 140 | + | |
133 | 141 | | |
134 | 142 | | |
135 | 143 | | |
136 | 144 | | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
145 | 154 | | |
146 | | - | |
147 | | - | |
| 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 | + | |
148 | 183 | | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
153 | 193 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
| 194 | + | |
| 195 | + | |
159 | 196 | | |
160 | 197 | | |
161 | | - | |
162 | 198 | | |
163 | | - | |
164 | | - | |
| 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 | + | |
165 | 235 | | |
166 | 236 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | 237 | | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
178 | 242 | | |
179 | 243 | | |
180 | 244 | | |
181 | 245 | | |
182 | 246 | | |
183 | 247 | | |
184 | | - | |
| 248 | + | |
185 | 249 | | |
| 250 | + | |
186 | 251 | | |
187 | | - | |
188 | | - | |
189 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
190 | 258 | | |
191 | 259 | | |
192 | 260 | | |
0 commit comments