Conversation
When GetRange restricts a DelayedSeries via Between/After/Before, the new DelayedSource previously kept the original rangeMin/rangeMax. This caused two bugs: 1. series.KeyRange returned the full original bounds, so Sample/ resampleUniform would generate keys for the entire original range rather than just the restricted window. 2. flattenRanges received the original bounds as overallMin/overallMax, potentially generating spurious boundary segments. Fix: pass rangeMin=fst lo and rangeMax=fst hi to With() in GetRange, and add corresponding optional parameters to DelayedSource.With. Added regression tests: - KeyRange reflects Between restriction on a lazy series (#310) - Loader is only called with restricted range after Between (#310) Co-authored-by: Copilot <[email protected]>
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Repo Assist — automated bug fix (Task 3: Issue Investigation and Fix)
Summary
Fixes the bug in #310: lazy series
.Between(ds, de).Sample(interval)loads data from the full original range instead of just the restricted window.The maintainer
@dsymerequested this fix in #310 (comment).Root Cause
DelayedSource.Withalways forwarded the originalrangeMin/rangeMaxto the new source, regardless of the range restriction passed inranges. This had two effects:KeyRangereturned the wrong bounds.DelayedIndex.KeyRangeis backed bysource.RangeMin/source.RangeMax, so after.Between(ds, de),series.KeyRangestill returned(original_min, original_max). ThegenerateKeysfunction inSeries.Sample/resampleUniformcallsseries.KeyRangeto determine the window for which to generate sample keys — so it generated keys across the entire original range.flattenRangesused the original bounds asoverallMin/overallMax. This added spurious boundary segments outside the restriction window into the loader call.Fix
Added optional
rangeMinandrangeMaxparameters toDelayedSource.With, and updatedDelayedIndexBuilder.GetRangeto pass the effective lower/upper bound (fst lo/fst hi) when creating the restricted source.And in
GetRange:Trade-offs
.Before(40).After(10)): eachGetRangecall narrowsrangeMin/rangeMaxfurther.Test Status
LazySeries.fs:KeyRange reflects Between restriction on a lazy series (regression #310)Loader is only called with restricted range after Between (regression #310)