Skip to content

Propagate container Key and Elem size estimates - #1537

Merged
TristonianJones merged 2 commits into
cel-expr:masterfrom
TristonianJones:cost-key-elem
Oct 7, 2026
Merged

TristonianJones merged 2 commits into
cel-expr:masterfrom
TristonianJones:cost-key-elem

Conversation

@TristonianJones

Copy link
Copy Markdown
Collaborator

Propagates container Key and Elem size estimates through DefaultSizingStrategy, AggregateSizingStrategy, single- and two-variable comprehensions (map, filter, transformList, transformMap, transformMapEntry), cel.bind, cel.@block, and computed container indexing:

  • Preserves Key and Elem metadata returned on a container SizeEstimate in both DefaultSizingStrategy and AggregateSizingStrategy, and records an explicit UnknownSizeEstimate on non-empty containers whose Key or Elem size is unhinted so combining them with literal containers widens to Unknown rather than narrowing to the literal.
  • Evaluates comprehension LoopStep size before popping loop variables so constructed list and map accumulators (including cel.@mapInsert) carry the body's Key and Elem sizes onto the comprehension result, while clearing Key on list comprehensions.
  • Propagates result paths and size estimates through cel.bind before popping the bound variable and adds costBlock for cel.@block expressions.

… comprehensions

Propagates container Key and Elem size estimates through DefaultSizingStrategy,
AggregateSizingStrategy, single- and two-variable comprehensions (map, filter,
transformList, transformMap, transformMapEntry), cel.bind, cel.@block, and
computed container indexing:

- Preserves Key and Elem metadata returned on a container SizeEstimate in both
  DefaultSizingStrategy and AggregateSizingStrategy, and records an explicit
  UnknownSizeEstimate on non-empty containers whose Key or Elem size is unhinted
  so combining them with literal containers widens to Unknown rather than
  narrowing to the literal.
- Evaluates comprehension LoopStep size before popping loop variables so
  constructed list and map accumulators (including cel.@mapInsert) carry the
  body's Key and Elem sizes onto the comprehension result, while clearing Key
  on list comprehensions.
- Propagates result paths and size estimates through cel.bind before popping
  the bound variable and adds costBlock for cel.@block expressions.
@TristonianJones
TristonianJones merged commit 0d12617 into cel-expr:master Oct 7, 2026
8 checks passed
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.

2 participants