Skip to content

⚡ Bolt: [Zero-Allocation ExecutionNode State Comparison] - #120

Merged
ovasylenko merged 2 commits into
mainfrom
bolt/zero-allocation-state-comparison-979372772646664012
Sep 2, 2026
Merged

⚡ Bolt: [Zero-Allocation ExecutionNode State Comparison]#120
ovasylenko merged 2 commits into
mainfrom
bolt/zero-allocation-state-comparison-979372772646664012

Conversation

@ovasylenko

Copy link
Copy Markdown
Contributor

💡 What: Replaced Vec<(ExecutionNodeId, NodeState)> allocations in phase_composite_reevaluation with a zero-allocation states_differ helper function.
🎯 Why: To reduce unnecessary memory allocations and hashing overhead on the evaluation hot path when comparing execution tree states.
📊 Impact: Eliminates multiple heap allocations per composite node tick, improving throughput and reducing memory pressure during heavy workloads.
🔬 Measurement: Verified via cargo +nightly test -p orch8-engine --lib evaluator::tests.


PR created automatically by Jules for task 979372772646664012 started by @ovasylenko

…mparison

In `phase_composite_reevaluation`, multiple `Vec` allocations were used to snapshot and compare `ExecutionNode` states before, during, and after block execution. This replaces the allocations with a zero-allocation `states_differ` helper that compares slice lengths and uses `.zip().any()` to quickly short-circuit on changes, reducing memory overhead on the execution hot path.

Co-authored-by: ovasylenko <3797513+ovasylenko@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

…mparison

In `phase_composite_reevaluation`, multiple `Vec` allocations were used to snapshot and compare `ExecutionNode` states before, during, and after block execution. This replaces the allocations with a zero-allocation `states_differ` helper that compares slice lengths and uses `.zip().any()` to quickly short-circuit on changes, reducing memory overhead on the execution hot path.

Also fixed a clippy warning `clippy::manual_is_variant_and` in `orch8-push/src/fcm.rs`.

Co-authored-by: ovasylenko <3797513+ovasylenko@users.noreply.github.com>
@ovasylenko
ovasylenko merged commit cb1464b into main Sep 2, 2026
16 of 17 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.

1 participant