penalty for lack of growth

Discussion of chess software programming and technical issues.

Moderator: Ras

lech
Posts: 1169
Joined: Sun Feb 14, 2010 10:02 pm

penalty for lack of growth

Post by lech »

Users of engines („go infinite ") have a problem with the fortress, „crazy piece” or magnetic passed pawn.
I think this can easily and safely be solved by a penalty for lack of growth (e.g. UCI option). :roll:

Algorithm:

Code: Select all

depth: x
scores: x’, x”
penalty: p
expected increase: y
threshold (positive): w 

on x depth a move gets score x’ 
on (x + 1) depth the same move gets score x”

if ((x” > w)  & (abs(x” – x’) < y) )
{i= i + 1 + (x” < = x’);
  x” = x’; // to break it (if stable small increase) or to avoid a swing
  score of this move =  Max(0, x” – p * i); }
else {i=0;
 score of this move =  x”;}
 
Dann Corbit
Posts: 12790
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: penalty for lack of growth

Post by Dann Corbit »

lech wrote:Users of engines („go infinite ") have a problem with the fortress, „crazy piece” or magnetic passed pawn.
I think this can easily and safely be solved by a penalty for lack of growth (e.g. UCI option). :roll:

Algorithm:

Code: Select all

depth: x
scores: x’, x”
penalty: p
expected increase: y
threshold (positive): w 

on x depth a move gets score x’ 
on (x + 1) depth the same move gets score x”

if ((x” > w)  & (abs(x” – x’) < y) )
{i= i + 1 + (x” < = x’);
  x” = x’; // to break it (if stable small increase) or to avoid a swing
  score of this move =  Max(0, x” – p * i); }
else {i=0;
 score of this move =  x”;}
 
What if the lack of growth move is the only move that saves a draw?
We might penalize it and switch to a losing move.
lech
Posts: 1169
Joined: Sun Feb 14, 2010 10:02 pm

Re: penalty for lack of growth

Post by lech »

Dann Corbit wrote:
lech wrote:Users of engines („go infinite ") have a problem with the fortress, „crazy piece” or magnetic passed pawn.
I think this can easily and safely be solved by a penalty for lack of growth (e.g. UCI option). :roll:

Algorithm:

Code: Select all

depth: x
scores: x’, x”
penalty: p
expected increase: y
threshold (positive): w 

on x depth a move gets score x’ 
on (x + 1) depth the same move gets score x”

if ((x” > w)  & (abs(x” – x’) < y) )
{i= i + 1 + (x” < = x’);
  x” = x’; // to break it (if stable small increase) or to avoid a swing
  score of this move =  Max(0, x” – p * i); }
else {i=0;
 score of this move =  x”;}
 
What if the lack of growth move is the only move that saves a draw?
We might penalize it and switch to a losing move.
It is for „go infinite” and a mindful choice (by UCI option).
This move on the end of analyze gets 0 score. If the other can get higher score, it is the better move.
It will be welcome by many of us :D
Is it better to see a bad score in the fortress, „crazy piece” or magnetic passed pawn and many endgames???? :oops:
lech
Posts: 1169
Joined: Sun Feb 14, 2010 10:02 pm

Re: penalty for lack of growth

Post by lech »

I corrected the algorithm. It is interesting that it can solve the “null move problem” too. 8-)
How to set values x, y, w, m?
If the values are set correctly it is impossible to lose a good result. :P

Code: Select all

depth: x 
scores: x1, x2 
penalty: p 
expected increase: y 
threshold : w 
min score: m

on x depth a move gets score x1 
on (x + 1) depth the same move gets score x2 

if ((x2 > w)  && (abs(x2 – x1) < y) ) 
{i = i + 1 + (x2 < = x1); 
x2  = x1;  // to break if is a stable increase
 score of this move =  Max(m, x2 – p * i); } 
else {i=0; 
 score of this move =  x2}
lech
Posts: 1169
Joined: Sun Feb 14, 2010 10:02 pm

Re: penalty for lack of growth

Post by lech »

Thanks for applause! :o :lol:
I understand that the immediate Dann Corbit’s (well-thought-out ! 8-) ) opinion was bought by others. :cry:
My dedication, for all creators of ELO-engines (clones too :wink: ) so-called “chess engines”, is the following position:
[d] 8/5pKN/5Pp1/5kP1/1B6/8/b7/7q b - -
If your engine is able to make (“go infinite”) 1...Qxh7 simple move, you may use the name “chess engine” for your product. :lol:
User avatar
marcelk
Posts: 348
Joined: Sat Feb 27, 2010 12:21 am

Re: penalty for lack of growth

Post by marcelk »

lech wrote:Thanks for applause! :o :lol:
I understand that the immediate Dann Corbit’s (well-thought-out ! 8-) ) opinion was bought by others. :cry:
My dedication, for all creators of ELO-engines (clones too :wink: ) so-called “chess engines”, is the following position:
[d] 8/5pKN/5Pp1/5kP1/1B6/8/b7/7q b - -
If your engine is able to make (“go infinite”) 1...Qxh7 simple move, you may use the name “chess engine” for your product. :lol:
Marek,

1. Is this a position from an actual game or is it a study?

2. Did you test your lack-of-growth-algorithm in this position? Did it find Qxh7? Can you show the engine output?
lech
Posts: 1169
Joined: Sun Feb 14, 2010 10:02 pm

Re: penalty for lack of growth

Post by lech »

marcelk wrote: 1. Is this a position from an actual game or is it a study?
2. Did you test your lack-of-growth-algorithm in this position? Did it find Qxh7? Can you show the engine output?
Is it a strange position ?
I am preparing a GUI (for myself) with option:
MuliPV = all possible moves.

I will test my algorithm with e.g. setting:
w = 100 (for SF)
y = (x2 – w) / 40
p = y
m = w + y // „+ y” if there is no a better hidden move

Code: Select all

 depth: x 
scores: x1, x2 
penalty: p 
expected increase: y 
threshold : w 
min score: m 

on x depth a move gets score x1 
on (x + 1) depth the same move gets score x2 

if ((x2 > w)  && (abs(x2 – x1) < y) ) 
{i = i + 1 + (x2 < = x1); 
x2  = x1;  // to break if is a stable increase 
 score of this move =  Max(m, x2 – p * i); } 
else {i=0; 
 score of this move =  x2}
I believe it should work correctly. Of course, only if a hidden better move (like 1...Qxh7) is one of first moves.
[d] 8/1q3pKN/5Pp1/5kP1/1B6/8/b7/8 b - -
The solution 1...Qh1 and 2...Qxh7 can be find only after some changes in codes of engines.