[Bug] FSRS Desired Retention Simulator expects 21 parameters but decks support less than that, leading to silent failure

After updating from Anki version 25.09 to the current version 26.05 I tried to use the FSRS Desired Retention Simulator (“Help Me Decide”). However it would not produce an output and Anki would produce an error message box upon closing Anki itself, with the provided debug log appearing unspecific.
Running Anki with console revealed an error in simulation.rs during execution of the simulator: “index out of bounds: the len is 19 but the index is 20”, corresponding to the function parameter “w” (FSRS parameter array) in the Rust code.
Upon adding parameters 20 and 21 to my deck’s FSRS parameters the simulator worked correctly.
After removing parameters 20 and 21 again, Anki continued operating normally with 19 parameters provided, but the simulator failed silently again.

Proposal

  • The FSRS Desired Retention Simulator (“Help Me Decide”) should refuse to open or run if fewer than 21 parameters are present, since it appears to assume 21 parameters and will fail silently otherwise while presumably locking the database, leading to an error message upon closing Anki
  • Users should be informed that their fewer than 21 FSRS parameters correspond to an outdated version of FSRS and will require optimization to generate 21 parameters for the current FSRS version.

Additional Issue

  • Since the simulator assumes 21 parameters and fails with fewer, it is unclear to me whether FSRS scheduling itself operates correctly in Anki 26.05 when fewer parameters are present.

@A_Blokee

I guess this code caused the problem.

I don’t think you need to be concerned about this though. As newer versions of FSRS have launched, and the number of parameters has increased from 17 to 19 to 21, each version of Anki applies the correct algorithm based on the number of parameters present. So if you still have 19 parameters, your cards will be scheduled just fine with FSRS-5.

Should be fixed by this.

    let reviewless_end_memorized = cards
        .iter()
        .fold(0., |p, c| p + c.retention_on(req.days_to_simulate as f32));

I get this error message in the console when running with 19 parameters, sorry should have included it:

thread '<unnamed>' (32688) panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\fsrs-5.2.0\src\simulation.rs:272:18:
index out of bounds: the len is 19 but the index is 20
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Since it’s FSRS 5.2 (from September 24, 2025) I believe it may correspond to fsrs-rs/src/simulation.rs at 2b7e679a0e2b9547c0a3e2f88ab7b969d0a07ddd · open-spaced-repetition/fsrs-rs · GitHub

fn power_forgetting_curve(w: &[f32], t: f32, s: f32) -> f32 {
    debug_assert!(t >= 0.);
>>  let decay = -w[20];
    let factor = 0.9f32.powf(1.0 / decay) - 1.0;
    (t / s).mul_add(factor, 1.0).powf(decay)
}

From what I can tell this code was added as “Feat/FSRS-6” in commit Feat/FSRS-6 (#313) · open-spaced-repetition/fsrs-rs@3e2f0b4 · GitHub but was potentially later released as part of FSRS 5.2, which could lead to the observed issue.

Thank you, this is good to know.

Don’t worry. The problem will be fixed on the next release. See the PR I linked above. check_and_fill_parameters wasn’t called before the weights were passed to the function (Which is the function which migrates parameters from earlier FSRS versions for use with the new one). But if you look at the PR that I linked above then you can see that it is called now and the parameters have been moved to each card instead of passed to the .on_retention function.