code wiki / _hdl_build / nx_gzip.nx

nx_gzip.nx

buildroot/runtime/_hdl_build/nx_gzip.nx

4027 B72 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind tooltopic gzip
docsdependenciesstructsconstsfunctions

about

nx_gzip.nx -- SOVEREIGN gzip/DEFLATE COMPRESSOR: CLI FRONT END ONLY. ★THE DUPLICATE IS GONE (2026-08-28). Until today this file carried its OWN copy of the entire compressor -- gz_deflate, gz_compress, the CRC32, the bit writer, the Huffman tables and every const -- alongside nx_gzip_lib.nx, which nx_host_router imports to compress every response the estate serves. TWO copies of one DEFLATE. The library's own source had recorded the remedy and nobody had taken it: nx_gzip.nx MUST be reduced to an import of nx_gzip_lib.nx. WHAT THE DUPLICATE COST, MEASURED TODAY: adding lazy matching had to be written TWICE, into two files, and proven twice -- because a fix landing in one copy and not its sibling is half a fix, and the half left undone is the one that ships. The next change already named on /compare/performance as rung PF3, dynamic Huffman at a measured further 11.3 percent, would have paid that tax again. ★A SHARED RULER THAT IS COPIED IS NOT SHARED. This file is now the CLI and nothing else: argument parsing, the selftest entry, and the report line. Every byte of compression logic lives ONCE, in the library the serving router already imports -- so the tool that MEASURES the estate's compression and the code that PERFORMS it can no longer drift apart. That equality is not a promise here, it is a property: there is only one gz_deflate now. Usage unchanged: nx_gzip <infile> <outfile> [mode 2 default|0 stored] | selftest Correctness oracle unchanged: STANDARD gunzip byte-identical.

dependencies 1 imports · 0 importers

nx_gzip_lib.nx nx_gzip.nx

imports: nx_gzip_lib.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gz_w sys_write gz_compress sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gz_deflate gz_putbits gz_flushbits sys_mmap ↻ gz_fill_len gz_fill_dist gz_hash3 gz_lencode gz_distcode gz_dh_lens sys_mmap ↻ gz_dh_pow2 gz_dh_canon sys_mmap ↻ gz_dh_clrle gz_dh_fill_clperm gz_dh_fixlen gz_puthuff gz_putbits ↻ gz_rev gz_fixed

structs

none

consts

none

functions

25func main(argc: i64, argv: *i64) -> i64