feat(ingest): consume asap-precompute-rs for envelope/delta/merge logic - #76
Merged
Merged
Conversation
ASAPQuery-backend ingest path now uses asap-precompute-rs (Rust edge runtime) for shared logic: envelope parsing, delta application, sketch state reconstruction, merge. Query-side engine (PromQL aggregation, storage, query planning) stays in this repo. Phase 3 step 3 of the ASAP edge-framework migration. DDSketch + KLL byte parity on upstream asap_sketchlib (#40, #41). HLL/CountSketch/CMS still pending — functional tests gated with #[ignore = "blocked on ASAPCollector#243"]. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
asap-precompute-rs(the host-neutral Rust edge runtime). The same code now runs in agents and the backend.asap-query-engine/src/precompute_operators/edge_runtime_adapter.rsre-exports asap-precompute-rs's runtime view types (SketchEnvelope,Encoding,SketchType, theSketchtrait family) and exposesreconstruct_via_runtime/unwrap_envelope_state/encode_ddsketch_envelope/merge_ddsketches_via_runtimehelpers used by thedecode_modified_otlp_sketch_byteshot path.asap_sketchlibPRs feat(sketch-db): create_checked retention validation (Method B) #40, feat(sketch-db): Phase 5 eviction — SchemaEvictionService background task #41). HLL / CountSketch / CountMinSketch byte parity is tracked under ProjectASAP/ASAPCollector#243; their tests are gated#[ignore = "blocked on ASAPCollector#243 HLL/CS/CMS byte parity"].AggregateCore/query_statistic/MergeableAccumulatortraits stay; sparse-delta apply (apply_modified_otlp_delta_bytes) stays.Notable details
decode_modified_otlp_sketch_bytestry the runtime adapter first (envelope-wrapped wire format, the canonical edge-framework shape). On envelope-decode failure (bare*Stateproto, as some unit-test / pre-envelope payloads still emit per the PR fix(ingest): decode envelope-wrapped CountMinState from DC processor #14 contract onfrom_sketchlib_proto_bytes), the dispatcher falls back to the backend's existing native decoder so existing e2e tests keep working unchanged.Cargo.tomladds a[patch."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/ProjectASAP/asap_sketchlib"]block pointing at the local../asap_sketchlibcheckout. This is required so theasap_sketchlib::sketches::*types unify across the two consumers (backend's git-sourced dep and asap-precompute-rs's path-sourced dep) at the FFI boundary (wrapper.inner()→ backend accumulator).asap-precompute-rsis consumed via a sibling path dep (../../ASAPCollector/asap-precompute-rs) — see the comment inasap-query-engine/Cargo.tomlfor why git-source resolution doesn't work today (parent-repo submodule pins).Test plan
cargo build --workspace(succeeds)cargo test --workspace --no-run(all test binaries compile)cargo test --test edge_runtime_consumes_precompute_rs(6 passed, 3 ignored)cargo test --test e2e_modified_otlp_sketch_path(6/6 passed; DDSketch + KLL routes through new adapter, others use backend's native decoder)cargo test --lib precompute_operators::edge_runtime_adapter(3 unit tests pass: round-trip, merge, envelope unwrap)#[ignore]'d pending ASAPCollector#243.Note: the workspace lib has 35 pre-existing test failures in
tests::datafusion::*/tests::elastic_*/tests::prometheus_forwarding_tests/tests::schema_timeline_dispatch_testspaths. These exist onorigin/mainand are unrelated to this PR's ingest/adapter work.