xquercus / load-balanced-scheduler

GNU General Public License v3.0
10 stars 9 forks source link

Addon no longer works with Anki 2.1.47 #11

Open cessen opened 3 years ago

cessen commented 3 years ago

I recently upgraded to Anki 2.1.47, and this addon no longer seems to do anything (everything is random, with days that spike with a bunch of reviews).

I'm not sure exactly what release it stopped working on, but it at least doesn't work on 2.1.47.

szalejot commented 3 years ago

The same issue here. For testing, I added logging to the file in the add-on code: at the add-on load temp file is created and each method invocation writes info to the file. The file is created, but nothing is logged. I suspect, that the binding fuzz calculation handler is broken, however, I am not that experienced with Anki dev to know how to fix that:

if version.startswith("2.1"):
    from anki.schedv2 import Scheduler
    anki.schedv2.Scheduler._fuzzedIvl = load_balanced_ivl

I checked in Anki source, that anki-main/pylib/anki/scheduler/v2.py contains the Scheduler class with the _fuzzedIvl method. I am puzzled, why substitution seems to not work.

xquercus commented 3 years ago

Thank you. I'll take a look.

On Mon, Sep 6, 2021, 2:13 PM szalejot @.***> wrote:

The same issue here. For testing, I added logging to the file in the add-on code: at the add-on load temp file is created and each method invocation writes info to the file. The file is created, but nothing is logged. I suspect, that the binding fuzz calculation handler is broken, however, I am not that experienced with Anki dev to know how to fix that:

if version.startswith("2.1"): from anki.schedv2 import Scheduler anki.schedv2.Scheduler._fuzzedIvl = load_balanced_ivl

I checked in Anki source, that anki-main/pylib/anki/scheduler/v2.py contains the Scheduler class with the _fuzzedIvl method. I am puzzled, why substitution seems to not work.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/xquercus/load-balanced-scheduler/issues/11#issuecomment-913837481, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFPIWVCBYI5AWJCQECGOSDUAUOF7ANCNFSM5DNMMLXQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

xquercus commented 3 years ago

Thank you both for the report.

So I just installed 2.1.47 and LBS seems to be working as expected. Here are the things I've confirmed:

Would you each explain exactly what you are seeing vs exactly what you expect to see? When recreating the issue, please disable all addons except LBS. Thanks.

xquercus commented 3 years ago

Question for you both. Could you both confirm that in Preferences -> Scheduling you have UNCHECKED V3 Scheduler (beta). There is new scheduling code in this version and LBS only works with V1 and V2. No idea what this V3 voodoo is but will find out soon enough.

Thanks. Really appreciate hearing what you find!

cessen commented 3 years ago

@xquercus Thanks for looking into this!

Here is a screen shot showing the reviews due graph and my Anki settings (v3 is disabled): http://perm.cessen.com/2021/anki/anki_balancer_report_01.png

Note that for several days prior to the shown graph, I only had 4-5 daily reviews. And then suddenly 15. And it's very inconsistent after that as well. I would expect a much more even distribution of daily reviews.

I did recently start over with my deck (deleting all cards, after 3+ years of using it). Does this addon cache information, perhaps, which hasn't gotten cleared since I deleted the cards?

I also use the following addons:

I doubt AnkiConnect or AwesomeTTS affect Load Balanced Scheduler, since they only do things on-demand, and don't have anything to do with scheduling. RefoldEase, on the other hand, I could imagine might interfere. I'll disable it and report back again in a week or so with the results.

xquercus commented 3 years ago

The same issue here. For testing, I added logging to the file in the add-on code: at the add-on load temp file is created and each method invocation writes info to the file. The file is created, but nothing is logged.

The logging in the config file will cause logs to be output to a terminal on systems like linux and probably Mac. They may not be available on Windows if that's that you are using. It's an anki/python issue. Although this might actually allow you to see the debug info on windows. Hm. If that works it would rock!

I suspect, that the binding fuzz calculation handler is broken, however, I am not that experienced with Anki dev to know how to fix that:

I'm not experienced either so appreciate your help.

if version.startswith("2.1"):
    from anki.schedv2 import Scheduler
    anki.schedv2.Scheduler._fuzzedIvl = load_balanced_ivl

I checked in Anki source, that anki-main/pylib/anki/scheduler/v2.py contains the Scheduler class with the _fuzzedIvl method. I am puzzled, why substitution seems to not work.

For me, using Anki's interactive debugger LBS seems to load correctly:

>>> pp(anki.sched.Scheduler._fuzzedIvl.code) <code object load_balanced_ivl at 0x7ff5dc3753a0, file >"/home/USERNAME/.local/share/Anki2/addons21/208879074/load_balanced_scheduler.py", line 27>

anki.sched.Scheduler._fuzzedIvl seems to be pointing to the patch in the addon when enabled. When disabled the same command will return Anki's stock _fuzzedIvl function.

xquercus commented 3 years ago

Here is a screen shot showing the reviews due graph and my Anki settings (v3 is disabled): http://perm.cessen.com/2021/anki/anki_balancer_report_01.png

Note that for several days prior to the shown graph, I only had 4-5 daily reviews. And then suddenly 15. And it's very inconsistent after that as well. I would expect a much more even distribution of daily reviews.

There is only so much load balancing that can be done with cards with a small interval so this may be expected behavior. This is from the readme:

Cards with small intervals will be load balanced over a narrow range. For example, cards with an interval of 3 will be load balanced over days 2-4. This range expands as the interval increases. Cards with an interval of 15 will be balanced over days 13-17 and cards with an interval of 30 will be balanced over days 26-34. Again, these are the same ranges stock Anki uses when randomly assigning intervals. The exact ranges can be seen here in the Anki source.

See here just how narrow the ranges are for newer cards.

To see if there is an issue we need logs:

I did recently start over with my deck (deleting all cards, after 3+ years of using it). Does this addon cache information, perhaps, which hasn't gotten cleared since I deleted the cards?

No. All scheduling information comes from whats stored in the current deck. There is no cache.

I also use the following addons:

  • AnkiConnect (for creating new cards from other applications)
  • AwesomeTTS (for adding spoken audio to vocab cards)
  • RefoldEase (ensures that the ease of cards remains constant)

None of these are likely to interfere but we need to disable them all anyway. Anki addons work by clobbering code and praying.

szalejot commented 3 years ago

I ran Anki with anki-console.exe. Debug messages are being written to logs as expected. Weird, that manual logging to the file was not working before (even though the file was created).

cessen commented 3 years ago

Here are the logs from a short review session (all other addons disabled):

https://gist.github.com/cessen/a8a5cb53ee18e65bbd5a73be601cc266

There is only so much load balancing that can be done with cards with a small interval so this may be expected behavior.

Yeah, and that's what I thought might be going on at first as well.

But if you take a look at my screenshot again, you'll see a spike of 4 cards about 20 days out, with completely empty days on either side. My assumption was that cards with ~20 day intervals would have at least a day or two of wiggle room, and indeed looking at the source you linked to it appears they have a +/- 2-day fuzz range. So it seems like those cards should be spread out over about four or five days.

There may still be something else about the addon that I'm misunderstanding, of course. But I was at least aware of the limited fuzzing with young cards already.

cessen commented 3 years ago

Also, here's a screen shot of the reviews due stats after that short review session (note that this is the day after the last screenshot, so everything is shifted over one): http://perm.cessen.com/2021/anki/anki_balancer_report_02.png

cessen commented 3 years ago

Here's the rest of my review session today: https://gist.github.com/cessen/c37e9c6e5a650adb8fa05f94dc59ab3e

And the reviews-due screen shot afterwards: http://perm.cessen.com/2021/anki/anki_balancer_report_03.png

szalejot commented 3 years ago

From logs looks like ilvl 6 is frequently chosen, but next review see still only 2 cards on day 6. The number of cards on this day is not getting incremented between reviews. Which actually causes big spike on day 6 instead preventing it.

cessen commented 3 years ago

Although I don't fully understand the logs, it appears to me that sometimes the scheduler might have an off-by-one error. You can see this especially in the logs of my second study session, where it repeatedly (and correctly) decides that interval 6 is best, but the day the card actually gets added to is at interval 7.

It's strange how it happens, though, because it's not consistent like I would normally expect an off-by-one error to be. In the first review session, for example, when it decides that interval 8 is best, it usually assigns the card to interval 8. ~But one time it assigns it to 9.~ (Edit: nevermind, I was reading it wrong. It does always assign to 8 and 9 correctly. Nevertheless, it works correctly there, but not with 6.)

Edit: Another case, but you have to look across both of my review sessions to see it: it also appears that whenever it (correctly) determines that 10 is the best interval, it actually assigns to 11 instead.

szalejot commented 3 years ago

Good catch. This "one off" may be the reason for the spikes creation.

xquercus commented 3 years ago

@cessen do the screenshots above show future reviews for just one deck or your entire collection?
Would you mind uploading a copy of your collection somewhere so I can download it? Not just the one deck you are studying but an export of the profile's entire collection. Is that possible? We'll get this figured out.

xquercus commented 3 years ago

From logs looks like ilvl 6 is frequently chosen, but next review see still only 2 cards on day 6. The number of cards on this day is not getting incremented between reviews. Which actually causes big spike on day 6 instead preventing it.

> check_ivl 5    num_cards 10   best_ivl 5   
> check_ivl 6    num_cards 2    best_ivl 6   
  check_ivl 7    num_cards 6    best_ivl 6   
2021-09-07 09:58:31.324883   orig_ivl 6    min_ivl 5    max_ivl 7    best_ivl 6   
> check_ivl 5    num_cards 10   best_ivl 5   
> check_ivl 6    num_cards 2    best_ivl 6   
  check_ivl 7    num_cards 6    best_ivl 6   
  check_ivl 8    num_cards 3    best_ivl 6   
  check_ivl 9    num_cards 3    best_ivl 6   
2021-09-07 09:58:31.324997   orig_ivl 7    min_ivl 5    max_ivl 9    best_ivl 6   
> check_ivl 5    num_cards 10   best_ivl 5   
> check_ivl 6    num_cards 2    best_ivl 6   
  check_ivl 7    num_cards 7    best_ivl 6   
2021-09-07 09:59:10.180349   orig_ivl 6    min_ivl 5    max_ivl 7    best_ivl 6   
> check_ivl 5    num_cards 10   best_ivl 5   
> check_ivl 6    num_cards 2    best_ivl 6   
  check_ivl 7    num_cards 7    best_ivl 6   
  check_ivl 8    num_cards 3    best_ivl 6   
  check_ivl 9    num_cards 3    best_ivl 6   
2021-09-07 09:59:10.180484   orig_ivl 7    min_ivl 5    max_ivl 9    best_ivl 6 

I think you are looking at this. Pointing out that both invocations at 9:24:33 and 9:24:47 ivl=6 has 2 cards even though a third was scheduled in the first invocation. One would expect the second invocation to show three cards. I'm working on an explanation for this but want to poke at the collection @cessen is using. Anymore insight would be appreciated.

Edit: Just as an idea of where I'm going is that the "one off" instances may be from the card being load balanced being counted before balancing. Failed cards don't get load balanced either so if one was reviewed between invocations of the load balancer we wouldn't see anything in the logs. Don't want to go too far out on a limb here before looking at the collection as it's been years since I've looked at the scheduler. I vaguely remember this though.

cessen commented 3 years ago

@cessen do the screenshots above show future reviews for just one deck or your entire collection?

I'm not totally sure, but it would look the same either way in this case. I do have two decks, but the second deck only has two cards in it (I use it very occasionally to help me remember things like new addresses, etc.), and neither of them are scheduled for the period shown in the screen shot.

Would you mind uploading a copy of your collection somewhere so I can download it?

Sure, here you go: http://perm.cessen.com/2021/anki/collection-2021-09-07%4016-20-44.colpkg

It should have both of my decks in it. I didn't include media, since I assume that's not relevant and would just bloat the size.

Thanks for taking the time to look into this, btw! I really appreciate it. This addon is IMO critical to making Anki actually usable.

xquercus commented 3 years ago

Thanks @cessen. Just to confirm, there are only 67 cards in the collection?

cessen commented 3 years ago

Yes, 67 cards. As I said before, I recently deleted my cards to start over fresh, hence the low count.

65 cards in one deck, and 2 in the other.

cessen commented 3 years ago

Not to nag or anything (no rush, I know you're doing all this work for free!). But have you made any progress on this yet?

xquercus commented 3 years ago

Not yet but thanks for touching base. Hoping to take a look at this today or tomorrow.

On Thu, Sep 16, 2021, 5:16 PM Nathan Vegdahl @.***> wrote:

Not to nag or anything (no rush, I know you're doing all this work for free!). But have you made any progress on this yet?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/xquercus/load-balanced-scheduler/issues/11#issuecomment-921325923, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFPIWUXHFB2PHLE2HSZTWTUCJ3FJANCNFSM5DNMMLXQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

xquercus commented 3 years ago

There is definitely a problem. I went through a review session and manually checked and recorded interval data. It's simply not working correctly for most cards. If LBS returns interval X many cards are actually being scheduled for interval X+1. You can see in the attached spreadsheet "LBS End Ivl" (the interval assigned by LBS and seen in the LBS debug logs) and "Browser End Ivl" (the interval the card has when finding it in the browser) are not equal. Something changes it. No idea what yet.

I'll keep looking into this but any thoughts are welcome.

09-08-2021-reviews-spreadsheet.ods 09-08-2021-debug.log

szalejot commented 3 years ago

@xquercus I looked briefly over the pylib/anki/scheduler/v2.py code, but I don't see an obvious reason, why one day shift may occur. I know it sounds like a crude heuristic, but have you tried changing your load_balanced_ivl function to return (best_ivl - 1)? Then, if most of the cases is shifted by one, cards should be mostly put into correct review day.

xquercus commented 3 years ago

I know it sounds like a crude heuristic, but have you tried changing your load_balanced_ivl function to return (best_ivl - 1)? Then, if most of the cases is shifted by one, cards should be mostly put into correct review day.

It would be better to find the root cause as we really need to make sure the scheduler is doing exactly what we want it to do. I have anki setup in pycharm and hope to be able to do some debugging soon.

xquercus commented 3 years ago

This looks like an LBS bug. It looks like here there is one case (in addition to max interval) where anki can modify a card's interval outside of _fuzzedIvl() and this isn't taken into account. This can sometimes increase the LBS interval by one day -- which is exactly what we are seeing. The attached file contains a possible patch. I've tested it on 2.1.47 mostly with review cards from the deck @cessen posted. It would be great if we could do further testing with new and relearn cards. If anyone is able to, please install Card Info During Review and check that after each card is scheduled "Interval" is the same as "best_ivl" from the LBS debug log. If there are any instances where these two values are not equal, please post a screenshot.

TODO

load_balanced_scheduler.txt

szalejot commented 3 years ago

I know, that it's not comprehensive testing, but I've been using modified code for the last few days. I am using 2.1.47 and doing 400-700 reviews per day. The future due graph becomes very smooth, without any spikes.

cessen commented 3 years ago

I've installed the patched version of the addon, and will report back once I've done enough review cycles to see if it's working or not. I've also installed Card Info During Review and will keep an eye on that as well.

@szalejot

and doing 400-700 reviews per day

Holy crap. You have some serious stamina, ha ha. I think I would die.

kuroahna commented 3 years ago

Using Anki version 2.1.48:

Not sure if anyone is noticing the same issue, but I've noticed my daily reviews have been steadily increasing after using the patch for a ~week. I was getting 300-350 reviews but for the past 2 days I've been getting 400 reviews, and strangely started to notice seeing the same cards that I've failed/relearned to show up constantly every day.

After some investigation, it looks to be a bug . In the screenshot below, I failed/relearned the card, and then I've been reviewing the same card every single day until I reverted the patch/change to the version that is on ankiweb (or just removing the addon completely), which successfully finally pushed it to 3 days

image

I've been testing the load balancer addon without the patch (the one available on ankiweb), and it actually works fine without the "fix" (which just introduced another problem where if you relearn a card, it'll get stuck in a 1 day interval loop forever), so I'm not sure if I'm seeing the same issue as you guys are describing. Also, anki settings are important here as well. I have my interval modifier set to 100%, hard interval set to 120%, easy bonus set to 130%, starting ease set to 250% and new interval set to 20%, which could be why I'm not seeing the same "off by 1" issue as u guys, but in a different area

The only thing is that the version without the patch (the one available in ankiweb addons https://ankiweb.net/shared/info/208879074 ) has a "bug" (if you consider this to be a bug) where it'll ignore the load balanced interval that it chose if the interval is too short such as <= 3 day interval, and just force it to be 3 days. This is the "off by 1" bug that I'm personally seeing. So in other words, there's no load balancing if the interval is too small (<= 3 day interval). Once the card's interval reaches > 3 day (such as 6/7 days), it'll get load balanced correctly

In the _constrainedIvl function, the patch does this:

    if fuzz:
        prev = 0

Right before calling

    ivl = max(ivl, prev + 1, 1)

Which ignores the previous interval

The algorithm is a bit complex and I honestly don't 100% understand it, but I spent a few hours just playing around with it yesterday, and basically this function gets called for determining the Hard, Good, and Easy button intervals. And the Good button is dependent on the Hard button, where prev is set to the Hard button's interval. Likewise, the Easy button is dependent on the Good button, where prev is set to the Good button's interval. And the Hard button's prev is set to the card's current interval (if the hardFactor > 1 which it is by default if you kept it to 120%, otherwise prev is set to 0)

So essentially your patch forces prev to be 0 if we're load balancing (when fuzz is set to true ). This isn't an issue for most of the time, but it becomes a problem when the interval is set to 1 day, because this line

ivl = max(ivl, prev + 1, 1)

means that it'll get stuck in the 1 day loop forever, if ivl is set to 1 and prev+1 is also set to 1 (since prev = 0)

So the whole reason why anki has this prev+1 logic when setting ivl = max(ivl, prev + 1, 1) is to avoid this 1 day loop.

If you remove his patch,

    if fuzz:
        prev = 0

Then you don't get this issue

Also, the prev variable technically contains the load balanced interval. So for example, the Good button has prev set to the Hard button's load balanced interval. And prev+1 means it'll be 1 day after the Hard button's load balanced interval (hence why the github issue is opened and complains about the "off by 1" issue)

So to recap, if you're not using his patch, then it'll work properly, just that for new/relearn cards where the interval is still too short, like <= 3 days, there's no load balancing done. Which is fine for the most part

I do have a fix in mind if you want to fix this issue and load balance cards that have a short interval (<= 3 days), where you replace

    ivl = max(ivl, prev + 1, 1)

With this:

    if fuzz and ivl < prev + 1:
        ivl = self._fuzzedIvl(prev + 1)
        ivl = max(ivl, 1)
    else:
        ivl = max(ivl, prev + 1, 1)

So this keeps the same functionality, but in the case where fuzz is set to true and ivl < prev + 1, we override the logic and call the load balancer function again on the prev + 1 instead.

However, this kind of messes with the scheduling algorithm a bit, depending if you like it or not.

Assuming we're using my patch, in the case that ivl = 1: For the hard button, prev is 1, which means it calls

    if fuzz:
        ivl = self._fuzzedIvl(ivl)

but load balancer for ivl=1 just returns 1 (since for 1 day, u can't load balance with only 1 day, you need a couple days) So with my patch, if fuzz and ivl < prev + 1: is true and hence we call ivl = self._fuzzedIvl(prev + 1) on it Since prev+1 = 2, then it load balances on 2 or 3 days. So the hard button interval, if prev=1 and ivl=1, then it'll return 2 or 3 day interval (this is important)

Then for the good button, prev = 2 OR prev = 3 since that's the returned interval for the hard button, Then it'll call

    if fuzz:
        ivl = self._fuzzedIvl(ivl)

But ivl = 1 as well (the card's interval doesn't change) So with my patch, if fuzz and ivl < prev + 1: is true and hence we call ivl = self._fuzzedIvl(prev + 1) on it

Then there's 2 cases to consider here: Case 1: prev = 2: Since prev = 2, then prev + 1 = 3, then it load balances on 2, 3 or 4 days (that's what _fuzzedIvl will return). Case 2: prev = 3: Since prev = 3, then prev + 1 = 4, then it load balances on 3, 4, or 5 days (that's what _fuzzedIvl will return)

So, pressing the good button, depending on what Hard button returns, will either load balance on: 1) 2, 3, or 4 day interval if hard button returns a 2 day interval. 2) 3, 4, or 5 day interval if hard button returns a 3 day interval.

So this fixes the issue.

In contrast, without my patch and just using the version from ankiweb, for the above case where the card interval is too short, which is when the card's interval is <= 3 days, and happens when you learn a new card, or relearn it, it will NOT load balance, and always set the card's interval to 3 days.

So, the main issue I have with my patch is that I'm a bit concerned with the 2nd case where we load balance it between 3, 4, and 5 days when pressing Good. Particularly when it pushes the card to 5 days. This might be too big of an interval. I'm not sure.

So I'm thinking, on one hand, it's completely fine to accept the spikes by constantly pushing it to 3 days when the card is still new/relearned. Once the card has an interval of > 3 days, it'll get load balanced normally

On the other hand, if you want to load balance these new/relearn cards, the current logic might push it too far, and hence you'll fail it Although, I guess this isn't too much of an issue, since there's technically 4 intervals a card can go into Either 2, 3, 4, or 5. And I think 75% of the time, when load balancing, your new/relearn cards will go into 2/3/4 day intervals. And then the other 25% of your cards will be pushed to 5 days

Also, I use Pass/Fail addon, so I only ever press Again or Good. That's why I don't even bother considering what happens when u press Easy. Although, for new cards, if you graduate it early by pressing Easy, then there's no load balancing for it anyways

Also, another thing, I noticed that you said that the addon doesn't work for filtered decks, but I tested it yesterday as well, and it works for filtered decks, so I'm not sure what exactly doesn't work.

I've attached my patch below (rename .py.txt to .py)

OUT OF DATE. DO NOT USE load_balanced_scheduler.py.txt

EDIT: I have raised a pull request which fixes the issue and the v2 scheduler bug. In particular, just download the file and replace the contents of the load_balanced_scheduler.py file in your addon folder if you have the addon already installed.

kuroahna commented 3 years ago

I spent some more time analyzing the code and comparing the v2 scheduler vs the v1 scheduler. There might be a bug with the v2 scheduler itself. See the above mentioned link.

Also, the patch I suggested above does somewhat work, but it's not the exact same as what the v1 scheduler would have done. Particularly, pressing the good button in the above example should only set the card's interval to either 2, 3, or 4 days. Not 2, 3, 4, or 5 days.

CC: @xquercus

EDIT: Looks like we got confirmation from them. Looks to be a regression in the v2 scheduler since 2018

cessen commented 3 years ago

@kuroahna

Thanks for putting the legwork into getting this figured out! Looking at your issue on the Anki repo, it looks like they don't intend to fix the bug in the v2 scheduler, which is a shame, but on the bright side means we don't have to worry about updating again once we get this fixed on our end.

(Also a shame that dae doesn't seem to think load balancing is worthwhile as a built-in feature, especially since the v3 scheduler looks to be essentially impossible to patch with addons since it's written in Rust now.)

@xquercus Any idea when you might get around to reviewing kuroahna's PR?

Willz7 commented 2 years ago

@cessen I wondering if someone could update this addon using v3 custom scheduler using JS

ratman-codes commented 1 year ago

@kuroahna Hi there, I just saw your post. I haven't been updating anki because I didn't want to use v2 scheduler and break this vital addon. I was wondering how I use your patch, do I drop it into the same folder as my loadbalancer.py file and good to go, or does it replace loadbalancer.py?

edit: I ended up installing the latest anki (2.1.64 as of this post) with the v2 scheduler and using @kuroahna 's patch. It has only been 4 days but I feel that the load balancing isn't as smooth as the original addon (talking way back, loadbalancer, the one before the current version) as you can see by this review graph image where I have a spike 5 days from now that I usually never would have had before.

I cannot tell if this is due to the updated nature of this addon itself, the patch kuroahna shared, both, or neither. But I'll keep watching it. As far as I know I can't even tell if the addon is functioning properly right now.

As someone who does anki for hours a day and fails a good amount of cards (~20%), the concept of this addon is absolutely vital for me to use Anki so I may be forced to downgrade back to 2.1.35 and the v1 schedular and go back to the original loadbalancer addon if I notice this isn't working.

edit 2: after today's reviews, I'm pretty sure the program IS working, so based on what kuroahna said above it might be that it's not as aggressive about balancing between 1-5 days or something where there is more flucutation, but in anything after that it's pretty obviously flat.

kuroahna commented 1 year ago

@kuroahna Hi there, I just saw your post. I haven't been updating anki because I didn't want to use v2 scheduler and break this vital addon. I was wondering how I use your patch, do I drop it into the same folder as my loadbalancer.py file and good to go, or does it replace loadbalancer.py?

You can use the one in the pull request that I have opened. In particular, just download the file and replace the contents of the load_balanced_scheduler.py file in your addon folder if you have the addon already installed.

The patch I have linked above is out of date. It still has the v2 scheduler bug. if you use the one in the pull request, it fixes the load balancing for cards with short intervals. I will update the comment so in case anyone stumbles upon it, they will use the correct one

It should work with the v2 scheduler. If you use the v3 scheduler, it will not work.

Note: I do not use this addon anymore, and haven't tested it on the latest versions of anki. The last version I have tested it with was 2.1.48