May I ask what's your relevant hardware info? Also, are you doing the perft from the initial position?syzygy wrote:With some more effort I finally got the "checking legality before making the move"-scheme slightly faster than my old play/test/undo scheme. I suspect though that some of the optimisations I found can also be applied to my old implementation.syzygy wrote:I've now experimented a bit with efficiently checking legality before making the move, but I am still losing nps compared to simply playing/testing/undoing. My perft speed has gone through the roof, but that does not buy me anything useful.
I then went on to implement a full legal move generator. The pinned pieces part can be done quite efficiently, but when implementing the generation of legal king moves I became convinced that this scheme would be of no help for alpha/beta search.
To my surprise, the legal move generator does increase nps during alpha/beta...
I don't think going from pseudo-legal to legal should be high on anybody's list, but well, it is an interesting exercise.
My perft now beats hgm's qperft on my machine (12.31s vs 15.19s for perft 7 and 336.25s vs 410.49s for perft 8). Before switching to full legal move generation, my perft was still a bit slower.
My checks generator still only generates pseudo-legal moves, so those still have to be checked in my select_move().
It might be that I could get a further speed up by generating pseudo-legal king moves.
On my machine, hgm's qperft (compiled by gcc) spends 52.3s on perft 7. Hardware problem, it seems.