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

Optimizing FSRS parameters shows 0 reviews #3242

Closed
user1823 opened this issue Jun 19, 2024 · 5 comments · Fixed by #3420
Closed

Optimizing FSRS parameters shows 0 reviews #3242

user1823 opened this issue Jun 19, 2024 · 5 comments · Fixed by #3420

Comments

@user1823
Copy link
Contributor

However, sometimes, it does show the correct count too.

Test file: Test.apkg.zip (Rename to remove .zip)

In this file, try to optimize the parameters of the deck B (subdeck of A) to reproduce the issue.

@abdnh
Copy link
Collaborator

abdnh commented Jun 27, 2024

No luck reproducing this here.

@user1823
Copy link
Contributor Author

user1823 commented Jun 27, 2024

I imported the apkg into a fresh profile and I was able to reproduce it a few times. The issue seems to appear randomly.

However, I have reasons to think that the issue is more likely to be reproduced when the optimization finishes too fast (probably indicating a race condition).

For e.g., if I start a screen recording, the CPU usage increases and the laptop becomes slightly slower and I am almost never able to reproduce the issue.

@benasocj
Copy link

I experience the same issue.

In the following scenarios the parameters have always been optimized already. For this reason the "...appear to be optimal" popup is always shown (which is expected).

Following scenarios I have come across:

1. Only "0 reviews" shown

Popup is shown:
screenshot_count_zero1
After I close the popup:
screenshot_count_zero2

2. Only "1,896 reviews" shown

Popup is shown:
screenshot_count_only1
After I close the popup:
screenshot_count_only2

3. "1,896 reviews" shown along with random percentage

Popup is shown, however with "1,896 reviews" and a random percentage already shown in the background (sometimes 60%, 58.6% or 49.3%):
screenshot_percent_and_count1
screenshot_percent_and_count2
screenshot_percent_and_count3
After I close the popup:
screenshot_percent_and_count9

As @user1823 has mentioned already, this really seems to happen due to a race condition. My laptop is running on a 14 year old CPU which may make it more likely for this race condition to occur.

Environment

  • Anki version: 24.06.3
  • OS: Debian GNU/Linux

@brishtibheja
Copy link
Contributor

Not seeing the percentages is weirder. You are supposed to see the percentage rise to 100 per cent as the optimisation completes.

@dae
Copy link
Member

dae commented Jul 22, 2024

I suspect that the progress update notifications are arriving asynchronously, and one or more is arriving after the operation has fully completed. Perhaps we could fix it by:

  • in computeWeights(), using the returned reviews number, which is currently ignored in favor of the reviews listed in the progress messages
  • hiding progress once the total reviews number has been returned

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 a pull request may close this issue.

5 participants