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 Feb 18, 2025

Key Changes

  • Updated FSRS dependency to use a version that supports post-scheduling hooks
  • Added post_scheduling_fn to simulator that applies load balance and easy days
  • Added easy days percentages to simulator proto
  • Refactored easy days parsing logic for reusability

TODO

  1. Refactor simulator daily stats chart

    • Current chart becomes unreadable with easy days due to high volatility of the number of reviews per day
  2. Review post_scheduling_fn implementation

    • Check for potential code duplication with existing scheduling logic
  3. Consider moving simulator to dedicated page

    • Simulator could benefit from more screen space

Related Issues

Preview:

image

image

@YukiNagat0
Copy link
Contributor

At first glance, same as #3815 - no support for the mw.col.load_balancer_enabled option (disabled load_balancer)

@dae
Copy link
Member

dae commented Feb 18, 2025

Updated FSRS dependency to use a version that supports post-scheduling hooks

Nice, that is a cleaner solution.

Consider moving simulator to dedicated page

I can't think of a better place to put it for now. What about instead of embedding it in the page, you have a clickable "Simulator" link that displays it as as a larger pop-over on the page?

@L-M-Sherlock
Copy link
Contributor Author

no support for the mw.col.load_balancer_enabled option (disabled load_balancer)

Fixed in 59d5ef0

What about instead of embedding it in the page, you have a clickable "Simulator" link that displays it as as a larger pop-over on the page?

Sounds good. But I need help. I don't know how to develop that.

@dae
Copy link
Member

dae commented Feb 18, 2025

An example of how to do that is TextInputModal.svelte, which is used in ConfigSelector.svelte

Associated docs: https://getbootstrap.com/docs/5.0/components/modal/

@L-M-Sherlock
Copy link
Contributor Author

L-M-Sherlock commented Feb 19, 2025

Now the simulator is moved to a larger pop-over on the page:

image

And I add a button to allow users to save these settings to the preset:

  • Desired retention
  • New cards/day
  • Maximum reviews/day
  • Maximum interval
  • New cards ignore review limit

To solve the issue of readability, I have two solutions:

  1. using moving average windows
  2. plotting the graph as the Future Due graph
image

Any ideas?

@L-M-Sherlock
Copy link
Contributor Author

Now it looks nice when you want to compare Easy Days with Non Easy Days in one year.

image

@YukiNagat0
Copy link
Contributor

YukiNagat0 commented Feb 19, 2025

Regarding the readibility issue, I believe that introducing a Smooth toggle would be the most appropriate solution. This allows users the flexibility to choose between a smoothed visualization and the exact number of reviews for a given date, catering to different use cases.

As for the window size of the moving average, I personally favor making it configurable, with a default value calculated using the formula: window_size = ceil(days_to_simulate / 180) or / 365, so only graphs with a larger learning span are affected by smoothing if the user doesn’t input an exact desired window size.

Update: I understand that implementing a configurable window size might be tricky from a UI perspective. However, at the very least, the Smooth toggle should definitely be implemented (if readability issue is concerning when using easy days).

@L-M-Sherlock
Copy link
Contributor Author

I added the Smooth toggle:

image image

@L-M-Sherlock
Copy link
Contributor Author

L-M-Sherlock commented Feb 20, 2025

But I don't know why the ticks become larger when I zoom out the window:

image

Edit: It's caused by this code

/* Customizing the standard x and y tick markers and text on the graphs.
* The `tick` class is automatically added by d3. */
:global(.tick) {
:global(line) {
opacity: 0.1;
}
:global(text) {
opacity: 0.5;
font-size: 10px;
@media only screen and (max-width: 800px) {
font-size: 13px;
}
@media only screen and (max-width: 600px) {
font-size: 16px;
}
}
}

But I don't know the purpose.

@L-M-Sherlock L-M-Sherlock marked this pull request as ready for review February 21, 2025 04:12
- Update fsrs-rs dependency to latest commit
- Modify retention and simulator modules to use Arc instead of Box
- Update function signatures and imports in simulator module
- Simplify review card order handling with direct enum usage
@Expertium
Copy link
Contributor

We should add a tooltip to clarify that the "Smooth" toggle only affects the graph and has nothing to do with actual scheduling.

@dae
Copy link
Member

dae commented Feb 21, 2025

The graph is looking pretty bad on mobile/small devices at the moment. I seem to recall it looking a bit better when I checked on this PR the other day, so it might be a regression?

Screenshot 2025-02-21 at 5 30 01 pm

Going through a review now.

One other initial thought was on how extra options have been added, presumably so that the user can configure them directly from that screen, and so it becomes apparent that those options also alter the simulation. But it's not complete, as easy days is not listed there.

Screenshot 2025-02-21 at 5 29 24 pm

Note how the graph is not actually visible at this screen size - the user has to scroll down.

Is it worth repeating those options there? (yes is an acceptable answer if you think so, I'm just brainstorming here). Are there any where it might make sense to show them in a more concise, read-only form? E.g. something like the following in small grey text: "Other influencing settings: 20 new cards/day, 200 reviews/day, 2 easy days, max interval 36500, ..."?

@dae
Copy link
Member

dae commented Feb 21, 2025

Or a variant of that idea - what if the simulator-specific options are shown at the top, with everything else in a disclosure/hidden by default section?

Again, no strong feelings here - "no" is an acceptable answer.

@user1823
Copy link
Contributor

Is it worth repeating those options there?

IMO, yes. The user might want to play with these values to see the effect on their future workload without wanting to change the actual settings. Also, if the user has to change the values scattered throughout the deck options page, the simulator would become difficult to use.

@YukiNagat0
Copy link
Contributor

YukiNagat0 commented Feb 21, 2025

Regarding the easy days: As user1823 pointed out, users might want to experiment with settings in the simulator. However, when it comes to easy days, users are unlikely to adjust them frequently. They already know which days are busy for them, so there’s no need to display these settings again on the simulator page.

Objectively, the simulator is a tool for exploration - users can play with it to find their ideal settings, which is why the adjustable options are present on this page. The "Save to Preset Options" button is there just to save users from having to remember the values they set in the pop-up to transfer to the main settings page . Since users don’t need to recall which days they’re busy, there’s no reason to duplicate the easy days settings on the simulator page.

Something like that. Personally, I like the current set of the adjustable settings. For me, Save to Preset Options button is redundant: I can remember all 4 values: DR, New cards/day, Max interval, Sort order. But I understand, that someone can find this button useful.


By the way, perhaps this is the right moment to implement the Enable/Disable Load Balancer option in UI? This way, users won’t need to access the debug console to toggle it, and now they’ll be able to see how it affects their (simulated) load. (笑)

@Expertium
Copy link
Contributor

They already know which days are busy for them, so there’s no need to display these settings again on the simulator page.

But we need to convey that Easy Days affect the simulation. Plus, as you said, the simulator is a tool for exploration, so I'd say we should add Easy Days sliders to the simulator.

@YukiNagat0
Copy link
Contributor

YukiNagat0 commented Feb 21, 2025

They already know which days are busy for them, so there’s no need to display these settings again on the simulator page.

But we need to convey that Easy Days affect the simulation. Plus, as you said, the simulator is a tool for exploration, so I'd say we should add Easy Days sliders to the simulator.

It is already obvious, if Days to simulate <= 365 with enabled Smooth option for any number of easy days (default simulation span is already 365 days). Or with disabled Smooth option.

I will suggest to set the Smooth option to False by default.

@L-M-Sherlock
Copy link
Contributor Author

I'd say we should add Easy Days sliders to the simulator.

I wanted, but the screen is too crowded now.

@dae
Copy link
Member

dae commented Feb 22, 2025

Reviewing now. Are you planning to release the updated fsrs-rs on crates.io? If so, it would be nice to point to that instead of a git commit.

(if it's still in progress, we can point to a git commit for now, but that would be nice to fix before the next stable release)

Copy link
Member

@dae dae left a comment

Choose a reason for hiding this comment

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

Just a couple of minor points and then good to go on my end 👍

@dae
Copy link
Member

dae commented Feb 27, 2025

Are you planning to release the updated fsrs-rs on crates.io?

Assuming that's a no for now, so I'll merge this in.

@dae
Copy link
Member

dae commented Feb 27, 2025

Thank you for your work on this as always!

@dae dae merged commit a6426be into ankitects:main Feb 27, 2025
1 check passed
@L-M-Sherlock L-M-Sherlock deleted the Feat/support-load-balance-and-easy-days-in-FSRS-simulator branch February 27, 2025 06:20
@L-M-Sherlock
Copy link
Contributor Author

Assuming that's a no for now, so I'll merge this in.

Yeah, because @Luc-Mcgrady added more features into the simulator:

So the simulator is still not stable now. I plan to update fsrs-rs on crates.io in the next month.

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.

6 participants