MahmoudUthman wrote:1-what unit "grain" does SF use for evaluation ? I read the source "7" and a couple of old posts here that made me think that I could be missing something .
Code: Select all
PawnValueMg = 188, PawnValueEg = 248
2-What advantage does SF gain by combining mid and end scores inside a single INT instead of using 2 shorts "inside a Struct or a union if needed"?
Speed, for example.
3-I stumbled upon an old post here that claims that storing only the 32bit upper portion of the key degrades performance "I know it causes more collisions" ,yet SF does this ?!
Storing 32 bits of the key in TT entries should be more than fine, since you would only get a collision once every 4 billion probes (or once every 1 billion probes if you store 4 entries per hash bucket).
However, I think SF stores just 16 bits and that leads to tons of collisions per second. Somehow SF seems to play reasonable chess anyway and there is no real evidence that it affects play negatively. (It tested positively on fishtest, obviously). The advantage of storing fewer bits is of course that it allows you to store more TT entries in the same amount of memory.
4-what does this code snippet do "does it have something to do with the sign " ?
Code: Select all
inline Score make_score(int mg, int eg) {
ScoreView v;
v.half.mg = (int16_t)(mg - (uint16_t(eg) >> 15));
v.half.eg = (int16_t)eg;
return Score(v.full);
}
...
That is old SF code. Yes, it is something that makes the addition / subtraction of two signed 16-bit ints wrapped inside a single 32-bit int work correctly.
5-I saw -"I don't remember where"- someone recommending the usage of SF's mobility weights in his engine directly , wouldn't this be considered unethical if not
illegal ? or is copying values "PST,Mob,etc" considered okay ?
I highly doubt there is copyright on such values which have been found by lots of tuning and are not the expression of creative freedom. So in my view this is legal.
Whether it is ethical depends on who you ask (and also on what you're actually doing with your engine).