Ultra fast agents for nodnod.
Project description
Getting started
import asyncio
from nodina import AsyncNodinaAgent, Scope, scalar_node
@scalar_node
class Hello:
@classmethod
async def __compose__(cls) -> str:
return "Hello,"
@scalar_node
class World:
@classmethod
async def __compose__(cls) -> str:
return "World!"
async def main() -> None:
agent = AsyncNodinaAgent.build({Hello, World})
mapped_scopes = {}
async with Scope(detail="local") as local_scope:
await agent.run(local_scope, mapped_scopes)
print(local_scope[Hello], local_scope[World])
asyncio.run(main())
How it works
nodina is a small DAG scheduler for nodnod
graphs, built as a Cython extension over a tiny native pthread work
pool. It ships two agents:
AsyncNodinaAgentresolves the dependency graph on the running asyncio event loop — one task per node, so independentasyncnodes (and any node that awaits real I/O) run concurrently.NodinaAgentresolves it synchronously, dispatching independent nodes onto a shared pthread pool (nodina/core/nodina_pool.c). The pool's queueing and waiting run without the GIL — theGILis held only inside each__compose__call. A lone ready node with nothing else in flight composes inline to skip a thread hand-off.
Both pick the first successful SequentialEither / ConcurrentEither
candidate in declared order; ConcurrentEither composes all of its candidates
concurrently, SequentialEither composes them lazily. Neither cancels losing
candidates.
Performance & the GIL, honestly
backend_name() returns "cython". The thread pool overlaps nodes that
release the GIL (blocking I/O, time.sleep, C extensions). On a normal
CPython build, CPU-bound __compose__ work still serializes on the GIL —
that is a property of the interpreter, not of nodina.
On a free-threaded build (python3.14t, PEP 703) the GIL is gone and the
pool runs CPU-bound nodes truly in parallel. The extension declares
freethreading_compatible, so importing it does not re-enable the GIL:
# 8 independent CPU nodes, 8-node graph, 11-core machine
python3.14 (GIL): 8 nodes = 206 ms speedup vs serial 1.0x
python3.14t (no GIL): 8 nodes = 40 ms speedup vs serial 5.1x
python -m benchmarks.bench # vs a pure-Python reference
python3.14t -m benchmarks.freethreading_demo # CPU parallelism with the GIL off
The benchmark suite in benchmarks/ measures nodina against a
~150-line pure-Python reference scheduler. nodina ties or beats it on every case
(deep chains and small graphs 3-4x faster); see
benchmarks/RESULTS.md and
benchmarks/BASELINE.md.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nodina-1.0.0.tar.gz.
File metadata
- Download URL: nodina-1.0.0.tar.gz
- Upload date:
- Size: 170.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
730c061c762935fa054da16459f4852e5e78177b47ab1a7d42a96d43c825e278
|
|
| MD5 |
21998f954efbe5962f56d61ed76ac8c0
|
|
| BLAKE2b-256 |
048d72af5b430f2c4c2ad46a2fcfb4895098376cf6ac18db89583d1ad007421c
|
Provenance
The following attestation bundles were made for nodina-1.0.0.tar.gz:
Publisher:
release.yml on luwqz1/nodina
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nodina-1.0.0.tar.gz -
Subject digest:
730c061c762935fa054da16459f4852e5e78177b47ab1a7d42a96d43c825e278 - Sigstore transparency entry: 1984852783
- Sigstore integration time:
-
Permalink:
luwqz1/nodina@24f15e67f153964eaa97f14496dc889c1c308f7c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/luwqz1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@24f15e67f153964eaa97f14496dc889c1c308f7c -
Trigger Event:
push
-
Statement type:
File details
Details for the file nodina-1.0.0-cp314-cp314-win_amd64.whl.
File metadata
- Download URL: nodina-1.0.0-cp314-cp314-win_amd64.whl
- Upload date:
- Size: 257.8 kB
- Tags: CPython 3.14, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
783f15497eb507251b78818934b752bf4d198f7d8a70e8d46a0becc924943fea
|
|
| MD5 |
5fafadf8c4aaaeb20f44f8a62c4bfa12
|
|
| BLAKE2b-256 |
a0e4c731b46dc05b8648662444c22f54b45cd35c648d5cfee00bb202108bb974
|
Provenance
The following attestation bundles were made for nodina-1.0.0-cp314-cp314-win_amd64.whl:
Publisher:
release.yml on luwqz1/nodina
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nodina-1.0.0-cp314-cp314-win_amd64.whl -
Subject digest:
783f15497eb507251b78818934b752bf4d198f7d8a70e8d46a0becc924943fea - Sigstore transparency entry: 1984853811
- Sigstore integration time:
-
Permalink:
luwqz1/nodina@24f15e67f153964eaa97f14496dc889c1c308f7c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/luwqz1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@24f15e67f153964eaa97f14496dc889c1c308f7c -
Trigger Event:
push
-
Statement type:
File details
Details for the file nodina-1.0.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: nodina-1.0.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 873.6 kB
- Tags: CPython 3.14, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cad4810402bbd834238e9cb86bc6720e207001b8053741f7f5ad25e5b2cc12d0
|
|
| MD5 |
1ffdaed199f9c1c148beae9ed1d13b90
|
|
| BLAKE2b-256 |
53bcd4570ac1f2d05ed4369b22990313e6a3fe934980cd55285d8ad8f90a716d
|
Provenance
The following attestation bundles were made for nodina-1.0.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
release.yml on luwqz1/nodina
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nodina-1.0.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
cad4810402bbd834238e9cb86bc6720e207001b8053741f7f5ad25e5b2cc12d0 - Sigstore transparency entry: 1984853277
- Sigstore integration time:
-
Permalink:
luwqz1/nodina@24f15e67f153964eaa97f14496dc889c1c308f7c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/luwqz1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@24f15e67f153964eaa97f14496dc889c1c308f7c -
Trigger Event:
push
-
Statement type:
File details
Details for the file nodina-1.0.0-cp314-cp314-macosx_11_0_arm64.whl.
File metadata
- Download URL: nodina-1.0.0-cp314-cp314-macosx_11_0_arm64.whl
- Upload date:
- Size: 272.1 kB
- Tags: CPython 3.14, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d56820295b414df24e3bdc8160c27b87995b81ef3a422c293bb31568a8a8a8b
|
|
| MD5 |
2adc18da981f5152007880ece188c534
|
|
| BLAKE2b-256 |
6d101102275c18a7e8fa2b8646db39abff405994fcaa47279b93eeaf53b9be4e
|
Provenance
The following attestation bundles were made for nodina-1.0.0-cp314-cp314-macosx_11_0_arm64.whl:
Publisher:
release.yml on luwqz1/nodina
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nodina-1.0.0-cp314-cp314-macosx_11_0_arm64.whl -
Subject digest:
9d56820295b414df24e3bdc8160c27b87995b81ef3a422c293bb31568a8a8a8b - Sigstore transparency entry: 1984853916
- Sigstore integration time:
-
Permalink:
luwqz1/nodina@24f15e67f153964eaa97f14496dc889c1c308f7c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/luwqz1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@24f15e67f153964eaa97f14496dc889c1c308f7c -
Trigger Event:
push
-
Statement type:
File details
Details for the file nodina-1.0.0-cp314-cp314-macosx_10_15_x86_64.whl.
File metadata
- Download URL: nodina-1.0.0-cp314-cp314-macosx_10_15_x86_64.whl
- Upload date:
- Size: 276.6 kB
- Tags: CPython 3.14, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8c9fabe7916e46224e656c86386e981c59470c615749de5d7e73c0bae31fa3b
|
|
| MD5 |
ebc8b44d8a3c8790572e9c9fc6b5f8ef
|
|
| BLAKE2b-256 |
9d92cb8c7fa07f2ba952f616e4be08d6ccef2028704de82185b9f1f928a422b9
|
Provenance
The following attestation bundles were made for nodina-1.0.0-cp314-cp314-macosx_10_15_x86_64.whl:
Publisher:
release.yml on luwqz1/nodina
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nodina-1.0.0-cp314-cp314-macosx_10_15_x86_64.whl -
Subject digest:
b8c9fabe7916e46224e656c86386e981c59470c615749de5d7e73c0bae31fa3b - Sigstore transparency entry: 1984853567
- Sigstore integration time:
-
Permalink:
luwqz1/nodina@24f15e67f153964eaa97f14496dc889c1c308f7c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/luwqz1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@24f15e67f153964eaa97f14496dc889c1c308f7c -
Trigger Event:
push
-
Statement type:
File details
Details for the file nodina-1.0.0-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: nodina-1.0.0-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 254.7 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46d4fda9ed2948290bfe7a269607f31c8fe266db87c13c0cede17ba88bb57494
|
|
| MD5 |
0dab0d67ec16dcac81069b608bc492f1
|
|
| BLAKE2b-256 |
779aeec91b3293d40b6fe58c150febfbfa18d38b4550bf0bafa469376479b443
|
Provenance
The following attestation bundles were made for nodina-1.0.0-cp313-cp313-win_amd64.whl:
Publisher:
release.yml on luwqz1/nodina
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nodina-1.0.0-cp313-cp313-win_amd64.whl -
Subject digest:
46d4fda9ed2948290bfe7a269607f31c8fe266db87c13c0cede17ba88bb57494 - Sigstore transparency entry: 1984852936
- Sigstore integration time:
-
Permalink:
luwqz1/nodina@24f15e67f153964eaa97f14496dc889c1c308f7c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/luwqz1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@24f15e67f153964eaa97f14496dc889c1c308f7c -
Trigger Event:
push
-
Statement type:
File details
Details for the file nodina-1.0.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: nodina-1.0.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 883.3 kB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
604519cccf84bdc847a6e1afb18f8785280918bcfb61dd2ef420a6a2f1460858
|
|
| MD5 |
46484e5671473fbaee6ecffddbfdfa50
|
|
| BLAKE2b-256 |
ec09c7aac21906b7356f697ae8648afb99212fcc21fb9e00bf37c413c304c49e
|
Provenance
The following attestation bundles were made for nodina-1.0.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
release.yml on luwqz1/nodina
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nodina-1.0.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
604519cccf84bdc847a6e1afb18f8785280918bcfb61dd2ef420a6a2f1460858 - Sigstore transparency entry: 1984853412
- Sigstore integration time:
-
Permalink:
luwqz1/nodina@24f15e67f153964eaa97f14496dc889c1c308f7c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/luwqz1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@24f15e67f153964eaa97f14496dc889c1c308f7c -
Trigger Event:
push
-
Statement type:
File details
Details for the file nodina-1.0.0-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: nodina-1.0.0-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 268.7 kB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07964ed435415f0c859a7515b728131da726a7e1b15e25dbe2e93f4b84719725
|
|
| MD5 |
98d520101b903d1c466fa00a3a13cd34
|
|
| BLAKE2b-256 |
e96925e54a394291822a0617c476c012e2b64d41009317e0c3952db10be3c5d4
|
Provenance
The following attestation bundles were made for nodina-1.0.0-cp313-cp313-macosx_11_0_arm64.whl:
Publisher:
release.yml on luwqz1/nodina
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nodina-1.0.0-cp313-cp313-macosx_11_0_arm64.whl -
Subject digest:
07964ed435415f0c859a7515b728131da726a7e1b15e25dbe2e93f4b84719725 - Sigstore transparency entry: 1984853103
- Sigstore integration time:
-
Permalink:
luwqz1/nodina@24f15e67f153964eaa97f14496dc889c1c308f7c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/luwqz1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@24f15e67f153964eaa97f14496dc889c1c308f7c -
Trigger Event:
push
-
Statement type:
File details
Details for the file nodina-1.0.0-cp313-cp313-macosx_10_13_x86_64.whl.
File metadata
- Download URL: nodina-1.0.0-cp313-cp313-macosx_10_13_x86_64.whl
- Upload date:
- Size: 273.3 kB
- Tags: CPython 3.13, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
209401ff98babcb6e4cc10a44139eb1d7148a7667d5d8a332404a13b73f74281
|
|
| MD5 |
7ad3435a1844e37492bcff4bf94eab14
|
|
| BLAKE2b-256 |
08e4680c807cc04b94f8992afa203a89a3e5d83fb04e2a37e376ea7f762c7f4d
|
Provenance
The following attestation bundles were made for nodina-1.0.0-cp313-cp313-macosx_10_13_x86_64.whl:
Publisher:
release.yml on luwqz1/nodina
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nodina-1.0.0-cp313-cp313-macosx_10_13_x86_64.whl -
Subject digest:
209401ff98babcb6e4cc10a44139eb1d7148a7667d5d8a332404a13b73f74281 - Sigstore transparency entry: 1984853667
- Sigstore integration time:
-
Permalink:
luwqz1/nodina@24f15e67f153964eaa97f14496dc889c1c308f7c -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/luwqz1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@24f15e67f153964eaa97f14496dc889c1c308f7c -
Trigger Event:
push
-
Statement type: