Exact streams.
Deterministic by theorem.
RetractorDB merges and resamples regular time series with zero approximation error. Its core operators are proved correct over rational arithmetic — grounded in Beatty sequences and Fraenkel’s partition theorem. Replay a recording, get the same bits. Every time.
arXiv:2607.07730 · MIT licenseEach column is one record n of str1 (Δ = 1/10). A core1 tuple lasts two slots, so it pairs with two consecutive core0 tuples. At n = 8 the 8-record datafile2.dat starts again from its first value.
str0 pairs the two sources exactly as in simple; str1 = str0.max keeps the larger field of each str0 tuple; str2 = str0 + str1 carries both side by side.
A merge you can always undo
A regular stream is just a clock — a starting point and a fixed interval between ticks. Two clocks running at different rates can be woven into one combined stream, in order, with nothing lost.
Exact
Core operators are proved correct over rational arithmetic. No floating-point drift, no approximation — for any pair of regular rates.
Reversible
The combined stream always splits back into the exact two clocks it came from. Merge and split are exact opposites; the scissors mark is that split, drawn.
Replay-stable
Replay the same recording twice and get the identical result down to the bit — a property exercised continuously in CI.
The formal proof is in the paper. Try the rules yourself with the interlace and sum operators.
Any machine that streams, any signal that matters
RetractorDB is domain-neutral. It sits at the edge, next to the sensors, and turns raw multi-rate telemetry into exact, reduced, replay-stable streams before they reach a historian, a TSDB, or the cloud.
Aerospace
Flight-test and avionics telemetry: hundreds of sensors at mismatched rates merged deterministically, with byte-identical replay for post-flight and incident analysis.
Rates are declared once, in the query, as exact fractions; a 400 Hz inertial unit and a 1 Hz GPS fix meet on a common timeline with no resampling guesswork. The same recording replayed a year later yields the same bytes, so a finding from a flight review can be re-derived and audited.
Automotive
ECU and vehicle-bus signals aligned without floating-point drift; reproducible traces for validation, fleet analytics, and homologation.
CAN, LIN and Ethernet frames arrive at unrelated periods. Streams are aligned by rational arithmetic instead of timestamps rounded to milliseconds, so a validation run and its replay agree record for record — across builds, machines and test campaigns.
Industrial monitoring
Machine condition monitoring and predictive maintenance: vibration, current, and temperature reduced at the edge to exact, comparable features.
Windowed reductions such as averages, extremes and sums run next to the sensor, and only the features leave the device. Because every window boundary is exact, features from different machines and different days line up and can be compared directly.
Energy & grid
Synchrophasors, substations, wind turbines: every rate is a rational multiple of line frequency, and post-fault analysis demands exact, replayable records.
Streams sampled at multiples of 50 or 60 Hz interleave without phase creep. Disturbance records keep every value in its slot, and missing samples are marked explicitly rather than silently interpolated, which matters when an event has to be reconstructed.
Audio & broadcast
44.1 ↔ 48 kHz is exactly 147:160 — a rational conversion the algebra performs with zero accumulated drift, keeping long chains sample-accurate.
Rate conversion is a plan operator, not an approximation buried in a filter library. A chain of conversions can be inspected, and the plan shows exactly which samples feed which output, so long broadcast chains stay aligned without periodic correction.
Software-defined radio
Decimation and interpolation chains with rational factors are SDR’s daily bread; here they are exact, declarative, and inspectable query operators.
A decimation by 5 followed by an interpolation by 3 is written as a query, compiled into a plan and checked before it runs. The same declarative form documents the chain, so the pipeline a receiver runs is the pipeline its designer reviewed.
Robotics & test benches
Encoder, IMU, and force signals fused across control-loop rates; hardware-in-the-loop runs replay bit-for-bit for regression testing and certification.
Control loops at 1 kHz, sensors at 200 Hz and supervisory logic at 10 Hz share one exact time base. Recorded bench sessions replay deterministically, so a regression test fails because the software changed, not because the timing did.
Biomedical
Vital-sign pipelines — the engine’s original domain and the paper’s worked example, a special case of the same algebra.
The engine grew out of ECG processing: detecting QRS complexes in signals recorded at different sampling rates. The worked example on this page — and in the paper — is that pipeline, expressed as a handful of continuous queries.
The same pattern recurs wherever regular telemetry meets an audit trail: rail and maritime data recorders, seismic networks, structural health monitoring of bridges and buildings, environmental sensor grids.
Three binaries, one deterministic pipeline
Declare source streams and continuous transformations in RQL, a declarative query language realizing the algebra. The compiler resolves every stream to a rational interval and builds a dependency DAG; the runtime schedules slots on a rational timeline.
xretractor
Parser, compiler, and runtime for RQL plans. Compile-only and plan-dump modes for inspection.
xqry
Queries running streams live over IPC — raw or formatted, ready to pipe into gnuplot.
xtrdb
Inspects and edits binary artifacts: schema, null/gap metadata, deterministic test data.
One worked example, the same algebra everywhere
The paper’s worked example is a longer chain of the same operators: the Pan–Tompkins QRS detector over MIT-BIH ECG data, end-to-end in the algebra. Swap the coefficients and the same chain computes a vibration envelope or a bus-signal feature. No user-defined functions, no procedural escape hatches.
- 01Bandpass 5–15 Hz
- 02Derivative
- 03Squaring
- 04Moving-window integration
- 05Adaptive threshold
A century of mathematics, one engine
-
1926
Beatty shows two sequences ⌊np⌋, ⌊nq⌋ partition ℕ for irrational rates.
-
1969
Fraenkel generalizes the partition criterion to rational parameters — the computable case.
-
2003
The operator algebra and declarative query language are defined in a fetal-monitoring context [JMIT vol. 5–6].
-
2006
The covering-systems ↔ stream-alignment bridge is established in peer-reviewed form [Annales UMCS Informatica vol. 4] — now on arXiv:2607.10444.
-
2026
Full formal semantics, proofs, and the engine report: arXiv:2607.07730.