Skip to content

Commit b92d85e

Browse files
committed
Phase 3 Batch 3: dead-state delete pending_b2_blocks_
Delete the pending_b2_blocks_ Class B vector + struct PendingBlock + drain loop in translate(). The W26-era refactor of emitInlineExceptionMatch removed all writers but left the queue declaration + drain plumbing as load-bearing-looking dead state. Independent grep verification (theologian 23:35:58Z + librarian 23:50:24Z + spec §2.1 grep-writers-before-Step-A discipline per pythia python#93): 4 reference sites, ZERO writers. Mutation patterns push_back/emplace_back/insert/operator[]/resize/assign/reserve all NOT FOUND across cpython/. PendingBlock struct unused outside the deleted field. Reframes Phase 3 spec §2 inventory: pending_b2_blocks_ marked DELETED in §2.1 errata; the §5 forcing-decision propagation validation is now deferred to Batch 4 (block_map_, the next Class B candidate) with mandatory pre-Step-A writer-grep per spec §2.1 amendment. NO new bridges, NO new W45 fixtures (delete-of-dead-state per shepard 22:46:33Z + supervisor 23:36:13Z carve-out). NOT counted toward W45 §3.5 5-batch backstop per supervisor 23:49:22Z (current count holds at 4: python#6+python#7 fold-into-C + Phase 3 Batch 1+2). Numstat (vs HEAD 1343895): Python/jit/hir/builder.cpp +0 -6 (drain loop + clear) Python/jit/hir/builder.h +0 -8 (struct + vector field) Python/jit/hir/builder_state_c.h +4 -3 (Class B doc-list refresh + dead-state footnote) TOTAL: NET -13L pure deletion (forecast -15L; -2L variance). Pre-commit compile-check: testkeeper 23:52:59Z BUILD_EXIT=0, 3-test sanity green (partial_conversions + W22 + W44). W44 gate: PASS (2 markers, 0 production callers). Authorization: theologian 23:35:58Z + supervisor 23:36:13Z (A) DEAD-DELETE only (split from getSimpleExceptInfo per theologian different-shape-bisect-granularity reasoning).
1 parent 1343895 commit b92d85e

3 files changed

Lines changed: 4 additions & 17 deletions

File tree

Python/jit/hir/builder.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2601,12 +2601,6 @@ void HIRBuilder::translate(
26012601
break;
26022602
}
26032603
}
2604-
// B2: drain pending blocks from emitInlineExceptionMatch.
2605-
for (auto& pb : pending_b2_blocks_) {
2606-
queue.emplace_back(pb.block, std::move(pb.frame));
2607-
}
2608-
pending_b2_blocks_.clear();
2609-
26102604
JIT_DCHECK(
26112605
tc.block->GetTerminator() != nullptr &&
26122606
!tc.block->GetTerminator()->IsSnapshot(),

Python/jit/hir/builder.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -626,14 +626,6 @@ class HIRBuilder {
626626
};
627627
std::vector<ExceptionTableEntry> exception_table_;
628628

629-
// B2: blocks that need to be added to the translation queue.
630-
// emitInlineExceptionMatch populates this; translate() drains it.
631-
struct PendingBlock {
632-
BasicBlock* block;
633-
FrameState frame;
634-
};
635-
std::vector<PendingBlock> pending_b2_blocks_;
636-
637629
// Parse co_exceptiontable into exception_table_
638630
void parseExceptionTable();
639631

Python/jit/hir/builder_state_c.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
* Class A members (5 immutable + nullable opaque pointers) extracted
77
* from HIRBuilder. Class B members (block_map_, exception_table_, etc.)
88
* remain C++-side and access via _cpp suffix bridges (push/clear/iterate)
9-
* until per-batch migration per spec §5 #1.
9+
* until per-batch migration per spec §5 #1. (pending_b2_blocks_ was
10+
* dead-state-deleted Phase 3 Batch 3 — zero writers post-W26 refactor.)
1011
*
1112
* Authorization: theologian 23:05:15Z + supervisor 23:02:34Z (Y) atomic.
1213
*/
@@ -23,8 +24,8 @@ extern "C" {
2324
/* PhxHirBuilderState — opaque holder for HIRBuilder Class A state.
2425
* code + preloader are immutable post-ctor; current_func/func/kwnames
2526
* mutate during translate()/emit. Subsequent batches add Class B
26-
* opaque pointers (block_map, exception_table, pending_b2_blocks,
27-
* temps, static_method_stack). */
27+
* opaque pointers (block_map, exception_table, temps,
28+
* static_method_stack). */
2829
typedef struct PhxHirBuilderState {
2930
void *code; /* PyCodeObject* (ctor, immutable) */
3031
const void *preloader; /* const Preloader& (ctor, immutable) */

0 commit comments

Comments
 (0)