test(hotpath): pin byte-locked checksum literals (LAB-1602) - #24
test(hotpath): pin byte-locked checksum literals (LAB-1602)#2427Bslash6 wants to merge 1 commit into
Conversation
…sserts (LAB-1602) The three checksum tests asserted cachekit_core::checksum(x) against values derived from cachekit_core::checksum(x) itself — green for any implementation, so a cachekit-core bump that moved the xxHash3-64 primitive could never fail CI (LAB-1492 had to hand-diff crate sources). Expected values are now hard-coded literals, same discipline as derives_byte_locked_keys. The empty-input vector matches the upstream xxHash3-64 reference, so the primitive's identity is verifiable against the spec independent of cachekit-core.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour. 📝 WalkthroughSummary by CodeRabbit
WalkthroughThe checksum tests now use fixed xxHash3-64 literals. They verify canonical payload bytes and parse expected values from locked hexadecimal strings instead of generating checksums during assertions. ChangesChecksum regression coverage
Merge Risk: ⚪ Minimal · up to This test-only change replaces tautological checksum assertions with fixed reference literals, improving detection of checksum or serialization drift without changing production behavior; no actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
|
@27Bslash6 — ready for your signoff. Automated review gates are clean on head
Diff is test-only ( |
Closes LAB-1602.
Problem
The three checksum tests in
hotpath/src/compute.rsassertedcachekit_core::checksum(x)against values derived fromcachekit_core::checksum(x)itself — green for any implementation. Acachekit-corebump that moved the xxHash3-64 primitive could never fail CI; on LAB-1492 (#12) the 0.3→0.4 bump had to be verified by hand-diffing published crate sources.Change (test-only)
checksum_matches_byte_locked_literals: pinschecksum(b"")=2d06800538d394c2(the upstream xxHash3-64 reference vector — verifiable against the spec independent of cachekit-core),checksum(b"skyline")=867903f9a19a1915, the canonical msgpack payload bytes for{"rust": 42}, and its checksum573a48b587ebc7b9(shared constRUST_42_XXH3). Payload bytes are pinned before the checksum so serialization drift can't masquerade as checksum drift.verify_reports_checksum_and_validity,verify_detects_corruption_via_expected_checksum,checksum_hex_roundtrip_and_rejection: expected values now come from the literals, not the live primitive. Zero tautological checksum assertions remain.Same discipline as the existing
derives_byte_locked_keys.Proof
RUST_42_XXH3fails 3 tests with clearleft/righthex diffs; restored → 14/14 green.xxhash— all match.cargo test --locked14/14,cargo clippy --all-targets --locked -- -D warningsclean (native),cargo clippy --target wasm32-unknown-unknown --locked -- -D warningsclean.