Skip to content

Conversation

@stevegolton
Copy link
Member

@stevegolton stevegolton commented Sep 22, 2025

Currently we make the assumption in BaseSliceTrack that slices are ordered by ts, which allows us to perform a very specific optimization which avoids rendering anything when the first slice is off the right hand side of the viewport.

However, slices from the mipmap function are ordered by depth first then ts, meaning that slices are not necessarily sorted by ts. In practice, slices at lower depths usually do start before those at higher depths anyway, so this is usually not an issue.

This patch removes the optimization entirely as it seems pretty dubious whether it actually helps all that much.

Fixes: https://buganizer.corp.google.com/issues/446503267

Currently we make the assumption in BaseSliceTrack that slices are
ordered by ts when rendering them, which allows us to cull slices that
are outside of the viewport.

However, there is no explicit order by guarantees in the track query,
so this ordering is not a given, it just happens to be that most
track sources are inherently ordered.

This patch simply adds an `ORDER BY tsQ` clause to the query, forcing
the results to be ordered by timetstamp.

Change-Id: Ieb76f56fe893543701f9d73c5f41394b8f6baf69
@stevegolton stevegolton requested a review from a team as a code owner September 22, 2025 10:53
Copy link
Member

@rsavitski rsavitski left a comment

Choose a reason for hiding this comment

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

-1 as well, let's investigate the trace (it was a local tracebox on my laptop, and I was messing with perf counters but I don't see how that would affect the scheduling tracks unless it went full on data corruption).

- Remove optimization that relies on slices being sorted in the first
  place.

Change-Id: I001737e4a200a9b14f235fd07e616e28f0a8c632
@stevegolton stevegolton changed the title ui: Fix disappearing slices by explicitly ordering slices ui: Fix disappearing slices by removing an optimization that assumes sorted slices in BaseSliceTrack Sep 22, 2025
@stevegolton
Copy link
Member Author

-1 as well, let's investigate the trace (it was a local tracebox on my laptop, and I was messing with perf counters but I don't see how that would affect the scheduling tracks unless it went full on data corruption).

This is definitely a bug in the base slice track renderer. I'm not quite sure why we don't see the problem more often, but apparently your trace is just unusual enough to provoke it.

@rsavitski
Copy link
Member

-1 as well, let's investigate the trace (it was a local tracebox on my laptop, and I was messing with perf counters but I don't see how that would affect the scheduling tracks unless it went full on data corruption).

This is definitely a bug in the base slice track renderer. I'm not quite sure why we don't see the problem more often, but apparently your trace is just unusual enough to provoke it.

Right, I originally thought the data is out of order at the table level, but it's a UI issue. LGTM.

@stevegolton stevegolton merged commit f02e7ca into main Sep 22, 2025
21 checks passed
@stevegolton stevegolton deleted the dev/sg/disappearing-slices branch September 22, 2025 16:58
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.

4 participants