Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 85 additions & 69 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ rev = "184b2ca50ed39ca43da13f0b830a463861adb9ca"
[workspace.dependencies.fsrs]
# version = "=2.0.3"
git = "https://github.com/open-spaced-repetition/fsrs-rs.git"
rev = "08d90d1363b0c4722422bf0ef71ed8fd7d053f8a"
rev = "c7717682997a8a6d53d97c7196281e745c5b3c8e"
# path = "../open-spaced-repetition/fsrs-rs"

[workspace.dependencies]
Expand Down
80 changes: 49 additions & 31 deletions cargo/licenses.json
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@
},
{
"name": "bincode",
"version": "2.0.0-rc.3",
"version": "2.0.1",
"authors": "Ty Overby <[email protected]>|Zoey Riordan <[email protected]>|Victor Koenders <[email protected]>",
"repository": "https://github.com/bincode-org/bincode",
"license": "MIT",
Expand Down Expand Up @@ -415,7 +415,7 @@
},
{
"name": "burn",
"version": "0.16.0",
"version": "0.16.1",
"authors": "nathanielsimard <[email protected]>",
"repository": "https://github.com/tracel-ai/burn",
"license": "Apache-2.0 OR MIT",
Expand All @@ -424,7 +424,7 @@
},
{
"name": "burn-autodiff",
"version": "0.16.0",
"version": "0.16.1",
"authors": "nathanielsimard <[email protected]>",
"repository": "https://github.com/tracel-ai/burn/tree/main/crates/burn-autodiff",
"license": "Apache-2.0 OR MIT",
Expand All @@ -433,7 +433,7 @@
},
{
"name": "burn-candle",
"version": "0.16.0",
"version": "0.16.1",
"authors": "louisfd <[email protected]>",
"repository": "https://github.com/tracel-ai/burn/tree/main/crates/burn-candle",
"license": "Apache-2.0 OR MIT",
Expand All @@ -442,7 +442,7 @@
},
{
"name": "burn-common",
"version": "0.16.0",
"version": "0.16.1",
"authors": "Dilshod Tadjibaev (@antimora)",
"repository": "https://github.com/tracel-ai/burn/tree/main/crates/burn-common",
"license": "Apache-2.0 OR MIT",
Expand All @@ -451,7 +451,7 @@
},
{
"name": "burn-core",
"version": "0.16.0",
"version": "0.16.1",
"authors": "nathanielsimard <[email protected]>",
"repository": "https://github.com/tracel-ai/burn/tree/main/crates/burn-core",
"license": "Apache-2.0 OR MIT",
Expand All @@ -460,7 +460,7 @@
},
{
"name": "burn-cuda",
"version": "0.16.0",
"version": "0.16.1",
"authors": "nathanielsimard <[email protected]>",
"repository": "https://github.com/tracel-ai/burn/tree/main/crates/burn-cuda",
"license": "Apache-2.0 OR MIT",
Expand All @@ -469,7 +469,7 @@
},
{
"name": "burn-dataset",
"version": "0.16.0",
"version": "0.16.1",
"authors": "nathanielsimard <[email protected]>",
"repository": "https://github.com/tracel-ai/burn/tree/main/crates/burn-dataset",
"license": "Apache-2.0 OR MIT",
Expand All @@ -478,7 +478,7 @@
},
{
"name": "burn-derive",
"version": "0.16.0",
"version": "0.16.1",
"authors": "nathanielsimard <[email protected]>",
"repository": "https://github.com/tracel-ai/burn/tree/main/crates/burn-derive",
"license": "Apache-2.0 OR MIT",
Expand All @@ -487,7 +487,7 @@
},
{
"name": "burn-hip",
"version": "0.16.0",
"version": "0.16.1",
"authors": "nathanielsimard <[email protected]>",
"repository": "https://github.com/tracel-ai/burn/tree/main/crates/burn-hip",
"license": "Apache-2.0 OR MIT",
Expand All @@ -496,7 +496,7 @@
},
{
"name": "burn-jit",
"version": "0.16.0",
"version": "0.16.1",
"authors": "nathanielsimard <[email protected]>",
"repository": "https://github.com/tracel-ai/burn/tree/main/crates/burn-jit",
"license": "Apache-2.0 OR MIT",
Expand All @@ -505,7 +505,7 @@
},
{
"name": "burn-ndarray",
"version": "0.16.0",
"version": "0.16.1",
"authors": "nathanielsimard <[email protected]>",
"repository": "https://github.com/tracel-ai/burn/tree/main/crates/burn-ndarray",
"license": "Apache-2.0 OR MIT",
Expand All @@ -514,7 +514,7 @@
},
{
"name": "burn-router",
"version": "0.16.0",
"version": "0.16.1",
"authors": "guillaumelagrange <[email protected]>|nathanielsimard <[email protected]>",
"repository": "https://github.com/tracel-ai/burn/tree/main/crates/burn-router",
"license": "Apache-2.0 OR MIT",
Expand All @@ -523,7 +523,7 @@
},
{
"name": "burn-tensor",
"version": "0.16.0",
"version": "0.16.1",
"authors": "nathanielsimard <[email protected]>",
"repository": "https://github.com/tracel-ai/burn/tree/main/crates/burn-tensor",
"license": "Apache-2.0 OR MIT",
Expand All @@ -532,7 +532,7 @@
},
{
"name": "burn-train",
"version": "0.16.0",
"version": "0.16.1",
"authors": "nathanielsimard <[email protected]>",
"repository": "https://github.com/tracel-ai/burn/tree/main/crates/burn-train",
"license": "Apache-2.0 OR MIT",
Expand All @@ -541,7 +541,7 @@
},
{
"name": "burn-wgpu",
"version": "0.16.0",
"version": "0.16.1",
"authors": "nathanielsimard <[email protected]>",
"repository": "https://github.com/tracel-ai/burn/tree/main/crates/burn-wgpu",
"license": "Apache-2.0 OR MIT",
Expand Down Expand Up @@ -2071,7 +2071,7 @@
},
{
"name": "itertools",
"version": "0.12.1",
"version": "0.13.0",
"authors": "bluss",
"repository": "https://github.com/rust-itertools/itertools",
"license": "Apache-2.0 OR MIT",
Expand All @@ -2080,7 +2080,7 @@
},
{
"name": "itertools",
"version": "0.13.0",
"version": "0.14.0",
"authors": "bluss",
"repository": "https://github.com/rust-itertools/itertools",
"license": "Apache-2.0 OR MIT",
Expand Down Expand Up @@ -2429,15 +2429,6 @@
"license_file": null,
"description": "A wrapper over a platform's native TLS implementation"
},
{
"name": "ndarray",
"version": "0.15.6",
"authors": "Ulrik Sverdrup \"bluss\"|Jim Turner",
"repository": "https://github.com/rust-ndarray/ndarray",
"license": "Apache-2.0 OR MIT",
"license_file": null,
"description": "An n-dimensional array for general elements and for numerics. Lightweight array views and slicing; views support chunking and splitting."
},
{
"name": "ndarray",
"version": "0.16.1",
Expand All @@ -2449,7 +2440,7 @@
},
{
"name": "ndarray-rand",
"version": "0.14.0",
"version": "0.15.0",
"authors": "bluss",
"repository": "https://github.com/rust-ndarray/ndarray",
"license": "Apache-2.0 OR MIT",
Expand Down Expand Up @@ -2971,7 +2962,7 @@
},
{
"name": "priority-queue",
"version": "2.1.1",
"version": "2.3.1",
"authors": "Gianmarco Garrisi <[email protected]>",
"repository": "https://github.com/garro95/priority-queue",
"license": "LGPL-3.0-or-later OR MPL-2.0",
Expand Down Expand Up @@ -3574,7 +3565,7 @@
},
{
"name": "serde",
"version": "1.0.217",
"version": "1.0.219",
"authors": "Erick Tryzelaar <[email protected]>|David Tolnay <[email protected]>",
"repository": "https://github.com/serde-rs/serde",
"license": "Apache-2.0 OR MIT",
Expand All @@ -3601,7 +3592,7 @@
},
{
"name": "serde_derive",
"version": "1.0.217",
"version": "1.0.219",
"authors": "Erick Tryzelaar <[email protected]>|David Tolnay <[email protected]>",
"repository": "https://github.com/serde-rs/serde",
"license": "Apache-2.0 OR MIT",
Expand Down Expand Up @@ -3851,6 +3842,15 @@
"license_file": null,
"description": "Helpful macros for working with enums and strings"
},
{
"name": "strum",
"version": "0.27.1",
"authors": "Peter Glotfelty <[email protected]>",
"repository": "https://github.com/Peternator7/strum",
"license": "MIT",
"license_file": null,
"description": "Helpful macros for working with enums and strings"
},
{
"name": "strum_macros",
"version": "0.26.4",
Expand All @@ -3860,6 +3860,15 @@
"license_file": null,
"description": "Helpful macros for working with enums and strings"
},
{
"name": "strum_macros",
"version": "0.27.1",
"authors": "Peter Glotfelty <[email protected]>",
"repository": "https://github.com/Peternator7/strum",
"license": "MIT",
"license_file": null,
"description": "Helpful macros for working with enums and strings"
},
{
"name": "subtle",
"version": "2.6.1",
Expand Down Expand Up @@ -4427,6 +4436,15 @@
"license_file": null,
"description": "Safe, fast, zero-panic, zero-crashing, zero-allocation parsing of untrusted inputs in Rust."
},
{
"name": "unty",
"version": "0.0.4",
"authors": "Victor Koenders <[email protected]>",
"repository": "https://github.com/bincode-org/unty",
"license": "Apache-2.0 OR MIT",
"license_file": null,
"description": "Explicitly types your generics"
},
{
"name": "url",
"version": "2.5.4",
Expand Down
1 change: 1 addition & 0 deletions proto/anki/cards.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ message Card {
optional uint32 original_position = 18;
optional FsrsMemoryState memory_state = 20;
optional float desired_retention = 21;
optional float decay = 22;
string custom_data = 19;
}

Expand Down
3 changes: 2 additions & 1 deletion proto/anki/deck_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,10 @@ message DeckConfig {

repeated float fsrs_params_4 = 3;
repeated float fsrs_params_5 = 5;
repeated float fsrs_params_6 = 6;

// consider saving remaining ones for fsrs param changes
reserved 6 to 8;
reserved 7 to 8;

uint32 new_per_day = 9;
uint32 reviews_per_day = 10;
Expand Down
21 changes: 10 additions & 11 deletions proto/anki/scheduler.proto
Original file line number Diff line number Diff line change
Expand Up @@ -432,17 +432,16 @@ message GetOptimalRetentionParametersResponse {
uint32 learn_span = 2;
float max_cost_perday = 3;
float max_ivl = 4;
repeated float learn_costs = 5;
repeated float review_costs = 6;
repeated float first_rating_prob = 7;
repeated float review_rating_prob = 8;
repeated float first_rating_offsets = 9;
repeated float first_session_lens = 10;
float forget_rating_offset = 11;
float forget_session_len = 12;
float loss_aversion = 13;
uint32 learn_limit = 14;
uint32 review_limit = 15;
repeated float first_rating_prob = 5;
repeated float review_rating_prob = 6;
float loss_aversion = 7;
uint32 learn_limit = 8;
uint32 review_limit = 9;
repeated float learning_step_transitions = 10;
repeated float relearning_step_transitions = 11;
repeated float state_rating_costs = 12;
uint32 learning_step_count = 13;
uint32 relearning_step_count = 14;
}

message EvaluateParamsRequest {
Expand Down
1 change: 1 addition & 0 deletions proto/anki/stats.proto
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ message CardStatsResponse {
string preset = 21;
optional string original_deck = 22;
optional float desired_retention = 23;
repeated float fsrs_params = 24;
}

message GraphsRequest {
Expand Down
12 changes: 8 additions & 4 deletions rslib/src/browser_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use std::sync::Arc;

use fsrs::FSRS;
use fsrs::FSRS5_DEFAULT_DECAY;
use itertools::Itertools;
use strum::Display;
use strum::EnumIter;
Expand Down Expand Up @@ -541,10 +542,13 @@ impl RowContext {
.memory_state
.as_ref()
.zip(self.cards[0].days_since_last_review(&self.timing))
.map(|(state, days_elapsed)| {
let r = FSRS::new(None)
.unwrap()
.current_retrievability((*state).into(), days_elapsed);
.zip(Some(self.cards[0].decay.unwrap_or(FSRS5_DEFAULT_DECAY)))
.map(|((state, days_elapsed), decay)| {
let r = FSRS::new(None).unwrap().current_retrievability(
(*state).into(),
days_elapsed,
decay,
);
format!("{:.0}%", r * 100.)
})
.unwrap_or_default()
Expand Down
2 changes: 2 additions & 0 deletions rslib/src/card/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ pub struct Card {
pub(crate) original_position: Option<u32>,
pub(crate) memory_state: Option<FsrsMemoryState>,
pub(crate) desired_retention: Option<f32>,
pub(crate) decay: Option<f32>,
/// JSON object or empty; exposed through the reviewer for persisting custom
/// state
pub(crate) custom_data: String,
Expand Down Expand Up @@ -145,6 +146,7 @@ impl Default for Card {
original_position: None,
memory_state: None,
desired_retention: None,
decay: None,
custom_data: String::new(),
}
}
Expand Down
2 changes: 2 additions & 0 deletions rslib/src/card/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ impl TryFrom<anki_proto::cards::Card> for Card {
original_position: c.original_position,
memory_state: c.memory_state.map(Into::into),
desired_retention: c.desired_retention,
decay: c.decay,
custom_data: c.custom_data,
})
}
Expand Down Expand Up @@ -134,6 +135,7 @@ impl From<Card> for anki_proto::cards::Card {
original_position: c.original_position,
memory_state: c.memory_state.map(Into::into),
desired_retention: c.desired_retention,
decay: c.decay,
custom_data: c.custom_data,
}
}
Expand Down
Loading