Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix losses against Stockfish appearing under "Draws" tab #13563

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

trevorbayless
Copy link
Member

@trevorbayless trevorbayless commented Sep 7, 2023

Fixes the issue where losses against Stockfish are incorrectly appearing in the "Draws" tab (l.org/@/user/draws).

This incorporates just the draw query changes from #13553 as this change only adds matching the status id to those which are a draw. Similar logic is already used as part of the loss query here.

To allow losses against Stockfish to correctly appear under the "Losses" tab, we would also need to include this commit, but I know there was some concern about $or queries being slow and having ill effects on the db servers.

Fixes: #3815

@fitztrev
Copy link
Member

Was there still a concern about performance for this change to the query? Could we profile it

$ mongo

> use lichess
> db.game5.find({us: 'thibault', s: { $in: [32, 34] }, wid: { $exists: false }})
> db.game5.find({us: 'thibault', s: { $in: [32, 34] }, wid: { $exists: false }}).explain("executionStats")

@trevorbayless
Copy link
Member Author

I think profiling this would be a good idea. However, I believe the majority of the performance concerns were regarding the excluded commit which resolves Stockfish losses not appear under "Losses". This PR only addresses the "Draws" issue at this time.

To allow losses against Stockfish to correctly appear under the "Losses" tab, we would also need to include this commit, but I know there was some concern about $or queries being slow and having ill effects on the db servers.

I think profiling both changes would be beneficial and would determine if we can bring in the changes from my excluded commit as well.

@kraktus
Copy link
Member

kraktus commented Jul 9, 2024

Coming after the battle here, but how would we profile it?

@trevorbayless
Copy link
Member Author

trevorbayless commented Jul 9, 2024

Coming after the battle here, but how would we profile it?

fitztrev's comment looks like a reasonable approach to me to gain some insight on it.

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.

Losses vs the AI or anonymous players show up under the Draws tab
3 participants