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

Cost tracking in v0.23.0 changes call order for estimations #1114

Closed
1 of 3 tasks
TristonianJones opened this issue Jan 28, 2025 · 0 comments · Fixed by #1113
Closed
1 of 3 tasks

Cost tracking in v0.23.0 changes call order for estimations #1114

TristonianJones opened this issue Jan 28, 2025 · 0 comments · Fixed by #1113

Comments

@TristonianJones
Copy link
Collaborator

Describe the bug

CEL v0.23.0 introduced cost-tracking for comprehensions along with a handful of other cleanups
to better track size and entry size of various CEL values (#1104). The change also introduced a
change in call order to the custom CostEstimator implementations which unfortunately triggered
failures in clients who estimated CEL scalar types differently from the standard CEL definition.

To Reproduce
Check which components this affects:

  • parser
  • checker
  • interpreter

Sample expression and input that reproduces the issue:

// where self is a map(string, duration)
duration(self.val1) == self.val2

Expected behavior
The expected cost from CEL and Kubernetes (as an example) was off-by-one since CEL always
estimates the size of constants as 1 and in Kubernetes the cost of constants may be zero.

With the call order restored, the cost would be what Kubernetes dictates for the type, not what
the core CEL definitions dictate.

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 a pull request may close this issue.

1 participant