Repository navigation
feat: binary format v2 — CRC32, header padding, strict reader, zero-copy ready - #62
Merged
Merged
Conversation
…opy ready Binary format changes (format v2): - Pad JSON header to 8-byte boundary for zero-copy Float64Array views - Add CRC32 checksum over entire file (excluding checksum field) - Cap headerLen at 1MB before allocation (DoS mitigation) - Assert payload size = rows × cols × 8 exactly (catches truncation) - Strict reader: unknown keys throw, missing required keys throw - normalizeHeaderKeys uses Object.create(null) (prototype pollution fix) - Module-init endianness assertion (LE required) - Backward compatible: v1 files still loadable Also includes: - SVD one-sided Jacobi with m<n transpose fix - Cross-compat test suite (22 tests) with Python fixture parity - Correctness test suite (127 tests) with Python-generated fixtures - 268 total tests passing across 8 suites - Python writer updated to v2 format - CHANGELOGs updated in both npm and Python packages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades binary format from v1 to v2 with critical safety and performance fixes. Both npm () and Python () packages updated.
Binary format v2 changes
Also included
Backward compatibility
Test plan
tsc --noEmit)