Skip to content

[Rust] Keep sampling and scheduler wire schemas in sync - #37222

Merged
merrymercy merged 19 commits into
mainfrom
rust-server-cleanup-3-parity
Aug 31, 2026
Merged

merrymercy merged 19 commits into
mainfrom
rust-server-cleanup-3-parity

Conversation

@merrymercy

@merrymercy merrymercy commented Aug 31, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

Close Rust/Python sampling parity gaps and make positional wire-schema drift fail in Python unit tests. This is PR 3 of 4 in stack #37223.

Modifications

  • Normalize empty grammar strings to unset, matching Python.
  • Include structural_tag in grammar mutual exclusion and align beam validation order.
  • Give custom_params the same bounded JSON shape as the Python type instead of accepting arbitrary JSON.
  • Add Rust regression coverage for those parity fixes.
  • Add Python-importing lockstep tests for SamplingParams and TokenizedGenerateReqInput; the latter permits only a defaulted Python suffix beyond the Rust-emitted prefix.

Test plan

  • cargo test --manifest-path rust/sglang-server/Cargo.toml --lib (251 passed)
  • cargo test --manifest-path rust/sglang-mm/Cargo.toml --lib (31 passed)
  • cargo clippy --manifest-path rust/sglang-server/Cargo.toml --lib --tests -- -D warnings
  • Rustfmt, Ruff targeted checks, Isort, and Python bytecode compilation
  • Focused registered tests, including both lockstep files, are triggered in PR comments.

Stack


CI States

Latest PR Test (Base): 🚫 Run #33430993111
Latest PR Test (Extra): 🚫 Run #33430992822
Latest PR Test (AMD ROCm 7.2): 🚫 Run #33430993191

@merrymercy merrymercy changed the title rust-server-cleanup(parity,non_mechanical_provable): align sampling and wire schemas [Rust] Keep sampling and scheduler wire schemas in sync Aug 31, 2026
@merrymercy

Copy link
Copy Markdown
Collaborator Author

/rerun-test test/registered/rust/test_run_rust_tests.py test/registered/core/test_srt_endpoint.py test/registered/vlm/test_rust_native_mm_e2e.py test/registered/vlm/test_rust_native_mm_mmmu.py

@merrymercy

Copy link
Copy Markdown
Collaborator Author

/rerun-test test/registered/unit/managers/test_io_struct.py test/registered/unit/sampling/test_sampling_params.py

@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Results for /rerun-test test/registered/rust/test_run_rust_tests.py test/registered/core/test_srt_endpoint.py test/registered/vlm/test_rust_native_mm_e2e.py test/registered/vlm/test_rust_native_mm_mmmu.py:

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

cd test/ && python3 registered/rust/test_run_rust_tests.py

🚀 1-gpu-5090 (1 test): ❌ View workflow run

cd test/ && python3 registered/core/test_srt_endpoint.py

🚀 1-gpu-h100 (2 tests): ❌ View workflow run

cd test/ && python3 registered/vlm/test_rust_native_mm_e2e.py
cd test/ && python3 registered/vlm/test_rust_native_mm_mmmu.py

@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Results for /rerun-test test/registered/unit/managers/test_io_struct.py test/registered/unit/sampling/test_sampling_params.py:

🚀 1-gpu-h100 (1 test): ❌ View workflow run

cd test/ && python3 registered/unit/managers/test_io_struct.py

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

cd test/ && python3 registered/unit/sampling/test_sampling_params.py

@merrymercy merrymercy added the run-ci CI: run the baseline test suite on this PR label Aug 31, 2026
@merrymercy

Copy link
Copy Markdown
Collaborator Author

/rerun-test test/registered/rust/test_run_rust_tests.py test/registered/core/test_srt_endpoint.py test/registered/vlm/test_rust_native_mm_e2e.py test/registered/vlm/test_rust_native_mm_mmmu.py

@merrymercy

Copy link
Copy Markdown
Collaborator Author

/rerun-test test/registered/unit/managers/test_io_struct.py test/registered/unit/sampling/test_sampling_params.py

@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Results for /rerun-test test/registered/unit/managers/test_io_struct.py test/registered/unit/sampling/test_sampling_params.py:

🚀 1-gpu-h100 (1 test): ❌ View workflow run

cd test/ && python3 registered/unit/managers/test_io_struct.py

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

cd test/ && python3 registered/unit/sampling/test_sampling_params.py

@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Results for /rerun-test test/registered/rust/test_run_rust_tests.py test/registered/core/test_srt_endpoint.py test/registered/vlm/test_rust_native_mm_e2e.py test/registered/vlm/test_rust_native_mm_mmmu.py:

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

cd test/ && python3 registered/rust/test_run_rust_tests.py

🚀 1-gpu-5090 (1 test): ❌ View workflow run

cd test/ && python3 registered/core/test_srt_endpoint.py

🚀 1-gpu-h100 (2 tests): ❌ View workflow run

cd test/ && python3 registered/vlm/test_rust_native_mm_e2e.py
cd test/ && python3 registered/vlm/test_rust_native_mm_mmmu.py

@merrymercy

Copy link
Copy Markdown
Collaborator Author

/rerun-test test/registered/unit/managers/test_io_struct.py test/registered/unit/sampling/test_sampling_params.py

@merrymercy

Copy link
Copy Markdown
Collaborator Author

/rerun-test test/registered/rust/test_run_rust_tests.py test/registered/core/test_srt_endpoint.py test/registered/vlm/test_rust_native_mm_e2e.py test/registered/vlm/test_rust_native_mm_mmmu.py

@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Results for /rerun-test test/registered/rust/test_run_rust_tests.py test/registered/core/test_srt_endpoint.py test/registered/vlm/test_rust_native_mm_e2e.py test/registered/vlm/test_rust_native_mm_mmmu.py:

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

cd test/ && python3 registered/rust/test_run_rust_tests.py

🚀 1-gpu-5090 (1 test): ❌ View workflow run

cd test/ && python3 registered/core/test_srt_endpoint.py

🚀 1-gpu-h100 (2 tests): ❌ View workflow run

cd test/ && python3 registered/vlm/test_rust_native_mm_e2e.py
cd test/ && python3 registered/vlm/test_rust_native_mm_mmmu.py

@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Results for /rerun-test test/registered/unit/managers/test_io_struct.py test/registered/unit/sampling/test_sampling_params.py:

🚀 1-gpu-h100 (1 test): ❌ View workflow run

cd test/ && python3 registered/unit/managers/test_io_struct.py

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

cd test/ && python3 registered/unit/sampling/test_sampling_params.py

@merrymercy merrymercy left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

approve

@merrymercy merrymercy left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

approve

@merrymercy

Copy link
Copy Markdown
Collaborator Author

/rerun-test test/registered/rust/test_run_rust_tests.py test/registered/core/test_srt_endpoint.py test/registered/vlm/test_rust_native_mm_e2e.py test/registered/vlm/test_rust_native_mm_mmmu.py

@merrymercy

Copy link
Copy Markdown
Collaborator Author

/rerun-test test/registered/unit/managers/test_io_struct.py test/registered/unit/sampling/test_sampling_params.py

@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Results for /rerun-test test/registered/unit/managers/test_io_struct.py test/registered/unit/sampling/test_sampling_params.py:

🚀 1-gpu-h100 (1 test): ✅ View workflow run

cd test/ && python3 registered/unit/managers/test_io_struct.py

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

cd test/ && python3 registered/unit/sampling/test_sampling_params.py

@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Results for /rerun-test test/registered/rust/test_run_rust_tests.py test/registered/core/test_srt_endpoint.py test/registered/vlm/test_rust_native_mm_e2e.py test/registered/vlm/test_rust_native_mm_mmmu.py:

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

cd test/ && python3 registered/rust/test_run_rust_tests.py

🚀 1-gpu-5090 (1 test): ✅ View workflow run

cd test/ && python3 registered/core/test_srt_endpoint.py

🚀 1-gpu-h100 (2 tests): ✅ View workflow run

cd test/ && python3 registered/vlm/test_rust_native_mm_e2e.py
cd test/ && python3 registered/vlm/test_rust_native_mm_mmmu.py

Base automatically changed from rust-server-cleanup-2-config to main August 31, 2026 19:30
@merrymercy
merrymercy merged commit 2138494 into main Aug 31, 2026
8 of 16 checks passed
@merrymercy
merrymercy deleted the rust-server-cleanup-3-parity branch August 31, 2026 19:31
StevenChenSE pushed a commit to StevenChenSE/sglang that referenced this pull request Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci CI: run the baseline test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants