Releases: PyNumLab/prik
Release list
PRIK 0.5.0
PRIK 0.5.0 adds first-class CMake integration and significantly expands native array interoperability.
Highlights
- Added
UsePRIK.cmakeandprik_add_module()for integrating PRIK directly into existing CMake projects. - Added
find_package(PRIK CONFIG REQUIRED)support, including automatic discovery through scikit-build-core'scmake.rootentry point. - Added
prik generate --cmakefor generating standalone CMake projects. - Added
prik doctor cmaketo diagnose Python/CMake discovery and conflicting PRIK installations. - CMake configuration now uses a lightweight structural plan; full PRIK parsing and code generation happen only during the build when outputs are stale.
- Added dependency-file tracking for transitive Fortran/C inputs and stable generated-source graphs for incremental builds.
- Expanded native array handles to support allocatable and pointer arguments, results, module variables, derived-type fields, optional arguments, character arrays, and supported Fortran sections.
- Improved generated-wrapper build time and contiguous-array call overhead.
Breaking change
The native array-handle ABI is now prik.native_array_backend.v2.
Extensions that exchange PRIK native array handles must be rebuilt.
See the full changelog for all changes and implementation details.
PRIK 0.4.3
Republishes 0.4.2. That tag carried the previous package version, so the built distribution was rejected as an existing release and never reached PyPI. The contents are unchanged.
PRIK 0.4.2
-
The
jupyterextra now accepts IPython 7.0 and newer instead of requiring
8.0. The cell magics use only long-stable IPython APIs, and the higher floor
madepip install prik[jupyter]upgrade the IPython that hosted notebook
environments ship, which forced a runtime restart for no benefit. Theqa
extra installsprik[jupyter]rather than repeating that requirement, so
the supported IPython range is stated once. -
Added a runnable
examples/notebooks/quickstart.ipynband its guided
tutorial, covering a Fortran cell, a C cell, and reshaping the generated API
by editing its semantic contract in the same session. The home page, Getting
Started, the tutorial, and the README offer it as a Colab run or a direct
download, so the documented workflow can be tried before installing anything. -
Generated contracts now represent a one-level primitive C pointer as
runtime-rankT[...]NumPy storage instead of choosing a scalar temporary.
It accepts ranks 0 through 15 with any strides, so a Fortran-ordered array
or a strided slice reaches the native call unchanged, and it can be narrowed
to contiguous, rank-zero, fixed-rank, or scalar-address storage in an edited
contract.Arg(i).sizesupplies the total element count to a native
parameter, alongside the existingArg(i).shape[d]andArg(i).strides[d]
layout projections; an axis projection against storage that has no such axis
now raisesTypeErrorinstead of reading past the actual's shape. -
Getting Started now offers complete Fortran and C paths for toolchain
verification, building the same first function, and the edit-review-build-test
loop. Fortran modules now begin in their task-focused User Guide page instead
of a separate mandatory beginner step. -
Added a dedicated C section to the User Guide for scalar functions, pointer
contracts, arrays and strings, outputs and errors, and native symbols and
dependencies. The C Support page now serves as a concise capability and
boundary map with the same wrapper-area, boundary, and source-entry structure
as Fortran Support. User Guide navigation presents separate Fortran and C
paths followed by their shared build workflows. -
An array argument now requires the NumPy storage of the C element type its
source declares, rather than the canonical storage of the same width. A
target'sint64_tmay belongorlong long, and NumPy independently
givesNPY_INT64to whichever of the two is 64 bits, so those two choices
could disagree: along long *buffer asked fornumpy.longlongon one
target andnumpy.int64on another. One C source now keeps one accepted
dtype everywhere. -
A scalar argument whose native parameter is a 64-bit C integer now accepts
either NumPy spelling of that width and converts it, sonp.int64and
np.longlongare both valid for along longorlongparameter whichever
one the target callsint64_t. Array arguments are unchanged: an element
buffer cannot be converted, so it still requires the exact native dtype. -
A cell magic that reads a dash-prefixed flag value as another option now
names the equals form and, for the flag groups, the quoted-group form. -
Added optional
%%fortran,%%c, and%%pyiIPython/Jupyter cell magics.
Native-source cells compile directly or, with--pyi, persist their exact
source and insert editable per-module or direct-declaration contract cells.
Executing the generated%%pyicell recovers the source language from its
digest, builds against that cached source, and publishes declared Fortran
modules or standalone declarations directly in the notebook namespace.
Exact cells reuse a persistent SHA-256 build cache unless--forceis
selected, and PRIK does not expose an internal package entry. Wrapped
functions follow the published notebook path (maths.squareor standalone
square) instead of exposing the private cache extension name; ordinary
file builds retain their user-selected package root, such as
geometry.maths.square. Existing notebook build artifacts are rebuilt once
so cached extensions cannot retain the old private function identity.
Multi-module--pyicells are presented sequentially in terminal IPython,
whose next-input prompt can hold only one editable contract, while Jupyter
frontends continue to receive every generated module cell immediately. All
cells in one generated contract bundle retain the source cell's effective
compiler and build flags; changing that configuration requires regenerating
the bundle and is rejected before compiler execution. Independently authored
%%pyicells can instead name one or more existing implementation files with
--native-fortran-sourcesor--native-c-sources; each cell builds and
publishes only its own contract module, and native file-content changes
invalidate its persistent cache. -
A one-character
@native_callliteral is now buildable:String[1]("N")
declares the character a native parameter receives instead of leaving it a
visible Python argument. It crosses the boundary as an interoperablechar,
so the same completed decision reaches a bridged Fortrancharacter(len=1)
dummy and a directbind(C)entrypoint. Policy completion requires exactly
one byte-representable character; invalid values and longer fixed-length
literals are rejected before planning. -
A
@native_callcomputed projection can now state the integer type it is
materialized as:Int32(Arg(0).shape[0])beside the existingInt32(1)
literal form. Shape, stride and length producers previously always crossed
the boundary asSizeT, which is the right identity for a Csize_t
parameter but not for a default FortranINTEGER, so those parameters had to
stay visible in the Python signature. Fixed-width signed and unsigned integer
contract types andSizeTare accepted; unresolvedIntandUIntare
rejected before planning. The explicit conversion is not range-checked. -
Renamed the exact C scalar mechanism from "cast" to "identity" throughout the
semantic IR and policy, matching the documentedExact C Scalar Identities
vocabulary and freeing "cast" for the conversion above. The public contract
helpers (CInt,CLongLong, and the rest) are unchanged. The semantic-IR
JSON record emitted byprik semantics --jsonrenames itsnative_cast
projection key tonative_c_identityand gains avalue_castkey. -
Added a Pythonic BLAS tutorial and runnable example that reshape
DDOT,
DNRM2,DGEMVandDGEMMintodot,norm,matvecandmatmul, plus
DenseMatrix. An edited.pyicontract owns the exact native mapping,
extents, leading dimensions, transposition modes, array validation, fixed
numeric values and result allocation. Matrix operations consume
Fortran-contiguous storage directly, whileDenseMatrixconverts its matrix
once at construction. The example reuses the existing Reference BLAS sources
in a four-file contract, Python API, build and test workflow. The.pyi
reference now states the native identity of shape and stride projections and
the declared-character-literal form. -
Reduced clean-build time for large projects under optimizing compiler flags.
Generated bindings now bind each ordinary array argument through one shared
prik_bind_arrayhelper instead of emitting the whole validate, extract, and
native-handle sequence at every array argument of every wrapper. A wrapper
carries one call and a small table of required extents in place of the
sequence, so the compiler optimizes the binding logic once rather than once
per argument per wrapper. Building the 155-source reference BLAS with
-O3 -march=nativeemits about a third less binding code and compiles it
about 1.4x faster. -
A binding is always one generated C file. Large procedure-only projects were
previously split across<module>_wrapper_001.cand siblings so those units
could compile concurrently; every project now generates only
<module>_wrapper.c. Splitting raised total compiler work — each unit
re-parsedPython.hand the NumPy headers — and paid off only where cores
were idle, which a project's own sources rarely leave. Removing it lowers
total build work and leaves one file to read when inspecting generated
output.
PRIK 0.4.1
Fixed README links and the logo for PyPI rendering.
PRIK 0.4.0
What's Changed
- Implement direct-entrypoint route without an adapted fortran bridge by @saidctb in #60
- Implement C wrapping by @saidctb in #63
Full Changelog: v0.3.0...v0.4.0
PRIK 0.3.0
Added
- Reorganized contributor documentation around a concise architecture guide
and one canonical page per production package, with local structures,
important objects, runnable examples, expected outputs, test owners, change
routes, and invariants. - Consolidated contributor workflows and removed nonessential concept and
design drafts, TODO-only pages, duplicate architecture maps, and completed
migration ledgers. - Added the persistent Zenodo all-versions DOI badge and citation links to the
README and About page. - Included the repository's machine-readable
CITATION.cffmetadata in source
distributions.
Changed
- Marked the contributor Architecture and Codebase Map as reviewed for
publication; the renamed map now focuses on package and cross-stage module
ownership. - Clarified the Feature-to-Code Map as the capability-to-owner and evidence
index, linking reviewed user documentation and retaining only planned
contributor-documentation paths before their review. - Revised the Feature-to-Code Map with reviewed package-guide links,
stage-ordered change routes, narrower focused evidence, and separate array,
callback, and error routes. - Condensed the contributor Testing Strategy around test ownership, stage
evidence, stable contracts, end-to-end evidence, fixture placement, and
verification scope. - Clarified contributor workflows for changing PRIK, local verification, pull
request checks, and documentation maintenance. - Linked the Contributing workflow to the Feature-to-Code Map and Testing
Strategy, explained its pre-push hook setup, and normalized its editable
checkout test commands. - Clarified that pull-request validation requires the performance benchmark and
identified its workflow implementation. - Renamed the Package Guides section to Architecture Components and grouped its
build stages separately from its supporting components, distinguishing
cross-build pipeline orchestration from sequential stages. - Ordered the Developer Documentation sidebar by the architecture reading path,
with build stages before supporting components. - Made every expandable documentation-sidebar section label open its first
published page, including through nested sections, while the adjacent +
control only expands or collapses it. - Made documentation tables wrap readable cell content instead of hiding
later columns behind unnecessary horizontal scrolling. - Added accessible two-, three-, and four-view example tabs to the User Guide;
Getting Started remains linear and example results stay visible. - Reviewed the Pipeline Component guide around the source-build handoff,
independent contract and inspection workflows, and build-result ownership. - Reviewed the Preprocessing Stage guide around its Fortran source route,
compiler-derived target probes, module navigation, and executable examples. - Reviewed the Parsing Stage guide around its Fortran and semantic-
.pyi
algorithms, source-level navigation, executable examples, and ownership
boundaries. - Reviewed the Semantics Stage guide around its shared IR, frontend-conversion
algorithms, raw contract facts, executable examples, and policy boundary. - Reviewed the Policy Stage guide around ordered policy completion, immutable
interoperability decisions, module algorithms, executable examples, and the
planning boundary. - Reviewed the Planning Stage guide around deterministic policy projection,
editable plan ownership, module algorithms, executable examples, and the
generator freeze boundary. - Reviewed the Code Generation Stage guide around its generator handoff,
backend lowering algorithms, plan-only decisions, executable examples, and
focused evidence. - Reviewed the Printing Stage guide around representation-specific traversal,
safe source formatting, isolated.pyiemission, executable examples, and
focused evidence. - Reviewed the Compiler Stage guide around coherent toolchain selection,
explicit command construction, conditional native-support installation,
executable examples, and focused evidence. - Added focused C Binding and Fortran Bridge lowering guides with executable
manually constructed plans and printed backend-source examples. - Moved binding and bridge algorithms and rendered-source demonstrations out
of the Code Generation overview and into their focused lowering guides. - Explained each reviewed package-guide execution example in terms of its
in-memory setup and the stage boundary established by its output. - Added Pipeline Component and source-level navigation for contract loading,
wrapper generation, build-manifest replay, andbuild.pyorchestration. - Removed empty package-marker entries from the Pipeline Component and Compiler
Stage guides. - Added a brief Developer Documentation overview that routes readers to
Architecture, then Architecture Components, and linked it from the website
home page. - Replaced the contributor architecture's text-only build path with a rendered
diagram of its two input routes and shared pipeline. - Made the architecture build-path diagram keyboard-accessible and linked each
route and stage to its reviewed component guide. - Added accessible explanations for
.pyi, f2py.pyf, ABI, semantic IR,
array order, and the GIL throughout User Documentation and on the Home page,
plus per-stage detail panels to the architecture diagram. - Changed the site-wide repository control into a “★ Star on GitHub” call to
action while preserving its repository destination. - Published concise Contracts, Naming, Runtime, and Utilities component guides,
restored their architecture links, corrected the diagram fallback, and
clarified the NumPy result type in the architecture example. - Made numeric scalar results consistently preserve their exact NumPy types;
Boolean scalar results remain Pythonboolvalues. - Corrected user documentation to distinguish numeric and Boolean scalar
boundaries, and aligned the Getting Started route with normal package
installation rather than a repository checkout. - Reduced documentation tests to enforce publication, link integrity,
executable examples, and public-reference contracts without freezing prose,
headings, page inventories, private names, or source-tree layout. - Reclassified implementation-structure and codegen-complexity checks as
contributor recommendations, while retaining hard behavioral, safety, ABI,
publication, and architectural-boundary contracts. - Moved contributor package-guide execution checks into the documentation
suite, using each guide's displayed result instead of a duplicate exact-
output inventory. - Reduced the root
prikAPI to its version and normal-user build entrypoints;
parser, semantic, probe, runtime, and planning tools now use their owning
package import paths. - Moved stage-record freezing from
prik.stage_valuesto
prik.utilities.stage_values; the root module path was removed. - Made
prikan import-only package boundary by removing its direct-script
demonstration; command and stage-value examples remain available from their
owning modules. - Expanded the contributor architecture and package guides with concrete stage
handoffs, runnable example results, focused test purposes, and change routes. - Moved generated documentation and distribution output under the hidden
.artifacts/directory in local commands and CI workflows. - Consolidated developer and maintainer material under one Contributor
Documentation tree and removed the separate maintainer documentation lane. - Moved the bundled header-only binding runtime from the package root into
prik.runtime.native_support; generated builds continue to receive it under
their internalbinding_support/include directory. - Deferred the contributor architecture sections for the immature C input
parser and C-to-IR path while retaining the generated CPython C binding
backend documentation required by Fortran wrappers. - Reorganized compiler and pre-parse infrastructure into
prik.compilerand
prik.preprocessing, including C/Fortran preprocessing and target probes;
the formerprik.compiling,prik.probes, parser-local C preprocessor, and
pipeline-local preprocessing import paths were removed. - Replaced the public semantic-to-NumPy helper API with stage-owned semantic,
contract-runtime, and code-generation datatype catalogues. - Separated post-IR policy and wrapper planning into
prik.policyand
prik.planning; code generation now renders plan-driven docstrings, and the
former maintainer import paths were removed. - Added a top-level language-printer package for C, Fortran, and semantic
.pyioutput, and madepipeline.wrapper.WrapperGeneratorthe single
plan-to-rendered-wrapper orchestration boundary. - Documented the completed ownership vocabulary, lifetime-policy philosophy,
pointer-policy boundary, and maintainer change routes in one maintained
architecture reference. - Moved exact overload selection from generated Python predicate chains to
generated C dispatchers with planned candidate IDs and direct switch-based
calls to the selected existing wrapper. - Stopped standalone Fortran parser discovery from descending into inaccessible
procedure-internal subprograms; procedure-local callback interfaces remain
classified and discoverable. - Made directory project parsing read and parse each discovered Fortran file
once before dependency ordering and project assembly.
Fixed
- Corrected README licensing wording to refer to bundled native-support files
rather than the removed package-rootbinding_support/path. - Unified source-level compile-time resolution across project and CLI parsing
so imported and host-associated kind facts also reach derived-...
PRIK 0.2.1
0.2.1 — 2026-08-11
Added
- Added machine-readable citation metadata through the repository-root
CITATION.cfffile. - Added an About page and public development disclosure covering PRIK's
motivation, design principles, stewardship, and use of AI-assisted tools.
Fixed
- Removed the stale
0.1.xqualifier from the README and website alpha-status
wording after the0.2.0release.
PRIK 0.2.0
Added
- Added maintained FFTPACK and MINPACK examples built from the upstream
fortran-lang projects. Their build scripts, user guides, and numerical tests
cover all 31 FFTPACK and 22 MINPACK public procedures. - Added Python-owned, read-only NumPy snapshots for supported public Fortran
parameter arrays, including MINPACK'sdpmparconstants. - Added declaration-expression support for richer arithmetic, comparisons,
conditionals, array inquiries, and local, imported, or standalone
specification functions, including native-dependent result extents. - Added exact NumPy Boolean-array conversion for compiler-measured 8-, 16-,
32-, and 64-bit Fortran logical kinds, with canonical writeback. - Added
WrapperBuildResult.import_module()to load a generated extension
explicitly without changingsys.path.
Changed
- Moved documentation and maintainer-tool tests to
tests/docs/and
tests/tools/, removed the generictests/shared/bucket, and mirrored
internal tests by production package with narrower support helpers; removed
recursive layout-policing tests that froze maintainer organization, retaining
exceptional release safety undertests/workflows/. The maintainer-tool and
workflow-safety suites, blocking static analysis, and focused documentation
smoke checks now also run through the repository's tracked pre-push hook,
together with one compiled scalar-wrapper smoke test, for earlier local
feedback while remaining enforced by GitHub Actions. - Simplified the documented DGESV validation and the LAPACK test suite to use
explicit NumPy Fortran-order copies, with documented numerical-test helper
conventions. - Aligned the documented MINPACK
hybrd1callback example with its runnable
test, made it verify callback invocation, and made its test problems
self-contained; FFTPACK workspace initializer tests now validate a paired
transform against NumPy or SciPy. - Renamed the developer-facing wrapper generation package from
prik.wrapper_codegentoprik.codegen; the old import path was removed. - Expanded public interface resolution so implemented unnamed interfaces and
public generics can be wrapped without exposing private implementation
procedures. - Expanded the Real Libraries CI lane to build and test BLAS, LAPACK, FFTPACK,
and MINPACK, with cached native BLAS and LAPACK builds where available. - Made performance comparisons faster and less order-sensitive with balanced
A/B/B/A runtime measurements, merged samples, smaller worker budgets, and
four measured clean builds after warm-up. - Refreshed the README and website around the canonical
PRIK — Python Runtime Interop Kit identity, with a concise FAQ, a fair
PRIK-versus-f2py guide, clearer array guidance, and searchable real-library
examples, including a four-library capability and validation summary, a
concise statement of current limitations, and a derived-type inheritance
walkthrough. - Hardened preprocessing, compiler-derived type probes, semantic policy
completion, and multi-source build reporting so unsupported contracts fail
earlier with clearer diagnostics.
Fixed
- Preserved authoritative public interface signatures when linked legacy
implementations use different internal storage declarations, including
FFTPACK'szfftfcomplex-array interface. - Corrected SciPy reference inputs for the LAPACK
dstemranddstebztests
and strengthened BLAS and LAPACK routine validation with independent
mathematical expectations.
PRIK 0.1.1
What's Changed
- Remove parser reference guard and update CONTRIBUTING.md
- Add Contents to README, and Update descritption and keywords in pyproject.toml.
PRIK 0.1.0
- First public release under the PRIK name.
- Build importable Python extensions from supported Fortran sources.
- Generate, inspect, edit, and rebuild from semantic
.pyicontracts. - Expose the
prikconsole command and the equivalentpython -m prik
module command. - Report the installed release through
prik --versionand
prik.__version__. - Added a complete runnable Reference BLAS correctness example covering all 155
discovered routines through PRIK, independent mathematical expectations, and
f2py differential comparisons. - Moved the repository's authoritative Reference BLAS sources to
examples/blas/native/for shared use by the example, integration tests,
LAPACK CI build, and build comparison tooling. - Added a complete Reference LAPACK build and correctness project. It wraps all
2,062 implementation sources once and explicitly validates the reviewed 127
SciPy 1.18.0 double-precision real routines against independent mathematical
invariants and f2py comparisons in the dedicated CI lane. - Moved the repository's authoritative Reference LAPACK implementation sources
toexamples/lapack/native/and updated full-library integration and CI to
consume that single source owner alongsideexamples/blas/native/. - Fixed dependency-safe Python argument conversion ordering for wrappers whose
array extents depend on later native scalar arguments, including padded BLAS
leading dimensions.