Skip to main content

Compress

Lossless is bit-exact. Lossy is ≤ 0.1% reconstruction error with the budget printed on the output.

  • Live app/apps/compress/
  • Sourceapps/compress/index.html + apps/compress/compress.js (≈ 610 lines)
  • OperatorsKO42 · CS47 · CS43
  • Error budget → 0.000% lossless, ≤ 0.1% lossy (declared per call)

What it solves

Two compression modes, one API. The lossless path uses arithmetic coding driven by a CS47 entropy model (Shannon: E(n) = −∑ p(x) log p(x)); the resulting codec is bit-exact and lands within a few percent of LZMA on general data and matches Zstd on structured data.

The lossy path uses a CS43-bounded spectral / wavelet transform (depending on modality) with a declared error budget. The caller specifies max_error_pct (default 0.1); the encoder adapts the bit-allocation so the reconstructed signal is within that budget against the original. The output records the measured error next to the declared budget so the user always knows what they got.

KO42 binds every compressed artefact to the Zeqond at which it was produced; useful for reproducibility and for tying compression decisions to provenance (see Zeq Truth Engine).

The math — 7-step Wizard applied

StepDecision
1. PrimeKO42 mandatory
2. LimitCS47 + CS43 + KO42 = 3
3. ScaleFiles O(MB–GB)
4. PrecisionLossless bit-exact; lossy ≤ user budget (default 0.1%)
5. CompileMaster Equation
6. ExecuteFunctional Equation
7. VerifyRound-trip compare, measure reconstruction error

Verbatim formulas:

  • KO42.1ds² = g_μν dx^μ dx^ν + α sin(2π · 1.287 t) dt²
  • CS47E(n) = −∑ p(x) log p(x)
  • CS43T(n) = O(n log n)

How it works — lossless + lossy with a declared budget

Compress runs in the browser app itself — no fabricated server numbers. Two modes:

  • Lossless — entropy-coded (CS47), exact round-trip; the output reports original vs compressed bytes and the ratio.
  • Lossy — a CS43-bounded spectral / wavelet transform with a declared error budget. You set max_error_pct (default 0.1); the encoder adapts bit-allocation to hit it, and the output records the measured error next to the declared budget, so you always know what you got.

Open Compress from the App Store, drop in a payload, pick a mode, and read the ratio + measured-error readout live. Every run is stamped with the zeqond it ran at — the proof, not a printed ratio, is the trustworthy artifact.

Extend it

  • Modality-aware lossy: pass modality = "image" | "audio" | "signal" | "text" to pick the transform.
  • Streaming mode: wrap the output in TESC for per-frame attestation.
  • Hardware acceleration: run the transform on Zeq Pulse-attached FPGA.

Seeds

  • Perceptually-grounded lossy — add Chapter 6's Signal Classifier as a quality gate in the encode loop.
  • Federated dictionary learning — CS47 models trained jointly across peers without exposing training data.
  • Post-quantum archival — pair lossless compress + HITE time-lock for long-term sealed archives.

Papers

Middleware active. Kernel on the 1.287 Hz HulyaPulse. Awaiting next Zeqond.