A Python toolkit that checks whether multi-sensor recordings keep correct time and keep every sample. Seven analyzers (A01–A07) cover clock rate, synchronization, data integrity, resources, the write pipeline, long-run stability, and lifecycle faults. A deterministic generator produces sessions with hidden ground truth, and nine preregistered experiments test each analyzer against that truth.
All numbers and figures below come from synthetic data. They show what the methods recover under a known model, not the performance of any hardware.
flowchart LR
cfg[Generator config] --> gen[Synthetic session generator]
gen --> sess[(Observable session<br/>manifest + sensor CSVs)]
gen --> truth[(Hidden ground truth<br/>separate directory)]
subgraph analysis [Analyzers: session only]
a[A01 timing · A02 sync · A03 integrity<br/>A04 resources · A05 pipeline<br/>A06 stability · A07 faults]
end
sess --> a
truth -. "✗ no access" .-x a
a --> rep[Machine-readable report<br/>report.json · metrics.csv]
rep --> exp[Experiments E01–E09<br/>frozen protocol]
truth --> exp
exp --> res[(Results)] --> fig[Research figures]
linkStyle 4 stroke:#d62728,stroke-width:2px,color:#d62728
The analyzers read only the session directory; the generator refuses to place the truth inside it. The truth is read only after analysis, by the experiments and tests. Architecture · Session format
| Finding (synthetic) | Evidence |
|---|---|
| A reference column converted from a single anchor reached ±35.99 ms error after 1,800 s with a 20 ppm host clock; the gated PPS/ToD fit stayed within 0.31–0.38 µs | E01 |
| Counting samples at the nominal rate gave up to 90 ms end error at ±50 ppm; the measured rate gave below 1 µs in every case | E02 |
| A sequence-gap check found 0 of 259 injected extra samples; the device-time interval check found 259 of 259 (precision and recall 1.0, five seeds) | E03 |
| With 200 µs host-clock wander, a single straight-line fit reported 742.8 µs delivery spread against 459.2 µs truth; a piecewise fit reported 460.8 µs | E04 |
The queue sizing rule ceil(rate × stall) + 1 predicted drop or no drop correctly in 12 of 12 configurations |
E05 |
| The PPS pairing gate flagged 102 of 103 injected wrong-second labels with no false positives | E06 |
| E04 did not meet its preregistered criterion, and two counter-unwrapping failure cases are kept in E07 | Benchmark report |
A recorder often converts host arrival time to reference time once, using a single anchor and an assumed rate. E01 (figure above) shows that this column then drifts linearly with the host clock error: anchored at the start, the far end is off by +35.99 ms; anchored at the end, the start is off by −35.99 ms, matching the predicted 20 ppm × 1,800 s within 3×10⁻⁵. A fit over all gated PPS/ToD pairs follows the true mapping within 0.38 µs.
E02. Reconstructing timestamps by counting samples at the nominal 100 Hz rate drifts in proportion to the device clock error: ±36 ms at ±20 ppm and ±90 ms at ±50 ppm after 30 minutes. Using the rate measured by A01 (on the reference timescale) keeps the end error between 0.85 and 0.88 µs in all five cases (dashed line). The device clocks here are a constant rate error; temperature drift is not modelled.
E03. Five 10-minute sessions at 400 Hz with lost and extra samples injected together. Sequence numbers recover every lost sample (234 of 234), but a gap-only check reports zero extra samples and labels each session as "gaps". Flagging device-time intervals much shorter than a period finds all 259 extras with no false alarms. The interval view needs device timestamps; with host arrival times alone, extra samples cannot be separated from bursty delivery.
E04 — not supported as preregistered. Delivery jitter is measured as the p99–p1 spread of arrival residuals after fitting host time against device time. A single straight line absorbs host-clock wander as jitter: 743 µs instead of 459 µs at 200 µs wander. A piecewise fit with 10 s knots recovers the true spread within 0.5 % in every case, and the PPS residuals separate host wander (115 and 461 µs) from a shared delay (4.5 µs). The preregistered criterion also required the straight-line excess to reach half of twice the wander amplitude. At 50 µs wander the excess was 48.1 µs against a 50 µs bar, so the outcome remains not_supported. A percentile spread does not grow linearly with small wander, and the threshold was not moved after the run.
E05. A 30 items/s stream is written through a bounded queue with one write stall every 10 s. Drops begin exactly where capacity falls below ceil(rate × stall) + 1 (7, 13 and 25 for 0.2, 0.4 and 0.8 s stalls), in all 12 cells. A05 derives the same capacities from writer timestamps alone. Sampled queue telemetry, however, under-reports the peak: 0 observed where the true peak was 6, and 12 where it was 24. Observed queue depth is a lower bound, not evidence of headroom.
E06. With 2 % wrong-second messages, 2 % spurious edges and 1 % missed edges, a least-squares fit over every recorder pair is off by 5.7–12.3 ms. The gate (warm-up chain, then prediction from recent accepted pairs) brings the error to 0.02–0.07 µs and finds 102 of 103 wrong-second labels. A generic robust fit reached the same accuracy on these faults; the gate's added value is classifying each rejected pair. It cannot detect a constant label offset, where every message names the wrong second by the same amount.
| ID | Claim | Outcome |
|---|---|---|
| E01 | A reference column anchored once drifts with the host clock | supported |
| E02 | The nominal rate is not the sampling rate | supported |
| E03 | A gap-only check cannot see extra samples | supported |
| E04 | Host clock wander inflates apparent delivery jitter | not supported (one sub-criterion missed) |
| E05 | Queue capacity sizing under write stalls | supported |
| E06 | PPS / time-of-day pairing needs a gate | supported |
| E07 | Counter unwrapping, including two documented failures | supported |
| E08 | Lifecycle replay catches an empty session whose exit status reports success | supported |
| E09 | A check that fails on every session carries no information | supported |
E07 keeps two failures on purpose. An 8-bit counter reset that lands on a plausible forward step (+13) is missed, and a 16-bit gap of 40,000 (more than half the range) is read as a reset. E08: an interrupt during start-up with exit status 0 produces an empty session, which A07 flags as inconsistent. E09: without a reference source, a "reference locked" check fails on every session; applicability-aware checks mark it not applicable.
The protocol (experiments/protocol.json) was committed before the first run, and every result records its SHA-256. In the first run, E02 failed because the evaluator used the wrong sign; the run is kept in results/run1/, and the fix is logged in the evaluation log. Benchmark report · Verification methodology
- 33 pytest tests cover the session format, counters, clock fits, the PPS gate, the queue model, generator determinism and A01–A07 against known answers.
- Hosted GitHub Actions passed on Python 3.10 and 3.12 for commit
7f2b471: cleanpip install, pytest, and experiments E06–E09. Run 46558998489 (first passing run: 46549846610, commit0aca553) - The full reproduction (all nine experiments and six figures) was run locally in about 60 s. Test report
Python 3.10+, CPU only.
pip install -r requirements.txt
pip install -e .
python -m pytest -q
python -m sdalab reproduce --out results --figures figuresAnalyze a single generated session:
python -m sdalab generate --config examples/basic.json --out out/session --truth out/truth
python -m sdalab validate out/session
python -m sdalab analyze out/session --out out/reportThe report is out/report/report.json plus a flat metrics.csv.
- Scope and disclosure boundary · Architecture · Session format
- Clock model · Verification methodology · Code walkthrough
- Benchmark report · Test report · Evaluation log
The generator models clocks as a constant rate error plus sinusoids, and write stalls as periodic and of fixed length. Temperature drift, clock steps, random-walk wander and heavy-tailed scheduling delays are not modelled. A piecewise fit follows wander only on time scales longer than about two knots. Queue telemetry and stall lengths from writer timestamps are lower bounds. Passing experiments show that the analyzers recover injected truth under this model, not that real hardware behaves like it. Full limitations
- This repository is an engineering showcase. It exists to present engineering experience, research results and technical capability.
- No general open-source license is granted, and there is no LICENSE file on purpose. Apart from the rights GitHub's Terms of Service give users of public repositories (viewing and forking on GitHub) and uses permitted by applicable law, no permission is granted to copy, modify or redistribute the contents.
- Intellectual property in the contents remains with its respective owners.
- Third-party content (libraries, tools, published methods) remains under its original license terms.
- This showcase does not imply ownership of third-party technologies, proprietary systems, or underlying intellectual property.
Version: 0.1.0
NumPy, SciPy, pandas and Matplotlib supply numerical, data and plotting primitives. The sessions, experiments and figures are generated by this project. Claude Code assisted with coding, experiments and writing.





