Mirrors the textus setup, adapted for a single crate rather than a workspace. Cargo.toml gains publish = ["kellnr"], which does double duty: it points cargo-release at the private registry and makes an accidental `cargo publish` to crates.io a hard error rather than an irreversible mistake. .cargo/config.toml is committed rather than left to a per-user ~/.cargo/config.toml. Without it a fresh clone, a new machine, or CI fails with "registry index was not found in any configuration: kellnr" before compiling anything. The index URL is not a secret; the token stays in ~/.cargo/credentials.toml, or CARGO_REGISTRIES_KELLNR_TOKEN in CI. release.toml flips publish from false to true and pins push = false, so the Justfile recipe pushes last — after tags and publish have both succeeded. The git-cliff pre-release hook is unchanged. cliff.toml gained a Breaking Changes group. Its commit_parsers matched on type alone with conventional_commits = false, so `refactor!: remove the inert online flag` rendered as an ordinary Refactor bullet and the break was invisible in the generated changelog. The new parsers match a `!` subject and a BREAKING CHANGE body, and must precede the type parsers because the first match wins. The unreleased section now opens with the break, which matters because the next release is the one that removes HistoryBuilder::online. The release recipe runs `just ci` before cutting: cargo-release only verify-compiles the packaged crate and publishing cannot be undone, and the release profile is where this crate's defects have historically hidden. Still unpublishable: Cargo.toml has no `license`. That is a deliberate TODO, not an oversight. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T5SYDExxL4vZgvunrcNSMc
TrueSkill - Through Time
Rust port of TrueSkillThroughTime.py.
Other implementations
- ttt-scala
- ChessAnalysis #F
- TrueSkillThroughTime.jl
- TrueSkillThroughTime.R
- TrueSkill Through Time: Revisiting the History of Chess
- TrueSkill Through Time. The full scientific documentation
Drift
Skill drift models how a player's true skill can change between appearances. Each time a player reappears after a gap, their skill uncertainty is widened by the drift model before the new evidence is incorporated.
Drift is represented by the Drift trait:
pub trait Drift: Copy + Debug {
fn variance_delta(&self, elapsed: i64) -> f64;
}
variance_delta returns the amount to add to σ² given the elapsed time since the player last played. Internally, Gaussian::forget uses this to compute the new sigma: σ_new = sqrt(σ² + variance_delta).
ConstantDrift
The built-in ConstantDrift implements a linear random walk — skill uncertainty grows proportionally to time:
variance_delta = elapsed * γ²
This is the standard TrueSkill Through Time model. Use it by passing a ConstantDrift(gamma) when constructing a Player:
use trueskill_tt::{Player, Gaussian, drift::ConstantDrift};
// gamma = 0.1 means skill can shift ~0.1 per time unit
let player = Player::new(Gaussian::from_ms(0.0, 6.0), 1.0, ConstantDrift(0.1));
Custom drift
Implement Drift to express any other model. For example, a drift that saturates after a long absence (uncertainty grows with the square root of elapsed time instead of linearly):
use trueskill_tt::drift::Drift;
#[derive(Clone, Copy, Debug)]
struct SqrtDrift {
gamma: f64,
}
impl Drift for SqrtDrift {
fn variance_delta(&self, elapsed: i64) -> f64 {
(elapsed as f64).sqrt() * self.gamma * self.gamma
}
}
let player = Player::new(Gaussian::from_ms(0.0, 6.0), 1.0, SqrtDrift { gamma: 0.5 });
To use a custom drift type with History, use the .drift() builder method instead of .gamma():
let h = History::builder()
.drift(SqrtDrift { gamma: 0.5 })
.build();
Scored outcomes
Use Outcome::scores([...]) when you have continuous per-team scores rather
than just ranks. Adjacent score margins flow into a MarginFactor that adds
soft Gaussian evidence about the latent performance diff. Configure
HistoryBuilder::score_sigma(σ) to control how much you trust the margins
(smaller σ = more trust).
use trueskill_tt::{History, Outcome};
let mut h = History::builder().score_sigma(2.0).build();
h.event(1)
.team(["alice"])
.team(["bob"])
.scores([21.0, 9.0])
.commit()
.unwrap();
h.converge().unwrap();
Todo
- Implement approx for Gaussian
- Add more tests from
TrueSkillThroughTime.jl - Generalise a time axis —
Timeis now a trait (Untimed,i64), not an enum - Add examples (
examples/atp.rs,examples/scored.rs) - Add Observer (
Observer/NullObserver) - Benchmark the inference loop (
benches/batch.rs,benches/history_converge.rs,benches/ingest.rs) - Cross-check
quality()against sublee/trueskill — N-group support works and is covered by invariants, but no reference values are asserted