PVS & Embla

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

flok

Re: PVS & Embla

Post by flok »

Hi,

I tried that but:

Code: Select all

Rank Name       Elo    +    - games score oppo. draws
   1 dorpsgek   134    5    4 28434   70%   -44   16%
   2 trunk       87    5    6  9524   44%   134   20%
   3 pvs2b2      34    6    6  9474   37%   134   16%
   4 lmrpvs    -254    7    8  9436    8%   134   13%
As you see the to pvs variants I tried still play far worse than the non-pvs version (trunk).
abulmo2
Posts: 433
Joined: Fri Dec 16, 2016 11:04 am
Location: France
Full name: Richard Delorme

Re: PVS & Embla

Post by abulmo2 »

I guess there is one or several bugs in other places.
Within the loops (in both search & quiescence), the initialization to 0 of the score variable looks suspect to me. In some (rare ?) cases, bestval will be set to 0 instead of a more legible negative score.

Code: Select all

			int score = 0;
#ifdef USE_TT
			if (!addToHistory(sd -> history, newHash.newHash))
#endif
			{
should be replaced by

Code: Select all

			int score = -infinite; // anything <= bestval
#ifdef USE_TT
			if (!addToHistory&#40;sd -> history, newHash.newHash&#41;)
#endif
			&#123;
Richard Delorme
flok

Re: PVS & Embla

Post by flok »

The score will be 0 if a position repeats. This is to prevent 3-repeats.
abulmo2
Posts: 433
Joined: Fri Dec 16, 2016 11:04 am
Location: France
Full name: Richard Delorme

Re: PVS & Embla

Post by abulmo2 »

Sorry, your code is obviously too clever for me :-(
Richard Delorme
AlvaroBegue
Posts: 931
Joined: Tue Mar 09, 2010 3:46 pm
Location: New York
Full name: Álvaro Begué (RuyDos)

Re: PVS & Embla

Post by AlvaroBegue »

abulmo2 wrote:Sorry, your code is obviously too clever for me :-(
That is a problem. Clever code hides bugs. Code should be as clear as possible.

Of course I am guilty of writing clever code myself, but I do make some effort to keep things simple.

The way I handle repetitions is to call a function that checks for repetition and 50-move rule before the recursive call to negamax:

Code: Select all

      score = board.draw&#40;) ? 0 &#58; -negamax&#40;-beta, -alpha, depth - 1&#41;;
abulmo2
Posts: 433
Joined: Fri Dec 16, 2016 11:04 am
Location: France
Full name: Richard Delorme

Re: PVS & Embla

Post by abulmo2 »

AlvaroBegue wrote: That is a problem. Clever code hides bugs. Code should be as clear as possible.

Of course I am guilty of writing clever code myself, but I do make some effort to keep things simple.

The way I handle repetitions is to call a function that checks for repetition and 50-move rule before the recursive call to negamax:

Code: Select all

      score = board.draw&#40;) ? 0 &#58; -negamax&#40;-beta, -alpha, depth - 1&#41;;
My programs detect draws (3-fold repetition, 50-moves rule and lack of material) at the start of the negamax function, ie after the recursive call.

Code: Select all

	if &#40;board.isDraw&#41; return 0;
Before or after a function call is not important, but naming such a function with the word "draw" inside is.

I am impressed by the work that is behind Embla, that contains many more things than in Amoeba, like syzygy table support, mysql/sqlite3 opening books, multithreading, etc. But I am also disappointed by the weakness of the engine, that is much weaker than my bare engine https://github.com/abulmo/Dumb. I am convinced that some bugs or poor implementation are hidden in the code and prevent it to progress.
Richard Delorme
flok

Re: PVS & Embla

Post by flok »

Possibly yes, but I have no idea where.
Note that the movegen is a bit slow, that doesn't help either.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: PVS & Embla

Post by Henk »

Posting on this website makes your code also worse is my experience. Best is to stick to your own bad coding ideas.
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: PVS & Embla

Post by Sven »

Henk wrote:Posting on this website makes your code also worse is my experience. Best is to stick to your own bad coding ideas.
So maybe not posting for six months would give +600 Elo for Skipper? :lol:
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: PVS & Embla

Post by Henk »

Sven wrote:
Henk wrote:Posting on this website makes your code also worse is my experience. Best is to stick to your own bad coding ideas.
So maybe not posting for six months would give +600 Elo for Skipper? :lol:
It would already be an improvement if Skippers rating stayed equal.