Skip to content

Commit

Permalink
Forward Rust (de-)serialization of transparent datatypes (#6793)
Browse files Browse the repository at this point in the history
### What

Remove lots of redundant serialization code by forwarding transparent
components to its datatypes:

* forward `from_arrow_opt` for fully transparent types
* forward `from_arrow` for fully transparent types
   * this requires us generating it for `datatypes`! 
* the forwarding uses `bytemuck` when possible. Should be possible in
more places, but the constraints are complicated so this isn't fully
automated and depends on types being manually marked as `bytemuck::Pod`
* would be really nice though if we could automate that. Almost
everything we're dealing with _should_ be pod 🤔
* forward `to_arrow_opt` for fully transparent types
* forward `arrow_datatype` for fully transparent types


@ reviewer: There's only two non-generated files:
* `crates/re_types_builder/src/codegen/rust/api.rs`:
https://github.com/rerun-io/rerun/pull/6793/files#diff-4eb7d4aa8c72b1987ed00d1ad9c61782b9dd55d8b96a50a44156388fea8c67f9
* `crates/re_types_builder/src/codegen/rust/deserializer.rs`:
https://github.com/rerun-io/rerun/pull/6793/files#diff-91844032ca93ef2e29de6a660674273bfd6e836b26ae58c83fef09dcd8db1076
Everything else is generated via those changes. You'll want to have a
sampling of both datatypes & components.

### Checklist
* [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 the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6793?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6793?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/6793)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
  • Loading branch information
Wumpf committed Jul 8, 2024
1 parent 137715e commit 8e437bd
Show file tree
Hide file tree
Showing 73 changed files with 1,393 additions and 4,914 deletions.
103 changes: 9 additions & 94 deletions crates/re_types/src/blueprint/components/active_tab.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

103 changes: 9 additions & 94 deletions crates/re_types/src/blueprint/components/included_content.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 9 additions & 47 deletions crates/re_types/src/blueprint/components/interactive.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8e437bd

Please sign in to comment.