I don't think I could recall any bug which I encountered in the past which could be attributed to the gcc compliler. I don't believe much in compiler bugs. But I could not see any bug in the codes below.
The first assert was cleared; the assert B was triggered with:
1) currstack->fifty == 3.
2) move->score == EXACT_SCORE_BASE;
Only line that sets it is line A within the repetition loop.
Hopefully, I did not miss something glaringly obvious.
for clarity, what is EXACT_SCORE_BASE vs EVAL_SCORE_BASE? (i'm having a hard time imagining why EXACT_SCORE_BASE is not between -inf and +inf for you (or if it is outside that range intentionally, why it's asserted as impossible)
kbhearn wrote:for clarity, what is EXACT_SCORE_BASE vs EVAL_SCORE_BASE? (i'm having a hard time imagining why EXACT_SCORE_BASE is not between -inf and +inf for you (or if it is outside that range intentionally, why it's asserted as impossible)
The code is actually doing the initial ordering using eval() from a base of EVAL_SCORE_BASE. It is intended that after the first root iteration, there may be some exact scores that would be scored from EXACT_SCORE_BASE. Repetition would be scored this way.
when you catch a repetition it appears you unmake the move but then stay in the repetition loop starting with i = 0. This would cause a loop until (i assume) unmake takes the currstack->fifty below where the repetition occurs (say it occurs at i=4), then currstack->fifty = 3, move->score = EXACT_SCORE_BASE, and i = 4 to skip the i==0 condition and assert B should trigger essentially any time a repetition is found...
kbhearn wrote:for clarity, what is EXACT_SCORE_BASE vs EVAL_SCORE_BASE? (i'm having a hard time imagining why EXACT_SCORE_BASE is not between -inf and +inf for you (or if it is outside that range intentionally, why it's asserted as impossible)
The code is actually doing the initial ordering using eval() from a base of EVAL_SCORE_BASE. It is intended that after the first root iteration, there may be some exact scores that would be scored from EXACT_SCORE_BASE. Repetition would be scored this way.
Rasjid.
Then which value of move->score triggers your assertion?
Perhaps you need to write something like a RANGE_ASSERT() macro that prints more information before firing the assertion.
If you have the source of the function that is called by assert() then you can also set a breakpoint and inspect your variables. To avoid such trouble of setting breakpoints in external library code I usually define my own ASSERT() macro.
kbhearn wrote:when you catch a repetition it appears you unmake the move but then stay in the repetition loop starting with i = 0. This would cause a loop until (i assume) unmake takes the currstack->fifty below where the repetition occurs (say it occurs at i=4), then currstack->fifty = 3, move->score = EXACT_SCORE_BASE, and i = 4 to skip the i==0 condition and assert B should trigger essentially any time a repetition is found...
You are right. Now everything runs smoothly.
I wanted to break and continue with the next move and used unmake() with continue; but notice it was within the repetition loop. So I did the i = 0,... and meant to break from the repetition loop. I forgot to add the break... and also failed to see it...