nx_zstd_seqtab.nx
buildroot/runtime/nx_zstd_seqtab.nx
about
nx_zstd_seqtab.nx -- Zstandard's three PREDEFINED sequence distributions.
These are spec DATA, transcribed from RFC 8878 rather than reconstructed --
a distribution that is merely plausible produces a decoder that looks right
and disagrees with every other zstd implementation on real files.
A NEGATIVE ONE IS A REAL ENTRY, NOT A TERMINATOR. In an FSE normalized
count, -1 means "less than one in this table": the symbol is present, it
occupies a single low-probability slot, and it counts as ONE toward the
total. Dropping the -1 entries -- the obvious reading, since they look like
end markers -- leaves the counts short of the table size and the build
refuses, which is the good outcome. Treating them as zero is the bad one:
the rarest symbols become undecodable and only some files break.
THE SUM IS THE TRANSCRIPTION CHECK. Each distribution must total exactly its
table size -- 64, 64 and 32 -- and nx_fse_build_dtable enforces that. A
single mistyped digit almost always breaks the sum, so a successful build is
meaningful evidence the numbers are right, not just that they parse.
genealogy_id: rfc8878_default_distributions
lineage_id: nx_zstd_seqtab_v1
license_tier: ORIGINAL
dependencies 2 imports · 4 importers
imports: nx_syscalls.nxnx_zstd_fse.nx
imported by: nx_zstd_block.nxnx_zstd_block_gate.nxnx_zstd_seqdec_gate.nxnx_zstd_seqtab_gate.nx
structs
| none |
consts
| 27 | const NX_SEQTAB_LL_MAX: i64 = 35 |
| 28 | const NX_SEQTAB_LL_LOG: i64 = 6 |
| 29 | const NX_SEQTAB_ML_MAX: i64 = 52 |
| 30 | const NX_SEQTAB_ML_LOG: i64 = 6 |
| 31 | const NX_SEQTAB_OF_MAX: i64 = 28 |
| 32 | const NX_SEQTAB_OF_LOG: i64 = 5 |
functions
| 36 | func nx_zstd_seqtab_ll(o: *i64) -> i64 |
| 47 | func nx_zstd_seqtab_ml(o: *i64) -> i64 |
| 59 | func nx_zstd_seqtab_of(o: *i64) -> i64 |
| 74 | func nx_zstd_seqtab_total(o: *i64, count: i64) -> i64 called by 1: main |
| 90 | func nx_zstd_seqtab_ll_table() -> *NxFseTable |
| 98 | func nx_zstd_seqtab_ml_table() -> *NxFseTable |
| 106 | func nx_zstd_seqtab_of_table() -> *NxFseTable |