{"action":"created","issue":{"url":"https://api.github.com/repos/official-stockfish/Stockfish/issues/1540","repository_url":"https://api.github.com/repos/official-stockfish/Stockfish","labels_url":"https://api.github.com/repos/official-stockfish/Stockfish/issues/1540/labels{/name}","comments_url":"https://api.github.com/repos/official-stockfish/Stockfish/issues/1540/comments","events_url":"https://api.github.com/repos/official-stockfish/Stockfish/issues/1540/events","html_url":"https://github.com/official-stockfish/Stockfish/pull/1540","id":312885247,"number":1540,"title":"fix excluded move key","user":{"login":"tthsqe12","id":6055563,"avatar_url":"https://avatars1.githubusercontent.com/u/6055563?v=4","gravatar_id":"","url":"https://api.github.com/users/tthsqe12","html_url":"https://github.com/tthsqe12","followers_url":"https://api.github.com/users/tthsqe12/followers","following_url":"https://api.github.com/users/tthsqe12/following{/other_user}","gists_url":"https://api.github.com/users/tthsqe12/gists{/gist_id}","starred_url":"https://api.github.com/users/tthsqe12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tthsqe12/subscriptions","organizations_url":"https://api.github.com/users/tthsqe12/orgs","repos_url":"https://api.github.com/users/tthsqe12/repos","events_url":"https://api.github.com/users/tthsqe12/events{/privacy}","received_events_url":"https://api.github.com/users/tthsqe12/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2018-04-10T11:40:31Z","updated_at":"2018-04-14T11:14:33Z","closed_at":"2018-04-12T06:47:27Z","author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/official-stockfish/Stockfish/pulls/1540","html_url":"https://github.com/official-stockfish/Stockfish/pull/1540","diff_url":"https://github.com/official-stockfish/Stockfish/pull/1540.diff","patch_url":"https://github.com/official-stockfish/Stockfish/pull/1540.patch"},"body":"The current code first takes the 32 bit int excludedMove, shifts it to the left 16, then sign extends the shifted quantity to 64 bits. This is dumb. Why not just shift the unsigned quantity to the left 16?\r\n\r\nEDIT: Maybe I should make it clear that this is a functional change.\r\n\r\nEDIT: Let's make it very clear why this is a functional change. When the move type is castling or enpassant, the quantity `move<<16` is negative (if int's are 32 bits, likely) or undefined (if int's are 16 bits, unlikely). Thus, the key passed either has its top 32 bits flipped (likely) or is undefined (unlikely).\r\n\r\nHere is proof that an excluded move of type castling or enpassent can affect the search. First of all, my box has 32 bit ints so move<<16 is defined. The command sequence\r\n`position startpos moves h2h3 h7h6 b1c3 e7e5 e2e3 d7d5 d1h5 g7g5 d2d4 e5e4 h5d1 g8f6 b2b3 c8e6 c1b2 b8c6 g1e2 f8d6`\r\n`go depth 18`\r\nwill search 3168908 positions in master but 3168899 in the patch."},"comment":{"url":"https://api.github.com/repos/official-stockfish/Stockfish/issues/comments/381321935","html_url":"https://github.com/official-stockfish/Stockfish/pull/1540#issuecomment-381321935","issue_url":"https://api.github.com/repos/official-stockfish/Stockfish/issues/1540","id":381321935,"user":{"login":"syzygy1","id":3028851,"avatar_url":"https://avatars1.githubusercontent.com/u/3028851?v=4","gravatar_id":"","url":"https://api.github.com/users/syzygy1","html_url":"https://github.com/syzygy1","followers_url":"https://api.github.com/users/syzygy1/followers","following_url":"https://api.github.com/users/syzygy1/following{/other_user}","gists_url":"https://api.github.com/users/syzygy1/gists{/gist_id}","starred_url":"https://api.github.com/users/syzygy1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syzygy1/subscriptions","organizations_url":"https://api.github.com/users/syzygy1/orgs","repos_url":"https://api.github.com/users/syzygy1/repos","events_url":"https://api.github.com/users/syzygy1/events{/privacy}","received_events_url":"https://api.github.com/users/syzygy1/received_events","type":"User","site_admin":false},"created_at":"2018-04-14T11:14:32Z","updated_at":"2018-04-14T11:14:32Z","author_association":"NONE","body":"@tthsqe12 \r\nInteresting. I guess Cfish has a functional difference here from Stockfish because it uses uint32_t for Move."}}
{"actor":{"display_login":"syzygy1"}}