perf improvements to textarena env + wordle#943
Merged
Conversation
e18ed54 to
c84fee0
Compare
06998cd to
b0e02d5
Compare
willccbb
approved these changes
Feb 22, 2026
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.
Description
the textarena env (which
worldeuses) has extreme event loop lag at high concurrency. this pr offloads the sync ops from the textarena package into the default asyncio thread pool executor.Type of Change
Testing
uv run pytestlocally.Checklist
Additional Notes
Note
Medium Risk
Touches core rollout execution paths (
setup_state/env_response) and changes sync-to-async behavior plus deepcopy semantics, which could introduce subtle concurrency or state-sharing bugs under load.Overview
Improves
TextArenaEnvconcurrency performance by offloading blocking TextArena calls (deepcopyduringsetup_state,step, andget_observation) to the default asyncio thread pool viaasyncio.to_thread.Adds a
build_shared_memohelper and uses it when cloning the underlying env so large immutable dictionary/word-list data can be shared across deep copies, and standardizes env responses to returnvf.UserMessageobjects (including the storedfinal_env_response).Written by Cursor Bugbot for commit b0e02d5. This will update automatically on new commits. Configure here.