Files
prime-rl/skills
Konstantin DunasandGitHub e18b36f059 refactor: rename env servers to env worker pools (#4381)
The environment hosting entrypoint launches a broker and a pool of
episode workers. Calling that unit an "env server" obscures the source →
pool replica → broker/workers hierarchy. This follow-up to #4375 names
those roles consistently.

- Rename the command to `uv run env-worker-pool`, its schema to
`EnvWorkerPoolConfig` in `prime_rl.configs.env_worker_pool`, and the
orchestrator field to `env_worker_pool_replicas`.
- Rename `EnvServerPool` to `EnvWorkerPool`, `EnvServer` to `EnvWorker`
in `prime_rl.env.worker`, and `serve_env` to `run_env_worker_pool`.
Process titles distinguish `PRL::EnvBroker` and `PRL::EnvWorker`.
- Update the RL/eval launchers, the shared SFT/pretrain launcher, SLURM
templates, config helpers, CI paths, dashboard text, docs, and the
affected skills. Document per-source configuration, pool replicas, and
worker concurrency.
- Anchor the root virtualenv ignore rule so it does not hide
`src/prime_rl/env/` on case-insensitive filesystems.

`[serve]`, the wire protocol, pool sizing/dispatch behavior, and run
artifact paths are unchanged. This is a naming change; direct
worker-to-sink data delivery remains separate work.

## Breaking names

| Before | After |
| --- | --- |
| `env-server` | `env-worker-pool` |
| `prime_rl.configs.env_server.EnvServerConfig` |
`prime_rl.configs.env_worker_pool.EnvWorkerPoolConfig` |
| `OrchestratorConfig.env_server_replicas` |
`OrchestratorConfig.env_worker_pool_replicas` |
| `prime_rl.env.pool.EnvServerPool` | `prime_rl.env.pool.EnvWorkerPool`
|
| `prime_rl.env.server.EnvServer` | `prime_rl.env.worker.EnvWorker` |
| `prime_rl.env.serve_env` | `prime_rl.env.run_env_worker_pool` |
| `EnvClient.wait_for_server_startup` |
`EnvClient.wait_for_pool_startup` |

## Validation

- 447 focused CPU tests passed (env, configs, supported
orchestrator/eval/transport tests, dashboard artifacts and pathing);
four cases deselected. Tests requiring unavailable `torch`, `vllm`, and
TextArena dependencies were excluded.
- Temporary smoke script exercised static pools with 1/2 workers and
elastic pools capped at 1/unbounded: address discovery, task/error
round-trip through the broker and worker, process titles, graceful
shutdown, and IPC cleanup all passed. The smoke env deliberately raises
an episode error; it does not call inference.
- Both wheels build; wheel contents and the renamed console entrypoint
verified. Entrypoint help, touched TOML parsing, Ruff, and `pre-commit
run --all-files` pass.
- The deep-backlog ZMQ test timed out after 18 seconds on both unchanged
base `c0ad9e9f4` and this branch, so it was deselected. No GPU training
run.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Breaking renames span the CLI, Python imports, and orchestrator config
fields; behavior is unchanged but existing scripts and TOML must be
updated.
> 
> **Overview**
> Renames the environment-hosting stack so **source → broker → workers**
is explicit: the CLI becomes **`uv run env-worker-pool`**, config schema
**`EnvWorkerPoolConfig`** (`prime_rl.configs.env_worker_pool`), and
orchestrator **`env_worker_pool_replicas`** replace the old `env-server`
/ `EnvServerConfig` / `env_server_replicas` names.
> 
> Runtime symbols align with that model—**`EnvWorkerPool`**,
**`EnvWorker`**, **`run_env_worker_pool`**, broker/worker process titles
(**`PRL::EnvBroker`** / **`PRL::EnvWorker`**), and
**`EnvClient.wait_for_pool_startup`**. RL/SFT/eval launchers, SLURM
templates, pathing helpers, CI filters, dashboard copy, docs, and skills
are updated to match; **`[serve]`**, the ZMQ wire protocol, and artifact
paths stay the same.
> 
> **.gitignore** anchors **`/ENV/`** so a root `ENV` venv directory is
not confused with **`src/prime_rl/env/`** on case-insensitive
filesystems.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
47c74d92f30d54524ad2e0c79ae1dae0e42def31. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2026-11-07 03:39:35 +01:00
..
2026-10-19 02:47:17 -07:00