Skip to content

Comments

perf improvements to textarena env + wordle#943

Merged
willccbb merged 5 commits intomainfrom
remove-sync-ops-textarena
Feb 22, 2026
Merged

perf improvements to textarena env + wordle#943
willccbb merged 5 commits intomainfrom
remove-sync-ops-textarena

Conversation

@mikasenghaas
Copy link
Member

@mikasenghaas mikasenghaas commented Feb 20, 2026

Description

the textarena env (which worlde uses) 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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Test improvement

Testing

  • All existing tests pass when running uv run pytest locally.
  • New tests have been added to cover the changes

Checklist

  • My code follows the style guidelines of this project as outlined in AGENTS.md
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

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 TextArenaEnv concurrency performance by offloading blocking TextArena calls (deepcopy during setup_state, step, and get_observation) to the default asyncio thread pool via asyncio.to_thread.

Adds a build_shared_memo helper 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 return vf.UserMessage objects (including the stored final_env_response).

Written by Cursor Bugbot for commit b0e02d5. This will update automatically on new commits. Configure here.

@mikasenghaas mikasenghaas changed the title run sync ta ops in threads + use user message perf improvements to textarena env + wordle Feb 20, 2026
@mikasenghaas mikasenghaas force-pushed the remove-sync-ops-textarena branch from e18ed54 to c84fee0 Compare February 20, 2026 12:58
@mikasenghaas mikasenghaas force-pushed the remove-sync-ops-textarena branch from 06998cd to b0e02d5 Compare February 20, 2026 20:03
@mikasenghaas mikasenghaas marked this pull request as ready for review February 20, 2026 20:03
@willccbb willccbb merged commit 3f555af into main Feb 22, 2026
6 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.

2 participants