benchset 0.0.8__tar.gz → 0.0.10__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.
- {benchset-0.0.8 → benchset-0.0.10}/Cargo.lock +1 -1
- {benchset-0.0.8 → benchset-0.0.10}/Cargo.toml +2 -2
- {benchset-0.0.8 → benchset-0.0.10}/PKG-INFO +136 -42
- {benchset-0.0.8 → benchset-0.0.10}/Package.swift +2 -2
- {benchset-0.0.8 → benchset-0.0.10}/README.md +134 -40
- {benchset-0.0.8 → benchset-0.0.10}/Sources/Benchset/Benchset.swift +24 -10
- {benchset-0.0.8 → benchset-0.0.10}/benchset/__init__.py +3 -1
- benchset-0.0.10/benchset/_metadata.json +1 -0
- {benchset-0.0.8 → benchset-0.0.10}/benchset/_metadata.py +10 -1
- {benchset-0.0.8 → benchset-0.0.10}/benchset/_native.py +67 -29
- benchset-0.0.10/benchset/_signal_state.py +177 -0
- {benchset-0.0.8 → benchset-0.0.10}/benchset/api.py +14 -6
- {benchset-0.0.8 → benchset-0.0.10}/benchset/cli.py +8 -3
- benchset-0.0.10/benchset/models.py +147 -0
- {benchset-0.0.8 → benchset-0.0.10}/benchset/reference.py +12 -10
- {benchset-0.0.8 → benchset-0.0.10}/benchset.egg-info/PKG-INFO +136 -42
- {benchset-0.0.8 → benchset-0.0.10}/benchset.egg-info/SOURCES.txt +5 -0
- {benchset-0.0.8 → benchset-0.0.10}/include/benchset.h +18 -6
- {benchset-0.0.8 → benchset-0.0.10}/native/build.rs +36 -14
- benchset-0.0.10/native/reference-calibration.json +244 -0
- {benchset-0.0.8 → benchset-0.0.10}/native/src/aggregate_protocol_tests.rs +3 -1
- {benchset-0.0.8 → benchset-0.0.10}/native/src/aggregation_ffi.rs +42 -39
- benchset-0.0.10/native/src/catalog.rs +58 -0
- {benchset-0.0.8 → benchset-0.0.10}/native/src/config_ffi.rs +37 -8
- {benchset-0.0.8 → benchset-0.0.10}/native/src/config_ffi_tests.rs +27 -17
- {benchset-0.0.8 → benchset-0.0.10}/native/src/configured_suite_tests.rs +80 -4
- {benchset-0.0.8 → benchset-0.0.10}/native/src/ffi.rs +186 -102
- {benchset-0.0.8 → benchset-0.0.10}/native/src/ffi_reference_tests.rs +74 -2
- {benchset-0.0.8 → benchset-0.0.10}/native/src/ffi_tests.rs +24 -6
- {benchset-0.0.8 → benchset-0.0.10}/native/src/lib.rs +373 -80
- benchset-0.0.10/native/src/memory.rs +118 -0
- benchset-0.0.10/native/src/memory_tests.rs +355 -0
- {benchset-0.0.8 → benchset-0.0.10}/native/src/reference.rs +34 -8
- {benchset-0.0.8 → benchset-0.0.10}/native/src/runtime_tests.rs +85 -0
- {benchset-0.0.8 → benchset-0.0.10}/native/src/suite_ffi.rs +76 -80
- {benchset-0.0.8 → benchset-0.0.10}/native/src/suite_ffi_tests.rs +30 -18
- {benchset-0.0.8 → benchset-0.0.10}/pyproject.toml +3 -3
- benchset-0.0.10/scripts/cargo.py +251 -0
- {benchset-0.0.8 → benchset-0.0.10}/scripts/check_source_install.py +46 -10
- {benchset-0.0.8 → benchset-0.0.10}/tests/helpers.py +27 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/swift/ReferenceTests.swift +75 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_aggregate_protocols.py +9 -2
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_benchset.py +31 -9
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_build_native.py +6 -2
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_cli.py +66 -12
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_cli_progress_streams.py +57 -17
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_interpreter_boundary.py +6 -1
- benchset-0.0.10/tests/test_loader_signals.py +1685 -0
- benchset-0.0.10/tests/test_memory.py +456 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_metadata.py +19 -6
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_name_diagnostics.py +25 -1
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_name_operands.py +5 -1
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_publication.py +48 -1
- benchset-0.0.10/tests/test_publication_signals.py +1656 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_python_core.py +20 -1
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_reference_artifacts.py +109 -20
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_release.py +57 -24
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_semantics.py +24 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_setup.py +5 -2
- benchset-0.0.10/tests/test_signal_state_contracts.py +373 -0
- benchset-0.0.8/benchset/_metadata.json +0 -1
- benchset-0.0.8/benchset/models.py +0 -92
- benchset-0.0.8/native/reference-calibration.json +0 -47
- benchset-0.0.8/native/src/catalog.rs +0 -33
- benchset-0.0.8/scripts/cargo.py +0 -111
- benchset-0.0.8/tests/test_loader_signals.py +0 -497
- benchset-0.0.8/tests/test_publication_signals.py +0 -576
- {benchset-0.0.8 → benchset-0.0.10}/LICENSE +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/MANIFEST.in +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/benchset/__main__.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/benchset/_aggregate.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/benchset/py.typed +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/benchset.egg-info/dependency_links.txt +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/benchset.egg-info/entry_points.txt +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/benchset.egg-info/requires.txt +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/benchset.egg-info/top_level.txt +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/examples/native/c.c +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/examples/native/rust.rs +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/examples/native/swift.swift +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/include/module.modulemap +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/native/src/aggregation_ffi_tests.rs +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/native/src/kernel.rs +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/native/src/kernel_tests.rs +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/native/src/observed_suite_tests.rs +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/native/src/reference_tests.rs +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/native/src/suite_tests.rs +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/rust-toolchain.toml +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/scripts/__init__.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/scripts/build_backend.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/scripts/build_native.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/scripts/check_native_coverage.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/scripts/package_native.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/scripts/release.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/scripts/version.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/setup.cfg +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/setup.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/__init__.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/swift/AggregationTests.swift +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/swift/BenchsetTests.swift +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_aggregate_exponential.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_aggregate_getters.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_aggregate_memory.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_aggregate_tuple_inputs.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_aggregation_boundary.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_approved_python_contracts.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_build.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_cli_active_signal_policy.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_cli_cleanup_signals.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_cli_embedded_signals.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_cli_final_signal_restore.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_cli_loader_validation.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_cli_loading_signals.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_cli_observer_signals.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_cli_signal_policy.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_cli_terminal_errors.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_core_contract.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_errors.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_exception_contexts.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_float_transport.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_installer_copy.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_loader_failures.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_loader_imports.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_native_coverage.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_native_lifetimes.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_packaging.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_quiet_validation.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_reference.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_reference_native.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_resources.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_runner_thread_safety.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_rust_api.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_signals.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_suite.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_suite_options.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_suite_signal_policy.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_validation_lifetime.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/test_version.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/typing/__init__.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/typing/reference_negative.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/typing/reference_positive.py +0 -0
- {benchset-0.0.8 → benchset-0.0.10}/tests/typing/test_reference_types.py +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "benchset"
|
|
3
3
|
# Generated from [project].version in pyproject.toml by scripts/version.py.
|
|
4
|
-
version = "0.0.
|
|
4
|
+
version = "0.0.10"
|
|
5
5
|
edition = "2021"
|
|
6
6
|
rust-version = "1.74"
|
|
7
7
|
build = "native/build.rs"
|
|
8
|
-
description = "Embeddable sustained
|
|
8
|
+
description = "Embeddable sustained CPU and memory benchmarks with a C ABI"
|
|
9
9
|
license = "MIT"
|
|
10
10
|
repository = "https://github.com/mutating/benchset"
|
|
11
11
|
readme = "README.md"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: benchset
|
|
3
|
-
Version: 0.0.
|
|
4
|
-
Summary: Sustained
|
|
3
|
+
Version: 0.0.10
|
|
4
|
+
Summary: Sustained CPU and memory benchmarks with an embeddable Rust core
|
|
5
5
|
Author-email: Evgeniy Blinov <zheni-b@yandex.ru>
|
|
6
6
|
Project-URL: Source, https://github.com/mutating/benchset
|
|
7
7
|
Project-URL: Tracker, https://github.com/mutating/benchset/issues
|
|
@@ -34,9 +34,8 @@ Dynamic: license-file
|
|
|
34
34
|
|
|
35
35
|

|
|
36
36
|
|
|
37
|
-
Sustained
|
|
38
|
-
a Python library, a CLI, and a macOS Swift package.
|
|
39
|
-
needed by applications embedding the native library.
|
|
37
|
+
Sustained CPU and memory benchmarks with an embeddable Rust core, a public C
|
|
38
|
+
ABI, a Python library, a CLI, and a macOS Swift package.
|
|
40
39
|
|
|
41
40
|
Rust is the single source of benchmark behavior: workloads, timing, validation,
|
|
42
41
|
suite order and early stopping, scores and aggregation all live in the native
|
|
@@ -50,7 +49,7 @@ definitions; it is a generated data snapshot, not a second implementation.
|
|
|
50
49
|
This keeps imports, metadata inspection and CLI help available without loading
|
|
51
50
|
the native library. Update Rust sources rather than editing that snapshot.
|
|
52
51
|
|
|
53
|
-
The
|
|
52
|
+
The CPU suite contains **`single_core`** (one computational worker) and
|
|
54
53
|
**`multi_core`** (all available computational workers). Both execute the same
|
|
55
54
|
fixed mixed workload and return a score in **completed iterations per second**.
|
|
56
55
|
Higher is faster. Each completed result also includes a **Pi equivalent**:
|
|
@@ -62,6 +61,11 @@ the geometric mean of the individual Pi equivalents, with equal weights.
|
|
|
62
61
|
See [Full-suite score](#full-suite-score) for the formula, availability rules
|
|
63
62
|
and the field to read in each interface.
|
|
64
63
|
|
|
64
|
+
**`memory_bandwidth`** measures sequential memory bandwidth in GB/s, and
|
|
65
|
+
**`memory_latency`** measures dependent memory access in ns/access. Select
|
|
66
|
+
either one by name. [Memory benchmarks](#memory-benchmarks) describes their
|
|
67
|
+
working sets and Pi equivalents.
|
|
68
|
+
|
|
65
69
|
This README describes the current source tree. For changes not yet published,
|
|
66
70
|
use `pip install .` or the local Rust/Swift dependencies described below.
|
|
67
71
|
|
|
@@ -72,6 +76,8 @@ pip install benchset
|
|
|
72
76
|
benchset
|
|
73
77
|
benchset --bench single_core
|
|
74
78
|
benchset --bench multi_core --warmup 120 --duration 60
|
|
79
|
+
benchset --bench memory_bandwidth
|
|
80
|
+
benchset --bench memory_latency
|
|
75
81
|
python -m benchset --warmup 0 --duration 1
|
|
76
82
|
```
|
|
77
83
|
|
|
@@ -89,7 +95,7 @@ these build tools.
|
|
|
89
95
|
|
|
90
96
|
| CLI option | Default | Meaning |
|
|
91
97
|
|---|---:|---|
|
|
92
|
-
| `--bench` | all | `all
|
|
98
|
+
| `--bench` | all | `all` runs the CPU suite in order. Any of the four benchmarks can be selected by name. |
|
|
93
99
|
| `--warmup` | 120 | Seconds of continuous workload excluded from the score; zero is allowed |
|
|
94
100
|
| `--duration` | 60 | Seconds of measurement after warmup; must be positive |
|
|
95
101
|
| `-h`, `--help` | | Show options, defaults, examples and Pi equivalent interpretation |
|
|
@@ -134,7 +140,7 @@ An unavailable multiplier is displayed as `—` (`-` in the fallback format).
|
|
|
134
140
|
|
|
135
141
|
## Full-suite score
|
|
136
142
|
|
|
137
|
-
Run the complete suite to obtain its overall score:
|
|
143
|
+
Run the complete CPU suite to obtain its overall score:
|
|
138
144
|
|
|
139
145
|
| Interface | Run the suite | Read the Full Pi equivalent |
|
|
140
146
|
|---|---|---|
|
|
@@ -279,7 +285,25 @@ or separately linked copies of the library can still compete for CPU time.
|
|
|
279
285
|
|
|
280
286
|
With Python's default SIGINT handler, Ctrl+C during a main-thread call cancels
|
|
281
287
|
the native work and raises `KeyboardInterrupt` after cleanup. Custom signal
|
|
282
|
-
handlers are preserved.
|
|
288
|
+
handlers are preserved. During the first native load, the first deferred
|
|
289
|
+
SIGINT goes to the original Python handler, and any later deferred SIGINT
|
|
290
|
+
uses the handler active at delivery.
|
|
291
|
+
|
|
292
|
+
On Linux and macOS, the loader preserves the Unix `SA_RESTART` flag across
|
|
293
|
+
temporary handler changes. An audit hook that denies access to `sigaction`
|
|
294
|
+
can prevent this. A simultaneous change to the SIGINT disposition between
|
|
295
|
+
the native snapshot and Python's handler installation can also reset the flag.
|
|
296
|
+
Concurrent changes during native restoration can cause an interrupt in that
|
|
297
|
+
window to miss its intended delivery. The loader reconciles policy changes
|
|
298
|
+
observed after restoration with the OS.
|
|
299
|
+
During snapshot initialization, a `PermissionError` is treated as an audit
|
|
300
|
+
refusal unless the traceback identifies a Python signal or tracing callback. A handler that
|
|
301
|
+
changes its signal arguments or a restriction on traceback inspection can
|
|
302
|
+
prevent that identification.
|
|
303
|
+
|
|
304
|
+
Source-build publication preserves recognizable signal, audit and tracing
|
|
305
|
+
vetoes. Global I/O replacements that imitate those callback argument and
|
|
306
|
+
event protocols can also be treated as host callbacks.
|
|
283
307
|
|
|
284
308
|
## What one iteration does
|
|
285
309
|
|
|
@@ -311,8 +335,40 @@ single-core score.
|
|
|
311
335
|
Normal release compiler optimization is enabled. There is no `target-cpu=native`,
|
|
312
336
|
inline assembly, manual SIMD, hardware cryptography or CPU-specific dispatch.
|
|
313
337
|
The dependent operations prevent the main loops from becoming independent
|
|
314
|
-
vector workloads.
|
|
315
|
-
|
|
338
|
+
vector workloads.
|
|
339
|
+
|
|
340
|
+
## Memory benchmarks
|
|
341
|
+
|
|
342
|
+
`memory_bandwidth` streams through three `u64` arrays totaling **192 MiB**
|
|
343
|
+
across workers. The runner divides the arrays into disjoint blocks among
|
|
344
|
+
available workers, up to 512. Each iteration processes one block of 16,384
|
|
345
|
+
elements, reading two words and writing their wrapping sum per element. The
|
|
346
|
+
score is the rate of those logical reads and writes in decimal **GB/s**
|
|
347
|
+
(393,216 bytes per iteration).
|
|
348
|
+
|
|
349
|
+
`memory_latency` uses one worker to follow a shuffled cycle of indices at
|
|
350
|
+
64-byte intervals in a **128 MiB** table. Each access determines the next index.
|
|
351
|
+
One iteration completes 1,024 dependent reads. The score is mean elapsed
|
|
352
|
+
nanoseconds per read, in **ns/access**.
|
|
353
|
+
|
|
354
|
+
These scores describe the fixed access patterns and working sets. How much
|
|
355
|
+
traffic reaches DRAM depends on the private and shared caches. With multiple
|
|
356
|
+
bandwidth workers, each worker's portion of the 192 MiB can fit in a private
|
|
357
|
+
cache. The score counts logical reads and writes at the reported worker count.
|
|
358
|
+
Latency includes address translation and the time spent following the chain.
|
|
359
|
+
Both benchmarks allocate and initialize their arrays before warmup and use
|
|
360
|
+
the same timing, sampling and cancellation API as the CPU benchmarks.
|
|
361
|
+
|
|
362
|
+
Select them with Python `run('memory_bandwidth', ...)` or
|
|
363
|
+
`run('memory_latency', ...)`, Rust `Benchmark::MemoryBandwidth` or
|
|
364
|
+
`Benchmark::MemoryLatency`, Swift `.memoryBandwidth` or `.memoryLatency`,
|
|
365
|
+
and C `BENCHSET_MEMORY_BANDWIDTH` or `BENCHSET_MEMORY_LATENCY`. Python and
|
|
366
|
+
Rust expose the pair as `MEMORY_BENCHMARKS`. The CPU suite and its
|
|
367
|
+
`Full Pi equivalent` use `BENCHMARKS` in order.
|
|
368
|
+
|
|
369
|
+
Memory bandwidth divides measured GB/s by the Pi's GB/s. Memory latency
|
|
370
|
+
divides the Pi's ns/access by the measured ns/access. A Pi equivalent above
|
|
371
|
+
1.0 therefore indicates faster performance in either test.
|
|
316
372
|
|
|
317
373
|
## Timing and result interpretation
|
|
318
374
|
|
|
@@ -329,31 +385,41 @@ of process-available parallelism; its documented limitations include Windows
|
|
|
329
385
|
processor groups above 64 logical CPUs and some affinity/quota configurations.
|
|
330
386
|
The library does not reserve cores or model sharing between isolates.
|
|
331
387
|
|
|
332
|
-
The
|
|
333
|
-
after warmup. Workers publish counters in batches of eight iterations
|
|
388
|
+
The CPU score is `iterations / elapsed_seconds`, using monotonic wall time
|
|
389
|
+
after warmup. Workers publish counters in batches of eight iterations. A final
|
|
334
390
|
batch can slightly extend the requested interval. The actual measured duration
|
|
335
391
|
is included and used as the denominator. Worker setup and teardown are excluded.
|
|
336
392
|
Cancellation is checked between batches; completion waits for active workers.
|
|
337
393
|
|
|
394
|
+
For memory benchmarks, the measurement window starts after all workers finish
|
|
395
|
+
their warmup batches. The elapsed time extends to the later of the measurement
|
|
396
|
+
deadline and the last measured batch's completion. A cancellation before the
|
|
397
|
+
deadline uses the first cancellation request as the end of the window and
|
|
398
|
+
includes any measured batches still in flight. Progress and sampling share
|
|
399
|
+
a timestamp for the counter snapshot. The coordinator skips a snapshot if
|
|
400
|
+
it takes longer than the 10 ms polling interval or crosses the phase deadline.
|
|
401
|
+
A final interval shorter than one second is merged into the preceding interval
|
|
402
|
+
when one exists, so a single batch does not dominate the stability estimate.
|
|
403
|
+
|
|
338
404
|
The immutable Python result contains:
|
|
339
405
|
|
|
340
406
|
| Field | Meaning |
|
|
341
407
|
|---|---|
|
|
342
408
|
| `benchmark`, `version` | Name and benchmark/library version |
|
|
343
409
|
| `status`, `success`, `reason` | `completed`, `cancelled` or `failed`; explanation on failure |
|
|
344
|
-
| `score`, `unit` |
|
|
345
|
-
| `pi_equivalent` | Double-precision
|
|
410
|
+
| `score`, `unit` | `iterations/s`, `GB/s` or `ns/access` by benchmark. Completed results have a score. |
|
|
411
|
+
| `pi_equivalent` | Double-precision throughput ratio to the Pi, or Pi latency divided by measured latency |
|
|
346
412
|
| `reference_machine`, `reference_run` | Calibration machine and series, present for every result status |
|
|
347
413
|
| `workers` | Number of computational workers |
|
|
348
414
|
| `warmup_seconds`, `measurement_seconds` | Requested windows |
|
|
349
415
|
| `elapsed_seconds`, `iterations` | Actual measured wall time and completed work |
|
|
350
416
|
| `checksum` | XOR of final per-worker checksums; diagnostic, not a score |
|
|
351
|
-
| `samples` |
|
|
417
|
+
| `samples` | Measurement intervals of approximately one second, with the final interval handled as described above |
|
|
352
418
|
| `variation_percent`, `unstable` | Time-weighted coefficient of variation, and whether it exceeds 10% |
|
|
353
419
|
|
|
354
420
|
Each sample stores cumulative measured elapsed time, interval duration,
|
|
355
|
-
interval iterations and iterations/s. Variation
|
|
356
|
-
|
|
421
|
+
interval iterations and iterations/s. Variation measures the within-run
|
|
422
|
+
spread of the sample iteration rates and requires at least two samples.
|
|
357
423
|
An unstable run retains its score and completed status; the consumer decides
|
|
358
424
|
whether to use it. Cancellation/failure can retain partial diagnostics but
|
|
359
425
|
never produces a usable score or Pi equivalent. An unstable completed run
|
|
@@ -377,19 +443,25 @@ The public names are:
|
|
|
377
443
|
| Python | `result.pi_equivalent: Optional[float]` | `result.reference_machine: ReferenceMachine` | `result.reference_run: ReferenceRun` |
|
|
378
444
|
| Rust | `result.pi_equivalent: Option<f64>` | `result.reference_machine: &'static ReferenceMachine` | `result.reference_run: &'static ReferenceRun` |
|
|
379
445
|
| Swift | `result.piEquivalent: Double?` | `result.referenceMachine: ReferenceMachine` | `result.referenceRun: ReferenceRun` |
|
|
380
|
-
| C / C++ V3 | `result.base.pi_equivalent`, when `result.base.has_pi_equivalent != 0` | `result.reference_machine` | `result.reference_run` + `
|
|
381
|
-
|
|
382
|
-
Every returned result carries
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
446
|
+
| C / C++ V3 | `result.base.pi_equivalent`, when `result.base.has_pi_equivalent != 0` | `result.reference_machine` | `result.reference_run` + `benchset_reference_result_for` |
|
|
447
|
+
|
|
448
|
+
Every returned result carries the reference machine and the calibration series
|
|
449
|
+
for its workload, including unsuccessful results. CPU results use
|
|
450
|
+
`PI_REFERENCE_RUN` / Swift `piReferenceRun`, and memory results use
|
|
451
|
+
`PI_MEMORY_REFERENCE_RUN` / Swift `piMemoryReferenceRun`.
|
|
452
|
+
For Python records built with the base `BenchmarkResult` initializer, omitted
|
|
453
|
+
memory metadata follows the benchmark name. Dataclass subclasses that generate
|
|
454
|
+
their own initializer use their declared field defaults. Supply `unit` and
|
|
455
|
+
`reference_run=PI_MEMORY_REFERENCE_RUN` when constructing a memory record with
|
|
456
|
+
one of those initializers.
|
|
457
|
+
`dataclasses.asdict(result)` includes both records as
|
|
388
458
|
nested data with numeric `started_at_unix_seconds`. Rust fields borrow the
|
|
389
459
|
public statics. Swift computed properties return the global structs with ordinary
|
|
390
460
|
value semantics. The globals
|
|
391
|
-
remain available without running a benchmark
|
|
392
|
-
`
|
|
461
|
+
remain available without running a benchmark. C uses the handle-free
|
|
462
|
+
`benchset_reference_run_for` and `benchset_reference_result_for` getters to
|
|
463
|
+
select a series by benchmark ID, and `benchset_benchmark_unit` for its unit.
|
|
464
|
+
The unqualified run and result getters select the CPU series.
|
|
393
465
|
|
|
394
466
|
Rust callers that construct `BenchmarkResult` with a struct literal must add
|
|
395
467
|
the new `pi_equivalent`, `reference_machine` and `reference_run` fields. This
|
|
@@ -436,9 +508,8 @@ fields are:
|
|
|
436
508
|
- `ReferenceRun`: `started_at_unix_seconds`, `start_temperature_c`,
|
|
437
509
|
`end_temperature_c`, `warmup_seconds` and `results`. Temperatures are in
|
|
438
510
|
Celsius; the warmup is in seconds before **each** reference measurement.
|
|
439
|
-
- `ReferenceBenchmarkResult`: `benchmark` and `score`
|
|
440
|
-
`results` contains
|
|
441
|
-
separate repeats.
|
|
511
|
+
- `ReferenceBenchmarkResult`: `benchmark` and `score` in that benchmark's
|
|
512
|
+
primary unit. `results` contains one pooled entry per workload in the series.
|
|
442
513
|
|
|
443
514
|
Swift uses camelCase fields, such as `shortName`, `startedAtUnixSeconds` and
|
|
444
515
|
`startTemperatureC`. Python additionally offers the timezone-aware UTC
|
|
@@ -458,6 +529,22 @@ and this reference configuration. The library reads these fixed values
|
|
|
458
529
|
locally; it does not connect to the Pi, query sensors or require the original
|
|
459
530
|
experiment directory.
|
|
460
531
|
|
|
532
|
+
### Memory reference
|
|
533
|
+
|
|
534
|
+
The memory series ran on the Raspberry Pi 5 at `pi-2.local` on December 6,
|
|
535
|
+
2026. It used a release `aarch64-unknown-linux-gnu` shared library built for
|
|
536
|
+
the glibc 2.17 baseline of the published ARM64 Linux packages. Each benchmark
|
|
537
|
+
had three 60-second measurements, each following a 120-second warmup. The
|
|
538
|
+
reference uses pooled work and actual elapsed time across those measurements.
|
|
539
|
+
|
|
540
|
+
| Benchmark | Workers | Pi 5 reference |
|
|
541
|
+
|---|---:|---:|
|
|
542
|
+
| `memory_bandwidth` | 4 | 4.120941 GB/s |
|
|
543
|
+
| `memory_latency` | 1 | 103.550973 ns/access |
|
|
544
|
+
|
|
545
|
+
The [calibration record](native/reference-calibration.json) contains
|
|
546
|
+
full-precision scores, per-run counters, timing and provenance.
|
|
547
|
+
|
|
461
548
|
The only editable package version is `[project].version` in `pyproject.toml`.
|
|
462
549
|
The version values in `Cargo.toml`, the package's `Cargo.lock` entry and the
|
|
463
550
|
Rust/Swift dependency pins below are generated copies. `benchset.__version__`
|
|
@@ -476,7 +563,7 @@ pinned release toolchain described under [Publishing](#publishing).
|
|
|
476
563
|
|
|
477
564
|
```toml
|
|
478
565
|
[dependencies]
|
|
479
|
-
benchset = "0.0.
|
|
566
|
+
benchset = "0.0.10"
|
|
480
567
|
# For changes from a local source checkout, use:
|
|
481
568
|
# benchset = { path = "../benchset" }
|
|
482
569
|
```
|
|
@@ -592,8 +679,8 @@ benchset_suite_free(suite_handle);
|
|
|
592
679
|
```
|
|
593
680
|
|
|
594
681
|
The C ABI version remains 1. The additive, size-checked
|
|
595
|
-
`benchset_reference_machine`, `
|
|
596
|
-
`
|
|
682
|
+
`benchset_reference_machine`, `benchset_reference_run_for` and indexed
|
|
683
|
+
`benchset_reference_result_for` getters need no handle. Their
|
|
597
684
|
immutable strings remain valid for the loaded library's lifetime. Pass the
|
|
598
685
|
exact output structure size to these getters, `benchset_result_v2` and
|
|
599
686
|
`benchset_result_v3`;
|
|
@@ -618,9 +705,15 @@ the supported 64-bit platforms.
|
|
|
618
705
|
|
|
619
706
|
The C metadata types are `BenchsetReferenceMachine`, `BenchsetReferenceRun`
|
|
620
707
|
and `BenchsetReferenceBenchmarkResult`. `BenchsetReferenceRun.result_count`
|
|
621
|
-
|
|
622
|
-
`
|
|
623
|
-
|
|
708
|
+
gives the length of the series. Retrieve its entries with
|
|
709
|
+
`benchset_reference_result_for(result.base.base.benchmark, index, &entry, sizeof(entry))`.
|
|
710
|
+
Indices are zero-based. The unqualified reference run and result getters read
|
|
711
|
+
the CPU series.
|
|
712
|
+
|
|
713
|
+
Use `benchset_benchmark_id` for UTF-8 names or `benchset_benchmark_match_catalog`
|
|
714
|
+
for a caller-supplied comparison. Either lookup returns the ID to use in
|
|
715
|
+
`BenchsetConfig`. `benchset_benchmark_match` handles the CPU suite and falls back
|
|
716
|
+
to `multi_core` in execution mode.
|
|
624
717
|
|
|
625
718
|
When statically linking Rust into a foreign application, system libraries may
|
|
626
719
|
also be required. Obtain their list with
|
|
@@ -642,7 +735,7 @@ the same repository. Rust is not required by the consumer.
|
|
|
642
735
|
For a Swift manifest, add:
|
|
643
736
|
|
|
644
737
|
```swift
|
|
645
|
-
.package(url: "https://github.com/mutating/benchset.git", .exact("0.0.
|
|
738
|
+
.package(url: "https://github.com/mutating/benchset.git", .exact("0.0.10"))
|
|
646
739
|
```
|
|
647
740
|
|
|
648
741
|
Add `.product(name: "Benchset", package: "benchset")` to your target's
|
|
@@ -744,10 +837,11 @@ they do not enforce speed thresholds in CI.
|
|
|
744
837
|
|
|
745
838
|
`python -m pytest tests/test_reference_artifacts.py` also builds and runs
|
|
746
839
|
consumers of unpacked crates, source distributions, wheels and native ZIPs
|
|
747
|
-
outside the checkout.
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
840
|
+
outside the checkout. The consumers exercise both memory workloads through
|
|
841
|
+
Rust, C, C++, Python and both CLI entry points. Build the Apple package first
|
|
842
|
+
to run the memory workloads from its unpacked Swift package and check both
|
|
843
|
+
XCFramework architectures. All smoke measurements use short explicit windows.
|
|
844
|
+
The [Pi equivalent test plan](tests/pi-equivalent-plan.md) records both
|
|
751
845
|
rounds of independent test reviews and their deduplicated scenarios.
|
|
752
846
|
|
|
753
847
|
## Test coverage
|
|
@@ -9,8 +9,8 @@ let package = Package(
|
|
|
9
9
|
products: [.library(name: "Benchset", targets: ["Benchset"])],
|
|
10
10
|
targets: [
|
|
11
11
|
.binaryTarget(name: "CBenchset",
|
|
12
|
-
url: "https://github.com/mutating/benchset/releases/download/v0.0.
|
|
13
|
-
checksum: "
|
|
12
|
+
url: "https://github.com/mutating/benchset/releases/download/v0.0.10/Benchset.xcframework.zip",
|
|
13
|
+
checksum: "3826874d292766837a9dee921e931defce771de69ffb58a9156e4c5d479f829e"),
|
|
14
14
|
.target(name: "Benchset", dependencies: ["CBenchset"]),
|
|
15
15
|
.testTarget(name: "BenchsetTests", dependencies: ["Benchset"], path: "tests/swift")
|
|
16
16
|
]
|