Artifact 5ca5369bc091b829ba240d1e7209098bc6dbe1d7cc8d14106f2224ec0a1df3b7:
- File
src/crc32.zig
-
2026-08-24 17:53:32
— part of check-in
[b82aacc805]
on branch crc-hardware-143
— crc32: fold with ARMv8's crc32 instruction where the target has it
Checksumming was half the cost of opening a repository: 18.8ms of a 37ms `ls` on a 302MB store, across the two sidecars (26.3MB derived-state image at 13.5ms, 9.7MB log index at 5.3ms). Both measured by doubling the work and taking the delta, so the number is the checksum and not its neighbours.
ARMv8's crc32b/crc32x implement CRC-32/ISO-HDLC -- the same generator this file is already defined in terms of, in the same reflected convention -- so this is an instruction-count change and never a value change, which is what the module doc says every edit here must be. tcl opens in 24.5ms against 38.5ms, output byte-identical.
aarch64 only, deliberately. x86_64's SSE4.2 crc32 instruction is CRC-32C/Castagnoli, a DIFFERENT generator; taking it because the mnemonic matches would orphan every store already written. x86_64 keeps the table path, which stays load-bearing rather than becoming a fallback nobody runs.
The new test recomputes CRC-32 as a plain bit-at-a-time recurrence, independent of update and its tables, and holds both paths to it at every length 0..1024 -- all eight residues mod 8, including the lengths below the fold width. The two paths differ only in where the fold stops and the tail begins, so a divergence would appear at particular residues and nowhere else, which is the shape a spot check misses. Chunked updates are pinned too: the store checksums payloads in 4 KiB pieces, so a path correct only for single-shot input would corrupt exactly the largest artifacts.
Refs #143 (user: dmestas, size: 26149) [annotate] [blame] [check-ins using]
- 2026-08-24 18:46:19 — part of check-in [2a676a5df1] on branch trunk — merge: hardware crc32 and index v3 sorted directory (#143, #145) (user: dmestas, size: 26149) [annotate] [blame] [check-ins using]
-
2026-08-24 17:53:32
— part of check-in
[b82aacc805]
on branch crc-hardware-143
— crc32: fold with ARMv8's crc32 instruction where the target has it