Replace expression-tree pipeline execution with trampoline parts #7625
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.
This PR aligns pipeline execution with a simplified trampoline model, keeps state on the context bag, and improves AOT/trimming friendliness while minimizing broader architectural change.
The trampoline model executes the pipeline as a flat loop-like progression over prebuilt parts, instead of recursively composing many nested delegates at runtime.
PipelinePart[]represents the execution plan.Index,RangeEnd) tracks current position/range.StageRunners.Next, increments index, and dispatches the next part.Nextentrypoint).This gives predictable control flow, avoids runtime code generation, and keeps hot-path dispatch compact.
Benefits
coupling.
more static.
Additional Notes
Pipeline Frame Safety
Cost of Adding a New Pipeline
This change does add a small amount of explicit wiring when introducing a brand-new pipeline. That should be called out, but in context:
So the tradeoff is intentional:
Benchmarks
https://github.com/danielmarbach/MicroBenchmarks and branches starting with
bare-metalExecution
Throwing
Warmup
Alternatives Considered
See https://github.com/danielmarbach/PipelinePlayground and and branches starting with
bare-metaland invokers