smolpy 1.17.1__tar.gz → 1.17.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.
Files changed (189) hide show
  1. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/PKG-INFO +3 -3
  2. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/README.md +2 -2
  3. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/__main__.py +32 -1
  4. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/pool.py +28 -4
  5. smolpy-1.17.2.dev2/benchmarks/results/2026-12-04-0741-simpy-jaws-zbook-switches.json +18918 -0
  6. smolpy-1.17.2.dev2/benchmarks/switches.py +469 -0
  7. smolpy-1.17.2.dev2/docs/adr/0018-three-switches.md +530 -0
  8. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/backends.md +17 -0
  9. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/dsl-reference.md +18 -0
  10. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/language-reference.md +25 -6
  11. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/model-semantics.md +21 -3
  12. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/roadmap.md +22 -0
  13. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/scenario-model.md +5 -5
  14. smolpy-1.17.2.dev2/docs/switch-profiles.md +115 -0
  15. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/mkdocs.yml +2 -0
  16. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/rust/smol-engine/src/rng.rs +24 -0
  17. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/rust/smol-engine/src/scenario.rs +86 -0
  18. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/rust/smol-engine/src/sim.rs +66 -12
  19. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/backends.py +10 -1
  20. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/core/adapter.py +24 -7
  21. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/core/network.py +4 -0
  22. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/ethernet/switch.py +7 -0
  23. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/lang/ast.py +4 -0
  24. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/lang/interpreter.py +4 -0
  25. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/lang/transformer.py +9 -0
  26. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/model/scenario.py +21 -4
  27. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/model/streams.py +22 -0
  28. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/model/validate.py +33 -0
  29. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/ns3/__init__.py +12 -12
  30. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/ns3/cpp/smol-ns3.cc +15 -9
  31. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/sim/engine.py +23 -8
  32. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/equivalence/scenarios.py +48 -0
  33. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_benchmarks.py +174 -0
  34. smolpy-1.17.2.dev2/tests/test_fit_min.py +302 -0
  35. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_light_port.py +4 -4
  36. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_ns3.py +2 -2
  37. smolpy-1.17.2.dev2/tests/test_phase.py +318 -0
  38. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/.github/workflows/ci.yml +0 -0
  39. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/.github/workflows/dev-build.yml +0 -0
  40. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/.github/workflows/docker-image.yml +0 -0
  41. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/.github/workflows/docs.yml +0 -0
  42. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/.github/workflows/github-release.yml +0 -0
  43. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/.github/workflows/ns3-base.yml +0 -0
  44. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/.github/workflows/publish.yml +0 -0
  45. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/.github/workflows/release.yml +0 -0
  46. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/.github/workflows/rust-wheels.yml +0 -0
  47. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/.gitignore +0 -0
  48. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/LICENSE +0 -0
  49. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/__init__.py +0 -0
  50. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/cells.py +0 -0
  51. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/closed_loop.py +0 -0
  52. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/ingress.py +0 -0
  53. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/light_port.py +0 -0
  54. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/load.py +0 -0
  55. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/loss.py +0 -0
  56. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/results/2026-11-13-0921-simpy-jaws-zbook-baseline.json +0 -0
  57. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/results/2026-11-13-1527-simpy-jaws-zbook-optimised.json +0 -0
  58. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/results/2026-11-13-2116-simpy-jaws-zbook-research-batch.json +0 -0
  59. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/results/2026-11-13-2119-simpy-jaws-zbook-research-b4.json +0 -0
  60. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/results/2026-11-15-1255-rust-jaws-zbook-stop-criterion.json +0 -0
  61. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/results/2026-11-15-1333-rust-jaws-zbook-research-b4.json +0 -0
  62. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/results/2026-11-15-1346-rust-jaws-zbook-research-batch.json +0 -0
  63. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/results/2026-11-16-1839-simpy-ns3-jaws-zbook-tcp-under-load.json +0 -0
  64. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/results/2026-11-23-1228-simpy-rust-ns3-jaws-zbook-bounded-buffers.json +0 -0
  65. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/results/2026-11-23-2106-simpy-rust-ns3-jaws-zbook-one-request-in-flight.json +0 -0
  66. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/results/2026-11-24-0836-simpy-rust-ns3-jaws-zbook-ingress-buffers.json +0 -0
  67. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/results/2026-11-24-1006-simpy-rust-ns3-jaws-zbook-buffer-cells.json +0 -0
  68. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/results/2026-11-24-1538-simpy-rust-ns3-jaws-zbook-shared-pool.json +0 -0
  69. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/results/2026-11-24-2122-simpy-rust-ns3-jaws-zbook-switch-drop-state.json +0 -0
  70. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/results/2026-11-26-1508-simpy-jaws-zbook-light-port.json +0 -0
  71. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/runner.py +0 -0
  72. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/scenarios.py +0 -0
  73. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/switch_drop.py +0 -0
  74. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/benchmarks/worker.py +0 -0
  75. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docker/Dockerfile +0 -0
  76. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docker/Dockerfile.dockerignore +0 -0
  77. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docker/Dockerfile.ns3 +0 -0
  78. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docker/Dockerfile.ns3.dockerignore +0 -0
  79. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docker/ns3-base/Dockerfile +0 -0
  80. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docker/ns3-base/smoke.cc +0 -0
  81. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docker/smoke.smol +0 -0
  82. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/adr/0001-protocol-package-structure.md +0 -0
  83. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/adr/0002-modbus-tcp-implementation.md +0 -0
  84. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/adr/0003-smol-external-dsl.md +0 -0
  85. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/adr/0004-execution-backends.md +0 -0
  86. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/adr/0005-profinet-rt.md +0 -0
  87. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/adr/0006-profiling-and-baseline-benchmark.md +0 -0
  88. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/adr/0007-execution-independent-scenario-model.md +0 -0
  89. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/adr/0008-rust-des-engine-mvp.md +0 -0
  90. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/adr/0009-batch-execution-and-cross-backend-validation.md +0 -0
  91. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/adr/0010-ethernet-frames-on-the-wire.md +0 -0
  92. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/adr/0011-bounded-switch-buffers.md +0 -0
  93. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/adr/0012-modbus-one-request-in-flight.md +0 -0
  94. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/adr/0013-ingress-buffer-accounting.md +0 -0
  95. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/adr/0014-buffer-cells-and-hysteresis.md +0 -0
  96. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/adr/0015-shared-pool-and-drain-resume.md +0 -0
  97. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/adr/0016-switch-wide-drop-state.md +0 -0
  98. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/adr/0017-drain-counted-net.md +0 -0
  99. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/benchmarks.md +0 -0
  100. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/dashboard.md +0 -0
  101. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/examples.md +0 -0
  102. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/index.md +0 -0
  103. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/modbus.md +0 -0
  104. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/mqtt.md +0 -0
  105. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/profinet.md +0 -0
  106. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/docs/simulation-engine.md +0 -0
  107. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/examples/README.md +0 -0
  108. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/examples/example.py +0 -0
  109. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/examples/example.smol +0 -0
  110. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/examples/example_10_clients.py +0 -0
  111. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/examples/example_12_clients.py +0 -0
  112. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/examples/example_20_clients.py +0 -0
  113. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/examples/example_bounded_buffer.smol +0 -0
  114. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/examples/example_file_transfer.py +0 -0
  115. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/examples/example_ingress_buffer.smol +0 -0
  116. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/examples/example_modbus.py +0 -0
  117. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/examples/example_modbus_timeout.smol +0 -0
  118. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/examples/example_mqtt.py +0 -0
  119. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/examples/example_profinet.py +0 -0
  120. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/examples/example_profinet.smol +0 -0
  121. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/examples/example_staggered_transfer.py +0 -0
  122. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/examples/example_two_tier.py +0 -0
  123. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/pyproject.toml +0 -0
  124. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/rust/Cargo.lock +0 -0
  125. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/rust/Cargo.toml +0 -0
  126. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/rust/smol-engine/Cargo.toml +0 -0
  127. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/rust/smol-engine/src/frames.rs +0 -0
  128. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/rust/smol-engine/src/lib.rs +0 -0
  129. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/rust/smol-engine/src/timebase.rs +0 -0
  130. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/rust/smolpy-engine-rs/Cargo.toml +0 -0
  131. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/rust/smolpy-engine-rs/README.md +0 -0
  132. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/rust/smolpy-engine-rs/pyproject.toml +0 -0
  133. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/rust/smolpy-engine-rs/smoke_test.py +0 -0
  134. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/rust/smolpy-engine-rs/src/lib.rs +0 -0
  135. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/__init__.py +0 -0
  136. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/_worker.py +0 -0
  137. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/batch.py +0 -0
  138. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/cli.py +0 -0
  139. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/core/__init__.py +0 -0
  140. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/core/batch.py +0 -0
  141. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/core/link.py +0 -0
  142. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/core/node.py +0 -0
  143. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/core/observation.py +0 -0
  144. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/ethernet/__init__.py +0 -0
  145. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/lang/__init__.py +0 -0
  146. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/lang/errors.py +0 -0
  147. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/lang/grammar.lark +0 -0
  148. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/modbus/__init__.py +0 -0
  149. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/modbus/slave.py +0 -0
  150. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/model/__init__.py +0 -0
  151. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/model/frames.py +0 -0
  152. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/model/timebase.py +0 -0
  153. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/mqtt/__init__.py +0 -0
  154. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/mqtt/broker.py +0 -0
  155. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/profinet/__init__.py +0 -0
  156. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/profinet/device.py +0 -0
  157. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/sim/__init__.py +0 -0
  158. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/stats.py +0 -0
  159. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/viz/__init__.py +0 -0
  160. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/viz/dashboard.py +0 -0
  161. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/src/smolpy/viz/text_dashboard.py +0 -0
  162. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/__init__.py +0 -0
  163. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/equivalence/__init__.py +0 -0
  164. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/equivalence/harness.py +0 -0
  165. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/equivalence/test_equivalence.py +0 -0
  166. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/equivalence/test_rust_timebase.py +0 -0
  167. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/light_port_audit.py +0 -0
  168. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_backends.py +0 -0
  169. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_batch.py +0 -0
  170. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_buffers.py +0 -0
  171. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_cli.py +0 -0
  172. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_drain_net.py +0 -0
  173. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_dsl.py +0 -0
  174. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_engine_ir.py +0 -0
  175. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_hysteresis.py +0 -0
  176. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_ingress.py +0 -0
  177. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_lang.py +0 -0
  178. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_model.py +0 -0
  179. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_outstanding.py +0 -0
  180. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_pool.py +0 -0
  181. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_profinet.py +0 -0
  182. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_semantics.py +0 -0
  183. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_simulation.py +0 -0
  184. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_stats.py +0 -0
  185. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_sweep.py +0 -0
  186. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_switch_drop.py +0 -0
  187. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_timebase.py +0 -0
  188. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/tests/test_validate.py +0 -0
  189. {smolpy-1.17.1 → smolpy-1.17.2.dev2}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: smolpy
3
- Version: 1.17.1
3
+ Version: 1.17.2.dev2
4
4
  Summary: Network simulation DSL and discrete-event simulator
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -533,8 +533,8 @@ The model every engine implements:
533
533
  - **MAC-learning switch** — each switch pre-seeds its forwarding table from the topology wiring, eliminating spurious flooding toward silent endpoints (e.g. a server that only receives). Dynamic learning still operates for traffic through intermediate switches.
534
534
  - **Store-and-forward model** — transmission delay + propagation delay per hop.
535
535
  - **Queuing** — each link direction has its own egress queue with 8 strict 802.1Q priority classes (FIFO within a class, non-preemptive); `qos="fifo"` on a switch ignores priorities. `queue_depth` reports buffered frames at the switch's outbound ports.
536
- - **Bounded buffers** — a switch with `buffer` (per egress port) or `ingress_buffer` (per ingress port), in bytes, frames or cells, drops a frame that does not fit, with tail drop or with a resume threshold ([ADR-0014](https://jwszolek.github.io/SMOLPy/adr/0014-buffer-cells-and-hysteresis/)), and can share one pool among its ports, with a reserve each ([ADR-0015](https://jwszolek.github.io/SMOLPy/adr/0015-shared-pool-and-drain-resume/)), and one drop state for the whole switch ([ADR-0016](https://jwszolek.github.io/SMOLPy/adr/0016-switch-wide-drop-state/)), ended by its drain counted net and protecting a light port ([ADR-0017](https://jwszolek.github.io/SMOLPy/adr/0017-drain-counted-net/)): delay is capped and loss appears, as on real switches near saturation ([ADR-0011](https://jwszolek.github.io/SMOLPy/adr/0011-bounded-switch-buffers/), [ADR-0013](https://jwszolek.github.io/SMOLPy/adr/0013-ingress-buffer-accounting/)). Without them queues are unbounded.
537
- - **Traffic shaping** — constant, Poisson, Pareto-burst and batch patterns; IMIX frame-size distribution.
536
+ - **Bounded buffers** — a switch with `buffer` (per egress port) or `ingress_buffer` (per ingress port), in bytes, frames or cells, drops a frame that does not fit, with tail drop or with a resume threshold ([ADR-0014](https://jwszolek.github.io/SMOLPy/adr/0014-buffer-cells-and-hysteresis/)), and can share one pool among its ports, with a reserve each ([ADR-0015](https://jwszolek.github.io/SMOLPy/adr/0015-shared-pool-and-drain-resume/)), and one drop state for the whole switch ([ADR-0016](https://jwszolek.github.io/SMOLPy/adr/0016-switch-wide-drop-state/)), ended by its drain counted net and protecting a light port ([ADR-0017](https://jwszolek.github.io/SMOLPy/adr/0017-drain-counted-net/)), and can admit a frame only with room for the largest (`fit_min`, [ADR-0018](https://jwszolek.github.io/SMOLPy/adr/0018-three-switches/)); three switches calibrated on a testbed are documented in [Switch profiles](https://jwszolek.github.io/SMOLPy/switch-profiles/): delay is capped and loss appears, as on real switches near saturation ([ADR-0011](https://jwszolek.github.io/SMOLPy/adr/0011-bounded-switch-buffers/), [ADR-0013](https://jwszolek.github.io/SMOLPy/adr/0013-ingress-buffer-accounting/)). Without them queues are unbounded.
537
+ - **Traffic shaping** — constant, Poisson, Pareto-burst and batch patterns; IMIX frame-size distribution; `phase="random"` starts a periodic source at a phase per seed ([ADR-0018](https://jwszolek.github.io/SMOLPy/adr/0018-three-switches/)).
538
538
  - **Live mode** (SimPy only) — simulation runs in 200 chunks (~8 s total wall time); the dashboard reads shared metric arrays between chunks via Python's GIL.
539
539
 
540
540
  ---
@@ -505,8 +505,8 @@ The model every engine implements:
505
505
  - **MAC-learning switch** — each switch pre-seeds its forwarding table from the topology wiring, eliminating spurious flooding toward silent endpoints (e.g. a server that only receives). Dynamic learning still operates for traffic through intermediate switches.
506
506
  - **Store-and-forward model** — transmission delay + propagation delay per hop.
507
507
  - **Queuing** — each link direction has its own egress queue with 8 strict 802.1Q priority classes (FIFO within a class, non-preemptive); `qos="fifo"` on a switch ignores priorities. `queue_depth` reports buffered frames at the switch's outbound ports.
508
- - **Bounded buffers** — a switch with `buffer` (per egress port) or `ingress_buffer` (per ingress port), in bytes, frames or cells, drops a frame that does not fit, with tail drop or with a resume threshold ([ADR-0014](https://jwszolek.github.io/SMOLPy/adr/0014-buffer-cells-and-hysteresis/)), and can share one pool among its ports, with a reserve each ([ADR-0015](https://jwszolek.github.io/SMOLPy/adr/0015-shared-pool-and-drain-resume/)), and one drop state for the whole switch ([ADR-0016](https://jwszolek.github.io/SMOLPy/adr/0016-switch-wide-drop-state/)), ended by its drain counted net and protecting a light port ([ADR-0017](https://jwszolek.github.io/SMOLPy/adr/0017-drain-counted-net/)): delay is capped and loss appears, as on real switches near saturation ([ADR-0011](https://jwszolek.github.io/SMOLPy/adr/0011-bounded-switch-buffers/), [ADR-0013](https://jwszolek.github.io/SMOLPy/adr/0013-ingress-buffer-accounting/)). Without them queues are unbounded.
509
- - **Traffic shaping** — constant, Poisson, Pareto-burst and batch patterns; IMIX frame-size distribution.
508
+ - **Bounded buffers** — a switch with `buffer` (per egress port) or `ingress_buffer` (per ingress port), in bytes, frames or cells, drops a frame that does not fit, with tail drop or with a resume threshold ([ADR-0014](https://jwszolek.github.io/SMOLPy/adr/0014-buffer-cells-and-hysteresis/)), and can share one pool among its ports, with a reserve each ([ADR-0015](https://jwszolek.github.io/SMOLPy/adr/0015-shared-pool-and-drain-resume/)), and one drop state for the whole switch ([ADR-0016](https://jwszolek.github.io/SMOLPy/adr/0016-switch-wide-drop-state/)), ended by its drain counted net and protecting a light port ([ADR-0017](https://jwszolek.github.io/SMOLPy/adr/0017-drain-counted-net/)), and can admit a frame only with room for the largest (`fit_min`, [ADR-0018](https://jwszolek.github.io/SMOLPy/adr/0018-three-switches/)); three switches calibrated on a testbed are documented in [Switch profiles](https://jwszolek.github.io/SMOLPy/switch-profiles/): delay is capped and loss appears, as on real switches near saturation ([ADR-0011](https://jwszolek.github.io/SMOLPy/adr/0011-bounded-switch-buffers/), [ADR-0013](https://jwszolek.github.io/SMOLPy/adr/0013-ingress-buffer-accounting/)). Without them queues are unbounded.
509
+ - **Traffic shaping** — constant, Poisson, Pareto-burst and batch patterns; IMIX frame-size distribution; `phase="random"` starts a periodic source at a phase per seed ([ADR-0018](https://jwszolek.github.io/SMOLPy/adr/0018-three-switches/)).
510
510
  - **Live mode** (SimPy only) — simulation runs in 200 chunks (~8 s total wall time); the dashboard reads shared metric arrays between chunks via Python's GIL.
511
511
 
512
512
  ---
@@ -21,6 +21,8 @@ python -m benchmarks switch-drop [--duration 60000] [--backend simpy rust ns3]
21
21
  python -m benchmarks switch-drop-summary benchmarks/results/<file>.json
22
22
  python -m benchmarks light-port [--duration 56000] [--seeds 1 2 3]
23
23
  python -m benchmarks light-port-summary benchmarks/results/<file>.json
24
+ python -m benchmarks switches [--switch xb005 phoenix ls108gp] [--duration 60000] [--seeds 1 2 3]
25
+ python -m benchmarks switches-summary benchmarks/results/<file>.json
24
26
  """
25
27
 
26
28
  from __future__ import annotations
@@ -32,7 +34,16 @@ import subprocess
32
34
  import sys
33
35
  from pathlib import Path
34
36
 
35
- from benchmarks import cells, closed_loop, ingress, light_port, loss, pool, switch_drop
37
+ from benchmarks import (
38
+ cells,
39
+ closed_loop,
40
+ ingress,
41
+ light_port,
42
+ loss,
43
+ pool,
44
+ switch_drop,
45
+ switches,
46
+ )
36
47
  from benchmarks.load import DURATION_MS, LOADS, run_load, summarize_load
37
48
  from benchmarks.runner import parse_size, run_batch, run_suite, size_label, summarize
38
49
 
@@ -192,6 +203,20 @@ def main() -> None:
192
203
  lp_summ = sub.add_parser("light-port-summary", help="markdown tables of a light-port file")
193
204
  lp_summ.add_argument("file", type=Path)
194
205
 
206
+ sws = sub.add_parser(
207
+ "switches", help="ADR-0018: three switches' documented parameters against the hardware"
208
+ )
209
+ sws.add_argument(
210
+ "--switch", nargs="+", default=list(switches.PROFILES), choices=list(switches.PROFILES)
211
+ )
212
+ sws.add_argument("--duration", type=float, default=switches.DURATION_MS, help="ms per run")
213
+ sws.add_argument("--seeds", type=int, nargs="+", default=list(switches.SEEDS))
214
+ sws.add_argument("--label", default="switches")
215
+ sws.add_argument("--out", type=Path, default=None)
216
+
217
+ sws_summ = sub.add_parser("switches-summary", help="markdown tables of a switches file")
218
+ sws_summ.add_argument("file", type=Path)
219
+
195
220
  a = p.parse_args()
196
221
  if a.cmd == "run":
197
222
  sizes = [parse_size(s) for s in a.frames]
@@ -254,6 +279,12 @@ def main() -> None:
254
279
  print(light_port.summarize(out))
255
280
  elif a.cmd == "light-port-summary":
256
281
  print(light_port.summarize(a.file))
282
+ elif a.cmd == "switches":
283
+ out = switches.run_switches(a.switch, a.duration, tuple(a.seeds), a.label, a.out)
284
+ print(f"results written to {out}")
285
+ print(switches.summarize(out))
286
+ elif a.cmd == "switches-summary":
287
+ print(switches.summarize(a.file))
257
288
  elif a.cmd == "batch":
258
289
  frames = parse_size(a.frames)
259
290
  r = run_batch(a.scenario, frames, a.metrics, a.runs, a.jobs, a.timeout, a.seed, a.backend)
@@ -49,10 +49,14 @@ from smolpy import Cells, Network, backends
49
49
  from smolpy.model import Scenario
50
50
  from smolpy.model import timebase as tb
51
51
  from smolpy.model.frames import WIRE_OVERHEAD_BYTES
52
+ from smolpy.model.scenario import Phase
52
53
 
53
54
  DATA = cells.DATA
54
55
  CELL = 128
55
56
  FRAME = 1_518
57
+ # the testbed's poll timeout: Linux's TCP_RTO_MIN, after which TCP
58
+ # retransmits a lost response, at about 215 ms on the hardware (ADR-0018)
59
+ TIMEOUT_MS = 200
56
60
  FIRST = (710, 30, 72) # P, R, D in cells: ADR-0015's first estimates
57
61
  L_GRID = tuple(range(730, 801, 10))
58
62
  D_GRID = (36, 48, 60, 72, 84, 96)
@@ -396,9 +400,19 @@ def testbed(
396
400
  poll_ms: float = 10,
397
401
  registers: int = 10,
398
402
  waveshare: bool = True,
403
+ *,
404
+ pi_mbps: float = 1_000,
405
+ timeout_ms: float = TIMEOUT_MS,
406
+ phase: Phase = "random",
399
407
  ) -> Scenario:
400
408
  """The testbed: each Pi a Modbus slave with its flows (rate, size,
401
- pattern), the Waveshare, and the laptop polling them."""
409
+ pattern), the Waveshare, and the laptop polling them.
410
+
411
+ The Pis and the Waveshare are linked at *pi_mbps*: 1 000 Mb/s on the
412
+ LS108GP, 100 on the XB005 and the Phoenix. The polls time out after
413
+ *timeout_ms*, Linux's minimum RTO, where TCP retransmits a lost
414
+ response, and the polls and constant flows start at a random *phase*
415
+ per seed, as the hardware's sources do (ADR-0018 Part 2)."""
402
416
  net = Network("LS108GP")
403
417
  sw = net.switch("sw", ports=2 + len(pis), **kw)
404
418
  nodes = [
@@ -407,14 +421,16 @@ def testbed(
407
421
  ws = net.modbus_slave("waveshare", ip="10.0.0.9", unit_id=1) if waveshare else None
408
422
  laptop = net.adapter("laptop", ip="10.0.0.100")
409
423
  for node in nodes:
410
- net.link(node, sw, speed=1_000, length=2)
424
+ net.link(node, sw, speed=pi_mbps, length=2)
411
425
  if ws is not None:
412
- net.link(ws, sw, speed=1_000, length=2)
426
+ net.link(ws, sw, speed=pi_mbps, length=2)
413
427
  net.link(laptop, sw, speed=laptop_mbps, length=2)
414
428
  for node, flows in zip(nodes, pis, strict=True):
415
429
  for rate, size, pattern in flows:
416
430
  if pattern.startswith("batch"):
417
431
  node.sends(laptop, rate=rate, size=size, pattern="batch", batch=int(pattern[5:]))
432
+ elif pattern == "constant":
433
+ node.sends(laptop, rate=rate, size=size, pattern=pattern, phase=phase)
418
434
  else:
419
435
  node.sends(laptop, rate=rate, size=size, pattern=pattern)
420
436
  servers = [(n, 1000 / poll_ms, registers) for n in nodes]
@@ -422,7 +438,15 @@ def testbed(
422
438
  servers.append((ws, 50, 1))
423
439
  end = duration_ms - 1
424
440
  for node, rate, count in servers:
425
- laptop.polls(node, register=0, count=count, rate=rate, outstanding=1, timeout_ms=1_000)
441
+ laptop.polls(
442
+ node,
443
+ register=0,
444
+ count=count,
445
+ rate=rate,
446
+ outstanding=1,
447
+ timeout_ms=timeout_ms,
448
+ phase=phase,
449
+ )
426
450
  net.observe("modbus_latency", on=node, every=1)
427
451
  for m in ("modbus_unanswered", "modbus_skipped", "modbus_timeouts"):
428
452
  net.observe(m, on=node, every=end)