Yes, but that material bonus lookup can be handled with the same binary ordered table probe. Just add a score component to the ordered table record holding the material signature key. If an increase in the entry count would make the ordered table too large, then use a hash based on the material signature key as did Chess4.x.Rebel wrote:Yep, but 2 queens, 3 rooks, 4 knights etc. simply falls outside the scope of a simple poor man table base concept.sje wrote:Perhaps, but what happens if one side has two queens? Your code will have to check the validity of EIGHT (w/b * q/r/b/n) bounds for safety before fetching from the table.Rebel wrote:I checked the ASM output, it's not so bad. I did not notice a drop in NPS also.sje wrote:While you will have a very quick switch dispatch, you will pay a high price on the category assignment:That will generate a lot of multiply, shift, and add instructions.Code: Select all
category = end_class [wp][bp] [wn][bn] [wb][bb] [wr][br] [wq][bq];
Besides, I use the system as a material imbalance table as well, in EVAL I add a pre-calculated bonus to score via a second table lookup.
Code: Select all
score+= material_bonus [wp][bp] [wn][bn] [wb][bb] [wr][br] [wq][bq];
Poor Man Table Base
Moderators: hgm, Rebel, chrisw
-
- Posts: 4675
- Joined: Mon Mar 13, 2006 7:43 pm
Re: Poor Man Table Base
-
- Posts: 27860
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Poor Man Table Base
In Spartacus the default hamdling of the 1-byte entries of the material table is ss an additive score correction. Some 36 codes are set apart to signal special treatment is required, e.g. multiplicative discounting a la Fruit, or a recognizer. I use a material index from which the nr of pawns is easily recognized (the lowest 7 bits), and where the bishops have different weight, so I can list end-games with unlike B separately.