Repository navigation
Feat: Fast entry without per-call depth counting for bounded compiled functions (#147) - #210
Merged
Merged
Conversation
# Conflicts: # python-multiplatform-ksp/src/main/python/typedpython/cgen.py
This was referenced Oct 17, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #147
Feature added:
redocalls to bounded callees and Box of scalars are allowed.tp_fimpl_f(..., int tp_fd). The twin has notp_enter_call/tp_leave_calland no entry poll, and it calls the callees' twins, so the C compiler can inline small leaves.tp_depth_room(k)holds (k = the static depth of the tree). If the precheck fails, the call runs the counted path, so RecursionError is raised at exactly the call where CPython raises it.redo, a loop poll), the frame count is set to its exact value for that span (tp_depth_py_begin/end(tp_fd)).Tests added:
test_fast_entry.py, 11 tests.tp_fd).Measured (quiet window, interleaved against develop, 11 pairs; data in
benchmarks/typedpython/results/2026-10-17-fast-entry-ab.json):spectral-norm now passes the M2 10x criterion (#41). nbody is not measured because it does not compile on develop since #209 (more than two list parameters); that regression is reported separately.
Verification (local):