ankitects / anki

Anki's shared backend and web components, and the Qt frontend
https://apps.ankiweb.net
Other
19.12k stars 2.16k forks source link

FSRS memory states revert to SM-2 after changing deck #3521

Open jcznk opened 1 month ago

jcznk commented 1 month ago

I'm using Anki 24.10 beta 4. This also occurs in version 24.06.3 (Windows 10, qt6). Testing was done on a new profile.

After changing a card's deck, the FSRS memory state (Stability, Difficulty, Retrievability) are lost and replaced with SM-2's Ease. This seems to affect both the scheduling and sorting. For example, when sorting by Difficulty Ascending, these cards are always shown first since they no longer have a Difficulty.

In the example below, all reviews were performed using a filtered deck, but the same behavior seems to occur for "regular" review entries.

Memory state and intervals before changing the deck:

Memory state and intervals after changing the deck:

dae commented 1 month ago

That is by design. They are recalculated when the card is reviewed again.

jcznk commented 1 month ago

May I ask the reasoning behind this design choice? From my understanding, it seems to negatively impact both the scheduling intervals and the sorting.

brishtibheja commented 1 month ago

Ah, I have faced this before but I failed to reproduce it later.

I assume it was done so that memory states need not be recalculated everytime deck is changed? Can we not still keep the previous parameters though so that sorting isn't affected?


@jcznk In case you didn't thought of this, clicking optimise will fix this issue. Just make sure the cards aren't suspended.

user1823 commented 1 month ago

I assume it was done so that memory states need not be recalculated everytime deck is changed?

Yes, different decks can have different presets and therefore different parameters. So, the memory states from the previous deck need to be cleared.

Can we not still keep the previous parameters though so that sorting isn't affected?

Do you mean memory states? We can't keep the previous ones. Otherwise, Anki has no way to know at the time of review if the saved memory states were calculated using the parameters of the new preset or the old preset.

From my understanding, it seems to negatively impact both the scheduling intervals and the sorting.

Because the memory states are recalculated just before you answer a card, the scheduling is unaffected. However, stats and sorting are affected.

Recalculating the memory states just after moving the card should be possible. I don't know why Anki doesn't do that. Maybe performance concerns? @dae

jcznk commented 1 month ago

@brishtibheja @user1823 Thank you both for the insights, and for the tip regarding optimization. I have updated the opening post and the topic title to use more accurate terminology.

dae commented 1 month ago

Deck changing is a common operation, and we don't want expensive calculations every time it happens.

Keeping the old memory state would require some extra flag so we know to discard it at study time. And it would mean your stats are still wrong - they'd just contain stale data, instead of missing data.

brishtibheja commented 1 month ago

And it would mean your stats are still wrong - they'd just contain stale data, instead of missing data.

Not every time, often we move things between decks that share the same preset (also note that FSRS users make presets on the basis of content, so they're more likely to shift cards to a deck with sharing same preset).