Repository navigation
Commit c2f255e
committed
hir/builder: §4.A.5 probe — migrate kwnames_ to PhxHirBuilderState
Pythia python#188 class-state-extraction PROBE (supervisor 2026-04-27T09:36:01Z
authored §4.A.5; supervisor 09:45:06Z accepted in-session execution;
theologian patch-shape APPROVE 09:49:24Z). Pilot-5 dry-run on the
simplest Class A field — kwnames_, the most-recent KW_NAMES Register*
slot — to surface class-state extraction failure modes (silent drift,
mutator-site enumeration miss, JIT_DCHECK equality drift) BEFORE
Phase 4.C burns 33-53 commits on harder containers.
Migration is single-commit + same-instant deletion:
Python/jit/hir/builder.h
Delete the C++ field 'Register* kwnames_{nullptr};'. Update the
Class A mirror comment (line 693-697) to reflect kwnames_ removal
+ document the §4.A.5 probe entry.
Python/jit/hir/builder.cpp
builder.cpp:2538 — sole C++ direct read site rewritten to
state_.kwnames == nullptr (post-translate KW_NAMES-stash invariant).
builder.cpp:2928-2935 — extern "C" hir_builder_get/set_kwnames
bridge bodies redirected to state_.kwnames; the static_cast<void*>
/ static_cast<Register*> drop because state_.kwnames is already
void* — no implicit conversion.
Mutator-site enumeration: ALL writes go through hir_builder_set_kwnames
(2 callers in builder_emit_c.c:968 + 3878); ALL reads go through
hir_builder_get_kwnames (3 callers in builder_emit_c.c:962 + 3857) +
the 1 direct-read C++ site at builder.cpp:2538. Zero C++ direct write
sites outside the bridge body — audited.
JIT_DCHECK equality (spec §4.A.5 step 3) is moot in the single-commit
migration: the C++ field is deleted in the same commit that redirects
the bridges, so no parallel state can drift. Theologian 09:49:24Z noted
the spec wording was overconservative for the single-commit case.
Falsifier (§6 python#5 grep-rule) result post-migration:
grep -nE '\\bkwnames_\\b' Python/jit/hir/builder.cpp
→ ZERO HITS. Field name is no longer anywhere in the codebase.
Build + ABBA: scripts/build_phoenix.sh --clean PASS (testkeeper
09:55:03Z). 4-bench ABBA GEO-MEAN 1.28x (matches BLME batch 2 baseline);
gen_simple 0.75x is pre-existing (BLME batch 2 0.74x; push-59 baseline
0.70x; same-session stable, structural causal absence — kwnames_
touches KW-arg dispatch not generator FRAME ops). No >5% drop trigger;
well above 1.0x floor.
Acceptance per spec §4.A.5: ABBA clean + zero functional regressions =
probe PASS = Class A delete approach VALIDATED for Pilot 5 across the
remaining Class A fields (code_ 46 sites, current_func_ ~30,
preloader_ 28, func_, static_method_stack_).1 parent 9958ef1 commit c2f255e
2 files changed
Lines changed: 10 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2535 | 2535 | | |
2536 | 2536 | | |
2537 | 2537 | | |
2538 | | - | |
| 2538 | + | |
2539 | 2539 | | |
2540 | 2540 | | |
2541 | 2541 | | |
| |||
2927 | 2927 | | |
2928 | 2928 | | |
2929 | 2929 | | |
2930 | | - | |
| 2930 | + | |
2931 | 2931 | | |
2932 | 2932 | | |
2933 | 2933 | | |
2934 | 2934 | | |
2935 | | - | |
| 2935 | + | |
2936 | 2936 | | |
2937 | 2937 | | |
2938 | 2938 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
685 | 685 | | |
686 | 686 | | |
687 | 687 | | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | 688 | | |
692 | 689 | | |
693 | 690 | | |
694 | | - | |
695 | | - | |
696 | | - | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
697 | 698 | | |
698 | 699 | | |
699 | 700 | | |
| |||
0 commit comments