Skip to content

config: the resolution pipeline's dispatcher leaves the record - #36896

Merged
ch-wan merged 1 commit into
mainfrom
cheng/gc-r4a-pipeline
Aug 29, 2026
Merged

config: the resolution pipeline's dispatcher leaves the record#36896
ch-wan merged 1 commit into
mainfrom
cheng/gc-r4a-pipeline

Conversation

@ch-wan

@ch-wan ch-wan commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

The series

Stacked, each PR based on the one above it. Read them in order; every boundary is
self-sufficient and green on its own.

  1. #36896 — the resolution pipeline's dispatcher leaves the record ← you are here
  2. #36972 — the callbacks into the record go to zero
  3. #36973 — six more runtime readers ask the bags
  4. #36974 — the dead record parameters go
  5. #36975 — the lazy imports that buy nothing become eager
  • #36925 — CI vehicle — runs the whole series against main, not for merge

Motivation

_run_resolution_pipeline was the last piece of resolution living on ServerArgs: 331 lines of
ordered dispatch, plus the four handler methods it still reached. Every step it calls already
lives in arg_groups/, and none of them is a member of the record — a step decides about the
record, it is not part of it.

Keeping the dispatcher on the class also kept the awkward direction of travel: a hook in
arg_groups/ was called by a method of the very object it was extracted from.

Modifications

The dispatcher becomes arg_groups.pipeline.run_resolution_pipeline(server_args).

Three of the four remaining handlers were one-line forwards to run_post_process_pass, the same
shape as the ninety-three slots #36792 cut, and are now that call. The fourth is the MLA opt-in
check; it joins the platform family as handle_hardware_runtime_validation. resolve_once keeps
the gate — the resolved/failed flags — and calls the function.

ServerArgs goes from 5643 to 5277 lines and hosts no resolution handler at all.

That changes what one guard can say. test_no_handler_reads_a_field_off_self said a handler on
the record must not read a raw field off self; there is no such handler left, so it becomes the
stronger test_the_record_hosts_no_resolution_handler, and the package-side
test_no_hook_reads_a_field_off_the_record covers what the steps read.

Five guards follow the dispatcher to its new file: the two that count pipeline entries patch the
module instead of the class; the "one caller" scan matches a bare-name call rather than a self.
attribute call; the laziness and ModelConfig-ordering checks parse arg_groups/pipeline.py,
which is the file whose imports map a bare-name call to the family defining it; and the platform
write-capture plugin is installed in the namespace the capture now runs in.

That last one is the seam worth noticing. The test installs an out-of-tree platform by patching
current_platform in the dispatcher's module. Moving the dispatcher moved that namespace, and
without following it the plugin's defaults silently stopped reaching the projection — a real
behaviour the test exists to protect, failing loudly rather than quietly.

The MLA check runs before the dummy short circuit, so platform_hook is imported at its call site
like every other family rather than at module scope.

Accuracy Tests

The 62-shape resolution probe (resolve_once() + check_server_args(), exception type and full
message) is byte-identical to the base commit. The registered tests that mention the record report
the same failure set as main, file for file.

A dummy resolution loads two more modules (pipeline, platform_hook) and is unchanged at ~9 ms.

Speed Tests and Profiling

None. The dispatch is the same sequence of calls, one stack frame shallower.

Checklist

Review and Merge Process

Mostly mechanical: arg_groups/pipeline.py is _run_resolution_pipeline verbatim with self
renamed and four call sites rewritten. The parts worth reading are the guard changes in test/,
and in particular the platform-plugin patch target — the one place where moving the dispatcher
moves a namespace a test depends on.

Checked on this tip: the 77 handler and pass calls stay in the same order, the MLX validation still
runs immediately before the dummy return, _run_resolution_pipeline has no leftover caller, and
the plugin test patches pipeline.current_platform.


CI States

Latest PR Test (Base): ❌ Run #33242578573
Latest PR Test (Extra): ❌ Run #33242578477
Latest PR Test (AMD ROCm 7.2): ❌ Run #33242578540

@github-actions github-actions Bot added the npu label Aug 28, 2026
@ch-wan
ch-wan force-pushed the cheng/gc-r4a-pipeline branch from 847804a to f8bf9a6 Compare August 28, 2026 22:11
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-29T06:37:34.325612Z 4c96ae3 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

`_run_resolution_pipeline` was the last piece of resolution living on
`ServerArgs`: 331 lines of ordered dispatch plus the four handler methods it
still reached. Every step it calls already lives in `arg_groups/`, and none of
them is a member of the record -- a step decides *about* the record.

The dispatcher becomes `arg_groups.pipeline.run_resolution_pipeline`. Three of
the four remaining handlers were one-line forwards to `run_post_process_pass`,
like the ninety-three the previous PR cut, and are now that call; the fourth is
the MLX opt-in check, which joins the platform family as
`handle_hardware_runtime_validation`. `resolve_once` keeps the gate and calls
the function.

`ServerArgs` loses 366 lines (5643 -> 5277) and hosts no resolution handler at
all. `test_no_handler_reads_a_field_off_self` said a handler on the record must
not read a raw field off `self`; there is none left, so the guard becomes the
stronger `test_the_record_hosts_no_resolution_handler`, and the package-side
`test_no_hook_reads_a_field_off_the_record` covers what the steps read.

Five guards follow the dispatcher to its new file: the two that count pipeline
entries patch the module rather than the class, the "one caller" scan matches a
bare-name call, the laziness and ModelConfig-ordering checks parse
`arg_groups/pipeline.py`, and the platform write-capture plugin is installed in
the namespace the capture now runs in -- without that last one the plugin's
defaults silently stopped reaching the projection.

The MLX check runs before the dummy short circuit, so `platform_hook` is
imported at its call site like every other family. A dummy resolution loads two
more modules (`pipeline`, `platform_hook`) and is unchanged at ~9ms.

The 62-shape resolution probe reports byte-identical results.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ch-wan
ch-wan force-pushed the cheng/gc-r4a-pipeline branch from 0f598b2 to 829770e Compare August 29, 2026 08:11
@ch-wan
ch-wan merged commit 48b88e1 into main Aug 29, 2026
107 of 123 checks passed
@ch-wan
ch-wan deleted the cheng/gc-r4a-pipeline branch August 29, 2026 11:16
kediwu0331 pushed a commit to Zhylkaaa/sglang that referenced this pull request Aug 30, 2026
saturn-acc pushed a commit to saturn-acc/sglang that referenced this pull request Aug 31, 2026
@PaddyXj PaddyXj mentioned this pull request Aug 31, 2026
9 tasks
nzr-niu pushed a commit to nzr-niu/sglang that referenced this pull request Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant