feat!: Game is the type you get, and one_v_one returns one
`lib.rs` advertised `Game` in "Core types" as "one match in isolation". It had no public constructor: every `Game::*` returned `OwnedGame`, so `let g: Game = Game::ranked(..)?` did not compile. Names swapped. The public type is the owned one — `Game<T, D>`, no lifetime — and the borrowing form is `pub(crate) GameRef<'a, T, D>`, which is what it always was: an implementation detail about whether the result and weight slices are borrowed from `History`'s storage. That distinction meant nothing to someone scoring one match, and it showed the module's surface twice in rustdoc, since both types carried `posteriors()` / `log_evidence()`. `one_v_one` returned `(Gaussian, Gaussian)` while every sibling returned a game, making it the one constructor you could not ask for `log_evidence()`. It returns `Self` now; `.posteriors()` recovers the old shape, and the test that covers it now also asserts the evidence of two identical ratings is exactly `ln(0.5)`. `ranked`, `scored` and `free_for_all` had `# Errors` as their entire doc, so rustdoc's index rendered the error list as the summary. They have summary lines, and `Game` has a worked example — it was advertised as a core type with none anywhere in the crate. Closes #69. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011hcFjNDmHXZF8URGLku5zZ
This commit is contained in:
+3
-3
@@ -3053,8 +3053,8 @@ mod tests {
|
||||
|
||||
use super::*;
|
||||
use crate::{
|
||||
ConstantDrift, EPSILON, Event, Game, Gaussian, Member, Outcome, P_DRAW, Team,
|
||||
arena::ScratchArena,
|
||||
ConstantDrift, EPSILON, Event, Gaussian, Member, Outcome, P_DRAW, Team,
|
||||
arena::ScratchArena, game::GameRef,
|
||||
};
|
||||
|
||||
/// #17: a slice's footprint must be O(competitors in the slice), not
|
||||
@@ -3170,7 +3170,7 @@ mod tests {
|
||||
let observed = h.time_slices[1].skills.get(a).unwrap().posterior();
|
||||
|
||||
let w = [vec![1.0], vec![1.0]];
|
||||
let p = Game::ranked_with_arena(
|
||||
let p = GameRef::ranked_with_arena(
|
||||
h.time_slices[1].events[0].within_priors(
|
||||
false,
|
||||
&h.time_slices[1].skills,
|
||||
|
||||
Reference in New Issue
Block a user