rerun icon indicating copy to clipboard operation
rerun copied to clipboard

Add a new "Air Traffic Data" example

Open abey79 opened this issue 1 year ago • 1 comments

What

WIP

pixi run py-build-examples && pixi run -e examples python examples/python/air_traffic_data/air_traffic_data.py

Checklist

  • [ ] I have read and agree to Contributor Guide and the Code of Conduct
  • [ ] I've included a screenshot or gif (if applicable)
  • [ ] I have tested the web demo (if applicable):
  • [ ] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • [ ] If applicable, add a new check to the release checklist!

abey79 avatar Mar 10 '24 08:03 abey79

Deployed docs

Commit Link
02b2ab1c3474540db39d1a159dda29ac8e5b3569 https://landing-1pfgfnhvx-rerun.vercel.app/docs

github-actions[bot] avatar Apr 10 '24 10:04 github-actions[bot]

@abey79 the reason we don't have this in yet is that it simply is too bad of a user experience, right?

Wumpf avatar Nov 15 '24 09:11 Wumpf

@abey79 the reason we don't have this in yet is that it simply is too bad of a user experience, right?

Yes. It's here to remind us that we need to improve our "lots of entities" story :)

abey79 avatar Nov 15 '24 09:11 abey79

Latest documentation preview deployed successfully.

Result Commit Link
296054bd4f690db3731f216e6243b9f36d433c9b https://landing-1x8st44fh-rerun.vercel.app/docs

Note: This comment is updated whenever you push a commit.

github-actions[bot] avatar Nov 21 '24 16:11 github-actions[bot]

Web viewer built successfully. If applicable, you should also test it:

  • [ ] I have tested the web viewer
Result Commit Link
296054b https://rerun.io/viewer/pr/5449

Note: This comment is updated whenever you push a commit.

github-actions[bot] avatar Nov 21 '24 16:11 github-actions[bot]

I would love to get this merged as a benchmark, even though we're not hitting the benchmark yet.

emilk avatar Nov 21 '24 19:11 emilk

I would love to get this merged as a benchmark, even though we're not hitting the benchmark yet.

May I interest you in https://github.com/rerun-io/rerun/pull/8163? This is a blocker for the --batch logging strategy of this example. Which is interesting to have along side the "regular" (aka rr.log()) logging pathway for ingestion benchmark (aka why is shuffling data in python faster than our compactor).

Then I can further dust it off and try to push it to mergeable state.

abey79 avatar Nov 21 '24 20:11 abey79

As of today on my machine, using the 2h dataset, I get the following ingestion times:

  • with --batch, I get 45s of ingestion time, plus 3-4s of additional latency in the viewer
  • without --batch, I get 1min20s of ingestion tine, plus ~35s of additional latency in the viewer

I'm probably missing something, but our batches (SDK-side and viewer-side) should probably do a better job at beating my home-grown, Polars-based batching code.

abey79 avatar Nov 26 '24 15:11 abey79

How do you measure ingestion time?

Is this a good timing?

Loading measurements:   5%|█▏                        | 7/148 [00:00<00:04, 28.39it/s][2025-10-28T14:20:41Z DEBUG re_viewer::app] Trying to load blueprint for rerun_example_air_traffic_data from "/Users/joel/Library/Application Support/rerun/blueprints/rerun_example_air_traffic_data.rbl"
[2025-10-28T14:20:41Z DEBUG re_viewer_context::store_hub] Activating new blueprint StoreId(Blueprint, "rerun_example_air_traffic_data", "rec_c775b7529249457080fe61d38d92f603") for rerun_example_air_traffic_data.
Loading measurements: 100%|████████████████████████| 148/148 [00:07<00:00, 20.16it/s]
Computing area of interest…
Downloading map data…: 100%|███████████████████| 28.1M/28.1M [00:08<00:00, 3.36MiB/s]
Logging measurements:  30%|████▏         | 360448/1205225 [00:12<00:31, 26609.45it/s][2025-10-28T14:21:11Z DEBUG re_viewer::app] Saved blueprint for rerun_example_air_traffic_data to "/Users/joel/Library/Application Support/rerun/blueprints/rerun_example_air_traffic_data.rbl"
Logging measurements:  94%|████████████▎| 1138688/1205225 [00:42<00:02, 25929.50it/s][2025-10-28T14:21:41Z DEBUG re_viewer::app] Saved blueprint for rerun_example_air_traffic_data to "/Users/joel/Library/Application Support/rerun/blueprints/rerun_example_air_traffic_data.rbl"
Logging measurements: 100%|█████████████| 1205225/1205225 [00:45<00:00, 26534.21it/s]

The above is after applying some patches, dev build, MBP M2 Max with 96Gb of memory.

I can't run the example without the patches, e.g.

❯ pixi run py-build-examples && pixi run -e examples air_traffic_data
 WARN Encountered 1 warning while parsing the manifest:
  ⚠ The `project` field is deprecated. Use `workspace` instead.
    ╭─[/Users/joel/Work/rerun/main/pixi.toml:17:1]
 16 │
 17 │ ╭─▶ [project]
 18 │ │   name = "rerun"
 19 │ │   authors = ["rerun.io <[email protected]>"]
 20 │ │   channels = ["conda-forge"]
 21 │ │   description = "Log images, point clouds, etc, and visualize them effortlessly"
 22 │ │   homepage = "https://rerun.io"
 23 │ │   license = "MIT OR Apache-2.0"
 24 │ │   platforms = ["linux-64", "linux-aarch64", "osx-arm64", "osx-64", "win-64"]
 25 │ │   readme = "README.md"
 26 │ │   repository = "https://github.com/rerun-io/rerun"
 27 │ │   version = "0.1.0" # TODO(emilk): sync version with `Cargo.toml` with help from `crates.py`
 28 │ ├─▶ requires-pixi = ">=0.55.0" # Make sure to keep this in sync with the version on our CI jobs!
    · ╰──── replace this with 'workspace'
 29 │
    ╰────

✨ Pixi task (py-build-examples in examples): pixi run -e examples py-build-common     WARN Encountered 1 warning while parsing the manifest:
  ⚠ The `project` field is deprecated. Use `workspace` instead.
    ╭─[/Users/joel/Work/rerun/main/pixi.toml:17:1]
 16 │
 17 │ ╭─▶ [project]
 18 │ │   name = "rerun"
 19 │ │   authors = ["rerun.io <[email protected]>"]
 20 │ │   channels = ["conda-forge"]
 21 │ │   description = "Log images, point clouds, etc, and visualize them effortlessly"
 22 │ │   homepage = "https://rerun.io"
 23 │ │   license = "MIT OR Apache-2.0"
 24 │ │   platforms = ["linux-64", "linux-aarch64", "osx-arm64", "osx-64", "win-64"]
 25 │ │   readme = "README.md"
 26 │ │   repository = "https://github.com/rerun-io/rerun"
 27 │ │   version = "0.1.0" # TODO(emilk): sync version with `Cargo.toml` with help from `crates.py`
 28 │ ├─▶ requires-pixi = ">=0.55.0" # Make sure to keep this in sync with the version on our CI jobs!
    · ╰──── replace this with 'workspace'
 29 │
    ╰────

✨ Pixi task (rerun-build in examples): cargo build --package rerun-cli --no-default-features --features release_no_web_viewer                                                  Finished `dev` profile [optimized] target(s) in 0.44s
                                                                                      ✨ Pixi task (py-build-common in examples): PIP_REQUIRE_VIRTUALENV=0 RERUN_ALLOW_MISSING_BIN=1 maturin develop --manifest-path rerun_py/Cargo.toml --extras=tests           🍹 Building a mixed python/rust project
🔗 Found pyo3 bindings with abi3 support for Python ≥ 3.10
🐍 Not using a specific python interpreter
📡 Using build options locked, config from pyproject.toml
Ignoring rerun-notebook: markers 'extra == "notebook"' don't match your environment
Ignoring datafusion: markers 'extra == "datafusion"' don't match your environment
Ignoring rerun-sdk: markers 'extra == "all"' don't match your environment
Ignoring rerun-sdk: markers 'extra == "all"' don't match your environment
Requirement already satisfied: attrs>=23.1.0 in ./.pixi/envs/examples/lib/python3.11/site-packages (25.3.0)
Requirement already satisfied: numpy>=2 in ./.pixi/envs/examples/lib/python3.11/site-packages (2.2.6)
Requirement already satisfied: pillow>=8.0.0 in ./.pixi/envs/examples/lib/python3.11/site-packages (11.3.0)
Requirement already satisfied: pyarrow>=18.0.0 in ./.pixi/envs/examples/lib/python3.11/site-packages (18.0.0)
Requirement already satisfied: typing-extensions>=4.5 in ./.pixi/envs/examples/lib/python3.11/site-packages (4.15.0)
Requirement already satisfied: pytest==8.4.1 in ./.pixi/envs/examples/lib/python3.11/site-packages (8.4.1)
Requirement already satisfied: iniconfig>=1 in ./.pixi/envs/examples/lib/python3.11/site-packages (from pytest==8.4.1) (2.3.0)
Requirement already satisfied: packaging>=20 in ./.pixi/envs/examples/lib/python3.11/site-packages (from pytest==8.4.1) (24.2)
Requirement already satisfied: pluggy<2,>=1.5 in ./.pixi/envs/examples/lib/python3.11/site-packages (from pytest==8.4.1) (1.6.0)
Requirement already satisfied: pygments>=2.7.2 in ./.pixi/envs/examples/lib/python3.11/site-packages (from pytest==8.4.1) (2.19.2)
    Finished `dev` profile [optimized] target(s) in 0.35s
📦 Built wheel for abi3 Python ≥ 3.10 to /var/folders/98/l2ptpkyn41q7d3sp6x4xp87m0000gn/T/.tmp1qdHqE/rerun_sdk-0.27.0a1+dev-cp310-abi3-macosx_11_0_arm64.whl
✏️  Setting installed package as editable
🛠 Installed rerun-sdk-0.27.0a1+dev
 WARN Encountered 1 warning while parsing the manifest:
  ⚠ The `project` field is deprecated. Use `workspace` instead.
    ╭─[/Users/joel/Work/rerun/main/pixi.toml:17:1]
 16 │
 17 │ ╭─▶ [project]
 18 │ │   name = "rerun"
 19 │ │   authors = ["rerun.io <[email protected]>"]
 20 │ │   channels = ["conda-forge"]
 21 │ │   description = "Log images, point clouds, etc, and visualize them effortlessly"
 22 │ │   homepage = "https://rerun.io"
 23 │ │   license = "MIT OR Apache-2.0"
 24 │ │   platforms = ["linux-64", "linux-aarch64", "osx-arm64", "osx-64", "win-64"]
 25 │ │   readme = "README.md"
 26 │ │   repository = "https://github.com/rerun-io/rerun"
 27 │ │   version = "0.1.0" # TODO(emilk): sync version with `Cargo.toml` with help from `crates.py`
 28 │ ├─▶ requires-pixi = ">=0.55.0" # Make sure to keep this in sync with the version on our CI jobs!
    · ╰──── replace this with 'workspace'
 29 │
    ╰────

DEV ENVIRONMENT DETECTED! Re-importing rerun from: /Users/joel/Work/rerun/main/rerun_py/rerun_sdk
[2025-10-28T14:07:11Z DEBUG rerun::commands::entrypoint] Detected 12 cores. Using 10 compute threads.
[2025-10-28T14:07:11Z DEBUG rerun::commands::entrypoint] Parsing --server-memory-limit (for gRPC server)
[2025-10-28T14:07:11Z DEBUG rerun::commands::entrypoint] Server memory limit: 0B
[2025-10-28T14:07:11Z DEBUG rerun::commands::entrypoint] Parsing --memory-limit (for Viewer)
[2025-10-28T14:07:11Z DEBUG re_memory::memory_limit] Setting memory limit to 72.0 GiB, which is 75% of total available memory (96.0 GiB).
[2025-10-28T14:07:11Z DEBUG re_memory::memory_limit] Setting memory limit to 72.0 GiB, which is 75% of total available memory (96.0 GiB).
[2025-10-28T14:07:11Z INFO  re_grpc_server] Listening for gRPC connections on 0.0.0.0:9876. Connect by running `rerun --connect rerun+http://127.0.0.1:9876/proxy`
[2025-10-28T14:07:11Z DEBUG eframe] Using the wgpu renderer
[2025-10-28T14:07:11Z DEBUG eframe::native::wgpu_integration] Event::Resumed
[2025-10-28T14:07:11Z DEBUG eframe::native::file_storage] Loading app state from /Users/joel/Library/Application Support/rerun/app.ron…
[2025-10-28T14:07:11Z DEBUG egui_wgpu::setup] Creating wgpu instance with backends Backends(VULKAN | GL | METAL)
[2025-10-28T14:07:11Z DEBUG egui_wgpu] Picked the only available wgpu adapter: backend: Metal, device_type: IntegratedGpu, name: "Apple M2 Max"
Loading measurements:   0%|                                   | 0/148 [00:00<?, ?it/s][2025-10-28T14:07:12Z DEBUG re_renderer::context] wgpu adapter backend: Metal, device_type: IntegratedGpu, name: "Apple M2 Max"
Loading measurements:   3%|▋                          | 4/148 [00:00<00:04, 35.17it/s]
thread 'main' panicked at 'Wrong path to data directory???: Os { code: 2, kind: NotFound, message: "No such file or directory" }'
re_ui/src/hot_reload_design_tokens.rs:22
stack backtrace:
   9: core::panicking::panic_fmt
             at core/src/panicking.rs:75:14
  10: core::result::unwrap_failed
             at core/src/result.rs:1732:5
  11: core::result::Result<T,E>::expect
             at core/src/result.rs:1089:23
      re_ui::hot_reload_design_tokens::DesignTokensPerTheme::load
             at re_ui/src/hot_reload_design_tokens.rs:19:25
  12: std::sync::poison::once::Once::call_once_force::{{closure}}
  13: std::sys::sync::once::queue::Once::call
             at std/src/sys/sync/once/queue.rs:219:21
  14: std::sync::once_lock::OnceLock<T>::initialize
  15: std::sync::once_lock::OnceLock<T>::get_or_try_init
             at std/src/sync/once_lock.rs:396:9
      std::sync::once_lock::OnceLock<T>::get_or_init
             at std/src/sync/once_lock.rs:310:15
      re_ui::hot_reload_design_tokens::design_token_access::design_tokens_per_theme
             at re_ui/src/hot_reload_design_tokens.rs:145:23
  16: re_ui::hot_reload_design_tokens::design_tokens_of
             at re_ui/src/hot_reload_design_tokens.rs:157:31
      re_ui::set_themes
             at re_ui/src/lib.rs:164:5
  17: re_ui::apply_style_and_install_loaders
             at re_ui/src/lib.rs:148:5
  18: re_viewer::customize_eframe_and_setup_renderer
             at re_viewer/src/lib.rs:247:5

Troubleshooting Rerun: https://www.rerun.io/docs/getting-started/troubleshooting
Report bugs: https://github.com/rerun-io/rerun/issues
[2025-10-28T14:07:12Z ERROR re_grpc_client::write] Write messages call failed: gRPC error, message: "transport error"
Loading measurements: 100%|█████████████████████████| 148/148 [00:06<00:00, 21.49it/s]
Computing area of interest…
Logging measurements: 100%|██████████████| 1205225/1205225 [00:37<00:00, 31861.01it/s]
[2025-10-28T14:07:57Z ERROR re_sdk::recording_stream] Failed to flush previous sink: gRPC connection to rerun+http://127.0.0.1:9876/proxy gracefully disconnected
[2025-10-28T14:07:57Z ERROR re_grpc_client::write] Failed to flush gRPC messages during shutdown: gRPC connection to rerun+http://127.0.0.1:9876/proxy gracefully disconnected
[2025-10-28T14:07:57Z ERROR re_grpc_client::write] Failed to gracefully shut down message proxy client: channel closed

joelreymont avatar Oct 28 '25 14:10 joelreymont

@joelreymont We're not running any benchmark on this particular example.

FWIW, here is what I get using my dev environment on my M4:

❯ air_traffic_data 
DEV ENVIRONMENT DETECTED! Re-importing rerun from: /Users/hhip/src/rerun/rerun_py/rerun_sdk
Loading measurements: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 148/148 [00:03<00:00, 38.19it/s]
Computing area of interest…
Logging measurements: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1205225/1205225 [00:32<00:00, 37480.49it/s]

In particular, I'm not experiencing any error. If you do, could you elaborate on that and maybe open an issue with a repro?

abey79 avatar Oct 28 '25 15:10 abey79

Pulled in 30 commits this morning. Head is 0e1eae56c and everything runs fine now.

joelreymont avatar Oct 29 '25 15:10 joelreymont