From e0bda96d1aad5715f192d2ea6800b56121f2aeee Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Tue, 17 Dec 2024 11:14:00 +0100 Subject: [PATCH 1/4] reenable tagging --- crates/store/re_chunk/src/chunk.rs | 2 -- .../descriptors/descr_builtin_archetype.rs | 26 +++------------- .../all/descriptors/descr_custom_archetype.rs | 30 ++++--------------- .../all/descriptors/descr_custom_component.rs | 12 ++------ 4 files changed, 12 insertions(+), 58 deletions(-) diff --git a/crates/store/re_chunk/src/chunk.rs b/crates/store/re_chunk/src/chunk.rs index 088beedd0825..d4090a1ae4dd 100644 --- a/crates/store/re_chunk/src/chunk.rs +++ b/crates/store/re_chunk/src/chunk.rs @@ -68,8 +68,6 @@ impl ChunkComponents { component_desc: ComponentDescriptor, list_array: ArrowListArray, ) -> Option { - // TODO(cmc): revert me - let component_desc = component_desc.untagged(); self.0 .entry(component_desc.component_name) .or_default() diff --git a/docs/snippets/all/descriptors/descr_builtin_archetype.rs b/docs/snippets/all/descriptors/descr_builtin_archetype.rs index 5562420b50cc..48ddffd25d5a 100644 --- a/docs/snippets/all/descriptors/descr_builtin_archetype.rs +++ b/docs/snippets/all/descriptors/descr_builtin_archetype.rs @@ -56,24 +56,6 @@ fn check_tags(rec: &rerun::RecordingStream) { .collect::>(); descriptors.sort(); - // TODO(cmc): revert me - // let expected = vec![ - // ComponentDescriptor { - // archetype_name: None, - // archetype_field_name: None, - // component_name: "rerun.components.Points3DIndicator".into(), - // }, - // ComponentDescriptor { - // archetype_name: Some("rerun.archetypes.Points3D".into()), - // archetype_field_name: Some("positions".into()), - // component_name: "rerun.components.Position3D".into(), - // }, - // ComponentDescriptor { - // archetype_name: Some("rerun.archetypes.Points3D".into()), - // archetype_field_name: Some("radii".into()), - // component_name: "rerun.components.Radius".into(), - // }, - // ]; let expected = vec![ ComponentDescriptor { archetype_name: None, @@ -81,13 +63,13 @@ fn check_tags(rec: &rerun::RecordingStream) { component_name: "rerun.components.Points3DIndicator".into(), }, ComponentDescriptor { - archetype_name: None, - archetype_field_name: None, + archetype_name: Some("rerun.archetypes.Points3D".into()), + archetype_field_name: Some("positions".into()), component_name: "rerun.components.Position3D".into(), }, ComponentDescriptor { - archetype_name: None, - archetype_field_name: None, + archetype_name: Some("rerun.archetypes.Points3D".into()), + archetype_field_name: Some("radii".into()), component_name: "rerun.components.Radius".into(), }, ]; diff --git a/docs/snippets/all/descriptors/descr_custom_archetype.rs b/docs/snippets/all/descriptors/descr_custom_archetype.rs index f9804b0f1280..83cab7434ce6 100644 --- a/docs/snippets/all/descriptors/descr_custom_archetype.rs +++ b/docs/snippets/all/descriptors/descr_custom_archetype.rs @@ -104,38 +104,20 @@ fn check_tags(rec: &rerun::RecordingStream) { .collect::>(); descriptors.sort(); - // TODO(cmc): revert me - // let expected = vec![ - // ComponentDescriptor { - // archetype_name: None, - // archetype_field_name: None, - // component_name: "user.CustomPoints3DIndicator".into(), - // }, - // ComponentDescriptor { - // archetype_name: Some("user.CustomPoints3D".into()), - // archetype_field_name: Some("colors".into()), - // component_name: "rerun.components.Color".into(), - // }, - // ComponentDescriptor { - // archetype_name: Some("user.CustomPoints3D".into()), - // archetype_field_name: Some("custom_positions".into()), - // component_name: "user.CustomPosition3D".into(), - // }, - // ]; let expected = vec![ ComponentDescriptor { archetype_name: None, archetype_field_name: None, - component_name: "rerun.components.Color".into(), + component_name: "user.CustomPoints3DIndicator".into(), }, ComponentDescriptor { - archetype_name: None, - archetype_field_name: None, - component_name: "user.CustomPoints3DIndicator".into(), + archetype_name: Some("user.CustomPoints3D".into()), + archetype_field_name: Some("colors".into()), + component_name: "rerun.components.Color".into(), }, ComponentDescriptor { - archetype_name: None, - archetype_field_name: None, + archetype_name: Some("user.CustomPoints3D".into()), + archetype_field_name: Some("custom_positions".into()), component_name: "user.CustomPosition3D".into(), }, ]; diff --git a/docs/snippets/all/descriptors/descr_custom_component.rs b/docs/snippets/all/descriptors/descr_custom_component.rs index a8bb1d0f9ee2..42780e98b3e0 100644 --- a/docs/snippets/all/descriptors/descr_custom_component.rs +++ b/docs/snippets/all/descriptors/descr_custom_component.rs @@ -60,18 +60,10 @@ fn check_tags(rec: &rerun::RecordingStream) { .collect::>(); descriptors.sort(); - // TODO(cmc): revert me - // let expected = vec![ - // ComponentDescriptor { - // archetype_name: Some("user.CustomArchetype".into()), - // archetype_field_name: Some("custom_positions".into()), - // component_name: "user.CustomPosition3D".into(), - // }, // - // ]; let expected = vec![ ComponentDescriptor { - archetype_name: None, - archetype_field_name: None, + archetype_name: Some("user.CustomArchetype".into()), + archetype_field_name: Some("custom_positions".into()), component_name: "user.CustomPosition3D".into(), }, // ]; From 2aad5b327500ee4bf204f69a2a3c67bcae921302 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Tue, 17 Dec 2024 11:38:03 +0100 Subject: [PATCH 2/4] py tests too --- rerun_py/tests/unit/test_dataframe.py | 33 ++++++--------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/rerun_py/tests/unit/test_dataframe.py b/rerun_py/tests/unit/test_dataframe.py index a2e3e29ac13e..b4961debe61f 100644 --- a/rerun_py/tests/unit/test_dataframe.py +++ b/rerun_py/tests/unit/test_dataframe.py @@ -104,36 +104,14 @@ def test_schema_recording(self) -> None: # Color, Points3DIndicator, Position3D, Radius, Text, TextIndicator assert len(schema.component_columns()) == 6 - # TODO(cmc): revert me - # assert schema.index_columns()[0].name == "log_tick" - # assert schema.index_columns()[1].name == "log_time" - # assert schema.index_columns()[2].name == "my_index" - # assert schema.component_columns()[0].entity_path == "/points" - # assert schema.component_columns()[0].component_name == "rerun.components.Points3DIndicator" - # assert schema.component_columns()[0].is_static is False - # assert schema.component_columns()[1].entity_path == "/points" - # assert schema.component_columns()[1].component_name == "rerun.components.Color" - # assert schema.component_columns()[1].is_static is False - # assert schema.component_columns()[2].entity_path == "/points" - # assert schema.component_columns()[2].component_name == "rerun.components.Position3D" - # assert schema.component_columns()[2].is_static is False - # assert schema.component_columns()[3].entity_path == "/points" - # assert schema.component_columns()[3].component_name == "rerun.components.Radius" - # assert schema.component_columns()[3].is_static is False - # assert schema.component_columns()[4].entity_path == "/static_text" - # assert schema.component_columns()[4].component_name == "rerun.components.TextLogIndicator" - # assert schema.component_columns()[4].is_static is True - # assert schema.component_columns()[5].entity_path == "/static_text" - # assert schema.component_columns()[5].component_name == "rerun.components.Text" - # assert schema.component_columns()[5].is_static is True assert schema.index_columns()[0].name == "log_tick" assert schema.index_columns()[1].name == "log_time" assert schema.index_columns()[2].name == "my_index" assert schema.component_columns()[0].entity_path == "/points" - assert schema.component_columns()[0].component_name == "rerun.components.Color" + assert schema.component_columns()[0].component_name == "rerun.components.Points3DIndicator" assert schema.component_columns()[0].is_static is False assert schema.component_columns()[1].entity_path == "/points" - assert schema.component_columns()[1].component_name == "rerun.components.Points3DIndicator" + assert schema.component_columns()[1].component_name == "rerun.components.Color" assert schema.component_columns()[1].is_static is False assert schema.component_columns()[2].entity_path == "/points" assert schema.component_columns()[2].component_name == "rerun.components.Position3D" @@ -142,11 +120,14 @@ def test_schema_recording(self) -> None: assert schema.component_columns()[3].component_name == "rerun.components.Radius" assert schema.component_columns()[3].is_static is False assert schema.component_columns()[4].entity_path == "/static_text" - assert schema.component_columns()[4].component_name == "rerun.components.Text" + assert schema.component_columns()[4].component_name == "rerun.components.TextLogIndicator" assert schema.component_columns()[4].is_static is True assert schema.component_columns()[5].entity_path == "/static_text" - assert schema.component_columns()[5].component_name == "rerun.components.TextLogIndicator" + assert schema.component_columns()[5].component_name == "rerun.components.Text" assert schema.component_columns()[5].is_static is True + assert schema.index_columns()[0].name == "log_tick" + assert schema.index_columns()[1].name == "log_time" + assert schema.index_columns()[2].name == "my_index" def test_schema_view(self) -> None: schema = self.recording.view(index="my_index", contents="points").schema() From 3e70035ecc5c27550f8d8d34976a40fb6ea598f7 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Mon, 20 Jan 2025 18:41:14 +0100 Subject: [PATCH 3/4] more of the same --- crates/store/re_chunk/src/chunk.rs | 26 ------------------- crates/store/re_chunk_store/src/writes.rs | 1 - .../re_types_core/src/component_descriptor.rs | 4 --- 3 files changed, 31 deletions(-) diff --git a/crates/store/re_chunk/src/chunk.rs b/crates/store/re_chunk/src/chunk.rs index d4090a1ae4dd..c57dad4cd08f 100644 --- a/crates/store/re_chunk/src/chunk.rs +++ b/crates/store/re_chunk/src/chunk.rs @@ -389,32 +389,6 @@ impl Chunk { self } - /// Clones the chunk into a new chunk where all descriptors are untagged. - /// - /// Only useful as a migration tool while the Rerun ecosystem slowly moves over - /// to always using tags for everything. - #[doc(hidden)] - #[inline] - pub fn clone_as_untagged(&self) -> Self { - let mut chunk = self.clone(); - - let per_component_name = &mut chunk.components; - for (component_name, per_desc) in per_component_name.iter_mut() { - if per_desc.len() != 1 { - // If there are more than one entry, then we're in the land of UB anyway (for now). - continue; - } - - let untagged_descriptor = ComponentDescriptor::new(*component_name); - *per_desc = std::mem::take(per_desc) - .into_values() - .map(|list_array| (untagged_descriptor.clone(), list_array)) - .collect(); - } - - chunk - } - /// Clones the chunk into a new chunk where all [`RowId`]s are [`RowId::ZERO`]. pub fn zeroed(self) -> Self { let row_ids = std::iter::repeat(RowId::ZERO) diff --git a/crates/store/re_chunk_store/src/writes.rs b/crates/store/re_chunk_store/src/writes.rs index 6be95c1167f0..c362edfe7eae 100644 --- a/crates/store/re_chunk_store/src/writes.rs +++ b/crates/store/re_chunk_store/src/writes.rs @@ -63,7 +63,6 @@ impl ChunkStore { // * Etc. if self.id.kind == re_log_types::StoreKind::Blueprint { let patched = chunk.patched_for_blueprint_021_compat(); - let patched = patched.clone_as_untagged(); chunk = Arc::new(patched); } diff --git a/crates/store/re_types_core/src/component_descriptor.rs b/crates/store/re_types_core/src/component_descriptor.rs index a5908e3a1e39..3d0b95b136e2 100644 --- a/crates/store/re_types_core/src/component_descriptor.rs +++ b/crates/store/re_types_core/src/component_descriptor.rs @@ -142,10 +142,6 @@ impl ComponentDescriptor { } } - pub fn untagged(self) -> Self { - Self::new(self.component_name) - } - /// Unconditionally sets [`Self::archetype_name`] to the given one. #[inline] pub fn with_archetype_name(mut self, archetype_name: ArchetypeName) -> Self { From 09f8cf82a14cfcbc715135bd2c04e392290bfc4b Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Tue, 21 Jan 2025 09:41:20 +0100 Subject: [PATCH 4/4] cant compare c++ partial updates yet --- docs/snippets/snippets.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/snippets/snippets.toml b/docs/snippets/snippets.toml index 98df865bfb43..7898423ce0e7 100644 --- a/docs/snippets/snippets.toml +++ b/docs/snippets/snippets.toml @@ -231,6 +231,9 @@ quick_start = [ # These examples don't have exactly the same implementation. "py", "rust", ] +"archetypes/points3d_partial_updates" = [ # TODO(cmc): revert once C++ has tagged partial updates + "cpp", +] "archetypes/points3d_random" = [ # TODO(#3206): examples use different RNGs "cpp", "py",