seamless-signature
YAML schema language for describing Seamless compiled-kernel function signatures, with a deterministic schema-to-C-header generator.
seamless-signature turns a YAML schema like:
inputs:
- name: a
dtype: int32
- name: matrix
dtype: float64
shape: ["X", "Y"]
outputs:
- name: result
dtype: float64
shape: ["Y"]
into a parsed Signature object and a generated C header (tf.header) that the Seamless compiled transformer pipeline feeds to CFFI to build the .so extension. It is the single source of truth from which the Python callable signature, C header, and runtime type-marshalling rules are all derived.
What the schema describes
- Scalars:
dtype: int32 | int64 | float32 | float64 | bool | …(the standard numpy scalar names). - Arrays:
shape: [...]with named wildcard dimensions ("X","Y") shared across the whole signature. - Trailing fixed dimensions:
shape: ("X", "Y", 3)collapses into a generated typedef (typedef int32_t int32_3[3];) so kernels can write idiomatic C indexing. - Structured dtypes (
StructDType): recursive nested field definitions that map to Ctypedef structs with field-by-field byte-offset alignment. - Output-only wildcards: dimensions that do not appear in any input (e.g.
K); the runtime requires ametavars.maxKupper bound and the kernel writes the actual size back via an output pointer.
Why a separate package
Compiled transformers need a stable contract between the YAML schema, the C header, and the Python callable signature. Splitting that contract into its own package keeps the surface narrow and lets both the Seamless transformer pipeline and external tooling (e.g. cross-language signature generators for Fortran or Rust) consume the same parsed Signature without dragging in the rest of seamless-transformer.
Installation
pip install seamless-signature
seamless-signature is also pulled in automatically by seamless-transformer[compiled].
Public API
from seamless_signature import load_signature, generate_header
sig = load_signature(yaml_path_or_string)
header = generate_header(sig) # returns the C header text
For the full schema reference, including dtype tables, wildcard rules, struct-field semantics, and worked examples (including derivations to Fortran and Rust signatures), see docs/agent/contracts/seamless-signature-schema.md in the Seamless repo.
Relationship to the Seamless ecosystem
seamless-signature ← schema parsing + C header generation
│
▼
seamless-transformer ← consumes Signature; builds .so via CFFI
(CompiledTransformer / DirectCompiledTransformer)
seamless-signature has no dependency on the rest of Seamless and is published as an independent PyPI package; it is reusable in any context that needs a YAML-to-C-signature contract.
Metadata
Release files for seamless-signature 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| seamless_signature-0.1.2.tar.gz | 10.0 kB | Without provenance | Details for seamless_signature-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| seamless_signature-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for seamless_signature-0.1.2-py3-none-any.whl |
Total release size: 18.7 kB
Release files / seamless_signature-0.1.2.tar.gz
| Download URL | seamless_signature-0.1.2.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
519a66aa8765ac111c1058a5548fa9cc57e954801504f8d7631831368f9b60a2
|
|
BLAKE2b-256 checksum How to use checksums |
9a7303e47a9d6a30b92611311f962a1a5982ca3361cf91c7a9f3c9e057beafb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.12
|
Release files / seamless_signature-0.1.2-py3-none-any.whl
| Download URL | seamless_signature-0.1.2-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
76475bbdb0bd133c611a55eb35ea68977e02f4b9e35351e09ae2a255726f6113
|
|
BLAKE2b-256 checksum How to use checksums |
fa42d40fbaa083367add6bf7d401e9497cb22605f6d9abc01dd93ff5f4143c7b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.12
|
Security for seamless-signature 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.