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.

Ah, I had forgotten that I posted here about this. I ended up manually searching for the that were rescheduled around that unix time in SQL and removing the revlogs from the database. Risky since I was editing the SQL files themselves, but it fixed it I suppose? But if anyone is reading this in the future i would not recommend directly editing the SQL files.

I reverted to a backup before my delves and tried your console command: it changed the review type after the manual to learn, and after Check database, optimizing FSRS parameters, and updating memory state, the card difficulties dropped to what it seems like they should have! This would have been much easier, lol.

Thank you for the fix! Hopefully it can help anyone in the future should they run into the same issue.

Out of curiosity, do know what may have lead to the issue in the first place? I wonder if it’s something that I can try to avoid if the case comes up again, or maybe to keep an eye out.

Edit: would it be worth it to run that debug code on my current deck? I’m not sure if it’d even find anything though, because I’m mostly confident that I just removed the revlogs that were causing the issue in the first place.

Exactly which revlogs did you remove? I don’t think removing revlogs would solve the issue.

My guess would be that you used an add-on instead of Anki’s built-in option to reset the cards.

I removed the revlogs from the cards I saw that were affected by this issue, using the unix timestamp of whatever “2025-03-15 @ 23:37” translates to because that’s about when I did whatever I ended up doing to the cards to cause the issue. Nothing seems to be broken yet and I’ve seen some of the cards back in rotation since then. For cid:1652084555216 it had intervals of 17, 16, 10, 8 (with three reviews after 2025-03-15) – removed revlog + rescheduled, and the next review was actually just earlier today. The Ease of this card went from 100% to 69% (nice) with the difficulty also at 69%.

With a quick look though, none of the cards with 0-1 lapses are above ~75% in difficulty, which is where my FSRS settings put them. Some of the cards that had 0 lapses but also had a difficulty/ease of 100% (as above) are scored appropriately.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.