pointy chains redux (part 1)

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: extending the chain (part 3)

Post by Lyudmil Tsvetkov »

cdani wrote:
Lyudmil Tsvetkov wrote: Pawel was splitting eval to pointed chains with some pawns blocked and pointed chains with a single/no pawns blocked, something like that.
Yes, it's exactly what I have done :-)

Code: Select all

 if ((Pawns(white) & 0x1008040000ULL) == 0x1008040000ULL) { //c3 d4 e5 
means "if there are white pawns at c3, d4 and e5",

Code: Select all

i += ((Pawns(black) & 0x100800000000ULL) == 0x100800000000ULL) ? pc1 : pc2; //d5 e6 
then add pc1 (25) if there are also black pawns at d5 and e6, or pc2 (20) if not.
Then do the opposite: do not split eval, but just give uniform bonus... :)

Or, give different bonus to different pointed chains, maybe a chain with an f5 spearhead is worth more in Andscacs than a chain with an e5 spearhead, etc., etc.

Maybe look for where the kings are, or maybe do not.

In any case, if you are not able to implement this in Andscacs after a months's efforts, I do not know who will be...
User avatar
velmarin
Posts: 1600
Joined: Mon Feb 21, 2011 9:48 am

Re: extending the chain (part 3)

Post by velmarin »

cdani wrote:Finally I tried this on Andscacs, but without luck :-(

Code: Select all

#define pc1 25
#define pc2 20
	//pointy chains
	if (COL(opponent_king) >= 4) {
		if (me == white) {
			if ((Pawns(white) & 0x1008040000ULL) == 0x1008040000ULL) { //c3 d4 e5
				i += ((Pawns(black) & 0x100800000000ULL) == 0x100800000000ULL) ? pc1 : pc2; //d5 e6
			}
			
	
Also tried with 15 and 10. May be I will try with even lower bonus.
You should not specify that they are exactly three pawns.
if ((popcount(pawn(white) & 0x1008040000ULL)== 3)
Or do even that, square, square.
if((pawn(white)&C3)&&(pawn(white)&D4)&&(pawn(white)&E5))

Try with exaggerated score, and put a position analysis.
However if there are other codes that give bonuses for support (bonus x 2, ) and penalize the block should suffice.
mar
Posts: 2662
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: extending the chain (part 3)

Post by mar »

velmarin wrote:You should not specify that they are exactly three pawns.
if ((popcount(pawn(white) & 0x1008040000ULL)== 3)
Or do even that, square, square.
if((pawn(white)&C3)&&(pawn(white)&D4)&&(pawn(white)&E5))
Jose,
he's doing if ( (bb & mask) == mask ) {}
Since mask has only 3 bits set, what he does is already optimal, popcnt would accomplish the same but would be most likely slower.
User avatar
velmarin
Posts: 1600
Joined: Mon Feb 21, 2011 9:48 am

Re: extending the chain (part 3)

Post by velmarin »

mar wrote: Jose,
he's doing if ( (bb & mask) == mask ) {}
Since mask has only 3 bits set, what he does is already optimal, popcnt would accomplish the same but would be most likely slower.
Thanks Martin,
my understanding was that if a one pawn in the mask is already true,
If the equality (==) forced three, I didn't know it, certainly.
As regards popcnt, never I gave speed problems.
Thanks.
PK
Posts: 907
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Re: extending the chain (part 3)

Post by PK »

@Daniel Jose,

it is possible that pawn chain bonus is dependent on many things that I am not aware of (and perhaps only doing a complete rewrite of the engine would show what the prerequisites are). A couple of ideas:

- does Andrasac have aggressive pawn storm eval (Rodent is generally timid in that respect, and this would be the simplest explanation of the difference between our engines)?
- does it have a bonus for two pawns next to each other on the same rank (this would facilitate operations on the files next to pawn chains, creating levers, keeping tension etc.)?
- are the pawns factored in king attack eval (for me doing it with e5 pawn helps, but doing the same with f5 pawn hurts)
- I am using a mask for King positions (F1-G1-H1-F2-G2-H2, used also for other things like fianchetto eval), you are using only the rank
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: extending the chain (part 3)

Post by cdani »

velmarin wrote: my understanding was that if a one pawn in the mask is already true,
If the equality (==) forced three, I didn't know it, certainly.
As regards popcnt, never I gave speed problems.
Thanks.
So yes, it's already doing well it, so finding the three pawns.

Popcount it's slower in itself, so an assembler popcnt is a lot slower than an assembler cmp or similar.
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: extending the chain (part 3)

Post by cdani »

Hi.
PK wrote:@Daniel Jose,

it is possible that pawn chain bonus is dependent on many things that I am not aware of (and perhaps only doing a complete rewrite of the engine would show what the prerequisites are).
Sure. Really I don't work a lot on the changes I do in Andscacs, because at least until now I was able to improve it mostly with simple things.


- does Andscacs have aggressive pawn storm eval (Rodent is generally timid in that respect, and this would be the simplest explanation of the difference between our engines)?

No.

- does it have a bonus for two pawns next to each other on the same rank (this would facilitate operations on the files next to pawn chains, creating levers, keeping tension etc.)?

No.

- are the pawns factored in king attack eval (for me doing it with e5 pawn helps, but doing the same with f5 pawn hurts)

No.

- I am using a mask for King positions (F1-G1-H1-F2-G2-H2, used also for other things like fianchetto eval), you are using only the rank

Nothing similar.


I think that it does not works because Andscacs it's more search oriented, instead of eval oriented, and also the evaluation, although quite complete, it's not specially well tuned. In fact it plays illogically in a lot of positions.
carldaman
Posts: 2287
Joined: Sat Jun 02, 2012 2:13 am

Re: extending the chain (part 3)

Post by carldaman »

Very interesting - thanks for giving this a shot, Daniel!

In the 3 main parts I outlined the pre-conditions that must be present for the directional chains/triads to be effective. It looks like you accounted for the defending King's position and for the interlocking chains (including the congestion points, forming a barrier) to be present, but what about the material count?

I estimate the total non-pawn material count for the attacking side has to be at least 20-22 points (where Q=10, R=5, B=3.5, N=3.5, P=1) AND the Queens must also be on the board. This is extremely important, or else the directional interlocking chain won't be worth much at all.

We need a lot of pieces to be on the board for the chains to be effective, so that on one hand the attacking side is able to sacrifice material and still have enough firepower to finish off the attack AND (just as important) the defending side will suffer from congestion, where the defending pieces will interfere with their King's escape.

In addition, these pre-conditions, when present, must trigger a further bonus for Kingside pawn storms, encouraging the g- and h-pawns to also join in the attack and either open lines or further extend the existing chain (to f6 or g6).

IF all these conditions are factored in, I would estimate a f5-pawn triad (a chain of at least 3 pawns or longer, d3-e4-f5) to be worth more than an e5-triad, and an f6 or g6-triad to be worth even more. Maybe 25 cp for an e5 triad, 35 cp for f5, and 40+ for f6 and g6, but you have some freedom to tinker with these. :)

All the basic criteria are mentioned in the 3 parts I already posted. I am going to post an addendum with further (counter)examples, when I have more time.

Regards,
CL
cdani wrote:Finally I tried this on Andscacs, but without luck :-(

Code: Select all

#define pc1 25
#define pc2 20
	//pointy chains
	if (COL(opponent_king) >= 4) {
		if (me == white) {
			if ((Pawns(white) & 0x1008040000ULL) == 0x1008040000ULL) { //c3 d4 e5
				i += ((Pawns(black) & 0x100800000000ULL) == 0x100800000000ULL) ? pc1 : pc2; //d5 e6
			}
			if ((Pawns(white) & 0x201008000000ULL) == 0x201008000000ULL) { //d4 e5 f6
				i += ((Pawns(black) & E6) == E6) ? pc1 : pc2;
			}
			if ((Pawns(white) & 0x2010080000ULL) == 0x2010080000ULL) { //d3 e4 f5
				i += ((Pawns(black) & 0x1008000000ULL) == 0x1008000000ULL) ? pc1 : pc2; //d4 e5
			}
			if ((Pawns(white) & 0x402010000000ULL) == 0x402010000000ULL) { //e4 f5 g6
				i += ((Pawns(black) & F6) == F6) ? pc1 : pc2;
			}
		}
		else {
			if ((Pawns(black) & 0x40810000000ULL) == 0x40810000000ULL) { //c6 d5 e4
				i += ((Pawns(white) & 0x8100000ULL) == 0x8100000ULL) ? pc1 : pc2; //d4 e3
			}
			if ((Pawns(black) & 0x810200000ULL) == 0x810200000ULL) { //d5 e4 f3
				i += ((Pawns(white) & E3) == E3) ? pc1 : pc2;
			}
			if ((Pawns(black) & 0x81020000000ULL) == 0x81020000000ULL) { //d6 e5 f4
				i += ((Pawns(white) & 0x810000000ULL) == 0x810000000ULL) ? pc1 : pc2; //d5 e4
			}
			if ((Pawns(black) & 0x1020400000ULL) == 0x1020400000ULL) { //e5 f4 g3
				i += ((Pawns(white) & F3) == F3) ? pc1 : pc2;
			}
		}
	}
Also tried with 15 and 10. May be I will try with even lower bonus.
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: extending the chain (part 3)

Post by cdani »

I tried with more restrictive prerequisites, but also without luck.

Abstract:

If Number_of_pices_that_attack_the_king > 1 and oponent_piece_value > 2500 then ...
User avatar
velmarin
Posts: 1600
Joined: Mon Feb 21, 2011 9:48 am

Re: extending the chain (part 3)

Post by velmarin »

cdani wrote:I tried with more restrictive prerequisites, but also without luck.

Abstract:

If Number_of_pices_that_attack_the_king > 1 and oponent_piece_value > 2500 then ...
I think it is one of the problems of the evaluation, we "make score" when the position has occurred.
But this does not require engine to play it.
So we have to tell "the engine" this is good with another method.
There is much work to do.
Thinking that it was before "the chicken or the egg".