smolpy 1.8.0__tar.gz → 1.8.2.dev2__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.
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/.github/workflows/ci.yml +4 -2
- smolpy-1.8.2.dev2/.github/workflows/dev-build.yml +30 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/.github/workflows/github-release.yml +4 -1
- smolpy-1.8.2.dev2/.github/workflows/publish.yml +247 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/.github/workflows/release.yml +2 -1
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/PKG-INFO +14 -2
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/README.md +11 -1
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/adr/0004-execution-backends.md +35 -1
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/adr/0008-rust-des-engine-mvp.md +7 -2
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/dsl-reference.md +2 -2
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/roadmap.md +7 -4
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/pyproject.toml +8 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/rust/smolpy-engine-rs/README.md +1 -1
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/backends.py +2 -2
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/tests/test_backends.py +1 -1
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/uv.lock +18 -1
- smolpy-1.8.0/.github/workflows/publish.yml +0 -155
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/.github/workflows/docs.yml +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/.github/workflows/rust-wheels.yml +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/.gitignore +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/LICENSE +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/benchmarks/__init__.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/benchmarks/__main__.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/benchmarks/results/2026-11-13-0921-simpy-jaws-zbook-baseline.json +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/benchmarks/results/2026-11-13-1527-simpy-jaws-zbook-optimised.json +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/benchmarks/results/2026-11-13-2116-simpy-jaws-zbook-research-batch.json +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/benchmarks/results/2026-11-13-2119-simpy-jaws-zbook-research-b4.json +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/benchmarks/results/2026-11-15-1255-rust-jaws-zbook-stop-criterion.json +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/benchmarks/results/2026-11-15-1333-rust-jaws-zbook-research-b4.json +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/benchmarks/results/2026-11-15-1346-rust-jaws-zbook-research-batch.json +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/benchmarks/runner.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/benchmarks/scenarios.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/benchmarks/worker.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/adr/0001-protocol-package-structure.md +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/adr/0002-modbus-tcp-implementation.md +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/adr/0003-smol-external-dsl.md +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/adr/0005-profinet-rt.md +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/adr/0006-profiling-and-baseline-benchmark.md +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/adr/0007-execution-independent-scenario-model.md +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/adr/0009-batch-execution-and-cross-backend-validation.md +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/adr/0010-ethernet-frames-on-the-wire.md +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/benchmarks.md +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/dashboard.md +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/examples.md +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/index.md +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/language-reference.md +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/modbus.md +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/model-semantics.md +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/mqtt.md +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/profinet.md +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/scenario-model.md +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/docs/simulation-engine.md +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/examples/README.md +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/examples/example.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/examples/example.smol +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/examples/example_10_clients.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/examples/example_12_clients.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/examples/example_20_clients.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/examples/example_file_transfer.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/examples/example_modbus.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/examples/example_mqtt.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/examples/example_profinet.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/examples/example_profinet.smol +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/examples/example_staggered_transfer.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/examples/example_two_tier.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/mkdocs.yml +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/rust/Cargo.lock +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/rust/Cargo.toml +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/rust/smol-engine/Cargo.toml +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/rust/smol-engine/src/frames.rs +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/rust/smol-engine/src/lib.rs +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/rust/smol-engine/src/rng.rs +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/rust/smol-engine/src/scenario.rs +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/rust/smol-engine/src/sim.rs +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/rust/smol-engine/src/timebase.rs +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/rust/smolpy-engine-rs/Cargo.toml +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/rust/smolpy-engine-rs/pyproject.toml +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/rust/smolpy-engine-rs/smoke_test.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/rust/smolpy-engine-rs/src/lib.rs +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/__init__.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/_worker.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/batch.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/cli.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/core/__init__.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/core/adapter.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/core/batch.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/core/link.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/core/network.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/core/node.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/core/observation.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/ethernet/__init__.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/ethernet/switch.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/lang/__init__.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/lang/ast.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/lang/errors.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/lang/grammar.lark +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/lang/interpreter.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/lang/transformer.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/modbus/__init__.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/modbus/slave.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/model/__init__.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/model/frames.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/model/scenario.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/model/streams.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/model/timebase.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/model/validate.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/mqtt/__init__.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/mqtt/broker.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/profinet/__init__.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/profinet/device.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/sim/__init__.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/sim/engine.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/stats.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/viz/__init__.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/viz/dashboard.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/src/smolpy/viz/text_dashboard.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/tests/__init__.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/tests/equivalence/__init__.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/tests/equivalence/harness.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/tests/equivalence/scenarios.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/tests/equivalence/test_equivalence.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/tests/equivalence/test_rust_timebase.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/tests/test_batch.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/tests/test_benchmarks.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/tests/test_cli.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/tests/test_dsl.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/tests/test_engine_ir.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/tests/test_lang.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/tests/test_model.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/tests/test_profinet.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/tests/test_semantics.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/tests/test_simulation.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/tests/test_stats.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/tests/test_sweep.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/tests/test_timebase.py +0 -0
- {smolpy-1.8.0 → smolpy-1.8.2.dev2}/tests/test_validate.py +0 -0
|
@@ -28,8 +28,10 @@ jobs:
|
|
|
28
28
|
- name: Set up Python ${{ matrix.python-version }}
|
|
29
29
|
run: uv python install ${{ matrix.python-version }}
|
|
30
30
|
|
|
31
|
+
# Not the rust extra: the published engine would be tested against this
|
|
32
|
+
# change's model. The rust job below tests the engine built from it.
|
|
31
33
|
- name: Install dependencies
|
|
32
|
-
run: uv sync --all-extras
|
|
34
|
+
run: uv sync --all-extras --no-extra rust
|
|
33
35
|
|
|
34
36
|
- name: Lint — ruff check
|
|
35
37
|
run: uv run ruff check src/
|
|
@@ -83,7 +85,7 @@ jobs:
|
|
|
83
85
|
run: uv python install 3.12
|
|
84
86
|
|
|
85
87
|
- name: Install dependencies
|
|
86
|
-
run: uv sync --all-extras --python 3.12
|
|
88
|
+
run: uv sync --all-extras --no-extra rust --python 3.12
|
|
87
89
|
|
|
88
90
|
- name: Build the Python module (maturin)
|
|
89
91
|
run: uvx maturin build --release -m rust/smolpy-engine-rs/Cargo.toml -o dist-rust
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Development build
|
|
2
|
+
|
|
3
|
+
# After every merge to main that changes the package, publish a development
|
|
4
|
+
# build: smolpy and smolpy-engine-rs X.Y.(Z+1).devN on PyPI (pre-releases,
|
|
5
|
+
# installed only with pip --pre) and the GitHub pre-release "Development
|
|
6
|
+
# build". Releases proper stay manual (release.yml).
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
push:
|
|
10
|
+
branches:
|
|
11
|
+
- main
|
|
12
|
+
paths:
|
|
13
|
+
- "src/**"
|
|
14
|
+
- "rust/**"
|
|
15
|
+
- "pyproject.toml"
|
|
16
|
+
|
|
17
|
+
# one at a time; a newer merge waiting replaces an older one that waits
|
|
18
|
+
concurrency:
|
|
19
|
+
group: dev-build
|
|
20
|
+
cancel-in-progress: false
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
publish:
|
|
24
|
+
name: Publish
|
|
25
|
+
uses: ./.github/workflows/publish.yml
|
|
26
|
+
with:
|
|
27
|
+
dev: true
|
|
28
|
+
permissions:
|
|
29
|
+
id-token: write # PyPI trusted publishing
|
|
30
|
+
contents: write # the GitHub pre-release
|
|
@@ -63,5 +63,8 @@ jobs:
|
|
|
63
63
|
if gh release view "$TAG" > /dev/null 2>&1; then
|
|
64
64
|
gh release upload "$TAG" dist/* --clobber
|
|
65
65
|
else
|
|
66
|
-
|
|
66
|
+
# notes since the previous release tag, never since the moving "dev" tag
|
|
67
|
+
PREVIOUS=$(git describe --tags --abbrev=0 --match 'v[0-9]*' "${TAG}^" 2>/dev/null || true)
|
|
68
|
+
gh release create "$TAG" dist/* --title "$TAG" --generate-notes --verify-tag \
|
|
69
|
+
${PREVIOUS:+--notes-start-tag "$PREVIOUS"} --latest
|
|
67
70
|
fi
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
# Three modes:
|
|
4
|
+
#
|
|
5
|
+
# - Release (a pushed tag v*, or release.yml passing its tag): publishes
|
|
6
|
+
# smolpy and the smolpy-engine-rs wheels and sdist to PyPI with the tag's
|
|
7
|
+
# version, then the GitHub Release with every file.
|
|
8
|
+
# - Development build (dev-build.yml, dev: true, after a merge to main):
|
|
9
|
+
# publishes both to PyPI as X.Y.(Z+1).devN, N commits after the latest tag,
|
|
10
|
+
# a pre-release that pip installs only with --pre, and replaces the GitHub
|
|
11
|
+
# pre-release "Development build" (tag "dev").
|
|
12
|
+
# - Test (run by hand, target: testpypi): publishes only the engine to
|
|
13
|
+
# TestPyPI, as a dev version numbered by the run.
|
|
14
|
+
#
|
|
15
|
+
# smolpy does not wait for the engine: if publishing the engine fails, smolpy
|
|
16
|
+
# is still published, and the GitHub release lacks only the engine's files.
|
|
17
|
+
|
|
18
|
+
on:
|
|
19
|
+
push:
|
|
20
|
+
tags:
|
|
21
|
+
- "v*"
|
|
22
|
+
workflow_call:
|
|
23
|
+
inputs:
|
|
24
|
+
tag:
|
|
25
|
+
description: The tag being released (release.yml passes it; a tag push has it as its ref)
|
|
26
|
+
required: false
|
|
27
|
+
type: string
|
|
28
|
+
dev:
|
|
29
|
+
description: A development build of the calling commit (dev-build.yml)
|
|
30
|
+
required: false
|
|
31
|
+
type: boolean
|
|
32
|
+
default: false
|
|
33
|
+
workflow_dispatch:
|
|
34
|
+
inputs:
|
|
35
|
+
target:
|
|
36
|
+
description: Test publication of the smolpy-engine-rs wheels (releases go through Release)
|
|
37
|
+
required: true
|
|
38
|
+
type: choice
|
|
39
|
+
options:
|
|
40
|
+
- testpypi
|
|
41
|
+
default: testpypi
|
|
42
|
+
|
|
43
|
+
jobs:
|
|
44
|
+
version:
|
|
45
|
+
name: Version
|
|
46
|
+
runs-on: ubuntu-latest
|
|
47
|
+
outputs:
|
|
48
|
+
mode: ${{ steps.v.outputs.mode }} # release, dev or test
|
|
49
|
+
release: ${{ steps.v.outputs.release }} # "true" for release and dev: smolpy goes to PyPI
|
|
50
|
+
tag: ${{ steps.v.outputs.tag }}
|
|
51
|
+
version: ${{ steps.v.outputs.version }}
|
|
52
|
+
|
|
53
|
+
steps:
|
|
54
|
+
- uses: actions/checkout@v4
|
|
55
|
+
with:
|
|
56
|
+
fetch-depth: 0 # to find the latest tag
|
|
57
|
+
|
|
58
|
+
# In a called workflow github.event_name is the caller's, so the test
|
|
59
|
+
# mode is recognised by its input, not by the event.
|
|
60
|
+
- name: Work out the version
|
|
61
|
+
id: v
|
|
62
|
+
env:
|
|
63
|
+
TEST: ${{ inputs.target == 'testpypi' }}
|
|
64
|
+
DEV: ${{ inputs.dev }}
|
|
65
|
+
TAG: ${{ inputs.tag || github.ref_name }}
|
|
66
|
+
RUN: ${{ github.run_number }}
|
|
67
|
+
run: |
|
|
68
|
+
# only release tags: the moving "dev" tag does not count
|
|
69
|
+
LATEST=$(git describe --tags --abbrev=0 --match 'v[0-9]*' 2>/dev/null || echo v0.0.0)
|
|
70
|
+
IFS=. read -r MAJOR MINOR PATCH <<< "${LATEST#v}"
|
|
71
|
+
NEXT="${MAJOR}.${MINOR}.$((PATCH + 1))"
|
|
72
|
+
if [ "$TEST" = "true" ]; then
|
|
73
|
+
MODE=test
|
|
74
|
+
VERSION="${NEXT}.dev${RUN}"
|
|
75
|
+
echo "release=false" >> "$GITHUB_OUTPUT"
|
|
76
|
+
elif [ "$DEV" = "true" ]; then
|
|
77
|
+
# as hatch-vcs numbers smolpy: N commits after the latest tag
|
|
78
|
+
N=$(git rev-list --count "${LATEST}..HEAD")
|
|
79
|
+
if [ "$N" = "0" ]; then
|
|
80
|
+
echo "::error::HEAD is release ${LATEST} itself: there is no development build to make"
|
|
81
|
+
exit 1
|
|
82
|
+
fi
|
|
83
|
+
MODE=dev
|
|
84
|
+
VERSION="${NEXT}.dev${N}"
|
|
85
|
+
echo "release=true" >> "$GITHUB_OUTPUT"
|
|
86
|
+
else
|
|
87
|
+
MODE=release
|
|
88
|
+
VERSION="${TAG#v}"
|
|
89
|
+
echo "release=true" >> "$GITHUB_OUTPUT"
|
|
90
|
+
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
|
|
91
|
+
fi
|
|
92
|
+
echo "mode=$MODE" >> "$GITHUB_OUTPUT"
|
|
93
|
+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
|
94
|
+
echo "Mode: $MODE, version: $VERSION (latest release ${LATEST})"
|
|
95
|
+
|
|
96
|
+
build:
|
|
97
|
+
name: Build smolpy
|
|
98
|
+
needs: version
|
|
99
|
+
if: ${{ needs.version.outputs.release == 'true' }}
|
|
100
|
+
runs-on: ubuntu-latest
|
|
101
|
+
|
|
102
|
+
steps:
|
|
103
|
+
- uses: actions/checkout@v4
|
|
104
|
+
with:
|
|
105
|
+
ref: ${{ needs.version.outputs.tag }}
|
|
106
|
+
fetch-depth: 0 # needed for hatch-vcs to read git tags
|
|
107
|
+
|
|
108
|
+
- name: Install uv
|
|
109
|
+
uses: astral-sh/setup-uv@v4
|
|
110
|
+
with:
|
|
111
|
+
version: "latest"
|
|
112
|
+
|
|
113
|
+
- name: Build package
|
|
114
|
+
run: uv build
|
|
115
|
+
|
|
116
|
+
# hatch-vcs numbers smolpy from git, the engine is numbered above: they must agree
|
|
117
|
+
- name: Check the version
|
|
118
|
+
env:
|
|
119
|
+
VERSION: ${{ needs.version.outputs.version }}
|
|
120
|
+
run: |
|
|
121
|
+
ls dist/
|
|
122
|
+
test -f "dist/smolpy-${VERSION}.tar.gz" || {
|
|
123
|
+
echo "::error::smolpy was built as $(ls dist/*.tar.gz), expected version ${VERSION}"
|
|
124
|
+
exit 1
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
- name: Upload dist
|
|
128
|
+
uses: actions/upload-artifact@v4
|
|
129
|
+
with:
|
|
130
|
+
name: dist
|
|
131
|
+
path: dist/
|
|
132
|
+
|
|
133
|
+
publish:
|
|
134
|
+
name: Publish smolpy to PyPI
|
|
135
|
+
needs: build
|
|
136
|
+
runs-on: ubuntu-latest
|
|
137
|
+
environment: pypi
|
|
138
|
+
permissions:
|
|
139
|
+
id-token: write # required for OIDC trusted publishing
|
|
140
|
+
|
|
141
|
+
steps:
|
|
142
|
+
- name: Download dist
|
|
143
|
+
uses: actions/download-artifact@v4
|
|
144
|
+
with:
|
|
145
|
+
name: dist
|
|
146
|
+
path: dist/
|
|
147
|
+
|
|
148
|
+
- name: Publish to PyPI
|
|
149
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
150
|
+
with:
|
|
151
|
+
attestations: false
|
|
152
|
+
|
|
153
|
+
engine-wheels:
|
|
154
|
+
name: Build smolpy-engine-rs
|
|
155
|
+
needs: version
|
|
156
|
+
uses: ./.github/workflows/rust-wheels.yml
|
|
157
|
+
with:
|
|
158
|
+
version: ${{ needs.version.outputs.version }}
|
|
159
|
+
ref: ${{ needs.version.outputs.tag }}
|
|
160
|
+
|
|
161
|
+
publish-engine:
|
|
162
|
+
name: Publish smolpy-engine-rs to ${{ needs.version.outputs.release == 'true' && 'PyPI' || 'TestPyPI' }}
|
|
163
|
+
needs: [version, engine-wheels]
|
|
164
|
+
runs-on: ubuntu-latest
|
|
165
|
+
environment: ${{ needs.version.outputs.release == 'true' && 'pypi' || 'testpypi' }}
|
|
166
|
+
permissions:
|
|
167
|
+
id-token: write # required for OIDC trusted publishing
|
|
168
|
+
|
|
169
|
+
steps:
|
|
170
|
+
- name: Download the wheels and sdist
|
|
171
|
+
uses: actions/download-artifact@v4
|
|
172
|
+
with:
|
|
173
|
+
pattern: engine-*
|
|
174
|
+
merge-multiple: true
|
|
175
|
+
path: dist/
|
|
176
|
+
|
|
177
|
+
- name: Publish
|
|
178
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
179
|
+
with:
|
|
180
|
+
repository-url: ${{ needs.version.outputs.release == 'true' && 'https://upload.pypi.org/legacy/' || 'https://test.pypi.org/legacy/' }}
|
|
181
|
+
attestations: false
|
|
182
|
+
|
|
183
|
+
github-release:
|
|
184
|
+
name: GitHub Release
|
|
185
|
+
needs: [version, publish, publish-engine]
|
|
186
|
+
# only once smolpy is on PyPI; with the engine's files if it is there too
|
|
187
|
+
if: ${{ always() && needs.version.outputs.mode == 'release' && needs.publish.result == 'success' }}
|
|
188
|
+
permissions:
|
|
189
|
+
contents: write
|
|
190
|
+
uses: ./.github/workflows/github-release.yml
|
|
191
|
+
with:
|
|
192
|
+
tag: ${{ needs.version.outputs.tag }}
|
|
193
|
+
engine: ${{ needs.publish-engine.result == 'success' }}
|
|
194
|
+
|
|
195
|
+
dev-release:
|
|
196
|
+
name: GitHub pre-release "Development build"
|
|
197
|
+
needs: [version, publish, publish-engine]
|
|
198
|
+
if: ${{ always() && needs.version.outputs.mode == 'dev' && needs.publish.result == 'success' }}
|
|
199
|
+
runs-on: ubuntu-latest
|
|
200
|
+
permissions:
|
|
201
|
+
contents: write
|
|
202
|
+
|
|
203
|
+
steps:
|
|
204
|
+
- name: Download smolpy
|
|
205
|
+
uses: actions/download-artifact@v4
|
|
206
|
+
with:
|
|
207
|
+
name: dist
|
|
208
|
+
path: dist/
|
|
209
|
+
|
|
210
|
+
- name: Download smolpy-engine-rs
|
|
211
|
+
if: ${{ needs.publish-engine.result == 'success' }}
|
|
212
|
+
uses: actions/download-artifact@v4
|
|
213
|
+
with:
|
|
214
|
+
pattern: engine-*
|
|
215
|
+
merge-multiple: true
|
|
216
|
+
path: dist/
|
|
217
|
+
|
|
218
|
+
# One pre-release, replaced by every development build, so the list of
|
|
219
|
+
# releases keeps only real releases and the latest development build.
|
|
220
|
+
- name: Replace the pre-release
|
|
221
|
+
env:
|
|
222
|
+
GH_TOKEN: ${{ github.token }}
|
|
223
|
+
GH_REPO: ${{ github.repository }}
|
|
224
|
+
VERSION: ${{ needs.version.outputs.version }}
|
|
225
|
+
ENGINE: ${{ needs.publish-engine.result == 'success' }}
|
|
226
|
+
SHA: ${{ github.sha }}
|
|
227
|
+
run: |
|
|
228
|
+
SHORT=${SHA:0:7}
|
|
229
|
+
ENGINE_LINE="smolpy-engine-rs ${VERSION}"
|
|
230
|
+
[ "$ENGINE" = "true" ] || ENGINE_LINE="smolpy-engine-rs: not published in this build"
|
|
231
|
+
cat > notes.md <<NOTES
|
|
232
|
+
The latest development build of \`main\`, from commit [\`${SHORT}\`](https://github.com/${GH_REPO}/commit/${SHA}). It is replaced by every merge that changes the package.
|
|
233
|
+
|
|
234
|
+
- smolpy ${VERSION}
|
|
235
|
+
- ${ENGINE_LINE}
|
|
236
|
+
|
|
237
|
+
Development builds are pre-releases on PyPI: pip installs them only when asked.
|
|
238
|
+
|
|
239
|
+
\`\`\`bash
|
|
240
|
+
pip install --pre "smolpy[rust]==${VERSION}"
|
|
241
|
+
\`\`\`
|
|
242
|
+
|
|
243
|
+
For a stable version, use the latest release instead.
|
|
244
|
+
NOTES
|
|
245
|
+
gh release delete dev --cleanup-tag --yes || true
|
|
246
|
+
gh release create dev dist/* --prerelease --target "$SHA" \
|
|
247
|
+
--title "Development build ${VERSION}" --notes-file notes.md
|
|
@@ -32,7 +32,8 @@ jobs:
|
|
|
32
32
|
- name: Compute next version
|
|
33
33
|
id: version
|
|
34
34
|
run: |
|
|
35
|
-
|
|
35
|
+
# only release tags: the moving "dev" tag of development builds does not count
|
|
36
|
+
LATEST=$(git describe --tags --abbrev=0 --match 'v[0-9]*' 2>/dev/null || echo "v0.0.0")
|
|
36
37
|
echo "Latest tag: $LATEST"
|
|
37
38
|
VERSION=${LATEST#v}
|
|
38
39
|
MAJOR=$(echo "$VERSION" | cut -d. -f1)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: smolpy
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.2.dev2
|
|
4
4
|
Summary: Network simulation DSL and discrete-event simulator
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -22,6 +22,8 @@ Requires-Dist: pytest>=8; extra == 'dev'
|
|
|
22
22
|
Requires-Dist: ruff; extra == 'dev'
|
|
23
23
|
Provides-Extra: docs
|
|
24
24
|
Requires-Dist: mkdocs-material>=9; extra == 'docs'
|
|
25
|
+
Provides-Extra: rust
|
|
26
|
+
Requires-Dist: smolpy-engine-rs>=1.8; extra == 'rust'
|
|
25
27
|
Description-Content-Type: text/markdown
|
|
26
28
|
|
|
27
29
|
# SMOLPy
|
|
@@ -68,6 +70,16 @@ Infrastructure: MAC-learning **switches** with 802.1Q strict-priority egress que
|
|
|
68
70
|
|
|
69
71
|
## Install
|
|
70
72
|
|
|
73
|
+
```bash
|
|
74
|
+
pip install smolpy # SimPy engine, dashboards, CLI
|
|
75
|
+
pip install "smolpy[rust]" # plus the native Rust engine, about 40x faster
|
|
76
|
+
pip install --pre "smolpy[rust]" # the latest development build of main
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Every merge to `main` that changes the package publishes a **development build**, `X.Y.(Z+1).devN` (N commits after the latest release). It is a pre-release on PyPI, so `pip` installs it only with `--pre`, and the GitHub pre-release [Development build](https://github.com/jwszolek/SMOLPy/releases/tag/dev) points to its commit. Releases proper are made by hand.
|
|
80
|
+
|
|
81
|
+
From a clone, for development:
|
|
82
|
+
|
|
71
83
|
```bash
|
|
72
84
|
uv sync # installs all runtime + dev dependencies
|
|
73
85
|
```
|
|
@@ -448,7 +460,7 @@ Every simulation goes through the same path. The Python API and `.smol` files bu
|
|
|
448
460
|
| Backend | Language | What it runs | Speed | Install |
|
|
449
461
|
|---|---|---|---|---|
|
|
450
462
|
| `simpy` (default) | Python, SimPy | the whole model, the live and text dashboards | reference | included |
|
|
451
|
-
| `rust` | Rust, through PyO3 | Ethernet: adapters, switches, links, flows (constant, Poisson, bursty, batch, IMIX), six metrics | about **40× faster**: B1 at 10 M frames in 4.9 s, not 200.8 s | `pip install smolpy
|
|
463
|
+
| `rust` | Rust, through PyO3 | Ethernet: adapters, switches, links, flows (constant, Poisson, bursty, batch, IMIX), six metrics | about **40× faster**: B1 at 10 M frames in 4.9 s, not 200.8 s | `pip install smolpy[rust]` (since v1.8.0) |
|
|
452
464
|
|
|
453
465
|
```python
|
|
454
466
|
result = net.simulate(duration=60_000, backend="rust") # one run
|
|
@@ -42,6 +42,16 @@ Infrastructure: MAC-learning **switches** with 802.1Q strict-priority egress que
|
|
|
42
42
|
|
|
43
43
|
## Install
|
|
44
44
|
|
|
45
|
+
```bash
|
|
46
|
+
pip install smolpy # SimPy engine, dashboards, CLI
|
|
47
|
+
pip install "smolpy[rust]" # plus the native Rust engine, about 40x faster
|
|
48
|
+
pip install --pre "smolpy[rust]" # the latest development build of main
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Every merge to `main` that changes the package publishes a **development build**, `X.Y.(Z+1).devN` (N commits after the latest release). It is a pre-release on PyPI, so `pip` installs it only with `--pre`, and the GitHub pre-release [Development build](https://github.com/jwszolek/SMOLPy/releases/tag/dev) points to its commit. Releases proper are made by hand.
|
|
52
|
+
|
|
53
|
+
From a clone, for development:
|
|
54
|
+
|
|
45
55
|
```bash
|
|
46
56
|
uv sync # installs all runtime + dev dependencies
|
|
47
57
|
```
|
|
@@ -422,7 +432,7 @@ Every simulation goes through the same path. The Python API and `.smol` files bu
|
|
|
422
432
|
| Backend | Language | What it runs | Speed | Install |
|
|
423
433
|
|---|---|---|---|---|
|
|
424
434
|
| `simpy` (default) | Python, SimPy | the whole model, the live and text dashboards | reference | included |
|
|
425
|
-
| `rust` | Rust, through PyO3 | Ethernet: adapters, switches, links, flows (constant, Poisson, bursty, batch, IMIX), six metrics | about **40× faster**: B1 at 10 M frames in 4.9 s, not 200.8 s | `pip install smolpy
|
|
435
|
+
| `rust` | Rust, through PyO3 | Ethernet: adapters, switches, links, flows (constant, Poisson, bursty, batch, IMIX), six metrics | about **40× faster**: B1 at 10 M frames in 4.9 s, not 200.8 s | `pip install smolpy[rust]` (since v1.8.0) |
|
|
426
436
|
|
|
427
437
|
```python
|
|
428
438
|
result = net.simulate(duration=60_000, backend="rust") # one run
|
|
@@ -166,7 +166,39 @@ A new test suite runs selected scenarios on both backends and compares metrics:
|
|
|
166
166
|
- **Low-load scenarios** (no queuing, no TCP congestion effects) — metrics must agree within a stated tolerance. Disagreement here indicates a translation bug in the backend.
|
|
167
167
|
- **Loaded scenarios** — differences are expected and are reported rather than asserted; quantifying them is part of the research output.
|
|
168
168
|
|
|
169
|
-
The ns-3 suite is skipped automatically when ns-3 is not available, and runs in CI in a container image with the pinned ns-3 release.
|
|
169
|
+
The ns-3 suite is skipped automatically when ns-3 is not available, and runs in CI in a container image with the pinned ns-3 release ([below](#container-images)).
|
|
170
|
+
|
|
171
|
+
### Container images
|
|
172
|
+
|
|
173
|
+
*Added 2026-11-15.*
|
|
174
|
+
|
|
175
|
+
ns-3 is the one backend that cannot be installed with `pip`. It is a C++ code base that must be built from source with its own toolchain, which takes tens of minutes, and SMOLPy supports exactly one pinned release. The ns-3 backend is therefore shipped, run in CI and archived as a **container image**. A lighter image without ns-3 serves users who want SMOLPy without installing Python.
|
|
176
|
+
|
|
177
|
+
**Registry and images.** The images are published to the GitHub Container Registry, `ghcr.io/jwszolek/smolpy`, public, for `linux/amd64` and `linux/arm64`:
|
|
178
|
+
|
|
179
|
+
| Tag | Contents | Size | From |
|
|
180
|
+
|---|---|---|---|
|
|
181
|
+
| `<version>`, `latest` | Python, `smolpy` and `smolpy-engine-rs` from the release's own wheels | ~ 200 MB | the first release that publishes the Rust engine (ADR-0008 step 7) |
|
|
182
|
+
| `<version>-ns3`, `latest-ns3` | the above, plus the pinned ns-3 release built with the SMOL C++ module, and `NS3_HOME` set | several GB | Phase 6, with the ns-3 backend |
|
|
183
|
+
|
|
184
|
+
The entry point is the CLI:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
docker run --rm -v "$PWD:/work" -w /work ghcr.io/jwszolek/smolpy run plant.smol --backend rust
|
|
188
|
+
docker run --rm -v "$PWD:/work" -w /work ghcr.io/jwszolek/smolpy:latest-ns3 run plant.smol --backend ns3
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
- **Headless only.** The live dashboard needs a display, which a container does not have. Headless runs, text mode, `--runs` and `-o` all work.
|
|
192
|
+
- **Built at release.** `publish.yml` builds and pushes the images at each release, after `smolpy` and `smolpy-engine-rs` are on PyPI, from the same files. The pushed images are listed under the repository's "Packages". The Dockerfiles live in `docker/`.
|
|
193
|
+
- **ns-3 is built once per pinned release.** It is built in a separate base image, `ghcr.io/jwszolek/smolpy-ns3-base:<ns-3 version>`, which is rebuilt only when the pinned version changes. Each release then adds SMOLPy to it in a few minutes, instead of rebuilding ns-3.
|
|
194
|
+
- **CI uses the image.** The ns-3 equivalence suite (ADR-0009) runs inside `<version>-ns3`, or inside the base image for pull requests. It never builds ns-3 itself.
|
|
195
|
+
- **Reproducible results.** An image tag fixes the SMOLPy, Rust engine and ns-3 versions together. Recording the image digest next to the scenario JSON, and the generated ns-3 scenario (`--keep-generated`), is enough to rerun a published experiment exactly.
|
|
196
|
+
- **Licences.** ns-3 is licensed under GPLv2, and SMOLPy and its Rust engine under MIT.
|
|
197
|
+
- The `-ns3` image distributes ns-3 binaries and the SMOL C++ module linked against them, so that image as a whole is distributed under GPLv2's terms.
|
|
198
|
+
- Its ns-3 sources are public at the pinned release, and the image records where. The SMOL module's source is in this repository.
|
|
199
|
+
- MIT is compatible with GPLv2, so the MIT code needs no change.
|
|
200
|
+
- The image without ns-3 contains no GPL code.
|
|
201
|
+
- **Not a replacement for pip.** `pip install smolpy smolpy-engine-rs` stays the main way to install SMOLPy. The images are for ns-3, for running without a Python setup, and for archiving.
|
|
170
202
|
|
|
171
203
|
### Documentation
|
|
172
204
|
|
|
@@ -178,6 +210,8 @@ The ns-3 suite is skipped automatically when ns-3 is not available, and runs in
|
|
|
178
210
|
- Exact behaviour of ns-3's CSMA model versus SimPy's collision approximation, to decide whether `hub` support should be limited further. *(Resolved: hubs were removed.)*
|
|
179
211
|
- How ns-3 queue lengths should be sampled so that `queue_depth` is comparable to SimPy's per-port frame count.
|
|
180
212
|
- Whether the pinned ns-3 release's build tool supports building scratch programs with an extra module cleanly, or the module should be installed as a contrib module.
|
|
213
|
+
- The size of the `-ns3` image, and whether to build ns-3 in its `optimized` profile only, without examples and tests, to keep it small.
|
|
214
|
+
- Whether GitHub's hosted runners can build the ns-3 base image for `linux/arm64` in reasonable time, or that platform needs a native arm64 runner or is offered for `amd64` only at first.
|
|
181
215
|
|
|
182
216
|
---
|
|
183
217
|
|
|
@@ -32,7 +32,7 @@ This ADR applies **only if the ADR-0006 decision gate is met**, i.e. if optimise
|
|
|
32
32
|
|
|
33
33
|
**Distribution**
|
|
34
34
|
- **A — one `smolpy` package that includes the native extension.** Everyone needs a platform-specific wheel. Platforms without one would need a Rust toolchain to install SMOLPy at all.
|
|
35
|
-
- **B — separate optional package `smolpy-engine-rs`, installed with `pip install smolpy[rust]`.** **Chosen.** *(Until the first release of `smolpy-engine-rs` it is installed as `pip install smolpy-engine-rs`. The `smolpy[rust]` extra is added once the package is on PyPI, because `uv.lock` cannot refer to a package that does not exist yet.)*
|
|
35
|
+
- **B — separate optional package `smolpy-engine-rs`, installed with `pip install smolpy[rust]`.** **Chosen.** *(Until the first release of `smolpy-engine-rs` it is installed as `pip install smolpy-engine-rs`. The `smolpy[rust]` extra is added once the package is on PyPI, because `uv.lock` cannot refer to a package that does not exist yet. Both were done with v1.8.0.)*
|
|
36
36
|
- `smolpy` stays pure Python and installs everywhere.
|
|
37
37
|
- Its build and release pipeline stays unchanged.
|
|
38
38
|
- The Rust backend simply reports *not installed* when absent.
|
|
@@ -172,7 +172,7 @@ Raw results: `benchmarks/results/2026-11-15-1255-rust-jaws-zbook-stop-criterion.
|
|
|
172
172
|
6. **The research targets B3 and B4** with `--backend rust`. *(Done, 2026-11-15: both are met. B4 at 100 M frames runs in 310 s against a 30 min limit, and 1 000 × B3 at 1 M frames in 413 s on 8 cores against 30 min. Details are in [Benchmarks](../benchmarks.md#research-targets-on-the-rust-engine-adr-0008-step-6).)*
|
|
173
173
|
7. **Wheels and CI,** as below. *(CI done early, with step 4: a `rust` job in `ci.yml` runs `cargo fmt`, `clippy -D warnings` and `cargo test`. It builds the module with maturin and runs the equivalence suite against SimPy, and it fails if the Rust backend is not installed, so the suite cannot skip it silently. Since 2026-11-15 every release also gets a GitHub Release, created by `github-release.yml` once the tag is on PyPI, with generated notes and the `smolpy` sdist and wheel.)*
|
|
174
174
|
|
|
175
|
-
*Done on 2026-11-15,
|
|
175
|
+
*Done on 2026-11-15, and released with v1.8.0. `smolpy` and `smolpy-engine-rs` 1.8.0 are on PyPI with wheels for all five platforms, and the GitHub Release carries every file:*
|
|
176
176
|
- **`rust-wheels.yml`** builds one abi3 wheel per platform, for every Python from 3.10: Linux x86_64 and aarch64 (manylinux), macOS arm64 and x86_64, and Windows x86_64. It also builds an sdist.
|
|
177
177
|
- The wheels the runner can execute (Linux x86_64, macOS arm64, Windows) are installed and smoke-tested: a small scenario must be bit-exact with SimPy.
|
|
178
178
|
- It runs on every pull request that touches `rust/`.
|
|
@@ -191,6 +191,11 @@ Raw results: `benchmarks/results/2026-11-15-1255-rust-jaws-zbook-stop-criterion.
|
|
|
191
191
|
- The workflow publishes `smolpy-engine-rs` to PyPI. Its version is kept in lock-step with `smolpy`: the same tag triggers both releases.
|
|
192
192
|
- The existing `ci.yml`, `release.yml` and `publish.yml` of the main package stay unchanged, apart from an extra CI job that runs the equivalence tests with the Rust backend.
|
|
193
193
|
- The Rust toolchain is needed only by contributors who work on the engine.
|
|
194
|
+
- *Added 2026-11-15:* **development builds.**
|
|
195
|
+
- **What.** After every merge to `main` that changes `src/`, `rust/` or `pyproject.toml`, `dev-build.yml` publishes `smolpy` and `smolpy-engine-rs` to PyPI as `X.Y.(Z+1).devN`, where N is the number of commits after the latest release tag. This is hatch-vcs's own numbering, and the workflow checks that the two agree.
|
|
196
|
+
- **For whom.** They are PEP 440 pre-releases, so `pip install smolpy` ignores them and `pip install --pre` gets them. A git hash cannot be part of a version on PyPI, so it goes into the GitHub pre-release instead.
|
|
197
|
+
- **On GitHub.** One pre-release, "Development build" on the moving tag `dev`, is replaced each time and names the commit. Every place that looks for the latest release matches `v*` tags only, so `dev` never counts as one.
|
|
198
|
+
- **Releases** (patch, minor or major) stay manual, through `release.yml`. Release `X.Y.(Z+1)` sorts above all its development builds.
|
|
194
199
|
|
|
195
200
|
---
|
|
196
201
|
|
|
@@ -164,7 +164,7 @@ result.export("out.csv", format="csv") # explicit format override
|
|
|
164
164
|
| Backend | What it is |
|
|
165
165
|
|---|---|
|
|
166
166
|
| `"simpy"` | The reference implementation. It is the default, always installed, and runs the whole model, including the live and text dashboards. |
|
|
167
|
-
| `"rust"` | The native engine of [ADR-0008](adr/0008-rust-des-engine-mvp.md), from the optional package `smolpy-engine-rs` (`pip install smolpy
|
|
167
|
+
| `"rust"` | The native engine of [ADR-0008](adr/0008-rust-des-engine-mvp.md), from the optional package `smolpy-engine-rs` (`pip install smolpy[rust]`). It runs headless. |
|
|
168
168
|
|
|
169
169
|
- **What a backend can run is checked before the run.** Every backend declares what it supports: node kinds, traffic kinds, patterns and metrics. A scenario that uses anything else is rejected with a `ScenarioError` naming the element, for example `poll a -> meter: the rust backend does not support poll (Modbus TCP)`.
|
|
170
170
|
- **A missing backend is an error.** When a backend is not installed, selecting it raises `BackendUnavailable` with the install command.
|
|
@@ -173,7 +173,7 @@ result.export("out.csv", format="csv") # explicit format override
|
|
|
173
173
|
**The Rust backend so far** runs adapters, switches (`strict` and `fifo` QoS, `learning` and `topology` MAC tables), links and flows with every pattern (`constant`, `poisson`, `bursty`, `batch`) and with fixed or IMIX sizes. It covers the metrics `throughput`, `latency`, `bytes_sent`, `bytes_received`, `queue_depth` and `utilization`.
|
|
174
174
|
- **Same results as SimPy.** Deterministic scenarios give SimPy's results bit for bit. Random traffic uses the same streams and distributions with the engine's own generator, so there the results agree statistically.
|
|
175
175
|
- **Not in it yet.** MQTT, Modbus and PROFINET come in Phase 5 of the [roadmap](roadmap.md).
|
|
176
|
-
- **Install** it with `pip install smolpy-engine-rs`. It is released together with `smolpy`, with the same version,
|
|
176
|
+
- **Install** it with `pip install smolpy[rust]`, or `pip install smolpy-engine-rs` next to an installed `smolpy`. It is released together with `smolpy`, with the same version, since v1.8.0. Wheels exist for Linux x86_64 and aarch64, macOS arm64 and x86_64, and Windows x86_64. To build it from the repository instead, with a Rust toolchain:
|
|
177
177
|
|
|
178
178
|
```bash
|
|
179
179
|
uvx maturin build --release -m rust/smolpy-engine-rs/Cargo.toml -o dist/
|
|
@@ -113,7 +113,7 @@ Decided before the Rust engine, so that it implements the final model once:
|
|
|
113
113
|
## Phase 4: Rust DES engine, MVP ([ADR-0008](adr/0008-rust-des-engine-mvp.md))
|
|
114
114
|
|
|
115
115
|
- Native engine for the core model: links, switches with priorities, Ethernet flows, core metrics.
|
|
116
|
-
- Ships as an optional package
|
|
116
|
+
- Ships as an optional package: `pip install smolpy[rust]`, which installs `smolpy-engine-rs`.
|
|
117
117
|
- Selected with `backend="rust"`.
|
|
118
118
|
|
|
119
119
|
**Exit criteria:**
|
|
@@ -123,7 +123,7 @@ Decided before the Rust engine, so that it implements the final model once:
|
|
|
123
123
|
- Research targets from ADR-0006 are met.
|
|
124
124
|
- Wheels are published for Linux, macOS and Windows.
|
|
125
125
|
|
|
126
|
-
**Status:** ADR-0008 accepted on 2026-11-15 and brought up to date: integer nanoseconds, IR version 2, frames on the wire (ADR-0010), bit-exact deterministic equivalence.
|
|
126
|
+
**Status:** ADR-0008 accepted on 2026-11-15 and brought up to date: integer nanoseconds, IR version 2, frames on the wire (ADR-0010), bit-exact deterministic equivalence. Done (steps 1–7), released in v1.8.0.
|
|
127
127
|
- Step 2: `smolpy.backends` is the backend registry. `backend=` is available on `simulate()` and `run_many()`, and `--backend` on `smolpy run`. Each backend's capabilities are checked before the run, and the Rust backend reports clearly when it is not installed.
|
|
128
128
|
- Step 3: `rust/` holds the engine `smol-engine` and the Python module `smolpy-engine-rs`. The engine reproduces SimPy's event graph, so it gives SimPy's results bit for bit, down to the event count. It covers adapters, switches, links, constant flows and six metrics.
|
|
129
129
|
- **Step 4, the stop criterion: go.** B1 at 10 M frames runs in 4.93 s against 200.8 s on SimPy, 40.8× faster where 10× was required, with an identical output hash.
|
|
@@ -141,11 +141,11 @@ Decided before the Rust engine, so that it implements the final model once:
|
|
|
141
141
|
- B1 10× faster: met, 40.8×.
|
|
142
142
|
- Equivalence suite: met, bit-exact on deterministic scenarios and statistical on random ones.
|
|
143
143
|
- Research targets: met.
|
|
144
|
-
- Wheels on Linux, macOS and Windows:
|
|
144
|
+
- Wheels on Linux, macOS and Windows: met. They are published since v1.8.0 and smoke-tested against SimPy at every build.
|
|
145
145
|
|
|
146
146
|
- Step 7: `rust-wheels.yml` builds abi3 wheels for Linux, macOS and Windows and smoke-tests them against SimPy. `publish.yml` publishes them with each release, and a manual run publishes to TestPyPI first.
|
|
147
147
|
|
|
148
|
-
Phase 4 is
|
|
148
|
+
**Phase 4 is done.** v1.8.0 published `smolpy-engine-rs`, so `pip install smolpy[rust]` installs it. Next is Phase 5, protocol parity in Rust.
|
|
149
149
|
|
|
150
150
|
## Phase 5: Rust protocol parity
|
|
151
151
|
|
|
@@ -157,10 +157,13 @@ Modbus TCP, MQTT and PROFINET RT in the Rust engine. These need no new architect
|
|
|
157
157
|
|
|
158
158
|
A code-generated ns-3 scenario from the Scenario IR. Gives a realistic TCP/IP stack for Modbus and MQTT.
|
|
159
159
|
|
|
160
|
+
ns-3 cannot be installed with `pip`, so the backend ships as a container image, `ghcr.io/jwszolek/smolpy:<version>-ns3`. It holds the pinned ns-3 release built once, and CI runs the ns-3 equivalence suite in it ([ADR-0004 — Container images](adr/0004-execution-backends.md#container-images)). A lighter image with SMOLPy and the Rust engine, without ns-3, can be published from the first release of `smolpy-engine-rs`.
|
|
161
|
+
|
|
160
162
|
**Exit criteria:**
|
|
161
163
|
|
|
162
164
|
- Low-load scenarios agree with SimPy and Rust.
|
|
163
165
|
- Under load, the differences are quantified and documented.
|
|
166
|
+
- The `-ns3` image is published at each release, and CI runs the ns-3 suite in it.
|
|
164
167
|
|
|
165
168
|
## Candidates (not yet scheduled)
|
|
166
169
|
|
|
@@ -27,6 +27,9 @@ smolpy = "smolpy.cli:main"
|
|
|
27
27
|
[project.optional-dependencies]
|
|
28
28
|
dev = ["pytest>=8", "ruff", "mypy"]
|
|
29
29
|
docs = ["mkdocs-material>=9"]
|
|
30
|
+
# The native Rust engine (ADR-0008). 1.8 is the first release, reading Scenario
|
|
31
|
+
# IR version 2; at import smolpy also checks the IR version the module reads.
|
|
32
|
+
rust = ["smolpy-engine-rs>=1.8"]
|
|
30
33
|
|
|
31
34
|
[build-system]
|
|
32
35
|
requires = ["hatchling", "hatch-vcs"]
|
|
@@ -36,6 +39,11 @@ build-backend = "hatchling.build"
|
|
|
36
39
|
source = "vcs"
|
|
37
40
|
fallback-version = "0.1.0"
|
|
38
41
|
|
|
42
|
+
# A commit N commits after tag vX.Y.Z is X.Y.(Z+1).devN, with no "+g<hash>"
|
|
43
|
+
# local part: PyPI rejects local versions, and development builds go there.
|
|
44
|
+
[tool.hatch.version.raw-options]
|
|
45
|
+
local_scheme = "no-local-version"
|
|
46
|
+
|
|
39
47
|
[tool.hatch.build.targets.wheel]
|
|
40
48
|
packages = ["src/smolpy"]
|
|
41
49
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
The native simulation engine of [SMOLPy](https://github.com/jwszolek/SMOLPy), a network description language and discrete-event simulator for industrial networks. It is written in Rust and exposed to Python with PyO3 ([ADR-0008](https://jwszolek.github.io/SMOLPy/adr/0008-rust-des-engine-mvp/)).
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
pip install smolpy smolpy-engine-rs
|
|
6
|
+
pip install smolpy[rust] # or: pip install smolpy smolpy-engine-rs
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
```python
|
|
@@ -8,7 +8,7 @@ silently.
|
|
|
8
8
|
|
|
9
9
|
- ``simpy``: the reference implementation, always available.
|
|
10
10
|
- ``rust``: the native engine of ADR-0008, from the optional package
|
|
11
|
-
``smolpy-engine-rs`` (``pip install smolpy
|
|
11
|
+
``smolpy-engine-rs`` (``pip install smolpy[rust]``). It declares its
|
|
12
12
|
own capabilities, so this module never claims more than the engine
|
|
13
13
|
supports, and the Scenario IR version it reads, which must be this
|
|
14
14
|
smolpy's.
|
|
@@ -104,7 +104,7 @@ class RustBackend:
|
|
|
104
104
|
|
|
105
105
|
name = "rust"
|
|
106
106
|
module_name = "smolpy_engine_rs"
|
|
107
|
-
install = "pip install smolpy
|
|
107
|
+
install = "pip install smolpy[rust]"
|
|
108
108
|
|
|
109
109
|
def _module(self) -> ModuleType:
|
|
110
110
|
from smolpy.model import VERSION
|
|
@@ -87,7 +87,7 @@ def test_simulate_on_the_default_backend_is_simpy() -> None:
|
|
|
87
87
|
def test_rust_reports_that_it_is_not_installed(no_rust) -> None:
|
|
88
88
|
assert "rust" not in backends.installed()
|
|
89
89
|
with pytest.raises(
|
|
90
|
-
BackendUnavailable, match="rust backend is not installed: pip install smolpy
|
|
90
|
+
BackendUnavailable, match=r"rust backend is not installed: pip install smolpy\[rust\]"
|
|
91
91
|
):
|
|
92
92
|
_net().simulate(duration=50, backend="rust")
|
|
93
93
|
with pytest.raises(BackendUnavailable, match="not installed"):
|
|
@@ -1571,6 +1571,9 @@ dev = [
|
|
|
1571
1571
|
docs = [
|
|
1572
1572
|
{ name = "mkdocs-material" },
|
|
1573
1573
|
]
|
|
1574
|
+
rust = [
|
|
1575
|
+
{ name = "smolpy-engine-rs" },
|
|
1576
|
+
]
|
|
1574
1577
|
|
|
1575
1578
|
[package.dev-dependencies]
|
|
1576
1579
|
dev = [
|
|
@@ -1595,8 +1598,9 @@ requires-dist = [
|
|
|
1595
1598
|
{ name = "rich", specifier = ">=13" },
|
|
1596
1599
|
{ name = "ruff", marker = "extra == 'dev'" },
|
|
1597
1600
|
{ name = "simpy", specifier = ">=4.1" },
|
|
1601
|
+
{ name = "smolpy-engine-rs", marker = "extra == 'rust'", specifier = ">=1.8" },
|
|
1598
1602
|
]
|
|
1599
|
-
provides-extras = ["dev", "docs"]
|
|
1603
|
+
provides-extras = ["dev", "docs", "rust"]
|
|
1600
1604
|
|
|
1601
1605
|
[package.metadata.requires-dev]
|
|
1602
1606
|
dev = [
|
|
@@ -1606,6 +1610,19 @@ dev = [
|
|
|
1606
1610
|
]
|
|
1607
1611
|
docs = [{ name = "mkdocs-material", specifier = ">=9" }]
|
|
1608
1612
|
|
|
1613
|
+
[[package]]
|
|
1614
|
+
name = "smolpy-engine-rs"
|
|
1615
|
+
version = "1.8.0"
|
|
1616
|
+
source = { registry = "https://pypi.org/simple" }
|
|
1617
|
+
sdist = { url = "https://files.pythonhosted.org/packages/64/f2/858fd6ba4b6b792411f25f56e10db32319a25c36b0b8320cabeec6de99d6/smolpy_engine_rs-1.8.0.tar.gz", hash = "sha256:8f6d17b48e7eb77c0398ea8600c106fd1d5d983b465790bd5fd7f7e546216ff5", size = 25172, upload-time = "2026-11-15T14:28:44.896Z" }
|
|
1618
|
+
wheels = [
|
|
1619
|
+
{ url = "https://files.pythonhosted.org/packages/b4/59/3e7292c05f8d2af703471256d1f4b0ffc9b8e9ef78e7b54ec2af288f7c7b/smolpy_engine_rs-1.8.0-cp310-abi3-macosx_10_12_x86_64.whl", hash = "sha256:06502c4089af9549ce111f025b9d90c4f1c7e1cdbf9180032ada6c9a4877da4d", size = 331524, upload-time = "2026-11-15T14:28:39.082Z" },
|
|
1620
|
+
{ url = "https://files.pythonhosted.org/packages/a3/b2/636675c169a31befaf84b199ccec97bc248d5576ec95ee9e69fc06a74da9/smolpy_engine_rs-1.8.0-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:c29427217f5b5836fcf0b57aeb9219f7f8b400933887101297a398e358b1a014", size = 311989, upload-time = "2026-11-15T14:28:40.346Z" },
|
|
1621
|
+
{ url = "https://files.pythonhosted.org/packages/7c/5b/4ac802396316d8943cc24ee5767993d14e7fc40f7f951b1faa90ac59fb69/smolpy_engine_rs-1.8.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:80484a7cf08e59def9b4179ddc89c9344352ade2404ba12397ad9fe6e2fbecff", size = 340475, upload-time = "2026-11-15T14:28:41.509Z" },
|
|
1622
|
+
{ url = "https://files.pythonhosted.org/packages/07/55/753af8b70c415de20b228356b098684e5cc51d63f071e98b7e1f3f6d7850/smolpy_engine_rs-1.8.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:94fd11543b4a21b0e1837667521625f9186a06b66b80a50053429dbb2332d021", size = 348954, upload-time = "2026-11-15T14:28:42.676Z" },
|
|
1623
|
+
{ url = "https://files.pythonhosted.org/packages/c3/51/629361601f9e43e4b306590c01eb726c543c29b3e66fbbcfc64d8af6bd95/smolpy_engine_rs-1.8.0-cp310-abi3-win_amd64.whl", hash = "sha256:8ab46ffa2025f9973782edd72fe019f5231e3b27af4f545b09cbe45754b6bc0b", size = 249969, upload-time = "2026-11-15T14:28:44.009Z" },
|
|
1624
|
+
]
|
|
1625
|
+
|
|
1609
1626
|
[[package]]
|
|
1610
1627
|
name = "sse-starlette"
|
|
1611
1628
|
version = "3.4.5"
|