{"comment":{"url":"https://api.github.com/repos/GuardianRM/Stockfish/comments/30045952","html_url":"https://github.com/GuardianRM/Stockfish/commit/ae1698a0d238fc6cff08cd79a36c9d5275117526#commitcomment-30045952","id":30045952,"node_id":"MDEzOkNvbW1pdENvbW1lbnQzMDA0NTk1Mg==","user":{"login":"jerrydonaldwatson","id":4200271,"node_id":"MDQ6VXNlcjQyMDAyNzE=","avatar_url":"https://avatars1.githubusercontent.com/u/4200271?v=4","gravatar_id":"","url":"https://api.github.com/users/jerrydonaldwatson","html_url":"https://github.com/jerrydonaldwatson","followers_url":"https://api.github.com/users/jerrydonaldwatson/followers","following_url":"https://api.github.com/users/jerrydonaldwatson/following{/other_user}","gists_url":"https://api.github.com/users/jerrydonaldwatson/gists{/gist_id}","starred_url":"https://api.github.com/users/jerrydonaldwatson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerrydonaldwatson/subscriptions","organizations_url":"https://api.github.com/users/jerrydonaldwatson/orgs","repos_url":"https://api.github.com/users/jerrydonaldwatson/repos","events_url":"https://api.github.com/users/jerrydonaldwatson/events{/privacy}","received_events_url":"https://api.github.com/users/jerrydonaldwatson/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":null,"commit_id":"ae1698a0d238fc6cff08cd79a36c9d5275117526","created_at":"2018-08-12T08:15:40Z","updated_at":"2018-08-12T08:15:40Z","author_association":"NONE","body":"Good luck with this idea.\r\n\r\nYou can use:\r\n\r\n```\r\nint cr3, cr4;\r\n\r\ncr3 = pos.count<PAWN>(Us); \r\ncr4 = pos.count<PAWN>(Them); \r\n\r\nscore -= ClosedRank * (cr3 - cr4)\r\n```\r\n\r\nto save two popcounts which should be a bit faster. \r\n\r\nAlso I think that:\r\n\r\n```\r\ncr = pos.pieces(Us, PAWN) & MiddleZone & ~attackedBy[Them][PAWN];  \r\ncr2 = attackedBy[Them][PAWN] & MiddleZone & ~pos.pieces(Us, PAWN); \r\n\r\nif (((popcount(cr) + popcount(cr2)) == 8 && …) \r\n```\r\n\r\ncould simply be\r\n\r\n```\r\nBitboard cr = MiddleZone & (pos.pieces(Us, PAWN) ^ attackedBy[Them][PAWN]);\r\n\r\nif (popcount(cr) == 8 && pos.non_pawn_material(WHITE) + pos.non_pawn_material(BLACK) < KnightValueMg)\r\n\r\n```\r\nFinally, just to check, why only Rank 4? Doesn't this make the evaluation asymmetrical for Black? Shouldn't it be:\r\n\r\n`constexpr Bitboard MiddleZone = (Us == WHITE ? Rank4BB : Rank5BB);`"}}
{"actor":{"display_login":"jerrydonaldwatson"}}