diff --git a/examples/import-vectors.rs b/examples/import-vectors.rs index 6351c37d..39f396e0 100644 --- a/examples/import-vectors.rs +++ b/examples/import-vectors.rs @@ -3,7 +3,7 @@ use std::fs; use std::io::{BufRead, BufReader}; use std::path::PathBuf; -use std::time::Instant; +use std::time::{Duration, Instant}; use arroy::distances::DotProduct; use arroy::{Database, Writer}; @@ -12,8 +12,8 @@ use heed::{EnvFlags, EnvOpenOptions}; use rand::rngs::StdRng; use rand::SeedableRng; -/// 2 GiB -const DEFAULT_MAP_SIZE: usize = 1024 * 1024 * 1024 * 2; +/// 200 GiB +const DEFAULT_MAP_SIZE: usize = 1024 * 1024 * 1024 * 200; #[derive(Parser)] #[command(author, version, about, long_about = None)] @@ -74,6 +74,7 @@ fn main() -> Result<(), heed::BoxedError> { // === END vectors === let now = Instant::now(); + let mut insertion_time = Duration::default(); let mut count = 0; for line in reader.lines() { let line = line?; @@ -89,14 +90,17 @@ fn main() -> Result<(), heed::BoxedError> { .map(|s| s.trim().parse::().unwrap()) .collect(); + let now = Instant::now(); if no_append { writer.add_item(&mut wtxn, id, &vector)?; } else { writer.append_item(&mut wtxn, id, &vector)?; } + insertion_time += now.elapsed(); count += 1; } - println!("Took {:.2?} to parse and insert into arroy", now.elapsed()); + println!("Took {:.2?} to parse and insert into arroy", now.elapsed() - insertion_time); + println!("Took {insertion_time:.2?} insert into arroy"); println!("There are {count} vectors"); println!(); diff --git a/src/node_id.rs b/src/node_id.rs index 7f1a8b26..fcd88528 100644 --- a/src/node_id.rs +++ b/src/node_id.rs @@ -9,9 +9,9 @@ use crate::ItemId; #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] #[repr(u8)] pub enum NodeMode { - Item = 0, + Metadata = 0, Tree = 1, - Metadata = 2, + Item = 2, } impl TryFrom for NodeMode { @@ -107,11 +107,11 @@ mod test { assert!(NodeId::tree(1) > NodeId::tree(0)); assert!(NodeId::tree(0) < NodeId::tree(1)); - // tree > item whatever is the value - assert!(NodeId::tree(0) > NodeId::item(1)); + // tree < item whatever is the value + assert!(NodeId::tree(u32::MAX) < NodeId::item(0)); assert!(NodeId::metadata() == NodeId::metadata()); - assert!(NodeId::metadata() > NodeId::tree(12)); - assert!(NodeId::metadata() > NodeId::item(12)); + assert!(NodeId::metadata() < NodeId::tree(u32::MAX)); + assert!(NodeId::metadata() < NodeId::item(u32::MAX)); } } diff --git a/src/tests/binary_quantized.rs b/src/tests/binary_quantized.rs index 9e784f5d..0e310501 100644 --- a/src/tests/binary_quantized.rs +++ b/src/tests/binary_quantized.rs @@ -47,8 +47,8 @@ fn write_and_retrieve_binary_quantized_vector() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 - Item 0: Leaf(Leaf { header: NodeHeaderBinaryQuantizedEuclidean { bias: 0.0 }, vector: [-1.0000, -1.0000, 1.0000, -1.0000, 1.0000, 1.0000, -1.0000, 1.0000, -1.0000, -1.0000, "other ..."] }) - Tree 0: Descendants(Descendants { descendants: [0] }) Root: Metadata { dimensions: 16, items: RoaringBitmap<[0]>, roots: [0], distance: "binary quantized euclidean" } + Tree 0: Descendants(Descendants { descendants: [0] }) + Item 0: Leaf(Leaf { header: NodeHeaderBinaryQuantizedEuclidean { bias: 0.0 }, vector: [-1.0000, -1.0000, 1.0000, -1.0000, 1.0000, 1.0000, -1.0000, 1.0000, -1.0000, -1.0000, "other ..."] }) "###); } diff --git a/src/tests/reader.rs b/src/tests/reader.rs index bce0e22e..a8c90f33 100644 --- a/src/tests/reader.rs +++ b/src/tests/reader.rs @@ -112,10 +112,10 @@ fn two_dimension_on_a_line() { let reader = Reader::::open(&rtxn, 0, handle.database).unwrap(); // if we can't look into enough nodes we find some random points - let ret = reader.nns(5).search_k(NonZeroUsize::new(1).unwrap()).by_item(&rtxn, 0).unwrap(); + let ret = reader.nns(5).search_k(NonZeroUsize::new(1).unwrap()).by_item(&rtxn, 1).unwrap(); insta::assert_snapshot!(NnsRes(ret), @r###" - id(48): distance(48) - id(92): distance(92) + id(48): distance(47) + id(92): distance(91) "###); // if we can look into all the node there is no inifinite loop and it works @@ -131,11 +131,11 @@ fn two_dimension_on_a_line() { let ret = reader.nns(5).by_item(&rtxn, 0).unwrap(); insta::assert_snapshot!(NnsRes(ret), @r###" + id(0): distance(0) id(1): distance(1) id(2): distance(2) id(3): distance(3) id(4): distance(4) - id(5): distance(5) "###); } @@ -162,11 +162,11 @@ fn two_dimension_on_a_column() { let ret = reader.nns(5).by_item(&rtxn, 0).unwrap(); insta::assert_snapshot!(NnsRes(ret), @r###" + id(0): distance(0) id(1): distance(1) id(2): distance(2) id(3): distance(3) id(4): distance(4) - id(5): distance(5) "###); } diff --git a/src/tests/snapshots/arroy__tests__writer__write_and_update_lot_of_random_points-2.snap b/src/tests/snapshots/arroy__tests__writer__write_and_update_lot_of_random_points-2.snap index 1df2243b..eb5dec7e 100644 --- a/src/tests/snapshots/arroy__tests__writer__write_and_update_lot_of_random_points-2.snap +++ b/src/tests/snapshots/arroy__tests__writer__write_and_update_lot_of_random_points-2.snap @@ -4,106 +4,7 @@ expression: handle --- ================== Dumping index 0 -Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5919, 0.9953, 0.7271, 0.7734, 0.5761, 0.8882, 0.8497, 0.0817, 0.3989, 0.3384, "other ..."] }) -Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.4199, 0.2620, 0.2655, 0.8414, 0.0192, 0.3828, 0.2561, 0.2692, 0.0368, 0.4624, "other ..."] }) -Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.2240, 0.0136, 0.1967, 0.7482, 0.6849, 0.7949, 0.0809, 0.5504, 0.6339, 0.6978, "other ..."] }) -Item 3: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0001, 0.7870, 0.9674, 0.4568, 0.5250, 0.2701, 0.2417, 0.8742, 0.6869, 0.8759, "other ..."] }) -Item 4: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.7711, 0.4016, 0.1489, 0.9991, 0.5236, 0.5613, 0.4596, 0.2214, 0.5016, 0.1191, "other ..."] }) -Item 5: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0850, 0.7778, 0.8818, 0.3427, 0.1293, 0.7240, 0.4773, 0.2871, 0.3988, 0.4014, "other ..."] }) -Item 6: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.7473, 0.3347, 0.9786, 0.4693, 0.3540, 0.1280, 0.9628, 0.2076, 0.3437, 0.4589, "other ..."] }) -Item 7: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5699, 0.5919, 0.7788, 0.3705, 0.3807, 0.1708, 0.3678, 0.5629, 0.0612, 0.4826, "other ..."] }) -Item 8: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1874, 0.7676, 0.9707, 0.5148, 0.7242, 0.4714, 0.1278, 0.2181, 0.2651, 0.5674, "other ..."] }) -Item 9: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8134, 0.9647, 0.6640, 0.4464, 0.7439, 0.6904, 0.3159, 0.7607, 0.3483, 0.9963, "other ..."] }) -Item 10: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.3157, 0.8096, 0.5024, 0.5421, 0.4327, 0.3696, 0.6485, 0.7972, 0.9792, 0.9554, "other ..."] }) -Item 11: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6560, 0.2343, 0.4079, 0.5972, 0.5766, 0.6739, 0.2985, 0.6167, 0.4834, 0.2818, "other ..."] }) -Item 12: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1559, 0.1898, 0.2475, 0.4582, 0.5481, 0.5846, 0.1844, 0.4898, 0.2916, 0.2669, "other ..."] }) -Item 13: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1726, 0.7399, 0.0271, 0.8721, 0.8725, 0.4023, 0.1558, 0.1044, 0.2096, 0.2081, "other ..."] }) -Item 14: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1712, 0.6340, 0.2866, 0.6282, 0.9072, 0.7589, 0.6432, 0.8676, 0.2942, 0.4375, "other ..."] }) -Item 15: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6031, 0.2970, 0.9485, 0.0272, 0.4336, 0.1339, 0.2209, 0.8350, 0.2566, 0.9481, "other ..."] }) -Item 16: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8145, 0.6759, 0.1411, 0.7878, 0.3556, 0.8440, 0.5301, 0.2627, 0.7050, 0.4145, "other ..."] }) -Item 17: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0819, 0.5362, 0.8215, 0.2263, 0.3109, 0.2738, 0.6133, 0.5147, 0.9334, 0.9877, "other ..."] }) -Item 18: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.4594, 0.9245, 0.5151, 0.7390, 0.6121, 0.5891, 0.5795, 0.6295, 0.0595, 0.6471, "other ..."] }) -Item 19: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1390, 0.7531, 0.3249, 0.8754, 0.9984, 0.7362, 0.0281, 0.2016, 0.9443, 0.1989, "other ..."] }) -Item 20: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5102, 0.8700, 0.3910, 0.0807, 0.1067, 0.0692, 0.7037, 0.4229, 0.0066, 0.1894, "other ..."] }) -Item 21: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6252, 0.9240, 0.7227, 0.6810, 0.2563, 0.3321, 0.2283, 0.9226, 0.8494, 0.0356, "other ..."] }) -Item 22: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8077, 0.3229, 0.5031, 0.0472, 0.6957, 0.9603, 0.8790, 0.2009, 0.3837, 0.1765, "other ..."] }) -Item 23: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.9915, 0.6886, 0.1976, 0.1725, 0.6776, 0.1356, 0.3842, 0.4424, 0.6939, 0.8016, "other ..."] }) -Item 24: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1651, 0.4144, 0.2816, 0.0037, 0.3038, 0.2344, 0.3321, 0.1985, 0.4704, 0.3710, "other ..."] }) -Item 25: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0116, 0.5323, 0.3940, 0.1382, 0.1987, 0.7287, 0.4026, 0.1442, 0.5957, 0.0340, "other ..."] }) -Item 26: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.7192, 0.5087, 0.9102, 0.0269, 0.7119, 0.7909, 0.0259, 0.6221, 0.9168, 0.1528, "other ..."] }) -Item 27: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.3569, 0.9070, 0.8412, 0.3201, 0.6998, 0.8674, 0.5494, 0.2322, 0.2969, 0.9787, "other ..."] }) -Item 28: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5587, 0.8792, 0.9279, 0.4203, 0.9903, 0.7524, 0.0600, 0.9020, 0.8837, 0.1950, "other ..."] }) -Item 29: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6021, 0.0690, 0.1080, 0.2535, 0.6817, 0.7899, 0.3297, 0.8656, 0.1566, 0.3560, "other ..."] }) -Item 30: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.9353, 0.1703, 0.1992, 0.7788, 0.4769, 0.5431, 0.4292, 0.5249, 0.7629, 0.9059, "other ..."] }) -Item 31: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.7584, 0.3448, 0.7315, 0.5405, 0.6797, 0.3253, 0.8611, 0.0846, 0.0174, 0.0882, "other ..."] }) -Item 32: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.3473, 0.1415, 0.1873, 0.7472, 0.3808, 0.6412, 0.1944, 0.5869, 0.0722, 0.3215, "other ..."] }) -Item 33: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.3494, 0.5787, 0.8027, 0.9625, 0.5944, 0.6781, 0.4204, 0.5899, 0.0209, 0.9001, "other ..."] }) -Item 34: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.4076, 0.8830, 0.7654, 0.5911, 0.3055, 0.0942, 0.7024, 0.9471, 0.9752, 0.4628, "other ..."] }) -Item 35: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.3281, 0.1178, 0.0533, 0.4172, 0.3990, 0.0395, 0.8533, 0.1435, 0.9799, 0.4063, "other ..."] }) -Item 36: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6939, 0.0973, 0.2992, 0.4254, 0.0919, 0.8203, 0.3851, 0.0823, 0.4547, 0.4283, "other ..."] }) -Item 37: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6603, 0.3675, 0.1019, 0.2193, 0.3180, 0.0591, 0.9934, 0.8583, 0.7473, 0.3644, "other ..."] }) -Item 38: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.7093, 0.6425, 0.0423, 0.0877, 0.7820, 0.6701, 0.4963, 0.1499, 0.8631, 0.8113, "other ..."] }) -Item 39: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.4498, 0.4107, 0.9992, 0.3928, 0.4779, 0.4661, 0.1282, 0.8140, 0.7490, 0.5641, "other ..."] }) -Item 40: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0152, 0.9782, 0.0253, 0.6194, 0.6177, 0.6446, 0.8634, 0.8343, 0.1429, 0.6369, "other ..."] }) -Item 41: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.7821, 0.0623, 0.1168, 0.3609, 0.6040, 0.8336, 0.0911, 0.2181, 0.7485, 0.0281, "other ..."] }) -Item 42: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5514, 0.2225, 0.8400, 0.2598, 0.5622, 0.6231, 0.5772, 0.0082, 0.8470, 0.9596, "other ..."] }) -Item 43: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8608, 0.8689, 0.4918, 0.2239, 0.9291, 0.0622, 0.6843, 0.4184, 0.4703, 0.3202, "other ..."] }) -Item 44: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.9144, 0.0223, 0.5079, 0.6873, 0.5501, 0.2577, 0.9304, 0.3154, 0.1546, 0.3749, "other ..."] }) -Item 45: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.9838, 0.4742, 0.5307, 0.6989, 0.9323, 0.2140, 0.1371, 0.1113, 0.0322, 0.3001, "other ..."] }) -Item 46: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5159, 0.9516, 0.6267, 0.1007, 0.4283, 0.1452, 0.9565, 0.4723, 0.4935, 0.7395, "other ..."] }) -Item 47: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.4506, 0.8658, 0.1164, 0.2339, 0.2266, 0.9050, 0.5849, 0.9792, 0.5951, 0.7706, "other ..."] }) -Item 48: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.3709, 0.3974, 0.5971, 0.7814, 0.2075, 0.5392, 0.4790, 0.5432, 0.4844, 0.3367, "other ..."] }) -Item 49: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1322, 0.0670, 0.3404, 0.5339, 0.0229, 0.5964, 0.5497, 0.3819, 0.6553, 0.7129, "other ..."] }) -Item 50: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.7462, 0.9877, 0.0796, 0.4441, 0.9824, 0.6855, 0.0985, 0.0618, 0.0551, 0.5251, "other ..."] }) -Item 51: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.3643, 0.3282, 0.2580, 0.4477, 0.5920, 0.3581, 0.3502, 0.2441, 0.1707, 0.1243, "other ..."] }) -Item 52: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8421, 0.8103, 0.5294, 0.6795, 0.9634, 0.3110, 0.8945, 0.1541, 0.5916, 0.1082, "other ..."] }) -Item 53: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5928, 0.6267, 0.1717, 0.1604, 0.6506, 0.0302, 0.8289, 0.5930, 0.9304, 0.6067, "other ..."] }) -Item 54: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8491, 0.4500, 0.8568, 0.1146, 0.7974, 0.5148, 0.0862, 0.6020, 0.7705, 0.6189, "other ..."] }) -Item 55: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6095, 0.6335, 0.4740, 0.0746, 0.3871, 0.1016, 0.6414, 0.3076, 0.5484, 0.7602, "other ..."] }) -Item 56: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.2720, 0.7143, 0.6966, 0.9709, 0.4263, 0.7441, 0.8624, 0.1372, 0.0418, 0.7771, "other ..."] }) -Item 57: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1524, 0.3441, 0.2368, 0.4350, 0.5328, 0.3005, 0.7021, 0.3614, 0.6369, 0.7984, "other ..."] }) -Item 58: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.4278, 0.5749, 0.9222, 0.8668, 0.5708, 0.7825, 0.1484, 0.1654, 0.7721, 0.1671, "other ..."] }) -Item 59: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6227, 0.1202, 0.9715, 0.3936, 0.3423, 0.7479, 0.6526, 0.1867, 0.5568, 0.0922, "other ..."] }) -Item 60: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5174, 0.1043, 0.5020, 0.7082, 0.0108, 0.7768, 0.2805, 0.5635, 0.1165, 0.3446, "other ..."] }) -Item 61: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1347, 0.7000, 0.0530, 0.4959, 0.8227, 0.9831, 0.5433, 0.5201, 0.7924, 0.3847, "other ..."] }) -Item 62: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.7594, 0.3160, 0.8848, 0.2336, 0.2080, 0.9798, 0.2609, 0.3579, 0.9043, 0.5035, "other ..."] }) -Item 63: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.9221, 0.3578, 0.3207, 0.9945, 0.9288, 0.4608, 0.3001, 0.0296, 0.4678, 0.7422, "other ..."] }) -Item 64: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.7278, 0.0499, 0.4536, 0.3295, 0.8839, 0.5060, 0.5773, 0.3133, 0.2521, 0.6842, "other ..."] }) -Item 65: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5677, 0.1247, 0.4928, 0.4097, 0.8433, 0.9238, 0.7848, 0.4437, 0.4696, 0.9886, "other ..."] }) -Item 66: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.3202, 0.9724, 0.0590, 0.9146, 0.0865, 0.5347, 0.9236, 0.5211, 0.4621, 0.4500, "other ..."] }) -Item 67: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5299, 0.5421, 0.8194, 0.1018, 0.5426, 0.9350, 0.3228, 0.7979, 0.7473, 0.1118, "other ..."] }) -Item 68: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.7403, 0.1475, 0.8585, 0.3990, 0.5766, 0.0263, 0.2665, 0.6317, 0.8026, 0.0227, "other ..."] }) -Item 69: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6163, 0.7762, 0.4365, 0.6713, 0.5647, 0.3449, 0.6615, 0.9430, 0.5941, 0.3563, "other ..."] }) -Item 70: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0981, 0.2398, 0.2595, 0.6075, 0.1605, 0.7487, 0.1070, 0.8330, 0.7908, 0.0203, "other ..."] }) -Item 71: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6478, 0.9371, 0.2378, 0.4279, 0.1400, 0.2146, 0.3193, 0.7330, 0.7932, 0.7295, "other ..."] }) -Item 72: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.9586, 0.8715, 0.0659, 0.6144, 0.4995, 0.6693, 0.1415, 0.7556, 0.9350, 0.9924, "other ..."] }) -Item 73: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.4640, 0.7218, 0.0154, 0.0829, 0.4829, 0.5139, 0.4344, 0.5872, 0.2770, 0.3745, "other ..."] }) -Item 74: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.9907, 0.6582, 0.3640, 0.9777, 0.6001, 0.3023, 0.3154, 0.2637, 0.7202, 0.7507, "other ..."] }) -Item 75: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.3639, 0.3210, 0.3718, 0.7818, 0.6264, 0.2524, 0.6018, 0.4059, 0.9744, 0.3568, "other ..."] }) -Item 76: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6910, 0.9733, 0.3937, 0.8154, 0.2171, 0.7616, 0.3415, 0.4227, 0.6408, 0.0355, "other ..."] }) -Item 77: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6003, 0.7202, 0.3803, 0.5052, 0.4006, 0.6708, 0.0438, 0.8432, 0.8772, 0.6849, "other ..."] }) -Item 78: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8030, 0.0396, 0.0641, 0.3958, 0.3427, 0.9163, 0.0129, 0.4500, 0.8504, 0.8711, "other ..."] }) -Item 79: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8093, 0.7442, 0.3738, 0.9164, 0.5923, 0.7353, 0.5379, 0.6815, 0.5925, 0.7954, "other ..."] }) -Item 80: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6515, 0.6402, 0.4825, 0.1251, 0.1569, 0.9048, 0.3695, 0.0092, 0.1574, 0.1528, "other ..."] }) -Item 81: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.2370, 0.7334, 0.4755, 0.8921, 0.1448, 0.2971, 0.2116, 0.1124, 0.7297, 0.2965, "other ..."] }) -Item 82: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5256, 0.7737, 0.1071, 0.1049, 0.5131, 0.1703, 0.7922, 0.1135, 0.4165, 0.0898, "other ..."] }) -Item 83: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.3071, 0.2166, 0.0566, 0.5153, 0.8628, 0.9601, 0.6390, 0.4052, 0.2759, 0.4989, "other ..."] }) -Item 84: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.7826, 0.2989, 0.7770, 0.4571, 0.1601, 0.9667, 0.6717, 0.1903, 0.1169, 0.8590, "other ..."] }) -Item 85: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.4718, 0.3682, 0.4350, 0.3129, 0.1289, 0.7526, 0.8249, 0.5640, 0.9296, 0.8479, "other ..."] }) -Item 86: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0498, 0.3107, 0.7264, 0.3119, 0.9096, 0.1574, 0.0399, 0.6895, 0.0600, 0.7256, "other ..."] }) -Item 87: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.2909, 0.8867, 0.3238, 0.4342, 0.3491, 0.4305, 0.8452, 0.0936, 0.1220, 0.3452, "other ..."] }) -Item 88: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8769, 0.4665, 0.6818, 0.3210, 0.8711, 0.3130, 0.2871, 0.8996, 0.6896, 0.5484, "other ..."] }) -Item 89: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6270, 0.3774, 0.7874, 0.7272, 0.4240, 0.1508, 0.0360, 0.5710, 0.2254, 0.0950, "other ..."] }) -Item 90: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.4460, 0.4258, 0.3236, 0.3679, 0.9002, 0.2569, 0.4921, 0.9407, 0.7830, 0.2773, "other ..."] }) -Item 91: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8560, 0.9670, 0.3969, 0.5008, 0.1567, 0.7420, 0.0072, 0.1891, 0.9690, 0.0387, "other ..."] }) -Item 92: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.3994, 0.3790, 0.3149, 0.3094, 0.6979, 0.4079, 0.0662, 0.5442, 0.6009, 0.6694, "other ..."] }) -Item 93: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5034, 0.4728, 0.9950, 0.7630, 0.0154, 0.4453, 0.6893, 0.6996, 0.0246, 0.0245, "other ..."] }) -Item 94: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1804, 0.0669, 0.8639, 0.6324, 0.8798, 0.3417, 0.1164, 0.5756, 0.9767, 0.7200, "other ..."] }) -Item 95: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8157, 0.8688, 0.2659, 0.6080, 0.5274, 0.1883, 0.7562, 0.8511, 0.6928, 0.8151, "other ..."] }) -Item 96: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1112, 0.3992, 0.0741, 0.7318, 0.9446, 0.2970, 0.9245, 0.1696, 0.6283, 0.9061, "other ..."] }) -Item 97: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0850, 0.4087, 0.7257, 0.3157, 0.9526, 0.5290, 0.5818, 0.5460, 0.1906, 0.9422, "other ..."] }) -Item 98: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5324, 0.0597, 0.9226, 0.4007, 0.0213, 0.2651, 0.8515, 0.9985, 0.8066, 0.3377, "other ..."] }) -Item 99: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8320, 0.5156, 0.6172, 0.6617, 0.4999, 0.2464, 0.4536, 0.3265, 0.2163, 0.5406, "other ..."] }) +Root: Metadata { dimensions: 30, items: RoaringBitmap<100 values between 0 and 99>, roots: [8, 17, 24, 35, 44, 55, 64, 75, 86, 97], distance: "euclidean" } Tree 0: Descendants(Descendants { descendants: [6, 14, 18, 21, 22, 23, 26, 28, 40, 42, 43, 44, 47, 51, 54, 59, 61, 62, 68, 73, 80, 82, 83, 87, 90] }) Tree 1: Descendants(Descendants { descendants: [8, 10, 15, 17, 20, 24, 34, 37, 46, 49, 53, 55, 57, 66, 71, 75, 77, 79, 92, 95, 98] }) Tree 2: SplitPlaneNormal(SplitPlaneNormal { left: Tree(0), right: Tree(1), normal: [-0.2169, 0.0505, 0.0138, 0.1637, -0.1566, -0.2702, 0.1215, 0.0399, 0.3132, 0.3827, "other ..."] }) @@ -212,4 +113,103 @@ Tree 123: SplitPlaneNormal(SplitPlaneNormal { left: Tree(121), right: Tree 124: Descendants(Descendants { descendants: [14, 16, 22, 38, 41, 42, 43, 44, 50, 51, 53, 59, 62, 64, 80, 84] }) Tree 125: Descendants(Descendants { descendants: [2, 10, 21, 23, 26, 28, 29, 30, 34, 37, 39, 47, 52, 54, 55, 67, 68, 69, 71, 72, 76, 78, 86, 88, 90, 94, 97, 98] }) Tree 126: SplitPlaneNormal(SplitPlaneNormal { left: Tree(124), right: Tree(125), normal: [-0.2156, 0.0925, 0.0242, 0.1246, -0.0758, -0.0672, -0.1816, 0.4853, 0.1643, 0.1418, "other ..."] }) -Root: Metadata { dimensions: 30, items: RoaringBitmap<100 values between 0 and 99>, roots: [8, 17, 24, 35, 44, 55, 64, 75, 86, 97], distance: "euclidean" } +Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5919, 0.9953, 0.7271, 0.7734, 0.5761, 0.8882, 0.8497, 0.0817, 0.3989, 0.3384, "other ..."] }) +Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.4199, 0.2620, 0.2655, 0.8414, 0.0192, 0.3828, 0.2561, 0.2692, 0.0368, 0.4624, "other ..."] }) +Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.2240, 0.0136, 0.1967, 0.7482, 0.6849, 0.7949, 0.0809, 0.5504, 0.6339, 0.6978, "other ..."] }) +Item 3: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0001, 0.7870, 0.9674, 0.4568, 0.5250, 0.2701, 0.2417, 0.8742, 0.6869, 0.8759, "other ..."] }) +Item 4: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.7711, 0.4016, 0.1489, 0.9991, 0.5236, 0.5613, 0.4596, 0.2214, 0.5016, 0.1191, "other ..."] }) +Item 5: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0850, 0.7778, 0.8818, 0.3427, 0.1293, 0.7240, 0.4773, 0.2871, 0.3988, 0.4014, "other ..."] }) +Item 6: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.7473, 0.3347, 0.9786, 0.4693, 0.3540, 0.1280, 0.9628, 0.2076, 0.3437, 0.4589, "other ..."] }) +Item 7: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5699, 0.5919, 0.7788, 0.3705, 0.3807, 0.1708, 0.3678, 0.5629, 0.0612, 0.4826, "other ..."] }) +Item 8: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1874, 0.7676, 0.9707, 0.5148, 0.7242, 0.4714, 0.1278, 0.2181, 0.2651, 0.5674, "other ..."] }) +Item 9: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8134, 0.9647, 0.6640, 0.4464, 0.7439, 0.6904, 0.3159, 0.7607, 0.3483, 0.9963, "other ..."] }) +Item 10: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.3157, 0.8096, 0.5024, 0.5421, 0.4327, 0.3696, 0.6485, 0.7972, 0.9792, 0.9554, "other ..."] }) +Item 11: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6560, 0.2343, 0.4079, 0.5972, 0.5766, 0.6739, 0.2985, 0.6167, 0.4834, 0.2818, "other ..."] }) +Item 12: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1559, 0.1898, 0.2475, 0.4582, 0.5481, 0.5846, 0.1844, 0.4898, 0.2916, 0.2669, "other ..."] }) +Item 13: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1726, 0.7399, 0.0271, 0.8721, 0.8725, 0.4023, 0.1558, 0.1044, 0.2096, 0.2081, "other ..."] }) +Item 14: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1712, 0.6340, 0.2866, 0.6282, 0.9072, 0.7589, 0.6432, 0.8676, 0.2942, 0.4375, "other ..."] }) +Item 15: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6031, 0.2970, 0.9485, 0.0272, 0.4336, 0.1339, 0.2209, 0.8350, 0.2566, 0.9481, "other ..."] }) +Item 16: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8145, 0.6759, 0.1411, 0.7878, 0.3556, 0.8440, 0.5301, 0.2627, 0.7050, 0.4145, "other ..."] }) +Item 17: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0819, 0.5362, 0.8215, 0.2263, 0.3109, 0.2738, 0.6133, 0.5147, 0.9334, 0.9877, "other ..."] }) +Item 18: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.4594, 0.9245, 0.5151, 0.7390, 0.6121, 0.5891, 0.5795, 0.6295, 0.0595, 0.6471, "other ..."] }) +Item 19: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1390, 0.7531, 0.3249, 0.8754, 0.9984, 0.7362, 0.0281, 0.2016, 0.9443, 0.1989, "other ..."] }) +Item 20: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5102, 0.8700, 0.3910, 0.0807, 0.1067, 0.0692, 0.7037, 0.4229, 0.0066, 0.1894, "other ..."] }) +Item 21: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6252, 0.9240, 0.7227, 0.6810, 0.2563, 0.3321, 0.2283, 0.9226, 0.8494, 0.0356, "other ..."] }) +Item 22: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8077, 0.3229, 0.5031, 0.0472, 0.6957, 0.9603, 0.8790, 0.2009, 0.3837, 0.1765, "other ..."] }) +Item 23: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.9915, 0.6886, 0.1976, 0.1725, 0.6776, 0.1356, 0.3842, 0.4424, 0.6939, 0.8016, "other ..."] }) +Item 24: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1651, 0.4144, 0.2816, 0.0037, 0.3038, 0.2344, 0.3321, 0.1985, 0.4704, 0.3710, "other ..."] }) +Item 25: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0116, 0.5323, 0.3940, 0.1382, 0.1987, 0.7287, 0.4026, 0.1442, 0.5957, 0.0340, "other ..."] }) +Item 26: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.7192, 0.5087, 0.9102, 0.0269, 0.7119, 0.7909, 0.0259, 0.6221, 0.9168, 0.1528, "other ..."] }) +Item 27: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.3569, 0.9070, 0.8412, 0.3201, 0.6998, 0.8674, 0.5494, 0.2322, 0.2969, 0.9787, "other ..."] }) +Item 28: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5587, 0.8792, 0.9279, 0.4203, 0.9903, 0.7524, 0.0600, 0.9020, 0.8837, 0.1950, "other ..."] }) +Item 29: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6021, 0.0690, 0.1080, 0.2535, 0.6817, 0.7899, 0.3297, 0.8656, 0.1566, 0.3560, "other ..."] }) +Item 30: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.9353, 0.1703, 0.1992, 0.7788, 0.4769, 0.5431, 0.4292, 0.5249, 0.7629, 0.9059, "other ..."] }) +Item 31: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.7584, 0.3448, 0.7315, 0.5405, 0.6797, 0.3253, 0.8611, 0.0846, 0.0174, 0.0882, "other ..."] }) +Item 32: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.3473, 0.1415, 0.1873, 0.7472, 0.3808, 0.6412, 0.1944, 0.5869, 0.0722, 0.3215, "other ..."] }) +Item 33: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.3494, 0.5787, 0.8027, 0.9625, 0.5944, 0.6781, 0.4204, 0.5899, 0.0209, 0.9001, "other ..."] }) +Item 34: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.4076, 0.8830, 0.7654, 0.5911, 0.3055, 0.0942, 0.7024, 0.9471, 0.9752, 0.4628, "other ..."] }) +Item 35: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.3281, 0.1178, 0.0533, 0.4172, 0.3990, 0.0395, 0.8533, 0.1435, 0.9799, 0.4063, "other ..."] }) +Item 36: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6939, 0.0973, 0.2992, 0.4254, 0.0919, 0.8203, 0.3851, 0.0823, 0.4547, 0.4283, "other ..."] }) +Item 37: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6603, 0.3675, 0.1019, 0.2193, 0.3180, 0.0591, 0.9934, 0.8583, 0.7473, 0.3644, "other ..."] }) +Item 38: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.7093, 0.6425, 0.0423, 0.0877, 0.7820, 0.6701, 0.4963, 0.1499, 0.8631, 0.8113, "other ..."] }) +Item 39: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.4498, 0.4107, 0.9992, 0.3928, 0.4779, 0.4661, 0.1282, 0.8140, 0.7490, 0.5641, "other ..."] }) +Item 40: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0152, 0.9782, 0.0253, 0.6194, 0.6177, 0.6446, 0.8634, 0.8343, 0.1429, 0.6369, "other ..."] }) +Item 41: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.7821, 0.0623, 0.1168, 0.3609, 0.6040, 0.8336, 0.0911, 0.2181, 0.7485, 0.0281, "other ..."] }) +Item 42: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5514, 0.2225, 0.8400, 0.2598, 0.5622, 0.6231, 0.5772, 0.0082, 0.8470, 0.9596, "other ..."] }) +Item 43: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8608, 0.8689, 0.4918, 0.2239, 0.9291, 0.0622, 0.6843, 0.4184, 0.4703, 0.3202, "other ..."] }) +Item 44: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.9144, 0.0223, 0.5079, 0.6873, 0.5501, 0.2577, 0.9304, 0.3154, 0.1546, 0.3749, "other ..."] }) +Item 45: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.9838, 0.4742, 0.5307, 0.6989, 0.9323, 0.2140, 0.1371, 0.1113, 0.0322, 0.3001, "other ..."] }) +Item 46: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5159, 0.9516, 0.6267, 0.1007, 0.4283, 0.1452, 0.9565, 0.4723, 0.4935, 0.7395, "other ..."] }) +Item 47: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.4506, 0.8658, 0.1164, 0.2339, 0.2266, 0.9050, 0.5849, 0.9792, 0.5951, 0.7706, "other ..."] }) +Item 48: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.3709, 0.3974, 0.5971, 0.7814, 0.2075, 0.5392, 0.4790, 0.5432, 0.4844, 0.3367, "other ..."] }) +Item 49: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1322, 0.0670, 0.3404, 0.5339, 0.0229, 0.5964, 0.5497, 0.3819, 0.6553, 0.7129, "other ..."] }) +Item 50: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.7462, 0.9877, 0.0796, 0.4441, 0.9824, 0.6855, 0.0985, 0.0618, 0.0551, 0.5251, "other ..."] }) +Item 51: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.3643, 0.3282, 0.2580, 0.4477, 0.5920, 0.3581, 0.3502, 0.2441, 0.1707, 0.1243, "other ..."] }) +Item 52: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8421, 0.8103, 0.5294, 0.6795, 0.9634, 0.3110, 0.8945, 0.1541, 0.5916, 0.1082, "other ..."] }) +Item 53: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5928, 0.6267, 0.1717, 0.1604, 0.6506, 0.0302, 0.8289, 0.5930, 0.9304, 0.6067, "other ..."] }) +Item 54: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8491, 0.4500, 0.8568, 0.1146, 0.7974, 0.5148, 0.0862, 0.6020, 0.7705, 0.6189, "other ..."] }) +Item 55: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6095, 0.6335, 0.4740, 0.0746, 0.3871, 0.1016, 0.6414, 0.3076, 0.5484, 0.7602, "other ..."] }) +Item 56: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.2720, 0.7143, 0.6966, 0.9709, 0.4263, 0.7441, 0.8624, 0.1372, 0.0418, 0.7771, "other ..."] }) +Item 57: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1524, 0.3441, 0.2368, 0.4350, 0.5328, 0.3005, 0.7021, 0.3614, 0.6369, 0.7984, "other ..."] }) +Item 58: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.4278, 0.5749, 0.9222, 0.8668, 0.5708, 0.7825, 0.1484, 0.1654, 0.7721, 0.1671, "other ..."] }) +Item 59: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6227, 0.1202, 0.9715, 0.3936, 0.3423, 0.7479, 0.6526, 0.1867, 0.5568, 0.0922, "other ..."] }) +Item 60: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5174, 0.1043, 0.5020, 0.7082, 0.0108, 0.7768, 0.2805, 0.5635, 0.1165, 0.3446, "other ..."] }) +Item 61: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1347, 0.7000, 0.0530, 0.4959, 0.8227, 0.9831, 0.5433, 0.5201, 0.7924, 0.3847, "other ..."] }) +Item 62: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.7594, 0.3160, 0.8848, 0.2336, 0.2080, 0.9798, 0.2609, 0.3579, 0.9043, 0.5035, "other ..."] }) +Item 63: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.9221, 0.3578, 0.3207, 0.9945, 0.9288, 0.4608, 0.3001, 0.0296, 0.4678, 0.7422, "other ..."] }) +Item 64: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.7278, 0.0499, 0.4536, 0.3295, 0.8839, 0.5060, 0.5773, 0.3133, 0.2521, 0.6842, "other ..."] }) +Item 65: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5677, 0.1247, 0.4928, 0.4097, 0.8433, 0.9238, 0.7848, 0.4437, 0.4696, 0.9886, "other ..."] }) +Item 66: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.3202, 0.9724, 0.0590, 0.9146, 0.0865, 0.5347, 0.9236, 0.5211, 0.4621, 0.4500, "other ..."] }) +Item 67: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5299, 0.5421, 0.8194, 0.1018, 0.5426, 0.9350, 0.3228, 0.7979, 0.7473, 0.1118, "other ..."] }) +Item 68: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.7403, 0.1475, 0.8585, 0.3990, 0.5766, 0.0263, 0.2665, 0.6317, 0.8026, 0.0227, "other ..."] }) +Item 69: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6163, 0.7762, 0.4365, 0.6713, 0.5647, 0.3449, 0.6615, 0.9430, 0.5941, 0.3563, "other ..."] }) +Item 70: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0981, 0.2398, 0.2595, 0.6075, 0.1605, 0.7487, 0.1070, 0.8330, 0.7908, 0.0203, "other ..."] }) +Item 71: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6478, 0.9371, 0.2378, 0.4279, 0.1400, 0.2146, 0.3193, 0.7330, 0.7932, 0.7295, "other ..."] }) +Item 72: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.9586, 0.8715, 0.0659, 0.6144, 0.4995, 0.6693, 0.1415, 0.7556, 0.9350, 0.9924, "other ..."] }) +Item 73: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.4640, 0.7218, 0.0154, 0.0829, 0.4829, 0.5139, 0.4344, 0.5872, 0.2770, 0.3745, "other ..."] }) +Item 74: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.9907, 0.6582, 0.3640, 0.9777, 0.6001, 0.3023, 0.3154, 0.2637, 0.7202, 0.7507, "other ..."] }) +Item 75: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.3639, 0.3210, 0.3718, 0.7818, 0.6264, 0.2524, 0.6018, 0.4059, 0.9744, 0.3568, "other ..."] }) +Item 76: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6910, 0.9733, 0.3937, 0.8154, 0.2171, 0.7616, 0.3415, 0.4227, 0.6408, 0.0355, "other ..."] }) +Item 77: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6003, 0.7202, 0.3803, 0.5052, 0.4006, 0.6708, 0.0438, 0.8432, 0.8772, 0.6849, "other ..."] }) +Item 78: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8030, 0.0396, 0.0641, 0.3958, 0.3427, 0.9163, 0.0129, 0.4500, 0.8504, 0.8711, "other ..."] }) +Item 79: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8093, 0.7442, 0.3738, 0.9164, 0.5923, 0.7353, 0.5379, 0.6815, 0.5925, 0.7954, "other ..."] }) +Item 80: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6515, 0.6402, 0.4825, 0.1251, 0.1569, 0.9048, 0.3695, 0.0092, 0.1574, 0.1528, "other ..."] }) +Item 81: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.2370, 0.7334, 0.4755, 0.8921, 0.1448, 0.2971, 0.2116, 0.1124, 0.7297, 0.2965, "other ..."] }) +Item 82: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5256, 0.7737, 0.1071, 0.1049, 0.5131, 0.1703, 0.7922, 0.1135, 0.4165, 0.0898, "other ..."] }) +Item 83: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.3071, 0.2166, 0.0566, 0.5153, 0.8628, 0.9601, 0.6390, 0.4052, 0.2759, 0.4989, "other ..."] }) +Item 84: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.7826, 0.2989, 0.7770, 0.4571, 0.1601, 0.9667, 0.6717, 0.1903, 0.1169, 0.8590, "other ..."] }) +Item 85: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.4718, 0.3682, 0.4350, 0.3129, 0.1289, 0.7526, 0.8249, 0.5640, 0.9296, 0.8479, "other ..."] }) +Item 86: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0498, 0.3107, 0.7264, 0.3119, 0.9096, 0.1574, 0.0399, 0.6895, 0.0600, 0.7256, "other ..."] }) +Item 87: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.2909, 0.8867, 0.3238, 0.4342, 0.3491, 0.4305, 0.8452, 0.0936, 0.1220, 0.3452, "other ..."] }) +Item 88: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8769, 0.4665, 0.6818, 0.3210, 0.8711, 0.3130, 0.2871, 0.8996, 0.6896, 0.5484, "other ..."] }) +Item 89: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6270, 0.3774, 0.7874, 0.7272, 0.4240, 0.1508, 0.0360, 0.5710, 0.2254, 0.0950, "other ..."] }) +Item 90: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.4460, 0.4258, 0.3236, 0.3679, 0.9002, 0.2569, 0.4921, 0.9407, 0.7830, 0.2773, "other ..."] }) +Item 91: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8560, 0.9670, 0.3969, 0.5008, 0.1567, 0.7420, 0.0072, 0.1891, 0.9690, 0.0387, "other ..."] }) +Item 92: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.3994, 0.3790, 0.3149, 0.3094, 0.6979, 0.4079, 0.0662, 0.5442, 0.6009, 0.6694, "other ..."] }) +Item 93: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5034, 0.4728, 0.9950, 0.7630, 0.0154, 0.4453, 0.6893, 0.6996, 0.0246, 0.0245, "other ..."] }) +Item 94: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1804, 0.0669, 0.8639, 0.6324, 0.8798, 0.3417, 0.1164, 0.5756, 0.9767, 0.7200, "other ..."] }) +Item 95: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8157, 0.8688, 0.2659, 0.6080, 0.5274, 0.1883, 0.7562, 0.8511, 0.6928, 0.8151, "other ..."] }) +Item 96: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1112, 0.3992, 0.0741, 0.7318, 0.9446, 0.2970, 0.9245, 0.1696, 0.6283, 0.9061, "other ..."] }) +Item 97: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0850, 0.4087, 0.7257, 0.3157, 0.9526, 0.5290, 0.5818, 0.5460, 0.1906, 0.9422, "other ..."] }) +Item 98: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5324, 0.0597, 0.9226, 0.4007, 0.0213, 0.2651, 0.8515, 0.9985, 0.8066, 0.3377, "other ..."] }) +Item 99: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8320, 0.5156, 0.6172, 0.6617, 0.4999, 0.2464, 0.4536, 0.3265, 0.2163, 0.5406, "other ..."] }) diff --git a/src/tests/snapshots/arroy__tests__writer__write_and_update_lot_of_random_points.snap b/src/tests/snapshots/arroy__tests__writer__write_and_update_lot_of_random_points.snap index 774440e5..6699dde7 100644 --- a/src/tests/snapshots/arroy__tests__writer__write_and_update_lot_of_random_points.snap +++ b/src/tests/snapshots/arroy__tests__writer__write_and_update_lot_of_random_points.snap @@ -4,6 +4,105 @@ expression: handle --- ================== Dumping index 0 +Root: Metadata { dimensions: 30, items: RoaringBitmap<100 values between 0 and 99>, roots: [8, 17, 24, 35, 44, 55, 64, 75, 86, 97], distance: "euclidean" } +Tree 0: Descendants(Descendants { descendants: [4, 8, 12, 18, 21, 22, 23, 24, 43, 47, 51, 56, 58, 59, 61, 64, 73, 76, 78, 80, 82, 83, 87] }) +Tree 1: Descendants(Descendants { descendants: [15, 17, 20, 32, 37, 38, 49, 52, 53, 54, 55, 57, 60, 68, 71, 75, 77, 79, 84, 88, 94, 95] }) +Tree 2: SplitPlaneNormal(SplitPlaneNormal { left: Tree(0), right: Tree(1), normal: [-0.2169, 0.0505, 0.0138, 0.1637, -0.1566, -0.2702, 0.1215, 0.0399, 0.3132, 0.3827, "other ..."] }) +Tree 3: Descendants(Descendants { descendants: [0, 9, 10, 29, 31, 34, 35, 42, 48, 50, 70, 74, 89, 92, 93] }) +Tree 4: Descendants(Descendants { descendants: [2, 3, 5, 6, 7, 11, 14, 25, 39, 40, 44, 62, 67, 69, 81, 86, 91, 96, 97, 98, 99] }) +Tree 5: Descendants(Descendants { descendants: [1, 13, 16, 19, 26, 27, 28, 30, 33, 36, 41, 45, 46, 63, 65, 66, 72, 85, 90] }) +Tree 6: SplitPlaneNormal(SplitPlaneNormal { left: Tree(4), right: Tree(5), normal: [0.0550, -0.0317, -0.1815, 0.1748, 0.2592, 0.1276, 0.0648, -0.3539, -0.1585, 0.0911, "other ..."] }) +Tree 7: SplitPlaneNormal(SplitPlaneNormal { left: Tree(3), right: Tree(6), normal: [-0.0346, 0.4691, 0.1765, -0.0148, 0.0259, 0.1307, -0.1240, -0.1665, 0.0875, 0.1291, "other ..."] }) +Tree 8: SplitPlaneNormal(SplitPlaneNormal { left: Tree(2), right: Tree(7), normal: [-0.0833, -0.0190, -0.0905, 0.1619, -0.0567, 0.2069, -0.2559, -0.1137, 0.0169, -0.0864, "other ..."] }) +Tree 9: Descendants(Descendants { descendants: [1, 6, 7, 10, 13, 26, 28, 31, 36, 39, 42, 48, 50, 62, 70, 86, 96, 97] }) +Tree 10: Descendants(Descendants { descendants: [2, 3, 9, 11, 27, 29, 30, 45, 46, 57, 65, 66, 67, 72, 73, 85, 91] }) +Tree 11: SplitPlaneNormal(SplitPlaneNormal { left: Tree(9), right: Tree(10), normal: [0.0163, 0.0439, -0.0411, -0.3070, 0.1504, 0.3722, 0.0400, 0.0252, 0.0917, -0.0341, "other ..."] }) +Tree 12: Descendants(Descendants { descendants: [0, 4, 8, 17, 18, 19, 32, 35, 37, 41, 47, 51, 52, 53, 54, 55, 60, 61, 64, 68, 75, 77, 78, 79, 87, 90, 95, 98] }) +Tree 13: Descendants(Descendants { descendants: [5, 12, 15, 16, 20, 21, 22, 23, 24, 38, 43, 56, 58, 59, 63, 69, 71, 74, 76, 80, 82, 83, 89, 93, 94] }) +Tree 14: Descendants(Descendants { descendants: [14, 25, 33, 34, 40, 44, 49, 81, 84, 88, 92, 99] }) +Tree 15: SplitPlaneNormal(SplitPlaneNormal { left: Tree(13), right: Tree(14), normal: [-0.3533, -0.1026, 0.1114, 0.1360, -0.1732, 0.1633, -0.0302, -0.1458, -0.0030, -0.2101, "other ..."] }) +Tree 16: SplitPlaneNormal(SplitPlaneNormal { left: Tree(12), right: Tree(15), normal: [0.2420, -0.1007, 0.3792, 0.0349, -0.0702, 0.0947, -0.3028, -0.1386, -0.2889, 0.0402, "other ..."] }) +Tree 17: SplitPlaneNormal(SplitPlaneNormal { left: Tree(11), right: Tree(16), normal: [-0.0014, -0.0866, -0.0081, 0.0327, -0.1021, -0.1147, 0.0955, 0.0205, 0.2358, -0.1408, "other ..."] }) +Tree 18: Descendants(Descendants { descendants: [0, 2, 4, 6, 7, 9, 11, 14, 25, 26, 27, 28, 29, 33, 34, 40, 42, 62, 67, 81, 86, 91, 96, 97, 98] }) +Tree 19: Descendants(Descendants { descendants: [1, 8, 10, 13, 19, 30, 31, 35, 36, 39, 44, 45, 46, 50, 51, 52, 54, 56, 66, 72, 80, 85, 89, 90, 92, 93] }) +Tree 20: SplitPlaneNormal(SplitPlaneNormal { left: Tree(18), right: Tree(19), normal: [-0.0557, -0.0514, -0.1661, -0.1599, 0.0364, -0.1539, 0.0511, -0.1720, -0.0989, -0.0885, "other ..."] }) +Tree 21: Descendants(Descendants { descendants: [3, 5, 15, 16, 17, 18, 20, 22, 24, 32, 38, 48, 49, 58, 59, 60, 63, 65, 69, 74, 75, 76, 79, 82, 83, 84, 87, 88, 94] }) +Tree 22: Descendants(Descendants { descendants: [12, 21, 23, 37, 41, 43, 47, 53, 55, 57, 61, 64, 68, 70, 71, 73, 77, 78, 95, 99] }) +Tree 23: SplitPlaneNormal(SplitPlaneNormal { left: Tree(21), right: Tree(22), normal: [0.1147, 0.1494, -0.3442, -0.2764, 0.1638, -0.3154, 0.0552, 0.1184, 0.1290, 0.0611, "other ..."] }) +Tree 24: SplitPlaneNormal(SplitPlaneNormal { left: Tree(20), right: Tree(23), normal: [-0.0617, -0.0186, -0.1350, -0.3128, -0.0542, 0.0524, 0.2907, 0.1259, 0.0908, 0.2518, "other ..."] }) +Tree 25: Descendants(Descendants { descendants: [0, 14, 32, 34, 74, 84, 92] }) +Tree 26: Descendants(Descendants { descendants: [5, 12, 20, 22, 24, 38, 43, 49, 58, 59, 76, 82, 83, 88, 94] }) +Tree 27: Descendants(Descendants { descendants: [3, 4, 6, 8, 15, 17, 18, 21, 23, 37, 47, 50, 52, 53, 54, 55, 61, 64, 67, 68, 71, 73, 75, 78, 79, 80, 87, 95] }) +Tree 28: SplitPlaneNormal(SplitPlaneNormal { left: Tree(26), right: Tree(27), normal: [0.0098, 0.2629, -0.1633, -0.1082, -0.0680, -0.1540, 0.0015, 0.1634, 0.2796, 0.1046, "other ..."] }) +Tree 29: Descendants(Descendants { descendants: [2, 7, 9, 11, 31, 33, 35, 39, 44, 46, 66, 69, 72, 81, 86, 89, 97, 98, 99] }) +Tree 30: SplitPlaneNormal(SplitPlaneNormal { left: Tree(28), right: Tree(29), normal: [-0.1005, -0.0667, 0.1734, 0.2457, 0.1330, 0.0145, -0.1141, -0.0260, -0.1916, -0.1144, "other ..."] }) +Tree 31: SplitPlaneNormal(SplitPlaneNormal { left: Tree(25), right: Tree(30), normal: [0.0357, 0.2985, -0.2477, -0.0879, 0.2653, 0.2303, 0.1487, 0.0825, -0.0937, 0.1187, "other ..."] }) +Tree 32: Descendants(Descendants { descendants: [13, 16, 19, 25, 26, 27, 30, 40, 41, 42, 56, 60, 62, 77, 85, 90, 91] }) +Tree 33: Descendants(Descendants { descendants: [1, 10, 28, 29, 36, 45, 48, 51, 57, 63, 65, 70, 93, 96] }) +Tree 34: SplitPlaneNormal(SplitPlaneNormal { left: Tree(32), right: Tree(33), normal: [0.1342, -0.2475, -0.0482, 0.0488, 0.0620, -0.3127, 0.1362, 0.1854, -0.4856, 0.1147, "other ..."] }) +Tree 35: SplitPlaneNormal(SplitPlaneNormal { left: Tree(31), right: Tree(34), normal: [-0.1861, -0.2141, -0.1520, 0.0974, 0.0900, 0.2616, -0.0688, -0.2960, -0.0378, -0.0949, "other ..."] }) +Tree 36: Descendants(Descendants { descendants: [8, 12, 15, 16, 21, 22, 24, 30, 34, 46, 52, 53, 56, 59, 60, 71, 74, 87, 89, 92, 93] }) +Tree 37: Descendants(Descendants { descendants: [2, 5, 7, 9, 14, 17, 19, 25, 27, 31, 36, 39, 40, 42, 55, 62, 66, 67, 72, 80, 81, 84, 86, 88, 91, 96, 97] }) +Tree 38: Descendants(Descendants { descendants: [0, 4, 6, 11, 23, 28, 33, 44, 54, 63, 69, 75, 94, 98, 99] }) +Tree 39: SplitPlaneNormal(SplitPlaneNormal { left: Tree(37), right: Tree(38), normal: [0.2761, -0.2159, -0.3421, 0.2165, 0.3175, -0.0799, 0.0880, 0.0680, 0.0497, -0.0448, "other ..."] }) +Tree 40: SplitPlaneNormal(SplitPlaneNormal { left: Tree(36), right: Tree(39), normal: [-0.0582, 0.0824, 0.2122, 0.1920, 0.2041, -0.0451, -0.0324, 0.0349, 0.0748, 0.2791, "other ..."] }) +Tree 41: Descendants(Descendants { descendants: [1, 3, 18, 29, 41, 43, 45, 47, 48, 49, 50, 58, 64, 65, 73, 76, 77, 78, 82, 83, 85] }) +Tree 42: Descendants(Descendants { descendants: [10, 13, 20, 26, 32, 35, 37, 38, 51, 57, 61, 68, 70, 79, 90, 95] }) +Tree 43: SplitPlaneNormal(SplitPlaneNormal { left: Tree(41), right: Tree(42), normal: [-0.2362, 0.0074, -0.1011, 0.1902, -0.2410, -0.2179, 0.1000, -0.2451, 0.0583, 0.2037, "other ..."] }) +Tree 44: SplitPlaneNormal(SplitPlaneNormal { left: Tree(40), right: Tree(43), normal: [-0.0723, -0.1644, -0.4771, -0.0662, 0.1894, 0.0474, 0.2151, 0.0954, -0.0123, 0.1914, "other ..."] }) +Tree 45: Descendants(Descendants { descendants: [20, 22, 23, 43, 49, 53, 55, 58, 75, 82, 88, 94] }) +Tree 46: Descendants(Descendants { descendants: [12, 16, 21, 30, 31, 39, 41, 45, 46, 47, 51, 56, 59, 66, 72, 77, 78, 80, 85, 91, 93, 98] }) +Tree 47: Descendants(Descendants { descendants: [8, 13, 19, 27, 37, 40, 42, 52, 64, 67, 68, 71, 73, 87] }) +Tree 48: SplitPlaneNormal(SplitPlaneNormal { left: Tree(46), right: Tree(47), normal: [-0.0763, 0.0885, -0.2724, 0.0145, 0.0947, -0.2347, 0.1067, -0.0488, 0.0689, 0.0441, "other ..."] }) +Tree 49: Descendants(Descendants { descendants: [6, 28, 54, 90, 96] }) +Tree 50: SplitPlaneNormal(SplitPlaneNormal { left: Tree(48), right: Tree(49), normal: [-0.0493, 0.0077, 0.1071, 0.2488, -0.0877, -0.1022, -0.1081, -0.0104, 0.0486, -0.0089, "other ..."] }) +Tree 51: Descendants(Descendants { descendants: [0, 1, 4, 10, 29, 35, 48, 50, 57, 63, 65, 70, 76, 83, 89, 95, 97] }) +Tree 52: Descendants(Descendants { descendants: [2, 3, 5, 7, 9, 11, 14, 15, 17, 18, 24, 25, 26, 32, 33, 34, 36, 38, 44, 60, 61, 62, 69, 74, 79, 81, 84, 86, 92, 99] }) +Tree 53: SplitPlaneNormal(SplitPlaneNormal { left: Tree(51), right: Tree(52), normal: [-0.2008, 0.1922, 0.3079, -0.0453, -0.3244, 0.1055, -0.0466, -0.1035, 0.1446, -0.0438, "other ..."] }) +Tree 54: SplitPlaneNormal(SplitPlaneNormal { left: Tree(50), right: Tree(53), normal: [-0.2175, -0.1158, -0.0781, 0.0622, -0.2080, 0.0082, 0.1641, 0.0493, -0.0815, 0.2456, "other ..."] }) +Tree 55: SplitPlaneNormal(SplitPlaneNormal { left: Tree(45), right: Tree(54), normal: [-0.0297, 0.0635, -0.0090, 0.0742, 0.0765, 0.2930, -0.2378, -0.0111, -0.1069, -0.1084, "other ..."] }) +Tree 56: Descendants(Descendants { descendants: [1, 2, 3, 6, 7, 14, 26, 27, 33, 36, 62, 81, 86, 93, 96, 99] }) +Tree 57: Descendants(Descendants { descendants: [0, 4, 10, 11, 28, 29, 39, 42, 44, 50, 57, 67, 70, 74, 95, 97, 98] }) +Tree 58: SplitPlaneNormal(SplitPlaneNormal { left: Tree(56), right: Tree(57), normal: [0.0169, -0.4385, -0.4607, -0.2781, 0.3243, 0.0145, 0.1026, 0.2875, 0.0069, -0.1195, "other ..."] }) +Tree 59: Descendants(Descendants { descendants: [5, 9, 15, 23, 31, 34, 38, 45, 48, 58, 63, 65, 69, 77, 80, 83, 89] }) +Tree 60: SplitPlaneNormal(SplitPlaneNormal { left: Tree(58), right: Tree(59), normal: [0.1786, -0.1600, -0.2775, -0.0898, 0.1079, 0.1067, -0.0025, 0.0785, -0.0136, -0.0227, "other ..."] }) +Tree 61: Descendants(Descendants { descendants: [17, 19, 20, 25, 32, 35, 37, 40, 41, 49, 52, 53, 55, 60, 71, 75, 79, 82, 84, 88, 90, 91, 92] }) +Tree 62: Descendants(Descendants { descendants: [8, 12, 13, 16, 18, 21, 22, 24, 30, 43, 46, 47, 51, 54, 56, 59, 61, 64, 66, 68, 72, 73, 76, 78, 85, 87, 94] }) +Tree 63: SplitPlaneNormal(SplitPlaneNormal { left: Tree(61), right: Tree(62), normal: [0.0237, 0.2316, 0.0207, 0.0743, 0.2916, 0.2200, 0.0594, 0.0390, -0.4108, -0.0552, "other ..."] }) +Tree 64: SplitPlaneNormal(SplitPlaneNormal { left: Tree(60), right: Tree(63), normal: [-0.0179, -0.0168, -0.2421, -0.1799, -0.1356, 0.0168, 0.1303, -0.2701, 0.3890, -0.1482, "other ..."] }) +Tree 65: Descendants(Descendants { descendants: [0, 2, 3, 7, 9, 14, 17, 25, 37, 39, 40, 55, 60, 65, 67, 70, 77, 96, 97, 98] }) +Tree 66: Descendants(Descendants { descendants: [1, 6, 8, 10, 11, 13, 19, 26, 27, 28, 30, 42, 46, 52, 62, 66, 72, 73, 85, 87, 90, 91] }) +Tree 67: SplitPlaneNormal(SplitPlaneNormal { left: Tree(65), right: Tree(66), normal: [0.0741, 0.1397, -0.1747, 0.1955, 0.0976, -0.0066, -0.2642, -0.4876, -0.0256, -0.1423, "other ..."] }) +Tree 68: Descendants(Descendants { descendants: [32, 34, 35, 44, 74, 75, 84, 92, 99] }) +Tree 69: Descendants(Descendants { descendants: [4, 15, 18, 20, 24, 29, 38, 47, 57, 58, 61, 63, 64, 68, 69, 76, 79, 81, 83, 86, 94, 95] }) +Tree 70: Descendants(Descendants { descendants: [5, 22, 31, 33, 36, 45, 48, 50, 51, 54, 56, 80, 89, 93] }) +Tree 71: SplitPlaneNormal(SplitPlaneNormal { left: Tree(69), right: Tree(70), normal: [0.0908, -0.0903, 0.3735, 0.0708, -0.0676, -0.1918, -0.1890, -0.2189, -0.3541, -0.3300, "other ..."] }) +Tree 72: Descendants(Descendants { descendants: [12, 16, 21, 23, 41, 43, 49, 53, 59, 71, 78, 82, 88] }) +Tree 73: SplitPlaneNormal(SplitPlaneNormal { left: Tree(71), right: Tree(72), normal: [-0.0215, 0.0861, 0.0260, -0.2042, -0.1901, -0.1088, 0.0154, -0.2001, 0.3676, -0.0737, "other ..."] }) +Tree 74: SplitPlaneNormal(SplitPlaneNormal { left: Tree(68), right: Tree(73), normal: [0.1338, 0.3609, -0.1010, -0.1138, 0.0836, 0.0482, -0.0207, 0.0315, 0.1349, 0.1157, "other ..."] }) +Tree 75: SplitPlaneNormal(SplitPlaneNormal { left: Tree(67), right: Tree(74), normal: [0.0874, -0.1312, 0.0401, 0.1433, -0.0151, -0.0312, 0.0888, 0.0681, -0.2158, -0.0702, "other ..."] }) +Tree 76: Descendants(Descendants { descendants: [0, 1, 6, 19, 28, 40, 42, 48, 63, 81, 91] }) +Tree 77: Descendants(Descendants { descendants: [2, 4, 7, 10, 11, 14, 17, 20, 25, 26, 31, 32, 33, 34, 36, 62, 70, 74, 86, 93, 99] }) +Tree 78: SplitPlaneNormal(SplitPlaneNormal { left: Tree(76), right: Tree(77), normal: [-0.2023, 0.0033, 0.1400, -0.2031, -0.1474, -0.0398, 0.4147, 0.3168, -0.3442, 0.1913, "other ..."] }) +Tree 79: Descendants(Descendants { descendants: [35, 38, 49, 60, 75, 76, 84, 88, 92] }) +Tree 80: SplitPlaneNormal(SplitPlaneNormal { left: Tree(78), right: Tree(79), normal: [-0.2920, -0.3421, -0.2821, -0.1193, -0.0368, 0.1317, 0.2692, -0.1174, -0.0436, -0.0298, "other ..."] }) +Tree 81: Descendants(Descendants { descendants: [8, 27, 30, 85] }) +Tree 82: Descendants(Descendants { descendants: [12, 18, 21, 23, 29, 37, 39, 41, 43, 44, 46, 47, 51, 52, 53, 55, 56, 59, 64, 66, 67, 68, 69, 71, 72, 78, 82, 96, 97, 98] }) +Tree 83: Descendants(Descendants { descendants: [3, 5, 9, 13, 15, 16, 22, 24, 45, 50, 54, 57, 58, 61, 65, 73, 77, 79, 80, 83, 87, 89, 90, 94, 95] }) +Tree 84: SplitPlaneNormal(SplitPlaneNormal { left: Tree(82), right: Tree(83), normal: [-0.0973, 0.2024, -0.0486, 0.1536, -0.0050, 0.0761, -0.0099, -0.1343, -0.3098, 0.2276, "other ..."] }) +Tree 85: SplitPlaneNormal(SplitPlaneNormal { left: Tree(81), right: Tree(84), normal: [0.1433, -0.2044, -0.0819, -0.1305, 0.0272, 0.1805, 0.0805, 0.1128, 0.0279, -0.0258, "other ..."] }) +Tree 86: SplitPlaneNormal(SplitPlaneNormal { left: Tree(80), right: Tree(85), normal: [0.0240, 0.1785, 0.0265, -0.3440, 0.1702, 0.0470, 0.0107, 0.2175, -0.0317, 0.1600, "other ..."] }) +Tree 87: Descendants(Descendants { descendants: [8, 13, 16, 21, 27, 28, 29, 30, 37, 41, 46, 47, 48, 56, 60, 64, 73, 78, 85, 91] }) +Tree 88: Descendants(Descendants { descendants: [1, 2, 3, 6, 7, 14, 17, 40, 42, 52, 62, 67, 77, 96, 98] }) +Tree 89: Descendants(Descendants { descendants: [20, 26, 32, 38, 49, 58, 61, 68, 75, 76, 79, 81, 86, 88, 94] }) +Tree 90: Descendants(Descendants { descendants: [24, 31, 33, 36, 39, 45, 50, 51, 54, 57, 63, 66, 72, 80, 89, 90, 93, 95, 97] }) +Tree 91: Descendants(Descendants { descendants: [0, 4, 5, 9, 12, 15, 18, 22, 23, 34, 35, 43, 44, 53, 55, 69, 71, 74, 82, 83, 84, 87, 92, 99] }) +Tree 92: SplitPlaneNormal(SplitPlaneNormal { left: Tree(90), right: Tree(91), normal: [0.1432, -0.2381, -0.0722, -0.2146, -0.0888, -0.0131, 0.0621, 0.2812, 0.2690, -0.0300, "other ..."] }) +Tree 93: Descendants(Descendants { descendants: [10, 11, 19, 25, 59, 65, 70] }) +Tree 94: SplitPlaneNormal(SplitPlaneNormal { left: Tree(92), right: Tree(93), normal: [-0.3120, -0.2834, -0.0907, 0.0227, 0.0090, 0.3812, 0.1933, -0.4350, -0.0939, -0.1180, "other ..."] }) +Tree 95: SplitPlaneNormal(SplitPlaneNormal { left: Tree(89), right: Tree(94), normal: [-0.0200, -0.2200, 0.1948, -0.1418, 0.1112, 0.0083, -0.0510, -0.0801, -0.3187, -0.1000, "other ..."] }) +Tree 96: SplitPlaneNormal(SplitPlaneNormal { left: Tree(88), right: Tree(95), normal: [0.0684, -0.2434, -0.1543, 0.0337, 0.1784, 0.1295, 0.3061, -0.0175, -0.0679, -0.1419, "other ..."] }) +Tree 97: SplitPlaneNormal(SplitPlaneNormal { left: Tree(87), right: Tree(96), normal: [-0.0316, -0.1036, 0.3252, -0.0985, -0.1286, -0.4867, -0.0286, 0.1159, -0.0177, 0.2205, "other ..."] }) Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8013, 0.2371, 0.6955, 0.8606, 0.5280, 0.2667, 0.6057, 0.9830, 0.9430, 0.0479, "other ..."] }) Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.4199, 0.2620, 0.2655, 0.8414, 0.0192, 0.3828, 0.2561, 0.2692, 0.0368, 0.4624, "other ..."] }) Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1040, 0.9647, 0.8238, 0.5344, 0.4903, 0.4420, 0.7937, 0.4028, 0.2083, 0.3315, "other ..."] }) @@ -104,102 +203,3 @@ Item 96: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.6829, Item 97: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0850, 0.4087, 0.7257, 0.3157, 0.9526, 0.5290, 0.5818, 0.5460, 0.1906, 0.9422, "other ..."] }) Item 98: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.5644, 0.3510, 0.4506, 0.6384, 0.6324, 0.5511, 0.5272, 0.8371, 0.9137, 0.4253, "other ..."] }) Item 99: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.8320, 0.5156, 0.6172, 0.6617, 0.4999, 0.2464, 0.4536, 0.3265, 0.2163, 0.5406, "other ..."] }) -Tree 0: Descendants(Descendants { descendants: [4, 8, 12, 18, 21, 22, 23, 24, 43, 47, 51, 56, 58, 59, 61, 64, 73, 76, 78, 80, 82, 83, 87] }) -Tree 1: Descendants(Descendants { descendants: [15, 17, 20, 32, 37, 38, 49, 52, 53, 54, 55, 57, 60, 68, 71, 75, 77, 79, 84, 88, 94, 95] }) -Tree 2: SplitPlaneNormal(SplitPlaneNormal { left: Tree(0), right: Tree(1), normal: [-0.2169, 0.0505, 0.0138, 0.1637, -0.1566, -0.2702, 0.1215, 0.0399, 0.3132, 0.3827, "other ..."] }) -Tree 3: Descendants(Descendants { descendants: [0, 9, 10, 29, 31, 34, 35, 42, 48, 50, 70, 74, 89, 92, 93] }) -Tree 4: Descendants(Descendants { descendants: [2, 3, 5, 6, 7, 11, 14, 25, 39, 40, 44, 62, 67, 69, 81, 86, 91, 96, 97, 98, 99] }) -Tree 5: Descendants(Descendants { descendants: [1, 13, 16, 19, 26, 27, 28, 30, 33, 36, 41, 45, 46, 63, 65, 66, 72, 85, 90] }) -Tree 6: SplitPlaneNormal(SplitPlaneNormal { left: Tree(4), right: Tree(5), normal: [0.0550, -0.0317, -0.1815, 0.1748, 0.2592, 0.1276, 0.0648, -0.3539, -0.1585, 0.0911, "other ..."] }) -Tree 7: SplitPlaneNormal(SplitPlaneNormal { left: Tree(3), right: Tree(6), normal: [-0.0346, 0.4691, 0.1765, -0.0148, 0.0259, 0.1307, -0.1240, -0.1665, 0.0875, 0.1291, "other ..."] }) -Tree 8: SplitPlaneNormal(SplitPlaneNormal { left: Tree(2), right: Tree(7), normal: [-0.0833, -0.0190, -0.0905, 0.1619, -0.0567, 0.2069, -0.2559, -0.1137, 0.0169, -0.0864, "other ..."] }) -Tree 9: Descendants(Descendants { descendants: [1, 6, 7, 10, 13, 26, 28, 31, 36, 39, 42, 48, 50, 62, 70, 86, 96, 97] }) -Tree 10: Descendants(Descendants { descendants: [2, 3, 9, 11, 27, 29, 30, 45, 46, 57, 65, 66, 67, 72, 73, 85, 91] }) -Tree 11: SplitPlaneNormal(SplitPlaneNormal { left: Tree(9), right: Tree(10), normal: [0.0163, 0.0439, -0.0411, -0.3070, 0.1504, 0.3722, 0.0400, 0.0252, 0.0917, -0.0341, "other ..."] }) -Tree 12: Descendants(Descendants { descendants: [0, 4, 8, 17, 18, 19, 32, 35, 37, 41, 47, 51, 52, 53, 54, 55, 60, 61, 64, 68, 75, 77, 78, 79, 87, 90, 95, 98] }) -Tree 13: Descendants(Descendants { descendants: [5, 12, 15, 16, 20, 21, 22, 23, 24, 38, 43, 56, 58, 59, 63, 69, 71, 74, 76, 80, 82, 83, 89, 93, 94] }) -Tree 14: Descendants(Descendants { descendants: [14, 25, 33, 34, 40, 44, 49, 81, 84, 88, 92, 99] }) -Tree 15: SplitPlaneNormal(SplitPlaneNormal { left: Tree(13), right: Tree(14), normal: [-0.3533, -0.1026, 0.1114, 0.1360, -0.1732, 0.1633, -0.0302, -0.1458, -0.0030, -0.2101, "other ..."] }) -Tree 16: SplitPlaneNormal(SplitPlaneNormal { left: Tree(12), right: Tree(15), normal: [0.2420, -0.1007, 0.3792, 0.0349, -0.0702, 0.0947, -0.3028, -0.1386, -0.2889, 0.0402, "other ..."] }) -Tree 17: SplitPlaneNormal(SplitPlaneNormal { left: Tree(11), right: Tree(16), normal: [-0.0014, -0.0866, -0.0081, 0.0327, -0.1021, -0.1147, 0.0955, 0.0205, 0.2358, -0.1408, "other ..."] }) -Tree 18: Descendants(Descendants { descendants: [0, 2, 4, 6, 7, 9, 11, 14, 25, 26, 27, 28, 29, 33, 34, 40, 42, 62, 67, 81, 86, 91, 96, 97, 98] }) -Tree 19: Descendants(Descendants { descendants: [1, 8, 10, 13, 19, 30, 31, 35, 36, 39, 44, 45, 46, 50, 51, 52, 54, 56, 66, 72, 80, 85, 89, 90, 92, 93] }) -Tree 20: SplitPlaneNormal(SplitPlaneNormal { left: Tree(18), right: Tree(19), normal: [-0.0557, -0.0514, -0.1661, -0.1599, 0.0364, -0.1539, 0.0511, -0.1720, -0.0989, -0.0885, "other ..."] }) -Tree 21: Descendants(Descendants { descendants: [3, 5, 15, 16, 17, 18, 20, 22, 24, 32, 38, 48, 49, 58, 59, 60, 63, 65, 69, 74, 75, 76, 79, 82, 83, 84, 87, 88, 94] }) -Tree 22: Descendants(Descendants { descendants: [12, 21, 23, 37, 41, 43, 47, 53, 55, 57, 61, 64, 68, 70, 71, 73, 77, 78, 95, 99] }) -Tree 23: SplitPlaneNormal(SplitPlaneNormal { left: Tree(21), right: Tree(22), normal: [0.1147, 0.1494, -0.3442, -0.2764, 0.1638, -0.3154, 0.0552, 0.1184, 0.1290, 0.0611, "other ..."] }) -Tree 24: SplitPlaneNormal(SplitPlaneNormal { left: Tree(20), right: Tree(23), normal: [-0.0617, -0.0186, -0.1350, -0.3128, -0.0542, 0.0524, 0.2907, 0.1259, 0.0908, 0.2518, "other ..."] }) -Tree 25: Descendants(Descendants { descendants: [0, 14, 32, 34, 74, 84, 92] }) -Tree 26: Descendants(Descendants { descendants: [5, 12, 20, 22, 24, 38, 43, 49, 58, 59, 76, 82, 83, 88, 94] }) -Tree 27: Descendants(Descendants { descendants: [3, 4, 6, 8, 15, 17, 18, 21, 23, 37, 47, 50, 52, 53, 54, 55, 61, 64, 67, 68, 71, 73, 75, 78, 79, 80, 87, 95] }) -Tree 28: SplitPlaneNormal(SplitPlaneNormal { left: Tree(26), right: Tree(27), normal: [0.0098, 0.2629, -0.1633, -0.1082, -0.0680, -0.1540, 0.0015, 0.1634, 0.2796, 0.1046, "other ..."] }) -Tree 29: Descendants(Descendants { descendants: [2, 7, 9, 11, 31, 33, 35, 39, 44, 46, 66, 69, 72, 81, 86, 89, 97, 98, 99] }) -Tree 30: SplitPlaneNormal(SplitPlaneNormal { left: Tree(28), right: Tree(29), normal: [-0.1005, -0.0667, 0.1734, 0.2457, 0.1330, 0.0145, -0.1141, -0.0260, -0.1916, -0.1144, "other ..."] }) -Tree 31: SplitPlaneNormal(SplitPlaneNormal { left: Tree(25), right: Tree(30), normal: [0.0357, 0.2985, -0.2477, -0.0879, 0.2653, 0.2303, 0.1487, 0.0825, -0.0937, 0.1187, "other ..."] }) -Tree 32: Descendants(Descendants { descendants: [13, 16, 19, 25, 26, 27, 30, 40, 41, 42, 56, 60, 62, 77, 85, 90, 91] }) -Tree 33: Descendants(Descendants { descendants: [1, 10, 28, 29, 36, 45, 48, 51, 57, 63, 65, 70, 93, 96] }) -Tree 34: SplitPlaneNormal(SplitPlaneNormal { left: Tree(32), right: Tree(33), normal: [0.1342, -0.2475, -0.0482, 0.0488, 0.0620, -0.3127, 0.1362, 0.1854, -0.4856, 0.1147, "other ..."] }) -Tree 35: SplitPlaneNormal(SplitPlaneNormal { left: Tree(31), right: Tree(34), normal: [-0.1861, -0.2141, -0.1520, 0.0974, 0.0900, 0.2616, -0.0688, -0.2960, -0.0378, -0.0949, "other ..."] }) -Tree 36: Descendants(Descendants { descendants: [8, 12, 15, 16, 21, 22, 24, 30, 34, 46, 52, 53, 56, 59, 60, 71, 74, 87, 89, 92, 93] }) -Tree 37: Descendants(Descendants { descendants: [2, 5, 7, 9, 14, 17, 19, 25, 27, 31, 36, 39, 40, 42, 55, 62, 66, 67, 72, 80, 81, 84, 86, 88, 91, 96, 97] }) -Tree 38: Descendants(Descendants { descendants: [0, 4, 6, 11, 23, 28, 33, 44, 54, 63, 69, 75, 94, 98, 99] }) -Tree 39: SplitPlaneNormal(SplitPlaneNormal { left: Tree(37), right: Tree(38), normal: [0.2761, -0.2159, -0.3421, 0.2165, 0.3175, -0.0799, 0.0880, 0.0680, 0.0497, -0.0448, "other ..."] }) -Tree 40: SplitPlaneNormal(SplitPlaneNormal { left: Tree(36), right: Tree(39), normal: [-0.0582, 0.0824, 0.2122, 0.1920, 0.2041, -0.0451, -0.0324, 0.0349, 0.0748, 0.2791, "other ..."] }) -Tree 41: Descendants(Descendants { descendants: [1, 3, 18, 29, 41, 43, 45, 47, 48, 49, 50, 58, 64, 65, 73, 76, 77, 78, 82, 83, 85] }) -Tree 42: Descendants(Descendants { descendants: [10, 13, 20, 26, 32, 35, 37, 38, 51, 57, 61, 68, 70, 79, 90, 95] }) -Tree 43: SplitPlaneNormal(SplitPlaneNormal { left: Tree(41), right: Tree(42), normal: [-0.2362, 0.0074, -0.1011, 0.1902, -0.2410, -0.2179, 0.1000, -0.2451, 0.0583, 0.2037, "other ..."] }) -Tree 44: SplitPlaneNormal(SplitPlaneNormal { left: Tree(40), right: Tree(43), normal: [-0.0723, -0.1644, -0.4771, -0.0662, 0.1894, 0.0474, 0.2151, 0.0954, -0.0123, 0.1914, "other ..."] }) -Tree 45: Descendants(Descendants { descendants: [20, 22, 23, 43, 49, 53, 55, 58, 75, 82, 88, 94] }) -Tree 46: Descendants(Descendants { descendants: [12, 16, 21, 30, 31, 39, 41, 45, 46, 47, 51, 56, 59, 66, 72, 77, 78, 80, 85, 91, 93, 98] }) -Tree 47: Descendants(Descendants { descendants: [8, 13, 19, 27, 37, 40, 42, 52, 64, 67, 68, 71, 73, 87] }) -Tree 48: SplitPlaneNormal(SplitPlaneNormal { left: Tree(46), right: Tree(47), normal: [-0.0763, 0.0885, -0.2724, 0.0145, 0.0947, -0.2347, 0.1067, -0.0488, 0.0689, 0.0441, "other ..."] }) -Tree 49: Descendants(Descendants { descendants: [6, 28, 54, 90, 96] }) -Tree 50: SplitPlaneNormal(SplitPlaneNormal { left: Tree(48), right: Tree(49), normal: [-0.0493, 0.0077, 0.1071, 0.2488, -0.0877, -0.1022, -0.1081, -0.0104, 0.0486, -0.0089, "other ..."] }) -Tree 51: Descendants(Descendants { descendants: [0, 1, 4, 10, 29, 35, 48, 50, 57, 63, 65, 70, 76, 83, 89, 95, 97] }) -Tree 52: Descendants(Descendants { descendants: [2, 3, 5, 7, 9, 11, 14, 15, 17, 18, 24, 25, 26, 32, 33, 34, 36, 38, 44, 60, 61, 62, 69, 74, 79, 81, 84, 86, 92, 99] }) -Tree 53: SplitPlaneNormal(SplitPlaneNormal { left: Tree(51), right: Tree(52), normal: [-0.2008, 0.1922, 0.3079, -0.0453, -0.3244, 0.1055, -0.0466, -0.1035, 0.1446, -0.0438, "other ..."] }) -Tree 54: SplitPlaneNormal(SplitPlaneNormal { left: Tree(50), right: Tree(53), normal: [-0.2175, -0.1158, -0.0781, 0.0622, -0.2080, 0.0082, 0.1641, 0.0493, -0.0815, 0.2456, "other ..."] }) -Tree 55: SplitPlaneNormal(SplitPlaneNormal { left: Tree(45), right: Tree(54), normal: [-0.0297, 0.0635, -0.0090, 0.0742, 0.0765, 0.2930, -0.2378, -0.0111, -0.1069, -0.1084, "other ..."] }) -Tree 56: Descendants(Descendants { descendants: [1, 2, 3, 6, 7, 14, 26, 27, 33, 36, 62, 81, 86, 93, 96, 99] }) -Tree 57: Descendants(Descendants { descendants: [0, 4, 10, 11, 28, 29, 39, 42, 44, 50, 57, 67, 70, 74, 95, 97, 98] }) -Tree 58: SplitPlaneNormal(SplitPlaneNormal { left: Tree(56), right: Tree(57), normal: [0.0169, -0.4385, -0.4607, -0.2781, 0.3243, 0.0145, 0.1026, 0.2875, 0.0069, -0.1195, "other ..."] }) -Tree 59: Descendants(Descendants { descendants: [5, 9, 15, 23, 31, 34, 38, 45, 48, 58, 63, 65, 69, 77, 80, 83, 89] }) -Tree 60: SplitPlaneNormal(SplitPlaneNormal { left: Tree(58), right: Tree(59), normal: [0.1786, -0.1600, -0.2775, -0.0898, 0.1079, 0.1067, -0.0025, 0.0785, -0.0136, -0.0227, "other ..."] }) -Tree 61: Descendants(Descendants { descendants: [17, 19, 20, 25, 32, 35, 37, 40, 41, 49, 52, 53, 55, 60, 71, 75, 79, 82, 84, 88, 90, 91, 92] }) -Tree 62: Descendants(Descendants { descendants: [8, 12, 13, 16, 18, 21, 22, 24, 30, 43, 46, 47, 51, 54, 56, 59, 61, 64, 66, 68, 72, 73, 76, 78, 85, 87, 94] }) -Tree 63: SplitPlaneNormal(SplitPlaneNormal { left: Tree(61), right: Tree(62), normal: [0.0237, 0.2316, 0.0207, 0.0743, 0.2916, 0.2200, 0.0594, 0.0390, -0.4108, -0.0552, "other ..."] }) -Tree 64: SplitPlaneNormal(SplitPlaneNormal { left: Tree(60), right: Tree(63), normal: [-0.0179, -0.0168, -0.2421, -0.1799, -0.1356, 0.0168, 0.1303, -0.2701, 0.3890, -0.1482, "other ..."] }) -Tree 65: Descendants(Descendants { descendants: [0, 2, 3, 7, 9, 14, 17, 25, 37, 39, 40, 55, 60, 65, 67, 70, 77, 96, 97, 98] }) -Tree 66: Descendants(Descendants { descendants: [1, 6, 8, 10, 11, 13, 19, 26, 27, 28, 30, 42, 46, 52, 62, 66, 72, 73, 85, 87, 90, 91] }) -Tree 67: SplitPlaneNormal(SplitPlaneNormal { left: Tree(65), right: Tree(66), normal: [0.0741, 0.1397, -0.1747, 0.1955, 0.0976, -0.0066, -0.2642, -0.4876, -0.0256, -0.1423, "other ..."] }) -Tree 68: Descendants(Descendants { descendants: [32, 34, 35, 44, 74, 75, 84, 92, 99] }) -Tree 69: Descendants(Descendants { descendants: [4, 15, 18, 20, 24, 29, 38, 47, 57, 58, 61, 63, 64, 68, 69, 76, 79, 81, 83, 86, 94, 95] }) -Tree 70: Descendants(Descendants { descendants: [5, 22, 31, 33, 36, 45, 48, 50, 51, 54, 56, 80, 89, 93] }) -Tree 71: SplitPlaneNormal(SplitPlaneNormal { left: Tree(69), right: Tree(70), normal: [0.0908, -0.0903, 0.3735, 0.0708, -0.0676, -0.1918, -0.1890, -0.2189, -0.3541, -0.3300, "other ..."] }) -Tree 72: Descendants(Descendants { descendants: [12, 16, 21, 23, 41, 43, 49, 53, 59, 71, 78, 82, 88] }) -Tree 73: SplitPlaneNormal(SplitPlaneNormal { left: Tree(71), right: Tree(72), normal: [-0.0215, 0.0861, 0.0260, -0.2042, -0.1901, -0.1088, 0.0154, -0.2001, 0.3676, -0.0737, "other ..."] }) -Tree 74: SplitPlaneNormal(SplitPlaneNormal { left: Tree(68), right: Tree(73), normal: [0.1338, 0.3609, -0.1010, -0.1138, 0.0836, 0.0482, -0.0207, 0.0315, 0.1349, 0.1157, "other ..."] }) -Tree 75: SplitPlaneNormal(SplitPlaneNormal { left: Tree(67), right: Tree(74), normal: [0.0874, -0.1312, 0.0401, 0.1433, -0.0151, -0.0312, 0.0888, 0.0681, -0.2158, -0.0702, "other ..."] }) -Tree 76: Descendants(Descendants { descendants: [0, 1, 6, 19, 28, 40, 42, 48, 63, 81, 91] }) -Tree 77: Descendants(Descendants { descendants: [2, 4, 7, 10, 11, 14, 17, 20, 25, 26, 31, 32, 33, 34, 36, 62, 70, 74, 86, 93, 99] }) -Tree 78: SplitPlaneNormal(SplitPlaneNormal { left: Tree(76), right: Tree(77), normal: [-0.2023, 0.0033, 0.1400, -0.2031, -0.1474, -0.0398, 0.4147, 0.3168, -0.3442, 0.1913, "other ..."] }) -Tree 79: Descendants(Descendants { descendants: [35, 38, 49, 60, 75, 76, 84, 88, 92] }) -Tree 80: SplitPlaneNormal(SplitPlaneNormal { left: Tree(78), right: Tree(79), normal: [-0.2920, -0.3421, -0.2821, -0.1193, -0.0368, 0.1317, 0.2692, -0.1174, -0.0436, -0.0298, "other ..."] }) -Tree 81: Descendants(Descendants { descendants: [8, 27, 30, 85] }) -Tree 82: Descendants(Descendants { descendants: [12, 18, 21, 23, 29, 37, 39, 41, 43, 44, 46, 47, 51, 52, 53, 55, 56, 59, 64, 66, 67, 68, 69, 71, 72, 78, 82, 96, 97, 98] }) -Tree 83: Descendants(Descendants { descendants: [3, 5, 9, 13, 15, 16, 22, 24, 45, 50, 54, 57, 58, 61, 65, 73, 77, 79, 80, 83, 87, 89, 90, 94, 95] }) -Tree 84: SplitPlaneNormal(SplitPlaneNormal { left: Tree(82), right: Tree(83), normal: [-0.0973, 0.2024, -0.0486, 0.1536, -0.0050, 0.0761, -0.0099, -0.1343, -0.3098, 0.2276, "other ..."] }) -Tree 85: SplitPlaneNormal(SplitPlaneNormal { left: Tree(81), right: Tree(84), normal: [0.1433, -0.2044, -0.0819, -0.1305, 0.0272, 0.1805, 0.0805, 0.1128, 0.0279, -0.0258, "other ..."] }) -Tree 86: SplitPlaneNormal(SplitPlaneNormal { left: Tree(80), right: Tree(85), normal: [0.0240, 0.1785, 0.0265, -0.3440, 0.1702, 0.0470, 0.0107, 0.2175, -0.0317, 0.1600, "other ..."] }) -Tree 87: Descendants(Descendants { descendants: [8, 13, 16, 21, 27, 28, 29, 30, 37, 41, 46, 47, 48, 56, 60, 64, 73, 78, 85, 91] }) -Tree 88: Descendants(Descendants { descendants: [1, 2, 3, 6, 7, 14, 17, 40, 42, 52, 62, 67, 77, 96, 98] }) -Tree 89: Descendants(Descendants { descendants: [20, 26, 32, 38, 49, 58, 61, 68, 75, 76, 79, 81, 86, 88, 94] }) -Tree 90: Descendants(Descendants { descendants: [24, 31, 33, 36, 39, 45, 50, 51, 54, 57, 63, 66, 72, 80, 89, 90, 93, 95, 97] }) -Tree 91: Descendants(Descendants { descendants: [0, 4, 5, 9, 12, 15, 18, 22, 23, 34, 35, 43, 44, 53, 55, 69, 71, 74, 82, 83, 84, 87, 92, 99] }) -Tree 92: SplitPlaneNormal(SplitPlaneNormal { left: Tree(90), right: Tree(91), normal: [0.1432, -0.2381, -0.0722, -0.2146, -0.0888, -0.0131, 0.0621, 0.2812, 0.2690, -0.0300, "other ..."] }) -Tree 93: Descendants(Descendants { descendants: [10, 11, 19, 25, 59, 65, 70] }) -Tree 94: SplitPlaneNormal(SplitPlaneNormal { left: Tree(92), right: Tree(93), normal: [-0.3120, -0.2834, -0.0907, 0.0227, 0.0090, 0.3812, 0.1933, -0.4350, -0.0939, -0.1180, "other ..."] }) -Tree 95: SplitPlaneNormal(SplitPlaneNormal { left: Tree(89), right: Tree(94), normal: [-0.0200, -0.2200, 0.1948, -0.1418, 0.1112, 0.0083, -0.0510, -0.0801, -0.3187, -0.1000, "other ..."] }) -Tree 96: SplitPlaneNormal(SplitPlaneNormal { left: Tree(88), right: Tree(95), normal: [0.0684, -0.2434, -0.1543, 0.0337, 0.1784, 0.1295, 0.3061, -0.0175, -0.0679, -0.1419, "other ..."] }) -Tree 97: SplitPlaneNormal(SplitPlaneNormal { left: Tree(87), right: Tree(96), normal: [-0.0316, -0.1036, 0.3252, -0.0985, -0.1286, -0.4867, -0.0286, 0.1159, -0.0177, 0.2205, "other ..."] }) -Root: Metadata { dimensions: 30, items: RoaringBitmap<100 values between 0 and 99>, roots: [8, 17, 24, 35, 44, 55, 64, 75, 86, 97], distance: "euclidean" } diff --git a/src/tests/writer.rs b/src/tests/writer.rs index 3a094335..c2ef333f 100644 --- a/src/tests/writer.rs +++ b/src/tests/writer.rs @@ -52,9 +52,9 @@ fn use_u32_max_minus_one_for_a_vec() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 - Item 4294967294: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) - Tree 0: Descendants(Descendants { descendants: [4294967294] }) Root: Metadata { dimensions: 3, items: RoaringBitmap<[4294967294]>, roots: [0], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [4294967294] }) + Item 4294967294: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) "###); } @@ -71,9 +71,9 @@ fn use_u32_max_for_a_vec() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 - Item 4294967295: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) - Tree 0: Descendants(Descendants { descendants: [4294967295] }) Root: Metadata { dimensions: 3, items: RoaringBitmap<[4294967295]>, roots: [0], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [4294967295] }) + Item 4294967295: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) "###); } @@ -90,9 +90,9 @@ fn write_one_vector() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 - Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) - Tree 0: Descendants(Descendants { descendants: [0] }) Root: Metadata { dimensions: 3, items: RoaringBitmap<[0]>, roots: [0], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [0] }) + Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) "###); } @@ -109,9 +109,9 @@ fn write_one_vector_in_one_tree() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 - Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) - Tree 0: Descendants(Descendants { descendants: [0] }) Root: Metadata { dimensions: 3, items: RoaringBitmap<[0]>, roots: [0], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [0] }) + Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) "###); } @@ -128,9 +128,9 @@ fn write_one_vector_in_multiple_trees() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 - Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) - Tree 0: Descendants(Descendants { descendants: [0] }) Root: Metadata { dimensions: 3, items: RoaringBitmap<[0]>, roots: [0], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [0] }) + Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) "###); } @@ -151,11 +151,11 @@ fn write_vectors_until_there_is_a_descendants() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 + Root: Metadata { dimensions: 3, items: RoaringBitmap<[0, 1, 2]>, roots: [0], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [0, 1, 2] }) Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000, 0.0000] }) Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 1.0000, 1.0000] }) Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [2.0000, 2.0000, 2.0000] }) - Tree 0: Descendants(Descendants { descendants: [0, 1, 2] }) - Root: Metadata { dimensions: 3, items: RoaringBitmap<[0, 1, 2]>, roots: [0], distance: "euclidean" } "###); } @@ -176,13 +176,13 @@ fn write_vectors_until_there_is_a_split() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 + Root: Metadata { dimensions: 3, items: RoaringBitmap<[0, 1, 2, 3]>, roots: [1], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [1, 2, 3] }) + Tree 1: SplitPlaneNormal(SplitPlaneNormal { left: Tree(0), right: Item(0), normal: [-0.5774, -0.5774, -0.5774] }) Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000, 0.0000] }) Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 1.0000, 1.0000] }) Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [2.0000, 2.0000, 2.0000] }) Item 3: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [3.0000, 3.0000, 3.0000] }) - Tree 0: Descendants(Descendants { descendants: [1, 2, 3] }) - Tree 1: SplitPlaneNormal(SplitPlaneNormal { left: Tree(0), right: Item(0), normal: [-0.5774, -0.5774, -0.5774] }) - Root: Metadata { dimensions: 3, items: RoaringBitmap<[0, 1, 2, 3]>, roots: [1], distance: "euclidean" } "###); } @@ -228,29 +228,29 @@ fn write_multiple_indexes() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 - Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) - Tree 0: Descendants(Descendants { descendants: [0] }) Root: Metadata { dimensions: 3, items: RoaringBitmap<[0]>, roots: [0], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [0] }) + Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) ================== Dumping index 1 - Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) - Tree 0: Descendants(Descendants { descendants: [0] }) Root: Metadata { dimensions: 3, items: RoaringBitmap<[0]>, roots: [0], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [0] }) + Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) ================== Dumping index 2 - Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) - Tree 0: Descendants(Descendants { descendants: [0] }) Root: Metadata { dimensions: 3, items: RoaringBitmap<[0]>, roots: [0], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [0] }) + Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) ================== Dumping index 3 - Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) - Tree 0: Descendants(Descendants { descendants: [0] }) Root: Metadata { dimensions: 3, items: RoaringBitmap<[0]>, roots: [0], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [0] }) + Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) ================== Dumping index 4 - Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) - Tree 0: Descendants(Descendants { descendants: [0] }) Root: Metadata { dimensions: 3, items: RoaringBitmap<[0]>, roots: [0], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [0] }) + Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 1.0000, 2.0000] }) "###); } @@ -292,18 +292,18 @@ fn overwrite_one_item_incremental() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 + Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 3, 4, 5]>, roots: [4], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [1, 3] }) + Tree 1: SplitPlaneNormal(SplitPlaneNormal { left: Tree(0), right: Item(2), normal: [0.0000, 0.0000] }) + Tree 2: Descendants(Descendants { descendants: [4, 5] }) + Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(1), right: Tree(2), normal: [0.0000, 0.0000] }) + Tree 4: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(3), normal: [1.0000, 0.0000] }) Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000] }) Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [2.0000, 0.0000] }) Item 3: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [3.0000, 0.0000] }) Item 4: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [4.0000, 0.0000] }) Item 5: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [5.0000, 0.0000] }) - Tree 0: Descendants(Descendants { descendants: [1, 3] }) - Tree 1: SplitPlaneNormal(SplitPlaneNormal { left: Tree(0), right: Item(2), normal: [0.0000, 0.0000] }) - Tree 2: Descendants(Descendants { descendants: [4, 5] }) - Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(1), right: Tree(2), normal: [0.0000, 0.0000] }) - Tree 4: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(3), normal: [1.0000, 0.0000] }) - Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 3, 4, 5]>, roots: [4], distance: "euclidean" } "###); let mut wtxn = handle.env.write_txn().unwrap(); @@ -318,18 +318,18 @@ fn overwrite_one_item_incremental() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 + Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 3, 4, 5]>, roots: [4], distance: "euclidean" } + Tree 1: SplitPlaneNormal(SplitPlaneNormal { left: Item(1), right: Tree(5), normal: [0.0000, 0.0000] }) + Tree 2: Descendants(Descendants { descendants: [4, 5] }) + Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(1), right: Tree(2), normal: [0.0000, 0.0000] }) + Tree 4: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(3), normal: [1.0000, 0.0000] }) + Tree 5: Descendants(Descendants { descendants: [2, 3] }) Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000] }) Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [2.0000, 0.0000] }) Item 3: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [6.0000, 0.0000] }) Item 4: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [4.0000, 0.0000] }) Item 5: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [5.0000, 0.0000] }) - Tree 1: SplitPlaneNormal(SplitPlaneNormal { left: Item(1), right: Tree(5), normal: [0.0000, 0.0000] }) - Tree 2: Descendants(Descendants { descendants: [4, 5] }) - Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(1), right: Tree(2), normal: [0.0000, 0.0000] }) - Tree 4: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(3), normal: [1.0000, 0.0000] }) - Tree 5: Descendants(Descendants { descendants: [2, 3] }) - Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 3, 4, 5]>, roots: [4], distance: "euclidean" } "###); } @@ -347,9 +347,9 @@ fn delete_one_item_in_a_one_item_db() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 - Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) - Tree 0: Descendants(Descendants { descendants: [0] }) Root: Metadata { dimensions: 2, items: RoaringBitmap<[0]>, roots: [0], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [0] }) + Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) "###); let mut wtxn = handle.env.write_txn().unwrap(); @@ -388,9 +388,9 @@ fn delete_document_in_an_empty_index_74() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 - Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) - Tree 0: Descendants(Descendants { descendants: [0] }) Root: Metadata { dimensions: 2, items: RoaringBitmap<[0]>, roots: [0], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [0] }) + Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) "###); let mut wtxn = handle.env.write_txn().unwrap(); @@ -441,10 +441,10 @@ fn delete_one_item_in_a_descendant() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 + Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1]>, roots: [0], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [0, 1] }) Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000] }) - Tree 0: Descendants(Descendants { descendants: [0, 1] }) - Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1]>, roots: [0], distance: "euclidean" } "###); let mut wtxn = handle.env.write_txn().unwrap(); @@ -458,9 +458,9 @@ fn delete_one_item_in_a_descendant() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 - Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000] }) - Tree 0: Descendants(Descendants { descendants: [1] }) Root: Metadata { dimensions: 2, items: RoaringBitmap<[1]>, roots: [0], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [1] }) + Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000] }) "###); } @@ -481,12 +481,12 @@ fn delete_one_leaf_in_a_split() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 + Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2]>, roots: [1], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [1, 2] }) + Tree 1: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(0), normal: [1.0000, 0.0000] }) Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000] }) Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [2.0000, 0.0000] }) - Tree 0: Descendants(Descendants { descendants: [1, 2] }) - Tree 1: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(0), normal: [1.0000, 0.0000] }) - Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2]>, roots: [1], distance: "euclidean" } "###); let mut wtxn = handle.env.write_txn().unwrap(); @@ -501,10 +501,10 @@ fn delete_one_leaf_in_a_split() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 + Root: Metadata { dimensions: 2, items: RoaringBitmap<[1, 2]>, roots: [0], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [1, 2] }) Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000] }) Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [2.0000, 0.0000] }) - Tree 0: Descendants(Descendants { descendants: [1, 2] }) - Root: Metadata { dimensions: 2, items: RoaringBitmap<[1, 2]>, roots: [0], distance: "euclidean" } "###); } @@ -523,9 +523,9 @@ fn delete_one_item_in_a_single_document_database() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 - Item 0: Leaf(Leaf { header: NodeHeaderCosine { norm: 0.0 }, vector: [0.0000, 0.0000] }) - Tree 0: Descendants(Descendants { descendants: [0] }) Root: Metadata { dimensions: 2, items: RoaringBitmap<[0]>, roots: [0], distance: "cosine" } + Tree 0: Descendants(Descendants { descendants: [0] }) + Item 0: Leaf(Leaf { header: NodeHeaderCosine { norm: 0.0 }, vector: [0.0000, 0.0000] }) "###); let mut wtxn = handle.env.write_txn().unwrap(); @@ -560,18 +560,18 @@ fn delete_one_item() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 + Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 3, 4, 5]>, roots: [4], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [1, 3] }) + Tree 1: SplitPlaneNormal(SplitPlaneNormal { left: Tree(0), right: Item(2), normal: [0.0000, 0.0000] }) + Tree 2: Descendants(Descendants { descendants: [4, 5] }) + Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(1), right: Tree(2), normal: [0.0000, 0.0000] }) + Tree 4: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(3), normal: [1.0000, 0.0000] }) Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000] }) Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [2.0000, 0.0000] }) Item 3: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [3.0000, 0.0000] }) Item 4: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [4.0000, 0.0000] }) Item 5: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [5.0000, 0.0000] }) - Tree 0: Descendants(Descendants { descendants: [1, 3] }) - Tree 1: SplitPlaneNormal(SplitPlaneNormal { left: Tree(0), right: Item(2), normal: [0.0000, 0.0000] }) - Tree 2: Descendants(Descendants { descendants: [4, 5] }) - Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(1), right: Tree(2), normal: [0.0000, 0.0000] }) - Tree 4: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(3), normal: [1.0000, 0.0000] }) - Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 3, 4, 5]>, roots: [4], distance: "euclidean" } "###); let mut wtxn = handle.env.write_txn().unwrap(); @@ -585,16 +585,16 @@ fn delete_one_item() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 + Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 4, 5]>, roots: [4], distance: "euclidean" } + Tree 1: Descendants(Descendants { descendants: [1, 2] }) + Tree 2: Descendants(Descendants { descendants: [4, 5] }) + Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(1), right: Tree(2), normal: [0.0000, 0.0000] }) + Tree 4: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(3), normal: [1.0000, 0.0000] }) Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000] }) Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [2.0000, 0.0000] }) Item 4: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [4.0000, 0.0000] }) Item 5: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [5.0000, 0.0000] }) - Tree 1: Descendants(Descendants { descendants: [1, 2] }) - Tree 2: Descendants(Descendants { descendants: [4, 5] }) - Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(1), right: Tree(2), normal: [0.0000, 0.0000] }) - Tree 4: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(3), normal: [1.0000, 0.0000] }) - Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 4, 5]>, roots: [4], distance: "euclidean" } "###); // delete the last item in a descendants node @@ -609,14 +609,14 @@ fn delete_one_item() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 + Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 2, 4, 5]>, roots: [4], distance: "euclidean" } + Tree 2: Descendants(Descendants { descendants: [4, 5] }) + Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Item(2), right: Tree(2), normal: [0.0000, 0.0000] }) + Tree 4: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(3), normal: [1.0000, 0.0000] }) Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [2.0000, 0.0000] }) Item 4: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [4.0000, 0.0000] }) Item 5: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [5.0000, 0.0000] }) - Tree 2: Descendants(Descendants { descendants: [4, 5] }) - Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Item(2), right: Tree(2), normal: [0.0000, 0.0000] }) - Tree 4: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(3), normal: [1.0000, 0.0000] }) - Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 2, 4, 5]>, roots: [4], distance: "euclidean" } "###); } @@ -644,9 +644,9 @@ fn add_one_item_incrementally_in_an_empty_db() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 - Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) - Tree 0: Descendants(Descendants { descendants: [0] }) Root: Metadata { dimensions: 2, items: RoaringBitmap<[0]>, roots: [0], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [0] }) + Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) "###); } @@ -663,9 +663,9 @@ fn add_one_item_incrementally_in_a_one_item_db() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 - Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) - Tree 0: Descendants(Descendants { descendants: [0] }) Root: Metadata { dimensions: 2, items: RoaringBitmap<[0]>, roots: [0], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [0] }) + Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) "###); let mut wtxn = handle.env.write_txn().unwrap(); @@ -677,10 +677,10 @@ fn add_one_item_incrementally_in_a_one_item_db() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 + Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1]>, roots: [0], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [0, 1] }) Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000] }) - Tree 0: Descendants(Descendants { descendants: [0, 1] }) - Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1]>, roots: [0], distance: "euclidean" } "###); } @@ -698,10 +698,10 @@ fn add_one_item_incrementally_to_create_a_split_node() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 + Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1]>, roots: [0], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [0, 1] }) Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000] }) - Tree 0: Descendants(Descendants { descendants: [0, 1] }) - Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1]>, roots: [0], distance: "euclidean" } "###); let mut wtxn = handle.env.write_txn().unwrap(); @@ -713,12 +713,12 @@ fn add_one_item_incrementally_to_create_a_split_node() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 + Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2]>, roots: [2], distance: "euclidean" } + Tree 1: Descendants(Descendants { descendants: [1, 2] }) + Tree 2: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(1), normal: [1.0000, 0.0000] }) Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000] }) Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [2.0000, 0.0000] }) - Tree 1: Descendants(Descendants { descendants: [1, 2] }) - Tree 2: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(1), normal: [1.0000, 0.0000] }) - Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2]>, roots: [2], distance: "euclidean" } "###); } @@ -738,18 +738,18 @@ fn add_one_item_incrementally() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 + Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 3, 4, 5]>, roots: [4], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [1, 3] }) + Tree 1: SplitPlaneNormal(SplitPlaneNormal { left: Tree(0), right: Item(2), normal: [0.0000, 0.0000] }) + Tree 2: Descendants(Descendants { descendants: [4, 5] }) + Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(1), right: Tree(2), normal: [0.0000, 0.0000] }) + Tree 4: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(3), normal: [1.0000, 0.0000] }) Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000] }) Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [2.0000, 0.0000] }) Item 3: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [3.0000, 0.0000] }) Item 4: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [4.0000, 0.0000] }) Item 5: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [5.0000, 0.0000] }) - Tree 0: Descendants(Descendants { descendants: [1, 3] }) - Tree 1: SplitPlaneNormal(SplitPlaneNormal { left: Tree(0), right: Item(2), normal: [0.0000, 0.0000] }) - Tree 2: Descendants(Descendants { descendants: [4, 5] }) - Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(1), right: Tree(2), normal: [0.0000, 0.0000] }) - Tree 4: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(3), normal: [1.0000, 0.0000] }) - Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 3, 4, 5]>, roots: [4], distance: "euclidean" } "###); let mut wtxn = handle.env.write_txn().unwrap(); @@ -763,6 +763,13 @@ fn add_one_item_incrementally() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 + Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 3, 4, 5, 25]>, roots: [4], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [1, 3] }) + Tree 1: SplitPlaneNormal(SplitPlaneNormal { left: Tree(0), right: Tree(5), normal: [0.0000, 0.0000] }) + Tree 2: Descendants(Descendants { descendants: [4, 5] }) + Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(1), right: Tree(2), normal: [0.0000, 0.0000] }) + Tree 4: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(3), normal: [1.0000, 0.0000] }) + Tree 5: Descendants(Descendants { descendants: [2, 25] }) Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000] }) Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [2.0000, 0.0000] }) @@ -770,13 +777,6 @@ fn add_one_item_incrementally() { Item 4: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [4.0000, 0.0000] }) Item 5: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [5.0000, 0.0000] }) Item 25: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [25.0000, 0.0000] }) - Tree 0: Descendants(Descendants { descendants: [1, 3] }) - Tree 1: SplitPlaneNormal(SplitPlaneNormal { left: Tree(0), right: Tree(5), normal: [0.0000, 0.0000] }) - Tree 2: Descendants(Descendants { descendants: [4, 5] }) - Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(1), right: Tree(2), normal: [0.0000, 0.0000] }) - Tree 4: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(3), normal: [1.0000, 0.0000] }) - Tree 5: Descendants(Descendants { descendants: [2, 25] }) - Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 3, 4, 5, 25]>, roots: [4], distance: "euclidean" } "###); let mut wtxn = handle.env.write_txn().unwrap(); @@ -790,6 +790,14 @@ fn add_one_item_incrementally() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 + Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 3, 4, 5, 8, 25]>, roots: [4], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [1, 3] }) + Tree 1: SplitPlaneNormal(SplitPlaneNormal { left: Tree(0), right: Tree(7), normal: [0.0000, 0.0000] }) + Tree 2: Descendants(Descendants { descendants: [4, 5] }) + Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(1), right: Tree(2), normal: [0.0000, 0.0000] }) + Tree 4: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(3), normal: [1.0000, 0.0000] }) + Tree 6: Descendants(Descendants { descendants: [8, 25] }) + Tree 7: SplitPlaneNormal(SplitPlaneNormal { left: Tree(6), right: Item(2), normal: [0.0000, 0.0000] }) Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000] }) Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [2.0000, 0.0000] }) @@ -798,14 +806,6 @@ fn add_one_item_incrementally() { Item 5: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [5.0000, 0.0000] }) Item 8: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [8.0000, 0.0000] }) Item 25: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [25.0000, 0.0000] }) - Tree 0: Descendants(Descendants { descendants: [1, 3] }) - Tree 1: SplitPlaneNormal(SplitPlaneNormal { left: Tree(0), right: Tree(7), normal: [0.0000, 0.0000] }) - Tree 2: Descendants(Descendants { descendants: [4, 5] }) - Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(1), right: Tree(2), normal: [0.0000, 0.0000] }) - Tree 4: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(3), normal: [1.0000, 0.0000] }) - Tree 6: Descendants(Descendants { descendants: [8, 25] }) - Tree 7: SplitPlaneNormal(SplitPlaneNormal { left: Tree(6), right: Item(2), normal: [0.0000, 0.0000] }) - Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 3, 4, 5, 8, 25]>, roots: [4], distance: "euclidean" } "###); } @@ -826,18 +826,18 @@ fn delete_extraneous_tree() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 - Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000, 0.0000, 0.0000] }) - Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000, 0.0000, 0.0000] }) - Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [2.0000, 0.0000, 0.0000, 0.0000] }) - Item 3: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [3.0000, 0.0000, 0.0000, 0.0000] }) - Item 4: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [4.0000, 0.0000, 0.0000, 0.0000] }) + Root: Metadata { dimensions: 4, items: RoaringBitmap<[0, 1, 2, 3, 4]>, roots: [1, 3, 5], distance: "euclidean" } Tree 0: Descendants(Descendants { descendants: [1, 2, 3, 4] }) Tree 1: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(0), normal: [1.0000, 0.0000, 0.0000, 0.0000] }) Tree 2: Descendants(Descendants { descendants: [1, 2, 3, 4] }) Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(2), right: Item(0), normal: [-1.0000, 0.0000, 0.0000, 0.0000] }) Tree 4: Descendants(Descendants { descendants: [1, 2, 3, 4] }) Tree 5: SplitPlaneNormal(SplitPlaneNormal { left: Tree(4), right: Item(0), normal: [-1.0000, 0.0000, 0.0000, 0.0000] }) - Root: Metadata { dimensions: 4, items: RoaringBitmap<[0, 1, 2, 3, 4]>, roots: [1, 3, 5], distance: "euclidean" } + Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000, 0.0000, 0.0000] }) + Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000, 0.0000, 0.0000] }) + Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [2.0000, 0.0000, 0.0000, 0.0000] }) + Item 3: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [3.0000, 0.0000, 0.0000, 0.0000] }) + Item 4: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [4.0000, 0.0000, 0.0000, 0.0000] }) "###); let mut wtxn = handle.env.write_txn().unwrap(); @@ -848,16 +848,16 @@ fn delete_extraneous_tree() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 + Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 3, 4]>, roots: [3, 5], distance: "euclidean" } + Tree 2: Descendants(Descendants { descendants: [1, 2, 3, 4] }) + Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(2), right: Item(0), normal: [-1.0000, 0.0000, 0.0000, 0.0000] }) + Tree 4: Descendants(Descendants { descendants: [1, 2, 3, 4] }) + Tree 5: SplitPlaneNormal(SplitPlaneNormal { left: Tree(4), right: Item(0), normal: [-1.0000, 0.0000, 0.0000, 0.0000] }) Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000, 0.0000, 0.0000] }) Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000, 0.0000, 0.0000] }) Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [2.0000, 0.0000, 0.0000, 0.0000] }) Item 3: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [3.0000, 0.0000, 0.0000, 0.0000] }) Item 4: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [4.0000, 0.0000, 0.0000, 0.0000] }) - Tree 2: Descendants(Descendants { descendants: [1, 2, 3, 4] }) - Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(2), right: Item(0), normal: [-1.0000, 0.0000, 0.0000, 0.0000] }) - Tree 4: Descendants(Descendants { descendants: [1, 2, 3, 4] }) - Tree 5: SplitPlaneNormal(SplitPlaneNormal { left: Tree(4), right: Item(0), normal: [-1.0000, 0.0000, 0.0000, 0.0000] }) - Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 3, 4]>, roots: [3, 5], distance: "euclidean" } "###); let mut wtxn = handle.env.write_txn().unwrap(); @@ -868,14 +868,14 @@ fn delete_extraneous_tree() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 + Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 3, 4]>, roots: [5], distance: "euclidean" } + Tree 4: Descendants(Descendants { descendants: [1, 2, 3, 4] }) + Tree 5: SplitPlaneNormal(SplitPlaneNormal { left: Tree(4), right: Item(0), normal: [-1.0000, 0.0000, 0.0000, 0.0000] }) Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000, 0.0000, 0.0000] }) Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000, 0.0000, 0.0000] }) Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [2.0000, 0.0000, 0.0000, 0.0000] }) Item 3: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [3.0000, 0.0000, 0.0000, 0.0000] }) Item 4: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [4.0000, 0.0000, 0.0000, 0.0000] }) - Tree 4: Descendants(Descendants { descendants: [1, 2, 3, 4] }) - Tree 5: SplitPlaneNormal(SplitPlaneNormal { left: Tree(4), right: Item(0), normal: [-1.0000, 0.0000, 0.0000, 0.0000] }) - Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 3, 4]>, roots: [5], distance: "euclidean" } "###); } @@ -895,18 +895,18 @@ fn reuse_node_id() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 + Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 3, 4, 5]>, roots: [4], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [1, 3] }) + Tree 1: SplitPlaneNormal(SplitPlaneNormal { left: Tree(0), right: Item(2), normal: [0.0000, 0.0000] }) + Tree 2: Descendants(Descendants { descendants: [4, 5] }) + Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(1), right: Tree(2), normal: [0.0000, 0.0000] }) + Tree 4: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(3), normal: [1.0000, 0.0000] }) Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000] }) Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [2.0000, 0.0000] }) Item 3: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [3.0000, 0.0000] }) Item 4: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [4.0000, 0.0000] }) Item 5: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [5.0000, 0.0000] }) - Tree 0: Descendants(Descendants { descendants: [1, 3] }) - Tree 1: SplitPlaneNormal(SplitPlaneNormal { left: Tree(0), right: Item(2), normal: [0.0000, 0.0000] }) - Tree 2: Descendants(Descendants { descendants: [4, 5] }) - Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(1), right: Tree(2), normal: [0.0000, 0.0000] }) - Tree 4: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(3), normal: [1.0000, 0.0000] }) - Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 3, 4, 5]>, roots: [4], distance: "euclidean" } "###); let mut wtxn = handle.env.write_txn().unwrap(); @@ -920,16 +920,16 @@ fn reuse_node_id() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 + Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 2, 3, 4, 5]>, roots: [4], distance: "euclidean" } + Tree 1: Descendants(Descendants { descendants: [2, 3] }) + Tree 2: Descendants(Descendants { descendants: [4, 5] }) + Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(1), right: Tree(2), normal: [0.0000, 0.0000] }) + Tree 4: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(3), normal: [1.0000, 0.0000] }) Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [2.0000, 0.0000] }) Item 3: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [3.0000, 0.0000] }) Item 4: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [4.0000, 0.0000] }) Item 5: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [5.0000, 0.0000] }) - Tree 1: Descendants(Descendants { descendants: [2, 3] }) - Tree 2: Descendants(Descendants { descendants: [4, 5] }) - Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(1), right: Tree(2), normal: [0.0000, 0.0000] }) - Tree 4: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(3), normal: [1.0000, 0.0000] }) - Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 2, 3, 4, 5]>, roots: [4], distance: "euclidean" } "###); let mut wtxn = handle.env.write_txn().unwrap(); @@ -943,18 +943,18 @@ fn reuse_node_id() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 + Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 3, 4, 5]>, roots: [4], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [2, 3] }) + Tree 2: Descendants(Descendants { descendants: [4, 5] }) + Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(5), right: Tree(2), normal: [0.0000, 0.0000] }) + Tree 4: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(3), normal: [1.0000, 0.0000] }) + Tree 5: SplitPlaneNormal(SplitPlaneNormal { left: Tree(0), right: Item(1), normal: [0.0000, 0.0000] }) Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000] }) Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [2.0000, 0.0000] }) Item 3: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [3.0000, 0.0000] }) Item 4: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [4.0000, 0.0000] }) Item 5: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [5.0000, 0.0000] }) - Tree 0: Descendants(Descendants { descendants: [2, 3] }) - Tree 2: Descendants(Descendants { descendants: [4, 5] }) - Tree 3: SplitPlaneNormal(SplitPlaneNormal { left: Tree(5), right: Tree(2), normal: [0.0000, 0.0000] }) - Tree 4: SplitPlaneNormal(SplitPlaneNormal { left: Item(0), right: Tree(3), normal: [1.0000, 0.0000] }) - Tree 5: SplitPlaneNormal(SplitPlaneNormal { left: Tree(0), right: Item(1), normal: [0.0000, 0.0000] }) - Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 3, 4, 5]>, roots: [4], distance: "euclidean" } "###); let mut wtxn = handle.env.write_txn().unwrap(); @@ -967,12 +967,7 @@ fn reuse_node_id() { insta::assert_snapshot!(handle, @r###" ================== Dumping index 0 - Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) - Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000] }) - Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [2.0000, 0.0000] }) - Item 3: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [3.0000, 0.0000] }) - Item 4: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [4.0000, 0.0000] }) - Item 5: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [5.0000, 0.0000] }) + Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 3, 4, 5]>, roots: [4, 9], distance: "euclidean" } Tree 0: Descendants(Descendants { descendants: [2, 3] }) Tree 1: Descendants(Descendants { descendants: [1, 3] }) Tree 2: Descendants(Descendants { descendants: [4, 5] }) @@ -983,7 +978,12 @@ fn reuse_node_id() { Tree 7: Descendants(Descendants { descendants: [2, 4] }) Tree 8: SplitPlaneNormal(SplitPlaneNormal { left: Tree(6), right: Tree(7), normal: [0.0000, 0.0000] }) Tree 9: SplitPlaneNormal(SplitPlaneNormal { left: Tree(8), right: Item(0), normal: [-1.0000, 0.0000] }) - Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1, 2, 3, 4, 5]>, roots: [4, 9], distance: "euclidean" } + Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) + Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [1.0000, 0.0000] }) + Item 2: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [2.0000, 0.0000] }) + Item 3: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [3.0000, 0.0000] }) + Item 4: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [4.0000, 0.0000] }) + Item 5: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [5.0000, 0.0000] }) "###); } @@ -1007,6 +1007,49 @@ fn need_build() { assert!(writer.need_build(&wtxn).unwrap(), "because an item has been updated"); } +#[test] +fn append() { + let handle = create_database::(); + let mut rng = rng(); + let mut wtxn = handle.env.write_txn().unwrap(); + let writer = Writer::new(handle.database, 1, 2); + + writer.append_item(&mut wtxn, 0, &[0.0, 0.0]).unwrap(); + writer.append_item(&mut wtxn, 1, &[0.1, 0.1]).unwrap(); + let err = writer.append_item(&mut wtxn, 0, &[0.2, 0.2]).unwrap_err(); + assert_snapshot!(err, @"Item cannot be appended into the database"); + writer.builder(&mut rng).build(&mut wtxn).unwrap(); + wtxn.commit().unwrap(); + insta::assert_snapshot!(handle, @r###" + ================== + Dumping index 1 + Root: Metadata { dimensions: 2, items: RoaringBitmap<[0, 1]>, roots: [0], distance: "euclidean" } + Tree 0: Descendants(Descendants { descendants: [0, 1] }) + Item 0: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.0000, 0.0000] }) + Item 1: Leaf(Leaf { header: NodeHeaderEuclidean { bias: 0.0 }, vector: [0.1000, 0.1000] }) + "###); + + let mut wtxn = handle.env.write_txn().unwrap(); + + // We cannot push in a database with an index lower than the maximum + let writer = Writer::new(handle.database, 0, 2); + let err = writer.append_item(&mut wtxn, 0, &[0.0, 0.0]).unwrap_err(); + assert_snapshot!(err, @"Item cannot be appended into the database"); + + // And we must still be able append in an already existing build database as long as the item id is higher than the last max item id + let writer = Writer::new(handle.database, 1, 2); + // The item id is *equal* to the previous maximum item id + let err = writer.append_item(&mut wtxn, 1, &[0.1, 0.1]).unwrap_err(); + assert_snapshot!(err, @"Item cannot be appended into the database"); + // If we delete the max item then we must be able to append it again + writer.del_item(&mut wtxn, 1).unwrap(); + writer.append_item(&mut wtxn, 1, &[0.1, 0.1]).unwrap(); + + // But we can still append in a database with a higher index even if the document id is lower + let writer = Writer::new(handle.database, 2, 2); + writer.append_item(&mut wtxn, 0, &[0.0, 0.0]).unwrap(); +} + #[test] fn prepare_changing_distance() { let handle = create_database::(); diff --git a/src/writer.rs b/src/writer.rs index b3c77809..23ec9a6e 100644 --- a/src/writer.rs +++ b/src/writer.rs @@ -307,6 +307,7 @@ impl Writer { .remap_data_type::() .get(wtxn, &Key::updated(self.index))? .unwrap_or_default(); + // We cannot append here because we may have removed an item with a larger id before updated.insert(item); self.database.remap_data_type::().put( wtxn,