Hello,
I make an AI I made a lot of game on lichess.com ( about 150 ) I have never encountered any problem ( illegal move ) I have 2000 elo on lichess but when I run a PerfT I obtain theses results :
1 : 20
2 : 400
3 : 8,902
4 : 197,281
5 : 4,865,867 <- problem should be 4,865,609 ( 4,865,609 ...