Force radix flush on weight sync for exact RL lanes - #50
Conversation
Broly Security ScanNote ✅ Clean scan Note Re-scan this PR anytime with
|
Make cache invalidation fail closed for exact RL weight updates. The paired SGLang engine commit forces a radix-cache flush regardless of the client flag, while the XoRL endpoint policy auto-flushes any endpoint reporting radix enabled. Advance the sampler pin to the engine half so this stack actually consumes the mandatory guard.
1319c4e to
f4feceb
Compare
020a338 to
e7beb67
Compare
qywu
left a comment
There was a problem hiding this comment.
Approving — this is a real bug with a correctly-sized fix. The stale-prefix failure mode is well described, the client-side rule is scoped to mode == "auto", mode="none" still opts out, and the four new tests cover engagement, both non-engagement paths, and the disable_radix_cache parsing. Ran the suite locally: 7 passed.
Two non-blocking notes.
1. Unknown radix state fails open. _server_info_radix_cache_enabled returns None when an endpoint reports neither radix_cache_enabled nor disable_radix_cache, and the aggregate in _resolve_sync_cache_behavior starts at False and only flips on info.radix_cache_enabled is True. So an endpoint that doesn't report its radix state won't trigger the auto flush — which is the opposite of fail-closed for exactly the older engines this rule is described as backstopping. Since SGLang enables the radix cache by default, treating None as "assume enabled" seems closer to the intent. Cheap to add a case for it in test_radix_state_parsed_from_disable_radix_cache.
2. ruff-format fails. pre-commit run --all-files reformats tests/server/api_server/test_inference_endpoints.py at this head. main is clean, so this would fail lint CI on merge — it just hasn't run, because lint.yml triggers only on pull_request: branches: [main] and this PR targets cleanup-tests.
Note that this branch sits on #49's base, which I've flagged separately as diverged from its declared parent — that's a stacking issue rather than anything wrong with this change.
|
Superseded by #57, which consolidates the complete exact trainer-serving stack directly onto main. |
Force radix flush on weight sync for exact RL lanes
Stack position: after
cleanup-tests. The paired xorl-sglang PR is stackedafter the existing xorl-sglang exactness stack and is pinned by this branch.
Problem
An exact RL endpoint can keep radix-prefix KV computed with the previous
weights when a weight update does not explicitly request a cache flush. The
next prefix hit can therefore mix old-policy KV with new-policy weights and
silently break trainer/sampler parity.
Change
rl_on_policy_targetis active and radix is enabled. A mandatory flush thatcannot complete fails closed.
cache_invalidation_mode="auto"flush such endpoints as a compatibilitybackstop for older engines.
cache_invalidation_mode="none"remains a client opt-out, while the engineguard still protects exact lanes.
Validation
engagement, non-RL and radix-disabled autonomy, and fail-closed behavior.
invalidation and endpoint capability parsing.
after weight sync and diverged from a fresh prefill; the fixed endpoint
flushed the cache and restored byte equality.
This PR contains only production code, conventional tests, and the required
xorl-sglang gitlink update. Prototype scenarios and campaign evidence are not
included.