-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
FSRS wrongly converts a card to interday learning card? #3712
Comments
According to the code, if the interval is greater than 0.5 day, the anki/rslib/src/scheduler/states/learning.rs Lines 143 to 173 in 39e293b
How did you know that the card is a interday learning card? |
Because it appears as red in the deck picker and has an interval of 1d. I also verified that it has type = 1 in the database. I can share the card from the backup created on 10th Jan. I don't have a backup before the last rating in the above screenshot. Parameters: Desired retention: 0.94 Edit: |
I'm sorry but I cannot reproduce the bug. I tried to increase the desired retention to 0.99 and press |
Ok, then let me guess. For a stability of 14h and DR = 0.94, FSRS would have calculated an interval of about 8 hours. Since this is less than 0.5d, |
Ok, I ran the following commands in the debug console to regenerate the "before" card after deleting the revlogs and updating the memory states. mw.col.db.execute("update cards set due=1736444160 where id = 1736346558840")
mw.col.db.execute("update cards set ivl=0 where id = 1736346558840")
mw.col.db.execute("update cards set queue=1 where id = 1736346558840") Here's the result: Before.apkg.zip To reproduce the issue, set your device time to 01:40 (night) on 10th Jan (Shanghai time). Launch Anki Upon rating the card with the above steps, I get the following:
So, in this case, Anki is indeed converting the intraday learning card (queue = 1) to an interday learning card (queue = 3). |
So, what's the expected behavior here? Should Anki keep the card in learning or convert it to review? |
If it remains a intraday learning card (queue = 1), would FSRS be able to know that I rated it on the next day so that it can calculate the next interval accordingly? If yes, keep it as an intraday learning card. If not, convert to review card. My main problem with the current behaviour is that on the next day, this card has a very low R but it doesn't show up in the early part of the reviews (even with ascending R sort order) because Anki is trying to shuffle interday learning and review cards evenly. |
Spitballing, instead of changing the behaviour of FSRS, we can also solve this issue (and possibly others) by treating the interday learning cards and review cards in the same way during review sorting if |
Yes. FSRS treats it as a review card if you review it in the next day. |
Can this be closed? |
Not yet. I proposed two approaches for solving the issue. Please decide which would be easier to implement.
|
OK, I locate the related function: anki/rslib/src/scheduler/answering/learning.rs Lines 40 to 75 in 8dea502
Here is the explanation of Claude: Let me explain how the card queue changes: In the
IntervalKind::InSecs(secs) => {
self.card.queue = CardQueue::Learn; // Set to learning queue
self.card.due = self.fuzzed_next_learning_timestamp(secs);
}
IntervalKind::InDays(days) => {
self.card.queue = CardQueue::DayLearn; // Set to day learning queue
self.card.due = (self.timing.days_elapsed + days) as i32;
}
The key logic is in the
So in summary:
|
If I understand your first approach correctly, we should remove |
As you're aware, even in SM2, Anki will put the card in the interday queue if it crosses a boundary, because queue selection is based on when the card will be shown again, not the length of the user's chosen learn step. Are you objecting to this behaviour in general, or are you making a case for FSRS behaving differently? I'd argue that the current behaviour is more appropriate, or perhaps moving it to the review queue, not the intraday queue. But I think the former might be a better choice, as if it's switched to a review card and the user forgets it, it will increment their lapse count. |
I think that this behavior is problematic in general. My main problem is that on the next day, Anki tries to mix these "interday" learning cards evenly with the "review" cards using the intersperser. But, if I have a large number of review cards due and I am not studying all of them, I can end up not seeing this "interday" learning card on the next day despite the fact that this card requires more urgent review. The user can potentially solve the issue by using I have said previously that altering the behavior of the intersperser might be the perfect solution (it will also allow interday learning cards to respect the sort orders) but altering the queue selection might be easier. |
It's impossible to change the behavior of the intersperser because the sorting is done before intersperser and the intersperser doesn't know the sorting method. So the intersperser cannot sort the interday learning cards and review cards. The intraday learning cards and review cards are gathered and sorted separately: anki/rslib/src/scheduler/queue/builder/gathering.rs Lines 14 to 61 in 44e01ea
|
Well, nothing is impossible but I agree that it may be difficult. So, putting the card in the intraday queue would be the easiest solution? |
If we keep learning cards in the intraday queue, learning cards and review cards are still in two separate queues. Does it solve your issue? |
Yes, because the learning card will be shown before the reviews which is desirable because it is the most urgent. |
I get it. I have a better solution: if the interval is shorter than 86400s or 43200s (instead of the seconds until rollover), keep it in the intraday queue. @dae, what do you think of? |
In current implementation, if the current datetime is 2024-02-10 20:00 and the rollover is 6, the number of seconds until rollover is (4+6) * 60 * 60 = 36000. If the interval is 43200s (if DR=0.9, the stability is 0.5 day), it will be converted to 1 day. The true retention will drop from 90% to ~80+%. If we put the card in the mid or the end of the queue, it is bad. |
I'm not very fond of the idea of putting cards due tomorrow in the intraday queue - it's what very old Anki did, and I don't think it's useful to keep the user waiting a few extra hours if they've already waited overnight. As this issue is not FSRS-specific, and Anki already gives you the ability to put interday learning cards in front of reviews in the case of a backlog, I'm not sure this needs to be a priority right now? With the default settings, Anki would not even be introducing new cards while you have a backlog active. |
Maybe you are right. This is not a priority because this won't be a (major) problem with the default settings and users can avoid the problem by putting interday learning cards ahead of the reviews. But, I think we should still keep this as a "low priority" issue for altering the behaviour of the intersperser when the interday learning and review cards are mixed. The final decision would be yours, though. |
@L-M-Sherlock
I am using
fsrs_short_term_with_steps
. Many times, I notice that after a review, FSRS converts a intraday learning card into a interday learning card.But, if the interval is 1d or more, shouldn't it simply convert the card to a review card?
Card info of one such card:
This is currently a interday learning card with a 1d interval.
The text was updated successfully, but these errors were encountered: