Skip to content

Introduce IndexCell #9226

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

Merged
merged 18 commits into from
Mar 7, 2025
Merged

Introduce IndexCell #9226

merged 18 commits into from
Mar 7, 2025

Conversation

emilk
Copy link
Member

@emilk emilk commented Mar 6, 2025

Related

What

Introduces a new type, IndexCell:

pub struct IndexCell {
    pub typ: TimeType,
    pub value: NonMinI64,
}

And changes TimePoint to use it:

pub struct TimePoint(BTreeMap<TimelineName, IndexCell>);

Naming

The thought behind the name IndexCell is two-fold:

A) It is symmetrical with DataCell
B) It will allow us to at some point broaden to more types of indices (e.g. UUID)

I’d like to rename TimeType to IndexType at some point. I haven’t planned this in detail though; I mostly want to avoid having to rename the new things I add.

TODO

  • Full check

Future work

There are A LOT of tests using Timeline and TimeInt that would be better seved by using TimelineName and IndexCell, but this is too much to clean up in this PR.

There is also A LOT of (old) parameters of the type impl TryInt<TimeInt> which in effect means "An i64 or TimeInt that will be converted to a non-static TimeInt via saturating cast". It took me a long time to figure out that this is what it meant. We should come up with a nicer pattern for this.

Maybe deprecate TimePoint::with and TimePoint::insert?

Copy link

github-actions bot commented Mar 6, 2025

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

  • I have tested the web viewer
Result Commit Link Manifest
482834a https://rerun.io/viewer/pr/9226 +nightly +main

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

@emilk emilk force-pushed the emilk/refactor-time-point branch from 41b2f35 to 94d21df Compare March 6, 2025 20:38
@emilk emilk marked this pull request as ready for review March 7, 2025 09:15
@emilk
Copy link
Member Author

emilk commented Mar 7, 2025

@rerun-bot full-check

Copy link

github-actions bot commented Mar 7, 2025

Started a full build: https://github.com/rerun-io/rerun/actions/runs/13718027176

@emilk emilk mentioned this pull request Mar 7, 2025
11 tasks
@teh-cmc teh-cmc self-requested a review March 7, 2025 14:12
Copy link
Member

@teh-cmc teh-cmc left a comment

Choose a reason for hiding this comment

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

"nonstatic" sounds a bit weird, but I guess we gotta stay away from "temporal" if we want to move towards generic indexes... 🤷

@emilk
Copy link
Member Author

emilk commented Mar 7, 2025

Good point 🤔
I'll add a TODO about that naming to the parent issue

@emilk emilk merged commit 6001eda into main Mar 7, 2025
36 checks passed
@emilk emilk deleted the emilk/refactor-time-point branch March 7, 2025 14:46
@emilk emilk mentioned this pull request Apr 11, 2025
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants