Hello,
Sven Schüle wrote:Chan Rasjid wrote:AlvaroBegue wrote:It sounds like a bug.
Tell me I am that bad in progamming!
numpc[0][0] is all while pieces counting the king:
Code: Select all
if (numpc[0][0] == 2 && numpc[1][0] == 2
&&
((numpc[0][Bishop] == 1 && numpc[1][Rook] == 1)
|| (numpc[1][Bishop] == 1 && numpc[0][Rook] == 1))
) {
/* loss if wrong bishop */
return evalBR(side);
}
My codes have passed many many asserts! And play very normally. If the global arrays numpc[2][8] were wrong, I expected a big issue.
Since others suspect it is a bug, it somehow must be.
Best Regards,
Rasjid.
The condition looks correct to me. One question that comes to mind is _where_ the conditional code above is placed and _if_ that code is used at all. Add a printf("hi\n") immediately above the first line of the code you quoted, and if it is printed then change it into printing the values of all the numpc[][] values used in the condition. Maybe there is some other code in your program that prevents the code above from being called in a KRKB position.
Another question is whether your evalBR() function makes any assumption about which side has the rook and which the bishop.
Sven
It is a little silly right now and I can't make out what's what.
In my eval(), a material flag would flag out the conditions:
1) board at most only 1 pawn - calls evalAtMost1Pawn().
2) board only N/B - calls evalOnlyNB().
3) KPK.
4) definite material draws.
If not one of the above, then evaluation proceeds to the main body.
evalBR() is called within evalAtMost1Pawn() with the codes shown.
Code: Select all
int evalAtMost1P(const int side, const int w_mat_table) {
//...
if (numpc[0][0] == 2 && numpc[1][0] == 2
&&
((numpc[0][Bishop] == 1 && numpc[1][Rook] == 1)
|| (numpc[1][Bishop] == 1 && numpc[0][Rook] == 1))
) {
exit(-1);/* this never triggered */
return evalBR(side);
}
//exit(-1);/* this would be triggered */
/* TEMP as the other codes not finished; return -INFI means use the main evaluation */
return -INFI;
}
But if I put the condition blocks,etc at the very beginning of eval(), then the condition is satisfied and evalBR() is used:
...
### BR
### BR
### BR
### BR
### BR
### BR
### BR
### BR
### BR
50 g8e6 score( -255) depth(12) pvL( 7) ply(19) nps( 2712827) pc(4) cttime(19) ctpoll(0)
sec(0.14, used 0.26) nodes(708048, q 0.1%, h 21.1%, f 78.8%) FH(12.1%) evasion(5.9%) invalid(4.9%)
Root-red(0.00%, rsc -nan%) Root-research(13.64%) BranchF(0.80%)
Hash-hit(full 81.5%, qs 4.6%, p( 100.0%, cover 0.0%), ev (97.3%) matOWrite( 0.35) draw(184)
ext(1.67%) see(qs 0.14%, delay 20.57%) zero-wnd(15.09%, rsc 8.38%)
null(0.0% hit -nan% verify -nan% ok -nan% ) lmr(0.00%, rsc -nan%) ply1_rsc(0) fut(0.00%) killer(1.92%)
EV call(2.16%) lazy(0.00%) cut(0.00%) fl(0.00%)
The ### BR means call to evalBR(). And is it not a smart evaluator - it held komodo to a fifty draw.
To be embarrassingly honest, I don't really know the proper way to trace bugs - only the crude method of assert, printf and some simple stuffs from common sense when needed.
I'll have to see what's what.
Best Regards,
Rasjid.