You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cd25567
Browse filesBrowse the repository at this point in the historyBrowse files
Add Fortran assumed-type argument support
* add `AnyNative` contracts for `TYPE(*)` scalar, assumed-size, assumed-shape, and assumed-rank dummies
* lower assumed-type arguments through raw-address or C descriptor ABI according to the Fortran dummy declaration
* support NumPy scalars, arrays, native derived objects, and module-backed native storage
* preserve read-only, contiguous, optional, and asynchronous source semantics
* add runtime type discovery, descriptor validation, and derived-type identity metadata
* support generated, hand-authored, and edited `.pyi` contracts
* add end-to-end coverage across compilers, platforms, module variables, and derived types
* document assumed-type support and current limitations
Copy file name to clipboardExpand all lines: AGENTS.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,7 @@ Ignore:
38
38
Do not spend context window or analysis on those files unless explicitly requested.
39
39
When asked to change or move an API, import path, command, feature, or behavior, do not add or keep compatibility layers, aliases, shims, fallback paths, or legacy entrypoints unless explicitly requested. A requested change means the old behavior should be removed.
40
40
When updating tests, remove obsolete tests that only assert removed/old implementation behavior does not exist. Do not preserve rejection or absence checks for API/features that were intentionally removed unless explicitly requested.
41
+
Do not add tests whose purpose is only to prove that removed or nonexistent features are rejected. Test supported behavior and meaningful validation boundaries instead. For example, if `ArrayCategory` is removed, delete its tests; do not add a test asserting that `ArrayCategory` now fails.
41
42
42
43
Treat tests as evidence for a named invariant, not as specifications merely
43
44
because they already exist. Add or retain automated tests when they protect at
Copy file name to clipboardExpand all lines: docs/user/language-support/feature-matrix.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,7 @@ where they apply.
63
63
| Pointer scalar projections and array handles | Partially supported |[Pointers](../guide/pointers.md)|[Pointer handle tests](../../../tests/fortran/pointers/end_to_end/test_pointer_handles.py), [pointer policy tests](../../../tests/fortran/pointers/policy/test_pointer_ownership_policy.py), [scalar-derived matrix tests](../../../tests/fortran/derived_types/end_to_end/test_scalar_actual_dummy_matrix.py)| Descriptor arguments, module and field handles, strided views, and returned array handles are supported. Deferred-width character views require contiguous storage and a compatible compiler. |
64
64
| Array-valued function results | Supported |[Array results](../guide/arrays.md#mutation-and-results)|[Array result tests](../../../tests/fortran/arrays/end_to_end/test_array_results.py)| Ownership and dtype/shape behavior are limited to documented array result forms. |
| Assumed-type native arguments | Partially supported |[Arrays](../guide/arrays.md#pass-values-to-type-dummies)|[Assumed-type source and edited-contract tests](../../../tests/fortran/assumed_types/end_to_end/test_assumed_type_calls.py)|`AnyNative` accepts PRIK-native NumPy and derived actuals. Descriptor dtypes have a documented subset; assumed-size is rank one, and nonblocking buffer lifetime remains caller-owned. |
66
67
| Derived-type scalar boundaries and methods | Supported |[Derived types](../guide/wrapping-derived-types.md)|[Derived boundary tests](../../../tests/fortran/derived_types/end_to_end/test_derived_boundaries.py), [method tests](../../../tests/fortran/derived_types/end_to_end/test_type_bound_methods.py)| Derived-type arrays and some polymorphic forms are not included. |
67
68
| Default and keyword constructors with finalizers | Supported |[Constructors and finalizers](../guide/wrapping-derived-types.md#key-concepts)|[Constructor/finalizer tests](../../../tests/fortran/derived_types/end_to_end/test_default_constructors_and_finalizers.py), [borrowed finalizer tests](../../../tests/fortran/derived_types/end_to_end/test_borrowed_components.py)| Construction commits ownership only after initialization; borrowed wrappers never run an owning finalizer. |
68
69
| Generic constructor interfaces and overloaded runtime initialization | Supported |[Constructors](../guide/wrapping-derived-types.md#custom-constructor)|[Edited class surface tests](../../../tests/fortran/infrastructure/semantic_pyi/contracts/functions_and_classes/end_to_end/test_edited_class_surfaces.py), [class policy tests](../../../tests/fortran/infrastructure/semantic_pyi/contracts/functions_and_classes/policy/test_class_surface_policy.py)| Candidates require distinguishable completed Python signatures; incomplete or ambiguous sets are blocked before emission. |
@@ -99,7 +100,7 @@ where they apply.
99
100
| Fortran parse, semantic IR, and `.pyi` inspection | Supported |[CLI commands](../reference/cli-commands.md#parse-and-semantics)|[Fortran parser fixtures](../../../tests/fortran/infrastructure/parsing/test_fortran_fixture_suite.py), [Fortran semantic tests](../../../tests/fortran/infrastructure/semantic_ir/semantics/)| Inspection support does not by itself prove runtime wrapper support. |
100
101
| Semantic `.pyi` wrapper builds from explicit native artifacts | Partially supported |[Editing `.pyi` contracts](../reference/pyi-contracts/index.md)|[format and authoritative-input tests](../../../tests/fortran/infrastructure/semantic_pyi/), [multi-source contract tests](../../../tests/fortran/infrastructure/building/end_to_end/test_multi_source_builds.py), [native build plan tests](../../../tests/fortran/infrastructure/building/end_to_end/test_source_build_modes.py)| Source/generated/modified multi-source package parity is covered. Support is limited to contract forms with linked build evidence; no general parity claim is made for every source-supported Fortran feature. |
101
102
| Scalar inheritance and polymorphic dispatch | Partially supported |[Inheritance and polymorphic input](../guide/wrapping-derived-types.md#inheritance-and-polymorphic-input-dispatch)|[Inheritance tests](../../../tests/fortran/derived_types/end_to_end/test_inheritance_and_polymorphism.py)| Abstract types wrap as non-instantiable Python base classes and deferred bindings resolve through the caller's concrete type. Polymorphic results, mutable dummies, arrays, allocatable/pointer scalars, and `class(*)` are blocked. |
102
-
| Assumed-size, assumed-rank, and lower-bound array contracts | Partially supported |[Arrays](../guide/arrays.md)|[Assumed-rank tests](../../../tests/fortran/arrays/end_to_end/test_assumed_rank_arrays.py)| Assumed type and derived-type arrays remain blocked. Character arrays require fixed-width NumPy bytes dtype. |
| Unproved pointer lifetime and ownership-changing operations | Unsupported |[Pointer safety](../guide/pointers.md#safety-checklist)|[Pointer policy tests](../../../tests/fortran/pointers/policy/test_pointer_ownership_policy.py), [pointer runtime tests](../../../tests/fortran/pointers/runtime/test_pointer_handle_protocol.py)| Native targets must outlive every handle use; allocation, target deallocation, resize, and writable reassociation require explicit completed policy. |
128
129
| Persistent callbacks and procedure pointers | Unsupported |[Callback limitations](../guide/callbacks.md#important-limitations)|[Callback policy tests](../../../tests/fortran/callbacks/policy/test_callback_policy.py), [scalar callback tests](../../../tests/fortran/callbacks/end_to_end/test_scalar_callbacks.py)| Callbacks are valid only during the wrapped call. |
129
130
| Advanced multi-source dependency discovery and external-library integration | Unsupported |[Multiple source files](../guide/building-shared-library.md#multiple-source-files)|[Multi-source tests](../../../tests/fortran/infrastructure/building/end_to_end/test_multi_source_builds.py)| PRIK does not discover sources you did not name, prebuilt module search paths, or external libraries. Dependency ordering among the sources it parses is supported. |
130
-
| Blocked array forms | Unsupported |[Arrays](../guide/arrays.md)|[Array semantic tests](../../../tests/fortran/arrays/semantics/test_array_semantics.py), [diagnostics](../reference/diagnostic-codes.md)|Assumed type `type(*)`, arrays of derived types, and character arrays not representable as fixed-width bytes need missing runtime contracts. |
131
+
| Blocked array forms | Unsupported |[Arrays](../guide/arrays.md)|[Array semantic tests](../../../tests/fortran/arrays/semantics/test_array_semantics.py), [diagnostics](../reference/diagnostic-codes.md)|Arrays of derived types and character arrays not representable as fixed-width bytes need missing runtime contracts. |
131
132
| Unsupported polymorphic forms | Unsupported |[Inheritance limits](../guide/wrapping-derived-types.md#inheritance-and-polymorphic-input-dispatch)|[Inheritance tests](../../../tests/fortran/derived_types/codegen/test_class_surfaces.py)| Results, mutable dummies, arrays, polymorphic allocatable/pointer scalars, and `class(*)` are blocked. Abstract types and deferred bindings are supported. |
132
133
| Ambiguous or incomplete constructor overload sets | Unsupported |[Constructor limitations](../guide/wrapping-derived-types.md#custom-constructor)|[Constructor semantic tests](../../../tests/fortran/infrastructure/semantic_pyi/contracts/functions_and_classes/semantics/test_method_and_constructor_contracts.py), [class-plan validation tests](../../../tests/fortran/infrastructure/semantic_pyi/contracts/functions_and_classes/policy/test_class_surface_policy.py)| Candidates must have distinguishable exact runtime signatures and compatible native-owner lifecycles. A Fortran `interface <typename>` is wrapped as the type's overloaded constructor. |
133
134
| Parameterized derived types | Unsupported |[Fortran support boundaries](fortran-support.md#important-boundaries)|[Parameterized-declaration parsing](../../../tests/fortran/derived_types/parsing/test_parameterized_derived_types.py)| The parser preserves the declaration and its parameter expressions, but wrapper semantics do not model type parameters. A build can currently reach compiler probing and surface a raw compiler diagnostic instead of a PRIK diagnostic. |
Copy file name to clipboardExpand all lines: docs/user/reference/pyi-format.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -921,12 +921,12 @@ type. Metadata falls into four groups.
921
921
|`Contiguous`| Storage is contiguous. | Loaded source-provenance/compatibility fact; on `T[...]` it narrows stride-agnostic runtime-rank storage to the language's contiguous order. |
922
922
|`Aliased`| Native storage is addressable or may be exposed as an alias. | Fortran `target` and borrowed native objects. |
923
923
|`Immutable`| Python-visible value is replace-only, not mutated in place. | Requires a compatible replacement/copy policy for writable native storage. |
924
+
|`ReadOnly`| Native code reads an `AnyNative` actual without writing it. | Use when an immutable NumPy scalar should be accepted. |
924
925
|`Polymorphic`| Fortran native declaration is `class(T)`. | Fortran. |
925
-
|`AssumedType`| Fortran native declaration is assumed type. | Accepted/generated where source semantics require it; wrapper support is limited. |
926
926
|`MaybeUnallocated`| Direct allocatable array function result can be unallocated. | Valid only on that result form. |
927
927
|`PointerAssociation("runtime")`| Pointer association is runtime state. | Fortran pointer facts. |
928
928
|`SourceName("native-name")`| Preserve a native name that the Python identifier cannot represent. | Shared. |
929
-
|`ArrayCategory("...")`, `FortranAllocatable`|Older source-provenance spellings. | Loaded compatibility; use active storage syntax for authored contracts. |
0 commit comments