mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-31 07:23:06 +08:00
The runtime vendored zlib 1.3.1 and archived it at -Os, and host C-lane builds linked the system libz, so deflate, raw deflate and gzip output differed from Node's at every level. The vendored copy is now Node v24.22.0's deps/zlib (Chromium's zlib, 1.3.2.1-motley-285e94b), built at -O3 with the units and defines Node's zlib.gyp selects per target: the SSSE3 Adler-32 and SSE2 inflate and slide-hash code on x86-64, the NEON and ARMv8 CRC-32 code on arm64, and the portable code on wasm32. The SIMD units check the CPU at run time and give the same output, so compressed bytes match Node's on every target. zlibInputs (runtime-pack-common/scripts/zlib-inputs.mjs for the runtime packs, vendor-inputs.ts for Zig cross builds and the sanitized runtime) holds the per-target table, and a unit test keeps the two identical. Every C-lane driver now links the vendored objects instead of -lz. Chromium's BSD license ships beside zlib's in the runtime packs. Corpus 8405 compares compressed bytes with Node across levels, strategies, memLevel, windowBits, dictionaries and flushing streams; 8406 covers chunked inflation with small input pieces and output chunks.