Commit 7135d94
committed
builder: emitInlineExceptionMatch → C orchestrator (W27c #2a Cat B)
Per theologian W27c pair-batch design 00:08:52Z + supervisor (α)
local-accumulate posture. Conversion #2a in the 5-method PARTIAL
backlog (now 4 → 3 PARTIAL Cat-B remaining); paired with W27c #2b
emitCallExceptionHandler which reuses the same opcode-array helper.
Cat B residue elimination: pre-resolve loop that previously ran
on the C++ side (PyTuple_GET_ITEM(co_consts) for LOAD_CONST/
RETURN_CONST + getBlockAtOff for JUMP_BACKWARD*) is moved into
a new C helper build_inline_except_opcode_array_c in
builder_emit_c.c. Helper iterates via JitBytecodeInstr
(cinderx/Jit/bytecode_c.h), allocates via PyMem_RawMalloc, and
mirrors the original terminator-detection logic byte-for-byte
(RETURN_VALUE / RETURN_CONST / JUMP_BACKWARD* recognized; default
out-of-pass-through-set → deopt-terminator).
Signature change: hir_builder_emit_inline_exception_match_c drops
(opcodes, opcode_count) params; builds opcode array internally
from PyCodeObject (via tc->frame.code) + builder block_map +
except_body_offset. C++ stub shrinks from ~70 lines to ~25, just
picks getitem_fn and passes JITRT_MatchAndClearException pointer.
Helper is intentionally reusable for W27c #2b emitCallExceptionHandler
which has the same shape (handler bytecode iteration with same
pre-resolve + terminator semantics).
Honest ratio framing per librarian D-1776879377 / D-1776880214:
post-conversion 97/100 PURE-CONVERTED + 3 PARTIAL Cat-B remaining
(was 96/100 + 4 PARTIAL after W27c python#1). emitInlineExceptionMatch
is now a delegation stub with C-side residue elimination, not
pure-C++-eliminated; same metric reading as the established
honest-scope record.
Memory line 50 ('no Python.h in JIT C headers transitional') is
about HEADERS — .c TUs may include Python.h directly per existing
pattern in builder_emit_c.c (already includes Python.h via
hir_c_api.h transitively + cinderx/Common/code.h directly).
VERIFICATION (testkeeper 01:45:23Z + 05:39:16Z deferred-verify,
x86_64 release at this HEAD on top of 7bfb7d1 W27c python#1):
- Build: PASS (binary 1777081390)
- JIT smoke (force_compile add/mul/fib): PASS
- nbody crash check (3 iters identical): PASS
- W-RE-PARSER substrate-stability (3-outcome per generalist
00:19:14Z + pythia python#133 python#2 challenge): OUTCOME 1 confirmed —
same 4-method deopt-detach trace as pre-W27c-python#1 baseline AND
post-W27c-python#1 baseline (Tokenizer.__next + Tokenizer.match +
SubPattern.__getitem__ + SubPattern.getwidth detach → SEGV).
Substrate stable across W27c python#1+#2a; W-RE-PARSER repro
replayable. Pythia python#133 python#2 substrate-shift risk FALSIFIED.
- Phoenix CPython suite (43,990 tests, 499/511 modules):
ZERO new JIT regressions. 8 PreExistingProven env/infra
failures (test_gdb x2, test_cmd_line, test_pdb,
test_peg_generator, test_posixpath, test_urllib, test_urllib2)
match docs/gates/a45aa5b69c.log baseline. +1 expected
test_phoenix_re_parser_jit_crash sentinel SEGV (locally
un-skipped W-RE-PARSER, not part of this commit).
- ABBA 4-bench (docs/benchmarks/abba_w27c2a_2026-04-24.md):
fibonacci 2.28x / nqueens 1.61x / gen_simple 0.74x /
func_calls 0.99x → geo 1.28x ≥ 1.0x hard floor. Per-bench
parity with pinned baseline (fibonacci 2.18x baseline,
gen_simple 0.74x baseline EXACT match).
PUSH DEFERRED: per supervisor (α) accumulation. Bundle with
W27c python#1 (7bfb7d1) + queued W27c #2b for push 54 once ARM64
verify completes on devgpu004 (server reboot done; ARM64
connectivity restored 16:53Z).
Auth chain: theologian design 00:08:52Z + APPROVE 01:13:25Z;
supervisor (α) authorization 00:07:10Z + 00:50:09Z; testkeeper
01:45:23Z substrate-stability + 05:39:16Z full deferred-verify.1 parent 7bfb7d1 commit 7135d94
2 files changed
Lines changed: 109 additions & 49 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1347 | 1347 | | |
1348 | 1348 | | |
1349 | 1349 | | |
1350 | | - | |
1351 | | - | |
1352 | | - | |
| 1350 | + | |
1353 | 1351 | | |
1354 | 1352 | | |
1355 | 1353 | | |
| |||
1360 | 1358 | | |
1361 | 1359 | | |
1362 | 1360 | | |
1363 | | - | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
1364 | 1365 | | |
1365 | 1366 | | |
1366 | 1367 | | |
1367 | 1368 | | |
1368 | | - | |
1369 | | - | |
1370 | | - | |
1371 | | - | |
1372 | | - | |
1373 | | - | |
1374 | | - | |
1375 | | - | |
1376 | | - | |
1377 | | - | |
1378 | | - | |
1379 | | - | |
1380 | | - | |
1381 | | - | |
1382 | | - | |
1383 | | - | |
1384 | | - | |
1385 | | - | |
1386 | | - | |
1387 | | - | |
1388 | | - | |
1389 | | - | |
1390 | | - | |
1391 | | - | |
1392 | | - | |
1393 | | - | |
1394 | | - | |
1395 | | - | |
1396 | | - | |
1397 | | - | |
1398 | | - | |
1399 | | - | |
1400 | | - | |
1401 | | - | |
1402 | | - | |
1403 | | - | |
1404 | | - | |
1405 | | - | |
1406 | | - | |
1407 | 1369 | | |
1408 | 1370 | | |
1409 | 1371 | | |
| |||
1417 | 1379 | | |
1418 | 1380 | | |
1419 | 1381 | | |
1420 | | - | |
1421 | | - | |
1422 | | - | |
| 1382 | + | |
1423 | 1383 | | |
1424 | 1384 | | |
1425 | 1385 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
3204 | 3205 | | |
3205 | 3206 | | |
3206 | 3207 | | |
| 3208 | + | |
| 3209 | + | |
| 3210 | + | |
| 3211 | + | |
| 3212 | + | |
| 3213 | + | |
| 3214 | + | |
| 3215 | + | |
| 3216 | + | |
| 3217 | + | |
| 3218 | + | |
| 3219 | + | |
| 3220 | + | |
| 3221 | + | |
| 3222 | + | |
| 3223 | + | |
| 3224 | + | |
| 3225 | + | |
| 3226 | + | |
| 3227 | + | |
| 3228 | + | |
| 3229 | + | |
| 3230 | + | |
| 3231 | + | |
| 3232 | + | |
| 3233 | + | |
| 3234 | + | |
| 3235 | + | |
| 3236 | + | |
| 3237 | + | |
| 3238 | + | |
| 3239 | + | |
| 3240 | + | |
| 3241 | + | |
| 3242 | + | |
| 3243 | + | |
| 3244 | + | |
| 3245 | + | |
| 3246 | + | |
| 3247 | + | |
| 3248 | + | |
| 3249 | + | |
| 3250 | + | |
| 3251 | + | |
| 3252 | + | |
| 3253 | + | |
| 3254 | + | |
| 3255 | + | |
| 3256 | + | |
| 3257 | + | |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
| 3261 | + | |
| 3262 | + | |
| 3263 | + | |
| 3264 | + | |
| 3265 | + | |
| 3266 | + | |
| 3267 | + | |
| 3268 | + | |
| 3269 | + | |
| 3270 | + | |
| 3271 | + | |
| 3272 | + | |
| 3273 | + | |
| 3274 | + | |
| 3275 | + | |
| 3276 | + | |
| 3277 | + | |
| 3278 | + | |
| 3279 | + | |
| 3280 | + | |
| 3281 | + | |
| 3282 | + | |
| 3283 | + | |
| 3284 | + | |
| 3285 | + | |
| 3286 | + | |
| 3287 | + | |
| 3288 | + | |
| 3289 | + | |
| 3290 | + | |
| 3291 | + | |
| 3292 | + | |
| 3293 | + | |
| 3294 | + | |
| 3295 | + | |
| 3296 | + | |
| 3297 | + | |
3207 | 3298 | | |
3208 | 3299 | | |
3209 | 3300 | | |
| |||
3414 | 3505 | | |
3415 | 3506 | | |
3416 | 3507 | | |
3417 | | - | |
3418 | | - | |
3419 | | - | |
| 3508 | + | |
3420 | 3509 | | |
3421 | 3510 | | |
3422 | 3511 | | |
| 3512 | + | |
| 3513 | + | |
| 3514 | + | |
| 3515 | + | |
| 3516 | + | |
| 3517 | + | |
| 3518 | + | |
| 3519 | + | |
| 3520 | + | |
3423 | 3521 | | |
3424 | 3522 | | |
3425 | 3523 | | |
| |||
3442 | 3540 | | |
3443 | 3541 | | |
3444 | 3542 | | |
| 3543 | + | |
| 3544 | + | |
3445 | 3545 | | |
3446 | 3546 | | |
3447 | 3547 | | |
| |||
0 commit comments