Skip to content

Conversation

@kraktus
Copy link
Member

@kraktus kraktus commented May 6, 2023

image

close #12106

The change to the aggregation query has been isolated to this commit: 24936cd. The change in size is mostly due to reformatting.

Globally I think the integration is quite clean and doesn't add that much complexity, beside the query being slightly more expensive.

Testing on the other end is hard because of complete lack of type checking and errors only happening at runtime. I've tested to the best of my abilities:

  • Tested on real broadcast (pic above)
  • Tested on Lichess game from start to end
  • Tested on Lichess game from position where black start first (which permitted do discover a bug with the query)

Worst case scenario the query fail and the overview cannot be shown, but I don't know if it'd harm the servers (since I guess the results wouldn't be cached anymore, every view on a broadcast would be expensive).

Maybe stage testing with the broadcast would be appropriate.

kraktus added 9 commits May 5, 2023 09:53
easier to see what's going on
Preliminary refactor to fetching clock stake. Extremely precautious here due to lack of type checking so each step is tested then commited
Probably more helpers to generate mini-game can go there
It's slightly inaccurate since not only used for mini-game but best effort
Keep the clock state as a sliding window of the last two nodes. since `Object.keys(root)` does not list moves chronologically, we need to store the two paths.

`clockTicking` -> the ticking clock, belonging to player whose turn it is to move
`node` -> the node of the last move. Contain the clock of the player that just played

We cannot use `node.ply` to know the side to move, because when starting from position black can start first
@kraktus kraktus changed the title Broadcast clocks Broadcast preview: add live clocks May 6, 2023
@kraktus kraktus marked this pull request as draft May 7, 2023 07:21
kraktus added 2 commits May 7, 2023 12:18
made from
`resultStr: Option[String] = outcome.map(o => Outcome.showResult(o).replace("1/2", "½"))`

with
```
case class Outcome(winner: Option[Color]):
  override def toString = winner match
    case Some(White) => "1-0"
    case Some(Black) => "0-1"
    case None        => "1/2-1/2"

object Outcome:
  def showResult(outcome: Option[Outcome]): String =
    outcome.fold("*")(_.toString)
```
@kraktus kraktus marked this pull request as ready for review May 7, 2023 17:20
@ornicar ornicar merged commit 1d5af03 into lichess-org:master May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clocks and finished game results on Broadcast multiboard

2 participants