You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
engine: run top-k CMSHeap on FastPath to match what sketch-bench measures #811
The MILP chooses top-k deployments using sketch-bench measurements of cms-heap-topk-fastpath-vector2d. Its cost and accuracy numbers are only valid if ASAPQuery deploys that same sketch. Today ASAPQuery deploys a different one:
As a result, the planned CPU cost and accuracy describe a sketch the engine does not run.
Agreed scope
Switch ASAPQuery’s top-k accumulator to CMSHeap<Vector2D<i32>, FastPath> directly. This issue is intentionally limited to ASAPQuery:
Keep both top-k modes. The updater inserts 1 for count; for sum, it rounds the incoming sample value at the engine boundary and passes an i32 increment to the sketch.
Keep the accumulator integer-only.
Keep JSON diagnostic output, but remove unused JSON deserialization.
Make byte serialization explicitly unsupported. Do not preserve or test the portable MessagePack representation.
Update matrix memory accounting for 4-byte i32 cells.
Add a focused FastPath regression/parity test and retain existing end-to-end top-k coverage.
Out of scope: Go collector/back-end wire compatibility, planner changes, persisted-state migration, and asap_sketchlib changes.
Done when
The engine’s CountMinSketchWithHeap runs on FastPath with i32 counters, matching cms-heap-topk-fastpath-vector2d.
The updater preserves count and sum top-k modes at the engine boundary.
FastPath behavior and existing top-k end-to-end behavior are covered by tests.
Merged from #810 (closed as duplicate). Items #810 had that this issue lists as out of scope, kept here so they aren't lost:
Where the deployed sketch lives: asap_sketchlib portable/countminsketch_topk.rs:21 (SketchlibCMSHeap), wrapped by count_min_sketch_with_heap_accumulator.rs.
Go collector:ASAPCollector/asap-precompute-go emits CountMinSketchWithHeap payloads ASAPQuery decodes with from_msgpack (see asapedgeprocessor/emit_heap_test.go). A sketch built with one hash path and queried with the other puts keys in the wrong buckets, so Go-built heap sketches must move to FastPath hashing or be refused / kept apart.
asap_sketchlib: unmerged branches asapv1-only/cmsheap and asapv1-only/cleanup contain 458d02e ("drop the portable MessagePack format"). Coordinate with that branch.
Activity
milindsrivastava1997 commentedon Oct 27, 2026
Merged from #810 (closed as duplicate). Items #810 had that this issue lists as out of scope, kept here so they aren't lost:
portable/countminsketch_topk.rs:21(SketchlibCMSHeap), wrapped bycount_min_sketch_with_heap_accumulator.rs.ASAPCollector/asap-precompute-goemits CountMinSketchWithHeap payloads ASAPQuery decodes withfrom_msgpack(seeasapedgeprocessor/emit_heap_test.go). A sketch built with one hash path and queried with the other puts keys in the wrong buckets, so Go-built heap sketches must move to FastPath hashing or be refused / kept apart.asapv1-only/cmsheapandasapv1-only/cleanupcontain458d02e("drop the portable MessagePack format"). Coordinate with that branch.milp_output.rsalready mapscms-heap-topk-fastpath-vector2dtoCountMinSketchWithHeap; no planner change needed.