Pablo Vazquez wrote:PK wrote:I can scrap inlining, it has been only a minor speed gain. Is it the only thing that gcc compiler dislikes? Anyhow, I will try to compile next version with it, but expect it in two months or so.
I used g++ 4.6.1. It's the only thing that it complained about. When I get home I'll post the exact message. As Michel said, it was about having to define the inlined function in the header itself.
If compiler and linker optimizations (-O3 and -flto) prove inlining to be useless, then you can remove then

Unfortunately there's no general rule that says if inlining is useless of useful, the only way is to test! But generally, even if it's useful it's so negligible... One could argue that it makes sense to specify the "inline" keyword anyway, as other compilers than GCC may not have such powerful optimizations. Anyway, modern compilers don't understand the word "inline" as an order anymore, but rather as a hint.
But yes, the only correct way to inline these functions is to define the body of the function in the header file. I can't understand how MSVC manages to compile such an abomination as "extern inline". Compiling units (ie. each cpp file) are compiled independantly, and linked together afterwards. So an extern inline is like asking the compiler to inline something that is not even defined in the compiling unit. MSVC probably doesn't care about your extern inline and considers them as an extern, and (perhaps?) writes a note for the linker optimizer somewhere when it compiles.
I've found 3 little bugs worth fixing:
- "Hash Size" should be called "Hash" to comply with the UCI protocol (no GUI should understand that the option "Hash Size" corresponds to anything in particular)
- Rodent doesn't seem to know how to mate a lone king with a rook, at least at fast time control. It's the most trivial code fix in the world: just make sure your king piece on square table for endgames will incentivisde king in the center. that way the stronger side will push the lone king into a corner or an edge, and the search will easily find the forceful mate.
- there was a third one, but it seems to have slipped off my mind... Anyway, I'll remember it again at some point
Otherwise great work, it's showing a big improvement (+230 elo on my list) compared to Sungorus 1.4