# Exact numeric-run columns (container 10/11)

The unpublished 5.0.0-rc5 reader adds a self-contained numeric model for maximum-density standalone compression. It competes in Native and Hybrid `--thin`; default and fast routes retain their existing behavior. External dictionaries and configured servers retain their established path. Larger-than-16-MiB inputs use the normal route unless processed as bounded stream frames.

```sh
pizd compress application.log --standalone --offline --thin -o application.pizd
pizd decompress application.pizd --offline --strict-capabilities -o restored.log
cmp application.log restored.log
```

## Model

Scan exact ASCII digit runs, wherever they occur. Preserve all other bytes, including signs, decimal/exponent separators, record order, whitespace, punctuation and NULs. Runs of 1–38 digits become unsigned 128-bit values with their exact digit width; longer runs remain literal. Leading zeros are restored from that stored width.

Two groupings compete: digit width alone, and digit width plus up to twelve preceding delimiter bytes (since the preceding converted run). There are no hardcoded field names, timestamp parsers or log-family identifiers. Discovery keys need not be stored: the skeleton explicitly identifies each column. Grouping by delimiter context can distinguish fields with the same digit width.

For example, the width-only grouping of:

```text
t=001020 code=200 size=1200
t=001021 code=200 size=1204
t=001022 code=404 size=1208
```

stores six-digit values `[1020, 1021, 1022]`, three-digit values `[200, 200, 404]` and four-digit values `[1200, 1204, 1208]`. Their signed differences from the previous value (initially zero) are `[1020, 1, 1]`, `[200, 0, 204]` and `[1200, 4, 4]`. Zigzag conversion and unsigned LEB128 serialize these differences. The exact skeleton and column widths reconstruct `001020`, not `1020`. The example illustrates the transform, not a benchmark claim.

Each candidate is encoded through an ordinary complete PIZD archive with the selected Native/Hybrid backend. Source-specific transforms and pattern mining are disabled for this opaque model. Ordinary binary/channel backend competition may still apply. Only a smaller **complete** numeric archive replaces the incumbent; ties retain it. Failed candidates still cost encoding work.

## Numeric model grammar

All variable integers are canonical unsigned LEB128, bounded to 128 bits. Counts and references must also fit the platform size type.

1. Eight-byte magic `NUMSTR01`, followed by mode byte `1` (per-column deltas).
2. Column count and skeleton byte length, then the skeleton.
3. For every column: one-byte original digit width, value count, then Zigzag-coded delta varints in source-occurrence order.

In the skeleton, nonzero bytes are literal. Byte zero followed by integer zero means a literal NUL. Byte zero followed by integer `i+1` consumes the next value from column `i`. The model stores every column value, width and reference needed for reconstruction; no source-side schema or dictionary is needed.

The encoder accepts at most 16 MiB per model and 4,096 columns. Decoder column cursors reference the stored varints rather than allocating an array of reconstructed scalar values. Counts, widths, arithmetic, references, output growth, unused values and trailing bytes are checked against declared source limits. These checks do not constitute an exhaustive hostile-input security audit.

## Outer container and compatibility

Container **10** uses SHA-256 source integrity; **11** uses BLAKE3. Both preserve the ordinary 51-byte PIZD header with zero outer flags and zero patterns, followed by the four-byte little-endian nested-archive length and exactly one complete nested PIZD archive of the numeric model. The source size and checksum describe the original file, not the model.

The nested frame must use an existing version 1–9, have no patterns or remote/embedded-pattern flags, and declare a model size at most `min(8 * original_size + 1024, 2 GiB)`. Nested numeric wrappers are rejected before invoking the ordinary decoder, preventing recursive wrapper chains. The nested model checksum is always verified. Normal source verification additionally checks the reconstructed file against the outer checksum; the original byte length is always checked.

Existing versions 1–9 remain readable. Readers that predate this extension reject numeric versions 10/11 explicitly. Archive suffixes and the separate pattern database format are unchanged. No public stable release or new signature protocol is implied by this prerelease implementation.

## Cost and measured scope

The outer wrapper costs 55 bytes in addition to the complete nested codec frame. The research envelope cost 48 bytes, so production predictions pay seven more bytes. No dictionary/model/checksum overhead is subtracted from benchmark totals.

The model adds two discovery/encoding trials to eligible thin compression and reconstructs numbers during decoding. It is a size/speed/memory tradeoff, not a faster entropy coder. Discovery is linear in input and token bytes with expected hash-table lookup cost; retained scalar arrays, skeletons and backend workspaces increase encoder memory. Grouping by context can hit the column cap and fall back to width-only/incumbent candidates.

See the [complete density evidence](benchmarks/numeric_density_rc4/README.md) for fixed parameters, input provenance, every losing research variant, production identities, matched CLI timings, later nonoverlapping windows and compatibility checks. The approach combines established transposition, delta coding, Zigzag and backend techniques; no new information-theoretic coding method is claimed.
