No missed ratings/lapses but difficulty @100% for FSRS5

Hi all, posted in the discord and after a bit of head scratching was guided to post here.

I’ve run into some cards in my deck that have a difficulty of 100% but have no failures of lapses. As far as I can tell, it has something to do with the fact that I reset these cards on 2025-03-15 (you can read my overly-lengthy rambling about it on the discord in this thread but i can’t include links in my post?), where after no missed ratings or lapses and after 3/15 the next rating had the difficulty spike to 100%. I used -rated:60:1 prop:d>0.99 to search for a few others cards that have unusually high difficulty ratings; there’s probably more, but I don’t know of a way to more specifically search for them. A common thread between these cards is that they had review history before 2025-03-15 (no fails/lapses), then the next review after being reset on 2025-03-15 resulted in the difficulty spiking to 100%.

I have an apkg of the deck, but I’m not sure the best way to share it.





current FSRS parameters:

0.9842, 8.0109, 41.2131, 100.0000, 7.3324, 0.5695, 1.7045, 0.0010, 1.3330, 0.3374, 0.8130, 1.9629, 0.1152, 0.3734, 2.2973, 0.1129, 3.0047, 0.4220, 0.7896

Cards I was able to find that showed this issues if i can figure out a way to upload the deck and someone wanted to look into it:

cid:1651387650132
cid:1652084556080
cid:1652084555216
cid:1652084555880
cid:1736233883284
cid:1652084555548

I’ve tried telling FSRS to “update memory state and reschedule” through the FSRS helper without any change in the difficulty. The deck has had it’s parameters optimized probably 2-3 times since 2025-03-15 as well, with memory states updated with each parameter change.

Any ideas? I’m open to suggestions on what to try from here. I think what I’ll probably do is to just use the card browser and use the reset option any of the cards with this issue I run across in the mean time, and then rate them accordingly.

Thanks!

3 Likes

After resetting a card, its next revlog entry should be of the Learn type. I am not sure why your cards have a Review type entry instead. This Review entry is what is confusing FSRS. You can try the following command in the debug console to correct the type of these entries.

mw.col.db.execute("""
WITH revlog_with_prev AS (
    SELECT 
        id,
        type,
        factor,
        LAG(type) OVER (PARTITION BY cid ORDER BY id) AS prev_type,
        LAG(factor) OVER (PARTITION BY cid ORDER BY id) AS prev_factor
    FROM revlog
)
UPDATE revlog
SET type = 0
WHERE type = 1
  AND id IN (
      SELECT id
      FROM revlog_with_prev
      WHERE prev_type = 4 AND prev_factor = 0
  );
""")
mw.col.set_schema_modified()

IMPORTANT:

  • Before doing this, ensure that all your devices are in sync. Otherwise, unsynced changes will be lost.
  • Create a backup so that you can restore if you don’t like the changes.

After running the above code, run Check database, optimize your FSRS parameters, ensure that everything looks alright and then do a one-way sync from Desktop to AnkiWeb.

1 Like

IMO check database should catch and fix such an error.

Actually, no. Such inconsistencies should be dealt with on a case-to-case basis after determining how they got the inconsistency. For some people, not fixing the inconsistency in type would produce better scheduling results.

Hmm, sure. Check database can still report the error and guide the user to here. Otherwise, most people would’ve no idea what’s going on.