Giter Site home page Giter Site logo

snowy's People

Contributors

jasoncreighton avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

yellow-panther

snowy's Issues

Strange behavior of hash table when searching repeatedly from the same position

Haven't tried to get to root cause at all yet, but here's an example: (bestmove should not flip to a2a4)

Snowy 0.1-34-g363c195 by Jason Creighton (built on Jan  6 2018 12:18:49)
d
  a b c d e f g h
8 r n b q k b n r 8
7 p p p p p p p p 7
6 . . . . . . . . 6
5 . . . . . . . . 5
4 . . . . . . . . 4
3 . . . . . . . . 3
2 P P P P P P P P 2
1 R N B Q K B N R 1
  a b c d e f g h
Hash: e08cc2b35b8ee749
go
info depth 1 score cp 55 time 0 nodes 20 pv b1c3
info depth 2 score cp 0 time 0 nodes 133 pv b1c3 b8c6
info depth 3 score cp 55 time 0 nodes 721 pv b1c3 b8c6 g1f3
info depth 4 score cp 0 time 4 nodes 3465 pv b1c3 b8c6 g1f3 g8f6
info depth 5 score cp 14 time 13 nodes 15408 pv b1c3 b8c6 g1f3 g8f6 a1b1
info depth 6 score cp 0 time 63 nodes 102853 pv b1c3 b8c6 g1f3 g8f6 a1b1 a8b8
info depth 7 score cp 34 time 246 nodes 409115 nps 1657557 pv d2d4 g8f6 b1c3 b8c6 g1f3 a8b8 c1e3
info depth 8 score cp 0 time 2070 nodes 3415371 nps 1649170 pv e2e4 b8c6 g1f3 g8f6 b1c3 e7e5 f1d3 f8d6
bestmove e2e4
go
info depth 1 score cp 55 time 0 nodes 20 pv b1c3
info depth 2 score cp 5 time 0 nodes 20 pv a2a4 g8f6
info depth 3 score cp 5 time 0 nodes 20 pv a2a4 g8f6 g1f3
info depth 4 score cp 5 time 0 nodes 20 pv a2a4 g8f6 g1f3 e7e6
info depth 5 score cp 5 time 0 nodes 20 pv a2a4 g8f6 g1f3 e7e6 e2e3
info depth 6 score cp 5 time 0 nodes 20 pv a2a4 g8f6 g1f3 e7e6 e2e3 f8d6
info depth 7 score cp 5 time 0 nodes 20 pv a2a4 g8f6 g1f3 e7e6 e2e3 f8d6 f1d3
info depth 8 score cp 5 time 0 nodes 20 pv a2a4 g8f6 g1f3 e7e6 e2e3 f8d6 f1d3 e8g8
bestmove a2a4

Moves probed from TT are not checked for pseudo-legality

Right now we are assuming that if the Zobrist hash matches, it must be the same position and therefore we can apply the move.

We should first check if the move is pseudo-legal before calling Board::Make(). (Note that Make() does look at whether the king would be left in check, but it doesn't verify that the move itself was pseudo-legal to begin with, so, eg, you might have a knight being moved like a bishop or some nonsense.)

wrong update of the 50-move rule counter

in Board.cpp line 436:

    // Update 50 move rule counter
    if(isCapture || isPawnMove) {
        m_NumReversiblePlies = 0;
    } else {
        ++m_NumReversiblePlies;     
}

This one doesn't consider castling as an irreversible move. Also, I think losing the castling right (king on e1, rook on h1 with castling right, but you move Ke2) should reset the counter, too. I will need to check the FIDE rules on this latter.

EDIT: this latter (the losing of the castling rights in an 50-move scenario) is astronomically rare in the wild, still, it would be nice to obey the rules totally.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.