Skip to content

Commit 893de2f

Browse files
authored
Remove instance keys and explicit splatting everywhere (#6104)
Annihilate everything related to instance keys. --- - [x] Remove `InstanceKey` - [x] Remove `NumInstances` - [x] Remove explicit/client-side splats - [x] Remove cluster keys and autogenerated cells - [x] Clean up every other little thing related to any of the above - [x] Update batching docs - [x] Check that Kiss-ICP now works smoothly - [x] Check roundtrips - [x] Check `rerun snippets/*.rrd` - [x] Rebase and run checklist - [x] Run full check bot --- Findings (none blocking, not sure any are new -- to be investigated later): - Depth clouds with visible history are broken in a different way than before - `OutOfTreeTransform` might be broken? (see associated snippet) - Does `DisconnectedSpace` even work? (see associated snippet) - Is something wrong with labels when there are lots of instances? --- - Fixes #5303 - Fixes #1014 - Fixes #1777 - Fixes #1793 - Fixes #1893 - Fixes #5685 - Fixes #1014
1 parent bc04e35 commit 893de2f

File tree

210 files changed

+933
-3017
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

210 files changed

+933
-3017
lines changed

crates/re_data_store/benches/arrow2.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ use arrow2::array::{Array, FixedSizeListArray, PrimitiveArray, StructArray};
99
use criterion::Criterion;
1010
use itertools::Itertools;
1111

12+
use re_log_types::example_components::MyIndex;
1213
use re_log_types::DataCell;
13-
use re_types::datagen::{build_some_instances, build_some_positions2d};
14+
use re_types::datagen::build_some_positions2d;
1415
use re_types::{
15-
components::{InstanceKey, Position2D},
16+
components::Position2D,
1617
testing::{build_some_large_structs, LargeStruct},
1718
};
1819
use re_types_core::{Component, SizeBytes};
@@ -40,7 +41,7 @@ const NUM_INSTANCES: usize = 1;
4041

4142
#[derive(Debug, Clone, Copy)]
4243
enum ArrayKind {
43-
/// E.g. an array of `InstanceKey`.
44+
/// E.g. an array of `MyIndex`.
4445
Primitive,
4546

4647
/// E.g. an array of `Position2D`.
@@ -79,7 +80,7 @@ fn erased_clone(c: &mut Criterion) {
7980

8081
match kind {
8182
ArrayKind::Primitive => {
82-
let data = build_some_instances(NUM_INSTANCES);
83+
let data = MyIndex::from_iter(0..NUM_INSTANCES as _);
8384
bench_arrow(&mut group, &data);
8485
bench_native(&mut group, &data);
8586
}
@@ -198,7 +199,9 @@ fn estimated_size_bytes(c: &mut Criterion) {
198199
fn generate_cells(kind: ArrayKind) -> Vec<DataCell> {
199200
match kind {
200201
ArrayKind::Primitive => (0..NUM_ROWS)
201-
.map(|_| DataCell::from_native(build_some_instances(NUM_INSTANCES).as_slice()))
202+
.map(|_| {
203+
DataCell::from_native(MyIndex::from_iter(0..NUM_INSTANCES as _).as_slice())
204+
})
202205
.collect(),
203206
ArrayKind::Struct => (0..NUM_ROWS)
204207
.map(|_| {
@@ -312,9 +315,9 @@ fn estimated_size_bytes(c: &mut Criterion) {
312315
.collect()
313316
}
314317

315-
fn generate_keys() -> Vec<Vec<InstanceKey>> {
318+
fn generate_indices() -> Vec<Vec<MyIndex>> {
316319
(0..NUM_ROWS)
317-
.map(|_| build_some_instances(NUM_INSTANCES))
320+
.map(|_| MyIndex::from_iter(0..NUM_INSTANCES as _))
318321
.collect()
319322
}
320323

@@ -325,7 +328,7 @@ fn estimated_size_bytes(c: &mut Criterion) {
325328
}
326329

327330
match kind {
328-
ArrayKind::Primitive => bench_std(&mut group, generate_keys()),
331+
ArrayKind::Primitive => bench_std(&mut group, generate_indices()),
329332
ArrayKind::Struct => bench_std(&mut group, generate_positions()),
330333
ArrayKind::StructLarge => bench_std(&mut group, generate_rects()),
331334
}

crates/re_data_store/benches/data_store.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,10 @@ use re_data_store::{
99
RangeQuery, TimeInt, TimeRange,
1010
};
1111
use re_log_types::{
12-
build_frame_nr, DataCell, DataRow, DataTable, EntityPath, RowId, TableId, TimePoint, TimeType,
13-
Timeline,
14-
};
15-
use re_types::datagen::build_some_instances;
16-
use re_types::{
17-
components::InstanceKey,
18-
testing::{build_some_large_structs, LargeStruct},
12+
build_frame_nr, example_components::MyIndex, DataCell, DataRow, DataTable, EntityPath, RowId,
13+
TableId, TimePoint, TimeType, Timeline,
1914
};
15+
use re_types::testing::{build_some_large_structs, LargeStruct};
2016
use re_types_core::{ComponentName, Loggable as _};
2117

2218
criterion_group!(
@@ -123,7 +119,6 @@ fn insert_same_time_point(c: &mut Criterion) {
123119
b.iter(|| {
124120
let mut store = DataStore::new(
125121
re_log_types::StoreId::random(re_log_types::StoreKind::Recording),
126-
InstanceKey::name(),
127122
DataStoreConfig::default(),
128123
);
129124

@@ -398,9 +393,8 @@ fn build_rows_ex(
398393
RowId::new(),
399394
"large_structs",
400395
time_point(frame_idx),
401-
num_instances as _,
402396
(
403-
build_some_instances(num_instances),
397+
MyIndex::from_iter(0..num_instances as _),
404398
build_some_large_structs(num_instances),
405399
),
406400
)
@@ -432,10 +426,8 @@ fn build_rows_ex(
432426
}
433427

434428
fn insert_rows(config: DataStoreConfig, rows: &[DataRow]) -> DataStore {
435-
let cluster_key = InstanceKey::name();
436429
let mut store = DataStore::new(
437430
re_log_types::StoreId::random(re_log_types::StoreKind::Recording),
438-
cluster_key,
439431
config,
440432
);
441433
for row in rows {

crates/re_data_store/benches/gc.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ use re_data_store::{
1010
use re_log_types::{
1111
build_frame_nr, build_log_time, DataRow, DataTable, EntityPath, RowId, TableId, Time, TimePoint,
1212
};
13-
use re_types::components::InstanceKey;
14-
use re_types_core::{AsComponents, ComponentBatch, ComponentName, Loggable as _};
13+
use re_types_core::{AsComponents, ComponentBatch};
1514

1615
criterion_group!(benches, plotting_dashboard);
1716
criterion_main!(benches);
@@ -85,13 +84,7 @@ fn plotting_dashboard(c: &mut Criterion) {
8584

8685
// Default config
8786
group.bench_function("default", |b| {
88-
let store = build_store(
89-
Default::default(),
90-
InstanceKey::name(),
91-
false,
92-
&mut timegen,
93-
&mut datagen,
94-
);
87+
let store = build_store(Default::default(), false, &mut timegen, &mut datagen);
9588
b.iter_batched(
9689
|| store.clone(),
9790
|mut store| {
@@ -117,7 +110,6 @@ fn plotting_dashboard(c: &mut Criterion) {
117110
indexed_bucket_num_rows: num_rows_per_bucket,
118111
..Default::default()
119112
},
120-
InstanceKey::name(),
121113
false,
122114
&mut timegen,
123115
&mut datagen,
@@ -142,7 +134,6 @@ fn plotting_dashboard(c: &mut Criterion) {
142134

143135
fn build_store<FT, FD>(
144136
config: DataStoreConfig,
145-
cluster_key: ComponentName,
146137
packed: bool,
147138
timegen: &mut FT,
148139
datagen: &mut FD,
@@ -153,7 +144,6 @@ where
153144
{
154145
let mut store = DataStore::new(
155146
re_log_types::StoreId::random(re_log_types::StoreKind::Recording),
156-
cluster_key,
157147
config,
158148
);
159149

crates/re_data_store/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ pub use self::store_subscriber::{StoreSubscriber, StoreSubscriberHandle};
4141
pub use self::store_write::{WriteError, WriteResult};
4242

4343
pub(crate) use self::store::{
44-
ClusterCellCache, IndexedBucket, IndexedBucketInner, IndexedTable, MetadataRegistry,
45-
StaticCell, StaticTable,
44+
IndexedBucket, IndexedBucketInner, IndexedTable, MetadataRegistry, StaticCell, StaticTable,
4645
};
4746

4847
// Re-exports

0 commit comments

Comments
 (0)