Skip to content

Carry result sizes and selector paths through optional operations - #1525

Open
TristonianJones wants to merge 1 commit into
cel-expr:masterfrom
TristonianJones:cost-fix-optional
Open

TristonianJones wants to merge 1 commit into
cel-expr:masterfrom
TristonianJones:cost-fix-optional

Conversation

@TristonianJones

Copy link
Copy Markdown
Collaborator

An estimate that passed through an optional previously lost the size of the wrapped value, leaving downstream estimates unbounded:

  • optional.of, optional.ofNonZeroValue, and optional.value were unmodeled, and optional.or and optional.orValue reported no result size, so a wrapped value's size did not survive the round trip.
  • Optional index overloads ([?]) recorded no field path, so @Items and @values size hints were not consulted below l[?0] or m[?'k'].

Both are corrected at cost model version 1 while preserving legacy estimates when pinned to version 0. Also documents model revisions in docs/cost-model.md.

An estimate that passed through an optional previously lost the size of the
wrapped value, leaving downstream estimates unbounded:

- optional.of, optional.ofNonZeroValue, and optional.value were unmodeled, and
  optional.or and optional.orValue reported no result size, so a wrapped value's
  size did not survive the round trip.
- Optional index overloads (_[?_]) recorded no field path, so @Items and @values
  size hints were not consulted below l[?0] or m[?'k'].

Both are corrected at cost model version 1 while preserving legacy estimates
when pinned to version 0. Also documents model revisions in docs/cost-model.md.
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.

1 participant