open-spaced-repetition / fsrs4anki-helper

An Anki add-on that supports Postpone & Advance & Load Balance & Easy Days & Disperse Siblings & Flatten
https://ankiweb.net/shared/info/759844606
MIT License
221 stars 19 forks source link

[BUG] Cards of same note show in succession during review #205

Closed winklerbua closed 8 months ago

winklerbua commented 1 year ago

Issue which was explained here https://www.reddit.com/r/Anki/comments/160r0kj/fsrs_does_show_cards_of_same_note_in_succession_a/

I don't know what else you need? Settings that already are used/tried are "auto disperse siblings after sync and review" "disperse all siblings was done" review order in Anki is set to "due date then random" or "random" etc. Only thing I don't use is the vanilla Anki function of burying siblings after reviewing one of them since as I explained I don't think it's viable to bury all of them til the next day, I just need it to be randomized so these cards would only show up very close to each other by occasionally by chance.

L-M-Sherlock commented 1 year ago

Could you provide the card info of those affected cards? I guess their intervals are too short, so FSRS doesn't disperse them.

winklerbua commented 1 year ago

exa3 exa2

yes so these are the type of cards where this happened today. So the intervals are short, but as I said I don't need or even want "dispersing" in terms of showing them on different days, they should just not show up directly after each other.

L-M-Sherlock commented 1 year ago

So the intervals are short, but as I said I don't need or even want "dispersing" in terms of showing them on different days, they should just not show up directly after each other.

But FSRS couldn't control the review sort order. It's the responsibility of Anki's short-term scheduler.

winklerbua commented 1 year ago

I mean something has to be in there that does this, since when I use the normal algorithm this never happened. It was a big reason why I abandoned the fsrs at some point. These cards are all already at least in their first fsrs step.

L-M-Sherlock commented 1 year ago

since when I use the normal algorithm this never happened.

It's weird. If you doesn't use Bury review siblings, it would also happen with the normal algorithm. Maybe I need to ask help from @dae.

dae commented 1 year ago

Are you using the FSRS add-on, and if so, does disabling it seem to make a difference? (of course, leaving FSRS active in your deck settings).

winklerbua commented 1 year ago

I have disabled the FSRS helper add-on today and after 150 reviews this hasn't happened once now.

dae commented 1 year ago

Ok, I suspect this is caused by the constant queue rebuilding I mentioned in https://forums.ankiweb.net/t/target-undo-op-not-found/33622/6.

L-M-Sherlock commented 1 year ago

Do you have any advice? I have not idea how to implement this:

A more efficient approach would be to do this processing in bulk, when the user is not in the middle of reviews.

dae commented 1 year ago

For example, your add-on could:

L-M-Sherlock commented 1 year ago

Indeed, my add-on has these features. But many users want to automate them. Is it possible to execute the feature when users leave their reviews (e.g., return to main page)?

dae commented 1 year ago

The most efficient solution (in both CPU time and user convenience) is that such tasks are handled by the Rust backend as cards are reviewed. I do not have any fundamental objections to "skip the weekend" or "load balancing" options, so long as they are implemented in a clean and efficient way (eg not searching through the future reviews on every answer - the information should be cached at queue build time, and updated as cards are reviewed)

For burying, Anki used to bury more than 1 day at a time, and it lead to problems, so I'd like to see a discussion of how those could be avoided/minimized before longer burying/rescheduling times were integrated in the Rust code.

If for now you want to address this in an add-on instead of the Rust core, a hook could be added to the congrats screen and/or or deck list if there isn't one already.

L-M-Sherlock commented 1 year ago

Yeah, it's efficient to let the Rust backend handle these tasks.

eg not searching through the future reviews on every answer - the information should be cached at queue build time, and updated as cards are reviewed

Here is my implementation:

  1. build a list of count of due cards per day.

https://github.com/open-spaced-repetition/fsrs4anki-helper/blob/857cba9a70adf62473c07ebc7b8f17f7d416facb/schedule/reschedule.py#L34-L53

  1. Find the date with the least count of due cards (exclude free days) in the fuzz range:

https://github.com/open-spaced-repetition/fsrs4anki-helper/blob/857cba9a70adf62473c07ebc7b8f17f7d416facb/schedule/reschedule.py#L115-L137

  1. update the list of count of due cards per day.

https://github.com/open-spaced-repetition/fsrs4anki-helper/blob/857cba9a70adf62473c07ebc7b8f17f7d416facb/schedule/reschedule.py#L342-L344

winklerbua commented 1 year ago

Just to confirm that you guys are fixing the right thing, I did all my like 400 due cards and this didn't happen with the add-on disabled. Just so I know, do I now need to enable the add-on and reschedule or what's the solution?

L-M-Sherlock commented 1 year ago

For burying, Anki used to bury more than 1 day at a time, and it lead to problems

Disperse Siblings in FSRS is more aggressive. It would increase the gap of due among sibling cards as large as possbile (but it would respect their fuzz range).

L-M-Sherlock commented 1 year ago

what's the solution?

The immediate solution is disable auto-disperse and auto-reschedule. Or if you want to use auto-disperse, please use it with auto-bury.

dae commented 1 year ago

Due to time constraints, I'd prefer to focus on the core FSRS integration for now. Once that's done, I'd be happy to discuss/accept well-written PRs that add this extra functionality.

winklerbua commented 1 year ago

what's the solution?

The immediate solution is disable auto-disperse and auto-reschedule. Or if you want to use auto-disperse, please use it with auto-bury.

But rescheduling after doing the reviews is fine?

L-M-Sherlock commented 1 year ago

But rescheduling after doing the reviews is fine?

Yeah, it's OK.

JordanAnthonyKing commented 1 year ago

Have these changes been mainlined? I've been experiencing this issue for quite a while and still often see siblings with wildly different intervals popping up in the same day. It's almost got me convinced that there's some bug in the disperse function that's actively placing these cards on the same day.

L-M-Sherlock commented 1 year ago
image

Could you enable debug_notify and collect related errors? I need them to solve bug.

JordanAnthonyKing commented 1 year ago

I'll endeavor to do so during my reviews tomorrow, I wonder if it's related to this: https://github.com/open-spaced-repetition/fsrs4anki-helper/pull/66 I say this because, in my case, I had several thousand words learned and wanted to add reverse cards to my deck. Instead of attempting to review them all in one day or fiddle with the allowance on my new cards/day, I rescheduled all of these cards to randomly appear within a 3 month range. Since they would therefore have no stats to calculate fuzz from, would the disperser place them right next to their sibling?

L-M-Sherlock commented 1 year ago

Disperser doesn't affect cards rescheduled manually by users:

JordanAnthonyKing commented 1 year ago

Could it instead then be non-manually rescheduled cards not being dispersed around the manually scheduled ones?

L-M-Sherlock commented 1 year ago

The manually scheduled cards' due and ivl are not modified by the disperse even if they are due in the same day.

JordanAnthonyKing commented 1 year ago

Despite having disperse enabled I have 16 pairs of siblings due today:

image

As described above, this could be due to manual rescheduling, but after beginning study I come across a note that I learned all of the cards for about a week ago. Perhaps they don't have enough fuzz to fully disperse? After reviewing the first card of the siblings due today:

image

Card gets dispersed from today into the past, causing it to show up today. I assume this can also happen for cards due a few days in the future.

JordanAnthonyKing commented 1 year ago

A second case of a card being dispersed into the past:

image

JordanAnthonyKing commented 1 year ago

Two cards dispersed but still on the same day as eachother:

image

Two cards with an interval of around a month not being split apart, these two cards have only been reviewed a single time, on their intiial 'new' state, where they were answered 'easy' putting them ~1 month into the future where they are now.

image

Same as above image

JordanAnthonyKing commented 1 year ago

A card being dispersed so that it ends up closer to its siblings?

image

And again, is this load balancing causing this?

image

user1823 commented 1 year ago

Card gets dispersed from today into the past, causing it to show up today. I assume this can also happen for cards due a few days in the future.

@L-M-Sherlock, this needs to be fixed.

Two cards dispersed but still on the same day as each other:

This needs to be investigated.

Two cards with an interval of around a month not being split apart

This needs to be investigated

A card being dispersed so that it ends up closer to its siblings?

This is not an bug. Disperse_siblings also tries to move cards away from the latest review date.

L-M-Sherlock commented 1 year ago

@JordanAnthonyKing, could you paste the screenshots of these cards' info?

L-M-Sherlock commented 1 year ago

Card gets dispersed from today into the past, causing it to show up today. I assume this can also happen for cards due a few days in the future.

Solved in c2df3ddc49fa6ad4d5723b5d5030400769384ca0

JordanAnthonyKing commented 1 year ago

@JordanAnthonyKing, could you paste the screenshots of these cards' info?

How do I view said info?

L-M-Sherlock commented 1 year ago
image

@JordanAnthonyKing, you can view the info in browser.

user1823 commented 1 year ago

@JordanAnthonyKing, do share the info of the affected cards, but also try out the following.

I have pushed a fix that might resolve this issue (at least partially). You can install the patched version of the add-on by downloading the following file, changing the file extension from .zip to .ankiaddon and then opening the file.

fsrs4anki-helper.zip

JordanAnthonyKing commented 1 year ago

Reviewed once, with a high interval, but not being dispersed:

image

image

As far as I can tell from the comment chain this is the only open issue but I will keep an eye out.

JordanAnthonyKing commented 1 year ago

@JordanAnthonyKing, do share the info of the affected cards, but also try out the following.

I have pushed a fix that might resolve this issue (at least partially). You can install the patched version of the add-on by downloading the following file, changing the file extension from .zip to .ankiaddon and then opening the file.

fsrs4anki-helper.zip

On the same card as above they now disperse:

image

However, and this may be unrelated, I decided to run disperse all siblings, not reschedule, just to clear up any present siblings and my reviews went from 400 to 800. This seems extreme.

JordanAnthonyKing commented 1 year ago

Not all cards are being dispersed:

image

Card info before review:

image

Sibling's info:

image

JordanAnthonyKing commented 1 year ago

Hi, just inquiring as to the status of this issue.

I've observed another odd behaviour. I recently increased my desired retention. I didn't reschedule as this would have meant a huge number of reviews, I'm just moving forward with this new retention and seeing how it goes for reviews and new cards.

Having 'Auto disperse siblings' set to true is pulling cards into the present day if I review one of their siblings, and their retention at the current (higher) level would bring their due date into the past/present.

Should there be some sort of parameter to prevent cards being dispersed into the present day, or just moving them into the past in general?

L-M-Sherlock commented 1 year ago

Should there be some sort of parameter to prevent cards being dispersed into the present day, or just moving them into the past in general?

I recommend discuss it in this issue:

L-M-Sherlock commented 1 year ago

Does the bug still exist after #259?

JordanAnthonyKing commented 1 year ago

I'm unsure as I've stopped using the feature altogether

user1823 commented 10 months ago

Having 'Auto disperse siblings' set to true is pulling cards into the present day if I review one of their siblings, and their retention at the current (higher) level would bring their due date into the past/present.

Fixed in https://github.com/open-spaced-repetition/fsrs4anki-helper/pull/350

JordanAnthonyKing commented 10 months ago

Having 'Auto disperse siblings' set to true is pulling cards into the present day if I review one of their siblings, and their retention at the current (higher) level would bring their due date into the past/present.

Fixed in #350

I'm not sure if the update hasn't been pushed yet or not but I am still seeing this issue

user1823 commented 10 months ago

Did you check for add-on updates in Anki?

JordanAnthonyKing commented 10 months ago

No updates available

user1823 commented 10 months ago

Are you running Anki 23.10+?

The issue has been fixed only in the version of the add-on that works in 23.10+. The older versions are no longer supported.

JordanAnthonyKing commented 10 months ago

Okay, I have the update now, I'll verify tomorrow

user1823 commented 10 months ago

If you have updated from 2.1.x to 23.x, I recommend reading the tutorial for built-in FSRS.

The most important points:

user1823 commented 10 months ago

@JordanAnthonyKing, is your problem resolved?