Conversation
…#1652) First slice of codec versioning: record an explicit codec name+version in the L3 handoff manifest so payload representations are namespaced rather than guessed, and refuse a payload this build cannot decode before assembly. - Add PayloadCodec { name, version } and CODEC_RAW / CODEC_RAW_VERSION. raw is the only implemented representation; the segment bytes are unchanged. - HandoffManifest gains a #[serde(default)] codec field, defaulting to raw. A manifest written before codec identity existed has no field and reads as raw — backward compatible, and MANIFEST_VERSION is unchanged so existing on-disk entries stay valid. - reject_unsupported_codec gates both try_commit (nothing unassemblable is ever persisted) and assemble (an unknown codec/version is a miss, never a silent misinterpretation of the bytes). Tests (skippy-cache, l3): explicit-raw round trip, legacy manifest without a codec field reads/assembles as raw, unknown codec refused at commit (no manifest left) and before assembly, unknown raw version refused on both paths, and a supported-codec payload whose bytes are corrupted still fails digest verification. No Q8/Q4 data path, request-path, or #1650/#1651 changes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
This pull request is currently a draft. Reviews will not take place until the PR is marked as ready for review. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…d paths (#1652 review) Addresses scama's two compatibility blockers on the raw codec slice. 1. Codec identity was downgradeable. With a serde-default codec at a fixed manifest version, the field could be stripped to force a raw reinterpretation of possibly non-raw bytes (the whole-payload digest still matches those bytes, bypassing the gate). Fix: bump MANIFEST_VERSION to 3, which *requires* an explicit codec, and add LEGACY_MANIFEST_VERSION (2) decoded as raw through an explicit legacy path. `codec` is now `Option<PayloadCodec>` so a stripped v3 codec is detectable and rejected instead of defaulted. 2. Unsupported codecs were locatable "hits". decode_manifest now centrally rejects an unsupported/absent codec, so every load path enforces it: startup reconciliation quarantines the manifest, manifest_for_prefix prunes the bad link and locate_longest falls back to a shorter supported prefix, and a direct load_manifest fails — all before segments are read or the LRU heats. Tests: downgrade (strip codec from a current-version manifest rejects; a genuine v2 legacy manifest still reads/assembles as raw), on-disk direct-load rejection, startup reconciliation quarantine, and locate_longest unsupported-longest/supported-shorter fallback — in addition to the existing round-trip, unknown-codec/version, and corruption-guard cases. Scope unchanged: payload-level raw-only; per-segment/mixed codec identity is later #1652 work. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…commit/assemble (#1652 review) try_commit and assemble checked codec support but not manifest.version, so a raw-codec manifest carrying an unknown future version could be persisted (and its segments read) even though decode_manifest/load_manifest reject it on the next read. Centralize both checks in validate_manifest_compatibility (supported current/legacy version + supported codec) and call it before commit and before any segment access. Regressions: a future-version raw manifest is refused by commit (leaving no persisted manifest) and before assembly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Exact-head code review and the required cache performance gate now pass at Compatibility review:
Validation:
Matched performance gate:
The roughly 0.2% lower restore median is within normal run noise. No material restart, reuse, or throughput regression is visible from the manifest-version and codec-validation change. |
Bumps the L3 manifest format to v4 and moves codec identity down to the segment level, the contract #1652 needs before any non-raw codec exists: each segment names its codec, representation version, exact/lossy class, decoded length, and (lossy only) calibration digest. - MANIFEST_VERSION is now 4 and requires explicit identity on every segment; v3 (#1750, payload-level codec) and v2 (pre-codec) become explicit legacy read paths, never written. - The per-segment identity is Option only so a v4 manifest with the field stripped is detectable and rejected — it never falls back to the payload codec or to raw. The check runs in decode_manifest (load), try_commit (persist), and assemble (read), so nothing unloadable is ever persisted or partially served. - CodecClass distinguishes exact entries (payload-digest verified) from lossy ones (calibration-namespaced, never satisfy an exact lookup). A lossy identity must carry a calibration digest; an exact identity must decode to its own stored bytes. - Writers stamp SegmentCodecIdentity::raw on every segment; capability negotiation names the offending segment index on refusal. Regressions: v4 per-segment stamping round trip, v3 read compatibility, v4 stripped-segment rejection at load/commit/assemble (single and all segments), unsupported segment codec naming the segment, and decoded_len mismatch refusal.
First slice of #1652 (codec versioning). Introduces an explicit raw codec identity + version in the L3 handoff manifest, enforces it by manifest version (not defaultable), and rejects unsupported codecs at every load path before segments are read or the LRU heats.
Stacked on
scama/skippy-l3-streaming-restore(#1736 head7247a397a). Payload-level, raw-only. No Q8/Q4 data path, no request-path performance work, no #1650/#1651 changes. Per-segment/mixed codec identity is later #1652 work.What it does
PayloadCodec { name, version }withCODEC_RAW/CODEC_RAW_VERSION.raw(uncompressed exact state) is the only implemented representation — segment bytes are unchanged.MANIFEST_VERSIONis bumped to 3, which requires an explicit codec.LEGACY_MANIFEST_VERSION = 2is decoded as raw through an explicit legacy path.HandoffManifest.codecisOption<PayloadCodec>purely so a v3 manifest with the codec stripped is detectable and rejected, rather than silently reinterpreted as raw (the whole-payload digest matches the stored bytes, so a serde default would bypass the gate — the downgrade hole this fixes).decode_manifest. Every load path enforces codec support before returning a manifest:reconcile_startup→validate_committed_manifest→load_manifest→ quarantines an unsupported manifest;manifest_for_prefixprunes the bad prefix link and returns a miss, solocate_longestfalls back to the shorter supported prefix;load_manifestfails.try_commitnever persists an unassemblable manifest, andassemblerefuses one before reassembly.Tests (
skippy-cache)manifest_stamps_explicit_raw_codec_and_round_tripslegacy_manifest_without_codec_field_reads_and_assembles_as_rawstripping_codec_from_current_version_rejects_but_legacy_v2_reads_as_raw(downgrade regression)on_disk_unsupported_codec_fails_direct_loadstartup_reconciliation_quarantines_unsupported_codec_manifestlocate_longest_skips_unsupported_codec_and_falls_back_to_shorter(tier fallback)unknown_codec_is_refused_at_commit_and_leaves_no_manifest,unknown_codec_is_rejected_before_assembly,unknown_raw_codec_version_is_rejected_at_commit_and_assembly,codec_gate_does_not_mask_payload_corruptionValidation
cargo test -p skippy-cache: 131 passed / 1 ignored / 0 failed.cargo clippy -p skippy-cache --all-targets -- -D warnings: clean.cargo fmt: clean. (skippy-benchdoes not depend onskippy-cacheon this base, so it is unaffected.)🤖 Generated with Claude Code