{"action":"created","comment":{"url":"https://api.github.com/repos/LeelaChessZero/lczero-training/pulls/comments/206530086","pull_request_review_id":141957356,"id":206530086,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjUzMDA4Ng==","diff_hunk":"@@ -99,26 +103,38 @@ process() {\n \n     if [ $hash_index -gt $TRAINPCT ]\n     then\n+      let \"n_test++\"\n       target=$TESTDIR/$file\n       echo -n \"T\"\n     else\n+      let \"n_train++\"\n       target=$TRAINDIR/$file\n       echo -n \"*\"\n     fi\n \n     ln $dir/$file $target\n \n-    # exceeding max buffer size, remove overhead\n-    if [ $n -gt $max ]\n+    # exceeding max buffer size for either, lock and remove overhead as appropriate\n+    if [ $n_test -gt $max_test ] || [ $n_train -gt $max_train ]\n     then\n       (\n       flock -e 200\n-      ls -rt $TESTDIR | head -n $overhead_test | xargs -I{} rm -f $TESTDIR/{}\n-      ls -rt $TRAINDIR | head -n $overhead_train | xargs -I{} rm -f $TRAINDIR/{}\n+      if [ $n_test -gt $max_test ]\n+      then\n+        ls -rt $TESTDIR | head -n $overhead_test | xargs -I{} rm -f $TESTDIR/{}\n+        let \"n -= $overhead_test\"\n+        let \"n_test -= $overhead_test\"\n+        echo -n \"-\"\n+      fi\n+      if [ $n_train -gt $max_train ]\n+      then\n+        ls -rt $TRAINDIR | head -n $overhead_train | xargs -I{} rm -f $TRAINDIR/{}\n+        let \"n -= $overhead_train\"\n+        let \"n_train -= $overhead_train\"","path":"scripts/split.sh","position":62,"original_position":62,"commit_id":"b5ffeef6b64b61a0936994f4a2c70fc3b4b61504","original_commit_id":"b5ffeef6b64b61a0936994f4a2c70fc3b4b61504","user":{"login":"Tilps","id":12046033,"node_id":"MDQ6VXNlcjEyMDQ2MDMz","avatar_url":"https://avatars3.githubusercontent.com/u/12046033?v=4","gravatar_id":"","url":"https://api.github.com/users/Tilps","html_url":"https://github.com/Tilps","followers_url":"https://api.github.com/users/Tilps/followers","following_url":"https://api.github.com/users/Tilps/following{/other_user}","gists_url":"https://api.github.com/users/Tilps/gists{/gist_id}","starred_url":"https://api.github.com/users/Tilps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tilps/subscriptions","organizations_url":"https://api.github.com/users/Tilps/orgs","repos_url":"https://api.github.com/users/Tilps/repos","events_url":"https://api.github.com/users/Tilps/events{/privacy}","received_events_url":"https://api.github.com/users/Tilps/received_events","type":"User","site_admin":false},"body":"So this code ended up being wrong after all - it was inside a subshell so the variable gets updated correctly, but only in the subshell.  The test machine is running a fixed version.","created_at":"2018-07-31T13:37:05Z","updated_at":"2018-07-31T13:37:06Z","html_url":"https://github.com/LeelaChessZero/lczero-training/pull/37#discussion_r206530086","pull_request_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/pulls/37","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/LeelaChessZero/lczero-training/pulls/comments/206530086"},"html":{"href":"https://github.com/LeelaChessZero/lczero-training/pull/37#discussion_r206530086"},"pull_request":{"href":"https://api.github.com/repos/LeelaChessZero/lczero-training/pulls/37"}},"in_reply_to_id":206343893},"pull_request":{"url":"https://api.github.com/repos/LeelaChessZero/lczero-training/pulls/37","id":204138579,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0MTM4NTc5","html_url":"https://github.com/LeelaChessZero/lczero-training/pull/37","diff_url":"https://github.com/LeelaChessZero/lczero-training/pull/37.diff","patch_url":"https://github.com/LeelaChessZero/lczero-training/pull/37.patch","issue_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/issues/37","number":37,"state":"closed","locked":false,"title":"Perform independent pruning of test and train to allow for rebalancing.","user":{"login":"Tilps","id":12046033,"node_id":"MDQ6VXNlcjEyMDQ2MDMz","avatar_url":"https://avatars3.githubusercontent.com/u/12046033?v=4","gravatar_id":"","url":"https://api.github.com/users/Tilps","html_url":"https://github.com/Tilps","followers_url":"https://api.github.com/users/Tilps/followers","following_url":"https://api.github.com/users/Tilps/following{/other_user}","gists_url":"https://api.github.com/users/Tilps/gists{/gist_id}","starred_url":"https://api.github.com/users/Tilps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tilps/subscriptions","organizations_url":"https://api.github.com/users/Tilps/orgs","repos_url":"https://api.github.com/users/Tilps/repos","events_url":"https://api.github.com/users/Tilps/events{/privacy}","received_events_url":"https://api.github.com/users/Tilps/received_events","type":"User","site_admin":false},"body":"Untested.","created_at":"2018-07-26T13:15:45Z","updated_at":"2018-07-31T13:37:06Z","closed_at":"2018-07-30T22:44:40Z","merged_at":"2018-07-30T22:44:40Z","merge_commit_sha":"f33afe30bb9443e868bf6f9671edd1eccbdd1097","assignee":null,"assignees":[],"requested_reviewers":[{"login":"Error323","id":76089,"node_id":"MDQ6VXNlcjc2MDg5","avatar_url":"https://avatars0.githubusercontent.com/u/76089?v=4","gravatar_id":"","url":"https://api.github.com/users/Error323","html_url":"https://github.com/Error323","followers_url":"https://api.github.com/users/Error323/followers","following_url":"https://api.github.com/users/Error323/following{/other_user}","gists_url":"https://api.github.com/users/Error323/gists{/gist_id}","starred_url":"https://api.github.com/users/Error323/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Error323/subscriptions","organizations_url":"https://api.github.com/users/Error323/orgs","repos_url":"https://api.github.com/users/Error323/repos","events_url":"https://api.github.com/users/Error323/events{/privacy}","received_events_url":"https://api.github.com/users/Error323/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/pulls/37/commits","review_comments_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/pulls/37/comments","review_comment_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/pulls/comments{/number}","comments_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/issues/37/comments","statuses_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/statuses/b5ffeef6b64b61a0936994f4a2c70fc3b4b61504","head":{"label":"Tilps:split_balance","ref":"split_balance","sha":"b5ffeef6b64b61a0936994f4a2c70fc3b4b61504","user":{"login":"Tilps","id":12046033,"node_id":"MDQ6VXNlcjEyMDQ2MDMz","avatar_url":"https://avatars3.githubusercontent.com/u/12046033?v=4","gravatar_id":"","url":"https://api.github.com/users/Tilps","html_url":"https://github.com/Tilps","followers_url":"https://api.github.com/users/Tilps/followers","following_url":"https://api.github.com/users/Tilps/following{/other_user}","gists_url":"https://api.github.com/users/Tilps/gists{/gist_id}","starred_url":"https://api.github.com/users/Tilps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tilps/subscriptions","organizations_url":"https://api.github.com/users/Tilps/orgs","repos_url":"https://api.github.com/users/Tilps/repos","events_url":"https://api.github.com/users/Tilps/events{/privacy}","received_events_url":"https://api.github.com/users/Tilps/received_events","type":"User","site_admin":false},"repo":{"id":135566993,"node_id":"MDEwOlJlcG9zaXRvcnkxMzU1NjY5OTM=","name":"lczero-training","full_name":"Tilps/lczero-training","owner":{"login":"Tilps","id":12046033,"node_id":"MDQ6VXNlcjEyMDQ2MDMz","avatar_url":"https://avatars3.githubusercontent.com/u/12046033?v=4","gravatar_id":"","url":"https://api.github.com/users/Tilps","html_url":"https://github.com/Tilps","followers_url":"https://api.github.com/users/Tilps/followers","following_url":"https://api.github.com/users/Tilps/following{/other_user}","gists_url":"https://api.github.com/users/Tilps/gists{/gist_id}","starred_url":"https://api.github.com/users/Tilps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tilps/subscriptions","organizations_url":"https://api.github.com/users/Tilps/orgs","repos_url":"https://api.github.com/users/Tilps/repos","events_url":"https://api.github.com/users/Tilps/events{/privacy}","received_events_url":"https://api.github.com/users/Tilps/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Tilps/lczero-training","description":"For code etc relating to the network training process.","fork":true,"url":"https://api.github.com/repos/Tilps/lczero-training","forks_url":"https://api.github.com/repos/Tilps/lczero-training/forks","keys_url":"https://api.github.com/repos/Tilps/lczero-training/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Tilps/lczero-training/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Tilps/lczero-training/teams","hooks_url":"https://api.github.com/repos/Tilps/lczero-training/hooks","issue_events_url":"https://api.github.com/repos/Tilps/lczero-training/issues/events{/number}","events_url":"https://api.github.com/repos/Tilps/lczero-training/events","assignees_url":"https://api.github.com/repos/Tilps/lczero-training/assignees{/user}","branches_url":"https://api.github.com/repos/Tilps/lczero-training/branches{/branch}","tags_url":"https://api.github.com/repos/Tilps/lczero-training/tags","blobs_url":"https://api.github.com/repos/Tilps/lczero-training/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Tilps/lczero-training/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Tilps/lczero-training/git/refs{/sha}","trees_url":"https://api.github.com/repos/Tilps/lczero-training/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Tilps/lczero-training/statuses/{sha}","languages_url":"https://api.github.com/repos/Tilps/lczero-training/languages","stargazers_url":"https://api.github.com/repos/Tilps/lczero-training/stargazers","contributors_url":"https://api.github.com/repos/Tilps/lczero-training/contributors","subscribers_url":"https://api.github.com/repos/Tilps/lczero-training/subscribers","subscription_url":"https://api.github.com/repos/Tilps/lczero-training/subscription","commits_url":"https://api.github.com/repos/Tilps/lczero-training/commits{/sha}","git_commits_url":"https://api.github.com/repos/Tilps/lczero-training/git/commits{/sha}","comments_url":"https://api.github.com/repos/Tilps/lczero-training/comments{/number}","issue_comment_url":"https://api.github.com/repos/Tilps/lczero-training/issues/comments{/number}","contents_url":"https://api.github.com/repos/Tilps/lczero-training/contents/{+path}","compare_url":"https://api.github.com/repos/Tilps/lczero-training/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Tilps/lczero-training/merges","archive_url":"https://api.github.com/repos/Tilps/lczero-training/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Tilps/lczero-training/downloads","issues_url":"https://api.github.com/repos/Tilps/lczero-training/issues{/number}","pulls_url":"https://api.github.com/repos/Tilps/lczero-training/pulls{/number}","milestones_url":"https://api.github.com/repos/Tilps/lczero-training/milestones{/number}","notifications_url":"https://api.github.com/repos/Tilps/lczero-training/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Tilps/lczero-training/labels{/name}","releases_url":"https://api.github.com/repos/Tilps/lczero-training/releases{/id}","deployments_url":"https://api.github.com/repos/Tilps/lczero-training/deployments","created_at":"2018-05-31T10:07:30Z","updated_at":"2018-05-31T10:07:33Z","pushed_at":"2018-07-26T13:14:50Z","git_url":"git://github.com/Tilps/lczero-training.git","ssh_url":"git@github.com:Tilps/lczero-training.git","clone_url":"https://github.com/Tilps/lczero-training.git","svn_url":"https://github.com/Tilps/lczero-training","homepage":null,"size":191,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"next"}},"base":{"label":"LeelaChessZero:master","ref":"master","sha":"e5753156f028296d14dba77e25740e1c69b72e05","user":{"login":"LeelaChessZero","id":39777295,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5Nzc3Mjk1","avatar_url":"https://avatars1.githubusercontent.com/u/39777295?v=4","gravatar_id":"","url":"https://api.github.com/users/LeelaChessZero","html_url":"https://github.com/LeelaChessZero","followers_url":"https://api.github.com/users/LeelaChessZero/followers","following_url":"https://api.github.com/users/LeelaChessZero/following{/other_user}","gists_url":"https://api.github.com/users/LeelaChessZero/gists{/gist_id}","starred_url":"https://api.github.com/users/LeelaChessZero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeelaChessZero/subscriptions","organizations_url":"https://api.github.com/users/LeelaChessZero/orgs","repos_url":"https://api.github.com/users/LeelaChessZero/repos","events_url":"https://api.github.com/users/LeelaChessZero/events{/privacy}","received_events_url":"https://api.github.com/users/LeelaChessZero/received_events","type":"Organization","site_admin":false},"repo":{"id":135491134,"node_id":"MDEwOlJlcG9zaXRvcnkxMzU0OTExMzQ=","name":"lczero-training","full_name":"LeelaChessZero/lczero-training","owner":{"login":"LeelaChessZero","id":39777295,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5Nzc3Mjk1","avatar_url":"https://avatars1.githubusercontent.com/u/39777295?v=4","gravatar_id":"","url":"https://api.github.com/users/LeelaChessZero","html_url":"https://github.com/LeelaChessZero","followers_url":"https://api.github.com/users/LeelaChessZero/followers","following_url":"https://api.github.com/users/LeelaChessZero/following{/other_user}","gists_url":"https://api.github.com/users/LeelaChessZero/gists{/gist_id}","starred_url":"https://api.github.com/users/LeelaChessZero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeelaChessZero/subscriptions","organizations_url":"https://api.github.com/users/LeelaChessZero/orgs","repos_url":"https://api.github.com/users/LeelaChessZero/repos","events_url":"https://api.github.com/users/LeelaChessZero/events{/privacy}","received_events_url":"https://api.github.com/users/LeelaChessZero/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LeelaChessZero/lczero-training","description":"For code etc relating to the network training process.","fork":false,"url":"https://api.github.com/repos/LeelaChessZero/lczero-training","forks_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/forks","keys_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/teams","hooks_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/hooks","issue_events_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/issues/events{/number}","events_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/events","assignees_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/assignees{/user}","branches_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/branches{/branch}","tags_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/tags","blobs_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/git/refs{/sha}","trees_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/statuses/{sha}","languages_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/languages","stargazers_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/stargazers","contributors_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/contributors","subscribers_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/subscribers","subscription_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/subscription","commits_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/commits{/sha}","git_commits_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/git/commits{/sha}","comments_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/comments{/number}","issue_comment_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/issues/comments{/number}","contents_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/contents/{+path}","compare_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/merges","archive_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/downloads","issues_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/issues{/number}","pulls_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/pulls{/number}","milestones_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/milestones{/number}","notifications_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/labels{/name}","releases_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/releases{/id}","deployments_url":"https://api.github.com/repos/LeelaChessZero/lczero-training/deployments","created_at":"2018-05-30T19:56:50Z","updated_at":"2018-07-31T08:55:53Z","pushed_at":"2018-07-31T08:55:52Z","git_url":"git://github.com/LeelaChessZero/lczero-training.git","ssh_url":"git@github.com:LeelaChessZero/lczero-training.git","clone_url":"https://github.com/LeelaChessZero/lczero-training.git","svn_url":"https://github.com/LeelaChessZero/lczero-training","homepage":null,"size":221,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":5,"license":null,"forks":9,"open_issues":5,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/LeelaChessZero/lczero-training/pulls/37"},"html":{"href":"https://github.com/LeelaChessZero/lczero-training/pull/37"},"issue":{"href":"https://api.github.com/repos/LeelaChessZero/lczero-training/issues/37"},"comments":{"href":"https://api.github.com/repos/LeelaChessZero/lczero-training/issues/37/comments"},"review_comments":{"href":"https://api.github.com/repos/LeelaChessZero/lczero-training/pulls/37/comments"},"review_comment":{"href":"https://api.github.com/repos/LeelaChessZero/lczero-training/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/LeelaChessZero/lczero-training/pulls/37/commits"},"statuses":{"href":"https://api.github.com/repos/LeelaChessZero/lczero-training/statuses/b5ffeef6b64b61a0936994f4a2c70fc3b4b61504"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Tilps"}}