mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-10-01 20:33:50 +00:00
Adds a reports section to the OpenStream spec so its claims rest on a reproducible measurement rather than an assertion. Each report is a run of the envelope over a defined corpus on real hardware: proof that decompression restores every byte, that an incompressible input costs only the framing overhead, that a compressible one saves what it claims against the complete wire size, and how long each codec takes. - docs/openstream/reports/ holds a machine-readable <id>.json (canonical, with a versioned schema) and a rendered <id>.md per report, plus a README on the shape and on submitting one. The seed report is nixamp 0.17.1 over the synthetic corpus, labelled synthetic so no one reads a padded-fixture number as production. - The site renders them at /docs/openstream/reports (index) and /docs/openstream/reports/<id> (one report), under the dynamic /docs/[slug] tree so the reports routes never shadow a spec's own doc page. A small lib/reports.ts reads the JSON at build time; REPORTED_SPECS keeps the route surface explicit. sitemap includes the index and every report. - The spec doc gains a Benchmark reports section linking there, and repeats the honest caveats: OpenStream frames Zstandard and gzip rather than being a new algorithm, synthetic padding flatters a codec, an efficient real feed saves little, and round-trip exactness is the one pass/fail. The report format is produced by `nixamp compression benchmark` (in the nixamp repo); a release runs it and commits the two files here. Claude-Session: https://claude.ai/code/session_01MxNif5tsYq4LczgG7aE8Jp Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2 KiB
2 KiB
OpenStream benchmark — nixamp 0.17.1
Generated 2026-09-12T13:13:15.713Z · envelope NXS1 · schema 1
Environment. bun 1.4.0, zstd f8745da6ff1ad1e7bab384bd1f9d742439278e99, zlib 12731092979c6d07f42da27da673a9f6c7b13586, on linux 7.0.0-30-generic x64, 8× DO-Premium-Intel, 15.6 GiB.
Policy. block 262144 B; eligible at 3% and 512 B; zstd levels 1, 3, 9.
Corpus
| sample | kind | bytes | container | best mode | saves |
|---|---|---|---|---|---|
| random-1mib | synthetic | 1048576 | bytes | stored | stored |
| zeros-1mib | synthetic | 1048576 | bytes | zstd L9 | 99.96% |
| text-repeat-1mib | synthetic | 1048576 | bytes | zstd L9 | 99.95% |
| ts-padded-50pct | synthetic | 752000 | mpegts | zstd L9 | 50.09% |
| ts-unpadded | synthetic | 752000 | mpegts | stored | stored |
| tiny-3b | synthetic | 3 | bytes | stored | stored |
| empty | synthetic | 0 | bytes | stored | stored |
Aggregate, per mode across the corpus
| mode | wire bytes | saving | enc ms | dec ms | round trip |
|---|---|---|---|---|---|
| stored | 4651091 | -0.03% | 0 | 0 | ok |
| gzip L6 | 2189399 | +52.91% | 96.34 | 13.78 | ok |
| zstd L1 | 2180200 | +53.11% | 18.84 | 23.12 | ok |
| zstd L3 | 2177968 | +53.16% | 24.23 | 11.67 | ok |
| zstd L9 | 2177476 | +53.17% | 53.51 | 13.5 | ok |
| ts-zstd L1 | 1127961 | +25% | 15.4 | 9.8 | ok |
Caveats
- Envelope v1: a 16-byte stream header, a 48-byte header per frame, plus one end frame.
- OpenStream is a framing envelope over Zstandard and gzip, not a new compression algorithm; these numbers are those codecs at the block boundary, honestly framed.
- Synthetic samples do not predict production savings. A padded transport stream flatters a codec by its padding; an efficient real feed saves far less. Use --corpus with authorized real samples for numbers that mean something.
- Timings are wall-clock on the machine and runtime named in
environmentand do not transfer to other hardware. - roundTrip:false in any row is a failure of exactness and must block a release.