Skip to content

Commit d4210b3

Browse files
committed
Phase 5.B c22b-mech amend-4: align (3-gate) fixture with empirically-confirmed traversal path.
testkeeper 16:31:45Z: amend-3 [None]*100 stress fixture FAILED to reach site 600 (counter delta == 0). Same run's JIT smoke (add+mul+fib force_compile sequence) DID reach site 600 (counter delta == 5), empirically confirming theologian's fib-traversal inference. Site 600 traversal happens during JIT compilation infrastructure path (force_compile internals create non-interned objects flowing through _Py_Dealloc), NOT through fib's runtime int-decref code (interned small ints never decref to zero — pythia python#376 second-order risk on fib's _runtime_ traversal does land, but the _compile-time_ traversal works). Amend-4 changes (3-gate) substep stress fixture to use the same add+mul+fib force_compile + invoke pattern that JIT smoke uses (counter delta empirically 5). This aligns the negative-test fixture with the empirically-confirmed traversal path, so the bad-path build's shadow-emit divergence will fire JIT_CHECK on actual wrapper invocation. theologian's site-600 inference UPHELD per testkeeper empirical evidence; (3-gate) fixture-choice was the only remaining gap. Net: ~10 LOC churn in scripts/gate_phoenix.sh Step 1a-4 (3-gate) substep.
1 parent b16dff7 commit d4210b3

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

‎scripts/gate_phoenix.sh‎

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,21 +181,27 @@ if [ "${JIT_VARIADIC_BAD_PATH_VERIFY:-0}" = "1" ]; then
181181
if [ "$BAD_BUILD_RC" -eq 0 ]; then
182182
BAD_RUN=$("$PYTHON" -c "
183183
import _cinderx, cinderjit, ctypes
184-
# Stress fixture: non-interned object decref reliably reaches _Py_Dealloc
185-
# (site 600). fib(10) only uses interned small ints which never decref to
186-
# zero; need actual deallocs.
187-
def stress():
188-
for _ in range(1000):
189-
x = [None] * 100 # list dealloc each iter; non-interned
190-
return 1
191-
cinderjit.force_compile(stress)
184+
# Use the SAME JIT smoke pattern that empirically reaches site 600
185+
# (testkeeper 16:31:45Z confirmed counter delta = 5 from add+mul+fib
186+
# force_compile sequence). Site 600 is reached during JIT compilation
187+
# of these functions (force_compile internals create non-interned
188+
# objects that flow through _Py_Dealloc). Fixture choice based on
189+
# empirical traversal evidence, not structural inference.
190+
def add(x, y): return x + y
191+
def mul(x, y): return x * y
192+
def fib(n):
193+
a, b = 0, 1
194+
for _ in range(n): a, b = b, a + b
195+
return a
192196
try:
193197
libpy = ctypes.CDLL(None)
194198
cnt = ctypes.c_int.in_dll(libpy, 'g_lir_bbb_append_invoke_call_count')
195199
pre = cnt.value
196200
except (AttributeError, ValueError):
197201
pre = -1
198-
stress()
202+
for f in [add, mul, fib]:
203+
cinderjit.force_compile(f)
204+
add(3, 4); mul(6, 7); fib(10)
199205
if pre >= 0:
200206
print(f'JIT_TEST_EXERCISE counter delta: {cnt.value - pre}')
201207
" 2>&1 || true)

0 commit comments

Comments
 (0)