Skip to content

Conversation

@joelreymont
Copy link
Contributor

@joelreymont joelreymont commented Oct 31, 2025

Changes:

  • Added next_key_after() and prev_key_before() methods to Int64Histogram to support time-stepping functionality
  • Updated TimeControl and related UI components to use TimeHistogramPerTimeline
  • Updated EntityDb to remove times_per_timeline
  • Added tests for new histogram methods and time-stepping

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.

Thanks for the PR, but I'm pretty sure prev_key_before breaks for large histograms

@joelreymont
Copy link
Contributor Author

Will fix!

@emilk emilk marked this pull request as draft November 4, 2025 07:44
@joelreymont joelreymont force-pushed the 7084-remove-times-per-timeline branch from b91c925 to 003b1ed Compare November 6, 2025 10:03
@joelreymont joelreymont marked this pull request as ready for review November 6, 2025 10:26
@Wumpf
Copy link
Member

Wumpf commented Nov 6, 2025

why did any screenshots change at all if this is supposed to an internal refactor? A lot of them seem to be missing the time display which is obviously a bug

@joelreymont
Copy link
Contributor Author

I had AI analyze the snapshot differences. Here's the summary, after commit 7041436...

All 18 snapshot changes relate to the time control panel fix. The fix ensures play/pause/follow buttons show the correct selected state even when no time histogram data is available.

Visual changes:

  • Button highlighting: buttons now correctly show selected (brighter/highlighted) vs unselected (darker) states
  • Panel area updates: the entire time control panel area reflects the correct play state
  • Consistency: all snapshots now show consistent button states matching the actual playback state

Root cause:

Previously, when time_histogram_per_timeline was None, the play state flags weren't updated, causing incorrect button states. The fix ensures set_play_state is called even without histogram data, using an empty histogram as a fallback.

More specifically:

  1. add_container_from_blueprint_panel_menu_3.png
  • Change: Small button state change in time control panel
  • Location: Bottom panel area (y=934)
  • Size: 7×6px region
  • Visual: Button appears brighter/highlighted (selected state)
  • Brightness increase: +25.3
  • Overall impact: 852 pixels changed (0.08% of image)
  1. change_container_type_2.png
  • Change: Large region change
  • Location: (30, 30) to (908, 398) — 879×369px region
  • Visual: Significant changes across a large area (13.51% of image)
  • Impact: 141,705 pixels changed, max difference 255/255
  1. drag_view_to_other_view_bottom_1.png
  • Change: Time control panel area change
  • Location: Bottom panel (y=724, spans most of width)
  • Size: 1010×299px region
  • Visual: Changes in the entire bottom panel area
  • Overall impact: 451,106 pixels changed (43.02% of image)
  1. drag_view_to_other_view_left_1.png
  • Change: Same as bottom_1 — time control panel area
  • Location: Bottom panel (y=724)
  • Size: 1010×299px region
  • Visual: Changes in the entire bottom panel area
  • Overall impact: 452,210 pixels changed (43.13% of image)
  1. drag_view_to_other_view_right_1.png
  • Change: Same pattern — time control panel area
  • Location: Bottom panel (y=724)
  • Size: 1010×299px region
  • Visual: Changes in the entire bottom panel area
  • Overall impact: 451,009 pixels changed (43.01% of image)
  1. resize_view_horizontal_1.png
  • Change: Time control panel button area
  • Location: Bottom panel (x=212, y=724)
  • Size: 606×50px region (button row width)
  • Visual: Changes in the time control button area
  • Overall impact: 433,710 pixels changed (41.36% of image)
  1. resize_view_horizontal_2.png
  • Change: Same as resize_1 — time control panel button area
  • Location: Bottom panel (x=212, y=724)
  • Size: 606×50px region
  • Visual: Changes in the time control button area
  • Overall impact: 454,404 pixels changed (43.34% of image)
  1. resize_view_horizontal_3.png
  • Change: Same as resize_1 and resize_2
  • Location: Bottom panel (x=212, y=724)
  • Size: 606×50px region
  • Visual: Changes in the time control button area
  • Overall impact: 454,014 pixels changed (43.30% of image)

@joelreymont joelreymont force-pushed the 7084-remove-times-per-timeline branch 3 times, most recently from bad8462 to 9f29cf0 Compare November 7, 2025 17:26
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.

Getting close!

@joelreymont joelreymont force-pushed the 7084-remove-times-per-timeline branch from c3a7959 to ce5d373 Compare November 10, 2025 13:48
@joelreymont
Copy link
Contributor Author

It's like to justify updating snapshots with this analysis of test_single_text_document. The same reasoning applies to the other failing snapshots.

Internal changes

Old code (TimesPerTimeline):

  impl Default for TimesPerTimeline {
      fn default() -> Self {
          let timeline = Timeline::log_time();
          Self(BTreeMap::from([(
              *timeline.name(),
              TimelineStats::new(timeline),  // ← ALWAYS has log_time!
          )]))
      }
  }

→ Timeline selector always shows log_time even with no data

New code (TimeHistogramPerTimeline):

  #[derive(Default, Clone)]  // ← derives Default
  pub struct TimeHistogramPerTimeline {
      times: BTreeMap<TimelineName, TimeHistogram>,  // ← EMPTY BTreeMap
      num_static_messages: u64,
  }

→ Timeline selector shows no timelines with no data

UI rendering changes:

Old timeline selector loop:

  for timeline_stats in times_per_timeline.timelines_with_stats() {
      // Always iterates at least once (log_time)
  }

New timeline selector loop:

  for (timeline_name, hist) in time_histogram_per_timeline.iter() {
      if let Some(timeline) = timelines.get(timeline_name) {
          // With empty data: NEVER enters this loop
      }
  }

Conclusion:

test_single_text_document has no timelines at the first snapshot. The old code artificially showed a log_time timeline by default; the new code correctly shows nothing. The snapshot visual difference is the timeline selector dropdown rendering empty instead of showing log_time.

So the snapshot needs to be updated. This is not a bug, it's the correct behavior for an empty recording.

@joelreymont joelreymont force-pushed the 7084-remove-times-per-timeline branch from ce5d373 to ab19617 Compare November 11, 2025 13:08
@emilk
Copy link
Member

emilk commented Nov 11, 2025

Something has gone wrong with some rebase/merge:
image

@joelreymont joelreymont force-pushed the 7084-remove-times-per-timeline branch from ab19617 to 5938952 Compare November 11, 2025 17:00
@joelreymont
Copy link
Contributor Author

Crap, thanks for pointing it out!

Will fix and watch out for this going forward.

@joelreymont joelreymont force-pushed the 7084-remove-times-per-timeline branch from 5938952 to dc57d03 Compare November 11, 2025 17:11
@joelreymont
Copy link
Contributor Author

Sorry about that! Should be fixed now.

@emilk emilk marked this pull request as draft November 12, 2025 16:02
@emilk
Copy link
Member

emilk commented Nov 12, 2025

Sorry about that! Should be fixed now.

It's not.

Converted to draft until the diff is clean and CI green

@joelreymont
Copy link
Contributor Author

joelreymont commented Nov 12, 2025

Something has gone wrong with some rebase/merge: image

Where are you looking?

I checked c765a7a and the Compare button and they show me a small subset of things changed.

@joelreymont
Copy link
Contributor Author

Will take care of CI tomorrow.

@joelreymont joelreymont force-pushed the 7084-remove-times-per-timeline branch 2 times, most recently from 137386e to 7144d58 Compare November 13, 2025 10:09
…ing (rerun-io#7084)

Changes:
- Added next_key_after() and prev_key_before() methods to Int64Histogram
  to support time-stepping functionality
- Updated TimeControl and related UI components to use TimeHistogramPerTimeline
- Updated EntityDb to remove times_per_timeline
- Added tests for new histogram methods and time-stepping
The histogram was incorrectly incrementing/decrementing by event.num_components()
instead of 1. This caused timelines with 'wide' archetypes (many components) to
appear far more active than timelines with few components, breaking timeline
selection and navigation logic.
@joelreymont joelreymont force-pushed the 7084-remove-times-per-timeline branch from 7144d58 to 2725554 Compare November 13, 2025 10:12
@joelreymont joelreymont marked this pull request as ready for review November 13, 2025 10:37
@joelreymont
Copy link
Contributor Author

Comparing against main should show 11 files changed, 619 insertions(+), 456 deletions now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Speed up ingestion: get rid of TimesPerTimeline

3 participants