Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
257 commits
Select commit Hold shift + click to select a range
2803a9c
Move NFI2 to separate project, move graalpy back to JDK 17+
otethal Oct 6, 2025
e9643c4
Remove checked exceptions from NFI2
otethal Oct 6, 2025
fedb3f4
Accept static method handle instead of Node supplier when creating cl…
otethal Oct 6, 2025
116e5f6
Remove "uncached" suffixes and do not use inheritance in multi-releas…
otethal Oct 6, 2025
295d01a
Add reachability fences for args during downcalls, deallocate upcall …
otethal Oct 13, 2025
03c3df7
Disable ECJ, windows and JDK21 gates, fix maven config for NFI2
otethal Oct 13, 2025
fac8659
Avoid PythonObjectReferences if possible
fangerer Oct 23, 2025
aa40a33
Refactor NativeToPython[Transfer]Node
fangerer Oct 29, 2025
13b6aa6
Allow NativeToPythonInternalNode to release the native stub
fangerer Oct 29, 2025
d2c2c13
Release native stub if return via native slots
fangerer Oct 29, 2025
cb330d5
Remove obsolete CExtAsPythonObjectNode
fangerer Oct 29, 2025
fae7326
Allow releasing stub on native return
fangerer Oct 29, 2025
8b4f67a
Fix assertions
fangerer Nov 7, 2025
a8264fa
Use the new NFI API in createModule/execModule, registerClosure and l…
otethal Oct 21, 2025
c09f2ea
dlclose
otethal Oct 23, 2025
626b434
Move responsibility for arg/retval conversions for closures from NFI …
otethal Oct 24, 2025
e77cafc
Remove AllocateNode, FreeNode, use long instead of interop pointer in…
otethal Nov 10, 2025
fe183f8
add oracledb benchmark script
timfel Nov 5, 2025
d130ccb
Fix a few eclipse warnings
timfel Nov 12, 2025
91fb139
add two benchmarks for nearly empty C API calls
timfel Nov 12, 2025
f0266b3
Generate and register static upcall functions in the PythonCextBuilti…
timfel Nov 12, 2025
fe408aa
Allow @CApiBuiltin on static methods and wire those up directly via p…
timfel Nov 13, 2025
8cbdf21
Make c-upcall benchmark work again
timfel Nov 13, 2025
641dc2d
Delete dead code
timfel Nov 13, 2025
239bb4a
Add benchmarks for the two other kinds of upcall we have
timfel Nov 14, 2025
59f824d
Remove commented code
timfel Nov 14, 2025
758f7c9
Instead of a Feature, generate the rechability-metadata for the C API…
timfel Nov 17, 2025
f44920d
Make sure C API upcall calltargets are per PythonLanguage
timfel Nov 21, 2025
71850b0
Use JNI types for SVM static upcall config
timfel Nov 21, 2025
f0b9975
Simplify ReadMemberNode and remove GetElementPtrNode
otethal Nov 13, 2025
029c23b
Use long in PMemoryView
otethal Nov 13, 2025
f1a3924
Use long in PythonBufferAccessLibrary.getNativePointer()
otethal Nov 13, 2025
ed08527
Remove ReadI32Node, simplify createModule/execModule, HiddenAttr.METH…
otethal Nov 17, 2025
8b6e1dd
Remove ReadI64Node, PythonNativeObject.getPtr() returns long
otethal Nov 17, 2025
76c1a55
Fix offset in `writePtrArrayElements` and address other review comments
otethal Nov 25, 2025
8994ffe
Remove ReadDoubleNode
otethal Nov 19, 2025
db59ed2
Remove ReadPointerNode
otethal Nov 19, 2025
f909b62
Simplify ReadObjectNode and ReadCharPtrNode
otethal Nov 20, 2025
5bae575
Use long in CApiMemberAccessNodes.WriteTypeNode
otethal Nov 20, 2025
e5e3e37
Remove WriteByteNode, WriteI16Node, WriteIntNode, WriteFloatNode, Wri…
otethal Nov 20, 2025
7704512
Remove WritePointerNode and simplify WriteObjectNewRefNode
otethal Nov 20, 2025
26ab91e
Remove some usages of ensurePointer/wrapPointer
otethal Nov 20, 2025
36ae536
Remove CAPI symbols previously used by CStructAccess
otethal Nov 20, 2025
a0bb57a
Simplify XDecRefPointerNode
otethal Nov 20, 2025
8589263
Simplify ensureExecutableUncached
otethal Nov 20, 2025
36f7161
Remove PyCapsule usages from _multibytecodec
otethal Nov 21, 2025
5403527
Store raw primitive pointers in PyCapsule
otethal Nov 21, 2025
cfbcd06
Do a copy in ReadNativeStringNode
otethal Nov 21, 2025
08c79d9
Rename ensureExecutableUncached
otethal Nov 25, 2025
dc07f34
Post-rebase fixes and imports update
otethal Nov 27, 2025
3bf84fe
Fix: keep string wrapper alive
fangerer Dec 3, 2025
afd002a
Fix: remove weakly referenced objects from GC lists.
fangerer Dec 4, 2025
a49fd98
Fix: actually cache CTs for C API builtins
fangerer Dec 10, 2025
f6c977a
Fix benchmark c-upcall-slot
fangerer Dec 12, 2025
1800e67
Move fields/methods from PythonNativeWrapper to PythonObject
fangerer Nov 21, 2025
af10aa2
Make TruffleObjectNativeWrapper a PythonObject
fangerer Nov 21, 2025
43e245b
Refactor PThreadState
fangerer Nov 21, 2025
190f070
Replace PythonAbstractObjectNativeWrapper by PythonObject and related
fangerer Nov 24, 2025
d5ab56f
Remove CPyObjectArrayWrapper
fangerer Nov 19, 2025
fcff360
Remove unused CIntArrayWrapper
fangerer Nov 19, 2025
f552cb7
Remove CStringWrapper
fangerer Nov 19, 2025
292b767
Adapt capsule
fangerer Nov 21, 2025
954cc16
Introduce context memory allocator
fangerer Nov 21, 2025
701393c
Remove CByteArrayWrapper usage from Arrow(Schema|Array)
fangerer Nov 21, 2025
ff2ce45
Remove CArrayWrappers
fangerer Nov 21, 2025
d5e31d6
Remove PythonNativeWrapper
fangerer Nov 21, 2025
3b52754
Use TruffleString.FromNativePointerNode in CExtNodes.FromCharPointerNode
fangerer Nov 26, 2025
3b7e6a0
Coerce result to long in TpSlot*
fangerer Nov 21, 2025
1a4941b
Resolve name clash with ZlibDecompressorObject.isNative
fangerer Nov 21, 2025
33f8c99
Fix assertion
fangerer Nov 21, 2025
ba0a7ed
Initialize native companions of singletons lazily
fangerer Nov 21, 2025
80951e2
Revisit isGcTracked* assertion
fangerer Nov 21, 2025
0b3e427
Save native pointer after transformation
fangerer Nov 21, 2025
fcd90e9
Fix wrong error case
fangerer Nov 21, 2025
8b18a98
Use right allocator for TruffleString native storage
fangerer Nov 21, 2025
ff52a46
Use PNone.NO_VALUE as native null object.
fangerer Nov 24, 2025
ff0d3f3
Accept interop pointer objects when passed from native code
fangerer Nov 24, 2025
eae47e1
Keep converted args alive
fangerer Dec 19, 2025
f37d95b
Fix PythonAbstractNativeObject.isIdentical
fangerer Nov 24, 2025
28929a8
Rename CExtNodes.MaterializePrimitiveNode to EnsurePythonObjectNode
fangerer Nov 24, 2025
90a9b3a
Fix double free when disposing thread state
fangerer Nov 26, 2025
863b324
Fix immortal refcnt in PythonToNativeInternalNode
fangerer Nov 24, 2025
2644437
Fix error message template RETURNED_NON_FLOAT
fangerer Nov 24, 2025
177d8d6
Return NO_VALUE to indicate native null
fangerer Nov 24, 2025
4a4b558
Fix demo2: string buffer was too small.
fangerer Nov 25, 2025
46785f3
WIP for testing
fangerer Nov 26, 2025
1ccf74f
Fix copyright header
fangerer Nov 25, 2025
8204cd8
Fix style
fangerer Nov 25, 2025
ac8c0bf
Avoid interop library in ProfileClassNode
fangerer Nov 25, 2025
72eb7ad
Finalize C API before joining threads
fangerer Nov 26, 2025
2ff0ef5
Add missing TruffleBoundary
fangerer Nov 27, 2025
45d1bfb
Split object promotion and toNative operation
fangerer Dec 1, 2025
5572baf
Fixes for C API debug build
fangerer Dec 15, 2025
e48f420
Fix cpyext tests to not fail native assertions
fangerer Dec 15, 2025
ca13ada
Fix: __graalpython__.using_native_primitive_storage_strategy should a…
fangerer Dec 15, 2025
64e16c2
Do not materialize native string data for length
fangerer Dec 15, 2025
8efb97d
Remove PNone.NO_VALUE from special singletons
fangerer Dec 16, 2025
8e72325
Unlink managed dict from native part on dealloc
fangerer Dec 16, 2025
55d024e
Fix: double-free of context memory
fangerer Dec 17, 2025
e509215
Use NativeMemory.free instead of Unsafe.freeMemory
fangerer Dec 18, 2025
7b550d7
Log alloc/free of context and native string memory.
fangerer Dec 18, 2025
c5f8a5b
Do not free thread state before finalization.
fangerer Dec 18, 2025
c5d9523
Fix: do not allocate stub for memoryview
fangerer Dec 18, 2025
ce60cbe
Replace MaterializePrimitiveNode by EnsurePythonObjectNode
fangerer Dec 19, 2025
a0f8ca7
Remove ReleaseNativeWrapperNode
fangerer Dec 19, 2025
090ae8d
Remove unreachable specialization doInteropPointer
fangerer Dec 19, 2025
632544e
Update IMPLEMENTATION_DETAILS.md
fangerer Dec 19, 2025
50d4bc5
Use raw pointers in ArgDescriptors
otethal Jan 7, 2026
26f25fd
Remove PythonToNativeNewRefRawNode and PythonToNativeRawNode
otethal Jan 7, 2026
c7a9abf
Remove Py_AtExit temporarily (GR-72092)
otethal Jan 7, 2026
12efc63
Cleanup CharPtrToPythonNode and ArgBehavior constructor
otethal Jan 8, 2026
17e7120
Introduce fast path for native type lookup
fangerer Dec 12, 2025
3533e78
Remove fast type lookup entry on type_dealloc
fangerer Jan 8, 2026
771ce19
Fix: globals arg check in PyEval_EvalCodeEx
fangerer Jan 8, 2026
dcee097
Unify UpdateStrongRefNode and UpdateHandleTableReferenceNode
fangerer Jan 9, 2026
be4cf54
Remove unused ResolveHandleNode and ResolvePointerNode
fangerer Jan 9, 2026
6b235d7
Fix: allow NotifyRefCount on collected managed object
fangerer Jan 9, 2026
2a65574
Use raw pointers in PyCFunctionWrapper and PyProcsWrapper
otethal Jan 12, 2026
df16750
Remove closure field from ClosureInfo
otethal Jan 12, 2026
a522c19
Remove obsolete todos
otethal Jan 12, 2026
ad3aed4
Prevent integer conversions in NFI2
otethal Jan 12, 2026
b639850
Remove argument conversions from NFI2
otethal Jan 12, 2026
0667228
Remove getNativeNull from PythonContext
otethal Jan 12, 2026
c6395db
Fix SVM build
otethal Jan 12, 2026
abdafeb
Fix test_buffer - add more explicit int->long conversions
otethal Jan 12, 2026
22afd98
Honor boxed primitives in PyNumber_(Float|Long)
fangerer Jan 15, 2026
f6bf53d
Simplify error retval in ExecuteCApiBuiltinNode
otethal Jan 15, 2026
d35b0ee
Use static methods for upcalls in PyCFunctionWrapper
otethal Jan 16, 2026
1efc28f
Add missing truffle boundaries and use NativeToPythonInternalNode dir…
otethal Jan 20, 2026
2f1555f
Post-rebase fixes - update datetime to use the new CStructAccess API …
otethal Jan 27, 2026
548c0f4
Add some macro c-extension benchmarks using our own harness
timfel Jan 20, 2026
526f655
Disable corp compliance while we are on a branch
timfel Jan 21, 2026
c867330
Fix typo in call to ensure_packages
fangerer Jan 28, 2026
0ee3b51
Avoid temp TruffleString in PyUnicode_CompareWithASCIIString
fangerer Jan 29, 2026
0e1a62d
Remove ArgDescriptors with YYY suffix
fangerer Jan 14, 2026
dae50f5
Introduce ExternalFunctionSignature
fangerer Jan 14, 2026
fea2b3b
Implement invoke of NfiDowncallSignature without bind
fangerer Jan 14, 2026
b0b5248
Use CApiBuiltinsProcessor to generate external function invocations
fangerer Jan 9, 2026
3f5903e
Cleanup GetThreadStateNode
fangerer Jan 13, 2026
33241bf
Remove unused ExternalFunctionWrapperInvokeNodeUncached
fangerer Jan 13, 2026
947df56
Remove ExternalFunctionInvokeNode and use ExternalFunctionInvoker ins…
fangerer Jan 14, 2026
0a5440c
Rework CheckFunctionResultNodes
fangerer Jan 14, 2026
fd60b94
Fix: wrong name in CallSlotRichCmpNode
fangerer Jan 14, 2026
fa51535
Remove obsolete PExternalFunctionWrapper.DIRECT
fangerer Jan 14, 2026
e3b96a2
Cleanly separate slot wrappers (wrapper_descriptor) and methods (meth…
fangerer Jan 21, 2026
8a8f49c
Fix style and copyrights
fangerer Jan 21, 2026
c4ef03a
Align PExternalFunctionWrapper and root nodes with wrap_* functions (…
fangerer Jan 22, 2026
a97360b
Annotate wrapper root nodes with CApiWrapperDescriptor
fangerer Jan 22, 2026
5a3babf
Generate method invokeExternalFunction for wrapper descriptor root nodes
fangerer Jan 23, 2026
ec4d890
Refactor method descriptor root nodes
fangerer Jan 26, 2026
7f1944a
Remove result checking specification from ArgDescriptor
fangerer Jan 28, 2026
65b03c1
Remove ArgDescriptor.InquiryResult
fangerer Jan 28, 2026
0af5c4a
Remove ArgDescriptor.IterResult
fangerer Jan 28, 2026
58c5a78
Remove ArgDescriptor.InitResult
fangerer Jan 28, 2026
eae8214
Refactor CheckPrimitiveResultNode
fangerer Jan 28, 2026
d4435df
Remove ChekFunctionResultNode interface
fangerer Jan 28, 2026
e15514c
Specify conversions in annotation
fangerer Jan 29, 2026
fb6e1e5
Correctly implement _add_methods_to_object
fangerer Feb 1, 2026
97dd812
Use static methods for upcalls in PyProcsWrapper
otethal Jan 22, 2026
f46cf1b
Merge PyProcsWrapper into TpSlotWrapper
otethal Jan 26, 2026
398bd4c
Skip SlotWrapperTests on darwin
otethal Jan 26, 2026
6a52762
Cleanup pointer wrapping/unwrapping, remove NfiType.POINTER
otethal Feb 2, 2026
19d25c4
Fix javadoc errors
timfel Jan 23, 2026
5d401eb
Generate error and gil handling for static C API calls
timfel Jan 27, 2026
e54ddb8
Convert more capi builtins to static methods
timfel Jan 27, 2026
f7ad647
Reduce size of CApiBuiltins metadata objects
timfel Jan 23, 2026
a92efe7
Fix canonicalizeprojects check
timfel Jan 28, 2026
93f5cd5
Only warn about invalid Javadoc (see eclipse-jdt/eclipse.jdt.core#517)
timfel Jan 28, 2026
eeced0d
Ensure uncached and error cases are not runtime compiled nodes
timfel Jan 28, 2026
f3226ec
Remove obsolete assert
timfel Feb 2, 2026
ba67401
Avoid usage of stream api that NI does not support
timfel Feb 3, 2026
6e11b3d
Add benchmarks METH_(NOARGS|O|VARARGS), PyObject_CallFunctionObjArgs,…
fangerer Feb 11, 2026
2d1253f
Add benchmark METH_FASTCALL
fangerer Feb 12, 2026
4cd806d
Fix minor TODOs
otethal Feb 23, 2026
ab1ec4e
Add test for escaping varargs tuple and elements
fangerer Feb 17, 2026
1c9ea02
Remove unused NativePtrToPythonWrapperNode
fangerer Feb 15, 2026
40ff2b1
Make GraalPyPrivate_Get_Py(List|Tuple)Object_ob_item be a static C AP…
fangerer Feb 16, 2026
c6a9e1b
Do not GC track objects in AllocateNativeObjectStubNode if initialRef…
fangerer Feb 16, 2026
c0b50ad
Remove objects from GC list if PythonObjectReference was made weak
fangerer Feb 16, 2026
6e41492
Use embedded array in native tuple
fangerer Feb 20, 2026
2650d4f
Create native args tuple and eagerly release it if possible
fangerer Feb 20, 2026
8679df6
Remove UnicodeFromFormatNode
fangerer Feb 10, 2026
bc3aeec
Remove GraalPyPrivate_Object_CallFunctionObjArgs
fangerer Feb 10, 2026
1bdf4a0
Remove GetNextVaArgNode
fangerer Feb 10, 2026
63b1796
Migrate PythonCextAbstractBuiltins to static builtins
otethal Feb 26, 2026
6a33d88
Migrate PythonCextArrayBuiltins to static builtins
otethal Mar 9, 2026
5e57742
Use raw pointers with TruffleString nodes
otethal Mar 9, 2026
ba87ea7
Add injectBranchProbability in expectArray
otethal Mar 16, 2026
d9a6dd6
Migrate PythonCextBuiltins to static builtins
otethal Mar 16, 2026
f9fe7e8
Post-rebase gate fixes
otethal Mar 18, 2026
e3ff601
Use bare unbound FFM API downcall handles
fangerer Mar 18, 2026
de393f9
Directly use MethodHandle in ExternalFunctionInvoker
fangerer Mar 18, 2026
25da6db
Remove NfiDowncallSignature; directly use downcall handles in Externa…
fangerer Mar 19, 2026
f9ea58d
Allow ext funcs without exceptions
fangerer Mar 19, 2026
e18c28c
Improve native call in GetDictIfExistsNode
fangerer Mar 19, 2026
54faef0
Remove PCallCApiFunction
fangerer Mar 19, 2026
793c2b1
Use ExternalFunctionSignature in NativeCAPISymbol
fangerer Mar 20, 2026
c799ed7
Refactor CExtNodes.SubtypeNew and subclasses
fangerer Mar 20, 2026
5dc1108
Add imports; cleanup fully qualified refs
fangerer Mar 20, 2026
6ef0003
Fix DSL warnings
fangerer Mar 20, 2026
6864e73
Fix style
fangerer Mar 20, 2026
f127dee
Implement GraalPyPrivate_AddSuboffset in Java
fangerer Mar 23, 2026
fbb5b8f
Hack Windows NFI2 loader for ctypes import
timfel Mar 27, 2026
ab08e79
Restore Windows ctypes module macros
timfel Mar 27, 2026
7c8d0d5
Hack Windows cpyext setuptools bootstrap
timfel Mar 27, 2026
c32b8b5
Relax offline setuptools bootstrap for cpyext tests
timfel Mar 27, 2026
ca77521
Re-enable disabled Windows CI gates
timfel Mar 27, 2026
84a013f
Make arena and symbollookup for windows lazy init
timfel Mar 30, 2026
4f5b208
Fix style
timfel Mar 30, 2026
fc40d0d
Fix LoadLibrary flags on Windows and surface library load errors
timfel Mar 30, 2026
76e71cc
Add a regression test for windows dll load flags
timfel Mar 30, 2026
17b2053
Fix copyright years for style gate
timfel Mar 31, 2026
ba82e05
Post-rebase fixes
fangerer Apr 9, 2026
ddb9707
Migrate CAPI builtins to static methods
otethal Mar 18, 2026
7eed024
Use getThreadState in PyEval_SaveThread
otethal Apr 13, 2026
ea4a06e
[GR-74794] Use zero-terminated native pointer strings
fangerer Apr 10, 2026
8e39eb8
Make CExtNodes.FromCharPointerNode be an inline node
fangerer Apr 10, 2026
6b12630
Fix boolean borrowed refs in _PyDict_Next
fangerer Apr 17, 2026
7f06398
Fix: directUpcall registration for upcall wrappers
fangerer Apr 23, 2026
8681e70
Raise a descriptive import error when panama is missing
timfel Apr 16, 2026
b0d02e0
Re-enable all gates on rebased ot_panama branch, skipping native thin…
timfel Apr 15, 2026
f475559
[GR-70223] Use tsLiteral for C API unsupported constant
timfel Apr 24, 2026
3e232a1
Add C API GC lifetime regression tests
fangerer Apr 10, 2026
18c1e9e
Introduce dealloc stack to avoid stale native object refs
fangerer Apr 23, 2026
e0b8707
Remove NFI2 project; move classes to native access runtime
fangerer Apr 24, 2026
5a63488
Encapsulate FFM API usage in NfiSupport
fangerer Apr 27, 2026
467d102
Split NfiSupport generated implementation
fangerer Apr 27, 2026
bda0194
Type native library lookups
fangerer Apr 27, 2026
15db905
Do not convert UnsupportedOperationException on JDK21
fangerer Apr 27, 2026
3aabebe
Cleanup NfiBoundFunction
fangerer Apr 27, 2026
4152c23
Rename NfiBoundFunction to NativeFunctionPointer
fangerer Apr 27, 2026
90d5c92
Rename NfiUpcallSignature to NativeSignature
fangerer Apr 28, 2026
bc6d8a4
Rename Nfi to NativeAccess
fangerer Apr 28, 2026
323647d
Rename field PythonContext.nativeContext to handleContext
fangerer Apr 28, 2026
36882d4
Rename NfiContext to NativeContext
fangerer Apr 28, 2026
20417a3
Check if native access is allowed in ensureNativeContext
fangerer Apr 28, 2026
800850c
Rename NfiLibrary to NativeLibrary
fangerer Apr 28, 2026
a919ff1
Small cleanup in generated PythonCApiAssertions
fangerer Apr 28, 2026
755a63e
Rename NfiSupport to NativeAccessSupport
fangerer Apr 28, 2026
03d8a43
Rename NfiType to NativeSimpleType
fangerer Apr 28, 2026
045d8cb
Rename NfiLoadException to NativeLibraryLoadException
fangerer Apr 28, 2026
85a40a4
Retag native access TODOs
fangerer Apr 28, 2026
2c44dd6
Remove NativeAccess facade
fangerer Apr 28, 2026
36cac7c
Restrict NativeAccessSupport API
fangerer Apr 28, 2026
0e550cb
Fix style
fangerer Apr 28, 2026
84c3d81
Remove stale native init argument
fangerer Apr 28, 2026
2ced092
Cleanup NativeSimpleType
fangerer Apr 29, 2026
2073125
Remove unused UsePanama option
fangerer Apr 29, 2026
e465259
Post-rebase fixes
otethal Apr 30, 2026
ca9cc27
Address review comments
otethal May 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
36 changes: 17 additions & 19 deletions ci.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,6 @@
// -----------------------------------------------------------------------------------------------------------------
local gate_task_dict = {
"python-unittest": gpgate + platform_spec(no_jobs) + platform_spec({
"linux:amd64:jdk21" : daily + t("01:00:00") + provide(GPY_JVM21_STANDALONE),
"linux:aarch64:jdk21" : daily + t("02:00:00") + provide(GPY_JVM21_STANDALONE),
"darwin:aarch64:jdk21" : daily + t("01:30:00") + provide(GPY_JVM21_STANDALONE),
"windows:amd64:jdk21" : daily + t("01:30:00") + provide(GPY_JVM21_STANDALONE),
"linux:amd64:jdk-latest" : tier2 + require(GPY_JVM_STANDALONE),
"linux:aarch64:jdk-latest" : tier3 + provide(GPY_JVM_STANDALONE),
"darwin:aarch64:jdk-latest" : tier3 + provide(GPY_JVM_STANDALONE),
Expand All @@ -136,10 +132,6 @@
"darwin:aarch64:jdk-latest" : daily + t("01:00:00"),
}),
"python-unittest-multi-context": gpgate + platform_spec(no_jobs) + platform_spec({
"linux:amd64:jdk21" : daily + t("01:00:00") + require(GPY_JVM21_STANDALONE),
"linux:aarch64:jdk21" : daily + t("01:30:00") + require(GPY_JVM21_STANDALONE),
"darwin:aarch64:jdk21" : daily + t("01:00:00") + require(GPY_JVM21_STANDALONE),
"windows:amd64:jdk21" : daily + t("02:00:00"),
"linux:amd64:jdk-latest" : tier2 + require(GPY_JVM_STANDALONE),
"linux:aarch64:jdk-latest" : daily + t("01:30:00") + require(GPY_JVM_STANDALONE),
"darwin:aarch64:jdk-latest" : daily + t("01:00:00") + require(GPY_JVM_STANDALONE),
Expand All @@ -160,10 +152,6 @@
"linux:amd64:jdk-latest" : tier2,
}),
"python-unittest-standalone": gpgate_maven + platform_spec(no_jobs) + platform_spec({
"linux:amd64:jdk21" : daily + t("02:00:00") + require(GPY_JVM21_STANDALONE),
"linux:aarch64:jdk21" : daily + t("02:00:00") + require(GPY_JVM21_STANDALONE),
"darwin:aarch64:jdk21" : daily + t("02:00:00") + require(GPY_JVM21_STANDALONE),
"windows:amd64:jdk21" : daily + t("02:00:00") + require(GPY_JVM21_STANDALONE) + batches(2),
"linux:amd64:jdk-latest" : tier3 + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST),
"linux:aarch64:jdk-latest" : tier3 + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST),
"darwin:aarch64:jdk-latest" : tier3 + require(GPY_JVM_STANDALONE) + require(GRAAL_JDK_LATEST),
Expand Down Expand Up @@ -244,17 +232,17 @@
"windows:amd64:jdk-latest" : weekly + t("20:00:00") + require(GPY_NATIVE_STANDALONE),
}),
"python-coverage-jacoco-tagged": cov_jacoco_tagged + batches(COVERAGE_SPLIT) + platform_spec(no_jobs) + platform_spec({
"linux:amd64:jdk21" : weekly + t("20:00:00"),
"darwin:aarch64:jdk21" : weekly + t("20:00:00"),
"windows:amd64:jdk21" : weekly + t("20:00:00"),
"linux:amd64:jdk-latest" : weekly + t("20:00:00"),
"darwin:aarch64:jdk-latest" : weekly + t("20:00:00"),
"windows:amd64:jdk-latest" : weekly + t("20:00:00"),
}),
"python-coverage-jacoco-base": cov_jacoco_base + platform_spec(no_jobs) + platform_spec({
"linux:amd64:jdk21" : weekly + t("20:00:00"),
"darwin:aarch64:jdk21" : weekly + t("20:00:00"),
"windows:amd64:jdk21" : weekly + t("20:00:00"),
"linux:amd64:jdk-latest" : weekly + t("20:00:00"),
"darwin:aarch64:jdk-latest" : weekly + t("20:00:00"),
"windows:amd64:jdk-latest" : weekly + t("20:00:00"),
}),
"python-coverage-truffle": cov_truffle + platform_spec(no_jobs) + platform_spec({
"linux:amd64:jdk21" : weekly + t("20:00:00"),
"linux:amd64:jdk-latest" : weekly + t("20:00:00"),
}),
"corp-compliance-watchdog": watchdog + platform_spec(no_jobs) + platform_spec({
"linux:amd64:jdk-latest" : tier1,
Expand All @@ -274,10 +262,20 @@
}),
// tests with sandboxed backends for various modules (posix, sha3, compression, pyexpat, ...)
"python-unittest-sandboxed": gpgate_ee + platform_spec(no_jobs) + platform_spec({
"linux:amd64:jdk21" : daily + t("01:00:00") + provide(GPY_JVM21_STANDALONE),
"linux:aarch64:jdk21" : daily + t("02:00:00") + provide(GPY_JVM21_STANDALONE),
"darwin:aarch64:jdk21" : daily + t("01:00:00") + provide(GPY_JVM21_STANDALONE),
"windows:amd64:jdk21" : daily + t("01:30:00"),
"linux:amd64:jdk-latest" : tier2 + batches(2),
"linux:aarch64:jdk-latest" : tier3,
"darwin:aarch64:jdk-latest" : tier3,
}),
"python-unittest-multi-context-sandboxed": gpgate_ee + platform_spec(no_jobs) + platform_spec({
"linux:amd64:jdk21" : daily + t("01:00:00") + require(GPY_JVM21_STANDALONE),
"linux:aarch64:jdk21" : daily + t("01:30:00") + require(GPY_JVM21_STANDALONE),
"darwin:aarch64:jdk21" : daily + t("01:00:00") + require(GPY_JVM21_STANDALONE),
"windows:amd64:jdk21" : daily + t("02:00:00"),
}),
"python-svm-unittest-sandboxed": gpgate_ee + platform_spec(no_jobs) + platform_spec({
"linux:amd64:jdk-latest" : tier3 + provide(GPYEE_NATIVE_STANDALONE),
}),
Expand Down
51 changes: 27 additions & 24 deletions docs/contributor/IMPLEMENTATION_DETAILS.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,24 +199,27 @@ Below is a rough draft of the types and memory layouts involved and how they con
```
Managed Heap Native Heap
Stub allocated to represent managed object
+------------------------+ +-------------------------------+
| PInt |<---+ | struct PyGC_Head { |
+------------------------+ | | uintptr_t _gc_next |
| BigInteger value | | | uintptr_t _gc_prev |
+------------------------+ | | } |
| +------------>| struct GraalPyObject { |
+------------------------+ | | | Py_ssize_t ob_refcnt |
| PythonNativeWrapper |<---+ | +------>| PyObject *ob_type |
+------------------------+------------+ | | int32_t handle_table_index |---+
| +<---+ | | } | |
+------------------------+ | | +-------------------------------+ |
| | |
| | |
+------------------------+ | | |
+---| PythonObjectReference |<---+ | |
| +------------------------+------------------+ |
| | boolean gc | |
| | boolean freeAtCollect | - |
+---------------------------+ +-------------------------------+
+-->| PInt | | struct PyGC_Head { |
| +---------------------------+ | uintptr_t _gc_next |
| | long nativePointer |---------------+ | uintptr_t _gc_prev |
| | PythonObjectReference ref |----+ | | } |
| | BigInteger value | | +------>| struct GraalPyObject { |
| +---------------------------+ | | | Py_ssize_t ob_refcnt |
| | | | PyObject *ob_type |
| | | | int32_t handle_table_index |---+
| | | | } | |
| | | +-------------------------------+ |
| | | |
| | | |
| | | |
| | | |
| +------------------------+ | | |
+---| PythonObjectReference |<------+ | |
+------------------------+ | |
| long pointer |------------------+ |
| boolean gc | |
+---| boolean freeAtCollect | |
| +------------------------+ |
| |
| +------------------------+ |
Expand Down Expand Up @@ -244,7 +247,7 @@ Below is a rough draft of the types and memory layouts involved and how they con

```

Managed objects are associated with `PythonNativeWrapper` subinstances when
Managed objects store a pointer to native `GraalPyObject` subinstances when
they go to native, native objects are represented throughout the interpreters
as `PythonAbstractNativeObject`. Both have associated weak references,
`PythonObjectReference` and `NativeObjectReference`, respectively.
Expand All @@ -261,14 +264,14 @@ Java code and is, for example, passed as an argument.

When a managed object is passed to a native extension code:

* We create `PythonNativeWrapper`. We create `PythonNativeWrapper` to
provide a different interop protocol, and not expose `toNative` and
`asPointer` on Python objects. The wrapper is stored inside the
* We allocate a `GraalPyObject`, `GraalPyVarObject`, or `GraalPyFloatObject` in
off-heap memory. The native pointer is stored inside the
`PythonAbstractObject`, because pointer identity is relied upon by some
extensions we saw in the wild. (See PythonToNativeNode)
* If the object was a "primitive" (TruffleString, int, long, boolean) we must
box it first into a `PythonAbstractObject`, so we create a `PString` or
`PInt` wrapper (or retrieve one for the singletons).
first promote the object to an appropriate instance of
`PythonAbstractObject` (e.g. `PString` is the promoted object for
`TruffleString` and `PInt` for Java `int`, `long`, `boolean`).
* For container types (such as tuples, lists), when their elements are
accessed any primitive elements are (like the previous step) boxed into a
`PythonAbstractObject`.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright (c) 2020, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* The Universal Permissive License (UPL), Version 1.0
*
* Subject to the condition set forth below, permission is hereby granted to any
* person obtaining a copy of this software, associated documentation and/or
* data (collectively the "Software"), free of charge and under any and all
* copyright rights in the Software, and any and all patent rights owned or
* freely licensable by each licensor hereunder covering either (i) the
* unmodified Software as contributed to or provided by such licensor, or (ii)
* the Larger Works (as defined below), to deal in both
*
* (a) the Software, and
*
* (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if
* one is included with the Software each a "Larger Work" to which the Software
* is contributed by such licensors),
*
* without restriction, including without limitation the rights to copy, create
* derivative works of, display, perform, and distribute the Software and make,
* use, sell, offer for sale, import, export, have made, and have sold the
* Software and the Larger Work(s), and to sublicense the foregoing rights on
* either these or other terms.
*
* This license is subject to the following condition:
*
* The above copyright notice and either this complete permission notice or at a
* minimum a reference to the UPL must be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.oracle.graal.python.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.TYPE)
public @interface CApiExternalFunctionSignatures {
}
17 changes: 17 additions & 0 deletions graalpython/com.oracle.graal.python.benchmarks/python/harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,22 @@ def warmup(cp_index):
return -1


def ensure_packages(**package_specs):
import sys, os

rootdir = os.path.dirname(__file__)
while os.path.basename(rootdir) != 'graalpython':
rootdir = os.path.dirname(rootdir)

sys.path.append(os.path.join(
rootdir,
"com.oracle.graal.python.test",
"src",
))
from tests import ensure_packages
ensure_packages(**package_specs)


def ccompile(name, code):
import sys, os

Expand Down Expand Up @@ -287,6 +303,7 @@ def get_bench_module(bench_file):
with _io.FileIO(bench_file, "r") as f:
bench_module.__file__ = bench_file
bench_module.ccompile = ccompile
bench_module.ensure_packages = ensure_packages
exec(compile(f.readall(), bench_file, "exec"), bench_module.__dict__)
return bench_module

Expand Down
Loading
Loading