Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate the FSRS optimizer #2633

Merged
merged 10 commits into from
Sep 5, 2023
Merged

Integrate the FSRS optimizer #2633

merged 10 commits into from
Sep 5, 2023

Conversation

dae
Copy link
Member

@dae dae commented Sep 3, 2023

No description provided.

@dae
Copy link
Member Author

dae commented Sep 3, 2023

This needs UI polish, translations, and testing across platforms. Help would be welcome.

@dae
Copy link
Member Author

dae commented Sep 3, 2023

Currently failing to build on both Android and iOS - will investigate more tomorrow.

Edit: fixed

@L-M-Sherlock
Copy link
Contributor

Anki is frozen when I quit the option page during the optimization.

image

@L-M-Sherlock
Copy link
Contributor

Also frozen when I click check.

image image
A fatal error occurred, and Anki must close. Please report this message on the forums.
Anki 2.1.66 (f616bea5) Python 3.9.15 Qt 6.5.0 PyQt 6.5.0
Platform: macOS-13.3.1-arm64-arm-64bit
Flags: frz=False ao=True sv=?
Add-ons, last update check: 2023-09-03 13:04:00

Caught exception:
Traceback (most recent call last):
  File "/Users/jarrettye/Codes/anki/qt/aqt/progress.py", line 118, in handler
    func()
  File "/Users/jarrettye/Codes/anki/qt/aqt/main.py", line 1470, in on_periodic_backup_timer
    self._create_backup_with_progress(user_initiated=False)
  File "/Users/jarrettye/Codes/anki/qt/aqt/main.py", line 1487, in _create_backup_with_progress
    if not user_initiated and self.col.legacy_checkpoint_pending():
  File "/Users/jarrettye/Codes/anki/pylib/anki/collection.py", line 349, in legacy_checkpoint_pending
    self._have_outstanding_checkpoint()
  File "/Users/jarrettye/Codes/anki/pylib/anki/collection.py", line 1124, in _have_outstanding_checkpoint
    self._check_backend_undo_status()
  File "/Users/jarrettye/Codes/anki/pylib/anki/collection.py", line 1107, in _check_backend_undo_status
    status = self._backend.get_undo_status()
  File "/Users/jarrettye/Codes/anki/out/pylib/anki/_backend_generated.py", line 130, in get_undo_status
    raw_bytes = self._run_command(1, 7, message.SerializeToString())
  File "/Users/jarrettye/Codes/anki/pylib/anki/_backend.py", line 145, in _run_command
    return self._backend.command(service, method, input)
pyo3_runtime.PanicException: called `Result::unwrap()` on an `Err` value: PoisonError { .. }

@dae
Copy link
Member Author

dae commented Sep 4, 2023

The way it's currently implemented, the collection is locked until calculation completes, as it was a bit simpler to implement. I've pushed a change that will cancel the operation if you close the window, which should avoid the freezing.

A PoisonError indicates that the code has previously panicked, and means Anki should be shut down. If you can trigger this again, please check the console for the original panic, as that will tell us more than the poison error does. I found one instance where it can panic when running in debug mode: open-spaced-repetition/fsrs-rs@3229131

I didn't know what to name those two floats, so I just called them out1/out2 for now. What do you suggest we name them?

@L-M-Sherlock
Copy link
Contributor

What do you suggest we name them?

LogLoss and RMSE.

@L-M-Sherlock
Copy link
Contributor

image

Couldn't cancel the optimization.

@L-M-Sherlock
Copy link
Contributor

please check the console for the original panic, as that will tell us more than the poison error does.

When I click Check, this error is raised:

thread '<unnamed>' panicked at 'FSRSItem is empty', /Users/jarrettye/.cargo/git/checkouts/fsrs-optimizer-burn-842e64be29d2ead3/03e51e8/src/dataset.rs:59:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
ERROR:waitress:Exception when servicing <waitress.channel.HTTPChannel connected 127.0.0.1:58683 at 0x11758c970>
Traceback (most recent call last):
  File "/Users/jarrettye/Codes/anki/out/pyenv/lib/python3.9/site-packages/waitress/task.py", line 84, in handler_thread
    task.service()
  File "/Users/jarrettye/Codes/anki/out/pyenv/lib/python3.9/site-packages/waitress/channel.py", line 428, in service
    task.service()
  File "/Users/jarrettye/Codes/anki/out/pyenv/lib/python3.9/site-packages/waitress/task.py", line 168, in service
    self.execute()
  File "/Users/jarrettye/Codes/anki/out/pyenv/lib/python3.9/site-packages/waitress/task.py", line 434, in execute
    app_iter = self.channel.server.application(environ, start_response)
  File "/Users/jarrettye/Codes/anki/out/pyenv/lib/python3.9/site-packages/waitress/proxy_headers.py", line 64, in translate_proxy_headers
    return app(environ, start_response)
  File "/Users/jarrettye/Codes/anki/out/pyenv/lib/python3.9/site-packages/flask/app.py", line 2213, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Users/jarrettye/Codes/anki/out/pyenv/lib/python3.9/site-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/jarrettye/Codes/anki/out/pyenv/lib/python3.9/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/jarrettye/Codes/anki/out/pyenv/lib/python3.9/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/Users/jarrettye/Codes/anki/qt/aqt/mediasrv.py", line 269, in handle_request
    return _handle_dynamic_request(request)
  File "/Users/jarrettye/Codes/anki/qt/aqt/mediasrv.py", line 590, in _handle_dynamic_request
    return request()
  File "/Users/jarrettye/Codes/anki/qt/aqt/mediasrv.py", line 571, in wrapped
    if data := handler():
  File "/Users/jarrettye/Codes/anki/qt/aqt/mediasrv.py", line 552, in <lambda>
    return lambda: getattr(aqt.mw.col._backend, f"{endpoint}_raw")(request.data)
  File "/Users/jarrettye/Codes/anki/out/pylib/anki/_backend_generated.py", line 856, in evaluate_weights_raw
    return self._run_command(9, 28, message)
  File "/Users/jarrettye/Codes/anki/pylib/anki/_backend.py", line 145, in _run_command
    return self._backend.command(service, method, input)
pyo3_runtime.PanicException: FSRSItem is empty

@dae
Copy link
Member Author

dae commented Sep 4, 2023

That's caused by the .expect() in fsrs-optimizer/src/dataset.rs:59:14. If the same collection works when testing with fsrs-optimizer directly, it would seem to indicate a bug in Anki's version of fsrs_to_anki. If you're able to provide me the source file you're using privately (you can strip out notes table), I'll see if I can reproduce.

@dae
Copy link
Member Author

dae commented Sep 4, 2023

The cancellation check happens at the end of each batch - if a single batch takes quite a while, cancellation might not happen immediately.

@L-M-Sherlock
Copy link
Contributor

Main.apkg.zip

I removed the contents of all cards.

@dae
Copy link
Member Author

dae commented Sep 4, 2023

Hmm, I imported that .apkg into a fresh profile, and training worked until completion. Which deck/options group are you testing with? Did you use a custom search?

@L-M-Sherlock
Copy link
Contributor

training worked until completion

Training works in my test. But the check doesn't work.

@dae
Copy link
Member Author

dae commented Sep 4, 2023

Check works for me too, but it doesn't currently show any progress, so you need to wait until it completes. If you run Anki with tools/runopt, it will be a bit faster.

@dae
Copy link
Member Author

dae commented Sep 4, 2023

(if you have any other suggestions on how I should trigger that panic, I'd appreciate them - definitely want to get any crashing bugs fixed before this makes it into a stable release)

@L-M-Sherlock
Copy link
Contributor

I couldn't reproduce the panic now. But I noted that these following steps will freeze Anki:

  1. click check.
  2. close option page
  3. open option page

evaluateWeights is not interrupted by step 2. I think it should be interrupted.

@dae
Copy link
Member Author

dae commented Sep 4, 2023

I can't reproduce this - did you update to the latest commit on this branch?

@L-M-Sherlock
Copy link
Contributor

Yeah, I pulled the latest commit.

@dae
Copy link
Member Author

dae commented Sep 4, 2023

Hmm. I wonder why we're seeing different things.

@L-M-Sherlock
Copy link
Contributor

1693817509.878 POST /_anki/computeFsrsWeights
1693817509.977 POST /_anki/latestProgress
1693817510.077 POST /_anki/latestProgress
1693817510.177 POST /_anki/latestProgress
1693817510.277 POST /_anki/latestProgress
thread '<unnamed>' panicked at 'attempt to subtract with overflow', /Users/jarrettye/.cargo/git/checkouts/fsrs-optimizer-burn-842e64be29d2ead3/03e51e8/src/training.rs:147:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', /Users/jarrettye/.cargo/git/checkouts/fsrs-optimizer-burn-842e64be29d2ead3/03e51e8/src/training.rs:161:42
1693817510.377 POST /_anki/latestProgress
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: SendError { .. }', /Users/jarrettye/.cargo/git/checkouts/burn-acfbee6a141c1b41/248dc33/burn-train/src/callback/async_callback.rs:70:51
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: SendError { .. }', /Users/jarrettye/.cargo/git/checkouts/burn-acfbee6a141c1b41/248dc33/burn-train/src/callback/async_callback.rs:88:40
stack backtrace:
   0:        0x106107c60 - std::backtrace_rs::backtrace::libunwind::trace::h77b39d3188241b9b
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:        0x106107c60 - std::backtrace_rs::backtrace::trace_unsynchronized::h255fc0d6f6a27160
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:        0x106107c60 - std::sys_common::backtrace::_print_fmt::hc63b2fe172b28820
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys_common/backtrace.rs:65:5
   3:        0x106107c60 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h523fafbfdb8f0857
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys_common/backtrace.rs:44:22
   4:        0x106128d28 - core::fmt::rt::Argument::fmt::h4c8d9e4aebabcbc2
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/fmt/rt.rs:138:9
   5:        0x106128d28 - core::fmt::write::hf94a55b5a3abd106
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/fmt/mod.rs:1094:21
   6:        0x106104aac - std::io::Write::write_fmt::hc7c6bf1da111b052
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/io/mod.rs:1714:15
   7:        0x106107ab8 - std::sys_common::backtrace::_print::h12835c9b28903edc
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys_common/backtrace.rs:47:5
   8:        0x106107ab8 - std::sys_common::backtrace::print::h68ede8fb1e716cba
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys_common/backtrace.rs:34:9
   9:        0x1061093ec - std::panicking::default_hook::{{closure}}::hba2205c2705c60bb
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:269:22
  10:        0x10610917c - std::panicking::default_hook::h9d927e01472bad1a
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:288:9
  11:        0x10610991c - std::panicking::rust_panic_with_hook::h8654c51ef9980a29
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:705:13
  12:        0x106109828 - std::panicking::begin_panic_handler::{{closure}}::hd188a636b3b90298
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:597:13
  13:        0x106108040 - std::sys_common::backtrace::__rust_end_short_backtrace::hc331d455ac21f427
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys_common/backtrace.rs:151:18
  14:        0x106109594 - rust_begin_unwind
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:593:5
  15:        0x10619169c - core::panicking::panic_fmt::h4f2054f72ff905b1
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/panicking.rs:67:14
  16:        0x106191a5c - core::result::unwrap_failed::ha6ab1074250e7550
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/result.rs:1651:5
  17:        0x105ad38d0 - <burn_train::callback::async_callback::AsyncTrainerCallback<T,V> as core::ops::drop::Drop>::drop::hb0d97a47c517506a
  18:        0x105ab34f8 - core::ptr::drop_in_place<burn_train::callback::async_callback::AsyncTrainerCallback<burn_train::learner::classification::ClassificationOutput<burn_autodiff::backend::ADBackendDecorator<burn_ndarray::backend::NdArrayBackend<f32>>>,burn_train::learner::classification::ClassificationOutput<burn_ndarray::backend::NdArrayBackend<f32>>>>::hf661201fa366fb82
  19:        0x105b55de0 - core::ptr::drop_in_place<alloc::boxed::Box<dyn burn_train::callback::base::LearnerCallback<burn_train::learner::classification::ClassificationOutput<burn_autodiff::backend::ADBackendDecorator<burn_ndarray::backend::NdArrayBackend<f32>>>,burn_train::learner::classification::ClassificationOutput<burn_ndarray::backend::NdArrayBackend<f32>>>>>::he5191f2641506359
  20:        0x105b53224 - burn_train::learner::train_val::<impl burn_train::learner::base::Learner<B,M,O,LR,TO,VO>>::fit::hc11552a1fa0b4b29
  21:        0x105b5138c - fsrs_optimizer::training::compute_weights::h973655ccb962b8cb
  22:        0x1057e0590 - anki::scheduler::fsrs::weights::<impl anki::collection::Collection>::compute_weights::h3e474b2202ef4de3
  23:        0x1057e3f50 - anki::scheduler::service::<impl anki::services::SchedulerService for anki::collection::Collection>::compute_fsrs_weights::ha019e7c6f33faecb
  24:        0x105a0bccc - anki::services::<impl anki::backend::Backend>::compute_fsrs_weights::{{closure}}::h91c61b87cc217e79
  25:        0x105481380 - anki::backend::Backend::with_col::hf2a174ec16b58287
  26:        0x105807564 - anki::services::<impl anki::backend::Backend>::compute_fsrs_weights::he973cd9c65166c53
  27:        0x10580ae88 - anki::services::<impl anki::backend::Backend>::run_backend_scheduler_service_method::hf6352aa3c344474c
  28:        0x10581df34 - anki::services::<impl anki::backend::Backend>::run_service_method::h3893278a089855db
  29:        0x1050e6e94 - rsbridge::Backend::command::{{closure}}::h5d2b9feba4a72a36
  30:        0x1050e7058 - pyo3::marker::Python::allow_threads::h29821cfdf6fa6886
  31:        0x1050e8114 - rsbridge::Backend::command::h17220be5a650ed4f
  32:        0x1050e85dc - rsbridge::_::<impl rsbridge::Backend>::__pymethod_command__::h6b790627059dadb9
  33:        0x1050e1e00 - pyo3::impl_::trampoline::cfunction_with_keywords::{{closure}}::h54c50a9f40dcdddd
  34:        0x1050e1adc - pyo3::impl_::trampoline::trampoline::{{closure}}::h4c52d3107d0a1cb7
  35:        0x1050e2950 - std::panicking::try::do_call::hb792efc984d195dd
  36:        0x1050e2bc0 - ___rust_try
  37:        0x1050e25e8 - std::panicking::try::h590317ab000c703e
  38:        0x1050e6bc8 - std::panic::catch_unwind::h92cc3e49201ef5bc
  39:        0x1050e17a0 - pyo3::impl_::trampoline::trampoline::h015e1f51938e7b62
  40:        0x1050e590c - pyo3::impl_::trampoline::cfunction_with_keywords::h423bee44e797d117
  41:        0x1050e82b4 - rsbridge::_::<impl pyo3::impl_::pyclass::PyMethods<rsbridge::Backend> for pyo3::impl_::pyclass::PyClassImplCollector<rsbridge::Backend>>::py_methods::ITEMS::trampoline::h8965eca3b95eda39
  42:        0x101a397b0 - _method_vectorcall_VARARGS_KEYWORDS
  43:        0x101b32a14 - __PyEval_EvalFrameDefault
  44:        0x101a2b7f8 - __PyFunction_Vectorcall
  45:        0x101b32a14 - __PyEval_EvalFrameDefault
  46:        0x101a2b7f8 - __PyFunction_Vectorcall
  47:        0x101a30610 - _method_vectorcall
  48:        0x101b468ac - __PyEval_EvalFrameDefault
  49:        0x101a2ba94 - __PyFunction_Vectorcall
  50:        0x101b468ac - __PyEval_EvalFrameDefault
  51:        0x101a2ba94 - __PyFunction_Vectorcall
  52:        0x101b468ac - __PyEval_EvalFrameDefault
  53:        0x101a2b7f8 - __PyFunction_Vectorcall
  54:        0x101b468ac - __PyEval_EvalFrameDefault
  55:        0x101a2ba94 - __PyFunction_Vectorcall
  56:        0x101b34830 - __PyEval_EvalFrameDefault
  57:        0x101a2b7f8 - __PyFunction_Vectorcall
  58:        0x101b32a14 - __PyEval_EvalFrameDefault
  59:        0x101a2b7f8 - __PyFunction_Vectorcall
  60:        0x101b32a14 - __PyEval_EvalFrameDefault
  61:        0x101a2b7f8 - __PyFunction_Vectorcall
  62:        0x101b32a14 - __PyEval_EvalFrameDefault
  63:        0x101a2b7f8 - __PyFunction_Vectorcall
  64:        0x101a2d9cc - __PyObject_Call_Prepend
  65:        0x101aad284 - _slot_tp_call
  66:        0x101b46a74 - __PyEval_EvalFrameDefault
  67:        0x101a2ba94 - __PyFunction_Vectorcall
  68:        0x101b33ef8 - __PyEval_EvalFrameDefault
  69:        0x101a2ba94 - __PyFunction_Vectorcall
  70:        0x101b32a14 - __PyEval_EvalFrameDefault
  71:        0x101a2b7f8 - __PyFunction_Vectorcall
  72:        0x101b32a14 - __PyEval_EvalFrameDefault
  73:        0x101a2b7f8 - __PyFunction_Vectorcall
  74:        0x101b32a14 - __PyEval_EvalFrameDefault
  75:        0x101a2b7f8 - __PyFunction_Vectorcall
  76:        0x101a306b4 - _method_vectorcall
  77:        0x101b32c70 - __PyEval_EvalFrameDefault
  78:        0x101a2b7f8 - __PyFunction_Vectorcall
  79:        0x101b32a14 - __PyEval_EvalFrameDefault
  80:        0x101a2b7f8 - __PyFunction_Vectorcall
  81:        0x101b32a14 - __PyEval_EvalFrameDefault
  82:        0x101a2b7f8 - __PyFunction_Vectorcall
  83:        0x101a30718 - _method_vectorcall
  84:        0x101c8eb64 - _t_bootstrap
  85:        0x101bb9af0 - _pythread_wrapper
  86:        0x198763fa8 - __pthread_joiner_wake
thread '<unnamed>' panicked at 'panic in a function that cannot unwind', library/core/src/panicking.rs:126:5
stack backtrace:
   0:        0x106107c60 - std::backtrace_rs::backtrace::libunwind::trace::h77b39d3188241b9b
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:        0x106107c60 - std::backtrace_rs::backtrace::trace_unsynchronized::h255fc0d6f6a27160
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:        0x106107c60 - std::sys_common::backtrace::_print_fmt::hc63b2fe172b28820
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys_common/backtrace.rs:65:5
   3:        0x106107c60 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h523fafbfdb8f0857
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys_common/backtrace.rs:44:22
   4:        0x106128d28 - core::fmt::rt::Argument::fmt::h4c8d9e4aebabcbc2
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/fmt/rt.rs:138:9
   5:        0x106128d28 - core::fmt::write::hf94a55b5a3abd106
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/fmt/mod.rs:1094:21
   6:        0x106104aac - std::io::Write::write_fmt::hc7c6bf1da111b052
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/io/mod.rs:1714:15
   7:        0x106107ab8 - std::sys_common::backtrace::_print::h12835c9b28903edc
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys_common/backtrace.rs:47:5
   8:        0x106107ab8 - std::sys_common::backtrace::print::h68ede8fb1e716cba
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys_common/backtrace.rs:34:9
   9:        0x1061093ec - std::panicking::default_hook::{{closure}}::hba2205c2705c60bb
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:269:22
  10:        0x10610917c - std::panicking::default_hook::h9d927e01472bad1a
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:288:9
  11:        0x10610991c - std::panicking::rust_panic_with_hook::h8654c51ef9980a29
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:705:13
  12:        0x1061097ec - std::panicking::begin_panic_handler::{{closure}}::hd188a636b3b90298
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:595:13
  13:        0x106108040 - std::sys_common::backtrace::__rust_end_short_backtrace::hc331d455ac21f427
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/sys_common/backtrace.rs:151:18
  14:        0x106109594 - rust_begin_unwind
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/std/src/panicking.rs:593:5
  15:        0x1061916cc - core::panicking::panic_nounwind_fmt::h6e49aceea1598c00
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/panicking.rs:96:14
  16:        0x106191748 - core::panicking::panic_nounwind::h4420bc9d05a9c1db
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/panicking.rs:126:5
  17:        0x10619183c - core::panicking::panic_cannot_unwind::hcd3e1319ebcd2ce0
                               at /rustc/5680fa18feaa87f3ff04063800aec256c3d4b4be/library/core/src/panicking.rs:189:5
  18:        0x105b53250 - burn_train::learner::train_val::<impl burn_train::learner::base::Learner<B,M,O,LR,TO,VO>>::fit::hc11552a1fa0b4b29
  19:        0x105b5138c - fsrs_optimizer::training::compute_weights::h973655ccb962b8cb
  20:        0x1057e0590 - anki::scheduler::fsrs::weights::<impl anki::collection::Collection>::compute_weights::h3e474b2202ef4de3
  21:        0x1057e3f50 - anki::scheduler::service::<impl anki::services::SchedulerService for anki::collection::Collection>::compute_fsrs_weights::ha019e7c6f33faecb
  22:        0x105a0bccc - anki::services::<impl anki::backend::Backend>::compute_fsrs_weights::{{closure}}::h91c61b87cc217e79
  23:        0x105481380 - anki::backend::Backend::with_col::hf2a174ec16b58287
  24:        0x105807564 - anki::services::<impl anki::backend::Backend>::compute_fsrs_weights::he973cd9c65166c53
  25:        0x10580ae88 - anki::services::<impl anki::backend::Backend>::run_backend_scheduler_service_method::hf6352aa3c344474c
  26:        0x10581df34 - anki::services::<impl anki::backend::Backend>::run_service_method::h3893278a089855db
  27:        0x1050e6e94 - rsbridge::Backend::command::{{closure}}::h5d2b9feba4a72a36
  28:        0x1050e7058 - pyo3::marker::Python::allow_threads::h29821cfdf6fa6886
  29:        0x1050e8114 - rsbridge::Backend::command::h17220be5a650ed4f
  30:        0x1050e85dc - rsbridge::_::<impl rsbridge::Backend>::__pymethod_command__::h6b790627059dadb9
  31:        0x1050e1e00 - pyo3::impl_::trampoline::cfunction_with_keywords::{{closure}}::h54c50a9f40dcdddd
  32:        0x1050e1adc - pyo3::impl_::trampoline::trampoline::{{closure}}::h4c52d3107d0a1cb7
  33:        0x1050e2950 - std::panicking::try::do_call::hb792efc984d195dd
  34:        0x1050e2bc0 - ___rust_try
  35:        0x1050e25e8 - std::panicking::try::h590317ab000c703e
  36:        0x1050e6bc8 - std::panic::catch_unwind::h92cc3e49201ef5bc
  37:        0x1050e17a0 - pyo3::impl_::trampoline::trampoline::h015e1f51938e7b62
  38:        0x1050e590c - pyo3::impl_::trampoline::cfunction_with_keywords::h423bee44e797d117
  39:        0x1050e82b4 - rsbridge::_::<impl pyo3::impl_::pyclass::PyMethods<rsbridge::Backend> for pyo3::impl_::pyclass::PyClassImplCollector<rsbridge::Backend>>::py_methods::ITEMS::trampoline::h8965eca3b95eda39
  40:        0x101a397b0 - _method_vectorcall_VARARGS_KEYWORDS
  41:        0x101b32a14 - __PyEval_EvalFrameDefault
  42:        0x101a2b7f8 - __PyFunction_Vectorcall
  43:        0x101b32a14 - __PyEval_EvalFrameDefault
  44:        0x101a2b7f8 - __PyFunction_Vectorcall
  45:        0x101a30610 - _method_vectorcall
  46:        0x101b468ac - __PyEval_EvalFrameDefault
  47:        0x101a2ba94 - __PyFunction_Vectorcall
  48:        0x101b468ac - __PyEval_EvalFrameDefault
  49:        0x101a2ba94 - __PyFunction_Vectorcall
  50:        0x101b468ac - __PyEval_EvalFrameDefault
  51:        0x101a2b7f8 - __PyFunction_Vectorcall
  52:        0x101b468ac - __PyEval_EvalFrameDefault
  53:        0x101a2ba94 - __PyFunction_Vectorcall
  54:        0x101b34830 - __PyEval_EvalFrameDefault
  55:        0x101a2b7f8 - __PyFunction_Vectorcall
  56:        0x101b32a14 - __PyEval_EvalFrameDefault
  57:        0x101a2b7f8 - __PyFunction_Vectorcall
  58:        0x101b32a14 - __PyEval_EvalFrameDefault
  59:        0x101a2b7f8 - __PyFunction_Vectorcall
  60:        0x101b32a14 - __PyEval_EvalFrameDefault
  61:        0x101a2b7f8 - __PyFunction_Vectorcall
  62:        0x101a2d9cc - __PyObject_Call_Prepend
  63:        0x101aad284 - _slot_tp_call
  64:        0x101b46a74 - __PyEval_EvalFrameDefault
  65:        0x101a2ba94 - __PyFunction_Vectorcall
  66:        0x101b33ef8 - __PyEval_EvalFrameDefault
  67:        0x101a2ba94 - __PyFunction_Vectorcall
  68:        0x101b32a14 - __PyEval_EvalFrameDefault
  69:        0x101a2b7f8 - __PyFunction_Vectorcall
  70:        0x101b32a14 - __PyEval_EvalFrameDefault
  71:        0x101a2b7f8 - __PyFunction_Vectorcall
  72:        0x101b32a14 - __PyEval_EvalFrameDefault
  73:        0x101a2b7f8 - __PyFunction_Vectorcall
  74:        0x101a306b4 - _method_vectorcall
  75:        0x101b32c70 - __PyEval_EvalFrameDefault
  76:        0x101a2b7f8 - __PyFunction_Vectorcall
  77:        0x101b32a14 - __PyEval_EvalFrameDefault
  78:        0x101a2b7f8 - __PyFunction_Vectorcall
  79:        0x101b32a14 - __PyEval_EvalFrameDefault
  80:        0x101a2b7f8 - __PyFunction_Vectorcall
  81:        0x101a30718 - _method_vectorcall
  82:        0x101c8eb64 - _t_bootstrap
  83:        0x101bb9af0 - _pythread_wrapper
  84:        0x198763fa8 - __pthread_joiner_wake
thread caused non-unwinding panic. aborting.
./run: line 17: 20274 Abort trap: 6           ./out/pyenv/bin/python tools/run.py $*

collection-2023-09-04@16-54-05.colpkg.zip

@dae
Copy link
Member Author

dae commented Sep 4, 2023

Thanks, this was fixed in open-spaced-repetition/fsrs-rs@424fe1c

Weight checking now shows progress and should be much faster.

@L-M-Sherlock
Copy link
Contributor

L-M-Sherlock commented Sep 5, 2023

image

The percentage of progress disappeared in the latest commit?

Edit: it shows in my second try. But it always disappeared in the first check after enter the option page.

@dae
Copy link
Member Author

dae commented Sep 5, 2023

Would you be able to record a short video that shows what's happening? I can't seem to reproduce it.

@L-M-Sherlock
Copy link
Contributor

20230905-103534.mp4

@dae
Copy link
Member Author

dae commented Sep 5, 2023

Ah, thanks, I was testing with the Main deck you shared earlier. I can reproduce it with the collection you shared, and will dig into it.

@dae
Copy link
Member Author

dae commented Sep 5, 2023

Should be fixed now.

@dae dae marked this pull request as ready for review September 5, 2023 08:37
@dae
Copy link
Member Author

dae commented Sep 5, 2023

  • UI polish is still required, but that can be done in follow-up commits (PRs welcome!)
  • Translations may be best to hold off on for now, as hopefully the strings will change in the not-too-distant-future when FSRS support is integrated into the review system
  • I've tested this across the different platforms and it seems to be fine, but if problems present themselves during beta testing, it may need to be temporarily rolled back.

@dae dae merged commit 0c6e3ea into main Sep 5, 2023
1 check passed
@filipenanclarez
Copy link

  • UI polish is still required, but that can be done in follow-up commits (PRs welcome!)
  • Translations may be best to hold off on for now, as hopefully the strings will change in the not-too-distant-future when FSRS support is integrated into the review system
  • I've tested this across the different platforms and it seems to be fine, but if problems present themselves during beta testing, it may need to be temporarily rolled back.

Can you generate de beta packages for testing?

I'm have a different dev environment here, and i no want to install python env in my desk at this time ...

But i really want to help testing this new FSRS optimizer integrated ...

Regards

@dae dae deleted the fsrs branch September 6, 2023 05:33
@dae
Copy link
Member Author

dae commented Sep 7, 2023

There are some other changes I'd like to get in before building a beta - it could be a week to a few weeks.

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.

3 participants