Skip to content

First-class indicator components for Rust#3251

Merged
teh-cmc merged 9 commits intomainfrom
cmc/first_class_indicators
Sep 11, 2023
Merged

First-class indicator components for Rust#3251
teh-cmc merged 9 commits intomainfrom
cmc/first_class_indicators

Conversation

@teh-cmc
Copy link
Copy Markdown
Contributor

@teh-cmc teh-cmc commented Sep 7, 2023

Implements & exposes first-class indicator components, effectively completing the "custom user data" story for Rust.

In the end, indicator components are neither materialized in the IDL nor in the generated code, as both alternatives proved to be dead-ends (void data really doesn't fit well into our traits and overall model).
Rather, they are materialized as a single GenericIndicatorComponent<Archetype> which directly implements ComponentList instead of Component, giving it the necessary leeway to bypass all the iterator machinery.


Loading from files now automatically inject indicators:

$ rerun ~/Downloads/image0.jpeg

image

custom_data now injects custom user-defined indicators:
image


Fixes #3252
Part of #3260

What

Checklist

@teh-cmc teh-cmc force-pushed the cmc/first_class_indicators branch 3 times, most recently from 8723a21 to 1ac4f7f Compare September 8, 2023 09:28
@teh-cmc teh-cmc added 🏹 arrow Apache Arrow sdk-rust Rust logging API labels Sep 8, 2023
@teh-cmc teh-cmc force-pushed the cmc/first_class_indicators branch 2 times, most recently from a7be46d to 2b6c1dd Compare September 8, 2023 09:39
@teh-cmc teh-cmc marked this pull request as ready for review September 8, 2023 10:04
@teh-cmc teh-cmc force-pushed the cmc/first_class_indicators branch from 23a1093 to c31710a Compare September 8, 2023 10:28
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 8, 2023

Size changes

Name main 3251/merge Change
plots.rrd 184.32 kiB 194.56 kiB +5.56%

@Wumpf Wumpf self-requested a review September 11, 2023 07:27
Copy link
Copy Markdown
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat!
plz check if the custom space view sample still works

Comment on lines +50 to +64
use re_types::Archetype;
let indicator = <re_types::archetypes::Image as Archetype>::Indicator::new_list(1);
let indicator_cell = DataCell::from_arrow(
re_types::archetypes::Image::indicator_component(),
indicator.to_arrow(),
);

// Assume an image (there are so many image extensions):
// TODO(#3159): include the `ImageIndicator` component.
let tensor = re_types::components::TensorData(
re_types::datatypes::TensorData::from_image_file(file_path)?,
);
Ok(DataCell::try_from_native(std::iter::once(&tensor))?)
Ok(vec![
indicator_cell,
DataCell::try_from_native(std::iter::once(&tensor))?,
])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why doesn't this log an archetype instead of manually doing components?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file loading path seems to bypass recording streams altogether, manually crafting tables instead.

Copy link
Copy Markdown
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(commenting on files I missed earlier)

teh-cmc and others added 4 commits September 11, 2023 12:16
Just a lot of renaming all around.

* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/3262) (if
applicable)

- [PR Build Summary](https://build.rerun.io/pr/3262)
- [Docs
preview](https://rerun.io/preview/fadea691f065a580e7dec805140bc47b8c8d8c90/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/fadea691f065a580e7dec805140bc47b8c8d8c90/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://ref.rerun.io/dev/bench/)
- [Wasm size tracking](https://ref.rerun.io/dev/sizes/)

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Co-authored-by: Andreas Reich <andreas@rerun.io>
@teh-cmc teh-cmc force-pushed the cmc/first_class_indicators branch from 6f82637 to e0505a8 Compare September 11, 2023 10:22
@teh-cmc teh-cmc force-pushed the cmc/first_class_indicators branch from bb0bce0 to 944d3df Compare September 11, 2023 11:22
@teh-cmc teh-cmc merged commit 782a734 into main Sep 11, 2023
@teh-cmc teh-cmc deleted the cmc/first_class_indicators branch September 11, 2023 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏹 arrow Apache Arrow sdk-rust Rust logging API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

First-class citizenry for indicator components - Rust

2 participants