{"action":"created","issue":{"url":"https://api.github.com/repos/official-stockfish/Stockfish/issues/786","repository_url":"https://api.github.com/repos/official-stockfish/Stockfish","labels_url":"https://api.github.com/repos/official-stockfish/Stockfish/issues/786/labels{/name}","comments_url":"https://api.github.com/repos/official-stockfish/Stockfish/issues/786/comments","events_url":"https://api.github.com/repos/official-stockfish/Stockfish/issues/786/events","html_url":"https://github.com/official-stockfish/Stockfish/pull/786","id":175103637,"number":786,"title":"Retire KingDanger array","user":{"login":"hxim","id":6370548,"avatar_url":"https://avatars.githubusercontent.com/u/6370548?v=3","gravatar_id":"","url":"https://api.github.com/users/hxim","html_url":"https://github.com/hxim","followers_url":"https://api.github.com/users/hxim/followers","following_url":"https://api.github.com/users/hxim/following{/other_user}","gists_url":"https://api.github.com/users/hxim/gists{/gist_id}","starred_url":"https://api.github.com/users/hxim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hxim/subscriptions","organizations_url":"https://api.github.com/users/hxim/orgs","repos_url":"https://api.github.com/users/hxim/repos","events_url":"https://api.github.com/users/hxim/events{/privacy}","received_events_url":"https://api.github.com/users/hxim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-05T16:39:08Z","updated_at":"2016-09-05T19:15:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/official-stockfish/Stockfish/pulls/786","html_url":"https://github.com/official-stockfish/Stockfish/pull/786","diff_url":"https://github.com/official-stockfish/Stockfish/pull/786.diff","patch_url":"https://github.com/official-stockfish/Stockfish/pull/786.patch"},"body":"Replaced KingDanger array with direct calculation. Function is designed so that\r\na) in interval 0..QuadUnits quadratic function f1(x) = a * x * x is used\r\nb) in interval QuadUnits..MaxUnits linear function f2(x) = x - b is used\r\n\r\nParameters a and b are must be a = 1 / (QuadUnits * 2) and b = QuadUnits / 2\r\nbecause we need for x := QuadUnits both\r\n\r\n1.) derivations same\r\nf1'(QuadUnits) = f2'(QuadUnits)\r\n=>\r\n2 * a * QuadUnits = 1\r\n=>\r\na = 1 / (QuadUnits * 2)\r\n\r\n2.) values same\r\nf1(QuadUnits) = f2(QuadUnits)\r\n=>\r\na * QuadUnits * QuadUnits = QuadUnits - b\r\n=>\r\nb = QuadUnits - a * QuadUnits * QuadUnits\r\n=>\r\nb = QuadUnits / 2\r\n\r\nSTC:\r\nLLR: 2.95 (-2.94,2.94) [-3.00,1.00]\r\nTotal: 41445 W: 7762 L: 7677 D: 26006\r\n\r\nLTC:\r\nLLR: 2.96 (-2.94,2.94) [-3.00,1.00]\r\nTotal: 70258 W: 9381 L: 9326 D: 51551\r\n\r\nbench 8507177"},"comment":{"url":"https://api.github.com/repos/official-stockfish/Stockfish/issues/comments/244801161","html_url":"https://github.com/official-stockfish/Stockfish/pull/786#issuecomment-244801161","issue_url":"https://api.github.com/repos/official-stockfish/Stockfish/issues/786","id":244801161,"user":{"login":"mcostalba","id":1099265,"avatar_url":"https://avatars.githubusercontent.com/u/1099265?v=3","gravatar_id":"","url":"https://api.github.com/users/mcostalba","html_url":"https://github.com/mcostalba","followers_url":"https://api.github.com/users/mcostalba/followers","following_url":"https://api.github.com/users/mcostalba/following{/other_user}","gists_url":"https://api.github.com/users/mcostalba/gists{/gist_id}","starred_url":"https://api.github.com/users/mcostalba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcostalba/subscriptions","organizations_url":"https://api.github.com/users/mcostalba/orgs","repos_url":"https://api.github.com/users/mcostalba/repos","events_url":"https://api.github.com/users/mcostalba/events{/privacy}","received_events_url":"https://api.github.com/users/mcostalba/received_events","type":"User","site_admin":false},"created_at":"2016-09-05T19:15:01Z","updated_at":"2016-09-05T19:15:01Z","body":"First of all, congratulations for this patch: it is not easy to have something working in king safety, especially such drastic idea is a really surprise that is proved **not weaker** than master.\r\n\r\nIf this patch would have been a [0, 5] or even a [0, 4] I would have gladly applied. But I am a bit dubious to totally replace a more or less easy to understand, easy to tweak table with something that is more difficult and less immediate. Your patch it is a simplification just because it removes KingDanger[] init code, but actual _running_ code in evaluate_king() is not easier than current master, actually it is even a bit more complex, so I am wondering if it makes sense to replace something easy and well proven with something totally new that just because it is not weaker.\r\n\r\nCan you please run a SPRT[0, 4] at LTC?\r\n"}}
{"actor":{"display_login":"mcostalba"}}