docs: plan for porting XoRL features from main onto dev - #27
Draft
qywu wants to merge 1 commit into
Draft
Conversation
Scaffolding and the written plan for issue #26. No feature code yet. Three placements, and the rule for choosing between them: python/sglang/xorl/ new capability upstream has no version of python/sglang/overrides/ changed behaviour of a module upstream does have in-tree edit only where neither can work The sglang/xorl/ namespace exists because additive code cannot use the overlay: the finder fires when sglang.srt.X is imported and a twin sglang.overrides.X exists, so a twin whose upstream counterpart does not exist is never imported and never fires. It would sit there looking installed and doing nothing. Two constraints found while sizing the work, both recorded where someone will hit them: server_args.py cannot use the overlay at all. 458 NS() field annotations and nine guard tests, including two-way namespace coverage and a mutation ratchet. Dataclass fields are fixed at class creation, so no post-hoc patch adds a field and still satisfies those guards. CLI surface is an in-tree edit, and it is the one place we knowingly take a conflict on every upstream sync. __apply_patch__ suits replacement, not interleaving. Replacing a whole function or method is clean; interleaved edits inside a long method force the twin to copy that method, and the copy then stops tracking upstream fixes with nothing to warn you. That is the trap that makes an overlay look maintainable while it quietly rots, so it is called out rather than discovered. Also worth having written down, because git actively misleads here: main's real upstream base is 48f1b14 (2026-08-06), one day before v0.5.17. Git reports a merge-base of 2026-03-18 because 38dc5c2 squashed its upstream import instead of merging, leaving no ancestry. By tree distance only 137 files separate 48f1b14 from main's post-sync tree, so the XoRL code was written against an upstream contemporaneous with dev's base and this is a port rather than a re-implementation. That decays with every upstream release. sglang/xorl/__init__.py is deliberately inert -- verified it adds zero sglang.srt imports of its own, since anything dragging srt in earlier than sglang/__init__.py's bootstrap would permanently un-override whatever it touched.
Broly Security ScanWarning Latest baseline snapshot is stale. Broly is running in PR-only fallback mode until the next scheduled baseline refreshes. This does not block the PR. Note ✅ Clean scan Note Re-scan this PR anytime with
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scaffolding and the written plan for #26. No feature code yet — this is the shape the ports land in.
Three placements, one rule
python/sglang/xorl/python/sglang/overrides/Two constraints found while sizing the work
Both are recorded in the code and docs where someone will actually hit them.
Additive code cannot use the overlay. The finder fires when
sglang.srt.Xis imported and a twinsglang.overrides.Xexists. A twin whose upstream counterpart doesn't exist is never imported and never fires — it sits there looking installed and doing nothing. Hencesglang/xorl/.server_args.pycannot use the overlay at all. 458NS()field annotations and nine guard tests, including two-way namespace coverage (test_server_args_namespaces.py) and a mutation ratchet. Dataclass fields are fixed at class creation, so no post-hoc patch adds a field and still satisfies those guards. CLI surface is an in-tree edit — the one place we knowingly take a conflict on every upstream sync, so it stays minimal and the behaviour behind it goes inxorl/oroverrides/.__apply_patch__suits replacement, not interleaving. Replacing a whole function or method is clean. Interleaved edits inside a long method force the twin to copy that method, and the copy then stops tracking upstream fixes with nothing to warn you. That's the trap that makes an overlay look maintainable while it quietly rots, so it's called out rather than discovered later.Why the port is cheap right now
Git actively misleads here.
main's reported merge-base is 2026-03-18, but38dc5c2b0squashed its upstream import instead of merging, leaving no ancestry. By tree distance, main's real base is48f1b14fc(2026-08-06) — one day before v0.5.17 — with only 137 files between it and main's post-sync tree.So the XoRL code was written against an upstream contemporaneous with
dev's base: this is a port, not a re-implementation. That decays with every upstream release, which is the argument for starting with the high-value items now.Contents
python/sglang/xorl/__init__.py— namespace for additive modules. Deliberately inert; verified it adds zerosglang.srtimports of its own, since anything pullingsrtin earlier thansglang/__init__.py's bootstrap would permanently un-override whatever it touched.docs/xorl-porting-plan.md— placement rules, port order, per-feature definition of done.python/sglang/overrides/README.md— documents the boundary, so the next person reaching for a twin learns the two limits before writing one.Draft, because two questions in #26 change the order
sgl-model-gatewayin scope?