Investigate additional FSRS integration regression test candidates
Context
Run a discovery spike to identify gaps in regression protection in the code that integrates FSRS with Anki, including simulation, rescheduling, and memory-state updates.
Review historical bug fixes and existing tests to find behaviors that could regress without a test failure. Produce a prioritized backlog of actionable test proposals, each describing the behavior to protect, the evidence for its expected outcome, and a feasible approach to testing it.
Scope
- Review merged bug fixes related to Anki’s FSRS integration.
- Check whether existing tests directly protect each corrected behavior, including tests outside
scheduler/fsrs/. - Identify the expected behavior and its supporting issue, pull request, or documentation.
- Identify the production code path that a regression test should exercise.
- Where practical, temporarily reintroduce the historical defect to determine whether existing tests or an experimental test detect it.
- Assess test determinism, stability across supported CI platforms, runtime, test-data complexity, and the need for FSRS domain expertise.
Temporary experimental tests may be used to assess feasibility. Implementing and merging permanent regression tests should be handled in separate issues and PRs.
Deliverable
Produce a prioritized backlog of test proposals. For each investigated behavior, document:
- The behavior to protect and its historical reference.
- The expected outcome and the evidence supporting it.
- Existing test coverage and any remaining gap.
- The production code path to exercise and the proposed assertions.
- Whether temporarily restoring the defect caused a test failure, or why that experiment was impractical.
- Implementation challenges, maintenance concerns, and any need for specialist input.
- A recommended next step.
Assign each proposal one of these outcomes:
- Ready for implementation and review.
- Needs a feasibility experiment.
- Needs an FSRS specialist to define the expected behavior or numerical tolerances.
- No additional test recommended, with a reason such as existing coverage, excessive fragility, or insufficient evidence for the expected behavior.
Prioritize by user impact, ability to detect regressions, implementation effort, and maintenance cost.
Starting points
Investigate the following historical fixes, verifying whether they still represent testing gaps:
- #3667 — Prevent future
last_datevalues for existing cards in the simulator. - #4240 — Preserve requested learning and relearning step counts in
SimulatorConfig. - #3940 / #4189 / #4269 — Handle existing cards with missing memory state in the simulator.
- Commit
987c1825— Avoid a panic when enabling FSRS for cards whose history consists only of manual or add-on rescheduling. - #3760 / #3708 — Account for cards introduced today when placing synthetic new cards in the simulation.
- #4274 — Include learning events in simulated workload totals.
- #4364 — Prevent intervals from moving backward during rescheduling.
These are investigation starting points, not confirmed gaps or a requirement to add a test for every item.
Acceptance criteria
- Each investigated behavior has a documented expected outcome, supporting reference, and assessment of existing coverage.
- Each recommended test has a proposed approach and a clear explanation of the regression it would detect.
- Feasibility findings and unresolved questions are documented.
- Proposals requiring FSRS specialist input are clearly identified.
- The resulting backlog is prioritized, with a recommended next step for each item.
Source: ankitects/anki