@@ -28,6 +28,24 @@ ELIMINATED. Honest test of the keep-vs-migrate forcing-decision
2828mechanism vs satisfying §5 by emptying the test set (per pythia #103
2929critique).
3030
31+ ** AMENDMENT per pythia #104 2026-04-24 (container-shape transferability):**
32+ The ` exception_table_ ` pilot validates ONLY the std::vector → typed-
33+ inline-array migration shape. Remaining 3 live Class B containers have
34+ DIFFERENT shapes that the vector-pilot does NOT predict transferability
35+ for:
36+ - ` block_map_ ` is hash-shape (2× std::unordered_map) — needs hash-table
37+ port, structurally different infra
38+ - ` static_method_stack_ ` is stack-shape (jit::Stack<Register* > LIFO) —
39+ needs stack port, different ops
40+ - ` temps_ ` is allocator-shape (TempAllocator class with state) —
41+ needs allocator port, fundamentally different from container
42+
43+ Each remaining container requires its OWN pilot OR explicit
44+ re-validation per shape. Phase A success on ` exception_table_ ` does
45+ not authorize 'pattern proven, do all 4'; full Tier 8 across all
46+ containers requires 4 separate pilot validations or a meta-spec
47+ demonstrating shape transferability.
48+
3149### 1.2 Out-of-scope
3250
3351- Porting ALL 4 live Class B containers (multi-Tier-8 workstream;
@@ -94,16 +112,35 @@ Concrete migration shape:
94112 ` findExceptionHandler ` shims; HIRBuilder no longer touches
95113 exception_table_ at all (PhxHirBuilderState owns it pure-C).
96114
97- ### 3.2 PhxArray prerequisite check
115+ ### 3.2 Container infrastructure (corrected per Tier 8 Step A grep)
116+
117+ Original spec assumed generic ` PhxArray<T> ` template existed; Step A
118+ grep verification (generalist 2026-04-24T01:11:34Z) found only:
119+ - ` PhxPtrArray ` (void* -only dynamic array; not POD-inline)
120+ - ` PhxStateMap ` (refcount-specific hash map; not generic)
121+
122+ No generic ` PhxArray<T> ` template exists. Three options surfaced:
123+
124+ (A) ` PhxPtrArray ` + per-entry malloc: reuses existing infra; heap
125+ fragmentation + malloc overhead per access.
126+ (B) ** NEW ` PhxExceptionTable ` typed inline-storage struct in
127+ ` builder_state_c.{h,c} ` ** : purpose-built; ~ 30L new C; no
128+ fragmentation; sets pilot precedent for per-container custom
129+ structs.
130+ (C) Defer pilot, file W47 generic ` PhxArray<T> ` template: bigger
131+ blast radius; multi-session template-design workstream itself.
98132
99- Existing PhxArray usage (refcount_pass C-port) covers:
100- - ` PhxArray_push(arr, &elem) ` — single-element push
101- - ` PhxArray_size(arr) → size_t `
102- - ` PhxArray_at(arr, i) → T* ` (or equivalent index access)
133+ ** ADOPTED: (B) per generalist 2026-04-24T01:11:34Z + theologian
134+ 2026-04-24T01:12:14Z + supervisor TBD.** Pilot's job is validating
135+ that ONE Class B can be ported, not laying full Tier-8 infrastructure
136+ simultaneously. Per spec §1.2 out-of-scope ('not re-architecting
137+ PhxArray API beyond what pilot needs'), (C) is over-engineered.
103138
104- If ` PhxArray<T> ` template is generic enough for ` ExceptionTableEntry `
105- (POD struct), pilot uses existing API as-is. If gaps surface, file
106- W47 PhxArray-extension spec before pilot Step 1.
139+ Post-pilot consideration: if (B) per-container custom struct (4
140+ containers = ~ 120L total infra) proves ugly across full Tier 8,
141+ W47 generic ` PhxArray<T> ` template SUPERSEDES via bulk refactor.
142+ (B) does not preclude (C); it sequences pilot first, generalization
143+ second.
107144
108145---
109146
@@ -164,18 +201,54 @@ Tier 8 pilot closure requires ALL:
164201 single bench <0.5x absolute).
1652029 . W45 §3.5 Fixture 3 amended to target C-side struct; still
166203 triggers build-fail.
167- 10 . ** Substantive C++-line burndown:** Phase 3 added +257L (B1-B6).
168- Tier 8 pilot must net-subtract enough that Phase 3+Tier-8
169- cumulative ≤ +0L (validates 'transitional foundation cost paid
170- back' framing, not 'permanent +257L scaffold').
171-
172- Estimated subtraction from pilot:
173- - 4 bridge impl bodies (~ 80L total, builder.cpp/builder_state_c.c)
174- - 4 bridge decls (~ 20L, builder_state_c.h)
175- - C++ struct + field + 2 method shims (~ 50L, builder.h + builder.cpp)
176- - Total estimate: ~ -150L (could bring B1-B6 +257L closer to ~ +107L
177- cumulative; full Tier-8 across all 4 Class B containers projects
178- net-negative)
204+ 10 . ** Substantive C++-line burndown (LINE delta):** Phase 3 added
205+ +257L (B1-B6). Pilot must net-subtract proportionally to its
206+ container scope; cumulative ≤+0L is the FULL Tier-8 endpoint
207+ (all 4 live Class B containers ported), NOT single-pilot
208+ endpoint per theologian 2026-04-24T01:14:29Z amendment.
209+
210+ Estimated per-container subtraction:
211+ - exception_table_ pilot ~ -48L (~ 19% of Phase 3 +257L); pure-
212+ C container infra cost (~ +25L PhxExceptionTable) offsets some
213+ bridge deletion (~ -73L)
214+ - block_map_ ~ -50L (1 bridge + hash port)
215+ - static_method_stack_ ~ -30L (1 bridge + Stack port)
216+ - temps_ ~ -50L (1 bridge + alloc port)
217+ - Full Tier 8 projection ~ -180L cumulative; Phase 3+full-Tier 8
218+ ~ +77L; further surface elimination beyond Class B (HirBuilder
219+ C++ class shim) needed for ≤+0L absolute.
220+
221+ 11 . ** Bridge-count delta acceptance (NEW per pythia #104 2026-04-24
222+ + supervisor 01:37:05Z):** Each Tier 8 pilot must NET-SUBTRACT
223+ bridges (or honestly add NEW bridges with W45 fixture coverage
224+ same-commit). Closes 'Phase A adds helper bridges silently'
225+ blind spot.
226+
227+ For exception_table_ pilot Phase A:
228+ - Net bridge delta = -3 (delete push_cpp + size_cpp + entry_cpp;
229+ keep find_exception_handler_c as algorithmic port)
230+ - If Phase A adds ANY new helper bridges to port buildHIRImpl:1198
231+ or emit_call_method_exception_handler_inline_c:2883, those
232+ MUST appear in the same commit's W45 fixture set + bridge-count
233+ delta becomes (-3 + new_count); spec acceptance requires net
234+ negative
235+ - W27a/W27b ZERO-new-bridge precedent (D-1776903189, D-1776904264)
236+ is the structural target — pilot should not silently break it
237+
238+ 12 . ** Phase B FORCING-FUNCTION (NEW per pythia #104 + supervisor
239+ 01:37:05Z):** Tier 8 SECOND-PILOT (block_map_ ) Step A is
240+ BLOCKED until exception_table_ Phase B commit lands. Phase B
241+ deletes C++ findExceptionHandler + parseExceptionTable shims +
242+ rewires builder.cpp:1198 + 2883 callers to PhxExceptionTable
243+ direct.
244+
245+ Rationale: prevents 'Phase B never lands' keep-bias-one-layer-
246+ deeper risk. Without forcing function, kept-shim-with-
247+ PhxExceptionTable-internals replaces kept-vector — identical
248+ retraction-debt shape with fresh _ cpp surface stacked atop.
249+ Block_map_ pilot represents the next opportunity to validate
250+ migrate-arm; gating it on Phase B closure ensures no
251+ half-migration accumulates.
179252
180253---
181254
0 commit comments