{"record":{"id":"74a227be7c0cce26","repo":"sgl-project/sglang","slug":"linear-replayssm-cache-len-must-be-1-got-cf","errorCode":null,"errorMessage":"--linear-replayssm-cache-len must be >= 1, got {cfg.linear_replayssm_cache_len}.","messagePattern":"--linear-replayssm-cache-len must be >= 1, got (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/server_args.py","lineNumber":6962,"sourceCode":"            if mamba_extra_buffer_of(resolved_view(self)):\n                raise ValueError(\n                    \"--enable-linear-replayssm requires --mamba-radix-cache-strategy \"\n                    \"no_buffer (the default); the extra_buffer ping-pong \"\n                    \"donation path is not yet supported (follow-up). Got \"\n                    f\"--mamba-radix-cache-strategy={cfg.mamba_radix_cache_strategy!r}.\"\n                )\n            if cfg.disaggregation_mode != \"null\":\n                # The disaggregated decode pool (HybridMambaDecodeReqToTokenPool)\n                # is not wired for the ReplaySSM ring, so the flag would silently\n                # no-op there; disagg also runs a different cache/coordination\n                # flow that is not yet validated for ReplaySSM (follow-up).\n                raise ValueError(\n                    \"--enable-linear-replayssm is not supported under PD \"\n                    \"disaggregation yet (follow-up). Got \"\n                    f\"--disaggregation-mode={cfg.disaggregation_mode!r}.\"\n                )\n            if cfg.linear_replayssm_cache_len < 1:\n                raise ValueError(\n                    \"--linear-replayssm-cache-len must be >= 1, got \"\n                    f\"{cfg.linear_replayssm_cache_len}.\"\n                )\n\n        # ReplaySSM spec-verify (Part B of #28511): linear-chain target verify via\n        # fold-every-commit -- the verify stores each draft step's raw inputs into\n        # the per-slot (rawv, rawk, g, beta) window and the commit replays the\n        # accepted prefix into the fp32 checkpoint. The intra-window interaction\n        # uses a strictly-lower causal mask, so it is valid ONLY for a linear\n        # draft chain (speculative_eagle_topk in {None, 1}, i.e. NEXTN / MTP);\n        # EAGLE tree verify (topk > 1) must fall back to the recurrent verify.\n        # GDN sizes the window to the draft maximum; KDA (kda_backend) keeps a\n        # --linear-replayssm-cache-len window and folds via its own fused\n        # verify ring-write + commit_kda_replayssm_after_verify.\n        if cfg.enable_linear_replayssm_spec:\n            if cfg.speculative_eagle_topk not in (None, 1):\n                raise ValueError(\n                    \"--enable-linear-replayssm-spec requires a linear draft chain \"","sourceCodeStart":6944,"sourceCodeEnd":6980,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/server_args.py#L6944-L6980","documentation":"Validates that --linear-replayssm-cache-len is at least 1. The cache length sizes the ReplaySSM ring window (e.g. KDA keeps a cache-len window and folds via its fused verify ring-write), so zero or negative values are meaningless and rejected.","triggerScenarios":"Passing --linear-replayssm-cache-len 0 (or a negative number) together with --enable-linear-replayssm; e.g. someone setting 0 intending 'unlimited/default'.","commonSituations":"Treating 0 as 'auto'/'disabled' (common convention elsewhere); scripting loops that compute cache length and can emit 0; typos in launch scripts.","solutions":["Set --linear-replayssm-cache-len to a positive integer (e.g. 128)","If you intended the default, omit the flag entirely","Check any script computing this value for off-by-one/empty-input bugs"],"exampleFix":"# before\n--enable-linear-replayssm --linear-replayssm-cache-len 0\n# after\n--enable-linear-replayssm --linear-replayssm-cache-len 128","handlingStrategy":"validation","validationCode":"def validate(cache_len, enable_replayssm):\n    return not enable_replayssm or (isinstance(cache_len, int) and cache_len >= 1)","typeGuard":"def valid_cache_len(n) -> bool: return isinstance(n, int) and n >= 1","tryCatchPattern":null,"preventionTips":["Sanitize scripted/computed arg values before launching","Remember 0 does not mean 'default' for this flag"],"tags":["sglang","replayssm","argument-validation"],"backgroundTag":"invalid-argument-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}