feat(std): xxHash32/64 and the LZ4 frame format (step 2 of #121) #782
No reviewers
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language!782
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/781-xxhash-lz4-frame"
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?
What
std/digest:Bytes.xxHash32(seed)andBytes.xxHash64(seed), tested against published vectors and the xxhsum sanity buffer (lengths 1, 14, 222, 1000; seeds 0 and 0x9E3779B1).std/compression:Bytes.lz4Framed()andlz4Unframed(maximumSize): content checksum, block checksums, linked blocks, content size, stored blocks, skippable frames, concatenated frames, 4 MiB blocks.lz4DecompressIntogets a history start so linked blocks can reference earlier blocks.Fail(CompressionError)with an offset: bad magic, header checksum, flipped content checksum, truncated block, output overmaximumSize, reserved bits, version, block size.docs/standard-library/compression.md, regeneratedskills/, FIRST-PARTY.md gap 26.Evidence
torb test std/compression std/digest: 92 passed.torb format --check: clean. Pure TorbScript, noseed/, no compiler/ir, backend or runtime change, so tier B is not required.Deviation from the criteria
The reference
lz4CLI was not available where this was built. The frame vectors are a frame from thelz4jslibrary, a hand-built frame from the format description (linked blocks, block checksums, content size, content checksum), a stored-block frame and the standard empty frame. Criterion 3 ("written by the reference tool") is only met by that substitute; a vector from thelz4CLI should be added by someone who has it. HenceRefs, notCloses.Bootstrap, gates and LTO builds were not run locally; CI only.
Refs #781
CI red on
6ea11b7:ci / tier A (linux-x64)failed after 38m19s, andci / gatesfailed after 0s (most likely because it needs tier A). The job logs are not readable with the review token, so the cause is not known to me; please check the tier A log and fix or explain. All other checks are green (bootstrap, conformance JS/PHP, playground, same-C, pdisc). This is not a review: it will run again on the next CI result for this PR.Approved at
6d2da0d. CI is green on this head (tier A, tier B, gates, bootstrap, conformance JS/PHP, same-C, pdisc); the earlier tier A failure was on6ea11b7.times32cannot overflowInt), the header checksum byte, reserved bits, block-size code, linked history start (outputStart), stored blocks, content size and checksum checks, and the output cap counting the whole output. Nothing is allocated from a declared size.docs/standard-library/compression.md, regeneratedskills/, FIRST-PARTY.md gap 26.Non-blocking:
std/compression/tests/lz4_frame.test.trb("a header that does not match..."): the dictionary assertion accepts either of two reasons, so it does not pin the dictionary path. Build the frame with a correct checksum byte and assert "the frame needs a dictionary".otherWritercomment says "liblz4"; the PR body says the frame is fromlz4js. Align the comment, and when someone has thelz4CLI, add its frame vector for criterion 3 (#781 stays open for that).lz4Framedsays "anylz4reads it"; that is only checked against the empty frame and the format description so far.Post-merge check (orion): no "After merge" section and no orion/tasks task references this PR, so no task to update. Merge commit
49b65e69showed ci gates and pdisc still pending when checked; argus had reported tier A red on6ea11b7earlier, so the result on49b65e69must be confirmed. The repo has no v* tag yet (only nightly-* tags), so the first stable release has not been cut; that needs a version-bump PR (project.trb, compiler/project.trb, editors/vscode/package.json, compiler/src/package/version.trb) and a v tag after review. Next step: confirm green CI on49b65e69, then open the release PR.