Execution frame integration with updated IntepretableV2#1344
Open
TristonianJones wants to merge 4 commits into
Open
Execution frame integration with updated IntepretableV2#1344TristonianJones wants to merge 4 commits into
TristonianJones wants to merge 4 commits into
Conversation
l46kok
reviewed
Jun 17, 2026
| @@ -44,15 +44,15 @@ type EvalObserver func(vars Activation, id int64, programStep any, value ref.Val | |||
| // StatefulObserver observes evaluation while tracking or utilizing stateful behavior. | |||
| type StatefulObserver interface { | |||
| // InitState configures stateful metadata on the activation. | |||
Collaborator
There was a problem hiding this comment.
nit: s/activation/ExecutionFrame
| tracker, found := asCostTracker(vars) | ||
| if !found { | ||
| frame := AsFrame(vars) | ||
| tracker := ct.GetState(frame).(*CostTracker) |
Collaborator
There was a problem hiding this comment.
Consider checking for nil from ct.getState call first before the cast
| // | ||
| // This method is concurrency safe and the expectation is that the observer function will use | ||
| // a switch statement to determine the type of the state which has been reported back from the call. | ||
| func (oi *ObservableInterpretable) ObserveEval(vars Activation, observer func(any)) ref.Val { |
Collaborator
There was a problem hiding this comment.
Would the rename here be a breaking change?
| @@ -44,15 +44,15 @@ type EvalObserver func(vars Activation, id int64, programStep any, value ref.Val | |||
| // StatefulObserver observes evaluation while tracking or utilizing stateful behavior. | |||
| type StatefulObserver interface { | |||
Collaborator
There was a problem hiding this comment.
This is technically a breaking change.. but not sure if it matters at all. Can external authors author a custom cost tracker against this interface and inject it into the evaluator?
| sa.Activation = activation | ||
| sa.Activation = frame | ||
| defer b.clearSlots(sa) | ||
| return b.expr.Eval(sa) |
Collaborator
There was a problem hiding this comment.
Should we push the slot into a child frame? sa no longer takes in an Activation, so this would force allocate a new frame on the heap per bind right?
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.
Plugs the
ExecutionFrameinto the CEL interpreter and program APIs and introducesa new
InterpretableV2for calling program steps with theExecutionFramerather thanthe
Activation.