Skip to content

[rllib] Drop the rllib- filename prefix from the RLlib doc pages - #66060

Merged
dstrodtman merged 2 commits into
masterfrom
doc-853-rllib-ia-pilot
Sep 18, 2026
Merged

dstrodtman merged 2 commits into
masterfrom
doc-853-rllib-ia-pilot

Conversation

@dstrodtman

Copy link
Copy Markdown
Contributor

What this does

Drops the redundant rllib- prefix from the 10 rllib-*.rst user-guide pages under doc/source/rllib/. The directory already namespaces them, so rllib/rllib-env.rst becomes rllib/env.rst, and so on.

This is a pure path change. Git detects all 10 as renames, and no page content changes beyond the inbound cross-references that have to move with the files.

Changes

  • Rename 10 files: advanced-api, algorithms, callback, dev, env, examples, fault-tolerance, learner, offline, replay-buffers.
  • Update path-based inbound references only: the index.rst and user-guides.rst toctrees, and the :doc:/.html links in env.rst, examples.rst, rl-modules.rst, index.rst, and the ray-overview use-cases page. Section anchors on the links are preserved. :ref: label targets are filename-independent, so they're deliberately left unchanged.
  • doc/redirects/current.yaml: add a page rule mapping each old /rllib/rllib-<name>.html to its new /rllib/<name>.html, placed before the existing /rllib/rllib-* catch-all so the specific rule wins, and repoint the six existing redirects that terminated at the old paths. rtd-redirects validate passes with 0 errors.

URL impact

Published URLs change from /rllib/rllib-<name>.html to /rllib/<name>.html. The added redirects 301 the old URLs to the new pages.

Deliberately out of scope

.html links to these pages that live in the rllib/ source tree (algorithm docstrings, READMEs, examples) are left untouched. The new redirects keep them resolving, and those files are part of the separate source-tree move, so rewriting them here would collide with that work. They can be cleaned up alongside or after the move.

Reviewing

Confirm GitHub shows the 10 files as renamed, not delete-plus-add, and that the RtD preview builds and diffs empty against /en/master for the renamed pages. This is the first of a short series of focused PRs on these pages (rename, then MyST conversion, then a soft-wrap and prose pass); each is kept separate so history stays clean and each diff is reviewable on its own.

🤖 Generated with Claude Code

Rename the 10 rllib-*.rst pages under doc/source/rllib/ to drop the
redundant rllib- prefix; the directory already namespaces them. This is a
pure path change: git detects all 10 as renames, and no page content
changes beyond updating inbound cross-references.

- Rename the 10 files: advanced-api, algorithms, callback, dev, env,
  examples, fault-tolerance, learner, offline, replay-buffers.
- Update path-based inbound references: the index.rst and user-guides.rst
  toctrees, and the :doc:/.html links in env.rst, examples.rst,
  rl-modules.rst, index.rst, and the ray-overview use-cases page. :ref:
  label targets are filename-independent, so they are left unchanged.
- Add doc/redirects/current.yaml page rules mapping each old
  /rllib/rllib-<name>.html to its new /rllib/<name>.html, placed before
  the /rllib/rllib-* catch-all so they resolve to the real page, and
  repoint the six existing redirects that terminated at the old paths.

The published URLs change from /rllib/rllib-<name>.html to
/rllib/<name>.html; the redirects 301 the old URLs. .html links to these
pages that live in the rllib/ source tree are covered by the new
redirects and are intentionally left for a later cleanup coordinated with
the source-tree move, to keep this change out of those files.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman
dstrodtman requested review from a team as code owners September 10, 2026 18:22

@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 simplifies the RLlib documentation file structure by removing the redundant 'rllib-' prefix from several documentation filenames (such as renaming 'rllib-env' to 'env' and 'rllib-algorithms' to 'algorithms'). It updates all internal references, table of contents directives, and links across the documentation to point to the new paths, while adding corresponding redirect rules in doc/redirects/current.yaml to maintain backward compatibility. There are no review comments, and I have no additional feedback to provide.

@ray-gardener ray-gardener Bot added rllib RLlib related issues docs An issue or change related to documentation labels Sep 10, 2026
The RtD preview flagged two rename fallout items:

- Four .. button-ref:: directives in user-guides.rst targeted the bare
  old doc names (rllib-callback, rllib-offline, rllib-replay-buffers,
  rllib-dev), which dangled once the pages were renamed. Point them at
  the new names. The sibling cards that target -doc/-docs labels are
  filename-independent and were already correct.
- The 'RLlib Multi-Agent' grid-table row in index.rst became malformed:
  shortening the rllib-env.html link to env.html narrowed the cell and
  pulled its closing border out of alignment. Repad the row to the
  table width.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman dstrodtman added the go add ONLY when ready to merge, run all tests label Sep 10, 2026
@dstrodtman
dstrodtman merged commit 967aa19 into master Sep 18, 2026
7 checks passed
@dstrodtman
dstrodtman deleted the doc-853-rllib-ia-pilot branch September 18, 2026 14:55
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]>
dstrodtman added a commit that referenced this pull request Sep 30, 2026
#66060 repointed six root-level rules, such as /rllib-env.html, from
/rllib/rllib-*.html to the renamed /rllib/*.html pages. Those pages exist
only on master, so the redirects now land on 404s on /en/latest/ and every
older release. Point them back at /rllib/rllib-*.html, which exists on
every published version, and let the /rllib/rllib-*.html rules that #66060
added carry master readers to the renamed pages in a second hop.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
dstrodtman added a commit that referenced this pull request Oct 1, 2026
…redirect targets (#66606)

## Why are these changes needed?

`doc/redirects/README.md` explains how to add a redirect. It doesn't
explain how a rule behaves across docs versions, or what to do when
pages that existing rules point at move. Directory moves such as #66605
need that guidance. The obvious approach, repointing existing rules at
the new path, breaks older releases.

The behavior that matters: Read the Docs redirects default to `force:
false`, so a rule fires only where the requested URL would otherwise
return 404. A `type: page` rule applies to every version and resolves
`to` within that version. So one version-less rule for a move does the
right thing everywhere:

- It's inert on `/en/latest/` and older releases, where the old path
still exists.
- It fires on `/en/master/` as soon as the move merges.
- It starts firing on `/en/latest/` when the release that ships the move
goes out, with no release-day edit.

Source: the "Robust fan-out" section of the [rtd-redirects
README](https://github.com/anyscale/rtd-redirects#robust-fan-out-page--force-false--splat).

This PR adds two README sections:

- **How redirects apply across versions**: the 404-only default,
per-version resolution, and when `force: true` is appropriate.
- **Moving or renaming pages**:
  - Add a wildcard `page` rule for the old path.
- Don't repoint existing rules whose `to` points under the moved path.
Older releases still serve the old path, and on newer versions the
request lands on the moved page in a second hop.
- Move the `from` of catch-alls under the old path, so they don't catch
moved pages first.
  - Expect chain warnings from the validator. They don't block CI.

It also fixes a live regression this pattern would have prevented.
#66060 repointed six root-level rules, such as `/rllib-env.html`, from
`/rllib/rllib-*.html` to the renamed `/rllib/*.html` pages. Those pages
exist only on master, so the redirects land on 404s on `/en/latest/` and
every older release. The second commit points them back at
`/rllib/rllib-*.html`, matching the file before #66060. The
`/rllib/rllib-*.html` rules that #66060 added then carry master readers
to the renamed pages in a second hop. A third commit fixes one older
instance of the same pattern: `/rllib-models.html` pointed at
`/rllib/rl-modules.html`, which exists only from 2.43.0 on. It now
points at `/rllib/rllib-models.html`.

It also adjusts step 1 of "Adding or changing a redirect", which said to
point `to` at the final destination. That still holds for new rules, and
the step now links to the move guidance for existing ones.

This replaces the approach in #66027, which staged release-gated rules
in a separate `master.yaml` and folded them into `current.yaml` on
release day. The 404-only default already gives that version gating, and
the fold step would repoint rules in a way that breaks older releases.
I'm closing #66027 in favor of this PR.

## Related PRs

- #66027: closed in favor of this PR.
- #66605: the first directory move that follows this pattern. It adds
`/ray-core/*` -> `/core/:splat`, keeps the 58 existing rules that point
at `/ray-core/...`, and moves the two catch-alls.
- Duplicate check: I searched open PRs for "redirects README" and
"redirect". The only matches are #66027 and #66605, and neither changes
this guidance.

## Testing

- `pre-commit run --files doc/redirects/README.md
doc/redirects/current.yaml`: passes.
- `rtd-redirects validate doc/redirects/current.yaml` with 0.2.0: exit
0, no errors. Warnings go from 44 to 58, all of them chain warnings from
the seven restored two-hop paths.
- For the six restored targets:
`/rllib/rllib-{env,examples,offline,dev,algorithms}.html` return 200 on
`/en/latest/`, `/en/releases-2.40.0/`, and `/en/releases-2.10.0/`. Each
has a `/rllib/rllib-*.html` rule that fires on master.
- Checked the CI claims against the anyscale-rtd-redirects 0.2.0 source
that CI pins. `validate` and `apply --strict` exit non-zero only on
error-level findings (`cli.py`), so chain warnings don't block either
step.
- Verified the 404-only behavior on the live project with the
`/rllib/rllib-env.html` -> `/rllib/env.html` rule that #66060 added
(`curl -sL` against docs.ray.io):
- `/en/master/rllib/rllib-env.html`: 1 hop to
`/en/master/rllib/env.html`, 200. The old page is gone on master, so the
rule fires.
- `/en/latest/rllib/rllib-env.html` and
`/en/releases-2.40.0/rllib/rllib-env.html`: 0 hops, 200. The old page
still exists there, so the rule doesn't fire.
- Verified the repointing failure on the live project, before this PR's
fix. #66060 also repointed six existing rules, such as
`/rllib-env.html`, from `/rllib/rllib-*.html` to the new names. Those
URLs now 404 on `/en/latest/`, `/en/releases-2.40.0/`, and
`/en/releases-2.10.0/`, because `/rllib/env.html` doesn't exist in those
versions. They resolve only on master. They resolve on every version
again once this PR merges and the postmerge apply step runs.

## AI assistance

This PR was prepared with AI assistance (Claude Code). It stays a draft
until I've reviewed every changed line.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
dstrodtman added a commit to anyscale/rtd-redirects that referenced this pull request Oct 1, 2026
…-1712]

validate checks a rule set in isolation, so a page-rename change can pass
it and still send readers to a landing page, a 404, or a loop. Whether a
force: false rule fires depends on which pages exist on each version, so
the answer needs page sets, not just rules.

- resolve.py: a request-time Resolver. First match by position, force:
  false only on a 404, page vs exact matching, :splat, fragments never
  matching, /<lang>/<version>/ targets switching page sets, and loop
  detection. Kept separate so the DOC-1697 coverage guard can share it.
- pages.py: page sets from a built HTML dir, objects.inv, sitemap.xml, a
  git tree of Sphinx sources (or WORKTREE), or a path list. Local or URL.
- simulate.py: test URLs from rule sources, prefixes, and explicit URLs;
  per-URL, per-version verdicts against the expected page via a rename map
  (YAML or git renames); hop budget; text and JSON reports.
- cli: simulate subcommand, exit 6 on any failure. Notes when the matrix
  has fewer than three versions or a version mixes a git tree with a build.
- diff_file: make compose_at_ref public for reuse.

Replayed against ray-project/ray#66060, it reports the six flattened
RLlib rules as regressions on latest, releases-2.40.0, and
releases-2.10.0, which ray-project/ray#66606 later restored. Against the
Ray Core move (ray-project/ray#66605) it reports no regressions or wrong
landings on master, latest, releases-2.40.0, or releases-2.20.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
dstrodtman added a commit to anyscale/rtd-redirects that referenced this pull request Oct 1, 2026
… [DOC-1713]

On a versioned project, leaving an existing rule pointed at a moved page
is the documented pattern: older versions still serve the old path, and
newer versions take a second hop. The structural tiers flagged exactly
those chains as warnings and told authors to flatten them, which is the
change that 404'd older releases in ray-project/ray#66060. On Ray's
current.yaml the 7 remaining warnings were the six rules #66606 restored
plus one more of the same shape.

A force: false rule fires only where A's target 404s, which varies by
version, so validate can't judge the chain. Those findings are now info
and point at simulate. A force: true rule fires even where A's target
exists, so the chain happens everywhere and stays a warning. Preempted
splats stay info. The fixed-page catch-all special case is subsumed and
removed.

Ray's current.yaml: 0 warning, 58 info. The Ray Core move
(ray-project/ray#66605): 0 warning, 151 info.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…-project#66060)

## What this does

Drops the redundant `rllib-` prefix from the 10 `rllib-*.rst` user-guide
pages under `doc/source/rllib/`. The directory already namespaces them,
so `rllib/rllib-env.rst` becomes `rllib/env.rst`, and so on.

This is a **pure path change**. Git detects all 10 as renames, and no
page content changes beyond the inbound cross-references that have to
move with the files.

## Changes

- Rename 10 files: `advanced-api`, `algorithms`, `callback`, `dev`,
`env`, `examples`, `fault-tolerance`, `learner`, `offline`,
`replay-buffers`.
- Update path-based inbound references only: the `index.rst` and
`user-guides.rst` toctrees, and the `:doc:`/`.html` links in `env.rst`,
`examples.rst`, `rl-modules.rst`, `index.rst`, and the `ray-overview`
use-cases page. Section anchors on the links are preserved. `:ref:`
label targets are filename-independent, so they're deliberately left
unchanged.
- `doc/redirects/current.yaml`: add a `page` rule mapping each old
`/rllib/rllib-<name>.html` to its new `/rllib/<name>.html`, placed
before the existing `/rllib/rllib-*` catch-all so the specific rule
wins, and repoint the six existing redirects that terminated at the old
paths. `rtd-redirects validate` passes with 0 errors.

## URL impact

Published URLs change from `/rllib/rllib-<name>.html` to
`/rllib/<name>.html`. The added redirects 301 the old URLs to the new
pages.

## Deliberately out of scope

`.html` links to these pages that live in the **`rllib/` source tree**
(algorithm docstrings, READMEs, examples) are left untouched. The new
redirects keep them resolving, and those files are part of the separate
source-tree move, so rewriting them here would collide with that work.
They can be cleaned up alongside or after the move.

## Reviewing

Confirm GitHub shows the 10 files as renamed, not delete-plus-add, and
that the RtD preview builds and diffs empty against `/en/master` for the
renamed pages. This is the first of a short series of focused PRs on
these pages (rename, then MyST conversion, then a soft-wrap and prose
pass); each is kept separate so history stays clean and each diff is
reviewable on its own.

🤖 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
…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
…redirect targets (ray-project#66606)

## Why are these changes needed?

`doc/redirects/README.md` explains how to add a redirect. It doesn't
explain how a rule behaves across docs versions, or what to do when
pages that existing rules point at move. Directory moves such as ray-project#66605
need that guidance. The obvious approach, repointing existing rules at
the new path, breaks older releases.

The behavior that matters: Read the Docs redirects default to `force:
false`, so a rule fires only where the requested URL would otherwise
return 404. A `type: page` rule applies to every version and resolves
`to` within that version. So one version-less rule for a move does the
right thing everywhere:

- It's inert on `/en/latest/` and older releases, where the old path
still exists.
- It fires on `/en/master/` as soon as the move merges.
- It starts firing on `/en/latest/` when the release that ships the move
goes out, with no release-day edit.

Source: the "Robust fan-out" section of the [rtd-redirects
README](https://github.com/anyscale/rtd-redirects#robust-fan-out-page--force-false--splat).

This PR adds two README sections:

- **How redirects apply across versions**: the 404-only default,
per-version resolution, and when `force: true` is appropriate.
- **Moving or renaming pages**:
  - Add a wildcard `page` rule for the old path.
- Don't repoint existing rules whose `to` points under the moved path.
Older releases still serve the old path, and on newer versions the
request lands on the moved page in a second hop.
- Move the `from` of catch-alls under the old path, so they don't catch
moved pages first.
  - Expect chain warnings from the validator. They don't block CI.

It also fixes a live regression this pattern would have prevented.
ray-project#66060 repointed six root-level rules, such as `/rllib-env.html`, from
`/rllib/rllib-*.html` to the renamed `/rllib/*.html` pages. Those pages
exist only on master, so the redirects land on 404s on `/en/latest/` and
every older release. The second commit points them back at
`/rllib/rllib-*.html`, matching the file before ray-project#66060. The
`/rllib/rllib-*.html` rules that ray-project#66060 added then carry master readers
to the renamed pages in a second hop. A third commit fixes one older
instance of the same pattern: `/rllib-models.html` pointed at
`/rllib/rl-modules.html`, which exists only from 2.43.0 on. It now
points at `/rllib/rllib-models.html`.

It also adjusts step 1 of "Adding or changing a redirect", which said to
point `to` at the final destination. That still holds for new rules, and
the step now links to the move guidance for existing ones.

This replaces the approach in ray-project#66027, which staged release-gated rules
in a separate `master.yaml` and folded them into `current.yaml` on
release day. The 404-only default already gives that version gating, and
the fold step would repoint rules in a way that breaks older releases.
I'm closing ray-project#66027 in favor of this PR.

## Related PRs

- ray-project#66027: closed in favor of this PR.
- ray-project#66605: the first directory move that follows this pattern. It adds
`/ray-core/*` -> `/core/:splat`, keeps the 58 existing rules that point
at `/ray-core/...`, and moves the two catch-alls.
- Duplicate check: I searched open PRs for "redirects README" and
"redirect". The only matches are ray-project#66027 and ray-project#66605, and neither changes
this guidance.

## Testing

- `pre-commit run --files doc/redirects/README.md
doc/redirects/current.yaml`: passes.
- `rtd-redirects validate doc/redirects/current.yaml` with 0.2.0: exit
0, no errors. Warnings go from 44 to 58, all of them chain warnings from
the seven restored two-hop paths.
- For the six restored targets:
`/rllib/rllib-{env,examples,offline,dev,algorithms}.html` return 200 on
`/en/latest/`, `/en/releases-2.40.0/`, and `/en/releases-2.10.0/`. Each
has a `/rllib/rllib-*.html` rule that fires on master.
- Checked the CI claims against the anyscale-rtd-redirects 0.2.0 source
that CI pins. `validate` and `apply --strict` exit non-zero only on
error-level findings (`cli.py`), so chain warnings don't block either
step.
- Verified the 404-only behavior on the live project with the
`/rllib/rllib-env.html` -> `/rllib/env.html` rule that ray-project#66060 added
(`curl -sL` against docs.ray.io):
- `/en/master/rllib/rllib-env.html`: 1 hop to
`/en/master/rllib/env.html`, 200. The old page is gone on master, so the
rule fires.
- `/en/latest/rllib/rllib-env.html` and
`/en/releases-2.40.0/rllib/rllib-env.html`: 0 hops, 200. The old page
still exists there, so the rule doesn't fire.
- Verified the repointing failure on the live project, before this PR's
fix. ray-project#66060 also repointed six existing rules, such as
`/rllib-env.html`, from `/rllib/rllib-*.html` to the new names. Those
URLs now 404 on `/en/latest/`, `/en/releases-2.40.0/`, and
`/en/releases-2.10.0/`, because `/rllib/env.html` doesn't exist in those
versions. They resolve only on master. They resolve on every version
again once this PR merges and the postmerge apply step runs.

## AI assistance

This PR was prepared with AI assistance (Claude Code). It stays a draft
until I've reviewed every changed line.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
dstrodtman added a commit that referenced this pull request Oct 23, 2026
## Description

RLlib's code links users to `https://docs.ray.io/en/master/...`, which
is built from Ray's development branch, not the version they have
installed. This PR points all 18 of those links in `python/ray/rllib/`
at `/en/latest/`, which tracks the most recent release.

The links are in three places:

- **Algorithm READMEs and docstrings** for APPO, CQL, DQN, PPO, and SAC
(15 links). They used the old top-level path `rllib-algorithms.html`,
which takes two 301 redirects to reach the current page
(`/rllib-algorithms.html` to `/rllib/rllib-algorithms.html` to
`/rllib/algorithms.html`). They now link to `rllib/algorithms.html`
directly. The anchors (`#appo`, `#cql`, `#dqn`, `#ppo`, `#sac`,
`#deep-q-networks-dqn-rainbow-parametric-dqn`) are unchanged, and I
confirmed each one exists on `/en/master/rllib/algorithms.html`.
- **The new-API-stack migration warnings** in `AlgorithmConfig` and
`SACConfig` (2 links). Users see these when they upgrade, so the link
should match released docs.
- **The RLlib README** link to the docs index (1 link).

Every replacement is the same length as the original, so no line
wrapping or formatting changed.

## Timing: the algorithms page reaches `/latest` with 2.60.0

`rllib/algorithms.html` comes from the filename rename in #66060, which
is on `releases/2.60.0` but not in 2.59.0, the current `/latest`. Until
2.60.0 publishes, `https://docs.ray.io/en/latest/rllib/algorithms.html`
returns 404, and the old name `/en/latest/rllib/rllib-algorithms.html`
still serves.

That only matters for someone reading these links on GitHub before
2.60.0 is out. This change isn't on `releases/2.60.0`, so the earliest
release that ships it is 2.61, by which point `/latest` serves the new
page. The other three targets (`rllib/index.html`,
`rllib/new-api-stack-migration-guide.html`, and
`rllib/checkpoints.html`) already return 200 on `/en/latest/`.

To avoid the GitHub-side gap entirely, hold the merge until 2.60.0
publishes.

## Related issues

None. This came out of a docs-team investigation into traffic on the
`master` RLlib docs. The links inside `doc/source/` are out of scope
here.

## Additional information

**Duplicate check.** Searched open PRs for RLlib docs-link changes
(`rllib docs.ray.io links`, `rllib en/master`) and found none.

**Testing.**

- `pre-commit run --files <changed files>`: all applicable hooks passed,
including ruff, black, pydoclint, the Ray docstyle check, and the
master-branch link check.
- `python -m py_compile` on the five changed `.py` files: passed.
- `git grep` found no tests that assert on the changed URLs or warning
strings.
- Requested each new URL on docs.ray.io to confirm status codes and
anchors, as described above.

**AI assistance.** This PR was written with AI assistance (Claude Code).
I reviewed every changed line.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[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.

3 participants