msarchet wrote: ↑Fri Oct 08, 2021 6:33 pm
R. Tomasi wrote: ↑Fri Oct 08, 2021 4:48 pm
That, and it's then also possible to sort the stages (instead of only the moves). Generating potentially winning captures first in QS, for example. I have a kind of history heuristics which sorts the stages in Pygmalion. Only if not in QS I will then also sort the generated moves. Not sorting the individual moves, and only generating potentially winning stages first proved to be better for me.
Edit: Btw, it seems debatable to me whether a pure legal-movegen will in the end be faster. It will have to do the legality check in some form or another during generation, which make the generation slower than pseudo-legal. And with a pseudo-legal movegen you will skip all this checking for moves that come behind a beta cut-off. To me the best option (I'm not doing this currently, though, and haven't tried), seems to be to do pure legal move-gen in expected all-nodes and staged pseudo-legal in expected cut-nodes.
This is something that I plan to look into. My move generation from profiling is only about 1-2% of the cost of executing a search, so I haven't been worrying about it at this point. For QSearch I do only generate captures.
I plan so, too. It's however not very high on the to-do list currently.
What I do/meant is not to generate only captures in QS (I think almost everybody does that). The idea is to generate captures in stages, and only generate the potentially winning stages first. For example when generating captures for the queen: capturing a pawn is with very high probability not a winning capture (but there probably are lot's of "queen captures pawn" cases, because of the high queen mobility). I generate (probably) winning captures in a first stage, then (probably) equal captures, and finally the (probably) loosing captures in QS. Within the individual stages I have passes (for example winning queen captures, winning rook captures, etc.). Those get sorted by a history score.
A typical approach in QS would then be to sort the generated captures by SEE. That I do not do. It may be because my SEE implementation is poor/slow, but the cost of that last sort outweighs any benefits in my engine. And it's not like the moves in QS aren't ordered - I just don't sort the moves within individual passes.
Edit: well, the (probably) winning queen captures is a BS example

They don't exist, becuase the queen can at best capture a queen, which would be a (probably) equal capture. But you get the idea...