-
Notifications
You must be signed in to change notification settings - Fork 227
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
Estimated size information lost when .map()
result is chained
#900
Comments
@jpbetz why do you expected unbounded cost on the upperbound when the input size is fixed? |
@TristonianJones I think it's the opposite - we expect a bounded cost, but the current implementation returns an unbounded one. |
I expected bounded but got unbounded. |
It seems like there's something more pernicious than adding
We get:
The cost assertions failing aside, the fact that the second evaluates to an unbounded cost is wrong and reproduces something similar to the original report without having to chain anything. |
@jpbetz @stevekuznetsov, my apologies, I misread the report about the expectations. My guess is that all comprehensions are looking for fixed size iteration ranges, so any chaining / nesting with more than one comprehension will likely trigger the issue. Happy to have more test cases though. -Tristan |
@TristonianJones I'm new to the project so I don't know if I understand your comment about "all comprehensions are looking for fixed size iteration ranges" but I believe my second test case has fixed-size inputs for all and still evaluates to an unbounded result:
For the original report from @jpbetz with a chained Edit: I guess in both cases it seems like the evaluator is not able to determine that the output of Edit 2: we hit this case on the output of the |
Estimated size information lost with
.map()
when.filter()
is called on the result (presumably applies to other chaining operations).To Reproduce
Check which components this affects:
Sample expression and input that reproduces the issue:
Test setup:
checker/cost_test.go
:Expected behavior
Expected a bounded cost estimate. got: [97, 18446744073709551615]
Additional context
Both these test cases pass when added:
The text was updated successfully, but these errors were encountered: