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

Skip to content

Conversation

@L-M-Sherlock
Copy link
Contributor

@L-M-Sherlock L-M-Sherlock commented Jul 8, 2025

@L-M-Sherlock
Copy link
Contributor Author

L-M-Sherlock commented Jul 8, 2025

@user1823 I found that the change introduced in PR #3717 caused this problem. Due to ignore_revlogs_before, some review cards don't have any revlog entires, so their memory state is None even after compute_memory_state.

Fine. I figure it out. If I revert the change on compute_memory_state, my helper add-on will mess up when rescheduling, right?

let new_cards =
cards.iter().filter(|c| c.queue == CardQueue::New).count() + req.deck_size as usize;
let fsrs = FSRS::new(Some(&req.params))?;
let historical_retention = req.desired_retention;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a placeholder?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solved in d159aaa

…ted logic

- Added `historical_retention` field to `SimulateFsrsReviewRequest` in `scheduler.proto`.
- Updated `simulator.rs` to use `req.historical_retention` instead of the removed `desired_retention`.
- Modified `FsrsOptions.svelte` to include `historicalRetention` in the options passed to the component.
@dae
Copy link
Member

dae commented Jul 8, 2025

Could you rename the branch? GitHub is throwing up a warning.

The head ref may contain hidden characters: "Fix/FSRS-simulator-fallback-to-memory_state_from_sm2-for-after-setting-\u201CIgnore-cards-reviewed-before\u201D"

@user1823
Copy link
Contributor

user1823 commented Jul 8, 2025

If I revert the change on compute_memory_state, my helper add-on will mess up when rescheduling, right?

Yes. To prevent that issue, I made it so that the memory states of cards without any revlog are calculated only in the reviewer.

@Luc-Mcgrady
Copy link
Contributor

Luc-Mcgrady commented Jul 8, 2025

Could you rename the branch? GitHub is throwing up a warning.

I've tried to rename a branch assosiated with a pr before and it closed the PR, so we will need a second pr. Just a heads up.

#3947

https://stackoverflow.com/a/20014444

@dae
Copy link
Member

dae commented Jul 8, 2025

Thats ok with me. Moving forward, if you could keep the branch names not-too-long @L-M-Sherlock, that'd be appreciated :-)

Copy link
Contributor

@user1823 user1823 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some suggestions. Otherwise, LGTM.

.filter_map(|c| {
let memory_state = match c.memory_state {
Some(state) => state,
None => fsrs
Copy link
Contributor

@user1823 user1823 Jul 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we exclude new cards here to improve performance and prevent introduction of new bugs?

Edit: filter(is_included_card) already excludes the new cards. I got confused by CardQueue::New => None, in the convert function. That's not actually needed, IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got confused by CardQueue::New => None, in the convert function. That's not actually needed, IMO.

It's required by Rust's compiler.

@L-M-Sherlock L-M-Sherlock deleted the Fix/FSRS-simulator-fallback-to-memory_state_from_sm2-for-after-setting-“Ignore-cards-reviewed-before” branch July 8, 2025 12:53
@L-M-Sherlock L-M-Sherlock restored the Fix/FSRS-simulator-fallback-to-memory_state_from_sm2-for-after-setting-“Ignore-cards-reviewed-before” branch July 8, 2025 12:54
@L-M-Sherlock L-M-Sherlock deleted the Fix/FSRS-simulator-fallback-to-memory_state_from_sm2-for-after-setting-“Ignore-cards-reviewed-before” branch July 8, 2025 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants