Simplifying code II

Discussion of chess software programming and technical issues.

Moderator: Ras

Henk
Posts: 7251
Joined: Mon May 27, 2013 10:31 am

Re: Simplifying code II

Post by Henk »

"Does not matter if code contains bugs. Only matters if code is maintainable/readable. For if it is readable you can debug it"
Henk
Posts: 7251
Joined: Mon May 27, 2013 10:31 am

Re: Simplifying code II

Post by Henk »

LMR giving no improvement in my implementation. Even for extending captures.
Singular extensions neither. But should be tested better.
Aspiration searches no improvement.

Looks like only improving evaluation might give bit more Elo.

O wait it does a research when if (!(lb + 1== ub && reduction ==1 || val >= ub))
Doubt it that is correct because if val >= ub and reduction == 1 then it should do research too.

Being idiot again may be can start all over with testing.
Henk
Posts: 7251
Joined: Mon May 27, 2013 10:31 am

Re: Simplifying code II

Post by Henk »

Doubt it that is correct because if val >= ub and reduction > 1 then it should do research too.

Being idiot again may be can start all over again with testing.

Code should be

Code: Select all

if ((lb + 1== ub || val >= ub) && reduction == 1)
{
} else 
{
//research
 }
Grrr.
Henk
Posts: 7251
Joined: Mon May 27, 2013 10:31 am

Re: Simplifying code II

Post by Henk »

Using this now. Doubt if it is giving any gain

Code: Select all

 
		int reduction =  (depth <= 2 || mvIsCapture ) ? 1 : 2;
                var nullWindowValue = AlphaBetaSearch(out counterMoveLine, -(lb + 1), -lb, depth - reduction, check);
                val = nullWindowValue.HasValue ? -nullWindowValue.Value : null;
                if (val.HasValue)
                {
                    if (val > lb && (reduction > 1 || lb + 1 < ub))
                    {
                            // research
                            var researchVal = AlphaBetaSearch(out counterMoveLine, -ub, -lb, depth - 1, check);
                            val = researchVal.HasValue ? -researchVal.Value : null;
                    }               
                }
Henk
Posts: 7251
Joined: Mon May 27, 2013 10:31 am

Re: Simplifying code II

Post by Henk »

Looks like bit better than plain alphabeta. No large gain.
Henk
Posts: 7251
Joined: Mon May 27, 2013 10:31 am

Re: Simplifying code II

Post by Henk »

Unclear. May even be worse than plain alpha beta. Probably because of extending bad captures as well.