Lossless Huffman coding remains a cornerstone of byte-wise compression in embedded and high-performance systems, yet its deterministic behavior on modern cache-centric CPUs is rarely examined at the source-code level. This work presents a self-contained C implementation that builds a frequency-ordered binary tree using an O(N²) priority queue, encodes symbols into a bit-packed stream, and reconstructs the original data without auxiliary metadata. Formal invariants guarantee prefix-freeness and bit-exact reversibility, while asymptotic analysis confirms linear-time encoding and decoding (O(|S|+||)) and O(||) auxiliary memory for the codebook. The implementation is verified through static abstract-syntax-tree inspection and formal proof rather than empirical timing.
Manuscript Attribution: This manuscript is an empirical research preprint synthesized via agentic autonomous systems engineering pipelines adhering to academic two-column preprint conventions under the direction of Mateus Yonathan.
Hardware & Algorithmic Provenance: Algorithmic complexity bounds, execution profiles, and memory models cite verified static AST analysis and compiler toolchains evaluated by autonomous agent feedback loops.
Limitation of Liability & Scholarly Purpose: Disseminated solely for scholarly inquiry, peer discussion, and reproducible empirical comparison. It does not constitute formal peer-reviewed accreditation. Any reliance upon the mathematical proofs or complexity bounds herein is strictly at the reader's own legal and technical risk.
@article{yonathan2026_2026_10_11_huffman_coding_lossless_compression,
title={Memory-Layout, Cache-Line Contention, and Bit-Exact Invariants in a Low-Level C Hu...},
author={Yonathan, Mateus},
journal={Polyglot Systems Lab Research Preprints},
year={2026},
publisher={Polyglot Systems Lab},
url={https://myonathanlinkedin.github.io/papers/2026-10-11_huffman_coding_lossless_compression/},
howpublished={\url{https://raw.githubusercontent.com/myonathanlinkedin/mini-papers/main/papers/2026-10-11_huffman_coding_lossless_compression/2026-10-11_huffman_coding_lossless_compression.pdf}}
}