code wiki / (root) / nx_zstd_seqtab.nx

nx_zstd_seqtab.nx

buildroot/runtime/nx_zstd_seqtab.nx

4150 B112 linesdepth 3pulls 3 transitivereach 4 importersview sourcekind librarytopic zstd
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_zstd_fse.nx nx_zstd_seqtab.nx nx_zstd_block.nx nx_zstd_block_gate.nx nx_zstd_seqdec_gate.nx nx_zstd_seqtab_gate.nx

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

27const NX_SEQTAB_LL_MAX: i64 = 35
28const NX_SEQTAB_LL_LOG: i64 = 6
29const NX_SEQTAB_ML_MAX: i64 = 52
30const NX_SEQTAB_ML_LOG: i64 = 6
31const NX_SEQTAB_OF_MAX: i64 = 28
32const NX_SEQTAB_OF_LOG: i64 = 5

functions

36func nx_zstd_seqtab_ll(o: *i64) -> i64
47func nx_zstd_seqtab_ml(o: *i64) -> i64
59func nx_zstd_seqtab_of(o: *i64) -> i64
74func nx_zstd_seqtab_total(o: *i64, count: i64) -> i64
called by 1: main
90func nx_zstd_seqtab_ll_table() -> *NxFseTable
98func nx_zstd_seqtab_ml_table() -> *NxFseTable
106func nx_zstd_seqtab_of_table() -> *NxFseTable