Repository navigation
Conversation
Reviewer's GuideAPIExpose compiler-recognized native kernel dispatch through the runtime wrapper, retaining the original function for unsupported calls and runtime conditions.
Recognize the supported function shapes, lower opted-in functions to runtime decorators, and validate generated-name bindings across combined source.
Uses of the APIRecognize native optimization directives during parsing and lower eligible functions, while preserving existing unrolling behavior.
Validate native generated-name bindings after include expansion without reserving compiler-looking names in unchanged Python source.
ImplementationImplement bounded, exact-built-in C kernels for string-length sums, integer sums with overflow fallback, and ordered substring matching, including signal checks.
ConfigurationRun all native test modules under the sanitizer workflow.
DocumentationDocument the experimental specialization scope, supported patterns, fallback conditions, and runtime safety limits.
TestsCover native dispatch, Python fallback, Unicode and overflow behavior, differential equivalence, diagnostics, and generated-name validation.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
| Py_RETURN_NOTIMPLEMENTED; | ||
| } | ||
| Py_ssize_t total = 0; | ||
| for (Py_ssize_t i = 0; i < n; ++i) { |
There was a problem hiding this comment.
🟡 Medium · Long native calls block threads and interrupts
When a native reduction or search processes a large input while a signal is pending, the C loops hold the GIL and do not check pending signals, so other Python threads cannot run and KeyboardInterrupt is delayed until the kernel finishes.
Release the GIL where safe and check for pending signals during the scans.
Also at restructuredpython/lib/compiler.c:305, restructuredpython/lib/compiler.c:334.
Compiler-recognized IR for explicit native=True functions: integer sum, Unicode length reduction and ordered substring matching. Original Python fallback for unsupported runtime values, overflow, overridden len, keyword calls and tracing. C kernels hold the GIL, avoid callbacks, and use checked arithmetic. Unsupported function shapes produce diagnostics. Includes randomized differential tests and sanitizer coverage. This is a narrowly scoped initial native runtime backend, not arbitrary AOT compilation.
Summary by Sourcery
Introduce an experimental, explicitly enabled native runtime path for a narrow set of supported functions while preserving their Python implementations as fallbacks.
New Features:
Enhancements:
CI:
Documentation:
Tests: