Update concurrency handling in benchmark execution - #136
Merged
Merged
Conversation
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.
What type of PR is this? (check all applicable)
Related issue: N/A
What changed?
_generate_summarycomputedconcurrency_efficiencyand reportedmax_concurrent_tasksusingself.config.max_concurrent_tasksdirectly._execute_tasks_concurrentlyforcesmax_concurrent = 1for AgentDojo runs regardless of config, so the summary was reading a value that didn't match what was actually used._execute_tasks_concurrentlynow returns(results, max_concurrent);run_benchmarkthreads that through;_generate_summarytakes anactual_max_concurrentparam and uses it instead of re-reading config.Why?
For every AgentDojo run,
concurrency_efficiencywas computed asactual_speedup / config_value(e.g./10) instead ofactual_speedup / 1, understating efficiency by roughly the configured concurrency factor. The reportedmax_concurrent_tasksfield was also just wrong for those runs.How did you test it?
Traced the value through both call paths (ADR-bench vs. AgentDojo) by reading the code; not run against a live benchmark. No unit test added — this file has no existing test scaffolding to attach one to.
Potential risks
_execute_tasks_concurrently's return signature changed fromList[Dict[str, Any]]toTuple[List[Dict[str, Any]], int]. Any other caller of that method (none visible in this file) would break._generate_summarygained a new optional parameter with a safe fallback (self.config.max_concurrent_taskswhenNone), so existing callers not passing it still work, just with the old (wrong-for-AgentDojo) behavior.