| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
various updates from upstream python/typing repo: - Added typing.Counter and typing.ChainMap generics - More flexible typing.NamedTuple - Improved generic ABC caching - More tests - Bugfixes - Other updates * Add Misc/NEWS entry * Add issue number (cherry picked from commit b692dc8)
This makes method descriptors for non-heap types immortal. The underlying logic is that the types are immortal so the methods will live for the lifetime of the program as well. See #77
Extensibility support for traversable objects Closes python#77 See merge request python-devs/importlib_resources!85
Fix disp_str for control characters
…/144 = 71.5%)
PartialConversion per theologian PTE pre-audit (chat 2026-04-22 17:15Z) +
supervisor concurrence (chat 17:18Z) + Alex 'NO SESSION BOUNDARIES — keep
working until ZERO C++' anchor [memory 2026-04-21]. Bridge-count gate
satisfied: 1 new top-level bridge (within gate), 0 sub-bridges.
SCOPE: only the await-tail dispatch (lines 2963-2993 in pre-conversion
source) is converted to C. The opcode-switch + INVOKE_FUNCTION/NATIVE/
METHOD/METHOD_VECTORCALL dispatch stay C++ until Tier 6 INVOKE_*
re-architecture (deferred per gate-count gate per [chat L1922]:
FullConversion would require 4+ new bridges, violating ≤1 limit).
Python/jit/hir/builder.cpp:
emitAnyCall await-tail block (lines 2963-2993, ~30 lines C++) →
1) C++ stub: 3x ++bc_it + 3x JIT_CHECK on opcode sequence (PA + A4) +
checkAsyncWithError(get_awaitable_bc) → (error_aenter, error_aexit) +
extract load_const_oparg from LOAD_CONST bc + call C body
2) checkAsyncWithError forward decl added (defined static at builder.cpp
:~4856, post-call-site refactor required forward visibility)
3) New extern decl: hir_builder_emit_awaited_call_tail_c
Python/jit/hir/builder_emit_c.c:
NEW hir_builder_emit_awaited_call_tail_c (~50 lines):
A5 alloc out + 2 blocks (await_block + post_await_block)
A5 dispatch_eager_coro_result (chains to push 55 C function)
A6 tc->block = await_block
A7 get_awaitable using pre-computed error flags (chains to push 56)
A8 load_const using pre-computed oparg + caller-passed code
A9 yield_from_method (chains to push 53)
A10 phx_tc_emit branch to post_await_block
A11 tc->block = post_await_block
PTE-trial invariant inventory verification per theologian [chat L1928]:
12 invariants A1-A12 + 4 pitfalls PA-PD.
PA: JIT_CHECK fires C++-side BEFORE C call ✓
PB: iterator state stays C++-side; only ints + pointers cross boundary ✓
PC: tc->block reassignment in C body (A6 + A11) ✓
PD: code passed as PyCodeObject* (not void*) — preserves emitGetAwaitable
port's PA invariant ✓
PTE TRIAL ROUND 2 FEEDBACK: A4 IF/THEN structure made
'JIT_CHECK MUST fire BEFORE C call' visually unambiguous. PD pitfall
on code_ typing caught at design time. Two empirical wins
(round 1: PD.a/PD.b distinction, round 2: A4 + PD).
Bridge spec (8 args, ratified by theologian [chat L1931]):
void hir_builder_emit_awaited_call_tail_c(
PhxTranslationContext* tc, void* func, void* builder,
PyCodeObject* code, int code_flags,
int get_awaitable_error_aenter, int get_awaitable_error_aexit,
int load_const_oparg);
testkeeper x86_64 compile-only PASS verified pre-commit at binary
timestamp 1776878644 (chat 17:24Z). Iter 1 needed forward decl for
checkAsyncWithError; v2 cleaned.
Tier 5 milestone: 103/144 = 71.5% with PartialConversion-asterisk on
emitAnyCall (await-tail in C, opcode-switch + INVOKE_* still C++).
Pre-push 61 gate ahead (per pythia python#77 python#3 + supervisor [chat L1939]):
testkeeper authors call-shape falsifier extension exercising
emitCallExceptionHandler D1-D3 invariants (theologian spec [chat L1942]:
3 tests covering function-call-in-try + closure-LOAD_DEREF +
unmatched-exception-deopt). Lands as separate commit before
Tier 5 close push.
Authorization chain:
- theologian PTE pre-audit + design lean (a, but generalist chose b): chat L1928
- bridge spec ratification: chat L1931
- supervisor concurrence on (B) PartialConversion: chat L1930
- testkeeper x86_64 compile PASS: chat L1944
Per pythia python#77 python#3 [chat L1937] gap + supervisor [chat L1939] authorization + theologian [chat L1942] spec: extend test_phoenix_jit_inline_except_closure.py with TestJitCallExceptionHandler class covering 3 tests that exercise the emitCallExceptionHandler unique invariants (D1-D3) NOT covered by the existing inline-except (BINARY_SUBSCR_DICT) tests. GAP CONTEXT: push 60 (9630005) landed emitCallExceptionHandler with shared-helper design — D1-D3 unique invariants ride only the shared P2+P3+P4 helper through the closure-LOAD_DEREF inline-except falsifier. Call-shape (function-call-in-try) was empirically untested at push 60. This falsifier closes that coverage gap retroactively. Lib/test/test_phoenix_jit_inline_except_closure.py: +135 lines, new class TestJitCallExceptionHandler with 3 tests: - C1 test_call_in_try_simple_except: function-call-in-try, ValueError matched + return from except. Exercises D1 (setSuppressExceptionDeopt + pop result pre-call) + D3 (RefineType + result push on OK path). - C2 test_call_in_try_with_closure_load_deref: function-call-in-try, LOAD_DEREF on closure variable in except body. Exercises D1-D3 + PA (D-1774910012 prev_exc Py_None placeholder under emitCallExceptionHandler entry). - C3 test_call_in_try_deopt_path: function-call-in-try, unmatched exception (TypeError vs except ValueError). Exercises D2 (DeoptTC zero re-push, no left/right context — call-handler doesn't have left/right unlike inline-match). EXISTING TESTS PRESERVED unchanged: TestJitInlineExceptClosure (3 tests) — D-1774910012 PA invariant via inline-except path, retained as the original falsifier. EMPIRICAL VALIDATION RESULT (testkeeper [chat L1946]): Run on push 60 binary 9630005 (ARM64 pydebug): 6/6 PASS, OK, 0.177s, EXIT=0, NO core dump. All D1-D3 invariants empirically validated; PA preserved across both call-handler and inline-match entry paths. PYTHIA python#77 python#3 SUBSTANCE CLOSED: D1-D3 unique invariants now empirically exercised, not only ride-along through shared helper. Falsifier-pre-port discipline restored for emitCallExceptionHandler (regression test exists post-port; ideal would have been pre-port but supervisor [chat L1939] accepted post-port retroactive validation as remediation). Bundled with push 61 (b28b512 emitAnyCall PartialConversion, Tier 5 close) per testkeeper [chat L1946] (a) sequencing — single gate cycle, single push, no separate gate ceremony for .py-only change. Authorization chain: - pythia python#77 python#3: chat L1937 (gap surfaced) - supervisor authorization: chat L1939 - theologian spec: chat L1942 - testkeeper draft + push-60-binary validation: chat L1946
| Back | FazBrowse Home | New Git URL |
various updates from upstream python/typing repo:
Add Misc/NEWS entry
Add issue number
Contributed by Ivan Levkivskyi @ilevkivskyi
(cherry picked from commit b692dc8)