Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: EPD opcodes and mate scores

Author: Miguel A. Ballicora

Date: 10:09:21 12/18/01

Go up one level in this thread


On December 18, 2001 at 12:41:29, Miguel A. Ballicora wrote:

>On December 18, 2001 at 02:15:31, Rafael Andrist wrote:
>
>>On December 17, 2001 at 15:06:09, Dann Corbit wrote:
>>
>>>On December 17, 2001 at 14:53:12, Rafael Andrist wrote:
>>>
>>>>In the PGN/EPD specification I couldn't find any human friendly way to indicate
>>>>the distance to the mate if it is the side the move which will be mated. I know
>>>>it would be possible with the "ce" opcode but this is a little bit more
>>>>difficult to read. Is there any way to indicate it in an easy way like the "dm"
>>>>it does if the side to move mates the opponent? Should I use e.g. "dm -3" or is
>>>>this a bad idea? Any suggestions?
>>>
>>>From the PGN Standard, we have this:
>>>-------------------------------------------------------------------------------
>>>16.2.5.7: Opcode "dm": direct mate fullmove count
>>>
>>>The "dm" opcode is used to indicate the number of fullmoves until checkmate is
>>>to be delivered by the active color for the indicated position.  It always
>>>takes a single operand which is a positive integer giving the fullmove count.
>>>For example, a position known to be a "mate in three" would have an operation
>>>of "dm 3;" to indicate this.
>>>
>>>This opcode is intended for use with problem sets composed of positions
>>>requiring direct mate answers as solutions.
>>>-------------------------------------------------------------------------------
>>>Because of the statement "by the active color" I think negative numbers are out.
>>>
>>>Unfortunately, *most* implementers of PGN ignore the correct use of the ce
>>>opcode (though I think 32767 should be allowed for 'this is a checkmate' rather

I just realized that the EPD standard do not take into account the evaluation
of a position that _is_already_ a checkmate!
That is a flaw. 32767 is not a valid number.
-32767 should be "this is a checkmate, active player is gonna be mated in
0 zero plies" and the positive 32767 should have been reserved for illegal
position. But I guess it is too late...
32767 cannot possibly be a valid number because in the spirit of the standard
a checkmate position is a negative number for the active player that is
mated.
Interestingly, as a corollary of the standard, 32765, 32763, 32761 etc.
are not valid numbers for evaluation but it is just a curiosity.
You cannot be that active player in a position and deliver mate in 2, 4, 6 etc
plies. That includes 0.

16.2.5.6: Opcode "ce": centipawn evaluation

The opcode "ce" indicates the evaluation of the indicated position in centipawn
units.  It takes a single operand, an optionally signed integer that gives an
evaluation of the position from the viewpoint of the active player; i.e., the
player with the move.  Positive values indicate a position favorable to the
moving player while negative values indicate a position favorable to the
passive player; i.e., the player without the move.  A centipawn evaluation
value close to zero indicates a neutral positional evaluation.

Values are restricted to integers that are equal to or greater than -32767 and
are less than or equal to 32766.

A value greater than 32000 indicates the availability of a forced mate to the
active player.  The number of plies until mate is given by subtracting the
evaluation from the value 32767.  Thus, a winning mate in N fullmoves is a mate
in ((2 * N) - 1) halfmoves (or ply) a
nd has a corresponding centipawn
evaluation of (32767 - ((2 * N) - 1)).  For example, a mate on the move (mate
in one) has a centipawn evaluation of 32766 while a mate in five has a
centipawn evaluation of 32758.

A value less than -32000 indicates the availability of a forced mate to the
passive player.  The number of plies until mate is given by subtracting the
evaluation from the value -32767 and then negating the result.  Thus, a losing
mate in N fullmoves is a mate in (2 * N) halfmoves (or ply) and has a
corresponding centipawn evaluation of (-32767 + (2 * N)).  For example, a mate
after the move (losing mate in one) has a centipawn evaluation of -32765 while
a losing mate in five has a centipawn evaluation of -32757.

A value of -32767 indicates an illegal position.  A stalemate position has a
centipawn evaluation of zero as does a position drawn due to insufficient
mating material.  Any other position known to be a certain forced draw also has
a centipawn evaluation of zero.




>>>than used for indication of error).  At any rate, you cannot count on 32767-n
>>>being ply distance to mate.  All sorts of values are used, and that is why
>>>distance to mate is unclear.  Because people ignore the standard.
>>
>>32767-n is wrong too... Please have a look at the standard again.
>>Most ce-programs are using a 16 bit integer for the score. The range of a signed
>>integer is [-32768;32767]
>
>I guess it might depend on the language, but in C the portable range for
>a signed integer is -32767 to 32767.
>
>>in the "ce" opcode -32767 is used for illegal position and the effective "ce"
>>range for legal positions goes from -32766 to 32766, and -32768/32767 can
>>internally used for -/+ infinity.

I checked the standard and I could not find this.

Regards,
Miguel


>
>I will check the EPD standard again but I do not think they contemplate the
>possibility of using -32768. Otherwise, it is broken.
>
>Regards,
>Miguel

I checked the standard and I could not find this.

>
>
>>
>>
>>>My suggestion is:
>>>c0 "Mate in three for the opposing side."
>>
>>This may be a solution for a single position, but not for a list of 1000 or more
>>positions. This would also nearly double the needed disk space.
>>
>>I think i will use a new opcode "om x" (= opponent mates in x) and then add a
>>"ce" opcode to make it clear for other programs.
>>
>>Rafael B. Andrist



This page took 2.94 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.