Metadata-Version: 2.4
Name: servediff
Version: 0.4.65
Summary: Diff what your vLLM / SGLang server actually ran with: auto-selected backends, CUDA graphs, startup failures, dependency versions.
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/apex-mochen/servediff
Project-URL: Issues, https://github.com/apex-mochen/servediff/issues
Project-URL: Changelog, https://github.com/apex-mochen/servediff/blob/main/CHANGELOG.md
Keywords: vllm,sglang,llm-inference,inference-server,llm-serving,startup-log,log-diff,kv-cache,cuda-graph,moe,tensor-parallel,performance-regression,debugging
Classifier: Programming Language :: Python :: 3
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Debuggers
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: System :: Logging
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: markdown>=3; extra == "dev"
Dynamic: license-file

# servediff

[![PyPI version](https://img.shields.io/pypi/v/servediff)](https://pypi.org/project/servediff/)
[![Python versions](https://img.shields.io/pypi/pyversions/servediff)](https://pypi.org/project/servediff/)
[![License](https://img.shields.io/github/license/apex-mochen/servediff)](https://github.com/apex-mochen/servediff/blob/main/LICENSE)
[![ci](https://github.com/apex-mochen/servediff/actions/workflows/ci.yml/badge.svg)](https://github.com/apex-mochen/servediff/actions/workflows/ci.yml)

**One startup log in — the settings the server actually ran with come out.** `servediff`
reads a vLLM or SGLang startup log into named facts (`kv_cache.tokens`,
`gpu.utilization_effective`, `backend.moe`), and reading two of them turns "same flags,
different server" into a table of what changed.

![servediff demo: two excerpt logs from vllm#47047, same flags, the MoE backend differs and one log never prints the KV cache concurrency line](https://raw.githubusercontent.com/apex-mochen/servediff/main/assets/demo.svg)

That is `servediff demo`, run on the two logs bundled in the package: same flags, and the
container MoE backend went from `VLLM_CUTLASS` to `MARLIN`. No log of your own needed to
see it.

Benchmark result files only record the client side. After an upgrade, the server can
silently pick a different MoE or attention backend, change its CUDA graph capture,
fall back to another code path, or run against different torch / triton / flashinfer
builds. Today you find that by reading startup logs and bisecting by hand.
`servediff` does the reading for you.

- **Who it is for:** anyone comparing two vLLM / SGLang runs — after an upgrade, a flag
  change, or between machines — who needs to know *what differs on the server side*.
- **What it reads:** the server's startup log, and optionally a snapshot of the
  server's Python environment. Offline, no GPU, no dependencies.
- **What it does not do:** it does not say *which* difference caused a performance
  change. That still needs an A/B run. It tells you what to A/B.

## Why not just `diff` the two logs

Because a startup log is not a config file. `diff` compares text, and the text churns:
timestamps, pids, two paths, progress bars that redraw the same line forty times. The values
you care about sit *inside* lines whose wording also changes, so a one-line answer arrives
buried in a few thousand irrelevant ones, and a value that went `0.45` → `0.41` is invisible
while a line that merely reordered is loud. `servediff` reads each line into a named fact
(`backend.moe`, `kv_cache.tokens`, `gpu.utilization_effective`) and compares the facts, so
the diff is a table of settings — with the ones a log never printed marked `<absent>`
instead of being guessed at.


## Try it in one minute (no GPU)

```bash
pip install servediff
servediff demo
```

`demo` diffs two excerpt logs that ship inside the package, so your first command
produces real output without you finding logs first. It exits `1`, because the two
logs do differ — that is the result, not a failure.

**Already have a log?** That is the shorter path, and it needs no second log to start:

```bash
servediff show serve.log
```

`show` prints the settings that log carries, each with its line number, and exits `0` as
soon as it read something. A second log is a later step, not a prerequisite.

The same pair, from the repo (the excerpt is public, from [vllm#47047](https://github.com/vllm-project/vllm/issues/47047)):

```bash
git clone https://github.com/apex-mochen/servediff && cd servediff
servediff diff examples/issue-excerpts/vllm-47047-v0.23-default.log examples/issue-excerpts/vllm-47047-v0.23-marlin.log
```

Install from PyPI. A different, unrelated tool also uses the name `servediff` in a
third-party Homebrew tap; the `pip install servediff` package is this one.

The measurement this project is built on — twenty-one logs pasted into public bug reports,
nothing the parser cannot read — is one command in a checkout, and it answers for every log
with one line each:

```bash
servediff audit tests/fixtures      # a directory audits every *.log inside it
```

That corpus is the one the rules were written against, so it can always be made to pass.
The test that matters is output the rules have never seen: `tests/fixtures/held-out-2026-10/`
(eleven pastes), `tests/fixtures/held-out-2026-11/` (seven), and
`tests/fixtures/held-out-2026-11b/` (twenty-eight), all collected straight from vLLM and
SGLang issues with their issue numbers in a `PROVENANCE.md` beside them.

```text
note: baseline: no all-reduce facts and no rank line: cannot tell whether this run had more than one rank, so an absent all-reduce path here is inconclusive
note: candidate: no all-reduce facts and no rank line: cannot tell whether this run had more than one rank, so an absent all-reduce path here is inconclusive

fact                             baseline                                 candidate                                status
backend.moe                      VLLM_CUTLASS (NvFp4)                     MARLIN (NvFp4)                           changed
kv_cache.max_concurrency         <absent>                                 54.14                                    only_candidate

2 difference(s); 0 fact(s) identical. Absent means the log did not print it, not that it was off.
```

The two `note:` lines are part of the answer, not noise: the excerpt posted in that
issue carries no rank line, so this run cannot say whether it was multi-GPU at all,
and the tool says so instead of leaving you to read silence as "unchanged".

The `kv_cache.max_concurrency` line is the second kind of answer worth noticing: the
Marlin excerpt happened to quote the concurrency line, the other one did not, so it
shows up as present-on-one-side rather than as a backend change. Read it as "one of
these two logs tells you this, the other stays silent" — not as "the value changed".

Two conventions keep timings from turning into noise. A numeric change carries its
magnitude, `changed  +45.0%`, because "changed" on its own reads the same at 4% and at 400%.
And a measurement every worker repeats is read once, from the lowest rank — on an 8-GPU box
`Model loading took …` is printed eight times with eight slightly different numbers, and
those differences are per-rank jitter, not a change between your two runs.

## Your own logs

**If you already have a log** — copied out of an issue, or left on disk by last week's run —
start there; nothing has to be captured first:

```bash
servediff show serve.log                     # what that one run actually used
servediff show serve.log --json > facts.json # record it, so a later run can be gated against it
servediff diff today.log --against facts.json
```

`show` needs no second log and no GPU. The diff is the second step, once you have something
to compare against.

**If the failure is ahead of you** — you are about to upgrade, or you have to reproduce it —
`capture` runs the server, tees its output, and snapshots the environment *before* launch, so
the two runs are directly comparable:

```bash
# before the upgrade, with the flags you actually use
servediff capture -o before.log -- python -m vllm.entrypoints.openai.api_server --model <model> ...
# Ctrl-C once the server is up: the startup lines are already in before.log
servediff capture -o after.log -- <the same command>
servediff diff before.log after.log                      # what the server did differently
servediff diff before.log.env.json after.log.env.json    # package, GPU and engine env drift
```

Ctrl-C stops the server, keeps the log, and exits `130`. A run that ends on its own passes the
server's exit code through, so `capture` is safe inside a script that checks it. If the command
names a python launcher, that interpreter is the one snapshotted; for entry points like
`vllm serve`, pass `--python <the server's python>`.

## Commands and exit codes

| Command | What it reads | Exit codes |
|---|---|---|
| `servediff show <log>` | one startup log (or `-` for stdin) → the facts it printed, each with its line number; `--json` | `0` read something; `2` unreadable path or no line recognised |
| `servediff diff <a> <b>` | two startup logs, or two `servediff env` snapshots; `--json`, `--markdown`, `--all`, `--raw-args`, `--skip-absent`, `--only MATCH` (repeatable; prefix or substring of the fact name, `_`/`-` ignored); `servediff diff <log> --against facts.json` diffs one log with facts recorded by `show --json`; give it a directory instead of a log to gate every `*.log` inside (one line each) | `0` identical; `1` at least one difference; `2` usage error, unreadable path, a facts file that is not one, a `--only` pattern that matched nothing, one log with nothing to compare it to, or one log mixed with one snapshot |
| `servediff series <a> <b> <c> ...` | three or more startup logs, in the column order you give → one fact per row; `--json`, `--markdown`, `--all`, `--raw-args` | `0` same across every log; `1` at least one fact differs; `2` fewer than three inputs |
| `servediff env [--python P] [-o snap.json]` | that interpreter's packages, GPU info, and env vars whose names start with `VLLM_` / `SGLANG_` / `SGL_` / `CUDA_` / `NCCL_` / `TORCH_` / `PYTORCH_` / `FLASHINFER_` / `TRITON_` or are `HF_HUB_OFFLINE` / `TRANSFORMERS_OFFLINE`; secret-looking names become `<redacted>` | `0` written; `2` snapshot failed or the path cannot be written |
| `servediff capture [-o run.log] -- <server command>` | runs the server, tees its log to stdout and to the file, and writes `<out>.env.json` **before** launch. If the command names a python launcher (`capture -- python -m vllm...`), that interpreter is the one snapshotted; otherwise pass `--python` to point at the server's venv | the server's own exit code; `2` when the paths cannot be written or the command cannot start |
| `servediff demo` | two excerpt logs shipped inside the package → a real diff with no log files of your own; run this first after installing | `1` always (the bundled logs differ; see the note it prints) |
| `servediff audit <log|dir>` | the lines no rule reads, split into noise (counted) and shapes worth a look (listed); a directory (or several paths) is audited as one corpus, one line per log; `--top N`, `--everything`, `--markdown`, `--json`, `--max-shapes N`, `--baseline JSON`, `--write-baseline JSON` | `0` reported; `1` more shapes worth a look than `--max-shapes` allows (with `--baseline`, only shapes not in it); `2` unreadable path or a file that is not a baseline |
| `servediff repeats <log|dir>` | the message shapes that appear more than once, each with its span, median gap and whether the gaps hold: `regular` (a watchdog re-logging one wait), `burst` (a retry loop), `untimed`; `--min N`, `--top N`, `--markdown`, `--json` | `0` reported, including a log that repeats nothing; `2` unreadable path, or more than one `-` |

`1` always means *the inputs differ* — never *something went wrong* — so
`servediff diff old.log new.log` works directly as a CI gate. At most one input may be
`-`, because stdin can only be read once.

```yaml
# .github/workflows/startup-log.yml — fail the job when a version bump changes startup
- run: pip install servediff
- run: servediff diff old.log new.log --markdown >> "$GITHUB_STEP_SUMMARY"
  # exit 1 fails the step; the summary carries the table for whoever reads the run
```

That is the difference the reporter of
[vllm#47047](https://github.com/vllm-project/vllm/issues/47047) found by hand after a
v0.21 → v0.23 throughput drop. The example files are the log lines posted in that
issue (see [tests/fixtures/README.md](https://github.com/apex-mochen/servediff/blob/main/tests/fixtures/README.md)).

The second thing worth gating is the tool's own blind spot: a server that starts printing
configuration no rule reads. `--max-shapes` alone fails forever after the first such line, so
record what today's log prints and gate on what is new:

```bash
# once, on a log you have read and accepted: commit the file
servediff audit run.log --write-baseline audit-baseline.json
```

```yaml
# .github/workflows/config-drift.yml — fail only when the server prints something new
- run: pip install servediff
- run: servediff audit run.log --baseline audit-baseline.json --max-shapes 0
  # exit 1: a shape no rule reads appeared that the baseline did not have
  # exit 2: the baseline or the log could not be read — a broken gate, not a finding
```

A shape in the baseline is still unread and still reported; it is accepted, not parsed. What
it stops is a gate that goes red on day one and stays red until someone deletes it.

The same idea applies to the facts themselves. A CI job has today's log; nobody keeps the
log from the run they accepted three months ago. `servediff show --json` records what that
run printed in a few kilobytes, and `--against` diffs a single log with those facts:

```bash
# once, on a run whose startup you have read: commit facts.json (a few KB, not the whole log)
servediff show accepted.log --json > facts.json
```

```yaml
# .github/workflows/facts-drift.yml — one log, no second log in the repo
- run: pip install servediff
- run: servediff show run.log --json > today.json
- run: servediff diff run.log --against facts.json --skip-absent
  # exit 0: today's startup still prints what the accepted run printed
  # exit 1: a fact on the same code path changed
  # exit 2: facts.json is unreadable — a broken gate, not a finding
```

`--skip-absent` matters here: a log that stopped early is missing facts, and a fact nobody
recorded cannot be compared. The note in the output says how many facts the baseline holds,
so a narrowed comparison never reads as a clean one.

A gate that fails on every row is a gate someone switches off: package pins move every week,
while the startup decisions are what a version bump actually changes. `--only` narrows the
comparison to the facts you name, and the note says how many facts were left out:

```bash
servediff diff run.log --against facts.json --skip-absent \
  --only backend. --only cuda_graph. --only parallel.
# exit 0: none of those changed, whatever moved in env.pip.*
# exit 2: a pattern matched no fact at all — a gate on nothing is not a pass
```

The pattern is matched against the fact name as a prefix *or* anywhere inside it, with `_`
and `-` ignored, because the word you have is the one from the log line and not the fact
name this tool chose. `--only all_reduce`, `--only all-reduce` and `--only allreduce` all
find `backend.allreduce_dispatch`, whose name never contains a hyphen. If the pair you are
comparing has no all-reduce line at all — the 0.28.0-vs-0.30.0 pair below does not, it is a
single-GPU run — the pattern still matches nothing and still exits 2, because "I asked about
the all-reduce chain and got a green line" is the silent failure this exit code prevents.
Neither the key nor the value is searched: `--only FLASHINFER` matches nothing either, since
a gate pinned to a value would move with whatever the version printed that week.

A CI matrix writes one log per row, so give `diff` the directory instead of running it six
times — one line per log, one exit code, and the failing row named:

```bash
servediff diff logs/ --against facts.json --skip-absent --only backend.
# logs/a.log   1 difference(s); 0 fact(s) identical  [backend.attention]
# logs/b.log   0 difference(s); 1 fact(s) identical
# 2 log(s): 1 differ from facts.json, 1 unchanged
```

An empty or truncated artifact in that directory exits 2 rather than passing as "no
differences": a gate input that nothing could be read from is broken, not clean.

## Real example: same flags, vLLM 0.28.0 vs 0.30.0

Two startup logs from one RTX 4060 Laptop under WSL2, identical flags
(Qwen2.5-0.5B-Instruct, fp16, `--max-model-len 2048`, `--gpu-memory-utilization 0.45`):

```bash
servediff diff vllm-0.28.0.log vllm-0.30.0.log
```

```text
warning: baseline server failed to start: RuntimeError: UVA is not available; facts after the failure are absent because startup stopped, not because they were off

note: baseline: no all-reduce facts: world_size=1, so there is no all-reduce group and no backend is chosen; a TP>1 run is what makes this path observable
note: candidate: no all-reduce facts: world_size=1, so there is no all-reduce group and no backend is chosen; a TP>1 run is what makes this path observable

fact                             baseline                                 candidate                                status
backend.attention                <absent>                                 FLASH_ATTN                               only_candidate
backend.flash_attn_version       <absent>                                 2                                        only_candidate
backend.sampling_flashinfer      <absent>                                 disabled                                 only_candidate
compile.artifacts                <absent>                                 25 entries, 3 artifacts, 4996920 bytes   only_candidate
compile.autotune_gemm            <absent>                                 disabled (not enough SMs)                only_candidate
compile.dynamo_s                 <absent>                                 9.43                                     only_candidate
compile.graph_s                  <absent>                                 13.12                                    only_candidate
compile.range                    <absent>                                 1,2048                                   only_candidate
compile.total_s                  <absent>                                 31.08                                    only_candidate
compile.warmup_s                 <absent>                                 1.02                                     only_candidate
cpu.torch_threads                <absent>                                 16 -> 1                                  only_candidate
cuda_graph.capture_gib           <absent>                                 [0.25, 0.17]                             only_candidate
cuda_graph.capture_s             <absent>                                 [9, 11]                                  only_candidate
cuda_graph.captures              <absent>                                 ["PIECEWISE x51", "FULL x2", "FULL x35"] only_candidate
cuda_graph.pool_gib              <absent>                                 0.17                                     only_candidate
cuda_graph.profiling             <absent>                                 enabled (default since v0.21.0)          only_candidate
engine.init_s                    <absent>                                 109.17                                   only_candidate
engine.version                   0.28.0                                   0.30.0                                   changed
gpu.budget_gib                   <absent>                                 3.6                                      only_candidate
gpu.consumed_gib                 <absent>                                 1.44                                     only_candidate
gpu.cudagraph_gib                <absent>                                 0.17                                     only_candidate
gpu.free_gib                     <absent>                                 6.93                                     only_candidate
gpu.peak_activation_gib          <absent>                                 0.53                                     only_candidate
gpu.total_gib                    <absent>                                 8.0                                      only_candidate
gpu.utilization                  <absent>                                 0.45                                     only_candidate
gpu.utilization_effective        <absent>                                 0.4151                                   only_candidate
gpu.utilization_to_match_kv_cache <absent>                                 0.4849                                   only_candidate
jit.monitor_mode                 <absent>                                 warn                                     only_candidate
jit.warmup_s                     <absent>                                 0.0                                      only_candidate
kernel.ir_op.gelu_and_mul_sparse <absent>                                 triton|native                            only_candidate
kv_cache.layout                  <absent>                                 LBNHC                                    only_candidate
kv_cache.max_concurrency         <absent>                                 69.3                                     only_candidate
kv_cache.memory_gib              <absent>                                 1.62                                     only_candidate
kv_cache.suggested_bytes         <absent>                                 1402454528                               only_candidate
kv_cache.suggested_gib           <absent>                                 1.31                                     only_candidate
kv_cache.tokens                  <absent>                                 141936                                   only_candidate
model_loading.gib                <absent>                                 0.93                                     only_candidate
model_loading.seconds            <absent>                                 19.122619                                only_candidate
parallel.roles                   DP rank 0, PP rank 0, PCP rank 0, TP ... DP rank 0, PP rank 0, PCP rank 0, TP ... changed
sampling.overridden              <absent>                                 {'repetition_penalty': 1.1, 'temperat... only_candidate
server.bind                      <absent>                                 http://0.0.0.0:8031                      only_candidate
server.scale_out                 <absent>                                 disabled                                 only_candidate
server.tasks                     <absent>                                 ['generate']                             only_candidate
serving.chat_template_content_format <absent>                                 string                                   only_candidate
startup                          failed                                   ["ready", "failed (output handler)"]     changed
startup.error                    ["RuntimeError: UVA is not available"... <absent>                                 only_baseline
uva_buffers                      <absent>                                 fallback: device memory                  only_candidate
weights.available_ram_gib        <absent>                                 4.23                                     only_candidate
weights.cache                    <absent>                                 miss (from scratch)                      only_candidate
weights.checkpoint_gib           <absent>                                 0.92                                     only_candidate
weights.filesystem               <absent>                                 EXT4                                     only_candidate
weights.load_s                   <absent>                                 10.49                                    only_candidate
weights.prefetch                 <absent>                                 disabled (EXT4 is not a network FS)      only_candidate

53 difference(s); 14 fact(s) identical. Absent means the log did not print it, not that it was off.
```

0.28.0 does not start on WSL2 with default settings; 0.30.0 does, because it falls
back to device memory when pinned memory is unavailable. Upstream fixed this in
[vllm#56908](https://github.com/vllm-project/vllm/pull/56908), first released in
v0.30.0. Forcing the V1 model runner on 0.28.0 (`VLLM_USE_V2_MODEL_RUNNER=0`) makes it
start, and the remaining server-side differences are:

```text
note: baseline: no all-reduce facts: world_size=1, so there is no all-reduce group and no backend is chosen; a TP>1 run is what makes this path observable
note: candidate: no all-reduce facts: world_size=1, so there is no all-reduce group and no backend is chosen; a TP>1 run is what makes this path observable

fact                             baseline                                 candidate                                status
compile.artifacts                25 entries, 3 artifacts, 4997798 bytes   25 entries, 3 artifacts, 4996920 bytes   changed
compile.dynamo_s                 8.29                                     9.43                                     changed
compile.graph_s                  16.92                                    13.12                                    changed
compile.total_s                  32.58                                    31.08                                    changed
compile.warmup_s                 2.66                                     1.02                                     changed
cuda_graph.capture_gib           0.36                                     [0.25, 0.17]                             changed
cuda_graph.capture_s             12                                       [9, 11]                                  changed
cuda_graph.captures              ["mixed prefill-decode, PIECEWISE x51... ["PIECEWISE x51", "FULL x2", "FULL x35"] changed
cuda_graph.pool_gib              0.36                                     0.17                                     changed
engine.init_s                    74.0                                     109.17                                   changed
engine.version                   0.28.0                                   0.30.0                                   changed
gpu.consumed_gib                 1.29                                     1.44                                     changed
gpu.cudagraph_gib                0.36                                     0.17                                     changed
gpu.peak_activation_gib          0.89                                     0.53                                     changed
gpu.utilization_effective        0.4031                                   0.4151                                   changed
gpu.utilization_to_match_kv_cache 0.4969                                   0.4849                                   changed
jit.warmup_s                     <absent>                                 0.0                                      only_candidate
kernel.ir_op.gelu_and_mul_sparse <absent>                                 triton|native                            only_candidate
kernel.missing_lib               libnvrtc.so.12                           <absent>                                 only_baseline
kernel.module_missing            ["deep_gemm", "vllm.third_party.deep_... <absent>                                 only_baseline
kv_cache.layout                  <absent>                                 LBNHC                                    only_candidate
kv_cache.max_concurrency         60.52                                    69.3                                     changed
kv_cache.memory_gib              1.42                                     1.62                                     changed
kv_cache.suggested_bytes         980078592                                1402454528                               changed  +43.1%
kv_cache.suggested_gib           0.91                                     1.31                                     changed  +44.0%
kv_cache.tokens                  123952                                   141936                                   changed
model_loading.seconds            13.191946                                19.122619                                changed
model_runner                     V1                                       V2                                       changed
parallel.roles                   DP rank 0, PP rank 0, PCP rank 0, TP ... DP rank 0, PP rank 0, PCP rank 0, TP ... changed
server.scale_out                 <absent>                                 disabled                                 only_candidate
startup                          ready                                    ["ready", "failed (output handler)"]     changed
uva_buffers                      <absent>                                 fallback: device memory                  only_candidate
weights.available_ram_gib        4.94                                     4.23                                     changed
weights.cache                    <absent>                                 miss (from scratch)                      only_candidate
weights.load_s                   7.86                                     10.49                                    changed

35 difference(s); 33 fact(s) identical. Absent means the log did not print it, not that it was off.
```

Rows of that kind are the reason this exists, and none of them shows up in a bug report.
`compile.autotune_gemm` and `kernel.ir_op.gelu_and_mul_sparse` show a faster kernel path
being skipped or a different kernel being chosen with no argument changed;
`sampling.overridden` shows the model's `generation_config.json` overriding the flags,
which is why two "identical" launches can sample differently. `gpu.free_gib` versus
`gpu.budget_gib` is the headroom an OOM is later judged against. `gpu.utilization_effective`
is the utilization a run *actually* spends once CUDA graph memory profiling takes its
share — the line also prints the value needed to keep the old KV cache, so a version that
changed only that default is visible here instead of as an unexplained capacity loss.
`gpu.peak_activation_gib` is the other half of that OOM story: the line after the graph
capture splits the footprint into consumed memory, peak activation and the graph
reservation, and activation is the part a version can move by several GiB without touching
a flag. It is also what a real report (`vllm#65907`) turned on — consumed memory stayed at
~45 GiB while peak activation went 14.16 → 8.97 GiB.
`weights.prefetch` is the same story on the loading side: the loader skips prefetch on a
filesystem it does not recognise as a network FS, and startup time changes with it.
`kv_cache.suggested_gib` / `kv_cache.transient_gib` are the extensible-KV-cache half of the
same question: after warmup the engine prints what it committed to the cache, what it held
back for transient activations, which `--kv-cache-memory` would fit the requested budget, and
what torch may still reserve. "KV was cut 2.4x" then becomes arithmetic on the facts instead
of a number to take on trust: in `vllm#66193` the 3.49 GiB suggestion against the 1.46 GiB the
error reports available is 2.39x, with a 28.65 GiB reservation against a 26.75 GiB budget.
`torch.oom_requested_mib` / `torch.oom_free_mib` come from the allocator's own failure line —
the one place a run records how much it asked for and what was free at that instant. Where
those lines sit matters as much as what they say: in `vllm#54559` all 39 of them fall inside
the model-loading window and stop the moment loading reports 63.31 GiB, so they are a
near-miss (20 MiB asked, 9.19 MiB free on a 79.14 GiB card) rather than the cause of the
`shm_broadcast` messages that start a minute later and outlive graph capture.

`frontend.ignored_arg` is the least comforting of these, and the most worth having: a flag the
server accepted and then dropped. In `vllm#58580` the run passes `--enable-auto-tool-choice`
and `--structured-outputs-config`, and the Rust frontend logs
`argument 'enable_auto_tool_choice' currently has no effect in Rust frontend, ignoring` — the
command line reads as configured and nothing is. `servediff` keeps that as a fact, so two runs
that differ only in which flags survived is a row, not a footnote you have to spot in 80 lines —
and since 0.4.56 it also states the consequence under the table, because a row of eighteen can
still be read as trivia while the run is not what you launched:

```text
$ servediff show vllm-58580.log
...
note: the command line named 2 flag(s) this frontend accepted and never applied (structured_outputs_config, enable_auto_tool_choice): the run is not configured the way the command reads
```

`diff` carries the same note per side, which is how two runs that both dropped a flag — every
fact `same`, exit 0 — still say why they are not the pair you meant to compare.
Same family: `spec.draft_max_len` records the draft model's context as the speculative path
bounded it (`262144 -> 131072`), because a version can halve it with no flag to show for it.

## When one of the two runs died

The most common real pair is a run that crashed against the same flags that now work. The
crash stops the log early, so every fact printed after it is `<absent>` on one side — on the
0.28.0-vs-0.30.0 pair that is 49 of the 53 rows, and they bury the three that explain the
outcome. `--skip-absent` keeps only the facts both logs printed, i.e. what changed on the
same code path, and says how many it hid instead of quietly recounting them as identical:

```text
$ servediff diff vllm-0.28.0.log vllm-0.30.0.log --skip-absent
warning: baseline server failed to start: RuntimeError: UVA is not available; facts after the failure are absent because startup stopped, not because they were off

note: 50 difference(s) hidden by --skip-absent: one side never printed those lines, so they can only be listed, not compared

fact                             baseline                                 candidate                                status
engine.version                   0.28.0                                   0.30.0                                   changed
parallel.roles                   DP rank 0, PP rank 0, PCP rank 0, TP ... DP rank 0, PP rank 0, PCP rank 0, TP ... changed
startup                          failed                                   ["ready", "failed (output handler)"]     changed

3 difference(s); 14 fact(s) identical. 50 difference(s) skipped because one side never printed those lines (--skip-absent). Absent means the log did not print it, not that it was off.
```

The exit code is still 1: the inputs do differ. `--json` reports both counts
(`differences` including the hidden ones, and `compared_both_sides` without them), so a
script cannot mistake a smaller table for a cleaner result.

## Validated against real TP>1 logs

The parallel-config rules were written and checked against a real TP=8 startup log
posted in [vllm#48591](https://github.com/vllm-project/vllm/issues/48591) (v0.23.1,
8 workers, one `world_size=N` line per rank, role assignment without an ETP field):

```text
parallel.world_size              8
parallel.roles                   DP rank 0, PP rank 0, PCP rank 0, TP rank 0, EP rank N/A, EPLB rank N/A
compile.fusions                  allreduce_rms
startup                          failed
```

### When the all-reduce path changes silently

vLLM chooses an all-reduce implementation per TP group out of a candidate list, and
FlashInfer can pick its own backend on top of that. These lines are printed once at
startup and never mentioned again — which is how a version bump can move decode
through a different communication path without any flag changing. Since 0.3.7 they
are facts (this is `servediff show` on the same v0.23.1 TP=8 log):

```text
backend.allreduce_dispatch       tp:0: ['CUSTOM', 'SYMM_MEM', 'PYNCCL']                       line 37
backend.allreduce_flashinfer     mnnvl                                                        line 102
backend.allreduce_fusion         ["norm: mnnvl", "norm quantization: trtllm"]                 line 106
backend.allreduce_potential      ['NCCL_SYMM_MEM', 'QUICK_REDUCE', 'FLASHINFER', 'AITER_CU... line 37
model_runner                     V2                                                           line 39
```

The first two separate *chosen* from *possible*: FlashInfer sitting in `potential`
but not in `dispatch` means it was not used for that group. The last two record
whether FlashInfer's fused workspaces were actually built, but read their absence
carefully: since 0.29.0 the FlashInfer auto-selection line is logged at DEBUG
(`debug_once`), so on a default INFO log it may simply not have been printed. The
`all-reduce backends (in dispatch order)` line is `info_once` in 0.29.0, which makes
the dispatch chain the reliable cross-version signal. `model_runner` covers V1 vs V2
(so `VLLM_USE_V2_MODEL_RUNNER=0` runs are identifiable), and `compile.fusions` carries
`allreduce_rms` when `fuse_allreduce_rms` is on.

A fact missing from *both* logs leaves no diff row at all, so it would otherwise be
counted as "identical" without ever being compared. Since 0.3.8 `diff` names the reason
where it can tell, instead of leaving that to the reader:

```text
> ℹ️ baseline: no all-reduce facts: world_size=1, so there is no all-reduce group and
  no backend is chosen; a TP>1 run is what makes this path observable
```

That note is what separates *nothing changed* from *nothing could be seen*: on a TP=1
log the all-reduce path does not exist to compare, and a TP>1 log that begins after
engine init never printed the selection. The same mechanism flags a 0.29+ log whose
FlashInfer fact is missing because the line is DEBUG-only.

That makes the question raised in
[vllm#63705](https://github.com/vllm-project/vllm/issues/63705) — *did 0.29 turn
FlashInfer all-reduce on by default (#52998)?* — answerable from logs you already
keep, one per version, same TP:

```bash
servediff diff v0.28.log v0.29.log
```

On a real 4×H100 TP4+EP node (MiniMax-M2.7, one run per version) that is exactly what
the diff showed between v0.26.0 and v0.29.0: the TP group chain went from `['PYNCCL']`
to `['FLASHINFER', 'PYNCCL']` while the EP group stayed `['PYNCCL']`, V2 Model Runner
appeared, and `allreduce_rms` was off in both runs — so the two changed defaults are
the TP-side FlashInfer path and the model runner ([reported
here](https://github.com/vllm-project/vllm/issues/63705#issuecomment-6656162111)).

So a TP4+EP comparison (like the one in the
[#63705 analysis](https://github.com/apex-mochen/servediff/blob/main/ISSUE-63705-analysis.md)
— a decode-only regression across vLLM 0.29–0.32) can be scripted as:

```bash
servediff capture -o v026.log -- docker run ... vllm/vllm-openai:v0.26.0 ...
servediff capture -o v029.log -- docker run ... vllm/vllm-openai:v0.29.0 ...
servediff diff v026.log v029.log --markdown
```

One log can also hold said-and-done failures that look like many. The
[#54559 analysis](https://github.com/apex-mochen/servediff/blob/main/ISSUE-54559-analysis.md)
counts them by cadence instead: 39 allocator OOM lines turn out to be two retry bursts inside
2.3 s, and 16 broadcast-wait lines turn out to be one wait of 959 s re-logged every minute.

## Dependency versions: `servediff env`

Logs do not print torch / triton / flashinfer versions, and upgrades of those change
server behaviour too. Snapshot each server environment with its own interpreter —
nothing needs to be installed into it:

```bash
servediff env --python /path/to/old-venv/bin/python -o old.json
servediff env --python /path/to/new-venv/bin/python -o new.json
servediff diff old.json new.json
```

Excerpt from those two environments (20 inference-relevant rows; the rest of the package
list is hidden unless you pass `--all`):

```text
pkg.flashinfer-python            0.6.16.post3                             0.6.18.post1                             changed
pkg.nvidia-cuda-nvcc             13.3.73                                  13.0.88                                  changed
pkg.nvidia-cutlass-dsl           4.6.2                                    4.7.1                                    changed
pkg.torch                        2.13.0                                   2.13.0+cu130                             changed
pkg.transformers                 5.16.1                                   5.17.0                                   changed
pkg.vllm                         0.28.0                                   0.30.0                                   changed
```

Note the older vLLM environment carries *newer* CUDA toolkit wheels (13.3 vs 13.0).
Whether that matters for performance is not known — that is what an A/B run is for.
Versions are read from package metadata, so the same torch build can show as `2.13.0`
in one environment and `2.13.0+cu130` in another.

The snapshot records Python, GPU name and driver (via `nvidia-smi`), all installed
package versions, and env vars starting with `VLLM_`, `SGLANG_`, `SGL_`, `CUDA_`,
`NCCL_`, `TORCH_`, `PYTORCH_`, `FLASHINFER_`, `TRITON_`. Values of variables whose name
contains `TOKEN`, `KEY`, `SECRET`, `PASSWORD`, `CREDENTIAL` or `AUTH` are replaced with
`<redacted>`. Snapshots and logs contain local paths: review them before sharing.

## What it extracts

| Fact | vLLM | SGLang |
|---|---|---|
| version | banner / engine init | — (not printed) |
| arguments | `non-default args` | `server_args` (all args) |
| attention backend | `Using X attention backend`; and the backend actually chosen after the check, `Using AttentionBackendEnum.FLASHINFER backend.` — a flag asks for one, this line says which won | `attention_backend` arg |
| MoE backend | three log formats seen in 0.23–0.30, plus the full candidate list when the build prints it separately | `moe_runner_backend` arg |
| CUDA graph | eager mode, `cudagraph_mode`, capture sets, capture time and memory, pool size | prefill CUDA graph disabled |
| model runner, UVA fallback | `Using V2 Model Runner`; V1 runner detected via `gpu_model_runner.py` module; pinned-memory fallback | — |
| all-reduce path | chosen chain per TP group + candidate pool (`all-reduce backends (in dispatch order) … out of potential backends`), FlashInfer's auto-selected backend and its norm / norm-quantization fusion workspaces (0.3.7+) | — |
| parallel config | `world_size`, DP/PP/PCP/TP/ETP/EP/EPLB role assignment | — |
| KV cache layout | `Using LBNHC KV cache layout` (0.30+) | `KV Cache is allocated. dtype: …` |
| KV cache capacity | `Available KV cache memory: … GiB`, `GPU KV cache size: … tokens`, `Maximum concurrency for … tokens per request: …x` | — |
| model identity | `Resolved architecture: …`, `Using max model len …` — the values the engine settled on, which can differ from the requested args | — |
| engine init cost | `init engine (profile, create kv cache, warmup model) took … s` | — |
| compile cost, split | `torch.compile took … s` and its parts: `Dynamo bytecode transform time: … s`, `Compiling a graph for compile range (1, 2048) takes … s` (with the range as its own fact), `Initial profiling/warmup run took … s` — one total cannot say which of the three moved | — |
| CPU threads for serving | `Reducing Torch threads from 16 to 1 for serving`, `Reducing Torch parallelism from 96 threads to 1` — the pair, because `1` alone cannot say what it was cut from; plus the forced worker start method (`We must use the spawn multiprocessing start method`) | — |
| batching and scheduling | `Chunked prefill is enabled with max_num_batched_tokens=16384.`, `Asynchronous scheduling is enabled.` — these decide the shape of every forward pass without appearing in the flags | — |
| speculative decoding | `Using Eagle3 auxiliary layers from config: (2, 10, 18, 26, 34)` | — |
| kernel errors and picks | `CUDA error (…flash_api.cpp): invalid configuration argument` (degraded, not fatal), `Using FlashInfer for top-p & top-k sampling.`, `FlashInfer resolved query dtypes: …`, `vLLM is using nccl==…`, an installed-but-unimportable optional kernel library (`Module deep_gemm was found but failed to import`, `ImportError: libnvrtc.so.3`) | — |
| runtime environment | the `collect_env` block every bug report pastes: `vLLM Version … (git sha …)`, `PyTorch version`, `ROCM used to build PyTorch`, `ROCM Version`, `HIP runtime version`, `OS`, `Python version`, `GPU models and configuration`, `[pip3] torch/triton/transformers/numpy/flashinfer-python==…`, and every `NAME=value` the dump ends with (`CUDA_VERSION`, `TORCH_CUDA_ARCH_LIST`, `VLLM_BUILD_COMMIT`, `VLLM_IMAGE_TAG`, …) — device selection and per-host cache paths are excluded, `Could not collect` / `N/A` are absences rather than values, and on ROCm this block is ~180 lines and every line reads like a setting | its own `name: value` dump: `sglang:`, `PyTorch:`, `sglang-kernel:`, `flashinfer_python:`, `triton:`, `CUDA_HOME:`, `NVCC:`, `CUDA Driver Version:`, `ulimit soft:` |
| SGLang mamba cache & concurrency (0.4.64+) | — | `Mamba Cache is allocated. max_mamba_cache_size: 63, conv_state size: 0.18GB, ssm_state size: 9.00GB`, `max_running_requests is capped to 12 by the mamba state cache (max_mamba_cache_size=63, 5 state slots per request)` — the concurrency you set is not the one you get — `[DP3 TP3 EP3] mamba_size (24) … raising effective_mamba_size to 72` (per rank, and it differs between ranks of one launch), `Disaggregation warmup requests completed for all 1 DP ranks`, `[Scheduler] scheduler died (exit code: -3), reason: 11`, and `Using FP8 KV cache but no scaling factors provided. Defaulting to scaling factors of 1.0` (facts `mamba.cache_size`, `mamba.state_gib`, `mamba.effective_size`, `sched.max_running_requests`, `pd.warmup`, `scheduler.exit`, `kv_cache.fp8_scaling`) |
| SGLang runtime state | — | `Tree cache initialized: source=… impl=UnifiedRadixCache …`, `NIXL KVManager initialized with backend: UCX`, and a scheduler that died before serving (`Scheduler hit an exception` → `startup: failed (scheduler)`), none of which appears in `server_args` |
| dtype coercion | `Casting torch.bfloat16 to torch.float32` — a numeric change no flag records | — |
| loading cost, split | `Loading model from scratch`, `Initializing model took … s`, `Loading weights took … s`, `Model loading took … GiB memory and … seconds` — so a slower startup names its step | — |
| weight source | `Filesystem type for checkpoints: … Checkpoint size: … Available RAM: …`, `Auto-prefetch is …` (prefetch is skipped on a filesystem the loader does not treat as a network FS) | — |
| GPU memory headroom | free / total at startup, desired utilization, budgeted GiB, plus `CUDA graph memory profiling` mode and the effective utilization it leaves (`equivalent to --gpu-memory-utilization=…`, `increase … to …` to keep the old KV cache) | — |
| server surface | `Supported tasks: …`, `Scale-out endpoints are …`, chat template content format, FlashInfer autotune skipped, listening address | — |
| server command | — (not printed) | `sgl start command: …` (the exact invocation, defaults included) |
| kernel selection | one fact per op from `Final IR op priority …`, e.g. `kernel.ir_op.rms_norm=native`; the autotune gate from `Not enough SMs to use max_autotune_gemm mode` | — |
| CPU-only builds (0.4.62+) | on a build with no GPU the `Using X attention backend` line never prints, so the choices appear as `Using default backend AttentionBackendEnum.TORCH_SDPA for vit attention` and `Using AttentionBackendEnum.TORCH_SDPA for MMEncoderAttention.`; the kernels as `Selected CPUInt8ScaledMMLinearKernel for CompressedTensorsW8A8Int8` and `Using CPU GDN prefill kernel (head_k_dim=128)`; and the one line that explains a slower run with no flag behind it: `Failed to create oneDNN linear, fallback to torch linear` | — |
| CPU deployment detail (0.4.64+) | `Explicitly set (4.0/30.69) GiB for KV cache on node 0.`, `kv lcm block sizes 640`, `Padding mamba page size by 20.75% to ensure that …` (the pad is why the KV numbers do not match the flag you set), `Encoder cache will be initialized with a budget of 16384 tokens …`, `Inductor compilation was disabled by user settings`, `The chat template requires system-first ordering …`, and the two-layer NUMA story — `Automatic NUMA binding unavailable … starting unbound` next to `Using MEMBIND policy …` after `numa_migrate_pages failed`; the facts are `kv_cache.cpu_node`, `kv_cache.lcm_block_sizes`, `kv_cache.mamba_page_pad`, `mm.encoder_cache`, `compile.inductor_disabled`, `api.chat_template_order`, `cpu.numa_auto`, `cpu.numa_membind`, `cpu.numa_migrate`, `cpu.set_num_threads`, `cpu.reserved_cpus`, `kv_cache.requested_gib`, `kv_cache.non_kv_gib`, `triton.drivers`, `model_runner` (a CPU build with no Triton driver drops to v1, and `Auto set (675.87/755.19) GiB for KV cache on node 0` is the same sizing line the auto path prints on a 384-thread box) | — |
| hybrid & multimodal startup (0.4.63+) | `Mamba cache mode is set to 'align' for … by default`, `kv cache group sizes (640, 640, 640, 640)` — 0.34 hybrid builds print this instead of `Available KV cache memory` — `Multi-modal warmup completed in …s`, and `[backbone] Compiling model again due to a load failure from …`: a lost compile-cache hit costs startup time and no flag explains it | — |
| sampler defaults | `Default vLLM sampling parameters have been overridden by the model's generation_config.json` | — |
| JIT behaviour | `JIT kernel warmup finished in … s`, `monitored JIT compilations … mode=` | — |
| torch.compile | `collected artifacts: …`, `torch.compile took … s in total` | — |
| startup outcome | ready / failed + root-cause error | ready / failed + root-cause error |

Every fact keeps the log line it came from (`servediff show <log>` or `--json`).
A fact the log did not print is `<absent>`: servediff never fills in defaults.
Options shared by both engines (dtype, context length, memory fraction, prefix cache,
CUDA graph, TP size) are mapped to common names, so a vLLM log and an SGLang log can be
compared, though the result is noisier than a same-engine diff.

### Pasting a report into a GitHub issue

```bash
servediff diff old.log new.log --markdown
```

Renders a GitHub-flavored table with a collapsible **Evidence** section quoting the
exact log line behind each fact — ready to paste into a regression report.

### Reading a log without copying it down

Logs usually live on the box that ran the server. `-` reads stdin, so nothing has
to be scp'd first:

```bash
ssh gpu-node 'cat /path/to/serve.log' | servediff show -
ssh gpu-node 'cat /path/to/serve.log' | servediff diff v0.31.log -
```

Only one side can be `-` (stdin is read once), and `--markdown` labels it `stdin`
in the report header.

### Three versions at once

Regression threads rarely have two runs. `series` puts every run in its own column,
so the middle version is not lost between two pairwise diffs:

```bash
servediff series v0.23.log v0.26.log v0.26-flag.log --markdown
```

```text
| fact         | v0.23.log                          | v0.26.log                     | v0.26-flag.log    |
|---|---|---|---|
| `backend.moe` | `FlashInfer CUTLASS (Unquantized)` | `TrtLlmBf16ExpertsMonolithic` | `FlashInferExperts` |
```

`--all` adds the rows that hold the same value across every log; exit codes match
`diff` (`0` identical, `1` differences, `2` nothing recognised).

### Capturing a run in one step

```bash
servediff capture -o run1.log --python /path/to/server/bin/python -- vllm serve <model>
```

Runs the server command, tees stdout+stderr to `run1.log`, and snapshots the
environment to `run1.log.env.json` before the server starts. After two runs:

```bash
servediff diff run1.log run2.log
servediff diff run1.log.env.json run2.log.env.json
```

Exit codes: `0` no differences, `1` differences, `2` nothing recognised.

### One waiting line, sixteen copies

A startup log repeats itself. The same allocator line can appear 39 times inside 2.3 s,
and the same ring-buffer warning 16 times over 16 minutes. Counting them says "39
problems" and "16 stalls" for what is one retry burst and one wait. `repeats` groups
every message shape that appears more than once and reports the gap between the copies:

```bash
servediff repeats serve.log
```

```text
serve.log: 102 line(s), 14 shape(s) repeated 2+ time(s), 85 line(s) in them
    39x burst    11:33:26.640 -> 11:33:28.959  span 2.32 s
        gaps 0.010 s median, 0.900 s max
        [rank0]:[W831 11:33:26.640394862 CUDACachingAllocator.cpp:3933] memory allocation failed with OOM on device 0 while trying to allocate 20971520 bytes
    16x regular  11:34:32 -> 11:50:31  span 959 s
        gap 60.000 s median, 118.000 s max
        No available shared memory broadcast block found in 60 seconds. This typically happens when some processes are hanging or doing some time-consuming wo
```

`regular` means the gaps hold their value — 90 % of them within 5 % of the median — **and**
the median is at least a second. That is a watchdog re-logging one continuous wait, not
N stalls: 16 lines, one 959 s wait. `burst` is a retry loop, with millisecond gaps and
usually one much longer gap between bursts. `untimed` is a shape that carries no clock,
so only its count is reported.

The two readings decide different fixes. A warning that repeats every 60 s points at one
blocked reader holding a ring buffer; a burst of OOM lines points at one allocator budget
being hit repeatedly, and the free memory elsewhere in the log decides which. The
[#54559 analysis](https://github.com/apex-mochen/servediff/blob/main/ISSUE-54559-analysis.md)
is that reading worked out end to end.

Progress bars are split off first: tqdm rewrites one terminal row with `\r` and carries
no newline, so a captured log can glue the next process's line onto the bar's. Without
that split the warning hides behind the bar's digits and never groups with its own copies.
Timestamps are read as a set of moments, not a sequence, because two ranks interleave
their lines and a captured log can carry them out of order.

`--min N` hides shapes below the bar, `--top N` keeps the most frequent, `--markdown`
wraps the report in a fence for an issue, and `--json` emits
`{log, lines, repeated: [{count, first, last, span_s, median_gap_s, max_gap_s, regular}]}`
so a pipeline does not parse the text. Exit codes: `0` reported — a log that repeats
nothing is a valid answer; `2` unreadable path, or more than one `-`.

## Limits

- **Tested on:** log excerpts posted in vllm#47047 (v0.23) and vllm#53472 (v0.23, v0.26);
  full startup logs of vLLM 0.28.0 and 0.30.0 (single GPU, WSL2); a real TP=8 startup log
  from vllm#48591 (v0.23.1, one line per worker + role assignment); a TP4+EP excerpt from
  a 4×H200 node in vllm#45604 (v0.29.0, two all-reduce groups); a SGLang startup log from
  sgl-project/sglang#4862 (v0.4.4, TP=4, Qwen2.5-Omni-7B — the `server_args=ServerArgs(...)`
  keyword-call form is parsed, startup failure + root-cause error recorded). One log is a
  live server run rather than an excerpt: vLLM 0.33.0 on a single RTX 4060 Laptop (8 GB)
  under WSL2, Qwen2.5-0.5B, written by `capture` — the server answered `/health` and a
  completion, Ctrl-C exited `130` and kept the log, and the two env snapshots of that run
  diff down to the two variables that separated a crash from a start. A ROCm setup is
  covered too: a public `collect_env` dump from vllm#65034 (vLLM 0.29.1.dev, AMD Radeon
  AI PRO R9700, torch 2.13+rocm10.1) is a fixture, and its 180-line environment block
  yields the version facts instead of 175 "shapes worth a look". The NVIDIA side and a
  second engine are covered by more public reports: a production-image `collect_env`
  (vllm#63505, vLLM 0.32.0, CUDA 13.0), an eight-card MI355X block (vllm#65611) and a
  gVisor run (vllm#65250) — each 44–61 "worth a look" lines before, nothing after; a GB200
  NVL node (vllm#66192, aarch64, SM100) and an RTX PRO 6000 Blackwell box (vllm#66193) —
  nothing after, once the per-card model line and the InfiniBand NIC grid were understood;
  and six SGLang reports (sglang#41654, #42684, #43741, #46756, #48502, #49206), where the
  brackets around SGLang's timestamp and its own `name: value` dump were the misses; those six
  are now fixtures (`tests/fixtures/sglang-2026-10/`, `PROVENANCE.md` names the code blocks each
  file was assembled from) and `audit` reads them to zero while yielding the mamba cache, the
  concurrency cap it forces and the per-rank effective size. The
  parallel-config and all-reduce rules are checked against real TP>1 logs; MoE models in
  full logs, SGLang versions other than 0.4.4–0.5.20, Intel GPUs and other engines are not
  yet verified.
- Parsing is regex-based on log text, which changes between versions. A missed line
  shows up as `<absent>`, never as a wrong value — please report it. Run
  `servediff audit run1.log` first: it prints the lines no rule reads yet, and that
  report is the useful half of a bug report. On a real 170-line vLLM startup log that
  is 64 unread lines, all of them noise (the route table, banner art, deprecation
  warnings, progress bars, access logs) — the report counts the noise and, when something
  is worth a look, lists only that second group, so what you paste is short. On that log
  nothing is left worth a look, and a test holds it that way: the day a version prints a
  configuration line this parser does not read, the suite fails and names the shape.
  A log that died is the other common case, and its report had the same problem for a
  different reason: every frame of the traceback is a line no rule reads, so a 151-line
  crashed startup came back as 146 "shapes worth a look". The noise classifier now matches
  the message after stripping the `(EngineCore pid=…) ERROR … [core.py:…]` preamble, so
  frames, carets, `[shutdown]` chatter and logging-error dumps are counted as noise, and
  the last shapes that were left there are now read: the `Casting torch.bfloat16 to
  torch.float32` warning (`model.cast` — a silent numeric change no flag records), a failed
output handler (`startup: failed (output handler)`), and an installed-but-unimportable
optional kernel library (`kernel.module_missing`, `kernel.missing_lib`).
  One rule had to be withdrawn to make that sentence true: the "prose" classifier — a
  capitalised English sentence ending in a period, meant for text written *around* a pasted
  log — also matched messages the engine printed, so `Padding mamba page size by 20.75% …`,
  `Encoder cache will be initialized …`, `Explicitly set (4.0/30.69) GiB …` and `kv lcm block
  sizes 640` were counted as noise while `audit` said `nothing worth a look`. It now applies
  only to lines with no log preamble, all four are facts, and
  `test_a_sentence_a_log_actually_printed_is_never_prose_noise` pins the difference. All five full logs
now report `nothing worth a look`; the measurements behind that, and what it does not
prove, are in [writeups/audit-noise-real-logs.md](https://github.com/apex-mochen/servediff/blob/main/writeups/audit-noise-real-logs.md).
  `servediff audit --markdown run1.log` wraps it in a code fence sized around any
  backticks inside, so it can go straight into the issue form's third field.
  `servediff audit --max-shapes 20 run1.log` exits `1` when more than 20 shapes need a
  look — put that in a pipeline against a log from your own upgrade and the build fails
  when the server starts printing configuration this tool still cannot read, which is the
  moment you want to know rather than three regressions later.
  `servediff audit --json run1.log` is the same report for a pipeline: per log the
  `unread` and `shapes` counts, the shapes worth a look with their counts, and a total
  `shapes_worth_a_look`, so the gate reads a field instead of parsing a table. `--json`
  changes the format, not the exit code, and it does not mix with `--markdown`.
  `servediff audit --write-baseline accepted.json run1.log` records the shapes this run saw,
  and `servediff audit --baseline accepted.json --max-shapes 0 run2.log` counts only shapes
  that are not in it. Without that, a threshold gate goes red the first time the server prints
  a line the parser cannot read and stays red, which is how a gate gets deleted — and then
  nothing is checked at all. With a baseline the gate answers the question you actually have:
  did this upgrade make the server print configuration nothing reads. A shape in the baseline
  is still reported as unread, because it is — accepted once, not read.
- Two identical runs of the same server must not differ:
  [writeups/same-box-twice.md](https://github.com/apex-mochen/servediff/blob/main/writeups/same-box-twice.md)
  — why the four per-worker facts are read from the lowest rank (the other ranks stay in the
  evidence line) instead of being collapsed by line count, and why numeric rows print a
  magnitude (`-4.6%`) while text rows never invent one.
- When the server dies, the crash prints the whole `VllmConfig` it was running with
  (`Dumping input data for V1 LLM engine (v0.20.1) with config: …`) — one long line that
  records the model, dtype, `max_seq_len`, TP/PP/DP, prefix caching and the compile backend of
  the failed run. `servediff` reads it into facts, so the run that crashed is still comparable
  with the run that works; the same log can also carry `set_p2p_nccl_context` overrides and
  request fields the server accepted then ignored (`{'enable_thinking'}`).
- When htop shows "only two cores" on a CPU-only box with hundreds of threads,
  [writeups/vllm-cpu-384-threads.md](https://github.com/apex-mochen/servediff/blob/main/writeups/vllm-cpu-384-threads.md)
  reads a 22-line forum paste into 21 facts: 95 cores bound (192-286), one reserved, MEMBIND on
  node 0, Triton reporting 0 drivers so the run drops to the v1 model runner, and why a cpuset
  clamp — not a vLLM flag — is the reading that survives.
- The same notes as a plain web page: <https://apex-mochen.github.io/servediff/> —
  generated from `writeups/*.md` by `tools/build_site.py`, each page titled with the exact
  error string it is about.
- One worked example end to end: [writeups/wsl-uva-028-vs-030.md](https://github.com/apex-mochen/servediff/blob/main/writeups/wsl-uva-028-vs-030.md)
  — same flags on a laptop GPU under WSL2, 0.28.0 dies with `RuntimeError: UVA is not
  available`, 0.30.0 starts; the startup-log diff is 53 differences and 14 identical facts,
  and the one line that explains it is the pinned-memory fallback from vllm#56908.
- When the log says `No available shared memory broadcast block found in 60 seconds`,
  [writeups/vllm-shm-broadcast-60-seconds.md](https://github.com/apex-mochen/servediff/blob/main/writeups/vllm-shm-broadcast-60-seconds.md) gives
  the three arithmetic checks that separate a full `/dev/shm`, a capture still running, and
  one reader that stopped draining — worked through a real 102-line TP2 log, against the two
  answers that dominate search results.
- When the log says `min_p and logit_bias parameters won't work with speculative decoding`,
  [writeups/spec-decode-overrides.md](https://github.com/apex-mochen/servediff/blob/main/writeups/spec-decode-overrides.md)
  lists the three settings speculative decoding changes behind your back — the scheduled-token
  budget reset to 2048 while `--max-num-batched-tokens` stays in the args, `min_p`/`logit_bias`
  dropped, the MTP layer forwarded once per draft token — read from one 86-line forum paste that
  also names the quantised GEMM kernels the flags never do.

## License

Apache-2.0.
