Meaning of POSITION->DYN

Discussion of chess software programming and technical issues.

Moderator: Ras

benstoker
Posts: 342
Joined: Tue Jan 19, 2010 2:05 am

Meaning of POSITION->DYN

Post by benstoker »

Can someome please explain what the "POSITION->DYN . . . " construct is throughout the robbo* code. What does "DYN" stand for?

From Robbo*:

Code: Select all

void Mobility (typePOS* POSITION)
{
	uint64 U, A, T, AttB, AttR;
	int b;
	POSITION->DYN->wXray = 0;
	POSITION->DYN->bXray = 0;
	A = AttK[POSITION->wKsq];
	POSITION->DYN->wAtt = A;
	if (A & bBitboardK)
		POSITION->DYN->bKcheck = SqSet[POSITION->wKsq];
	else
		POSITION->DYN->bKcheck = 0;
	A = AttK[POSITION->bKsq];

bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Meaning of POSITION->DYN

Post by bob »

benstoker wrote:Can someome please explain what the "POSITION->DYN . . . " construct is throughout the robbo* code. What does "DYN" stand for?

From Robbo*:

Code: Select all

void Mobility (typePOS* POSITION)
{
	uint64 U, A, T, AttB, AttR;
	int b;
	POSITION->DYN->wXray = 0;
	POSITION->DYN->bXray = 0;
	A = AttK[POSITION->wKsq];
	POSITION->DYN->wAtt = A;
	if (A & bBitboardK)
		POSITION->DYN->bKcheck = SqSet[POSITION->wKsq];
	else
		POSITION->DYN->bKcheck = 0;
	A = AttK[POSITION->bKsq];

A guess would be "dynamic" in that it is something that is updated as you walk up and down the tree, but I have not looked at the code very carefully at all beyond noticing how ugly it is...
User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: Meaning of POSITION->DYN

Post by michiguel »

benstoker wrote:Can someome please explain what the "POSITION->DYN . . . " construct is throughout the robbo* code. What does "DYN" stand for?

From Robbo*:

Code: Select all

void Mobility (typePOS* POSITION)
{
	uint64 U, A, T, AttB, AttR;
	int b;
	POSITION->DYN->wXray = 0;
	POSITION->DYN->bXray = 0;
	A = AttK[POSITION->wKsq];
	POSITION->DYN->wAtt = A;
	if (A & bBitboardK)
		POSITION->DYN->bKcheck = SqSet[POSITION->wKsq];
	else
		POSITION->DYN->bKcheck = 0;
	A = AttK[POSITION->bKsq];

It is a Gaviota Clone!

po->bi.dyn[WH].pawn_att = p_att0;
po->bi.dyn[WH].all_att = allth;

Since it is a gaviota clone, I can say "dynamic" are properties of the board that depend of other "static" things. For instance, attacks. Those dynamic characteristics may or may not have been updated after a move. The static characteristics, of course, are always up to date

For instance, there is a Bishop in e4, that is a static property.
The attacks of the bishop depends of the position of other pieces, hence, I call it dynamic. The dynamic properties are updated only when needed.

Miguel
Dann Corbit
Posts: 12792
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Meaning of POSITION->DYN

Post by Dann Corbit »

Code: Select all

typedef struct typeDYNAMIC
{
    /* 0x00-0x0f */
    uint64 HASH, PAWN_HASH;
    /* 0x10-0x1b */
    uint32 material, STATIC, _7; /* STATIC es sint32 ? */
    /* 0x1c-0x1f */
    uint8 oo, reversible, ep, cp;
    /* 0x20-0x3f */
    uint64 wAtt, Batt, wXray, bXray;
    /* 0x40-0x47 */
    sint32 Value, positional_valu;
    /* 0x48-0x51 */
    uint16 _5, _6, killer1, killer2, move;
    /* 0x52-0x57 */
    uint8 _0, _3, _4, lazy, SAVED_FLAGS, flags;
    /* 0x58-0x7f */
    uint64 wKcheck, bKcheck, _1, _2, _8;
} typeDYNAMIC;