Skip to content

Commit 154997b

Browse files
committed
gate_phoenix: extend wiring fixture to n>=294 (block_map_n294_chain)
Closes pythia python#119 (a) PhxBlockMap hash-clustering coverage gap deferred from Phase A push 39 (theologian 11:20:24Z + supervisor 11:20:43Z DEFER: separate from Phase B for clean revert boundary; sequence-isolated per shepard 11:11:59Z). Gap: the previous block_map_resize_chain (10 if-return arms, ~25 block_starts) trips PhxBlockMap_resize at insert python#12 but does not exercise the 5 sequential resizes (16->32->64->128->256->512) that re._parser:Tokenizer.__next at 294 blocks drives in production (D2 measurement 2026-04-24). Fix: add block_map_n294_chain — 110-arm if-return chain (~330 block_starts) generated via exec to keep the source compact. force_compile must succeed across n=0/54/109/200 (3 in-range hits + 1 default-arm miss); proves Knuth multiplicative h=key*2654435761u clusters acceptably at production- scale BCOffset density. NO production code change. Pure test/fixture extension. Pre-commit discipline satisfied via testkeeper bash -n syntax lint + diff-scope confirmation (testkeeper 11:33:43Z): no C/C++ source touched, Phase B binary 4145fe3 remains current. Auth chain: theologian patch-shape APPROVE 11:33:03Z; testkeeper pre- commit lint PASS 11:33:43Z.
1 parent 4145fe3 commit 154997b

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎scripts/gate_phoenix.sh‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,22 @@ def block_map_resize_chain(n):
441441
if n == 9: return 'j'
442442
return 'z'
443443
444+
# Tier 8 SECOND-PILOT Phase A pythia #119 (a) followup (theologian
445+
# 11:20:24Z + supervisor 11:20:43Z DEFER): n=294-class hash-clustering
446+
# coverage. block_map_resize_chain (10 arms) trips first resize at
447+
# insert #12 but does not exercise the 5 sequential resizes
448+
# (16->32->64->128->256->512) that re._parser:Tokenizer.__next at 294
449+
# blocks drives in production. This generates a 110-arm if-return chain
450+
# (~330 block_starts) via exec to keep the source compact; force_compile
451+
# must succeed AND produce the correct result for sampled arms -- proves
452+
# Knuth multiplicative h=key*2654435761u clusters acceptably at
453+
# production-scale BCOffset density.
454+
_n294_src = 'def block_map_n294_chain(n):\n'
455+
for _i in range(110):
456+
_n294_src += f' if n == {_i}: return {_i}\n'
457+
_n294_src += ' return -1\n'
458+
exec(_n294_src)
459+
444460
tests = [
445461
(straight_add, (3, 4), 7),
446462
(recursive_fib, (10,), 55),
@@ -460,6 +476,10 @@ tests = [
460476
(block_map_resize_chain, (5,), 'f'),
461477
(block_map_resize_chain, (9,), 'j'),
462478
(block_map_resize_chain, (99,), 'z'),
479+
(block_map_n294_chain, (0,), 0),
480+
(block_map_n294_chain, (54,), 54),
481+
(block_map_n294_chain, (109,), 109),
482+
(block_map_n294_chain, (200,), -1),
463483
]
464484
for func, args, expected in tests:
465485
cinderjit.force_compile(func)

0 commit comments

Comments
 (0)