Skip to content

[Test] Add a docs drift check for server_arguments.mdx - #38520

Merged
ch-wan merged 8 commits into
sgl-project:mainfrom
hickeyma:test/server-args-docs-coverage
Oct 8, 2026
Merged

ch-wan merged 8 commits into
sgl-project:mainfrom
hickeyma:test/server-args-docs-coverage

Conversation

@hickeyma

@hickeyma hickeyma commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

server_arguments.mdx drifts from the CLI and the only fix today is someone noticing and hand editing a row. In the last three months, 5 PRs touched only this doc and 3 of them (#37989, #32172, #34654) just added rows for flags that had shipped without one. The same drift keeps getting found after the fact instead of being caught when the flag lands.

Modifications

Adds test/registered/unit/server_args/test_server_args_docs_coverage.py. It builds the real ServerArgs argparse parser and diffs it against the doc tables. A live flag with no row in the Argument column fails and so does any flag the doc names that no longer registers as a current or deprecated flag.

One allowlist, server_arguments_undocumented.txt (beside the doc), lists the live flags that have no row today. It can only shrink. A new undocumented flag fails and an entry that gets documented or whose flag is removed has to come off the list. It sits outside the main_package paths so a PR that backfills a row only runs the CPU stage.

Also in this PR:

  • Documents --speculative-use-block-verification with its CLI help text and False default, fixing the new docs coverage test without expanding the undocumented allowlist.
  • Fixes the 4 stale rows so there's no stale allowlist. The rows for --custom-sigquit-handler, --debug-tensor-dump-inject and --hybrid-kvcache-ratio are deleted. --hybrid-kvcache-ratio was the only row under "Deprecated arguments", so that section is gone too. --optimistic-prefill-retries is renamed to --optimistic-prefill-attempts, the flag's current name.
  • Adds a server_args_docs filter to _pr-test-check-changes.yml that only the CPU stage reads, like renderer. Otherwise a docs only PR skips base-a-test-cpu, can merge a stale row green and then breaks the test on main for everyone. It stays out of main_package so a doc edit doesn't need run-ci or trigger the GPU stages.

AI assistance was used for implementation and verification.

Accuracy Tests

N/A. Test, docs and CI filter only. No model or kernel code touched.

Speed Tests and Profiling

N/A, doesn't affect inference.

Checklist


CI States

Latest PR Test (Base): ⏳ Run #37744036367
Latest PR Test (Extra): ❌ Run #37744035808
Latest PR Test (AMD ROCm 10): ⏳ Run #37744036275

@Kangyan-Zhou

Copy link
Copy Markdown
Collaborator

/tag-and-rerun-ci

@github-actions github-actions Bot added the run-ci CI: run the baseline test suite on this PR label Sep 14, 2026
@Kangyan-Zhou

Copy link
Copy Markdown
Collaborator

Could you please fix the CPU test?

@hickeyma

Copy link
Copy Markdown
Contributor Author

Could you please fix the CPU test?

Thanks @Kangyan-Zhou. The rebase of main introduced changes which caused the tests to fail. Fixed now. We will have to balance this with incoming changes that affect it until it lands.

@hickeyma

Copy link
Copy Markdown
Contributor Author

Thanks @ch-wan for the review. Updated and ready for review again.

@hickeyma

Copy link
Copy Markdown
Contributor Author

/tag-and-rerun-ci

@hickeyma
hickeyma requested a review from ch-wan September 15, 2026 09:37
@hickeyma
hickeyma force-pushed the test/server-args-docs-coverage branch from 2f502bc to 5a9c9a1 Compare September 17, 2026 09:40
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Sep 17, 2026
@ch-wan ch-wan removed the run-ci CI: run the baseline test suite on this PR label Sep 28, 2026

@ch-wan ch-wan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed by agent.

Summary

This is a solid bookkeeping ratchet: it diffs the live ServerArgs argparse parser against server_arguments.mdx table rows, pins today’s 75 undocumented flags in a shrink-only allowlist, and cleans up the four stale rows so that allowlist is not carrying ghosts. Placement, CustomTestCase, register_cpu_ci, and the four test methods each guard a distinct failure mode (malformed rows, new gaps, stale allowlist entries, stale mentions). The remaining risk is operational: putting this one MDX path on main_package does run base-a-test-cpu, but it also dispatches the full NVIDIA GPU matrix and the run-ci gate for docs-only edits of that page.

Issue counts by severity

  • bugs: 0
  • suggestions: 1
  • nits: 0

@hickeyma
hickeyma force-pushed the test/server-args-docs-coverage branch from 0271746 to 7349e2c Compare September 28, 2026 13:00
@hickeyma
hickeyma requested a review from ch-wan September 28, 2026 13:54
@ch-wan ch-wan added the run-ci CI: run the baseline test suite on this PR label Oct 1, 2026
@hickeyma
hickeyma force-pushed the test/server-args-docs-coverage branch from fd12441 to 56e688a Compare October 1, 2026 08:05
@hickeyma
hickeyma requested a review from ch-wan October 5, 2026 09:08
@hickeyma

hickeyma commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @ch-wan for the review and feedback. All three are addressed in the latest push. I took the count out of the description since it'd just go stale again.

@ch-wan

ch-wan commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

/rerun-test test_server_args_docs_coverage.py‎

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🚀 ubuntu-latest (1 test): ✅ View workflow run

cd test/ && python3 registered/unit/server_args/test_server_args_docs_coverage.py

@ch-wan
ch-wan merged commit f795fe3 into sgl-project:main Oct 8, 2026
88 of 115 checks passed
@hickeyma
hickeyma deleted the test/server-args-docs-coverage branch October 8, 2026 08:23
Shunkangz added a commit to Shunkangz/sglang that referenced this pull request Oct 9, 2026
The docs drift check from sgl-project#38520 requires every live flag to have a row.
Also rename the hook test whose name said the disabled-radix tree core is
unused; since ChunkCache was removed, a disabled UnifiedRadixCache builds it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Nozom1ff added a commit to Infrawaves/sglang that referenced this pull request Oct 29, 2026
Post-rebase review fixes, squashed. Each corrects how one of our commits
merged with an upstream v0.5.22 change.

PD abort / deferred release (with upstream sgl-project#37077 generation protocol):
- A receiver's clear() drops its own generation's ACK-tracker entry again.
  The merge dropped the token-scoped clear, so a receiver aborted before
  KV pre-allocation left a permanent tracker entry.
- Keep a held room exclusive to its receiver under transfer drain
  (Mooncake), as the per-receiver token did locally:
  - a new receiver of a room its earlier receiver has not released fails
    fast before publishing any destination, leaving the room's status and
    failure record to the owner. Only the owner may resend the ABORT that
    drains the room, so a takeover would strand both receivers' buffers;
  - arm_deferred_abort_room() keeps the receiver's own generation and
    refuses to replace another undrained receiver's;
  - is_abort_release_safe()/clear_deferred_abort_state() take an optional
    generation; the decode release path passes the receiver's own.
  Upstream rejects a duplicate room only under prefill_complete; it can
  leave early mode alone because it force-releases on timeout, which
  fail-closed Mooncake does not. Non-drain backends keep upstream's
  semantics, and the wire format is unchanged.
- Document that SGLANG_DISAGGREGATION_DECODE_BOOTSTRAP_TIMEOUT does not
  cover the prefill_complete wait.

Drop lazy creation added during the rebase only so that tests built with
__new__ would not raise AttributeError. Production always runs __init__,
and the fallbacks would hide a missing initialization behind a fresh lock
or table: CommonKVManager.connection_lock and the parallel-info tables are
plain attributes set by __init__ / _init_decode_handshake_state() again,
as upstream has them. _transfer_lifetime gets a declared class default
instead of getattr lookups.

trtllm_mla: pass forward_batch.kv_loc_plan, the first argument upstream
(it raised TypeError on the first breakable prefill graph capture on
SM100), and use paged_row_view for the KV buffer like upstream's call
sites.

cutedsl_mla fixed split-KV: allow FlashInfer 0.7.1, which upstream now
pins. The adapter's private dependencies (cute_dsl_mla_decode, the
_get_split_kv_and_workspace_size planner and the workspace layout) are
unchanged from 0.6.18; 0.7.1 only adds lse_scale, whose default keeps
the natural-log LSE. Without this, setting
SGLANG_CUTEDSL_MLA_NUM_KV_SPLITS failed at startup.

Docs: add --dcp-kv-layout, --max-parallel-samples and --max-batch-outputs
to server_arguments.mdx, which upstream sgl-project#38520 now checks.

Co-Authored-By: Claude <[email protected]>
nvjullin pushed a commit to nvjullin/sglang that referenced this pull request Nov 24, 2026
…ad-back

test_server_args_docs_coverage (added on main by sgl-project#38520) requires every live
ServerArgs flag to have a row in server_arguments.mdx. Add rows for the two
flags this PR introduces, using their help text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
nvjullin pushed a commit to nvjullin/sglang that referenced this pull request Nov 24, 2026
…ad-back

test_server_args_docs_coverage (added on main by sgl-project#38520) requires every live
ServerArgs flag to have a row in server_arguments.mdx. Add rows for the two
flags this PR introduces, using their help text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
nvjullin pushed a commit to nvjullin/sglang that referenced this pull request Dec 4, 2026
…ad-back

test_server_args_docs_coverage (added on main by sgl-project#38520) requires every live
ServerArgs flag to have a row in server_arguments.mdx. Add rows for the two
flags this PR introduces, using their help text.

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

documentation Improvements or additions to documentation run-ci CI: run the baseline test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants