Skip to content

refactor(processors): drop shim_helpers workaround, import sketches/ wrappers - #235

Merged
zzylol merged 1 commit into
mainfrom
phase2/shim-cleanup
May 4, 2026
Merged

zzylol merged 1 commit into
mainfrom
phase2/shim-cleanup

Conversation

@zzylol

@zzylol zzylol commented May 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Two cleanups across all 5 OTel sketch processor shims, both enabled by PR #232 (which fixed SnapshotCache::ComputeDelta's always-refresh invariant and extracted the canonical wrappers into asap-precompute-go/sketches/):

Net: 17 files changed, 173 insertions(+), 1193 deletions(-) — ~1020 LoC removed across 5 shims (each shim shrinks by ~150-300 LoC).

A handful of test-only helpers (newKLLSketch, serializeKLLSketch, serializeCMS, deserializeCMS, cloneHLL) were the only non-wrapper code in the deleted files; they were preserved in new test_helpers_test.go files (test-build-only) so existing test suites don't need rewrites. One DDSketch helper (decodeDDSketchEnvelope) is consumed by the shim's quantile-emission path and was inlined into shim_helpers.go since the canonical sketches package keeps its decoder unexported.

One downstream test fix: TestCSDelta_MultipleWindowsConvergence was written expecting the pre-#232 buggy semantics (delta against a fixed first baseline); updated to apply each delta to the previous reconstruction, matching the now-correct always-refresh behavior.

Test plan

  • go test -race green for all 5 processors (ddsketch / kll / hll / countsketch / countminsketch)
  • Parity harness all-PASS, 5 envelope groups byte-identical (DDSketch: 6, KLL: 3, HLL: 3, CountSketch: 1, CountMinSketch: 602)
  • No submodule pointer drift committed
  • No changes under asap-precompute-go/ or integration/parity/

🤖 Generated with Claude Code

…wrappers

Two cleanups, both enabled by PR #232:

1. CountSketch and CMS shims drop the applyDeltaTransmission workaround
   (shim-side snapshot cache that mirrored legacy delta-refresh
   semantics). Runtime's SnapshotCache::ComputeDelta now always-refreshes
   correctly, so the workaround is redundant.

2. All 5 shims (DDSketch / KLL / HLL / CountSketch / CMS) drop their
   per-processor sketch_wrapper.go files and import the canonical
   wrappers from asap-precompute-go/sketches/.

Net: each shim shrinks by ~150-300 LoC. Parity harness still all-PASS
byte-identical.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zzylol
zzylol merged commit fd04d97 into main May 4, 2026
@zzylol
zzylol deleted the phase2/shim-cleanup branch May 4, 2026 15:12
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