Comments (7)
Please go ahead and land the PR (when you are ready). All in all, I think It'll be easier to fix it afterwards.
And sorry for breaking it 😬
No problem! 😆
from govariants.
I believe the second issue "two players time out in the same round" is a race condition. It is very easy to trigger if it happens in the first timed round, but otherwise shouldn't happen often.
To repro:
- Set up 4 player parallel game (or any parallel variant with >2 players).
- Finish round 1 to start the clock
- play moves for player 0 and player 1
- Wait for player 2 and player 3 to timeout
Results:
It appears that the timeout for player 3 is overwritten or never occurs. If there is a race, it means that neither timeout will detect that the round ends.
Timeout in round two, simultaneous, BAD:
"forPlayer": {
"0": {
"clockState": {
"remainingTimeMS": 30000
},
"onThePlaySince": "2024-04-14T20:29:43.452Z",
"stagedMoveAt": "2024-04-14T20:30:03.660Z"
},
"1": {
"clockState": {
"remainingTimeMS": 30000
},
"onThePlaySince": "2024-04-14T20:29:43.452Z",
"stagedMoveAt": "2024-04-14T20:30:05.363Z"
},
"2": {
"clockState": {
"remainingTimeMS": 0
},
"onThePlaySince": null,
"stagedMoveAt": null
},
"3": {
"clockState": {
"remainingTimeMS": 30000
},
"onThePlaySince": "2024-04-14T20:29:43.452Z",
"stagedMoveAt": null
}
}
On the other hand, if the timeouts happen at different times, the round will get reset accordingly:
Here's a timeout in round 3, GOOD:
"forPlayer": {
"0": {
"clockState": {
"remainingTimeMS": 26840
},
"onThePlaySince": "2024-04-14T20:38:37.323Z",
"stagedMoveAt": null
},
"1": {
"clockState": {
"remainingTimeMS": 23038
},
"onThePlaySince": "2024-04-14T20:38:37.323Z",
"stagedMoveAt": null
},
"2": {
"clockState": {
"remainingTimeMS": 0
},
"onThePlaySince": null,
"stagedMoveAt": null
},
"3": {
"clockState": {
"remainingTimeMS": 0
},
"onThePlaySince": null,
"stagedMoveAt": null
}
}
from govariants.
About the Scenario with 4 players, one times out <- I've tested this in the past, and it used to work. I'm not sure what exactly is going wrong, it looks like all 4 players time out at (almost) the same time for some reason.
from govariants.
I have found out the reason for this bug. The new function MakeTransition takes the move as input parameter. However in parallel time control, a move from any player may trigger a round transition. At this point we don't know the moves of other players, and it seems that the transition (with this move) is used for all players. In the event that the move is "timeout", the transition sets all player times to 0. Then all players immediately time out.
from govariants.
I'm not sure how to fix it without disrupting your bigger PR.
from govariants.
Ohh oh no! Thank you for root causing. And sorry for breaking it 😬
I'm not sure how to fix it without disrupting your bigger PR.
Should I go ahead and land it then? Or I am also okay with dealing with some merge conflicts if we need to fix before landing
from govariants.
Linking related issue #226, which also needs a solution to race conditions
from govariants.
Related Issues (20)
- Display player colors or symbols
- Dimensions object
- Adding the following features for go/variants/quantum HOT 6
- Admin users and dashboard
- Migration strategy HOT 4
- Duplicate move on game HOT 1
- Display komi and other "invisible" configs HOT 1
- Sequential Fractional Baduk
- Overlapping Layout in game page for variant quantum HOT 3
- Config Not Editable for Variants without a Config Form HOT 1
- Graph expects intersection IDs to equal their index HOT 7
- [optimization] do not re-render board every move HOT 1
- Improve Server endpoint for fetching the game state
- Optimize network calls wrt. game-state handling in the game view
- Quantum go uses Coordinate.toSgfRepr() (in exportState), which throws an error with the grid boards. HOT 1
- Rating System HOT 18
- Quantum on Graph boards is broken
- Quantum Games seem to be broken HOT 2
- Quantum Go Game Engine HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from govariants.