pub enum MaybeRounded<T> {
    Rounded(T),
    Precise(T),
}
Expand description

A value that may be affected by DTZ rounding.

DTZ

Rounded Dtz values may be off by one:

  • MaybeRounded::Rounded(Dtz(-n)) can mean a loss with a forced zeroing move in n or n + 1 plies.
  • MaybeRounded::Rounded(Dtz(n)) can mean a win with a forced zeroing move in n or n + 1 plies.

WDL

Because of that MaybeRounded::Rounded(Dtz(100)) might correspond to Wdl::Win or Wdl::CursedWin, and MaybeRounded::Rounded(Dtz(-100)) might correspond to Wdl::Loss or Wdl::BlessedLoss.

Rounding will never be used for endgame phases that are exactly on the edge of the 50-move rule (value ±100 directly after a capture or pawn move).

Move selection

So some primary tablebase lines may waste up to 1 ply, but never more, and never for endgame phases (starting after a capture or pawn move) where wasting 1 ply would change the game theoretical outcome.

Users need to be careful in positions that are nearly drawn under the 50-move rule! Carelessly wasting 1 more ply by not following the tablebase recommendation, for a total of 2 wasted plies, may change the outcome of the game afterall.

For some background, see this and the following posts on talkchess.com.

Variants§

§

Rounded(T)

Inner value potentially affected by DTZ rounding.

§

Precise(T)

Inner value not affected by DTZ rounding.

Implementations§

Applies a function to the inner value.

Gets the inner value.

Gets the inner value, or None if it was affected by DTZ rounding.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
The resulting type after applying the - operator.
Performs the unary - operation. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.