rerun-io / rerun

Visualize streams of multimodal data. Fast, easy to use, and simple to integrate. Built in Rust using egui.
https://rerun.io/
Apache License 2.0
5.86k stars 265 forks source link

Promises: bigger-than-RAM #5247

Open emilk opened 5 months ago

emilk commented 5 months ago

Goals

Support some forms of “bigger-than-RAM” recordings, as soon as possible

Background

Small-index vs Big-index

Table index: row ids and time points.

Does the table index fit in RAM?

Hypothesis: most “bigger-than-RAM” problems have smallish indices.

Big index

Example: 100GB of scalar plots

We need a hierarchical index file on disk, with seeking, and have store-subscribers that are aware of this, etc. Difficult!

Small index

Example: thousands of uncompressed 4k images, or big point clouds, meshes, …

We “just” need to figure out how load blobs from disk on-demand. Easier!

Promises: a solution to small-index

We replace large blobs with promises, that refer to the external data.

A promise could be a file path with optional byte offset, a URL, …

When a query results in a Promise, we (try) to resolve it.

Example: we go through a huge MCAP file and log it to Rerun, but replace big blobs by a Promise referring to a byte-offset in the MCAP.

User stories

Design

A Promise is a datatype, which can be used for any component. So a component.Point3D can be represented by datatype.Promise A promise contains a single URI string.

A promise resolves to some IPC Arrow data (or an error, or pending).

The promise is resolved late, after primary caches, close to the UI/visualizer.

/// The data of component. `ComponentResult` a better name?
enum ComponentResult<'data, T> {
    /// The entity doesn't have this component
    None,

    /// Wait for it - it is being loaded in the background
    Pending,

    /// Failed to load.
    Error(String),

    /// The data is decoded and ready.
    /// A slice into the secondary promise cache (if it was a promise)
    Data(&'data [T]),
}

impl PromiseResult {
    fn map(…) -> …
}

MVP

Steps

Post-MVP

Latency-aware

Promise resolvers

SDK-aware

Each of these adds additional abilities:

andresv commented 4 months ago

Making video frame seeking really fast would be huge. My use case is hours of video and telemetry recordings from UAVs and I would like to dump all of them to rerun and then step frame by frame back and forward somewhere in the middle of the video to study frames and corresponding telemetry.