From 4d0bc70b2f8a62d09338b0f5a0073c5ec45c8386 Mon Sep 17 00:00:00 2001 From: Luc Mcgrady Date: Mon, 18 Aug 2025 22:33:02 +0100 Subject: [PATCH] Fix/Simulator intervals decending overflows --- rslib/src/scheduler/fsrs/simulator.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rslib/src/scheduler/fsrs/simulator.rs b/rslib/src/scheduler/fsrs/simulator.rs index a26afda9c..85e29cdc0 100644 --- a/rslib/src/scheduler/fsrs/simulator.rs +++ b/rslib/src/scheduler/fsrs/simulator.rs @@ -97,7 +97,7 @@ fn create_review_priority_fn( // Interval-based ordering IntervalsAscending => wrap!(|c, _w| c.interval as i32), - IntervalsDescending => wrap!(|c, _w| -(c.interval as i32)), + IntervalsDescending => wrap!(|c, _w| -((c.interval as i32).max(-i32::MAX))), // Retrievability-based ordering RetrievabilityAscending => { wrap!(move |c, w| (c.retrievability(w) * 1000.0) as i32)