trior 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- trior-0.1.0/.github/workflows/ci.yml +30 -0
- trior-0.1.0/.github/workflows/python-release.yml +133 -0
- trior-0.1.0/.github/workflows/steady-state-benchmark.yml +37 -0
- trior-0.1.0/.gitignore +9 -0
- trior-0.1.0/AGENTS.md +98 -0
- trior-0.1.0/CONTRIBUTING.md +34 -0
- trior-0.1.0/Cargo.lock +133 -0
- trior-0.1.0/Cargo.toml +20 -0
- trior-0.1.0/LICENSE +21 -0
- trior-0.1.0/LICENSE.Trio +23 -0
- trior-0.1.0/PKG-INFO +39 -0
- trior-0.1.0/README.md +133 -0
- trior-0.1.0/benchmarks/bench_churn.py +48 -0
- trior-0.1.0/benchmarks/bench_io.py +48 -0
- trior-0.1.0/benchmarks/bench_nursery_start.py +41 -0
- trior-0.1.0/benchmarks/bench_runtime.py +118 -0
- trior-0.1.0/benchmarks/bench_sparse_io.py +50 -0
- trior-0.1.0/benchmarks/bench_steady_state.py +284 -0
- trior-0.1.0/benchmarks/bench_sync.py +85 -0
- trior-0.1.0/docs/HANDOFF.md +167 -0
- trior-0.1.0/docs/ROADMAP.md +86 -0
- trior-0.1.0/docs/api.md +94 -0
- trior-0.1.0/docs/architecture.md +25 -0
- trior-0.1.0/docs/licensing.md +25 -0
- trior-0.1.0/docs/package-description.md +24 -0
- trior-0.1.0/docs/release.md +58 -0
- trior-0.1.0/docs/research.md +132 -0
- trior-0.1.0/docs/steady-state-cpu-occupancy.png +0 -0
- trior-0.1.0/docs/steady-state-results.md +144 -0
- trior-0.1.0/docs/steady-state-samples.json +1197 -0
- trior-0.1.0/examples/basic.py +17 -0
- trior-0.1.0/pyproject.toml +28 -0
- trior-0.1.0/python/trior/__init__.py +38 -0
- trior-0.1.0/python/trior/_runtime.py +541 -0
- trior-0.1.0/python/trior/lowlevel.py +47 -0
- trior-0.1.0/python/trior/socket.py +86 -0
- trior-0.1.0/requirements-dev.lock +16 -0
- trior-0.1.0/src/lib.rs +14 -0
- trior-0.1.0/src/reactor/epoll.rs +52 -0
- trior-0.1.0/src/reactor/kqueue.rs +61 -0
- trior-0.1.0/src/reactor/poll.rs +69 -0
- trior-0.1.0/src/reactor.rs +165 -0
- trior-0.1.0/src/runtime.rs +678 -0
- trior-0.1.0/tests/test_io.py +167 -0
- trior-0.1.0/tests/test_nursery_start.py +170 -0
- trior-0.1.0/tests/test_runtime.py +251 -0
- trior-0.1.0/tests/test_steady_state.py +182 -0
- trior-0.1.0/tests/test_sync.py +185 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
test:
|
|
9
|
+
strategy:
|
|
10
|
+
fail-fast: false
|
|
11
|
+
matrix:
|
|
12
|
+
os: [ubuntu-latest, macos-latest]
|
|
13
|
+
reactor: [default, poll]
|
|
14
|
+
runs-on: ${{ matrix.os }}
|
|
15
|
+
env:
|
|
16
|
+
TRIOR_REACTOR: ${{ matrix.reactor }}
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- uses: actions/setup-python@v5
|
|
20
|
+
with:
|
|
21
|
+
python-version: '3.12'
|
|
22
|
+
- uses: astral-sh/setup-uv@v6
|
|
23
|
+
- run: rustup toolchain install stable --profile minimal
|
|
24
|
+
- run: uv venv --python 3.12
|
|
25
|
+
- run: uv pip install --python .venv/bin/python -r requirements-dev.lock
|
|
26
|
+
- run: |
|
|
27
|
+
source .venv/bin/activate
|
|
28
|
+
maturin develop --release --locked
|
|
29
|
+
python -m pytest -q
|
|
30
|
+
python examples/basic.py
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
name: Python distributions
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
paths:
|
|
6
|
+
- .github/workflows/python-release.yml
|
|
7
|
+
- Cargo.*
|
|
8
|
+
- pyproject.toml
|
|
9
|
+
- README.md
|
|
10
|
+
- LICENSE*
|
|
11
|
+
- requirements-dev.lock
|
|
12
|
+
- python/**
|
|
13
|
+
- src/**
|
|
14
|
+
- tests/**
|
|
15
|
+
push:
|
|
16
|
+
branches: [main]
|
|
17
|
+
tags: ['v*']
|
|
18
|
+
workflow_dispatch:
|
|
19
|
+
inputs:
|
|
20
|
+
publish_testpypi:
|
|
21
|
+
description: Publish to TestPyPI after verifying the distributions
|
|
22
|
+
type: boolean
|
|
23
|
+
default: false
|
|
24
|
+
|
|
25
|
+
permissions:
|
|
26
|
+
contents: read
|
|
27
|
+
|
|
28
|
+
jobs:
|
|
29
|
+
build:
|
|
30
|
+
strategy:
|
|
31
|
+
fail-fast: false
|
|
32
|
+
matrix:
|
|
33
|
+
include:
|
|
34
|
+
- os: ubuntu-latest
|
|
35
|
+
platform: linux-x86_64
|
|
36
|
+
manylinux: '2014'
|
|
37
|
+
- os: macos-latest
|
|
38
|
+
platform: macos-arm64
|
|
39
|
+
manylinux: 'off'
|
|
40
|
+
runs-on: ${{ matrix.os }}
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/checkout@v5
|
|
43
|
+
with:
|
|
44
|
+
persist-credentials: false
|
|
45
|
+
- uses: actions/setup-python@v5
|
|
46
|
+
with:
|
|
47
|
+
python-version: '3.12'
|
|
48
|
+
- uses: astral-sh/setup-uv@v6
|
|
49
|
+
- uses: PyO3/maturin-action@v1
|
|
50
|
+
with:
|
|
51
|
+
command: build
|
|
52
|
+
manylinux: ${{ matrix.manylinux }}
|
|
53
|
+
args: --release --locked --interpreter python3.12 --out dist
|
|
54
|
+
- name: Test the installed wheel
|
|
55
|
+
run: |
|
|
56
|
+
uv venv --python 3.12
|
|
57
|
+
uv pip install --python .venv/bin/python -r requirements-dev.lock dist/*.whl
|
|
58
|
+
.venv/bin/python -m pytest -q
|
|
59
|
+
TRIOR_REACTOR=poll .venv/bin/python -m pytest -q
|
|
60
|
+
- name: Build the source distribution
|
|
61
|
+
if: runner.os == 'Linux'
|
|
62
|
+
run: .venv/bin/maturin sdist --out dist
|
|
63
|
+
- name: Check distribution metadata
|
|
64
|
+
run: uvx twine check --strict dist/*
|
|
65
|
+
- uses: actions/upload-artifact@v4
|
|
66
|
+
with:
|
|
67
|
+
name: python-dist-${{ matrix.platform }}
|
|
68
|
+
path: dist/
|
|
69
|
+
if-no-files-found: error
|
|
70
|
+
|
|
71
|
+
check-release:
|
|
72
|
+
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && inputs.publish_testpypi && github.ref == 'refs/heads/main')
|
|
73
|
+
runs-on: ubuntu-latest
|
|
74
|
+
steps:
|
|
75
|
+
- uses: actions/checkout@v5
|
|
76
|
+
with:
|
|
77
|
+
fetch-depth: 0
|
|
78
|
+
persist-credentials: false
|
|
79
|
+
- uses: actions/setup-python@v5
|
|
80
|
+
with:
|
|
81
|
+
python-version: '3.12'
|
|
82
|
+
- name: Validate release source
|
|
83
|
+
run: |
|
|
84
|
+
git merge-base --is-ancestor HEAD origin/main
|
|
85
|
+
python - <<'PY'
|
|
86
|
+
import os
|
|
87
|
+
import tomllib
|
|
88
|
+
from pathlib import Path
|
|
89
|
+
|
|
90
|
+
project = tomllib.loads(Path("pyproject.toml").read_text())["project"]
|
|
91
|
+
if not Path("LICENSE").is_file() or not project.get("license"):
|
|
92
|
+
raise SystemExit("Select and declare Trior's license before publishing.")
|
|
93
|
+
if os.environ["GITHUB_REF_TYPE"] == "tag":
|
|
94
|
+
expected = "v" + project["version"]
|
|
95
|
+
if os.environ["GITHUB_REF_NAME"] != expected:
|
|
96
|
+
raise SystemExit(f"Expected release tag {expected}")
|
|
97
|
+
PY
|
|
98
|
+
|
|
99
|
+
publish-testpypi:
|
|
100
|
+
if: github.event_name == 'workflow_dispatch' && inputs.publish_testpypi && github.ref == 'refs/heads/main'
|
|
101
|
+
needs: [build, check-release]
|
|
102
|
+
runs-on: ubuntu-latest
|
|
103
|
+
environment:
|
|
104
|
+
name: testpypi
|
|
105
|
+
url: https://test.pypi.org/p/trior
|
|
106
|
+
permissions:
|
|
107
|
+
id-token: write
|
|
108
|
+
steps:
|
|
109
|
+
- uses: actions/download-artifact@v4
|
|
110
|
+
with:
|
|
111
|
+
pattern: python-dist-*
|
|
112
|
+
path: dist/
|
|
113
|
+
merge-multiple: true
|
|
114
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
115
|
+
with:
|
|
116
|
+
repository-url: https://test.pypi.org/legacy/
|
|
117
|
+
|
|
118
|
+
publish-pypi:
|
|
119
|
+
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
|
|
120
|
+
needs: [build, check-release]
|
|
121
|
+
runs-on: ubuntu-latest
|
|
122
|
+
environment:
|
|
123
|
+
name: pypi
|
|
124
|
+
url: https://pypi.org/p/trior
|
|
125
|
+
permissions:
|
|
126
|
+
id-token: write
|
|
127
|
+
steps:
|
|
128
|
+
- uses: actions/download-artifact@v4
|
|
129
|
+
with:
|
|
130
|
+
pattern: python-dist-*
|
|
131
|
+
path: dist/
|
|
132
|
+
merge-multiple: true
|
|
133
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Steady-state benchmark
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
|
|
6
|
+
permissions:
|
|
7
|
+
contents: read
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
steady-state:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
timeout-minutes: 45
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: actions/setup-python@v5
|
|
16
|
+
with:
|
|
17
|
+
python-version: '3.12'
|
|
18
|
+
- uses: astral-sh/setup-uv@v6
|
|
19
|
+
- run: rustup toolchain install stable --profile minimal
|
|
20
|
+
- run: uv venv --python 3.12
|
|
21
|
+
- run: uv pip install --python .venv/bin/python -r requirements-dev.lock
|
|
22
|
+
- name: Build Trior
|
|
23
|
+
run: |
|
|
24
|
+
source .venv/bin/activate
|
|
25
|
+
maturin develop --release --locked
|
|
26
|
+
- name: Measure 600 workers
|
|
27
|
+
timeout-minutes: 35
|
|
28
|
+
run: |
|
|
29
|
+
.venv/bin/python benchmarks/bench_steady_state.py compare \
|
|
30
|
+
--output "$RUNNER_TEMP/steady-state.json"
|
|
31
|
+
- name: Save trial results
|
|
32
|
+
if: always()
|
|
33
|
+
uses: actions/upload-artifact@v4
|
|
34
|
+
with:
|
|
35
|
+
name: steady-state
|
|
36
|
+
path: ${{ runner.temp }}/steady-state.json
|
|
37
|
+
if-no-files-found: ignore
|
trior-0.1.0/.gitignore
ADDED
trior-0.1.0/AGENTS.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Trior — development instructions
|
|
2
|
+
|
|
3
|
+
## Mission
|
|
4
|
+
|
|
5
|
+
Trior is an independent experimental async runtime for Python, powered by Rust,
|
|
6
|
+
with a Trio-compatible public API. Repository: https://github.com/jrfk/trior.
|
|
7
|
+
Reference: https://github.com/python-trio/trio (v0.35.0) and
|
|
8
|
+
https://trio.readthedocs.io/en/stable/. The independent runtime is the primary
|
|
9
|
+
development target; historical partial replacements of Trio are research controls,
|
|
10
|
+
not the production architecture.
|
|
11
|
+
|
|
12
|
+
Priorities, in order:
|
|
13
|
+
|
|
14
|
+
1. Preserve Trio semantics (structured concurrency, cancellation, checkpoints,
|
|
15
|
+
resource ownership, exception propagation and task isolation).
|
|
16
|
+
2. Lower process CPU time and idle CPU load for equivalent work, especially
|
|
17
|
+
applications with around 600 long-lived coroutines.
|
|
18
|
+
3. Improve elapsed time, throughput, latency and memory usage.
|
|
19
|
+
4. Maintain readable, portable, testable code.
|
|
20
|
+
|
|
21
|
+
Rust is a means, not a goal. Do not claim full/drop-in compatibility based on
|
|
22
|
+
a subset of tests. Keep upstream Trio contributions separate from Trior.
|
|
23
|
+
|
|
24
|
+
## Getting oriented
|
|
25
|
+
|
|
26
|
+
Read [docs/HANDOFF.md](docs/HANDOFF.md), [docs/ROADMAP.md](docs/ROADMAP.md),
|
|
27
|
+
README.md and docs/research.md, plus archived results as needed before changing code.
|
|
28
|
+
Stage 20 implementation: c783eb1; Stage 20.5 separates the active package
|
|
29
|
+
from archived research (research/stage20). Stage 20.6 adds Nursery.start;
|
|
30
|
+
next is Stage 21 unless directed otherwise.
|
|
31
|
+
|
|
32
|
+
- Core: src/runtime.rs; src/reactor.rs; src/reactor/{epoll,kqueue,poll}.rs.
|
|
33
|
+
- Public facade: python/trior/.
|
|
34
|
+
- Python coroutine driver/wrappers: python/trior/_runtime.py.
|
|
35
|
+
- Independent-runtime tests and benchmarks: tests/ and benchmarks/.
|
|
36
|
+
- Historical adapters, tests, benchmarks and raw results: branch research/stage20.
|
|
37
|
+
- API reference test dependency pinned to Trio 0.35.0; not a runtime dependency. Current package requires
|
|
38
|
+
CPython >=3.12,<3.13; Python 3.15 is a development target, not yet supported.
|
|
39
|
+
Do not broaden metadata until the relevant tests pass.
|
|
40
|
+
|
|
41
|
+
## Architecture and correctness
|
|
42
|
+
|
|
43
|
+
Keep coroutine execution in CPython; move scheduler, readiness, deadlines and
|
|
44
|
+
other runtime bookkeeping into Rust where benchmarks justify it. Minimize
|
|
45
|
+
Python/Rust crossings, Python allocations and OS calls. Never hold a mutable
|
|
46
|
+
native borrow or lock across Python coroutine callbacks. Keep GIL handling and
|
|
47
|
+
ownership explicit. Preserve contextvars and cancellation/cleanup invariants.
|
|
48
|
+
Account for descriptor reuse, close, simultaneous readiness/cancellation,
|
|
49
|
+
fairness, stale events, and cleanup of partially completed operations.
|
|
50
|
+
Prefer local deterministic tests over external services. Use Trio itself as the
|
|
51
|
+
behavioral oracle at the pinned version. Consult upstream licensing and retain
|
|
52
|
+
attribution for derived code.
|
|
53
|
+
|
|
54
|
+
## Build and regression checks
|
|
55
|
+
|
|
56
|
+
From repository root:
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
uv venv --python 3.12
|
|
60
|
+
uv pip install --python .venv/bin/python -r requirements-dev.lock
|
|
61
|
+
. .venv/bin/activate
|
|
62
|
+
maturin develop --release --locked
|
|
63
|
+
python -m pytest -q
|
|
64
|
+
TRIOR_REACTOR=poll python -m pytest -q
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Historical control tests are preserved on research/stage20; use current differential tests for main.
|
|
68
|
+
Linux defaults to epoll, macOS to kqueue, and TRIOR_REACTOR=poll selects the
|
|
69
|
+
comparison implementation. A macOS cross-target check is not a runtime test.
|
|
70
|
+
Do not report unexecuted checks as passing. State exact platform/Python versions.
|
|
71
|
+
|
|
72
|
+
## Performance protocol
|
|
73
|
+
|
|
74
|
+
Measure equivalent completed work in fresh processes with same Python,
|
|
75
|
+
reference Trio and workload. Record process CPU time and wall time separately,
|
|
76
|
+
CPU occupancy = CPU seconds / wall seconds * 100 (one-core convention),
|
|
77
|
+
throughput, relevant latency percentiles, RSS and idle CPU load where possible.
|
|
78
|
+
Use repeats, raw samples and medians; record environment, affinity, parameters
|
|
79
|
+
and variance. For I/O use both sparse readiness and dense traffic. For long
|
|
80
|
+
runs include a fixed-rate workload with roughly 600 long-lived tasks and
|
|
81
|
+
cancellation/deadline churn. A speedup is not proof of reduced CPU consumption
|
|
82
|
+
or production suitability. Investigate regressions; do not cherry-pick.
|
|
83
|
+
|
|
84
|
+
## Workflow
|
|
85
|
+
|
|
86
|
+
For each stage:
|
|
87
|
+
- Read existing code and upstream behavior; define a narrow compatibility scope.
|
|
88
|
+
- Implement, add differential tests and run relevant regression suites.
|
|
89
|
+
- Measure performance where the change affects the hot path.
|
|
90
|
+
- Record commands, results, limitations and follow-up in docs/ or benchmark artifacts; avoid accumulating raw experimental output on main.
|
|
91
|
+
- Update README/roadmap when public scope or stage status changes.
|
|
92
|
+
- Use scoped commits and PRs according to the owner's requested workflow.
|
|
93
|
+
- Delegate independent research, test and benchmark work to subagents when
|
|
94
|
+
available and authorized; integrate and verify the results centrally.
|
|
95
|
+
|
|
96
|
+
No publishing to PyPI or upstream Trio, changing repository visibility, or
|
|
97
|
+
claiming production readiness without the owner's direction. Do not expose
|
|
98
|
+
credentials or private application data in code, logs or benchmarks.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Trior is an experimental project. Read README.md and docs/ROADMAP.md before
|
|
4
|
+
starting. Keep changes narrowly scoped and preserve Trio semantics.
|
|
5
|
+
|
|
6
|
+
Use the development setup in README.md. Add behavior tests under tests/,
|
|
7
|
+
prefer differential tests against Trio 0.35.0, and exercise both default
|
|
8
|
+
and poll backends on Linux. macOS tests should exercise kqueue on real hardware.
|
|
9
|
+
For shared scheduler changes cover cancellation, checkpoints and cleanup.
|
|
10
|
+
|
|
11
|
+
Run benchmarks with matched Python, workload and hardware in fresh processes:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
python benchmarks/bench_runtime.py
|
|
15
|
+
python benchmarks/bench_sync.py
|
|
16
|
+
python benchmarks/bench_sparse_io.py trio --count 600
|
|
17
|
+
python benchmarks/bench_sparse_io.py trior --count 600
|
|
18
|
+
TRIOR_REACTOR=poll python benchmarks/bench_sparse_io.py trior --count 600
|
|
19
|
+
python benchmarks/bench_io.py trio --count 600
|
|
20
|
+
python benchmarks/bench_io.py trior --count 600
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Report CPU time, elapsed time, raw repeats, environment and limitations.
|
|
24
|
+
Do not claim full compatibility or extrapolate microbenchmarks to production.
|
|
25
|
+
|
|
26
|
+
Run the full 600-worker steady-state benchmark on demand when evaluating
|
|
27
|
+
scheduler or reactor changes or collecting a release baseline. It takes
|
|
28
|
+
about 24 minutes and runs only when started explicitly. In GitHub Actions,
|
|
29
|
+
select **Steady-state benchmark** and **Run workflow**. Download the
|
|
30
|
+
`steady-state` artifact to inspect completed trials. For direct comparisons
|
|
31
|
+
with historical measurements, use the same local hardware and Python build.
|
|
32
|
+
|
|
33
|
+
Keep upstream Trio contributions separate and preserve any upstream notices.
|
|
34
|
+
See [licensing and attribution](docs/licensing.md).
|
trior-0.1.0/Cargo.lock
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "heck"
|
|
7
|
+
version = "0.5.0"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
10
|
+
|
|
11
|
+
[[package]]
|
|
12
|
+
name = "libc"
|
|
13
|
+
version = "0.2.191"
|
|
14
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
|
+
checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
|
|
16
|
+
|
|
17
|
+
[[package]]
|
|
18
|
+
name = "once_cell"
|
|
19
|
+
version = "1.21.4"
|
|
20
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
21
|
+
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
|
22
|
+
|
|
23
|
+
[[package]]
|
|
24
|
+
name = "portable-atomic"
|
|
25
|
+
version = "1.15.0"
|
|
26
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
27
|
+
checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
|
|
28
|
+
|
|
29
|
+
[[package]]
|
|
30
|
+
name = "proc-macro2"
|
|
31
|
+
version = "1.0.107"
|
|
32
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
33
|
+
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
|
34
|
+
dependencies = [
|
|
35
|
+
"unicode-ident",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[[package]]
|
|
39
|
+
name = "pyo3"
|
|
40
|
+
version = "0.30.1"
|
|
41
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
42
|
+
checksum = "229ca13b8a15bb0d1487b81ab975bfcd97513416499a8312011b6036e42e0de4"
|
|
43
|
+
dependencies = [
|
|
44
|
+
"libc",
|
|
45
|
+
"once_cell",
|
|
46
|
+
"portable-atomic",
|
|
47
|
+
"pyo3-build-config",
|
|
48
|
+
"pyo3-ffi",
|
|
49
|
+
"pyo3-macros",
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
[[package]]
|
|
53
|
+
name = "pyo3-build-config"
|
|
54
|
+
version = "0.30.1"
|
|
55
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
56
|
+
checksum = "70130e2b6dd1ee589a8788026a429561ca5c40fa7a2fa7914c2282eddae24700"
|
|
57
|
+
dependencies = [
|
|
58
|
+
"target-lexicon",
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
[[package]]
|
|
62
|
+
name = "pyo3-ffi"
|
|
63
|
+
version = "0.30.1"
|
|
64
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
65
|
+
checksum = "5e7ff73c555c286d212d4ce7e5fbda845a973c4f61bd5f160f5f2c3c2a04d1c4"
|
|
66
|
+
dependencies = [
|
|
67
|
+
"libc",
|
|
68
|
+
"pyo3-build-config",
|
|
69
|
+
]
|
|
70
|
+
|
|
71
|
+
[[package]]
|
|
72
|
+
name = "pyo3-macros"
|
|
73
|
+
version = "0.30.1"
|
|
74
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
75
|
+
checksum = "c46d2e5862c7bb8207e3b639f713dda3c499933444784154c11d013c5a691b60"
|
|
76
|
+
dependencies = [
|
|
77
|
+
"proc-macro2",
|
|
78
|
+
"pyo3-macros-backend",
|
|
79
|
+
"quote",
|
|
80
|
+
"syn",
|
|
81
|
+
]
|
|
82
|
+
|
|
83
|
+
[[package]]
|
|
84
|
+
name = "pyo3-macros-backend"
|
|
85
|
+
version = "0.30.1"
|
|
86
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
87
|
+
checksum = "38b89f066f2ae72a2aef52d1537ca2fcd104440ebfadee06e97aa90738a25b9b"
|
|
88
|
+
dependencies = [
|
|
89
|
+
"heck",
|
|
90
|
+
"proc-macro2",
|
|
91
|
+
"quote",
|
|
92
|
+
"syn",
|
|
93
|
+
]
|
|
94
|
+
|
|
95
|
+
[[package]]
|
|
96
|
+
name = "quote"
|
|
97
|
+
version = "1.0.47"
|
|
98
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
99
|
+
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
|
|
100
|
+
dependencies = [
|
|
101
|
+
"proc-macro2",
|
|
102
|
+
]
|
|
103
|
+
|
|
104
|
+
[[package]]
|
|
105
|
+
name = "syn"
|
|
106
|
+
version = "3.0.9"
|
|
107
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
108
|
+
checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
|
|
109
|
+
dependencies = [
|
|
110
|
+
"proc-macro2",
|
|
111
|
+
"quote",
|
|
112
|
+
"unicode-ident",
|
|
113
|
+
]
|
|
114
|
+
|
|
115
|
+
[[package]]
|
|
116
|
+
name = "target-lexicon"
|
|
117
|
+
version = "0.13.5"
|
|
118
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
119
|
+
checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
|
|
120
|
+
|
|
121
|
+
[[package]]
|
|
122
|
+
name = "trior"
|
|
123
|
+
version = "0.1.0"
|
|
124
|
+
dependencies = [
|
|
125
|
+
"libc",
|
|
126
|
+
"pyo3",
|
|
127
|
+
]
|
|
128
|
+
|
|
129
|
+
[[package]]
|
|
130
|
+
name = "unicode-ident"
|
|
131
|
+
version = "1.0.27"
|
|
132
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
133
|
+
checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
|
trior-0.1.0/Cargo.toml
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "trior"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
license = "MIT"
|
|
6
|
+
publish = false
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
|
|
9
|
+
[lib]
|
|
10
|
+
name = "_native"
|
|
11
|
+
crate-type = ["cdylib"]
|
|
12
|
+
|
|
13
|
+
[dependencies]
|
|
14
|
+
libc = "0.2"
|
|
15
|
+
pyo3 = { version = "=0.30.1", features = ["extension-module"] }
|
|
16
|
+
|
|
17
|
+
[profile.release]
|
|
18
|
+
lto = "thin"
|
|
19
|
+
codegen-units = 1
|
|
20
|
+
|
trior-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Trior contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
trior-0.1.0/LICENSE.Trio
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Copyright Contributors to the Trio project.
|
|
2
|
+
|
|
3
|
+
The MIT License (MIT)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
+
|
trior-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: trior
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Requires-Dist: trio==0.35.0 ; extra == 'test'
|
|
5
|
+
Requires-Dist: pytest>=9,<10 ; extra == 'test'
|
|
6
|
+
Provides-Extra: test
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
License-File: LICENSE.Trio
|
|
9
|
+
Summary: Experimental Rust-powered structured concurrency runtime for Python
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
Requires-Python: >=3.12, <3.13
|
|
12
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
13
|
+
Project-URL: Repository, https://github.com/jrfk/trior
|
|
14
|
+
|
|
15
|
+
# Trior
|
|
16
|
+
|
|
17
|
+
Trior is an experimental async runtime for CPython 3.12. Python runs the
|
|
18
|
+
coroutines and Rust handles scheduling, timers, cancellation and I/O readiness.
|
|
19
|
+
The public API implements a subset of Trio 0.35.0, including nurseries,
|
|
20
|
+
synchronization primitives, memory channels and basic socket operations.
|
|
21
|
+
|
|
22
|
+
## CPU occupancy with 600 workers
|
|
23
|
+
|
|
24
|
+
The benchmark ran timers, events, memory channels and local socket I/O on
|
|
25
|
+
macOS ARM64 with CPython 3.12.13. Each value is the median of three
|
|
26
|
+
60-second trials with equal completed work. One CPU core is 100%.
|
|
27
|
+
|
|
28
|
+
| Scheduled rate | Trio 0.35.0 | Trior |
|
|
29
|
+
|---:|---:|---:|
|
|
30
|
+
| 10 Hz | 13.71% | 6.46% |
|
|
31
|
+
| 20 Hz | 20.76% | 11.61% |
|
|
32
|
+
| 50 Hz | 39.58% | 26.65% |
|
|
33
|
+
| 100 Hz | 53.47% | 45.91% |
|
|
34
|
+
|
|
35
|
+
The [API guide](https://github.com/jrfk/trior/blob/main/docs/api.md)
|
|
36
|
+
lists implemented and planned features. The
|
|
37
|
+
[benchmark report](https://github.com/jrfk/trior/blob/main/docs/steady-state-results.md)
|
|
38
|
+
includes the measurement protocol, variability and latency results.
|
|
39
|
+
|