mortii / anki-morphs

A MorphMan fork rebuilt from the ground up with a focus on simplicity, performance, and a codebase with minimal technical debt.
https://mortii.github.io/anki-morphs/
Mozilla Public License 2.0
47 stars 6 forks source link

Not all cards get due updated when recalc is run #199

Closed xofm31 closed 3 months ago

xofm31 commented 3 months ago

Describe the bug

I first noticed this when running my version of score calculation, but I was able to reproduce it with Ankimorphs 2.1.0.

In settings, I have one note type, I am using Chinese Jieba. I have all extra fields checked. I have all skip boxes checked. Under recalc, I have "Move new cards..." and "Shift new cards..." selected.

I select all of my new cards and reposition them to 0. I delete the tags am-known-automatically, am-not-ready and am-ready.

I hit "recalc". Because I have "move new cards" selected, I should have only cards that start with 500000. But out of about 16,000 new cards, about 500 of them are not moved to 500000+. For the first card that wasn't moved, it has a due of 1, but am-score value of 501456.

Without doing anything else, I hit "recalc" again. Now it is 438 cards that still have not moved. Recalc a third time, and now it's just 344.

Before hitting recalc a fourth time, I deleted the am-score value for the first four cards. After the recalc, one of those cards has gotten the correct due value. The other three still have low due values, and the am-score value is back, all in the 500000's.

Expected behavior

I expected that the due value should match the am-score for all of the cards.

My setup

macOS 14.4 Anki Version: ⁨23.12.1 (1a1d4d54)⁩ Python 3.9.15 Qt 6.5.3 PyQt 6.5.3 AnkiMorphs Version: v2.1.0

mortii commented 3 months ago

Interesting. I can't debug this today but here are some thoughts:

  1. What happens if you repeat the process but turn off the "shift new cards..." option?
  2. The small changs between recalcs can happen because tags are only read and applied once per recalc, so the actual scores and tags might lag behind and wont be applied until x number of recalcs. There isnt a good way to fix this unfortunately. That being said, i dont know how much of of the problem you described can be attributed to this.
mortii commented 3 months ago

I've reproduces the problem and it stems from the "shift new cards" option, specifically this part: https://github.com/mortii/anki-morphs/blob/7c7169119ccc67758f12bfcbb6d9ae941a557153/ankimorphs/recalc.py#L587-L591

It's too naive unfortunately... I'll try to come up with something better.

mortii commented 3 months ago

Should be fixed in v2.1.1.

Thanks!

github-actions[bot] commented 3 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.