Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chunkify time panel data density graphs #6847

Merged
merged 42 commits into from
Jul 15, 2024
Merged

Chunkify time panel data density graphs #6847

merged 42 commits into from
Jul 15, 2024

Conversation

jprochazk
Copy link
Member

@jprochazk jprochazk commented Jul 10, 2024

What

Part 1 of:

This adds a new option, Chunk-based data density graph, which when enabled switches the timeline from rendering using TimeHistogram to rendering chunks directly, using range queries in the UI code.

To test, enable Options -> Chunk-based data density graph

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!

To run all checks from main, comment on the PR with @rerun-bot full-check.

@jprochazk jprochazk added 📉 performance Optimization, memory use, etc 🚜 refactor Change the code, not the functionality 📺 re_viewer affects re_viewer itself include in changelog exclude from changelog PRs with this won't show up in CHANGELOG.md and removed include in changelog labels Jul 10, 2024
Copy link
Member

@emilk emilk left a comment

Choose a reason for hiding this comment

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

Looks like a good first step! But I think we should consider entity-level APIs for Chunks to make this code less awkward and more performant

crates/viewer/re_time_panel/src/data_density_graph.rs Outdated Show resolved Hide resolved
crates/viewer/re_time_panel/src/data_density_graph.rs Outdated Show resolved Hide resolved
crates/viewer/re_time_panel/src/data_density_graph.rs Outdated Show resolved Hide resolved
crates/viewer/re_time_panel/src/data_density_graph.rs Outdated Show resolved Hide resolved
crates/viewer/re_time_panel/src/data_density_graph.rs Outdated Show resolved Hide resolved
crates/viewer/re_ui/src/command.rs Outdated Show resolved Hide resolved
@jprochazk jprochazk marked this pull request as ready for review July 11, 2024 12:35
@emilk
Copy link
Member

emilk commented Jul 11, 2024

I think it would be great with some test code for this, testing different scenarios:

  • A lot of tiny chunks
  • A few huge, sorted chunks
  • A few huge, unsorted chunks
  • An examples with gaps

Of course, to properly test this, one has to turn off the compaction in the viewer somehow

@teh-cmc
Copy link
Member

teh-cmc commented Jul 11, 2024

Of course, to properly test this, one has to turn off the compaction in the viewer somehow

Compaction can be disabled either via ChunkStoreConfig or the associated environment variables:

pub const DEFAULT: Self = Self {
enable_changelog: true,
chunk_max_bytes: 8 * 1024 * 1024,
chunk_max_rows: 1024,
chunk_max_rows_if_unsorted: 256,
};
/// Environment variable to configure [`Self::enable_changelog`].
pub const ENV_STORE_ENABLE_CHANGELOG: &'static str = "RERUN_STORE_ENABLE_CHANGELOG";
/// Environment variable to configure [`Self::chunk_max_bytes`].
pub const ENV_CHUNK_MAX_BYTES: &'static str = "RERUN_CHUNK_MAX_BYTES";
/// Environment variable to configure [`Self::chunk_max_rows`].
pub const ENV_CHUNK_MAX_ROWS: &'static str = "RERUN_CHUNK_MAX_ROWS";
/// Environment variable to configure [`Self::chunk_max_rows_if_unsorted`].
//
// NOTE: Shared with the same env-var on the batcher side, for consistency.
pub const ENV_CHUNK_MAX_ROWS_IF_UNSORTED: &'static str = "RERUN_CHUNK_MAX_ROWS_IF_UNSORTED";

@teh-cmc
Copy link
Member

teh-cmc commented Jul 11, 2024

I'm not sure I understand the UX here.

I open https://rerun.io/viewer/pr/6847?url=https%3A%2F%2Fapp.rerun.io%2Fversion%2Fnightly%2Fexamples%2Fnuscenes_dataset.rrd and then hover randomly over the time panel and I cannot quite make sense of the behaviour. Sometimes I get an hover pop-up, sometimes not, I'm not sure why?
I expect to always have a hover pop-up no matter what, if only to tell me that I can only see very coarse data because <reasons>.

24-07-11_15.07.47.patched.mp4

Am I missing something?

@jprochazk jprochazk marked this pull request as draft July 12, 2024 10:08
@jprochazk
Copy link
Member Author

Updated after design call with Katya and @emilk:

  • The "timeline cursor preview" that used to only show when hovering over the timeline rect now shows when hovering anywhere in the time area
  • Set the "timeline cursor preview" to use a brighter color, it should be more visible now
  • Clicking anywhere in the time area now takes you to that point on the timeline (as the preview suggests)
  • Removed the range highlight
  • Removed num_events from the tooltip

For testing, I added tests/rust/test_data_density_graph, based on #6847 (comment)

@jprochazk jprochazk marked this pull request as ready for review July 15, 2024 10:17
@jprochazk jprochazk requested a review from emilk July 15, 2024 10:17
@emilk
Copy link
Member

emilk commented Jul 15, 2024

Double-clicking to reset the pan/zoom of the streams panel view no longer works

@emilk
Copy link
Member

emilk commented Jul 15, 2024

When hovering something in a chunk I want to know when in time the thing I hover is at.

image

I think the individual time-point of the latest-at query should be shown in the tooltip, but also visually.

For the visually part I think either that's where the time-cursor snaps to on hover, or we add a circle or something to highlight when that time-point is.

Both these can wait for a later PR though, but definitely before we switch to the new chunk design.

@jprochazk
Copy link
Member Author

jprochazk commented Jul 15, 2024

Double-clicking to reset the pan/zoom of the streams panel view no longer works

Should be working now. I also feature-gated the new behavior, should've been done from the start. This feels like something that should eventually be added to the release checklist. I tested:

  • Click/drag on the timeline: Sets time + starts dragging
  • Shift+drag on the timeline: Creates loop section
  • Click on the time area (streams area?): Sets time
  • Double click on the time area: Sets time, then resets the zoom/pan

The last part is new and slightly strange, because previously you couldn't just click anywhere on the time area to set time. Now you can, which has this side effect. I don't dislike it, but I don't know how I'd get it working as it did previously if it is an issue.

@jprochazk jprochazk merged commit 973e0de into main Jul 15, 2024
33 of 34 checks passed
@jprochazk jprochazk deleted the jan/chunk-timeline branch July 15, 2024 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude from changelog PRs with this won't show up in CHANGELOG.md 📉 performance Optimization, memory use, etc 📺 re_viewer affects re_viewer itself 🚜 refactor Change the code, not the functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants