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

Leo/sy 779 cesium codebase inspection #648

Merged
merged 14 commits into from
Jun 17, 2024

Conversation

LeonLiur
Copy link
Contributor

fixed bugs:

  • Added a check to not configuring a control update channel on a non-virtual non-string channel
  • Fixed behaviour where writing to a timestamp channel with int64 would not error: must write in timestamps.
  • Fixed bug in unary iterator where after reading parts of a doamin, that domain is skipped directly
  • Fixed bug in unary iterator where if view is entirely in a discontinuity, following reads are incorrect.
  • Added lots of tests for cesium iterator

@LeonLiur LeonLiur requested a review from emilbon99 June 15, 2024 22:01
Copy link

vercel bot commented Jun 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 17, 2024 1:06am

Copy link

codecov bot commented Jun 15, 2024

Codecov Report

Attention: Patch coverage is 76.87075% with 34 lines in your changes missing coverage. Please review.

Project coverage is 51.83%. Comparing base (73f89bf) to head (e1589b5).

Files Patch % Lines
x/go/telem/testutil/matchers.go 45.45% 11 Missing and 1 partial ⚠️
cesium/writer_stream.go 50.00% 4 Missing and 2 partials ⚠️
cesium/iterator_stream.go 50.00% 5 Missing ⚠️
cesium/iterator_open.go 20.00% 4 Missing ⚠️
cesium/open.go 86.66% 3 Missing and 1 partial ⚠️
x/go/telem/series_factory.go 50.00% 2 Missing ⚠️
cesium/db.go 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##               rc     #648      +/-   ##
==========================================
+ Coverage   51.65%   51.83%   +0.17%     
==========================================
  Files        1040     1040              
  Lines       78615    78658      +43     
  Branches     3249     3249              
==========================================
+ Hits        40609    40771     +162     
+ Misses      37019    36899     -120     
- Partials      987      988       +1     
Flag Coverage Δ
aspen 50.36% <ø> (+0.17%) ⬆️
cesium 74.77% <83.47%> (+2.06%) ⬆️
clientpy 87.38% <ø> (ø)
clientts 86.67% <ø> (ø)
gox 58.99% <46.15%> (+0.96%) ⬆️
synnax 27.24% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@emilbon99 emilbon99 left a comment

Choose a reason for hiding this comment

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

Approved once you address my questions

cesium/control.go Outdated Show resolved Hide resolved
cesium/internal/index/domain.go Outdated Show resolved Hide resolved
cesium/internal/testutil/matchers.go Outdated Show resolved Hide resolved
@@ -138,7 +138,7 @@ func (i *Iterator) Next(ctx context.Context, span telem.TimeSpan) (ok bool) {

i.reset(i.view.End.SpanRange(span).BoundBy(i.bounds))

if i.view.IsZero() {
if i.view.IsZero() || i.view.End.BeforeEq(i.internal.TimeRange().Start) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd be interested in getting an explanation of why you added this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the entire view is before the start of the internal domain, that means there's no data to be read.

Added to address a bug where if the view is put between two domains via Next, it unnecessarily moves on to the next domain and skip the previous one. (domain 1: [10, 20), domain 2: [30, 40), domain 3: [50, 60), say view is at [23, 24), the iterator position is at domain 2 – instead of reading nothing and doing nothing, the iterator actually moved on to domain 3, skipping domain 2 entirely.

if lengthOfFrame == -1 {
s := fr.Series[i]
if s.DataType.Density() == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We want to check every frame for whether it has the right data type, not just the first.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We want to check whether every series has the right data type, not just the first

Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we be checking this in the unary layer? I added this so that getting the length of the series doesn't panic on a variable length series

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you're right, we're already checking at the unary level whether the data type is correct. But I still don't understand why we only chekc for the first channel if the data type is unknown. Could you explain what you mean by "variable length series". Isn't getting the length of the frame supposed to panic when the frame is not even?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, just to confirm – at the unary level we check as if int64 and timestamp data type are interchangeable – should that be the case? Should we allow passing a int64 series into a timestamp channel?

@pjdotson pjdotson merged commit 5699c7c into rc Jun 17, 2024
48 checks passed
@pjdotson pjdotson deleted the leo/sy-779-cesium-codebase-inspection branch June 17, 2024 18:36
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.

3 participants