smolpy 1.8.2.dev8__tar.gz → 1.8.2.dev10__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.
Files changed (135) hide show
  1. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/PKG-INFO +4 -4
  2. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/README.md +3 -3
  3. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/adr/0008-rust-des-engine-mvp.md +1 -1
  4. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/dsl-reference.md +10 -3
  5. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/roadmap.md +9 -5
  6. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/rust/smol-engine/src/frames.rs +12 -0
  7. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/rust/smol-engine/src/scenario.rs +73 -13
  8. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/rust/smol-engine/src/sim.rs +330 -4
  9. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/rust/smolpy-engine-rs/README.md +3 -2
  10. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/rust/smolpy-engine-rs/smoke_test.py +15 -4
  11. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/tests/equivalence/scenarios.py +41 -8
  12. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/.github/workflows/ci.yml +0 -0
  13. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/.github/workflows/dev-build.yml +0 -0
  14. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/.github/workflows/docs.yml +0 -0
  15. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/.github/workflows/github-release.yml +0 -0
  16. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/.github/workflows/publish.yml +0 -0
  17. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/.github/workflows/release.yml +0 -0
  18. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/.github/workflows/rust-wheels.yml +0 -0
  19. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/.gitignore +0 -0
  20. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/LICENSE +0 -0
  21. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/benchmarks/__init__.py +0 -0
  22. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/benchmarks/__main__.py +0 -0
  23. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/benchmarks/results/2026-11-13-0921-simpy-jaws-zbook-baseline.json +0 -0
  24. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/benchmarks/results/2026-11-13-1527-simpy-jaws-zbook-optimised.json +0 -0
  25. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/benchmarks/results/2026-11-13-2116-simpy-jaws-zbook-research-batch.json +0 -0
  26. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/benchmarks/results/2026-11-13-2119-simpy-jaws-zbook-research-b4.json +0 -0
  27. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/benchmarks/results/2026-11-15-1255-rust-jaws-zbook-stop-criterion.json +0 -0
  28. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/benchmarks/results/2026-11-15-1333-rust-jaws-zbook-research-b4.json +0 -0
  29. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/benchmarks/results/2026-11-15-1346-rust-jaws-zbook-research-batch.json +0 -0
  30. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/benchmarks/runner.py +0 -0
  31. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/benchmarks/scenarios.py +0 -0
  32. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/benchmarks/worker.py +0 -0
  33. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/adr/0001-protocol-package-structure.md +0 -0
  34. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/adr/0002-modbus-tcp-implementation.md +0 -0
  35. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/adr/0003-smol-external-dsl.md +0 -0
  36. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/adr/0004-execution-backends.md +0 -0
  37. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/adr/0005-profinet-rt.md +0 -0
  38. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/adr/0006-profiling-and-baseline-benchmark.md +0 -0
  39. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/adr/0007-execution-independent-scenario-model.md +0 -0
  40. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/adr/0009-batch-execution-and-cross-backend-validation.md +0 -0
  41. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/adr/0010-ethernet-frames-on-the-wire.md +0 -0
  42. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/benchmarks.md +0 -0
  43. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/dashboard.md +0 -0
  44. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/examples.md +0 -0
  45. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/index.md +0 -0
  46. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/language-reference.md +0 -0
  47. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/modbus.md +0 -0
  48. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/model-semantics.md +0 -0
  49. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/mqtt.md +0 -0
  50. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/profinet.md +0 -0
  51. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/scenario-model.md +0 -0
  52. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/docs/simulation-engine.md +0 -0
  53. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/examples/README.md +0 -0
  54. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/examples/example.py +0 -0
  55. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/examples/example.smol +0 -0
  56. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/examples/example_10_clients.py +0 -0
  57. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/examples/example_12_clients.py +0 -0
  58. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/examples/example_20_clients.py +0 -0
  59. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/examples/example_file_transfer.py +0 -0
  60. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/examples/example_modbus.py +0 -0
  61. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/examples/example_mqtt.py +0 -0
  62. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/examples/example_profinet.py +0 -0
  63. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/examples/example_profinet.smol +0 -0
  64. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/examples/example_staggered_transfer.py +0 -0
  65. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/examples/example_two_tier.py +0 -0
  66. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/mkdocs.yml +0 -0
  67. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/pyproject.toml +0 -0
  68. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/rust/Cargo.lock +0 -0
  69. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/rust/Cargo.toml +0 -0
  70. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/rust/smol-engine/Cargo.toml +0 -0
  71. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/rust/smol-engine/src/lib.rs +0 -0
  72. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/rust/smol-engine/src/rng.rs +0 -0
  73. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/rust/smol-engine/src/timebase.rs +0 -0
  74. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/rust/smolpy-engine-rs/Cargo.toml +0 -0
  75. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/rust/smolpy-engine-rs/pyproject.toml +0 -0
  76. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/rust/smolpy-engine-rs/src/lib.rs +0 -0
  77. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/__init__.py +0 -0
  78. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/_worker.py +0 -0
  79. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/backends.py +0 -0
  80. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/batch.py +0 -0
  81. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/cli.py +0 -0
  82. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/core/__init__.py +0 -0
  83. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/core/adapter.py +0 -0
  84. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/core/batch.py +0 -0
  85. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/core/link.py +0 -0
  86. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/core/network.py +0 -0
  87. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/core/node.py +0 -0
  88. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/core/observation.py +0 -0
  89. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/ethernet/__init__.py +0 -0
  90. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/ethernet/switch.py +0 -0
  91. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/lang/__init__.py +0 -0
  92. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/lang/ast.py +0 -0
  93. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/lang/errors.py +0 -0
  94. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/lang/grammar.lark +0 -0
  95. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/lang/interpreter.py +0 -0
  96. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/lang/transformer.py +0 -0
  97. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/modbus/__init__.py +0 -0
  98. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/modbus/slave.py +0 -0
  99. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/model/__init__.py +0 -0
  100. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/model/frames.py +0 -0
  101. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/model/scenario.py +0 -0
  102. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/model/streams.py +0 -0
  103. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/model/timebase.py +0 -0
  104. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/model/validate.py +0 -0
  105. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/mqtt/__init__.py +0 -0
  106. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/mqtt/broker.py +0 -0
  107. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/profinet/__init__.py +0 -0
  108. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/profinet/device.py +0 -0
  109. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/sim/__init__.py +0 -0
  110. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/sim/engine.py +0 -0
  111. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/stats.py +0 -0
  112. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/viz/__init__.py +0 -0
  113. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/viz/dashboard.py +0 -0
  114. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/src/smolpy/viz/text_dashboard.py +0 -0
  115. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/tests/__init__.py +0 -0
  116. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/tests/equivalence/__init__.py +0 -0
  117. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/tests/equivalence/harness.py +0 -0
  118. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/tests/equivalence/test_equivalence.py +0 -0
  119. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/tests/equivalence/test_rust_timebase.py +0 -0
  120. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/tests/test_backends.py +0 -0
  121. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/tests/test_batch.py +0 -0
  122. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/tests/test_benchmarks.py +0 -0
  123. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/tests/test_cli.py +0 -0
  124. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/tests/test_dsl.py +0 -0
  125. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/tests/test_engine_ir.py +0 -0
  126. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/tests/test_lang.py +0 -0
  127. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/tests/test_model.py +0 -0
  128. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/tests/test_profinet.py +0 -0
  129. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/tests/test_semantics.py +0 -0
  130. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/tests/test_simulation.py +0 -0
  131. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/tests/test_stats.py +0 -0
  132. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/tests/test_sweep.py +0 -0
  133. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/tests/test_timebase.py +0 -0
  134. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/tests/test_validate.py +0 -0
  135. {smolpy-1.8.2.dev8 → smolpy-1.8.2.dev10}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: smolpy
3
- Version: 1.8.2.dev8
3
+ Version: 1.8.2.dev10
4
4
  Summary: Network simulation DSL and discrete-event simulator
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -48,7 +48,7 @@ SMOLPy lets you describe a network topology in pure Python, define traffic flows
48
48
  > result = net.simulate(duration=60_000, backend="rust")
49
49
  > ```
50
50
  >
51
- > The Rust engine covers Ethernet, Modbus TCP and MQTT for now: adapters, switches, links, flows, Modbus polling and MQTT publish/subscribe. PROFINET follows. See [Simulation engine](#simulation-engine) and [ADR-0008](https://jwszolek.github.io/SMOLPy/adr/0008-rust-des-engine-mvp/).
51
+ > The Rust engine runs the whole model: Ethernet, Modbus TCP, MQTT and PROFINET RT. Only the live and text dashboards need SimPy. See [Simulation engine](#simulation-engine) and [ADR-0008](https://jwszolek.github.io/SMOLPy/adr/0008-rust-des-engine-mvp/).
52
52
 
53
53
  📖 **Full documentation:** [jwszolek.github.io/SMOLPy](https://jwszolek.github.io/SMOLPy/)
54
54
 
@@ -471,7 +471,7 @@ Every simulation goes through the same path. The Python API and `.smol` files bu
471
471
  | Backend | Language | What it runs | Speed | Install |
472
472
  |---|---|---|---|---|
473
473
  | `simpy` (default) | Python, SimPy | the whole model, the live and text dashboards | reference | included |
474
- | `rust` | Rust, through PyO3 | Ethernet: adapters, switches, links, flows (constant, Poisson, bursty, batch, IMIX); Modbus TCP polling; seven 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) |
474
+ | `rust` | Rust, through PyO3 | the whole model, headless: Ethernet, Modbus TCP, MQTT and PROFINET RT, every metric | about **40× faster**: B1 at 10 M frames in 4.9 s, not 200.8 s | `pip install smolpy[rust]` (since v1.8.0) |
475
475
 
476
476
  ```python
477
477
  result = net.simulate(duration=60_000, backend="rust") # one run
@@ -483,7 +483,7 @@ smolpy run plant.smol --backend rust
483
483
  ```
484
484
 
485
485
  - **The same numbers.** On deterministic scenarios the Rust engine reproduces SimPy's results bit for bit, down to the event count. Random traffic uses each engine's own generator, so there the results agree statistically. CI checks both on every pull request ([ADR-0009](https://jwszolek.github.io/SMOLPy/adr/0009-batch-execution-and-cross-backend-validation/)).
486
- - **Nothing is skipped silently.** A scenario that uses something a backend does not support, such as PROFINET on Rust for now, is rejected before the run with a message naming the element.
486
+ - **Nothing is skipped silently.** A scenario that uses something a backend does not support is rejected before the run with a message naming the element. Asking the Rust engine for a dashboard is an error too.
487
487
 
488
488
  The model both engines implement:
489
489
 
@@ -20,7 +20,7 @@ SMOLPy lets you describe a network topology in pure Python, define traffic flows
20
20
  > result = net.simulate(duration=60_000, backend="rust")
21
21
  > ```
22
22
  >
23
- > The Rust engine covers Ethernet, Modbus TCP and MQTT for now: adapters, switches, links, flows, Modbus polling and MQTT publish/subscribe. PROFINET follows. See [Simulation engine](#simulation-engine) and [ADR-0008](https://jwszolek.github.io/SMOLPy/adr/0008-rust-des-engine-mvp/).
23
+ > The Rust engine runs the whole model: Ethernet, Modbus TCP, MQTT and PROFINET RT. Only the live and text dashboards need SimPy. See [Simulation engine](#simulation-engine) and [ADR-0008](https://jwszolek.github.io/SMOLPy/adr/0008-rust-des-engine-mvp/).
24
24
 
25
25
  📖 **Full documentation:** [jwszolek.github.io/SMOLPy](https://jwszolek.github.io/SMOLPy/)
26
26
 
@@ -443,7 +443,7 @@ Every simulation goes through the same path. The Python API and `.smol` files bu
443
443
  | Backend | Language | What it runs | Speed | Install |
444
444
  |---|---|---|---|---|
445
445
  | `simpy` (default) | Python, SimPy | the whole model, the live and text dashboards | reference | included |
446
- | `rust` | Rust, through PyO3 | Ethernet: adapters, switches, links, flows (constant, Poisson, bursty, batch, IMIX); Modbus TCP polling; seven 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) |
446
+ | `rust` | Rust, through PyO3 | the whole model, headless: Ethernet, Modbus TCP, MQTT and PROFINET RT, every metric | about **40× faster**: B1 at 10 M frames in 4.9 s, not 200.8 s | `pip install smolpy[rust]` (since v1.8.0) |
447
447
 
448
448
  ```python
449
449
  result = net.simulate(duration=60_000, backend="rust") # one run
@@ -455,7 +455,7 @@ smolpy run plant.smol --backend rust
455
455
  ```
456
456
 
457
457
  - **The same numbers.** On deterministic scenarios the Rust engine reproduces SimPy's results bit for bit, down to the event count. Random traffic uses each engine's own generator, so there the results agree statistically. CI checks both on every pull request ([ADR-0009](https://jwszolek.github.io/SMOLPy/adr/0009-batch-execution-and-cross-backend-validation/)).
458
- - **Nothing is skipped silently.** A scenario that uses something a backend does not support, such as PROFINET on Rust for now, is rejected before the run with a message naming the element.
458
+ - **Nothing is skipped silently.** A scenario that uses something a backend does not support is rejected before the run with a message naming the element. Asking the Rust engine for a dashboard is an error too.
459
459
 
460
460
  The model both engines implement:
461
461
 
@@ -122,7 +122,7 @@ Anything outside this scope is rejected by the capability check with a message s
122
122
  - **Cross-engine equivalence** against SimPy uses the harness from ADR-0009:
123
123
  - **Deterministic scenarios** (constant patterns, fixed sizes) must agree with SimPy ~~within a tight tolerance on every metric window. Differences come only from float µs (SimPy) versus integer ns (Rust).~~ *Amended by the ADR-0007 revision of 2026-11-14:* exactly, on every metric window. Both engines use integer nanoseconds and the same rounding rules ([ADR-0007](0007-execution-independent-scenario-model.md#simulated-time-integer-nanoseconds)).
124
124
  - **Stochastic scenarios** must agree statistically across replications.
125
- - **Benchmark acceptance:** B1, B3 and B4 of the ADR-0006 suite, run with `--backend rust`, must meet the research targets defined there on the reference machine. B2 follows with protocol parity (Phase 5). *Met on 2026-11-15; see step 6.*
125
+ - **Benchmark acceptance:** B1, B3 and B4 of the ADR-0006 suite, run with `--backend rust`, must meet the research targets defined there on the reference machine. B2 follows with protocol parity (Phase 5). *Met on 2026-11-15; see step 6. B2 runs on Rust since Phase 5 (2026-11-16), bit-exact with SimPy.*
126
126
 
127
127
  ### Stop criterion
128
128
 
@@ -166,13 +166,20 @@ result.export("out.csv", format="csv") # explicit format override
166
166
  | `"simpy"` | The reference implementation. It is the default, always installed, and runs the whole model, including the live and text dashboards. |
167
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
- - **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 `ProfinetDevice 'io': the rust backend does not support PROFINET device (planned for Phase 5)`.
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. A dashboard (`live=True` or `text=True`) on a headless backend is a `ValueError`.
170
170
  - **A missing backend is an error.** When a backend is not installed, selecting it raises `BackendUnavailable` with the install command.
171
171
  - **`smolpy.backends.installed()`** lists the backends that can run here.
172
172
 
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 also runs Modbus TCP (slaves, `polls()` and `modbus_latency`) and MQTT (brokers, `publishes()` with QoS 0 and 1, `routes()` and `broker_queue`). It covers every metric except the PROFINET ones.
173
+ **The Rust backend** runs the whole model:
174
+ - 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;
175
+ - Modbus TCP: slaves, `polls()` and `modbus_latency`;
176
+ - MQTT: brokers, `publishes()` with QoS 0 and 1, `routes()` and `broker_queue`;
177
+ - PROFINET RT: devices, `controls()` and its watchdog, `pn_latency`, `pn_jitter` and `pn_watchdog_expiries`;
178
+ - every metric.
179
+
180
+ It runs headless: the live and text dashboards need SimPy.
181
+
174
182
  - **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
- - **Not in it yet.** PROFINET comes in Phase 5 of the [roadmap](roadmap.md).
176
183
  - **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
184
 
178
185
  ```bash
@@ -145,7 +145,7 @@ Decided before the Rust engine, so that it implements the final model once:
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 done.** v1.8.0 published `smolpy-engine-rs`, so `pip install smolpy[rust]` installs it. Next is Phase 5, protocol parity in Rust.
148
+ **Phase 4 is done.** v1.8.0 published `smolpy-engine-rs`, so `pip install smolpy[rust]` installs it. Phase 5 then brought protocol parity.
149
149
 
150
150
  ## Phase 5: Rust protocol parity
151
151
 
@@ -153,14 +153,18 @@ Modbus TCP, MQTT and PROFINET RT in the Rust engine. These need no new architect
153
153
 
154
154
  **Exit criteria:** the Rust backend's capabilities equal SimPy's, apart from the live dashboard.
155
155
 
156
- **Status:** two of three protocols done.
157
- - **Modbus TCP: done.**
156
+ **Status: done.** The exit criterion is met: the Rust backend's capabilities equal SimPy's, apart from the live dashboard.
157
+ - **Modbus TCP.**
158
158
  - The Rust engine runs slaves, `polls()` and `modbus_latency`. It reproduces SimPy's poll generator and slave process, including requests flooded to other slaves and dropped there.
159
159
  - The new `polling` scenario is bit-exact with SimPy, down to the event count.
160
- - **MQTT: done.**
160
+ - **MQTT.**
161
161
  - The Rust engine runs brokers, `publishes()` with QoS 0 and 1, `routes()` and `broker_queue`. It reproduces SimPy's publish generator and broker: copies keep the publisher's origin time, QoS 1 is acknowledged with a PUBACK, and a topic nobody subscribes to is only acknowledged.
162
162
  - The new `messaging` scenario (two brokers, non-ASCII topics) and the existing `protocols` scenario (Modbus and MQTT) are bit-exact with SimPy, down to the event count.
163
- - **PROFINET RT** is next. Its watchdog waits on "a frame or a timeout", a SimPy condition whose event ordering the engine has to reproduce. watchdog waits on "a frame or a timeout", a SimPy condition whose event ordering the engine has to reproduce.
163
+ - **PROFINET RT.**
164
+ - The Rust engine runs devices, `controls()`, `pn_latency`, `pn_jitter` and `pn_watchdog_expiries`.
165
+ - The watchdog waits on "a frame or a timeout", a SimPy `AnyOf` condition. The engine reproduces it event by event: the condition is an event of its own, and only an arrival processed before it counts. So the watchdog expires exactly when SimPy's does, also when a frame arrives in the same nanosecond as the timeout.
166
+ - The new `cyclic` scenario (two controllers, three ARs, a watchdog that expires in some cycles) and the existing `priorities` scenario are bit-exact with SimPy, down to the event count.
167
+ - **Benchmarks.** B2, the plant with PROFINET, Modbus and MQTT, now runs on Rust as well: all four benchmarks give SimPy's output and metric hashes and event counts at 200 k frames. B2 runs about 34× faster there.
164
168
 
165
169
  ## Phase 6: ns-3 high-fidelity backend ([ADR-0004](adr/0004-execution-backends.md), revised)
166
170
 
@@ -36,6 +36,15 @@ pub fn modbus_response_frame_size(count: u16) -> u64 {
36
36
  padded(ETHERNET_IP_TCP_BYTES + 6 + 1 + 1 + 2 * count as u64)
37
37
  }
38
38
 
39
+ /// The 802.1Q priority (PCP) of PROFINET RT cyclic frames.
40
+ pub const PN_RT_PRIORITY: u8 = 6;
41
+
42
+ /// PROFINET RT: Ethernet (14), 802.1Q (4), FrameID (2), IO data, APDU
43
+ /// status (4) and FCS (4), padded to the minimum.
44
+ pub fn pn_frame_size(io_bytes: u64) -> u64 {
45
+ padded(14 + VLAN_TAG_BYTES + 2 + io_bytes + 4 + 4)
46
+ }
47
+
39
48
  /// A flow frame of `size` bytes (untagged, FCS included), with the tag a
40
49
  /// priority above 0 needs.
41
50
  pub fn flow_frame_size(size: u64, priority: u8) -> u64 {
@@ -55,6 +64,9 @@ mod tests {
55
64
  assert_eq!(MODBUS_REQUEST_BYTES, 69);
56
65
  assert_eq!(modbus_response_frame_size(10), 86);
57
66
  assert_eq!(modbus_response_frame_size(1), 68);
67
+ assert_eq!(pn_frame_size(20), 64);
68
+ assert_eq!(pn_frame_size(40), 68);
69
+ assert_eq!(pn_frame_size(1400), 1428);
58
70
  assert_eq!(MQTT_PUBACK_BYTES, padded(ETHERNET_IP_TCP_BYTES + 4));
59
71
  assert_eq!(mqtt_publish_frame_size(7, 20, 0), 58 + 2 + 2 + 7 + 20);
60
72
  assert_eq!(mqtt_publish_frame_size(7, 20, 1), 58 + 2 + 2 + 7 + 2 + 20);
@@ -17,6 +17,7 @@ pub enum NodeKind {
17
17
  Adapter { mac: String },
18
18
  ModbusSlave { mac: String, unit: u8 },
19
19
  MqttBroker { mac: String },
20
+ ProfinetDevice { mac: String },
20
21
  Switch { fifo: bool, topology: bool },
21
22
  }
22
23
 
@@ -90,6 +91,20 @@ pub struct Route {
90
91
  pub subscribers: Vec<String>,
91
92
  }
92
93
 
94
+ /// A PROFINET RT application relationship: cyclic frames both ways, with
95
+ /// `inputs` bytes from the device and `outputs` bytes to it; the watchdog is
96
+ /// `hold` cycles.
97
+ #[derive(Debug, Clone)]
98
+ pub struct ProfinetAr {
99
+ pub controller: String,
100
+ pub device: String,
101
+ pub cycle_ms: Q,
102
+ pub inputs: u64,
103
+ pub outputs: u64,
104
+ pub hold: u64,
105
+ pub delay_ms: Q,
106
+ }
107
+
93
108
  #[derive(Debug, Clone, Copy, PartialEq, Eq)]
94
109
  pub enum Metric {
95
110
  Throughput,
@@ -100,10 +115,13 @@ pub enum Metric {
100
115
  Utilization,
101
116
  ModbusLatency,
102
117
  BrokerQueue,
118
+ PnLatency,
119
+ PnJitter,
120
+ PnWatchdogExpiries,
103
121
  }
104
122
 
105
123
  impl Metric {
106
- pub const ALL: [(&'static str, Metric); 8] = [
124
+ pub const ALL: [(&'static str, Metric); 11] = [
107
125
  ("throughput", Metric::Throughput),
108
126
  ("latency", Metric::Latency),
109
127
  ("bytes_sent", Metric::BytesSent),
@@ -112,6 +130,9 @@ impl Metric {
112
130
  ("utilization", Metric::Utilization),
113
131
  ("modbus_latency", Metric::ModbusLatency),
114
132
  ("broker_queue", Metric::BrokerQueue),
133
+ ("pn_latency", Metric::PnLatency),
134
+ ("pn_jitter", Metric::PnJitter),
135
+ ("pn_watchdog_expiries", Metric::PnWatchdogExpiries),
115
136
  ];
116
137
 
117
138
  pub fn name(self) -> &'static str {
@@ -135,6 +156,7 @@ pub struct Scenario {
135
156
  pub polls: Vec<Poll>,
136
157
  pub publishes: Vec<Publish>,
137
158
  pub routes: Vec<Route>,
159
+ pub ars: Vec<ProfinetAr>,
138
160
  pub observations: Vec<Observation>,
139
161
  pub duration_ms: Q,
140
162
  pub seed: u64,
@@ -151,8 +173,14 @@ pub struct Capabilities {
151
173
  }
152
174
 
153
175
  pub const CAPABILITIES: Capabilities = Capabilities {
154
- nodes: &["adapter", "switch", "modbus_slave", "mqtt_broker"],
155
- traffic: &["flow", "poll", "publish", "route"],
176
+ nodes: &[
177
+ "adapter",
178
+ "switch",
179
+ "modbus_slave",
180
+ "mqtt_broker",
181
+ "profinet_device",
182
+ ],
183
+ traffic: &["flow", "poll", "publish", "route", "profinet_ar"],
156
184
  patterns: &["constant", "poisson", "bursty", "batch"],
157
185
  metrics: &[
158
186
  "throughput",
@@ -163,12 +191,12 @@ pub const CAPABILITIES: Capabilities = Capabilities {
163
191
  "utilization",
164
192
  "modbus_latency",
165
193
  "broker_queue",
194
+ "pn_latency",
195
+ "pn_jitter",
196
+ "pn_watchdog_expiries",
166
197
  ],
167
198
  features: &["imix"],
168
- notes: &[
169
- ("profinet_device", "planned for Phase 5"),
170
- ("profinet_ar", "planned for Phase 5"),
171
- ],
199
+ notes: &[],
172
200
  };
173
201
 
174
202
  type Res<T> = Result<T, String>;
@@ -292,8 +320,8 @@ pub fn parse(text: &str) -> Res<Scenario> {
292
320
  f.done()?;
293
321
  links.push(link);
294
322
  }
295
- let (mut flows, mut polls, mut publishes, mut routes) =
296
- (Vec::new(), Vec::new(), Vec::new(), Vec::new());
323
+ let (mut flows, mut polls, mut publishes, mut routes, mut ars) =
324
+ (Vec::new(), Vec::new(), Vec::new(), Vec::new(), Vec::new());
297
325
  for (i, v) in array(top.take_or("traffic"), "traffic")?
298
326
  .into_iter()
299
327
  .enumerate()
@@ -303,6 +331,7 @@ pub fn parse(text: &str) -> Res<Scenario> {
303
331
  Traffic::Poll(poll) => polls.push(poll),
304
332
  Traffic::Publish(publish) => publishes.push(publish),
305
333
  Traffic::Route(route) => routes.push(route),
334
+ Traffic::ProfinetAr(ar) => ars.push(ar),
306
335
  }
307
336
  }
308
337
  let mut observations = Vec::new();
@@ -350,6 +379,7 @@ pub fn parse(text: &str) -> Res<Scenario> {
350
379
  polls,
351
380
  publishes,
352
381
  routes,
382
+ ars,
353
383
  observations,
354
384
  duration_ms,
355
385
  seed,
@@ -417,7 +447,12 @@ fn parse_node(value: Value, i: usize) -> Res<Node> {
417
447
  mac: f.string("mac")?,
418
448
  }
419
449
  }
420
- "profinet_device" => return Err(unsupported(&format!("{kind} nodes (Phase 5)"))),
450
+ "profinet_device" => {
451
+ f.string("ip")?;
452
+ NodeKind::ProfinetDevice {
453
+ mac: f.string("mac")?,
454
+ }
455
+ }
421
456
  other => return Err(format!("unknown node kind {other:?}")),
422
457
  };
423
458
  f.done()?;
@@ -429,6 +464,7 @@ enum Traffic {
429
464
  Poll(Poll),
430
465
  Publish(Publish),
431
466
  Route(Route),
467
+ ProfinetAr(ProfinetAr),
432
468
  }
433
469
 
434
470
  fn parse_traffic(value: Value, i: usize) -> Res<Traffic> {
@@ -505,7 +541,31 @@ fn parse_traffic(value: Value, i: usize) -> Res<Traffic> {
505
541
  subscribers,
506
542
  }))
507
543
  }
508
- "profinet_ar" => Err(unsupported(&format!("{kind} traffic (Phase 5)"))),
544
+ "profinet_ar" => {
545
+ let controller = f.string("controller")?;
546
+ let device = f.string("device")?;
547
+ f.what = format!("PROFINET AR {controller} -> {device}");
548
+ let ar = ProfinetAr {
549
+ controller,
550
+ device,
551
+ cycle_ms: f.number("cycle_ms")?,
552
+ inputs: f.integer("inputs")?,
553
+ outputs: f.integer("outputs")?,
554
+ hold: match f.take_or("hold") {
555
+ None => 3,
556
+ Some(v) => v
557
+ .as_u64()
558
+ .filter(|h| *h >= 1)
559
+ .ok_or(format!("PROFINET AR: invalid hold {v}"))?,
560
+ },
561
+ delay_ms: match f.take_or("delay_ms") {
562
+ None => Q::int(0),
563
+ Some(v) => number(&v, "PROFINET AR: delay_ms")?,
564
+ },
565
+ };
566
+ f.done()?;
567
+ Ok(Traffic::ProfinetAr(ar))
568
+ }
509
569
  other => Err(format!("unknown traffic kind {other:?}")),
510
570
  }
511
571
  }
@@ -618,8 +678,8 @@ mod tests {
618
678
  assert_eq!(mqtt.publishes[0].topic, "hala/temp°C");
619
679
  assert_eq!(mqtt.publishes[0].qos, 1);
620
680
  assert_eq!(mqtt.routes[0].subscribers, ["tx"]);
621
- assert!(parse(&B1.replace("\"throughput\"", "\"pn_jitter\""))
681
+ assert!(parse(&B1.replace("\"throughput\"", "\"frame_loss\""))
622
682
  .unwrap_err()
623
- .contains("metric \"pn_jitter\""));
683
+ .contains("metric \"frame_loss\""));
624
684
  }
625
685
  }