Skip to content

test(data_plane): gate the KLL byte-parity round-trip test #[ignore] - #237

Merged
zzylol merged 1 commit into
mainfrom
pr-kll-byte-parity-ignore
May 14, 2026
Merged

zzylol merged 1 commit into
mainfrom
pr-kll-byte-parity-ignore

Conversation

@zzylol

@zzylol zzylol commented May 14, 2026

Copy link
Copy Markdown
Contributor

The pre-existing kll_envelope_round_trip_through_backend_adapter failure (flagged in #236) — diagnosed and resolved.

Root cause

reconstruct_via_runtime(KLLSketch, …) rebuilds the KLL by replaying the envelope's retained items through KLLWrapper::apply_deltaupdate(). For an input large enough to compact (the test feeds 400 items at k=200 → 2 levels), that re-feed re-compacts the already-compacted set — lossily, and with a fresh RNG seed (None) instead of the original's Some(42). So the re-snapshot is a valid KLL summary but not byte-identical. The test's "single-level layout" rationale was factually wrong for this input.

KLL's coin state is on the wire (KllState.coin), but asap-precompute-rs has no KLL::from_wire_state to consume levels/items/coin directly — apply_delta is item-replay only. Byte parity needs that upstream API (asap_sketchlib#41).

Fix

#[ignore] the byte-parity test with a precise reason — exactly the existing pattern for HLL/CS/CMS in this file. The structural round-trip test for KLL stays live. File header updated.

Test plan

  • cargo test -p data_plane --test edge_runtime_consumes_precompute_rs — 5 pass, 4 ignored, 0 failed (was 1 failed)

🤖 Generated with Claude Code

`kll_envelope_round_trip_through_backend_adapter` asserted a
byte-identical `snapshot → reconstruct_via_runtime → snapshot`
round-trip, but that is not achievable in-repo:

`reconstruct_via_runtime(KLLSketch, …)` rebuilds the sketch by replaying
the envelope's retained `items` through `KLLWrapper::apply_delta` →
`update()`. For an input large enough to compact (the test feeds 400
items at k=200 → 2 levels), that re-feed re-compacts the already-compacted
item set — lossily, and with a fresh RNG seed (`None`) rather than the
original's `Some(42)`. The re-snapshot is a valid KLL summary but not
byte-identical. The test's "single-level layout" rationale was simply
wrong for this input.

KLL's coin state *is* on the wire (`KllState.coin`), but `asap-precompute-rs`
has no `KLL::from_wire_state` to consume `levels`/`items`/`coin` directly —
`apply_delta` is item-replay only. True byte parity needs that upstream
API, tracked in `asap_sketchlib`#41.

So this matches the existing pattern for HLL/CS/CMS in this file:
`#[ignore]` with a precise reason, gap visible, CI green. The structural
round-trip test for KLL stays live. File header updated to move KLL into
the "byte parity blocked on upstream" bucket.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zzylol
zzylol merged commit 8242c81 into main May 14, 2026
@zzylol
zzylol deleted the pr-kll-byte-parity-ignore branch July 17, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant