Author: Vincent Diepeveen
Date: 16:50:30 02/26/04
Go up one level in this thread
On February 26, 2004 at 15:53:15, Gerd Isenberg wrote:
>On February 26, 2004 at 15:13:16, Gerd Isenberg wrote:
>
>>On February 26, 2004 at 12:14:59, Vincent Diepeveen wrote:
>>
>>>On February 26, 2004 at 04:23:01, Gerd Isenberg wrote:
>>>
>>>><snip>
>>>>>>To avoid the white versus side to move score chaos, it makes sense to mirror all
>>>>>>>current black to move positions vertically with white to move.
>>>>>>
>>>>>>Oups, with mirror vertically i mean white pawn on e2 becomes black pawn on e7
>>>>>>and so on.
>>>>>
>>>>>i prefer also left right mirrorring. I bet diep is one of the few programs still
>>>>>displaying the same score then :)
>>>>
>>>>A good point, with respect to castle rights of course.
>>>>In my current program there are some asymmetries in (early) middlegame :-(
>>>>
>>>>In my new approach i will implement FRC-castles, but mirroring castles (rights)
>>>>is still not possible since king/rooks target squares are still asymmetric.
>>>>
>>>>Gerd
>>>
>>>You're not getting my point exactly.
>>>
>>>Try some known testset positions at Fritz and mirror them diagonally over a1-h8
>>>, so both color mirroring and left right mirrorring.
>>
>>Yes, i wrongly implied, if color mirroring is ok and left-right mirroring is ok,
>>combining both is ok too. But of course, it depends on the implementation.
>>
>>>
>>>Will it still find the solutions?
>>>
>>>I bet several positions it won't :)
>>>
>>>In all those positions there has already been castled, so no such problems.
>>>
>>>I'm talking about king safety patterns which are there for g,h file but not a,b
>>>file.
>>
>>You got me. Since my vertical color mirroring is perfectly ok (i'll hope), i
>>currently have exactly those asymmetries you mentioned with king- and queen
>>wings ;-)
>>
>>Not that i'm worried about that so much, since there are only slight differences
>>- anyway left-right symmetry is better to fix bugs and of course small eval
>>differences result in totally different search trees and behaviour.
>
>
>Sharing source code for left-right mirrored files and patterns is another issue.
>I like the idea of using C++ template int(kingwing|queenwing)-parameter with two
>function incarnations, rather than using an actual parameter with one single
>function.
I'm a big fan of writing general code which with a single for loop can mirror
quickly.
However, in practice this is not so easy, because many simple patterns simply
execute way faster when written out for black & white and left & right.
Additionally understand very well that programs like Fritz basically castle
short and basically never need those king safety patterns at the queenside.
So it saves out another few hundreds of cycles and you know how happy Frans is
with another 100 cycles. I can't blame him there.
I do understand it fully.
But back to implementation level, source code above all must be very readable.
If you cannot write readable code then it is very hard to improve your code,
especially when the total size gets pretty big.
Today i'm toying again with my own EGTBs again. In contradiction to my
evaluation function i can easily write some very neat general easy to use and
very portable code, which simply is not as fast as it could be!
Let's take a simple bishop pattern and write it out simple in the bishop
evaluation:
if( sq == sq_d3
&& snelbord[sq_d2] == pawn
&& snelbord[sq_c1] == bishop ) {
s += PAWN_BLOKT2ERIJ;
}
Now black:
if( sq == sq_d6
&& snelbord[sq_d7] == bpawn
&& snelbord[sq_c8] == bbishop ) {
s += PAWN_BLOKT2ERIJ;
}
The above code is very easy to understand and read. No confusion possible.
Additionally it's very fast to write. If datastructures get extended you don't
need to worry about weird variables or defines or whatever mirrorring.
Easy clear code.
Chance is like 95% that the first branch gives a misprediction.
So it's very fast code too, especially in PGO'ed executables.
>>
>>Thanks for pointing that out!
>>
>>Even more strange, since i already had implemented that mirroring feature with
>>the intention to check left-right mirrored endgame positions. But no kingsafety
>>issues which i always considered asymmetric for some reasons...
>>
>>Gerd
This page took 0 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.