# QNum — public benchmark release v3

**Numeric compression, measured on real records and reproducible industry layouts.**

QNum is Qytte's licensed numeric-data product. It can be used with QSwift or Qompress and optionally with Qstream Smart Builder. This folder contains public evidence and open inspection/sample/baseline tools — **not the proprietary SDK, trainer or profiles**.

## Start with the results

- **2,324 native configurations** across three frozen studies; three byte-exact encode/restore repetitions per configuration.
- **18 generated workload families and four real public datasets**, covering numeric logs, telemetry, market, energy, carbon-emissions and air-quality records.
- **Up to 55.73% smaller complete files on real records**: household energy, QNum versus same-level plain QSTR at Zstandard level 3.
- **Up to 84.69% smaller complete generated retail files**, same codec/level-3 baseline. This selected synthetic result is not an expected saving for every retailer.
- **Measured native encode/restore speed and process peak RAM**, with 8 and 32 MiB real-energy size scaling in the original study.
- **Measured Node and Python-to-Node application calls, training CPU/RAM and 400 concurrent round trips**, with exact replay checks.
- **Six byte-exact Parquet row-archive comparisons** on the new real datasets; original record bytes, including decimal spellings and line endings, restored unchanged.

Read **BENCHMARK-RESULTS.md** for headline tables and every native comparison, including controls and net losses. Use **summary.csv** for sortable dataset/codec/mode totals. The raw JSON files preserve all repetitions and provenance.

## Real-data highlights — QNum at level 3

| Real dataset | Complete-file reduction | Encode MB/s | Restore MB/s | Encode peak MiB |
|---|---:|---:|---:|---:|
| Household energy | 55.73% | 13.83 | 62.01 | 6.95 |
| Market records | 37.16% | 25.05 | 116.14 | 6.36 |
| Air-quality sensors | 36.62% | 7.01 | 51.73 | 6.49 |
| Carbon-emissions records | 49.30% | 8.82 | 69.00 | 6.94 |

These selected wins use same-codec, same-level plain QSTR on identical input. QNum rows have no profile overhead. The larger-file RAM results must not be replaced by small-file peaks. Speed is measured throughput, **not a claim of speed superiority against another compressor**.

## What each file is for

| File | Purpose |
|---|---|
| README.md | This guide: findings, accounting, sources and audit instructions |
| BENCHMARK-RESULTS.md | Complete current tables, highlights, host/training/concurrency/Parquet scope |
| HISTORICAL-RESULTS.md | Preserved earlier generated stream results, separate from SDK measurements |
| summary.csv | Every native study/dataset/codec/level/mode aggregate, including losses |
| runtime-results.json | Original 1,064 native configurations, real data and size-scaling/control results |
| expanded-results.json | 1,008 additional configurations: eight synthetic sectors, three test files each |
| real-extension-results.json | 252 configurations: three test slices each from CO₂ and Air Quality |
| host-results.json | Node/Python application repetitions, training resources, bounded concurrency |
| columnar-results.json | Parquet exact-byte row archive measurements and all repetitions |
| inspect-results.py | Standalone Python checksum/provenance/accounting audit and report generator |
| generate-samples.py | Open generator for eight added numeric layouts; no Qytte SDK dependency |
| parquet-baseline.py | Open PyArrow Parquet row-archive baseline; no Qytte SDK dependency |
| SHA256SUMS.txt | Integrity hashes for every file above |

This is a public evidence package. No production licence keys, engine source, compiled SDKs, private profiles or redistributed third-party input archives are included. When quoting a percentage, keep the workload, codec/level and complete-file/profile accounting with it, and see BENCHMARK-RESULTS.md for the full tables including losses.

## Verify the download (no Qytte SDK needed)

Requires Python 3.10 or newer. Open a terminal in the extracted folder:

```sh
python3 inspect-results.py .
```

Windows users may use `py inspect-results.py .`. The script verifies available checksums, recorded byte-exact flags, all three native repetitions, disjoint training/test hashes, training provenance and complete-stream fallback. **It audits recorded evidence; it does not rerun compression or independently restore unavailable proprietary streams.**

To regenerate the tables and CSV from the frozen JSON:

```sh
python3 inspect-results.py . --write
```

On Linux, file integrity can also be checked with `sha256sum -c SHA256SUMS.txt`.

## Generate the additional public sample layouts

```sh
python3 generate-samples.py ./samples
```

This creates 16 training and 24 held-out test files plus a SHA-256 manifest. Fixed seeds and target sizes are documented in the generator. These JSONL samples simulate numeric industry layouts; they are not customer records. Rerunning QNum requires a separately licensed private SDK — it is intentionally not bundled here.

The open Parquet baseline requires `python3 -m pip install pyarrow`. Run `python3 parquet-baseline.py PATH_TO_REAL_SLICES` against a directory containing co2-real/test-*.bin and air-real/test-*.bin. Results are written beside that script. It measures one binary column of original row bytes, not typed field queries or zero-copy numeric columns. Source slices are not redistributed; request the private reproducible evaluation workflow or recreate the original contiguous slices from recorded source URLs, byte sizes and hashes.

## How to read the comparisons

- **Plain**: same-codec QSTR baseline; **QNum**: optional numeric workflow; **Smart**: original-data profile; **Combined**: QNum plus companion Smart Builder profile. **Bare**: ordinary Zstandard without QSTR.
- **Stream saving** = 100 × (1 − complete output bytes / plain complete output bytes).
- **Net saving** additionally counts each actually required profile once within the dataset/settings/mode test batch. Profiles are not counted per file. Changing batch size changes amortisation.
- QNum fallback keeps the complete plain result on ties/losses; combined fallback keeps the Smart result. This does not guarantee a win versus ordinary compressed data or after unused profiles are deployed. Never add the products' percentages.
- **MB/s** uses original bytes and decimal MB. **MiB** is binary memory. **Process peak RAM** includes input, libraries, profiles and runtime; it is not codec working memory. Python and child Node peaks are separate, not simultaneous combined RSS.
- Native measurements: fresh sequential Linux process per phase, three repetitions, median wall/CPU and maximum VmHWM. Timing includes SDK competition, internal checks and restore validation; excludes startup, file I/O, profile training and lease networking. Host/compiler/library metadata is recorded per sitting; frozen timings from different sittings are never pooled into one speed.
- Application calls use persistent processes with warmup; concurrent and Parquet tests include different overheads. Compare their documented boundaries, not just their numeric speeds.
- Historical results are preserved separately; they count prototype streams and cannot replace complete-container evidence.

## Sources and attribution

1. **Binance Vision BTCUSDT trades, 1 January 2024**: https://data.binance.vision/data/spot/daily/trades/BTCUSDT/BTCUSDT-trades-2024-01-01.zip . Unmodified contiguous CSV slices. Public access is not an assertion of redistribution rights.
2. **UCI Individual Household Electric Power Consumption**: Georges Hebrail and Alice Berard; CC BY 4.0; DOI https://doi.org/10.24432/C58K54 . https://archive.ics.uci.edu/dataset/235/individual+household+electric+power+consumption . Original semicolon records, header excluded.
3. **UCI Air Quality**: S. De Vito; CC BY 4.0; DOI https://doi.org/10.24432/C59K5F . https://archive.ics.uci.edu/dataset/360/air+quality . Original CSV slices retain numeric spellings and line endings.
4. **Our World in Data CO₂ dataset**: https://github.com/owid/co2-data and https://ourworldindata.org/co2-and-greenhouse-gas-emissions . Cite OWID and the original source providers listed there; original-provider terms may differ. The source download SHA-256 records the exact snapshot used, not an assurance that the moving master URL stays unchanged.

Every native dataset records source URLs, input/archive hashes, byte sizes and disjoint training/test selection. Public files contain measurements, not source archives or trained profiles.

## Completed studies and deployment-specific boundaries

Completed: native compression/restore, controls, complete-file and net-profile accounting, broader real records, all listed generated workload families, QSwift/Qompress/Smart Builder combinations, Node/Python application calls, training resources, bounded concurrency/latency and exact-byte Parquet row replay.

Customer deployment still determines multi-hour soak, network/storage buffering, long-term profile drift, larger training sets and typed Arrow/database field queries. Short bounded tests do not certify those conditions. kdb+ cannot be measured without a licensed runtime. No universal saving, fixed RAM budget or guaranteed production rate is claimed.

QNum and Smart Builder SDK evaluation/licensing: https://qytte.com/licensing . Product evidence: https://qytte.com/qnum .
