Adaptive compression & Bounded mode

at1 optimize is AT-1’s adaptive numeric compressor. It auto-selects the best transform and entropy back-end per column, with a hard guarantee the output is never larger than a strong general compressor. It is built entirely from standard, published signal-processing and entropy coding — and emits the same SHA-256-verified, queryable AT-1 container.

Lossless (default)

# Auto-select the best transform + entropy back-end for a numeric column.
# AT-1 tries delta / double-delta / linear-predictive / spectral / byte-plane
# against xz, zstd, bz2, zlib and brotli, and keeps the smallest — and it is
# guaranteed never larger than a plain general-compressor baseline.
at1 optimize compress  readings.npy  readings.at1o
at1 optimize decompress readings.at1o readings.npy
at1 optimize verify     readings.at1o     # checks the SHA-256 integrity trailer

Methods it picks from

MethodBest for
identityalready-decorrelated / incompressible data (falls back here)
delta / double-deltamonotone IDs, counters, slow sensor & financial series
ar_lpcvibration, EEG/biosignal, LiDAR, audio — linear-predictive
fft_sparseperiodic / tonal signals — spectral model + lossless residual
frame_of_referencelow-range / categorical columns (large values, small spread)
seasonalperiodic baselines + noise — hourly request rates, daily/weekly load, duty cycles
byte-planemodel weights, wide-integer & float columns

You don’t choose — AT-1 measures all of them against several codecs and keeps the smallest, recording which it used in the container header.

Whole tables (per-column)

Pass a 2-D input — a CSV or a 2-D array — and AT-1 encodes it per column: a monotone id column takes delta, a sensor takes ar_lpc, a categorical takes frame_of_reference, an hourly-rate column takes seasonal. Each column carries its own integrity trailer, and a table-level trailer binds the columns together (so a reorder or truncation is caught too).

# A 2-D input (a TABLE) is auto-detected and encoded per-column: every column
# gets its own best transform + back-end, with per-column AND table-level integrity.
at1 optimize compress  metrics.csv  metrics.at1o   # routes to the table codec
at1 optimize verify    metrics.at1o                # one column tampered -> fails

Bounded mode (error-bounded lossy)

For scientific and sensor archives where a known tolerance is acceptable, pass --bound F to guarantee a maximum absolute error of F × signal-range. Quantization happens in the signal domain, so the bound holds worst-case on every sample, not on average. Each container embeds a tamper-evident certificate of the honored bound.

# Bounded mode: guarantee a maximum absolute error (here 1% of signal range).
# Far smaller than lossless, with the bound honored on every sample by construction.
at1 optimize compress  signal.npy  signal.at1o  --bound 0.01
at1 optimize verify    signal.at1o
#   -> mode=bounded  max_abs_error=...  certificate=<sha256>

See the Bounded mode overview for measured size-vs-error results. Bit-exact lanes (medical, forensic, evidence, model weights) never use Bounded mode.

Guarantees

  • Never worse than zip — enforced in CI on every release.
  • Tamper-evident — a flipped byte fails verify.
  • Bounded mode bound always holds — and is independently checkable from the certificate.

← Back to Adaptive compression