Skip to main content
← Lab

mirostatclone

confirmedupstream bugC++Inference & servingJuly 13, 2026

the question

Does cloning a Mirostat v1 sampler preserve its adapted controller state mu, or does it revert to a fresh init?

what came out

Confirmed. llama_sampler_mirostat_clone casts result_ctx from smpl->ctx (the source) rather than result->ctx, so both state copies are self-assignments and the clone keeps the init mu=2*tau. The controller restarts cold. Every other stateful clone, including Mirostat v2, casts correctly; v1 is the lone outlier.

method & receipts

  • Result: confirmed
  • Pre-registered the prediction was written down and committed before the run.
  • Reproducible one script re-runs the whole thing from scratch.
  • Tested — a correctness/benchmark suite ships alongside the code.

→ read the code and re-run it

github.com/v-code01/mirostatclone