I inlined FSRS-4.5 into a page so you can watch one lapse eat months of spacing
programming.dev
I inlined FSRS-4.5 into a page so you can watch one lapse eat months of spacing
Anki 23.10+ ships FSRS, but the scheduler is a black box while you’re using it — you press a button and a number appears. I wanted to actually watch the state evolve, so I inlined an FSRS-4.5 implementation into a single page. No server, no signup, nothing leaves your browser. https://smeltworks.com/studysched/sim [https://smeltworks.com/studysched/sim] Press Again / Hard / Good / Easy and it shows, per review: retrievability at review time, the updated stability and difficulty, and the next interval the scheduler would give you. Two things I found much more visceral once they were plotted rather than described: - A Good-streak compounds superlinearly. 4d -> 15d -> 50d -> 149d -> 405d. Stability gain scales with current stability and with how low retrievability was at review time, which is why reviewing early (“just to be safe”) measurably costs you — you get a smaller stability bump for the same review. - One lapse is brutal in a way the interval alone doesn’t show. A single Again doesn’t just shorten the next interval, it collapses stability to the post-lapse formula and permanently bumps difficulty, and difficulty only decays back slowly. Months of spacing genuinely evaporate. There’s also a desired-retention slider — dropping from 0.9 to 0.85 lengthens intervals noticeably, which is the main knob most people never touch. Implementation notes: it’s ~200 lines of dependency-free JS. The one thing worth flagging for anyone porting FSRS themselves is that initial difficulty in 4.5 uses the linear form w4 - (G-3)*w5; FSRS-5 switched to an exponential form with a different weight scale, and mixing the two silently gives you plausible-looking but wrong difficulties. I got that wrong first time and the trajectory still looked fine. Happy to be told where the implementation diverges from the reference — that’s most of why I’m posting it.
Anki 23.10+ ships FSRS, but the scheduler is a black box while you’re using it — you press a button and a number appears. I wanted to actually watch the state evolve, so I…
0 comments
No comments yet.