Autoresearch v2: 42% faster via graph surgery + executor optimizations#93
Open
sunapi386 wants to merge 12 commits into
Open
Autoresearch v2: 42% faster via graph surgery + executor optimizations#93sunapi386 wants to merge 12 commits into
sunapi386 wants to merge 12 commits into
Conversation
…EachNode via _construct_trusted Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…lidation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… per iteration, use Edge.model_construct, pre-compute adapter templates Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…chNode.run Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…namespace Avoid clearing input_type, output_type, etc. when only the node ID changes. This prevents expensive create_model re-computation for namespaced copies. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…dy match Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… via successor map Instead of scanning all nodes after each execution, only check successors of the just-completed node. Falls back to full scan after workflow expansion. Reduces large_100 topological from ~91ms to ~30ms. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…k formatting ShouldRetry is an expected transient error handled by the execution loop. Skip logger.exception and on_node_error for faster retry handling. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…g empty dicts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Context
Why
The v1 autoresearch round optimized small arithmetic DAGs but didn't exercise the engine's heaviest code paths:
ForEachNodesub-workflow expansion (graph surgery), large DAGs (100+ nodes), retry/backoff loops, and yield/resume. These are the patterns real production workflows hit.What
Second autoresearch round targeting the 4 new heavy benchmarks. 16 experiments, 11 kept, 5 reverted. 42% faster, 70% less memory vs v1 baseline.
How
Focused on eliminating validation overhead in hot paths (
_construct_trusted,model_construct), optimizingForEachNode.run()loop (pre-computed templates, skip per-iterationwith_namespace), and switching the topological executor to incremental successor-based ready-node tracking.Summary
core/workflow.py_construct_trustedbypasses DAG validation;defaultdictforedges_by_target;Edge.model_constructinexpand_nodecore/node.pywith_namespace; fast-path ShouldRetry;model_constructin_cast_inputcreate_modeldynamic types for every namespaced copycore/edge.pymodel_constructinwith_namespacenodes/iteration.pyworkflow.with_namespaceper iteration, pre-compute adapter templatesexecution/topological.pylarge_1003x fasterexecution/parallel.pyResults
total_time_speak_memory_mbcorrectnessPer-benchmark highlights (topological):
foreach_expandlarge_100retry_chainTest plan
🤖 Generated with Claude Code