lucasart wrote:
You seem to have more experience than me in the matter. And you're probably right. I've been a bit naive…
Don't feel too bad about it.
There are a few highly successful open-source projects, and you tend to think of those as the way open source software development goes. Even then there can be bears on the road.
Take Stockfish. Back when it was still Glaurung, Tord was the sole developer, and my impression (from reading forum archives) is that at some point he found that he had less time to devote to Glaurung; perhaps he got a little bored with it as well (I don't know that for a fact). Then Marco forked Glaurung, called it Stockfish and started improving it, and it grew from there. Then not too long ago, Marco announced that he would have less time to spend improving Stockfish. The source repository was made public, and eventually the testing framework emerged. But there are at least two points where development could have stagnated and the project dropped.
Someone may yet pick up DiscoCheck 5 and continue with it.
Parallel search, from day 1. This impacts the overall design of the datastructures. Of course, making it efficient is something that needs to happen incrementally. Optimal parallel search for an engine that has a minimalistic evaluation and no or poorly implemented reductions will (probably) not be an optimal search for an engine with a balanced and well-tuned evaluation and a good single-threaded search.
Totally agreed. That being said, I have no experience in writing an SMP engine myself. But you have.
Yes, but I do have to say that I don't have massive experience writing parallel code. In particular, I've been fortunate enough to not have to suffer the nightmare of debugging race conditions, which means I don't have much experience doing that.
A design that will naturally and easily lend itself to playing chess variants. This can take various forms. If limited to "standard" chess pieces, this could include things like atomic (different capture rules), losers/giveaway (very different evaluation weights), Fischer Random, Bughouse and Crazyhouse. I'm more interested in variants with "fairy pieces", but that forces you to make a few design decisions early on: how many fairy pieces will you support? Are they fixed or arbitrary? Can pieces be asymmetric? Can the king be different from the "standard" king? Can the pawns? What about promotion options? In normal chess, you need 6+6=12 bits to encode from/to squares, and 2 bits to encode promotion choices, giving you 14 bit in total, which fits into a standard 16 bit integer and leaves you 2 bits for other information (castling flag, say). If you have more piece types, this may not fit and you'll need to use a 32 bit integer. But then, you can store loads more stuff as well (the piece type, for instance, so you don't need to look that up on the board). This affects the data structures needed, as well as how you write the evaluation (it needs to be scalable to adding additional pieces). Can the board be different from 8x8? Can the topology be different from a square (say, a cylinder)?
Personally, I would suggest a plain 8x8 board, and just add support, or at least the ability to support, a range of different fairy pieces (say, Archbishop, Chancellor/Marshal, Ferz, Elephant, Silver general, Berolina pawns) and rule extensions (atomic captures, giveaway, piece drops). That allows for Berolina Chess, Seirawan Chess, Atomic chess, Bug/Crazy house (whichever is the two-player version of the game, I get them mixed up), Giveaway chess, Fischer Random Chess, Makruk and Shatranj, which is a decent enough mix. It doesn't need to play all of them equally well, and Makruk and Shatranj are perhaps more for "because we can" sake (I don't think anyone plays Shatranj anymore).
I don't know anything about chess variants (except Chess960). But I think we shouldn't goo for too much generality or we risk to never complete the project. Better stay with 8x8 board using bitboards. As for piece types, I would prefer to limit ourselves to normal chess pieces, for simplicity and efficiency. That way move can fit in 16 bits (which is useful for TT). Also, adding "fairy" pieces means we need to go back to computing magics for those
It's actually not so bad. The trick with extra pieces, for the most part, is to make sure that a) you can store them (have a bitboard for them), and b) the move generator can generate moves for them. If the evaluation only does PST+value for them, that's good enough initially. This is all just a matter of making sure arrays can accomodate them. If I were to pick any one variant with fairy pieces to support initially, I'd go with Seirawan Chess, for which there is at least some interest from players (but no strong engine), the new pieces are not particularly strange (B+N and R+N, when Q=R+B) and it has the infrastructure for piece drops.
Are the four extra bits of a 16 bit integer needed for anything, or could they be used to encode for 16 possible promotion pieces? If the latter is possible, I'd suggest going with that (I've only ever done 32 and 64 bit move structures, where that's not a concern).
As for magics: no need for new ones: you'd encode N+B as knight_attacks(square) | rook_attacks(square, occ). At least if you stay away from things like Nightriders (which I would).
I will send you a more detailled PM with what I have in mind.
Ok.