From 0321c26e7317e5c2ea1fd3b01154255d09f80edf Mon Sep 17 00:00:00 2001 From: RREEMMII <64311122+rreemmii-dev@users.noreply.github.com> Date: Sat, 26 Apr 2025 03:55:40 +0200 Subject: [PATCH 1/4] Fix docs of note_fields_check to match changes made in PR #3912 (#3944) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: RĂ©mi Deloye --- rslib/src/notes/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rslib/src/notes/mod.rs b/rslib/src/notes/mod.rs index 2243a916d..2b53321b9 100644 --- a/rslib/src/notes/mod.rs +++ b/rslib/src/notes/mod.rs @@ -590,9 +590,9 @@ impl Collection { Ok(changed_notes) } - /// Check if the note's first field is empty or a duplicate. Then for cloze - /// notetypes, check if there is a cloze in a non-cloze field or if there's - /// no cloze at all. For other notetypes, just check if there's a cloze. + /// Check if there is a cloze in a non-cloze field. Then check if the + /// note's first field is empty. For cloze notetypes, check whether there + /// is a cloze at all. Finally, check if the first field is a duplicate. pub fn note_fields_check(&mut self, note: &Note) -> Result { Ok({ let cloze_state = self.field_cloze_check(note)?; From a5778f337753637127eefd6efb8e7a42fa652c7f Mon Sep 17 00:00:00 2001 From: Jarrett Ye Date: Sat, 26 Apr 2025 10:05:13 +0800 Subject: [PATCH 2/4] Fix/FSRS-6 doesn't give <1d intervals & use log loss instead of RMSE(bins) (#3948) * Fix/FSRS-6 doesn't give <1d intervals https://forums.ankiweb.net/t/anki-25-05-beta-1/59710/8?u=l.m.sherlock * use log loss instead of rmse to determine use which parameters --- rslib/src/scheduler/answering/mod.rs | 2 +- rslib/src/scheduler/fsrs/params.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rslib/src/scheduler/answering/mod.rs b/rslib/src/scheduler/answering/mod.rs index e9461279f..13006fa88 100644 --- a/rslib/src/scheduler/answering/mod.rs +++ b/rslib/src/scheduler/answering/mod.rs @@ -468,7 +468,7 @@ impl Collection { self.get_config_bool(BoolKey::FsrsShortTermWithStepsEnabled); let fsrs_allow_short_term = if fsrs_enabled { let params = config.fsrs_params(); - if params.len() == 19 { + if params.len() >= 19 { params[17] > 0.0 && params[18] > 0.0 } else { false diff --git a/rslib/src/scheduler/fsrs/params.rs b/rslib/src/scheduler/fsrs/params.rs index 13e588535..d313a6851 100644 --- a/rslib/src/scheduler/fsrs/params.rs +++ b/rslib/src/scheduler/fsrs/params.rs @@ -116,10 +116,10 @@ impl Collection { })?; progress_thread.join().ok(); if let Ok(fsrs) = FSRS::new(Some(current_params)) { - let current_rmse = fsrs.evaluate(items.clone(), |_| true)?.rmse_bins; + let current_log_loss = fsrs.evaluate(items.clone(), |_| true)?.log_loss; let optimized_fsrs = FSRS::new(Some(¶ms))?; - let optimized_rmse = optimized_fsrs.evaluate(items.clone(), |_| true)?.rmse_bins; - if current_rmse <= optimized_rmse { + let optimized_log_loss = optimized_fsrs.evaluate(items.clone(), |_| true)?.log_loss; + if current_log_loss <= optimized_log_loss { if num_of_relearning_steps <= 1 { params = current_params.to_vec(); } else { From 9872645d5ac63a927f44e84a4e2715499e5afe78 Mon Sep 17 00:00:00 2001 From: user1823 <92206575+user1823@users.noreply.github.com> Date: Sat, 26 Apr 2025 07:35:38 +0530 Subject: [PATCH 3/4] Update sorting by R for FSRS 6 (#3949) * Update sorting by R for FSRS 6 * Update sqlite.rs --- rslib/src/storage/sqlite.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rslib/src/storage/sqlite.rs b/rslib/src/storage/sqlite.rs index e7057946d..fb7066caf 100644 --- a/rslib/src/storage/sqlite.rs +++ b/rslib/src/storage/sqlite.rs @@ -384,10 +384,8 @@ fn add_extract_fsrs_relative_retrievability(db: &Connection) -> rusqlite::Result .max(0.0001); return Ok(Some( - // power should be the reciprocal of the value of DECAY in FSRS-rs, - // which is currently -0.5 - -(current_retrievability.powi(-2) - 1.) - / (desired_retrievability.powi(-2) - 1.), + -(current_retrievability.powf(-1.0 / decay) - 1.) + / (desired_retrievability.powf(-1.0 / decay) - 1.), )); } } From 2406830ff949668403c60f52d56201f456e5a2d9 Mon Sep 17 00:00:00 2001 From: Luc Mcgrady Date: Sat, 26 Apr 2025 03:09:40 +0100 Subject: [PATCH 4/4] Fix/no memory state revlogs in reverse order on card stats screen. (#3951) --- rslib/src/stats/card.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rslib/src/stats/card.rs b/rslib/src/stats/card.rs index cdea5193e..dce38c56a 100644 --- a/rslib/src/stats/card.rs +++ b/rslib/src/stats/card.rs @@ -176,7 +176,7 @@ impl Collection { } Ok(result.into_iter().rev().collect()) } else { - Ok(revlog.iter().map(stats_revlog_entry).collect()) + Ok(revlog.iter().rev().map(stats_revlog_entry).collect()) } } }