Repository navigation
Test: compiled TypedPython calls Kotlin in the embedded runtime (#45) - #102
Merged
Merged
Conversation
…edded runtime (#45) ksp-fixtures/app builds a '# typedpython: compiled' module with the TypedPython pipeline against the embedded CPython's headers (cpythonIncludeDirectories provider; EXT_SUFFIX from the extracted tree's sysconfigdata) and loads it next to the interpreted module in the desktopTest JVM. The compiled code constructs a Kotlin proxy, calls its method, passes it back to Kotlin and loops with float math around the calls. Passing: build/ABI premise; identical results and Kotlin-side call counts; a Kotlin exception reaches the compiled caller as the same Python exception. Skipped: the 10,000-call leak test, blocked by #98 (the binder releases a reference twice on the cleaner path; the interpreted control crashes too). Found on the way: #94 (KSP function returns are untyped _PmObject). :ksp-fixtures:app:desktopTest: 74 tests, 0 failures, 1 skipped. Refs #45
This was referenced Oct 3, 2026
Merged
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.
Refs #45. This doesn't close it: the leak criterion is blocked by #98.
Test added
An embedded-runtime test in
ksp-fixtures/app: compiled TypedPython code calls Kotlin through the binder.buildTypedPythonBridgetask builds a# typedpython: compiledmodule withpipeline.compile_moduleagainst the embedded CPython 3.14 headers. It uses thecpythonIncludeDirectoriesprovider and readsEXT_SUFFIXfrom the extracted tree's sysconfigdata.TpSampleKotlin proxy, calls its method, passes it back to Kotlin, passes a Python token to Kotlin, and loops with float math around the calls.Results, all in the JVM:
float.hex), and Kotlin saw the same calls;-Dtypedpython.leakTest=true.:ksp-fixtures:app:desktopTest: 74 tests, 0 failures, 1 skipped.Defects found (filed, not fixed here: binder area)
_PmObject.The compile step needs a host Python with pyrefly 1.3.2, from
-PtypedpythonPythonorpython-multiplatform-ksp/.venv. Without one the test reports itself as skipped. It runs on macOS only.