smolpy 1.8.2.dev8__tar.gz → 1.9.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/.github/workflows/dev-build.yml +1 -0
  2. smolpy-1.9.0/.github/workflows/docker-image.yml +152 -0
  3. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/.github/workflows/publish.yml +15 -1
  4. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/.github/workflows/release.yml +1 -0
  5. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/PKG-INFO +14 -4
  6. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/README.md +13 -3
  7. smolpy-1.9.0/docker/Dockerfile +36 -0
  8. smolpy-1.9.0/docker/Dockerfile.dockerignore +3 -0
  9. smolpy-1.9.0/docker/smoke.smol +30 -0
  10. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/adr/0004-execution-backends.md +2 -0
  11. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/adr/0008-rust-des-engine-mvp.md +1 -1
  12. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/dsl-reference.md +10 -3
  13. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/roadmap.md +14 -5
  14. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/rust/smol-engine/src/frames.rs +12 -0
  15. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/rust/smol-engine/src/scenario.rs +73 -13
  16. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/rust/smol-engine/src/sim.rs +330 -4
  17. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/rust/smolpy-engine-rs/README.md +3 -2
  18. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/rust/smolpy-engine-rs/smoke_test.py +15 -4
  19. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/tests/equivalence/scenarios.py +41 -8
  20. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/.github/workflows/ci.yml +0 -0
  21. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/.github/workflows/docs.yml +0 -0
  22. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/.github/workflows/github-release.yml +0 -0
  23. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/.github/workflows/rust-wheels.yml +0 -0
  24. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/.gitignore +0 -0
  25. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/LICENSE +0 -0
  26. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/benchmarks/__init__.py +0 -0
  27. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/benchmarks/__main__.py +0 -0
  28. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/benchmarks/results/2026-11-13-0921-simpy-jaws-zbook-baseline.json +0 -0
  29. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/benchmarks/results/2026-11-13-1527-simpy-jaws-zbook-optimised.json +0 -0
  30. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/benchmarks/results/2026-11-13-2116-simpy-jaws-zbook-research-batch.json +0 -0
  31. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/benchmarks/results/2026-11-13-2119-simpy-jaws-zbook-research-b4.json +0 -0
  32. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/benchmarks/results/2026-11-15-1255-rust-jaws-zbook-stop-criterion.json +0 -0
  33. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/benchmarks/results/2026-11-15-1333-rust-jaws-zbook-research-b4.json +0 -0
  34. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/benchmarks/results/2026-11-15-1346-rust-jaws-zbook-research-batch.json +0 -0
  35. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/benchmarks/runner.py +0 -0
  36. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/benchmarks/scenarios.py +0 -0
  37. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/benchmarks/worker.py +0 -0
  38. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/adr/0001-protocol-package-structure.md +0 -0
  39. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/adr/0002-modbus-tcp-implementation.md +0 -0
  40. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/adr/0003-smol-external-dsl.md +0 -0
  41. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/adr/0005-profinet-rt.md +0 -0
  42. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/adr/0006-profiling-and-baseline-benchmark.md +0 -0
  43. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/adr/0007-execution-independent-scenario-model.md +0 -0
  44. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/adr/0009-batch-execution-and-cross-backend-validation.md +0 -0
  45. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/adr/0010-ethernet-frames-on-the-wire.md +0 -0
  46. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/benchmarks.md +0 -0
  47. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/dashboard.md +0 -0
  48. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/examples.md +0 -0
  49. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/index.md +0 -0
  50. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/language-reference.md +0 -0
  51. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/modbus.md +0 -0
  52. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/model-semantics.md +0 -0
  53. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/mqtt.md +0 -0
  54. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/profinet.md +0 -0
  55. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/scenario-model.md +0 -0
  56. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/docs/simulation-engine.md +0 -0
  57. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/examples/README.md +0 -0
  58. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/examples/example.py +0 -0
  59. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/examples/example.smol +0 -0
  60. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/examples/example_10_clients.py +0 -0
  61. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/examples/example_12_clients.py +0 -0
  62. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/examples/example_20_clients.py +0 -0
  63. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/examples/example_file_transfer.py +0 -0
  64. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/examples/example_modbus.py +0 -0
  65. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/examples/example_mqtt.py +0 -0
  66. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/examples/example_profinet.py +0 -0
  67. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/examples/example_profinet.smol +0 -0
  68. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/examples/example_staggered_transfer.py +0 -0
  69. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/examples/example_two_tier.py +0 -0
  70. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/mkdocs.yml +0 -0
  71. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/pyproject.toml +0 -0
  72. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/rust/Cargo.lock +0 -0
  73. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/rust/Cargo.toml +0 -0
  74. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/rust/smol-engine/Cargo.toml +0 -0
  75. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/rust/smol-engine/src/lib.rs +0 -0
  76. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/rust/smol-engine/src/rng.rs +0 -0
  77. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/rust/smol-engine/src/timebase.rs +0 -0
  78. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/rust/smolpy-engine-rs/Cargo.toml +0 -0
  79. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/rust/smolpy-engine-rs/pyproject.toml +0 -0
  80. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/rust/smolpy-engine-rs/src/lib.rs +0 -0
  81. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/__init__.py +0 -0
  82. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/_worker.py +0 -0
  83. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/backends.py +0 -0
  84. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/batch.py +0 -0
  85. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/cli.py +0 -0
  86. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/core/__init__.py +0 -0
  87. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/core/adapter.py +0 -0
  88. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/core/batch.py +0 -0
  89. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/core/link.py +0 -0
  90. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/core/network.py +0 -0
  91. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/core/node.py +0 -0
  92. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/core/observation.py +0 -0
  93. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/ethernet/__init__.py +0 -0
  94. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/ethernet/switch.py +0 -0
  95. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/lang/__init__.py +0 -0
  96. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/lang/ast.py +0 -0
  97. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/lang/errors.py +0 -0
  98. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/lang/grammar.lark +0 -0
  99. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/lang/interpreter.py +0 -0
  100. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/lang/transformer.py +0 -0
  101. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/modbus/__init__.py +0 -0
  102. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/modbus/slave.py +0 -0
  103. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/model/__init__.py +0 -0
  104. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/model/frames.py +0 -0
  105. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/model/scenario.py +0 -0
  106. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/model/streams.py +0 -0
  107. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/model/timebase.py +0 -0
  108. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/model/validate.py +0 -0
  109. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/mqtt/__init__.py +0 -0
  110. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/mqtt/broker.py +0 -0
  111. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/profinet/__init__.py +0 -0
  112. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/profinet/device.py +0 -0
  113. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/sim/__init__.py +0 -0
  114. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/sim/engine.py +0 -0
  115. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/stats.py +0 -0
  116. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/viz/__init__.py +0 -0
  117. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/viz/dashboard.py +0 -0
  118. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/src/smolpy/viz/text_dashboard.py +0 -0
  119. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/tests/__init__.py +0 -0
  120. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/tests/equivalence/__init__.py +0 -0
  121. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/tests/equivalence/harness.py +0 -0
  122. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/tests/equivalence/test_equivalence.py +0 -0
  123. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/tests/equivalence/test_rust_timebase.py +0 -0
  124. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/tests/test_backends.py +0 -0
  125. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/tests/test_batch.py +0 -0
  126. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/tests/test_benchmarks.py +0 -0
  127. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/tests/test_cli.py +0 -0
  128. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/tests/test_dsl.py +0 -0
  129. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/tests/test_engine_ir.py +0 -0
  130. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/tests/test_lang.py +0 -0
  131. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/tests/test_model.py +0 -0
  132. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/tests/test_profinet.py +0 -0
  133. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/tests/test_semantics.py +0 -0
  134. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/tests/test_simulation.py +0 -0
  135. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/tests/test_stats.py +0 -0
  136. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/tests/test_sweep.py +0 -0
  137. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/tests/test_timebase.py +0 -0
  138. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/tests/test_validate.py +0 -0
  139. {smolpy-1.8.2.dev8 → smolpy-1.9.0}/uv.lock +0 -0
@@ -28,3 +28,4 @@ jobs:
28
28
  permissions:
29
29
  id-token: write # PyPI trusted publishing
30
30
  contents: write # the GitHub pre-release
31
+ packages: write # granted because publish.yml's image job asks for it; it runs at releases only
@@ -0,0 +1,152 @@
1
+ name: Docker image
2
+
3
+ # The image without ns-3, ghcr.io/jwszolek/smolpy (ADR-0004, Container
4
+ # images): Python, smolpy and smolpy-engine-rs for linux/amd64 and
5
+ # linux/arm64, installed from the wheels of one version. Every image is tested
6
+ # before anything is pushed: the wheel smoke test (bit-exact with SimPy) and a
7
+ # .smol run through the CLI.
8
+ #
9
+ # - Called by publish.yml at a release, once both packages are on PyPI: uses
10
+ # the files of the same run and pushes <version> and latest.
11
+ # - On a pull request that touches the image: builds the wheels here, for
12
+ # linux/amd64 only, tests that image and pushes nothing.
13
+
14
+ on:
15
+ pull_request:
16
+ paths:
17
+ - "docker/**"
18
+ - ".github/workflows/docker-image.yml"
19
+ workflow_call:
20
+ inputs:
21
+ version:
22
+ description: The release version, e.g. 1.9.0
23
+ required: true
24
+ type: string
25
+ ref:
26
+ description: The release tag, e.g. v1.9.0
27
+ required: true
28
+ type: string
29
+
30
+ jobs:
31
+ image:
32
+ name: ${{ inputs.version && format('Image {0}', inputs.version) || 'Image (test build)' }}
33
+ runs-on: ubuntu-latest
34
+ permissions:
35
+ contents: read
36
+ packages: write # push to ghcr.io
37
+
38
+ env:
39
+ IMAGE: ghcr.io/${{ github.repository_owner }}/smolpy
40
+ RELEASE: ${{ inputs.version && 'true' || 'false' }} # no inputs on a pull request
41
+
42
+ steps:
43
+ - uses: actions/checkout@v4
44
+ with:
45
+ ref: ${{ inputs.ref }}
46
+ fetch-depth: 0 # hatch-vcs numbers a test build from git
47
+
48
+ # --- a release: the files the calling run has published ---
49
+
50
+ - name: Download smolpy
51
+ if: ${{ env.RELEASE == 'true' }}
52
+ uses: actions/download-artifact@v4
53
+ with:
54
+ name: dist
55
+ path: dist/
56
+
57
+ - name: Download smolpy-engine-rs
58
+ if: ${{ env.RELEASE == 'true' }}
59
+ uses: actions/download-artifact@v4
60
+ with:
61
+ pattern: engine-*
62
+ merge-multiple: true
63
+ path: dist/
64
+
65
+ # --- a pull request: both wheels built here, with one version ---
66
+
67
+ - name: Install uv
68
+ if: ${{ env.RELEASE != 'true' }}
69
+ uses: astral-sh/setup-uv@v4
70
+ with:
71
+ version: "latest"
72
+
73
+ - name: Build smolpy and number the engine alike
74
+ if: ${{ env.RELEASE != 'true' }}
75
+ run: |
76
+ uv build --wheel
77
+ wheels=(dist/smolpy-*.whl) # smolpy-<version>-py3-none-any.whl
78
+ VERSION=$(basename "${wheels[0]}" | cut -d- -f2)
79
+ CARGO_VERSION=$(echo "$VERSION" | sed -E 's/\.dev([0-9]+)$/-dev.\1/')
80
+ sed -i "s/^dynamic = \[\"version\"\]$/version = \"$VERSION\"/" rust/smolpy-engine-rs/pyproject.toml
81
+ sed -i "s/^version = \"[^\"]*\"$/version = \"$CARGO_VERSION\"/" rust/Cargo.toml
82
+ echo "Test build of version $VERSION"
83
+
84
+ - name: Build smolpy-engine-rs
85
+ if: ${{ env.RELEASE != 'true' }}
86
+ uses: PyO3/maturin-action@v1
87
+ with:
88
+ target: x86_64
89
+ manylinux: auto
90
+ args: --release --out dist -m rust/smolpy-engine-rs/Cargo.toml
91
+
92
+ # --- the image ---
93
+
94
+ - name: Version
95
+ id: v
96
+ env:
97
+ VERSION: ${{ inputs.version }}
98
+ run: |
99
+ if [ -z "$VERSION" ]; then
100
+ wheels=(dist/smolpy-*.whl)
101
+ VERSION=$(basename "${wheels[0]}" | cut -d- -f2)
102
+ fi
103
+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
104
+ ls dist/
105
+
106
+ - name: Set up QEMU, for linux/arm64
107
+ if: ${{ env.RELEASE == 'true' }}
108
+ uses: docker/setup-qemu-action@v3
109
+
110
+ - uses: docker/setup-buildx-action@v3
111
+
112
+ - name: Build and test each platform
113
+ env:
114
+ VERSION: ${{ steps.v.outputs.version }}
115
+ PLATFORMS: ${{ env.RELEASE == 'true' && 'linux/amd64 linux/arm64' || 'linux/amd64' }}
116
+ run: |
117
+ for platform in $PLATFORMS; do
118
+ echo "::group::$platform"
119
+ docker buildx build --platform "$platform" --load \
120
+ --build-arg VERSION="$VERSION" -f docker/Dockerfile -t smolpy:test .
121
+ docker run --rm --platform "$platform" smolpy:test --help
122
+ # the wheel smoke test: bit-exact with SimPy on this platform
123
+ docker run --rm --platform "$platform" -v "$PWD/rust/smolpy-engine-rs:/test:ro" \
124
+ --entrypoint python smolpy:test /test/smoke_test.py
125
+ # the CLI, as a user runs it, writing to the mounted directory
126
+ mkdir -p out && chmod 777 out
127
+ cp docker/smoke.smol out/
128
+ docker run --rm --platform "$platform" -v "$PWD/out:/work" \
129
+ smolpy:test run smoke.smol --backend rust -o results.csv
130
+ grep -q "pn_latency:plc" out/results.csv
131
+ rm -rf out
132
+ echo "::endgroup::"
133
+ done
134
+
135
+ - name: Log in to ghcr.io
136
+ if: ${{ env.RELEASE == 'true' }}
137
+ uses: docker/login-action@v3
138
+ with:
139
+ registry: ghcr.io
140
+ username: ${{ github.actor }}
141
+ password: ${{ secrets.GITHUB_TOKEN }}
142
+
143
+ # the platforms tested above, rebuilt from the build cache
144
+ - name: Push
145
+ if: ${{ env.RELEASE == 'true' }}
146
+ env:
147
+ VERSION: ${{ steps.v.outputs.version }}
148
+ run: |
149
+ docker buildx build --platform linux/amd64,linux/arm64 --push \
150
+ --build-arg VERSION="$VERSION" -f docker/Dockerfile \
151
+ -t "$IMAGE:$VERSION" -t "$IMAGE:latest" .
152
+ echo "Pushed $IMAGE:$VERSION and $IMAGE:latest" >> "$GITHUB_STEP_SUMMARY"
@@ -4,7 +4,8 @@ name: Publish to PyPI
4
4
  #
5
5
  # - Release (a pushed tag v*, or release.yml passing its tag): publishes
6
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.
7
+ # version, then the GitHub Release with every file and the Docker image
8
+ # ghcr.io/jwszolek/smolpy:<version> (docker-image.yml).
8
9
  # - Development build (dev-build.yml, dev: true, after a merge to main):
9
10
  # publishes both to PyPI as X.Y.(Z+1).devN, N commits after the latest tag,
10
11
  # a pre-release that pip installs only with --pre, and replaces the GitHub
@@ -192,6 +193,19 @@ jobs:
192
193
  tag: ${{ needs.version.outputs.tag }}
193
194
  engine: ${{ needs.publish-engine.result == 'success' }}
194
195
 
196
+ image:
197
+ name: Docker image
198
+ needs: [version, publish, publish-engine]
199
+ # from the files just published, so only once both packages are on PyPI
200
+ if: ${{ needs.version.outputs.mode == 'release' }}
201
+ permissions:
202
+ contents: read
203
+ packages: write # push to ghcr.io
204
+ uses: ./.github/workflows/docker-image.yml
205
+ with:
206
+ version: ${{ needs.version.outputs.version }}
207
+ ref: ${{ needs.version.outputs.tag }}
208
+
195
209
  dev-release:
196
210
  name: GitHub pre-release "Development build"
197
211
  needs: [version, publish, publish-engine]
@@ -64,3 +64,4 @@ jobs:
64
64
  permissions:
65
65
  id-token: write # PyPI trusted publishing
66
66
  contents: write # the GitHub Release
67
+ packages: write # the Docker image on ghcr.io
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: smolpy
3
- Version: 1.8.2.dev8
3
+ Version: 1.9.0
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
 
@@ -89,6 +89,16 @@ pip install --pre "smolpy[rust]" # the latest development build of main
89
89
  - **Where it is on GitHub.** The [Development build](https://github.com/jwszolek/SMOLPy/releases/tag/dev) pre-release points to its commit.
90
90
  - **Releases proper** are made by hand.
91
91
 
92
+ **Without Python,** from the Docker image of each release, which has SMOLPy and the Rust engine for `linux/amd64` and `linux/arm64`:
93
+
94
+ ```bash
95
+ docker run --rm -v "$PWD:/work" ghcr.io/jwszolek/smolpy run plant.smol --backend rust -o results.csv
96
+ ```
97
+
98
+ - The image runs headless: the live dashboard needs a display, so a `.smol` file needs `mode=headless` or `mode=text`.
99
+ - It runs as uid 1000. To own the files it writes as yourself, add `--user "$(id -u):$(id -g)"`.
100
+ - A version is pinned as `ghcr.io/jwszolek/smolpy:<version>`; `latest` is the latest release.
101
+
92
102
  From a clone, for development:
93
103
 
94
104
  ```bash
@@ -471,7 +481,7 @@ Every simulation goes through the same path. The Python API and `.smol` files bu
471
481
  | Backend | Language | What it runs | Speed | Install |
472
482
  |---|---|---|---|---|
473
483
  | `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) |
484
+ | `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
485
 
476
486
  ```python
477
487
  result = net.simulate(duration=60_000, backend="rust") # one run
@@ -483,7 +493,7 @@ smolpy run plant.smol --backend rust
483
493
  ```
484
494
 
485
495
  - **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.
496
+ - **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
497
 
488
498
  The model both engines implement:
489
499
 
@@ -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
 
@@ -61,6 +61,16 @@ pip install --pre "smolpy[rust]" # the latest development build of main
61
61
  - **Where it is on GitHub.** The [Development build](https://github.com/jwszolek/SMOLPy/releases/tag/dev) pre-release points to its commit.
62
62
  - **Releases proper** are made by hand.
63
63
 
64
+ **Without Python,** from the Docker image of each release, which has SMOLPy and the Rust engine for `linux/amd64` and `linux/arm64`:
65
+
66
+ ```bash
67
+ docker run --rm -v "$PWD:/work" ghcr.io/jwszolek/smolpy run plant.smol --backend rust -o results.csv
68
+ ```
69
+
70
+ - The image runs headless: the live dashboard needs a display, so a `.smol` file needs `mode=headless` or `mode=text`.
71
+ - It runs as uid 1000. To own the files it writes as yourself, add `--user "$(id -u):$(id -g)"`.
72
+ - A version is pinned as `ghcr.io/jwszolek/smolpy:<version>`; `latest` is the latest release.
73
+
64
74
  From a clone, for development:
65
75
 
66
76
  ```bash
@@ -443,7 +453,7 @@ Every simulation goes through the same path. The Python API and `.smol` files bu
443
453
  | Backend | Language | What it runs | Speed | Install |
444
454
  |---|---|---|---|---|
445
455
  | `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) |
456
+ | `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
457
 
448
458
  ```python
449
459
  result = net.simulate(duration=60_000, backend="rust") # one run
@@ -455,7 +465,7 @@ smolpy run plant.smol --backend rust
455
465
  ```
456
466
 
457
467
  - **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.
468
+ - **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
469
 
460
470
  The model both engines implement:
461
471
 
@@ -0,0 +1,36 @@
1
+ # SMOLPy with the Rust engine, without ns-3: ghcr.io/jwszolek/smolpy
2
+ # (ADR-0004, Container images). Built by .github/workflows/docker-image.yml.
3
+ #
4
+ # The build context holds only dist/, with the wheels of one version of
5
+ # smolpy and smolpy-engine-rs: a release's own files, or a pull request's.
6
+ # pip picks the engine wheel of the platform being built.
7
+ #
8
+ # docker run --rm -v "$PWD:/work" ghcr.io/jwszolek/smolpy run plant.smol --backend rust
9
+
10
+ FROM python:3.12-slim-bookworm
11
+
12
+ ARG VERSION
13
+
14
+ LABEL org.opencontainers.image.title="SMOLPy" \
15
+ org.opencontainers.image.description="Network simulation DSL and discrete-event simulator, with the Rust engine (without ns-3)" \
16
+ org.opencontainers.image.source="https://github.com/jwszolek/SMOLPy" \
17
+ org.opencontainers.image.documentation="https://jwszolek.github.io/SMOLPy/" \
18
+ org.opencontainers.image.licenses="MIT" \
19
+ org.opencontainers.image.version="${VERSION}"
20
+
21
+ # both packages pinned to the version, so pip takes them from dist/; their
22
+ # dependencies come from PyPI
23
+ RUN --mount=type=bind,source=dist,target=/dist \
24
+ test -n "${VERSION}" \
25
+ && pip install --no-cache-dir --find-links /dist \
26
+ "smolpy[rust]==${VERSION}" "smolpy-engine-rs==${VERSION}" \
27
+ && python -c "import smolpy_engine_rs; assert smolpy_engine_rs.__version__ == '${VERSION}'"
28
+
29
+ # not root: files written to the mounted directory belong to uid 1000, or to
30
+ # whoever `docker run --user` names
31
+ RUN useradd --create-home --uid 1000 smolpy
32
+ USER 1000
33
+ WORKDIR /work
34
+
35
+ ENTRYPOINT ["smolpy"]
36
+ CMD ["--help"]
@@ -0,0 +1,3 @@
1
+ # The image is built from the repository root, but needs only the wheels.
2
+ *
3
+ !dist/
@@ -0,0 +1,30 @@
1
+ # Run by CI in every image it builds: the CLI, a .smol file and the Rust
2
+ # engine, with every protocol, writing its results to the mounted directory.
3
+
4
+ network "image-smoke" {
5
+
6
+ switch sw ports=6
7
+ adapter plc ip=10.0.0.1
8
+ adapter hmi ip=10.0.0.2
9
+ mqtt_broker broker ip=10.0.0.3
10
+ modbus_slave meter ip=10.0.0.4 unit_id=1
11
+ profinet_device io ip=10.0.0.5
12
+
13
+ link plc -- sw speed=100 length=10
14
+ link hmi -- sw speed=100 length=10
15
+ link broker -- sw speed=100 length=10
16
+ link meter -- sw speed=100 length=10
17
+ link io -- sw speed=100 length=10
18
+
19
+ flow plc -> hmi rate=2000 size=512
20
+ poll plc -> meter register=0 count=10 rate=100
21
+ route broker topic="plant/t" -> [hmi]
22
+ publish plc -> broker topic="plant/t" rate=100 qos=1
23
+ control plc -> io cycle=2 inputs=20 outputs=20
24
+
25
+ observe throughput on hmi every=10
26
+ observe modbus_latency on plc every=10
27
+ observe pn_latency on plc every=10
28
+
29
+ simulate duration=100 mode=headless
30
+ }
@@ -174,6 +174,8 @@ The ns-3 suite is skipped automatically when ns-3 is not available, and runs in
174
174
 
175
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
176
 
177
+ *As built (2026-11-16):* the image without ns-3 is `docker/Dockerfile`, built by `.github/workflows/docker-image.yml`. Each release, `publish.yml` calls it once both packages are on PyPI. It tests the image of each platform with the wheel smoke test and a `.smol` run through the CLI before it pushes `<version>` and `latest`. A pull request that changes the image builds and tests it for `linux/amd64` and pushes nothing. The image runs as uid 1000, not as root.
178
+
177
179
  **Registry and images.** The images are published to the GitHub Container Registry, `ghcr.io/jwszolek/smolpy`, public, for `linux/amd64` and `linux/arm64`:
178
180
 
179
181
  | Tag | Contents | Size | From |
@@ -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
 
@@ -168,6 +172,11 @@ A code-generated ns-3 scenario from the Scenario IR. Gives a realistic TCP/IP st
168
172
 
169
173
  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`.
170
174
 
175
+ **Status:** step 1 of 3 done.
176
+ 1. **The image without ns-3: done.** `ghcr.io/jwszolek/smolpy:<version>` holds SMOLPy and the Rust engine, for `linux/amd64` and `linux/arm64`. It is built, tested and pushed at each release.
177
+ 2. **The ns-3 base image.** It holds the pinned ns-3 release, built once.
178
+ 3. **The ns-3 backend.** It generates the scenario, adds the SMOL C++ module and runs the equivalence suite in CI.
179
+
171
180
  **Exit criteria:**
172
181
 
173
182
  - Low-load scenarios agree with SimPy and Rust.
@@ -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);