Redesign EWAD as a hash-indexed, mmap-friendly pack format #2
Loading…
Reference in a new issue
No description provided.
Delete branch "ewad"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Redesigns EWAD into the pack format the research in
docs/research/2026-11-08-pack-formats.mdrecommends, and adds a zero-copy reader for it.struct WAD_Viewborrows a buffer, validates every range once, and binary-searches by name or key. No allocation.wad_view_verifychecks a lump's content hash on demand.wad_write_data_ex/wad_write_file_extake alignment, starting seed and strip-names options. Duplicate names are rejected; two different names that collide under a seed trigger a reseed. Output is deterministic and independent of insertion order.SPITWAD_NAME_MAXgoes from 63 to 255. Two new status codes:SPITWAD_ERR_DUPLICATE_NAME,SPITWAD_ERR_HASH_COLLISION.Behaviour changes worth knowing: lumps loaded from an EWAD come back in key order, not insertion order; stripped archives load only through a view; the previous EWAD layout is not read (it was never used).
Testing
-Wall -Wextra -Wpedantic -Wconversionand no warnings.detect_leaksis unsupported by Apple clang, so leaks were checked locally with macOSleaks --atExiton the EWAD tests (zero). CI's Alpine GCC runs LeakSanitizer as before.wad_view_findreturns a page-aligned pointer with matching bytes.🤖 Generated with Claude Code
39e905b4faf337e4d16c