fix rewind in load, race condition on pv
This commit is contained in:
1 parent
f63f960e1a
commit
098c39c4bd
2 files changed
+5
-1
No files matched your search
+3
-1
@@ -169,8 +169,10 @@ class GameNode(SGFNode):
|
||||
top_polmove = polmoves[0][1] if polmoves else Move(None) # if no info at all, pass
|
||||
return [{**self.analysis["root"], "pointsLost": 0, "order": 0, "move": top_polmove.gtp()}] # single visit -> go by policy/root
|
||||
|
||||
root_score = self.analysis["root"]["scoreLead"]
|
||||
move_dicts = list(self.analysis["moves"].values()) # prevent incoming analysis from causing crash
|
||||
return sorted(
|
||||
[{"pointsLost": self.player_sign(self.next_player) * (self.analysis["root"]["scoreLead"] - d["scoreLead"]), **d} for d in self.analysis["moves"].values()],
|
||||
[{"pointsLost": self.player_sign(self.next_player) * (root_score - d["scoreLead"]), **d} for d in move_dicts],
|
||||
key=lambda d: (d["order"], d["pointsLost"]),
|
||||
)
|
||||
|
||||
|
||||
@@ -197,6 +197,8 @@ class KaTrainGui(BoxLayout):
|
||||
self.log(f"Failed to load SGF. Parse Error: {e}", OUTPUT_ERROR)
|
||||
return
|
||||
self._do_new_game(move_tree=move_tree, analyze_fast=popup_contents.fast.active)
|
||||
if not popup_contents.rewind.active:
|
||||
self.game.redo(999)
|
||||
|
||||
popup_contents.filesel.on_submit = readfile
|
||||
self.fileselect_popup.open()
|
||||
|
||||
Reference in new issue
Block a user