0x88 engines

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Desperado
Posts: 879
Joined: Mon Dec 15, 2008 11:45 am

Re: 0x88 engines

Post by Desperado »

Aleks Peshkov wrote:Your toX88[] table is 64 byte long, so you get no win against a pure x88 engine at all. :)

The difference in speed is minimal of course, but it exists.
Hi Aleks,

for the board only, you are right. But _all_ tables within the engine
also only use table[64] instead of tb[128](or even tb[256]).
That sums together.

That means the principal board(table) concept is based on

type alltables[64]. (absolut basic board so to say)

There doesnt exist at least one _x88 range_.

Hi Stefano,

as i descriped directly above, i dont have a x88board[128].
i have a UI_08 board[64].(There arent any sq-relations like
in x88 boards)

But to take the advantage of the square-relations a x88board has,
and the easy out-of-board-test, i just emulate by the toX88[sq64]
So all tables (like pst) stay compact with index of 64.
On need, i can profit from x88 calculations by just using toX88[sq64].
although i dont really have a x88board (thats the point).

Aleks + Stefano

So in other words, it doesnt matter what kind of board-model you
have, every model can take the advantages of x88-calculations fully,
as long as your square index has an equivalent x88-sq-index at hand!

You dont have to restrict the boardmodel on x88board to take
advantage of its mechanics!

That is the point for me!

regards
User avatar
Desperado
Posts: 879
Joined: Mon Dec 15, 2008 11:45 am

Re: 0x88 engines

Post by Desperado »

PS:

So every non-x88 model can be simply _upgraded_ with

Code: Select all


square_t toX88[your_square_indices] = {...} (and all is done)

or if you have for example an 8x8 model

Code: Select all


square_t toX88[8][8] = {...}

and so on...

Definitely everyone has square indices
(at least square-centric-representations have),
and you can easily lookup the x88-index to
benefit from x88 contents (like testing boarders,attackdeltas...)

Everywhere where it is profitable. And as bonus, likely all board
representations have their own advantages,which will remain
of course.

just an additional square-index-lookup-table (And you are free
in your choice of board-representation)

:)
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: 0x88 engines

Post by stegemma »

Ok but if you have a 64 squares array you can translate it to x88 even without using the to X88 array:

index88 = index64 + (index64 & 111000b)

(b means binary)

in fact, the index64 index could be read like a binary number like this:

00yyyxxx

and the x88 can be read as this one:

wyyywxxx

where w=overflow bit (0 if ok)
yyy=rank
xxx=column

the formula index88 = index64 + (index64 & 111000b) works this way:

wyyyywxxxx = yyyxxx + (yyyxxx & 111000b)
wyyyywxxxx = yyyxxx + yyy000
wyyyywxxxx = 0yyy0xxx

in assembly:

(eax = index64)
Index64to88 proc
push ebx
mov ebx, eax
and ebx, 111000b
add eax, ebx ; or lea eax, [eax+ebx]
pop ebx
ret
endp
User avatar
Desperado
Posts: 879
Joined: Mon Dec 15, 2008 11:45 am

Re: 0x88 engines

Post by Desperado »

Hi Stefano,

maybe i can compute the indices directly, but a trivial
lookup is doing the job perfectly i think.

with toX88[myoriginalindex]. one table with 64 entries.

This can be done generally(and is cheap enough), even if someones squareindices doesnt allow a simple direct computation.Also you
can fill it with (8x16,16x16...) indices dependent which x88 style
you like most.

And my board-model is ready for x88-calculations where they are
important.

(For me i would name x88 methods _index-centric_ and neither square nor piece centric. Which can be used as buildup for all square centric
approaches, just by using a simple additionally array)


thx for reply