Skip to content

[rllib] Soft-wrap all converted RLlib doc pages - #66214

Merged
dstrodtman merged 3 commits into
masterfrom
doc-1528-rllib-soft-wrap
Sep 18, 2026
Merged

dstrodtman merged 3 commits into
masterfrom
doc-1528-rllib-soft-wrap

Conversation

@dstrodtman

@dstrodtman dstrodtman commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

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

@dstrodtman
dstrodtman requested review from a team as code owners September 16, 2026 19:55

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request reformats multiple RLlib documentation files by consolidating multi-line paragraphs into single continuous lines. The review feedback identifies several minor typos, grammatical errors, and incorrect class references in the updated text, such as a trademark symbol typo in a Sphinx reference (~®ay.rllib), incorrect casing of OfflinePreLearner, and phrasing issues like 'This features is' and 'All the of them'. Addressing these documentation errors will ensure the guides remain accurate and professional.

#### Pipeline level
On this level of RLlib's Offline RL API you can redefine your complete pipeline from data reading to batch iteration by overriding the {py:class}`~®ay.rllib.offline.offline_data.OfflineData` class. In most cases however the other two levels should be sufficient for your requirements. Manipulating the complete pipeline needs sensible handling because it could degrade performance of your
pipeline to a high degree. Study carefully the {py:class}`~ray.rllib.offline.offline_data.OfflineData` class to reach a good understanding of how the default pipeline works before going over to program your own one. There are mainly two methods that define this pipeline:
On this level of RLlib's Offline RL API you can redefine your complete pipeline from data reading to batch iteration by overriding the {py:class}`~®ay.rllib.offline.offline_data.OfflineData` class. In most cases however the other two levels should be sufficient for your requirements. Manipulating the complete pipeline needs sensible handling because it could degrade performance of your pipeline to a high degree. Study carefully the {py:class}`~ray.rllib.offline.offline_data.OfflineData` class to reach a good understanding of how the default pipeline works before going over to program your own one. There are mainly two methods that define this pipeline:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There is a typo in the Sphinx class reference: ~®ay.rllib uses the registered trademark symbol ® instead of the letter r. This will cause the documentation link to render incorrectly or break. It should be corrected to ~ray.rllib.

Implementing an autoscaled actor pool in the **Post-Processing (Pre-Learner)** layer doesn't guarantee you the elimination of backpressure. Adding more {py:class}`~ray.rllib.offline.offline_prelearner.OffLinePreLearner` instances introduces additional overhead to the system. RLlib's offline RL pipeline is
optimized for streaming data, which typically exhibits stable throughput and resource usage, except in cases of imbalances between upstream and downstream tasks. As a rule of thumb, consider using autoscaling only under the following conditions: (1) throughput is expected to be highly variable, (2) Cluster resources
are subject to fluctuations (for example, in shared or dynamic environments), and/or (3) workload characteristics are highly unpredictable.
Implementing an autoscaled actor pool in the **Post-Processing (Pre-Learner)** layer doesn't guarantee you the elimination of backpressure. Adding more {py:class}`~ray.rllib.offline.offline_prelearner.OffLinePreLearner` instances introduces additional overhead to the system. RLlib's offline RL pipeline is optimized for streaming data, which typically exhibits stable throughput and resource usage, except in cases of imbalances between upstream and downstream tasks. As a rule of thumb, consider using autoscaling only under the following conditions: (1) throughput is expected to be highly variable, (2) Cluster resources are subject to fluctuations (for example, in shared or dynamic environments), and/or (3) workload characteristics are highly unpredictable.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The class name OffLinePreLearner has incorrect casing (capital 'L' in 'OffLine'). It should be OfflinePreLearner to match the actual class name and other references in the documentation. Also, "guarantee you the elimination of" can be simplified to "guarantee the elimination of".

#### Allocated resources
Other than the number of post-processing actors you can tune performance on the **Post-Processing (PreLearner)** layer through defining resources to be allocated to each {py:class}`~ray.rllib.offline.offline_prelearner.OffLinePreLearner` in the actor pool. Such resources can be defined either through `num_cpus` and `num_gpus`
or in the `ray_remote_args`.
Other than the number of post-processing actors you can tune performance on the **Post-Processing (PreLearner)** layer through defining resources to be allocated to each {py:class}`~ray.rllib.offline.offline_prelearner.OffLinePreLearner` in the actor pool. Such resources can be defined either through `num_cpus` and `num_gpus` or in the `ray_remote_args`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The class name OffLinePreLearner has incorrect casing (capital 'L' in 'OffLine'). It should be OfflinePreLearner to match the actual class name.

:::{note}
RLlib formats The stored episode data as `binary`. Each episode is converted into its dictionary representation and serialized using `msgpack-numpy`,
ensuring version compatibility.
RLlib formats The stored episode data as `binary`. Each episode is converted into its dictionary representation and serialized using `msgpack-numpy`, ensuring version compatibility.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There is an incorrect capitalization of "The" in the middle of the sentence ("RLlib formats The stored..."). It should be lowercase "the".


This features is in alpha. If you migrate to this algorithm, enable the feature by
via `AlgorithmConfig.api_stack(enable_rl_module_and_learner=True, enable_env_runner_and_connector_v2=True)`.
This features is in alpha. If you migrate to this algorithm, enable the feature by via `AlgorithmConfig.api_stack(enable_rl_module_and_learner=True, enable_env_runner_and_connector_v2=True)`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There are two grammatical issues in this sentence: "This features is" should be "This feature is", and "enable the feature by via" contains a redundant preposition ("by via") and should be simplified to "enable the feature via".

Have a look at the {py:class}`~ray.rllib.utils.replay_buffers.multi_agent_replay_buffer.MultiAgentReplayBuffer` to get a sense of how it extends our base class.
You can find buffer types and arguments to modify their behaviour as part of RLlib's default parameters. They are part of
the `replay_buffer_config`.
RLlib comes with a set of extendable replay buffers built in. All the of them support the two basic methods `add()` and `sample()`. We provide a base {py:class}`~ray.rllib.utils.replay_buffers.replay_buffer.ReplayBuffer` class from which you can build your own buffer. In most algorithms, we require {py:class}`~ray.rllib.utils.replay_buffers.multi_agent_replay_buffer.MultiAgentReplayBuffer`s. This is because we want them to generalize to the multi-agent case. Therefore, these buffer's `add()` and `sample()` methods require a `policy_id` to handle experiences per policy. Have a look at the {py:class}`~ray.rllib.utils.replay_buffers.multi_agent_replay_buffer.MultiAgentReplayBuffer` to get a sense of how it extends our base class. You can find buffer types and arguments to modify their behaviour as part of RLlib's default parameters. They are part of the `replay_buffer_config`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

"All the of them" is grammatically incorrect. It should be corrected to "All of them".

In python, a simple buffer can be implemented by a list to which elements are added and later sampled from.
Such buffers are used mostly in off-policy learning algorithms. This makes sense intuitively because these algorithms can learn from
experiences that are stored in the buffer, but where produced by a previous version of the policy (or even a completely different "behavior policy").
When we talk about replay buffers in reinforcement learning, we generally mean a buffer that stores and replays experiences collected from interactions of our agent(s) with the environment. In python, a simple buffer can be implemented by a list to which elements are added and later sampled from. Such buffers are used mostly in off-policy learning algorithms. This makes sense intuitively because these algorithms can learn from experiences that are stored in the buffer, but where produced by a previous version of the policy (or even a completely different "behavior policy").

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There is a typo in this sentence: "where produced" should be "were produced".

Suggested change
When we talk about replay buffers in reinforcement learning, we generally mean a buffer that stores and replays experiences collected from interactions of our agent(s) with the environment. In python, a simple buffer can be implemented by a list to which elements are added and later sampled from. Such buffers are used mostly in off-policy learning algorithms. This makes sense intuitively because these algorithms can learn from experiences that are stored in the buffer, but where produced by a previous version of the policy (or even a completely different "behavior policy").
When we talk about replay buffers in reinforcement learning, we generally mean a buffer that stores and replays experiences collected from interactions of our agent(s) with the environment. In python, a simple buffer can be implemented by a list to which elements are added and later sampled from. Such buffers are used mostly in off-policy learning algorithms. This makes sense intuitively because these algorithms can learn from experiences that are stored in the buffer, but were produced by a previous version of the policy (or even a completely different "behavior policy").

RLlib assigns these actors a global name. You can retrieve handles to them using
these names. As an example, consider maintaining a shared global counter that's
environments increment and read periodically from the driver program:
Sometimes, you need to coordinate between pieces of code that live in different processes managed by RLlib. For example, it can be useful to maintain a global average of a certain variable, or centrally control a hyperparameter that policies use. Ray provides a general way to achieve this coordination through *named actors*. See {ref}`Ray actors <actor-guide>` to learn more. RLlib assigns these actors a global name. You can retrieve handles to them using these names. As an example, consider maintaining a shared global counter that's environments increment and read periodically from the driver program:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There is a grammatical error in this sentence: "that's environments increment" should be "that environments increment".

`evaluation_duration` setting isn't divisible by the number of evaluation workers, RLlib runs the remainder of episodes
on the first n evaluation EnvRunners and leave the remaining workers idle for that time.
You can configure evaluation workers with `evaluation_num_env_runners`.
Note that when using `evaluation_duration_unit=timesteps` and the `evaluation_duration` setting isn't divisible by the number of evaluation workers, RLlib rounds up the number of time-steps specified to the nearest whole number of time-steps that's divisible by the number of evaluation workers. Also, when using `evaluation_duration_unit=episodes` and the `evaluation_duration` setting isn't divisible by the number of evaluation workers, RLlib runs the remainder of episodes on the first n evaluation EnvRunners and leave the remaining workers idle for that time. You can configure evaluation workers with `evaluation_num_env_runners`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There is a grammatical error in this sentence: "and leave the remaining workers" should be "and leaves the remaining workers" to agree with the singular subject "RLlib".

@dstrodtman
dstrodtman force-pushed the doc-1528-rllib-soft-wrap branch from 89a188b to 40fba7c Compare September 16, 2026 20:41
@dstrodtman dstrodtman changed the title [rllib] Soft-wrap the converted batch-8 RLlib doc pages [rllib] Soft-wrap all converted RLlib doc pages Sep 16, 2026
@ray-gardener ray-gardener Bot added rllib RLlib related issues docs An issue or change related to documentation labels Sep 17, 2026
dstrodtman added a commit that referenced this pull request Sep 17, 2026
…#66216)

## Why

RLlib's user-guide pages are moving from reStructuredText to MyST
Markdown, the standard for new Ray docs. This converts the next two
non-prefixed pages — the RLlib landing page (`index`) and the RL Modules
guide (`rl-modules`) — and takes the opportunity to decouple the RLlib
package README from the doc source.

This stacks on the conversion layer (#66062). Its files are disjoint
from the pages converted there, and these two pages carry no `rllib-`
filename prefix, so unlike that stack there's no rename layer beneath
this — the URLs don't change.

## What

Format-only conversion. Rendered HTML is preserved, so published URLs
and page content stay the same (Sphinx maps `.rst` and `.md` to the same
`.html`). No rewording, no restructuring, no heading-level changes.
Source line-wrapping is preserved verbatim so the diff stays
line-aligned with the `.rst`; the soft-wrap reflow is deferred to a
later layer, matching #66062 / #66214.

- **`doc/source/rllib/index.rst` → `index.md`** and
**`doc/source/rllib/rl-modules.rst` → `rl-modules.md`**.
- **`rllib/README.rst` → `rllib/README.md`**, rewritten as
self-contained GitHub-flavored Markdown (details below).
- One sibling-link fix in `doc/source/ray-overview/getting-started.md`
(`[RLlib](../rllib/index.rst)` → `{doc}`).

### Construct notes for review

- **Sigil substitution tables (`index`).** The two collapsible previews
(Algorithms and Environments) were RST grid tables driven by
`|single_agent|`-style image substitutions. The `substitution` MyST
extension is off, and wrapping a substitution in `{eval-rst}` doesn't
rescue it (docutils raises `Undefined substitution referenced`). Since
`html_image` is on, each becomes a `{list-table}` with inline `<img>`
cells — the same pattern `algorithms.md` already uses. Two consequences
worth a look:
- Section rows (**On-Policy**, **Off-Policy**, …) render as bold labels
rather than full-width bands, because MyST list-tables can't span
columns.
- The Environments table keeps its per-row `bash`/`python` snippets as
fenced code inside the list-table cells.
- **README decoupling.** `rllib/README.rst` used `.. include::` to
splice three marker-delimited sections out of `index.rst`. That file
isn't in the Sphinx build, and `python/setup.py`'s `long_description`
uses the repo-root `README.rst`, not this one — and GitHub doesn't
execute RST includes — so the includes rendered nothing anywhere. The
new `README.md` carries the tagline, install, a quickstart, a docs link,
and the citations directly. The now-defunct `sphinx_rllib_readme_*`
markers are dropped from `index.md`.
- **Shared include dropped.** The `.. include::
/_includes/rllib/new_api_stack.rst` line is dropped from both pages.
That partial is all-comment and renders nothing under RST; a MyST
`{include}` of an `.rst` partial would surface its raw text instead.
- **Executed doctest.** `{testcode}` counts match the originals (3 in
`index`, 16 in `rl-modules`). The `doctest[rllib]` target globs `*.md`
and neither file is individually excluded, so coverage carries over with
no `doc/BUILD.bazel` change. These blocks already executed as `.rst` on
master.
- **`literalinclude` paths preserved byte-for-byte** — the
`../../../rllib/...` code-tree includes in `rl-modules`. If the RLlib
source-tree move lands while this is open, coordinate merge order on
`rl-modules.md`.
- **`rl-modules`** keeps a large author `.. TODO:` comment (the
parametric-actions section) verbatim inside an HTML comment — it renders
nothing, as before.

## Links repointed (called out)

- `index`: `env.html#multi-agent-and-hierarchical` was a moved anchor;
it now targets the Multi-Agent Environments page (`{ref}` to
`rllib-multi-agent-environments-doc`), the same target `env.md` uses.
`env.html#configuring-environments` → `{ref}` to the live label on
`env.md`.
- `ray-overview/getting-started.md`: the sibling
`[RLlib](../rllib/index.rst)` link → `{doc}` so it survives the rename.

## Verification

- Static checks pass on both new pages: fenced and colon fences balance,
no residual RST outside fences, every label preserved,
executed-directive counts match, no conversion-agent scaffolding leaked.
- **The decisive check is the Read the Docs preview**
(`fail_on_warning`) and the render diff against `/en/master`; I'll
confirm both on this PR's preview build and post any surviving,
explainable diffs. The list-table-with-`<img>` previews and the
code-in-cell Environments table are the constructs to watch there.

🤖 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]>
@dstrodtman
dstrodtman force-pushed the doc-1528-rllib-soft-wrap branch from 40fba7c to fe9f985 Compare September 17, 2026 14:10

@pseudo-rnd-thoughts pseudo-rnd-thoughts left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stamp

dstrodtman added a commit that referenced this pull request Sep 18, 2026
…#66216)

RLlib's user-guide pages are moving from reStructuredText to MyST
Markdown, the standard for new Ray docs. This converts the next two
non-prefixed pages — the RLlib landing page (`index`) and the RL Modules
guide (`rl-modules`) — and takes the opportunity to decouple the RLlib
package README from the doc source.

This stacks on the conversion layer (#66062). Its files are disjoint
from the pages converted there, and these two pages carry no `rllib-`
filename prefix, so unlike that stack there's no rename layer beneath
this — the URLs don't change.

Format-only conversion. Rendered HTML is preserved, so published URLs
and page content stay the same (Sphinx maps `.rst` and `.md` to the same
`.html`). No rewording, no restructuring, no heading-level changes.
Source line-wrapping is preserved verbatim so the diff stays
line-aligned with the `.rst`; the soft-wrap reflow is deferred to a
later layer, matching #66062 / #66214.

- **`doc/source/rllib/index.rst` → `index.md`** and
**`doc/source/rllib/rl-modules.rst` → `rl-modules.md`**.
- **`rllib/README.rst` → `rllib/README.md`**, rewritten as
self-contained GitHub-flavored Markdown (details below).
- One sibling-link fix in `doc/source/ray-overview/getting-started.md`
(`[RLlib](../rllib/index.rst)` → `{doc}`).

- **Sigil substitution tables (`index`).** The two collapsible previews
(Algorithms and Environments) were RST grid tables driven by
`|single_agent|`-style image substitutions. The `substitution` MyST
extension is off, and wrapping a substitution in `{eval-rst}` doesn't
rescue it (docutils raises `Undefined substitution referenced`). Since
`html_image` is on, each becomes a `{list-table}` with inline `<img>`
cells — the same pattern `algorithms.md` already uses. Two consequences
worth a look:
- Section rows (**On-Policy**, **Off-Policy**, …) render as bold labels
rather than full-width bands, because MyST list-tables can't span
columns.
- The Environments table keeps its per-row `bash`/`python` snippets as
fenced code inside the list-table cells.
- **README decoupling.** `rllib/README.rst` used `.. include::` to
splice three marker-delimited sections out of `index.rst`. That file
isn't in the Sphinx build, and `python/setup.py`'s `long_description`
uses the repo-root `README.rst`, not this one — and GitHub doesn't
execute RST includes — so the includes rendered nothing anywhere. The
new `README.md` carries the tagline, install, a quickstart, a docs link,
and the citations directly. The now-defunct `sphinx_rllib_readme_*`
markers are dropped from `index.md`.
- **Shared include dropped.** The `.. include::
/_includes/rllib/new_api_stack.rst` line is dropped from both pages.
That partial is all-comment and renders nothing under RST; a MyST
`{include}` of an `.rst` partial would surface its raw text instead.
- **Executed doctest.** `{testcode}` counts match the originals (3 in
`index`, 16 in `rl-modules`). The `doctest[rllib]` target globs `*.md`
and neither file is individually excluded, so coverage carries over with
no `doc/BUILD.bazel` change. These blocks already executed as `.rst` on
master.
- **`literalinclude` paths preserved byte-for-byte** — the
`../../../rllib/...` code-tree includes in `rl-modules`. If the RLlib
source-tree move lands while this is open, coordinate merge order on
`rl-modules.md`.
- **`rl-modules`** keeps a large author `.. TODO:` comment (the
parametric-actions section) verbatim inside an HTML comment — it renders
nothing, as before.

- `index`: `env.html#multi-agent-and-hierarchical` was a moved anchor;
it now targets the Multi-Agent Environments page (`{ref}` to
`rllib-multi-agent-environments-doc`), the same target `env.md` uses.
`env.html#configuring-environments` → `{ref}` to the live label on
`env.md`.
- `ray-overview/getting-started.md`: the sibling
`[RLlib](../rllib/index.rst)` link → `{doc}` so it survives the rename.

- Static checks pass on both new pages: fenced and colon fences balance,
no residual RST outside fences, every label preserved,
executed-directive counts match, no conversion-agent scaffolding leaked.
- **The decisive check is the Read the Docs preview**
(`fail_on_warning`) and the render diff against `/en/master`; I'll
confirm both on this PR's preview build and post any surviving,
explainable diffs. The list-table-with-`<img>` previews and the
code-in-cell Environments table are the constructs to watch there.

🤖 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]>
@dstrodtman
dstrodtman force-pushed the doc-1528-rllib-myst-convert branch from 8599a87 to e91f7f1 Compare September 18, 2026 15:05
@dstrodtman
dstrodtman requested review from a team as code owners September 18, 2026 15:05
dstrodtman added a commit that referenced this pull request Sep 18, 2026
…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]>
Base automatically changed from doc-1528-rllib-myst-convert to master September 18, 2026 15:23
dstrodtman and others added 3 commits September 18, 2026 11:28
Whitespace-only reflow of the 10 MyST pages converted in the parent branch to one line per paragraph and list item. No word, code, directive, table, or front-matter changes. Verified content-invariant, render-equal, and idempotent by the ray-soft-wrap verify.py gate across all 10 files.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
Reflow the converted guide pages to the one-sentence-per-line
convention, matching the batch-8 reflow. Whitespace-only; rendered
HTML is unchanged.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman
dstrodtman force-pushed the doc-1528-rllib-soft-wrap branch from fe9f985 to b655e4d Compare September 18, 2026 15:29
@dstrodtman
dstrodtman enabled auto-merge (squash) September 18, 2026 15:31
@github-actions github-actions Bot added the go add ONLY when ready to merge, run all tests label Sep 18, 2026
@dstrodtman
dstrodtman merged commit 77c68c7 into master Sep 18, 2026
6 of 8 checks passed
@dstrodtman
dstrodtman deleted the doc-1528-rllib-soft-wrap branch September 18, 2026 15:38
dstrodtman added a commit that referenced this pull request Sep 18, 2026
…ing-style guide (#66239)

## Summary

Two things across the converted RLlib documentation pages under
`doc/source/rllib/`: a prose/style pass against the [Ray writing-style
guide](https://docs.ray.io/en/latest/ray-contribute/writing-style.html),
and a set of technical corrections surfaced during that pass and by
RLlib-maintainer review. This is the style-pass layer of the RLlib IA
pilot stack, sitting on top of the soft-wrap PR (#66214) and the
Vale-rules PR (#66236), whose warn-first rules this pass uses as its
deterministic net.

Opening as a **draft** for review. All 26 pages have had the pass; the
stack still needs a rebase as the lower PRs merge.

## How the style pass runs

A deterministic-first pipeline, so the model never spends effort on what
a linter catches:

- **Layer 0 (deterministic, no model):** `codespell` for typos, then the
shared `Ray/` and `RLlib/` Vale term swaps applied to prose only (code,
inline code, MyST roles, anchors, and URLs are shielded). Two semantic
false positives were caught by hand: `refer to → see` is correct for a
reference but wrong for the "pertain to" sense, and a `N(ot)` math token
inside inline code isn't a typo.
- **Comprehensive pass (per page):** active voice, second person,
present tense, no first-person plural, filler cut, "such as" not "like",
hedges turned into direct advice, parentheticals and long sentences
restructured, headings to sentence case. Meaning is held invariant;
code, role targets, and anchors are never touched, and soft-wrap is
preserved.
- **Cleanup pass (per page):** list punctuation, parentheticals, and the
prose inside figure captions, admonition bodies, and `list-table` cells
— the seam the comprehensive pass misses.

Every prose edit is verified against the `git diff`, not the editor's
self-report: code-fence counts, `{ref}`/`{py:*}` role targets,
`(label)=` anchors, and URLs are diffed to confirm they didn't move.

## Technical corrections (from maintainer review and code introspection)

The prose pass is meaning-preserving by design, but reviewing it
surfaced pre-existing technical errors in the docs. These are **not**
style edits, and each one is validated against the RLlib source rather
than guessed:

- **Broken cross-references and copy-paste errors:** dead
`{py:class}`/`{ref}` targets (for example a Unicode `®ay`,
`OffLinePreLearner`, `default_model_cnofig`), a SAC diagram captioned
"DQN", a DeepMind Control Suite figure captioned "Atari 100k tasks", and
an OpenSpiel section that pointed at the `PettingZooEnv` wrapper. Each
corrected form was confirmed against the source tree before applying.
- **`external-envs.md` RLlink protocol section, rewritten:** the
published section described message bodies that don't exist in the code.
@pseudo-rnd-thoughts flagged the section as materially wrong during
review; the rewrite is validated through direct discussion with him and
by introspecting the implementation (`rllib/env/external/rllink.py`,
`env_runner_server_for_external_inference.py`, and the reference
client). It corrects the wire format (msgpack, with a body-length
header), the `SET_STATE` body (`rl_module` state plus `weights_seq_no`,
not an `onnx_file`/`mlir_file`), the `SET_CONFIG` body (a pickled
`AlgorithmConfig`, not `env_steps_per_sample`/`force_on_policy`), and
the `EPISODES_AND_GET_STATE` body (`SingleAgentEpisode.get_state()`
dicts plus `timesteps`), and documents the previously omitted `EPISODES`
and `GET_STATE` message types.

External-environment support is an early, still-changing area of RLlib.
This PR corrects the docs to match the current implementation and keeps
the section's "early draft" note; deeper protocol tech debt is expected
to be follow-up work for eng.

The three open questions the review raised (a Ray 2.52/2.53 version
mismatch, a TensorFlow-support contradiction, and the RLlink framing)
were answered by the maintainer and are resolved in the commits above.

## Scope and status

All 26 soft-wrapped RLlib pages are in scope for the prose pass; the
technical corrections touch the subset where review found errors. Vale
enforcement (widening the hook and CI paths) stays deferred to #66236's
plan.

🤖 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]>
dstrodtman added a commit that referenced this pull request Sep 18, 2026
#66214 soft-wrapped the converted RLlib doc pages to one sentence per
line. That reflow is whitespace-only but rewrites every line, so `git
blame` on those pages now attributes every line to the reflow commit
instead of the real authorship underneath.

This adds that squash commit to `.git-blame-ignore-revs`, the same
mechanism the repo already uses for the Black reformat commit. `git
blame --ignore-revs-file .git-blame-ignore-revs` and GitHub's blame UI
then skip the reflow and surface the underlying edits.

The grammar and style pass (#66239) is deliberately left out of this
file: those are real edits that should stay attributable.

Signed-off-by: Douglas Strodtman <[email protected]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…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]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
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]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…ing-style guide (ray-project#66239)

## Summary

Two things across the converted RLlib documentation pages under
`doc/source/rllib/`: a prose/style pass against the [Ray writing-style
guide](https://docs.ray.io/en/latest/ray-contribute/writing-style.html),
and a set of technical corrections surfaced during that pass and by
RLlib-maintainer review. This is the style-pass layer of the RLlib IA
pilot stack, sitting on top of the soft-wrap PR (ray-project#66214) and the
Vale-rules PR (ray-project#66236), whose warn-first rules this pass uses as its
deterministic net.

Opening as a **draft** for review. All 26 pages have had the pass; the
stack still needs a rebase as the lower PRs merge.

## How the style pass runs

A deterministic-first pipeline, so the model never spends effort on what
a linter catches:

- **Layer 0 (deterministic, no model):** `codespell` for typos, then the
shared `Ray/` and `RLlib/` Vale term swaps applied to prose only (code,
inline code, MyST roles, anchors, and URLs are shielded). Two semantic
false positives were caught by hand: `refer to → see` is correct for a
reference but wrong for the "pertain to" sense, and a `N(ot)` math token
inside inline code isn't a typo.
- **Comprehensive pass (per page):** active voice, second person,
present tense, no first-person plural, filler cut, "such as" not "like",
hedges turned into direct advice, parentheticals and long sentences
restructured, headings to sentence case. Meaning is held invariant;
code, role targets, and anchors are never touched, and soft-wrap is
preserved.
- **Cleanup pass (per page):** list punctuation, parentheticals, and the
prose inside figure captions, admonition bodies, and `list-table` cells
— the seam the comprehensive pass misses.

Every prose edit is verified against the `git diff`, not the editor's
self-report: code-fence counts, `{ref}`/`{py:*}` role targets,
`(label)=` anchors, and URLs are diffed to confirm they didn't move.

## Technical corrections (from maintainer review and code introspection)

The prose pass is meaning-preserving by design, but reviewing it
surfaced pre-existing technical errors in the docs. These are **not**
style edits, and each one is validated against the RLlib source rather
than guessed:

- **Broken cross-references and copy-paste errors:** dead
`{py:class}`/`{ref}` targets (for example a Unicode `®ay`,
`OffLinePreLearner`, `default_model_cnofig`), a SAC diagram captioned
"DQN", a DeepMind Control Suite figure captioned "Atari 100k tasks", and
an OpenSpiel section that pointed at the `PettingZooEnv` wrapper. Each
corrected form was confirmed against the source tree before applying.
- **`external-envs.md` RLlink protocol section, rewritten:** the
published section described message bodies that don't exist in the code.
@pseudo-rnd-thoughts flagged the section as materially wrong during
review; the rewrite is validated through direct discussion with him and
by introspecting the implementation (`rllib/env/external/rllink.py`,
`env_runner_server_for_external_inference.py`, and the reference
client). It corrects the wire format (msgpack, with a body-length
header), the `SET_STATE` body (`rl_module` state plus `weights_seq_no`,
not an `onnx_file`/`mlir_file`), the `SET_CONFIG` body (a pickled
`AlgorithmConfig`, not `env_steps_per_sample`/`force_on_policy`), and
the `EPISODES_AND_GET_STATE` body (`SingleAgentEpisode.get_state()`
dicts plus `timesteps`), and documents the previously omitted `EPISODES`
and `GET_STATE` message types.

External-environment support is an early, still-changing area of RLlib.
This PR corrects the docs to match the current implementation and keeps
the section's "early draft" note; deeper protocol tech debt is expected
to be follow-up work for eng.

The three open questions the review raised (a Ray 2.52/2.53 version
mismatch, a TensorFlow-support contradiction, and the RLlink framing)
were answered by the maintainer and are resolved in the commits above.

## Scope and status

All 26 soft-wrapped RLlib pages are in scope for the prose pass; the
technical corrections touch the subset where review found errors. Vale
enforcement (widening the hook and CI paths) stays deferred to ray-project#66236's
plan.

🤖 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]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…ect#66285)

ray-project#66214 soft-wrapped the converted RLlib doc pages to one sentence per
line. That reflow is whitespace-only but rewrites every line, so `git
blame` on those pages now attributes every line to the reflow commit
instead of the real authorship underneath.

This adds that squash commit to `.git-blame-ignore-revs`, the same
mechanism the repo already uses for the Black reformat commit. `git
blame --ignore-revs-file .git-blame-ignore-revs` and GitHub's blame UI
then skip the reflow and surface the underlying edits.

The grammar and style pass (ray-project#66239) is deliberately left out of this
file: those are real edits that should stay attributable.

Signed-off-by: Douglas Strodtman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs An issue or change related to documentation go add ONLY when ready to merge, run all tests rllib RLlib related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants