Repository navigation
[rllib] Convert the remaining RLlib guide pages to MyST Markdown - #66213
dstrodtman wants to merge 3 commits into
Conversation
… to MyST Markdown
Continues the RLlib MyST conversion past the prefixed-page pilot by
converting the 14 non-prefixed guide pages under doc/source/rllib/. These
pages keep their filenames, so there are no renames and no redirects.
Converted (faithful, format-only): algorithm-config, checkpoints,
connector-v2, env-to-module-connector, external-envs, hierarchical-envs,
key-concepts, learner-connector, metrics-logger, multi-agent-envs,
new-api-stack-migration-guide, scaling-guide, single-agent-episode,
user-guides.
Notes:
- Drops the `.. include:: /_includes/rllib/new_api_stack.rst` line from
every page. That shared partial is a docutils comment that renders
nothing, consistent with how the pilot handled it.
- Preserves every cross-reference label so external `{ref}`/`:ref:`
callers keep resolving.
- Preserves all executed `.. testcode::` blocks as `{testcode}` fences
(94 across the batch); the doctest[rllib] target globs `*.md`, so
coverage carries over unchanged. No doc/BUILD.bazel edit is needed.
- Card grids convert to native MyST; nested button-refs, figures, and
images convert to fences in the same pass.
- key-concepts carries three pre-existing dead relative `.html` links,
preserved verbatim as raw-HTML passthrough pending a link-cleanup
follow-up.
Prose line-wrapping is kept verbatim in this commit; a follow-up commit
reflows it with the ray-soft-wrap tooling.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
Whitespace-only reflow to one line per paragraph and list item, per the ray-soft-wrap tooling. verify.py confirms non-whitespace bytes are byte-identical, the rendered HTML is unchanged, and the transform is idempotent. Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request migrates RLlib's documentation from reStructuredText (.rst) to MyST Markdown (.md) format across multiple files. The review feedback identifies several formatting and syntax issues introduced during the conversion, such as leaked XML/HTML tags (e.g., and ), invalid Python syntax in code examples (using '..' instead of '...' for ellipsis), and various minor typos, grammatical errors, and capitalization issues that should be corrected to ensure high-quality documentation.
| See {ref}`the Learner connector pipeline documentation <learner-pipeline-docs>` for more details on how to customize it. | ||
| </content> |
There was a problem hiding this comment.
The closing tag ('') appears to have been accidentally leaked or left over from a generation tool. It should be removed.
| See {ref}`the Learner connector pipeline documentation <learner-pipeline-docs>` for more details on how to customize it. | |
| </content> | |
| See {ref}the Learner connector pipeline documentation <learner-pipeline-docs> for more details on how to customize it. |
| See the [PettingZoo parameter sharing example](https://github.com/ray-project/ray/blob/master/rllib/examples/multi_agent/pettingzoo_parameter_sharing.py) for details. | ||
| </content> | ||
| </invoke> |
There was a problem hiding this comment.
These XML/HTML closing tags ('' and '') appear to have been accidentally leaked or left over from a generation tool. They should be removed.
| See the [PettingZoo parameter sharing example](https://github.com/ray-project/ray/blob/master/rllib/examples/multi_agent/pettingzoo_parameter_sharing.py) for details. | |
| </content> | |
| </invoke> | |
| See the [PettingZoo parameter sharing example](https://github.com/ray-project/ray/blob/master/rllib/examples/multi_agent/pettingzoo_parameter_sharing.py) for details. |
| :::: | ||
| </content> |
| tuner = tune.Tuner( | ||
| "IMPALA", | ||
| param_space=config, # <- your RLlib AlgorithmConfig object | ||
| .. |
| :end-before: rllib-sa-episode-01-end | ||
| ``` | ||
|
|
||
| The {py:class}`~ray.rllib.env.single_agent_episode.SingleAgentEpisode` constructed and filled preceding should roughly look like this now: |
|
|
||
| ```{button-ref} rllib-advanced-api-doc | ||
|
|
||
| Advanced features of the RLlib python API |
| config.rl_module(model_config=DefaultModelConfig(use_lstm=True)) | ||
|
|
||
| # For stateful RLModules, we do need to pass in the RLModule to every call to the | ||
| # connector. so construct an instance here. |
| ) | ||
| ``` | ||
|
|
||
| the Ray team renamed the setting `num_cpus_for_local_worker` to `num_cpus_for_main_process`. |
| ``` | ||
|
|
||
| :::{warning} | ||
| For some algorithms, such as IMPALA and APPO, the performance of a single remote {py:class}`~ray.rllib.core.learner.learner.Learner` actor (`num_learners=1`) compared to a single local {py:class}`~ray.rllib.core.learner.learner.Learner` instance (`num_learners=0`), depends on whether you have a GPU available or not. If exactly one GPU is available, you should run these two algorithms with `num_learners=0, num_gpus_per_learner=1`, if no GPU is available, set `num_learners=1, num_gpus_per_learner=0`. If more than 1 GPU is available, set `num_learners=.., num_gpus_per_learner=1`. |
The reST-to-MyST conversion left stray `</content>` and `</invoke>` closing tags at the end of seven guide pages, where they render as literal text. Remove them. No prose or code-example changes. Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
…nversion agent When an agent runs the conversion, its own tool-call framing can leak into the output — trailing `</content>`/`</invoke>` tags, or a stray `<function_calls>`/`<parameter>`/`antml:` token mid-file. These build green and render as literal visible text, and at EOF the render diff can miss them. Add a static-check assert and a grep to Verification step 1. Seen for real: seven RLlib guide pages shipped with trailing tags (#66213). Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
|
Consolidating the stack so each level is a single PR. This PR's work has been absorbed:
The recombined content is byte-identical to this PR's tip (verified file-by-file; the soft-wrap layer passes |
…kdown (#66062) ## Why RLlib's user-guide pages were still reStructuredText while the rest of the Ray docs have moved to MyST Markdown, the standard for new pages. This converts **all 24 RLlib guide pages** to MyST. This is the conversion layer of a three-PR stack. It targets the branch of the rename PR (#66060), which dropped the `rllib-` filename prefix. Keeping rename and conversion as separate PRs preserves each file's git history: the rename is a pure path change and this is a pure format change, so `git log --follow` traces every page through both steps instead of reading as a delete-plus-add. The soft-wrap reflow is the next layer up (#66214). This PR consolidates the two conversion PRs that were previously split (the prefixed-page pilot set and the remaining guides, formerly #66213) into a single conversion layer, so each level of the stack is one PR. ## What `.rst` → `.md` for all 24 RLlib guide pages, format only. Two sets, disjoint: - **Prefixed-pilot set (10):** `advanced-api`, `algorithms`, `callback`, `dev`, `env`, `examples`, `fault-tolerance`, `learner`, `offline`, `replay-buffers`. - **Remaining guides (14):** `algorithm-config`, `checkpoints`, `connector-v2`, `env-to-module-connector`, `external-envs`, `hierarchical-envs`, `key-concepts`, `learner-connector`, `metrics-logger`, `multi-agent-envs`, `new-api-stack-migration-guide`, `scaling-guide`, `single-agent-episode`, `user-guides`. The conversion is faithful — syntax only, no rewording, no restructuring, no heading-level changes. Rendered HTML is unchanged, so published URLs and page content stay the same (Sphinx maps `.rst` and `.md` to the same `.html`). Source line-wrapping is preserved verbatim so the diff stays line-aligned with the `.rst`; the reflow is #66214. Construct notes for review: - **Substitutions.** `algorithms.md` and `learner.md` use `|name|` image substitutions and the `substitution` extension isn't enabled, so each substitution-using table (and the `algorithms` intro paragraph) stays inside an `{eval-rst}` block with its `.. |name| image::` definitions, where RST substitutions resolve natively. - **autodoc** (`.. autofunction::` / `.. autoclass::`) is wrapped in `{eval-rst}` blocks, verbatim. - **Executed doctest.** All executed `.. testcode::` blocks convert to `{testcode}` fences and stay executed (94 across the guides set; `callback`, `env`, `learner`, `offline` in the pilot set). The `doctest[rllib]` target globs `*.md`, so coverage carries over unchanged — no `doc/BUILD.bazel` edit needed. - **Shared include dropped.** The `.. include:: /_includes/rllib/new_api_stack.rst` line is dropped from every page that had it. That shared partial is a docutils comment that renders nothing; keeping it as a MyST `{include}` would dump its raw text onto the page. - **Code-tree `literalinclude` paths are preserved byte-for-byte** (the `../../../rllib/...` includes in `advanced-api`, `offline`, `replay-buffers`). See the coordination note. - **No leaked scaffolding.** An earlier pass of the guides conversion left stray `</content>`/`</invoke>` tags at the end of seven pages; those are removed here (`grep -rnE '</?(content|invoke)>'` is clean). ## Coordination note (literalinclude ↔ source-tree move) `advanced-api.md`, `offline.md`, and `replay-buffers.md` carry the six `../../../rllib/...` code-tree `literalinclude` paths. If the RLlib source-tree move (`rllib/` → `python/ray/rllib/`) lands while this PR is open, whichever merges second needs to repath those six lines. Coordinating merge order on these three files avoids a conflict. ## A note on file history Most of these files show as delete-plus-add rather than a rename: these pages are dense with inline roles, and the faithful mappings (`` :py:class:`…` `` → `` {py:class}`…` ``, `:ref:` → `{ref}`, `` `text <url>`_ `` → `[text](url)`) rewrite nearly every prose line even though wrapping and wording are unchanged. That drops git's line-based similarity below its rename threshold. The pre-conversion history is still in the object graph — `git log --follow -M15% <file>.md` traces each page back through the conversion and the earlier rename. ## Verification - Read the Docs preview builds green under `fail_on_warning` — every label, `{ref}`/`{doc}`, link, toctree entry, `{literalinclude}`, and sphinx-design directive resolves. - Rendered output diffed page-by-page against the pre-conversion (rename-only) preview. Every surviving diff is explained below. - Executed-block counts match the originals. ## Render-diff findings — worth a look The conversion surfaced a few pre-existing RST bugs. In each case the MyST render is *more* correct than the published RST page, but they change what renders, so calling them out: - **`offline` surfaces 7 admonitions that were hidden on the live site.** Seven `.. tip::`/`.. warning::`/`.. note::` directives in `offline.rst` had no space after `::` (e.g. `.. warning::Currently, you can't set both...`), which RST silently swallows — they never rendered. MyST renders them. The content is the author's. **Please sanity-check these are still accurate to publish.** - **`learner` correctly hides a setup import that was leaking.** A `.. testcode:: :hide:` block had its `:hide:` option tab-indented while its body was space-indented, so RST ignored `:hide:` and showed the `import PPOConfig` boilerplate. MyST hides it as intended. - **Dead links/anchors repointed** (called out): `advanced-api` (`rllib-models.html#…` → RLModules page), `env` (`algorithms#available-algorithms-overview` → algorithms page), `offline` (`:ref:`Learner (Alpha)`` → `learner-guide`). All were broken on the RST pages too. - **`key-concepts` carries three pre-existing dead relative `.html` links**, preserved verbatim as raw-HTML passthrough pending a link-cleanup follow-up. - **The algorithm-support table is now a `{list-table}`** (was an RST grid table): same sigil images and `{ref}` links; section rows are bold labels rather than full-width bands, since MyST list-tables can't span columns. - **Index-style pages render examples as list items, not definition lists** (`examples`, `replay-buffers`, `dev`): same content, `title: description` in a bullet rather than a `<dl>`. Happy to convert to MyST definition lists if you'd prefer the original look. Remaining diffs are inert markup (HTML comments carried over from RST comments, cross-reference `<span>` wrapping). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]>
Soft-wraps **all 24 converted RLlib doc pages** to the Ray docs one-sentence-per-line convention. No prose content changes — line-wrapping only. This is the soft-wrap layer of the stack, stacked on the conversion PR (#66062), and kept separate so the conversion PR stays reviewable line-aligned against the `.rst`. It covers both conversion sets in one layer: the prefixed-pilot pages and the remaining guide pages (the latter's reflow was previously carried in #66213, now consolidated here). ## Verification Every changed file passes `ray-soft-wrap`'s `verify.py` against the conversion layer — `content=ok render=ok idempotent=ok` for all 24 pages: - **content** — non-whitespace bytes are byte-identical to the conversion layer. - **render** — CommonMark+GFM rendered HTML is unchanged. - **idempotent** — re-running the reflow is a no-op. ``` python3 doc/.claude/skills/ray-soft-wrap/scripts/verify.py --ref <conversion-tip> <the .md files> ``` (`user-guides.md` is unchanged — its converted form was already one-sentence-per-line — so 23 of the 24 pages show a diff.) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]>
…kdown (ray-project#66062) ## Why RLlib's user-guide pages were still reStructuredText while the rest of the Ray docs have moved to MyST Markdown, the standard for new pages. This converts **all 24 RLlib guide pages** to MyST. This is the conversion layer of a three-PR stack. It targets the branch of the rename PR (ray-project#66060), which dropped the `rllib-` filename prefix. Keeping rename and conversion as separate PRs preserves each file's git history: the rename is a pure path change and this is a pure format change, so `git log --follow` traces every page through both steps instead of reading as a delete-plus-add. The soft-wrap reflow is the next layer up (ray-project#66214). This PR consolidates the two conversion PRs that were previously split (the prefixed-page pilot set and the remaining guides, formerly ray-project#66213) into a single conversion layer, so each level of the stack is one PR. ## What `.rst` → `.md` for all 24 RLlib guide pages, format only. Two sets, disjoint: - **Prefixed-pilot set (10):** `advanced-api`, `algorithms`, `callback`, `dev`, `env`, `examples`, `fault-tolerance`, `learner`, `offline`, `replay-buffers`. - **Remaining guides (14):** `algorithm-config`, `checkpoints`, `connector-v2`, `env-to-module-connector`, `external-envs`, `hierarchical-envs`, `key-concepts`, `learner-connector`, `metrics-logger`, `multi-agent-envs`, `new-api-stack-migration-guide`, `scaling-guide`, `single-agent-episode`, `user-guides`. The conversion is faithful — syntax only, no rewording, no restructuring, no heading-level changes. Rendered HTML is unchanged, so published URLs and page content stay the same (Sphinx maps `.rst` and `.md` to the same `.html`). Source line-wrapping is preserved verbatim so the diff stays line-aligned with the `.rst`; the reflow is ray-project#66214. Construct notes for review: - **Substitutions.** `algorithms.md` and `learner.md` use `|name|` image substitutions and the `substitution` extension isn't enabled, so each substitution-using table (and the `algorithms` intro paragraph) stays inside an `{eval-rst}` block with its `.. |name| image::` definitions, where RST substitutions resolve natively. - **autodoc** (`.. autofunction::` / `.. autoclass::`) is wrapped in `{eval-rst}` blocks, verbatim. - **Executed doctest.** All executed `.. testcode::` blocks convert to `{testcode}` fences and stay executed (94 across the guides set; `callback`, `env`, `learner`, `offline` in the pilot set). The `doctest[rllib]` target globs `*.md`, so coverage carries over unchanged — no `doc/BUILD.bazel` edit needed. - **Shared include dropped.** The `.. include:: /_includes/rllib/new_api_stack.rst` line is dropped from every page that had it. That shared partial is a docutils comment that renders nothing; keeping it as a MyST `{include}` would dump its raw text onto the page. - **Code-tree `literalinclude` paths are preserved byte-for-byte** (the `../../../rllib/...` includes in `advanced-api`, `offline`, `replay-buffers`). See the coordination note. - **No leaked scaffolding.** An earlier pass of the guides conversion left stray `</content>`/`</invoke>` tags at the end of seven pages; those are removed here (`grep -rnE '</?(content|invoke)>'` is clean). ## Coordination note (literalinclude ↔ source-tree move) `advanced-api.md`, `offline.md`, and `replay-buffers.md` carry the six `../../../rllib/...` code-tree `literalinclude` paths. If the RLlib source-tree move (`rllib/` → `python/ray/rllib/`) lands while this PR is open, whichever merges second needs to repath those six lines. Coordinating merge order on these three files avoids a conflict. ## A note on file history Most of these files show as delete-plus-add rather than a rename: these pages are dense with inline roles, and the faithful mappings (`` :py:class:`…` `` → `` {py:class}`…` ``, `:ref:` → `{ref}`, `` `text <url>`_ `` → `[text](url)`) rewrite nearly every prose line even though wrapping and wording are unchanged. That drops git's line-based similarity below its rename threshold. The pre-conversion history is still in the object graph — `git log --follow -M15% <file>.md` traces each page back through the conversion and the earlier rename. ## Verification - Read the Docs preview builds green under `fail_on_warning` — every label, `{ref}`/`{doc}`, link, toctree entry, `{literalinclude}`, and sphinx-design directive resolves. - Rendered output diffed page-by-page against the pre-conversion (rename-only) preview. Every surviving diff is explained below. - Executed-block counts match the originals. ## Render-diff findings — worth a look The conversion surfaced a few pre-existing RST bugs. In each case the MyST render is *more* correct than the published RST page, but they change what renders, so calling them out: - **`offline` surfaces 7 admonitions that were hidden on the live site.** Seven `.. tip::`/`.. warning::`/`.. note::` directives in `offline.rst` had no space after `::` (e.g. `.. warning::Currently, you can't set both...`), which RST silently swallows — they never rendered. MyST renders them. The content is the author's. **Please sanity-check these are still accurate to publish.** - **`learner` correctly hides a setup import that was leaking.** A `.. testcode:: :hide:` block had its `:hide:` option tab-indented while its body was space-indented, so RST ignored `:hide:` and showed the `import PPOConfig` boilerplate. MyST hides it as intended. - **Dead links/anchors repointed** (called out): `advanced-api` (`rllib-models.html#…` → RLModules page), `env` (`algorithms#available-algorithms-overview` → algorithms page), `offline` (`:ref:`Learner (Alpha)`` → `learner-guide`). All were broken on the RST pages too. - **`key-concepts` carries three pre-existing dead relative `.html` links**, preserved verbatim as raw-HTML passthrough pending a link-cleanup follow-up. - **The algorithm-support table is now a `{list-table}`** (was an RST grid table): same sigil images and `{ref}` links; section rows are bold labels rather than full-width bands, since MyST list-tables can't span columns. - **Index-style pages render examples as list items, not definition lists** (`examples`, `replay-buffers`, `dev`): same content, `title: description` in a bullet rather than a `<dl>`. Happy to convert to MyST definition lists if you'd prefer the original look. Remaining diffs are inert markup (HTML comments carried over from RST comments, cross-reference `<span>` wrapping). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]>
Soft-wraps **all 24 converted RLlib doc pages** to the Ray docs one-sentence-per-line convention. No prose content changes — line-wrapping only. This is the soft-wrap layer of the stack, stacked on the conversion PR (ray-project#66062), and kept separate so the conversion PR stays reviewable line-aligned against the `.rst`. It covers both conversion sets in one layer: the prefixed-pilot pages and the remaining guide pages (the latter's reflow was previously carried in ray-project#66213, now consolidated here). ## Verification Every changed file passes `ray-soft-wrap`'s `verify.py` against the conversion layer — `content=ok render=ok idempotent=ok` for all 24 pages: - **content** — non-whitespace bytes are byte-identical to the conversion layer. - **render** — CommonMark+GFM rendered HTML is unchanged. - **idempotent** — re-running the reflow is a no-op. ``` python3 doc/.claude/skills/ray-soft-wrap/scripts/verify.py --ref <conversion-tip> <the .md files> ``` (`user-guides.md` is unchanged — its converted form was already one-sentence-per-line — so 23 of the 24 pages show a diff.) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 4.8 <[email protected]>
Converts the remaining RLlib guide pages from reStructuredText to MyST Markdown, continuing the RLlib prose conversion past the initial pilot set. Also soft-wraps the converted guide pages to match the Ray docs one-sentence-per-line convention.
This stacks on top of the batch-8 conversion PR (#66062) — review that one first. The diff here is only the additional guide pages (
algorithm-config,checkpoints,connector-v2,env-to-module-connector,external-envs,hierarchical-envs,key-concepts,learner-connector,metrics-logger,multi-agent-envs,new-api-stack-migration-guide,scaling-guide,single-agent-episode,user-guides); these files do not overlap with the batch-8 set.Checks