Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion asapv1_golden
Submodule asapv1_golden updated 73 files
+183 −38 README.md
+1 −0 bloom_fast_5x32.hex
+1 −0 bloom_regular_3x128.hex
+1 −1 cms_f64_fast_2x3.hex
+1 −0 cms_f64_fast_2x3_delta.hex
+1 −1 cms_i64_regular_2x3.hex
+1 −0 cms_i64_regular_2x3_admission.hex
+1 −0 cms_i64_regular_2x3_delta.hex
+1 −0 cmsheap_f64_fast_2x3_f64keys.hex
+1 −1 cmsheap_i32_fast_2x3_i64keys.hex
+1 −0 cmsheap_i64_regular_2x3_delta.hex
+1 −1 cmsheap_i64_regular_2x3_empty.hex
+1 −1 cmsheap_i64_regular_2x3_i64tie.hex
+1 −1 cmsheap_i64_regular_2x3_strkeys.hex
+1 −1 cmsheap_i64_regular_2x3_strtie.hex
+1 −0 cmsheap_i64_regular_2x3_tuplekeys.hex
+1 −0 cmsspacesaving_i64_regular_2x3_strkeys.hex
+1 −1 coco_3x7.hex
+1 −1 count_l2hh_2x4_seed7.hex
+1 −0 cs_f64_fast_2x4.hex
+1 −0 cs_f64_fast_2x4_delta.hex
+1 −1 cs_i32_regular_2x4.hex
+1 −1 cs_i64_fast_2x4.hex
+1 −1 cs_i64_regular_2x4.hex
+1 −0 cs_i64_regular_2x4_admission.hex
+1 −0 cs_i64_regular_2x4_delta.hex
+1 −0 csheap_f64_fast_2x4_strkeys.hex
+1 −0 csheap_i64_regular_2x4_delta.hex
+1 −0 csheap_i64_regular_2x4_i64tie.hex
+1 −1 csheap_i64_regular_2x4_strkeys.hex
+1 −0 csheap_i64_regular_2x4_tuplekeys.hex
+1 −0 csspacesaving_f64_fast_2x4_i64keys.hex
+1 −0 ddsketch_buckets_empty_a001.hex
+1 −0 ddsketch_buckets_positive_a001.hex
+1 −0 ddsketch_buckets_signed_a001.hex
+1 −0 ddsketch_buckets_signed_a001_admission.hex
+1 −0 ddsketch_buckets_signed_a001_delta.hex
+1 −1 ddsketch_empty_a001.hex
+1 −1 ddsketch_positive_a001.hex
+1 −1 ddsketch_signed_a001.hex
+1 −0 ddsketch_signed_a001_admission.hex
+1 −0 ddsketch_signed_a001_delta.hex
+1 −0 eh_w100_k2_cm_2x4.hex
+1 −0 ehsketchlist_cm_i32_fast_2x4.hex
+1 −0 ehsketchlist_ddsketch_a001.hex
+1 −0 ehsketchlist_ddsketch_buckets_a001.hex
+1 −1 elastic_4b_2x4.hex
+1 −1 elastic_4b_2x4_stale.hex
+1 −1 hll_classic_p12.hex
+1 −0 hll_classic_p12_admission.hex
+1 −1 hll_classic_p14.hex
+1 −0 hll_classic_p14_delta.hex
+1 −1 hll_ertl_mle_p12.hex
+1 −1 hll_ertl_mle_p14.hex
+1 −0 hll_ertl_mle_p14_delta.hex
+1 −1 hll_hip_p12.hex
+1 −1 hll_hip_p14.hex
+1 −1 hydra_cm_2x2_counter_2x2.hex
+1 −1 hydra_cs_2x2_counter_2x2.hex
+1 −1 hydra_hll_1x2_p14.hex
+1 −1 hydra_kll_2x2_k200.hex
+1 −1 hydra_univmon_1x2.hex
+1 −1 kll_f64_k200.hex
+1 −1 kll_i64_k200.hex
+1 −0 kmv_k8.hex
+1 −0 space_saving_bytes_c3.hex
+1 −0 space_saving_i64_c8.hex
+1 −0 uniform_sampling_r0p25.hex
+1 −1 univmon_empty_l3_2x4_h5.hex
+1 −1 univmon_i64_l3_2x4_h5.hex
+1 −0 univmon_optimized_l5_e2_3x8_1x4_h6.hex
+1 −0 univmon_q_i32_l3_c8_r3.hex
+1 −1 univmon_str_l3_2x4_h5.hex
194 changes: 104 additions & 90 deletions wire/asapv1/kind.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,51 +12,61 @@ type KindID string
// The kind_id registry. An id is allocated once and never reassigned. A
// variant with its top bit set names the delta of the state variant without it.
const (
KindHLLUnspecified KindID = "\x01\x00"
KindHLLClassic KindID = "\x01\x01"
KindHLLErtlMLE KindID = "\x01\x02"
KindHLLHIP KindID = "\x01\x03"
KindHLLClassicDelta KindID = "\x01\x81"
KindHLLErtlMLEDelta KindID = "\x01\x82"
KindCountMin KindID = "\x02\x00"
KindCountMinDelta KindID = "\x02\x80"
KindCMSHeap KindID = "\x03\x00"
KindCMSHeapDelta KindID = "\x03\x80"
KindCountSketch KindID = "\x04\x00"
KindCountSketchDelta KindID = "\x04\x80"
KindDDSketch KindID = "\x05\x00"
KindDDSketchDelta KindID = "\x05\x80"
KindKLL KindID = "\x06\x00"
KindKLLDynamic KindID = "\x06\x01"
KindHydraKLL KindID = "\x07\x00"
KindHydraCountMin KindID = "\x07\x01"
KindHydraCountSketch KindID = "\x07\x02"
KindHydraHLL KindID = "\x07\x03"
KindHydraUnivMon KindID = "\x07\x04"
KindSetAggregator KindID = "\x08\x00"
KindSetAggregatorDelta KindID = "\x08\x80"
KindRetired09 KindID = "\x09\x00"
KindCSHeap KindID = "\x0a\x00"
KindCSHeapDelta KindID = "\x0a\x80"
KindElastic KindID = "\x0b\x00"
KindCoco KindID = "\x0c\x00"
KindUniformSampling KindID = "\x0d\x00"
KindKMV KindID = "\x0e\x00"
KindHashSketchEnsemble KindID = "\x0f\x00"
KindUnivMon KindID = "\x10\x00"
KindUnivMonOptimized KindID = "\x11\x00"
KindNitroBatch KindID = "\x12\x00"
KindExponentialHistogram KindID = "\x13\x00"
KindEHSketchList KindID = "\x14\x00"
KindEHUnivOptimized KindID = "\x15\x00"
KindOctoSketch KindID = "\x16\x00"
KindBloom KindID = "\x17\x00"
KindSpaceSaving KindID = "\x18\x00"
KindCountL2HH KindID = "\x19\x00"
KindUnivMonQ KindID = "\x1a\x00"
KindFoldCMS KindID = "\x1b\x00"
KindFoldCS KindID = "\x1c\x00"
KindRetired1D KindID = "\x1d\x00"
KindHLLUnspecified KindID = "\x01\x00"
KindHLLClassic KindID = "\x01\x01"
KindHLLErtlMLE KindID = "\x01\x02"
KindHLLHIP KindID = "\x01\x03"
KindHLLClassicDelta KindID = "\x01\x81"
KindHLLErtlMLEDelta KindID = "\x01\x82"
KindCountMin KindID = "\x02\x00"
KindCountMinDelta KindID = "\x02\x80"
KindCMSHeap KindID = "\x03\x00"
KindCMSHeapDelta KindID = "\x03\x80"
KindCountSketch KindID = "\x04\x00"
KindCountSketchDelta KindID = "\x04\x80"
KindDDSketch KindID = "\x05\x01"
KindDDSketchDelta KindID = "\x05\x81"
// KindDDSketchWithScalars is the retired DDSketch kind whose payload also
// carried sum / min / max: decoded with those scalars dropped, never
// encoded.
KindDDSketchWithScalars KindID = "\x05\x00"
// KindDDSketchWithScalarsDelta is the retired delta of
// KindDDSketchWithScalars, with KindDDSketchDelta's payload: decoded,
// never encoded.
KindDDSketchWithScalarsDelta KindID = "\x05\x80"
KindKLL KindID = "\x06\x00"
KindKLLDynamic KindID = "\x06\x01"
KindHydraKLL KindID = "\x07\x00"
KindHydraCountMin KindID = "\x07\x01"
KindHydraCountSketch KindID = "\x07\x02"
KindHydraHLL KindID = "\x07\x03"
KindHydraUnivMon KindID = "\x07\x04"
KindSetAggregator KindID = "\x08\x00"
KindSetAggregatorDelta KindID = "\x08\x80"
KindRetired09 KindID = "\x09\x00"
KindCSHeap KindID = "\x0a\x00"
KindCSHeapDelta KindID = "\x0a\x80"
KindElastic KindID = "\x0b\x00"
KindCoco KindID = "\x0c\x00"
KindUniformSampling KindID = "\x0d\x00"
KindKMV KindID = "\x0e\x00"
KindHashSketchEnsemble KindID = "\x0f\x00"
KindUnivMon KindID = "\x10\x00"
KindUnivMonOptimized KindID = "\x11\x00"
KindNitroBatch KindID = "\x12\x00"
KindExponentialHistogram KindID = "\x13\x00"
KindEHSketchList KindID = "\x14\x00"
KindEHUnivOptimized KindID = "\x15\x00"
KindOctoSketch KindID = "\x16\x00"
KindBloom KindID = "\x17\x00"
KindSpaceSaving KindID = "\x18\x00"
KindCountL2HH KindID = "\x19\x00"
KindUnivMonQ KindID = "\x1a\x00"
KindFoldCMS KindID = "\x1b\x00"
KindFoldCS KindID = "\x1c\x00"
KindRetired1D KindID = "\x1d\x00"
KindCMSSpaceSaving KindID = "\x1e\x00"
KindCSSpaceSaving KindID = "\x1f\x00"
)

type kindEntry struct {
Expand All @@ -65,51 +75,55 @@ type kindEntry struct {
}

var registry = map[KindID]kindEntry{
KindHLLUnspecified: {"HLL Unspecified", false},
KindHLLClassic: {"HLL Classic", true},
KindHLLErtlMLE: {"HLL Ertl-MLE", true},
KindHLLHIP: {"HLL HIP", true},
KindHLLClassicDelta: {"HLL Classic delta", true},
KindHLLErtlMLEDelta: {"HLL Ertl-MLE delta", true},
KindCountMin: {"Count-Min", true},
KindCountMinDelta: {"Count-Min delta", true},
KindCMSHeap: {"CMSHeap", true},
KindCMSHeapDelta: {"CMSHeap delta", true},
KindCountSketch: {"Count Sketch", true},
KindCountSketchDelta: {"Count Sketch delta", true},
KindDDSketch: {"DDSketch", true},
KindDDSketchDelta: {"DDSketch delta", true},
KindKLL: {"KLL", true},
KindKLLDynamic: {"KLL Dynamic", true},
KindHydraKLL: {"Hydra KLL", true},
KindHydraCountMin: {"Hydra Count-Min", true},
KindHydraCountSketch: {"Hydra Count Sketch", true},
KindHydraHLL: {"Hydra HLL", true},
KindHydraUnivMon: {"Hydra UnivMon", true},
KindSetAggregator: {"SetAggregator", true},
KindSetAggregatorDelta: {"SetAggregator delta", true},
KindRetired09: {"retired", false},
KindCSHeap: {"CSHeap", true},
KindCSHeapDelta: {"CSHeap delta", true},
KindElastic: {"Elastic", true},
KindCoco: {"Coco", true},
KindUniformSampling: {"UniformSampling", true},
KindKMV: {"KMV", true},
KindHashSketchEnsemble: {"HashSketchEnsemble", false},
KindUnivMon: {"UnivMon", true},
KindUnivMonOptimized: {"UnivMon Optimized", true},
KindNitroBatch: {"NitroBatch", false},
KindExponentialHistogram: {"ExponentialHistogram", true},
KindEHSketchList: {"EHSketchList", true},
KindEHUnivOptimized: {"EHUnivOptimized", false},
KindOctoSketch: {"OctoSketch", false},
KindBloom: {"Bloom", true},
KindSpaceSaving: {"Space-Saving", true},
KindCountL2HH: {"CountL2HH", true},
KindUnivMonQ: {"UnivMon-Q", true},
KindFoldCMS: {"FoldCMS", false},
KindFoldCS: {"FoldCS", false},
KindRetired1D: {"retired", false},
KindHLLUnspecified: {"HLL Unspecified", false},
KindHLLClassic: {"HLL Classic", true},
KindHLLErtlMLE: {"HLL Ertl-MLE", true},
KindHLLHIP: {"HLL HIP", true},
KindHLLClassicDelta: {"HLL Classic delta", true},
KindHLLErtlMLEDelta: {"HLL Ertl-MLE delta", true},
KindCountMin: {"Count-Min", true},
KindCountMinDelta: {"Count-Min delta", true},
KindCMSHeap: {"CMSHeap", true},
KindCMSHeapDelta: {"CMSHeap delta", true},
KindCountSketch: {"Count Sketch", true},
KindCountSketchDelta: {"Count Sketch delta", true},
KindDDSketch: {"DDSketch", true},
KindDDSketchDelta: {"DDSketch delta", true},
KindDDSketchWithScalars: {"DDSketch with scalars", true},
KindDDSketchWithScalarsDelta: {"DDSketch with scalars delta", true},
KindKLL: {"KLL", true},
KindKLLDynamic: {"KLL Dynamic", true},
KindHydraKLL: {"Hydra KLL", true},
KindHydraCountMin: {"Hydra Count-Min", true},
KindHydraCountSketch: {"Hydra Count Sketch", true},
KindHydraHLL: {"Hydra HLL", true},
KindHydraUnivMon: {"Hydra UnivMon", true},
KindSetAggregator: {"SetAggregator", true},
KindSetAggregatorDelta: {"SetAggregator delta", true},
KindRetired09: {"retired", false},
KindCSHeap: {"CSHeap", true},
KindCSHeapDelta: {"CSHeap delta", true},
KindElastic: {"Elastic", true},
KindCoco: {"Coco", true},
KindUniformSampling: {"UniformSampling", true},
KindKMV: {"KMV", true},
KindHashSketchEnsemble: {"HashSketchEnsemble", false},
KindUnivMon: {"UnivMon", true},
KindUnivMonOptimized: {"UnivMon Optimized", true},
KindNitroBatch: {"NitroBatch", false},
KindExponentialHistogram: {"ExponentialHistogram", true},
KindEHSketchList: {"EHSketchList", true},
KindEHUnivOptimized: {"EHUnivOptimized", false},
KindOctoSketch: {"OctoSketch", false},
KindBloom: {"Bloom", true},
KindSpaceSaving: {"Space-Saving", true},
KindCountL2HH: {"CountL2HH", true},
KindUnivMonQ: {"UnivMon-Q", true},
KindFoldCMS: {"FoldCMS", false},
KindFoldCS: {"FoldCS", false},
KindRetired1D: {"retired", false},
KindCMSSpaceSaving: {"CMSSpaceSaving", true},
KindCSSpaceSaving: {"CSSpaceSaving", true},
}

// Name returns the registry name of k, or "" if k is not in the registry.
Expand Down
30 changes: 17 additions & 13 deletions wire/asapv1/kind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
)

func TestRegistry(t *testing.T) {
if len(registry) != 45 {
t.Fatalf("registry has %d ids, want 45", len(registry))
if len(registry) != 49 {
t.Fatalf("registry has %d ids, want 49", len(registry))
}
payloads := 0
for kind, e := range registry {
Expand All @@ -22,19 +22,23 @@ func TestRegistry(t *testing.T) {
t.Errorf("%v is not the delta of a registered state kind", kind)
}
}
if payloads != 36 {
t.Errorf("registry has %d ids with a payload, want 36", payloads)
if payloads != 40 {
t.Errorf("registry has %d ids with a payload, want 40", payloads)
}
cases := map[KindID]string{
KindHLLClassic: "01 01 (HLL Classic)",
KindCountMin: "02 00 (Count-Min)",
KindCSHeap: "0a 00 (CSHeap)",
KindUnivMonQ: "1a 00 (UnivMon-Q)",
KindRetired09: "09 00 (retired)",
KindRetired1D: "1d 00 (retired)",
"\x1e\x00": "1e 00 (unregistered)",
"": " (unregistered)",
KindHydraUnivMon: "07 04 (Hydra UnivMon)",
KindHLLClassic: "01 01 (HLL Classic)",
KindCountMin: "02 00 (Count-Min)",
KindCSHeap: "0a 00 (CSHeap)",
KindUnivMonQ: "1a 00 (UnivMon-Q)",
KindRetired09: "09 00 (retired)",
KindRetired1D: "1d 00 (retired)",
KindDDSketch: "05 01 (DDSketch)",
KindDDSketchWithScalars: "05 00 (DDSketch with scalars)",
KindDDSketchWithScalarsDelta: "05 80 (DDSketch with scalars delta)",
KindCSSpaceSaving: "1f 00 (CSSpaceSaving)",
"\x20\x00": "20 00 (unregistered)",
"": " (unregistered)",
KindHydraUnivMon: "07 04 (Hydra UnivMon)",
}
for kind, want := range cases {
if got := kind.String(); got != want {
Expand Down