Commit Graph

155 Commits

Author SHA1 Message Date
Voczi
9e3a34f17f
Add support for custom certificates (#3203)
* Add support for custom certificates

* Update lints

* Update licenses

* Changes after feedback

* More changes
2024-05-24 10:57:54 +01:00
Jarrett Ye
7a1508adb7
update to fsrs-rs v0.6.4 (#3200)
* update to fsrs-rs v0.6.3

* update to fsrs-rs v0.6.4
2024-05-17 06:26:06 +01:00
Jarrett Ye
4a05fab088
update to fsrs-rs v0.6.2 (#3171) 2024-05-01 17:55:14 +10:00
Damien Elmes
a90eda2e53 Update rustls for security issue 2024-04-22 19:37:11 +10:00
Jarrett Ye
10d567f937
Update to FSRS-rs v0.6.1 (#3106)
* update to FSRS-rs 0.6.0

* update to crates.io version

* format

* update to FSRS-rs v0.6.01

* ./ninja fix:minilints

* update python backend code
2024-04-05 13:04:50 +01:00
Damien Elmes
00ba69b5fe Fix latest RUSTSEC warning 2024-04-05 18:35:28 +07:00
laalsaas
798d9df4de
sync-server: add option to store hashed passwords (#3083) 2024-03-26 07:39:57 +00:00
Jarrett Ye
8d197a1555
Feat/fsrs simulator backend part (#3075)
* [WIP] FSRS simulator

* add desired_retention as input

* cargo fmt

* fix format

* add standard copyright header

* support existing cards

* fix format

* pass days_elapsed into Card::convert & return None
2024-03-18 13:42:38 +00:00
Jarrett Ye
e8d95de426
speed up computing optimal retention (#3072)
* speed up computing optimal retention

* ./ninja fix:minilints
2024-03-12 15:57:41 +07:00
Jarrett Ye
8c9d7d64d9
refactor optimal retention to minimize workload per memorization & fix progress goes backwards (#3065)
* Feat/optimal retention for minimal workload per memorization

* ./ninja fix:minilints

* update to FSRS-rs 0.5.2

* update to FSRS-rs 0.5.3

* ./ninja fix:minilints

* 'estimated retention' -> 'predicted optimal retention'; add warning (dae)
2024-03-11 16:16:37 +07:00
Jarrett Ye
055b6e30f8
update FSRS-rs to 0.5.0 & export benchmark API (#3056)
* update fsrs to 0.4.5

* update to fsrs 0.4.6

* add benchmark API

* update fsrs to 0.5.0

* cargo fmt

* ./ninja fix:minilints

* ./ninja format

* Add a brief comment about the new method (dae)
2024-03-08 12:37:06 +00:00
Damien Elmes
55dacf05c3 Update mio for security warning 2024-03-05 13:51:06 +07:00
Jarrett Ye
c7556f17e6
update fsrs to 0.4.4 (#3045)
* update fsrs to 0.4.4

* fix bypassed_learning_is_handled
2024-03-03 14:30:34 +07:00
Damien Elmes
4fc535ec88
Dependency updates (#3040)
* Update JS deps

* Update semver-compat Rust deps

* Update some semver-incompat Rust deps

- hyper/axum held back because reqwests is not ready
- rusqlite held back due to burn-rs incompat version
- wiremock held back due to compile issue

* pylint wants changes to our _rsbridge.pyi

* Update Python deps

Also solves a security warning in orjson

Reformat with latest black
2024-02-28 16:28:04 +07:00
Damien Elmes
1a7f8b4fdf Fix cargo deny in CI
The 0.14.12 release appears to have broken "-A duplicate". Fix by
updating our checks to use the latest release/format.

Also update iana-time-zone, which was yanked, and ignore safemem,
which is only used when bundling.
2024-02-24 15:22:57 +07:00
Abdo
4ef389b580
Keep previous FSRS parameters if they get worse when optimizing (#2996)
* Update to fsrs-rs 0.3.0

* Keep previous FSRS parameters if they get worse when optimizing
2024-02-11 16:26:04 +10:00
Jarrett Ye
2fffe4b7ba
update FSRS to v0.2.0 (#2977)
* update FSRS to v0.2.0

* update comments

* ./ninja fix:minilints

* 1000 -> 400 in translation (dae)
2024-01-30 16:27:12 +10:00
Damien Elmes
6afc4993fd Update Rust deps 2024-01-18 11:00:01 +10:00
Damien Elmes
77cb3220c5 Update zerocopy for soundness fix 2023-12-16 09:48:30 +10:00
Damien Elmes
96ae3a5d63 Update to latest fsrs-rs
The extra entries in Cargo.lock and licenses.json are mostly spurious,
and caused by https://github.com/tracel-ai/burn/pull/1025#issuecomment-1842006690
2023-12-07 14:13:58 +10:00
Damien Elmes
70b0fbde92 Update to Rust 1.74, and update most Rust deps
hyper has been held back, as neither reqwest nor axum support 1.0 yet
2023-11-27 13:34:42 +10:00
Damien Elmes
fc24a4be52 Update self_cell for UB fix 2023-11-12 10:40:33 +10:00
Damien Elmes
7740241331 We can now use burn from crates.io 2023-10-28 08:23:33 +10:00
Damien Elmes
1c08a97fb2 Update fsrs and Rust deps 2023-10-25 10:22:36 +10:00
dependabot[bot]
2d176d8c35
Bump rustix from 0.38.14 to 0.38.19 (#2747)
* Bump rustix from 0.38.14 to 0.38.19

Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.38.14 to 0.38.19.
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.14...v0.38.19)

---
updated-dependencies:
- dependency-name: rustix
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update licenses

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Damien Elmes <gpg@ankiweb.net>
2023-10-19 09:44:51 +10:00
Dominique Martinet
c555a9cf7a
Update rust-csv (#2703)
Upstream rust-csv 1.3.0 includes our patch and can be used instead of
the ankitects repo.

This fixes `cargo vendor`
2023-10-04 13:21:47 +10:00
Damien Elmes
50c8a1ba9f Update FSRS
- up to 10x performance increase in optimal retention
- expose loss aversion
- use SpinBoxes
2023-09-30 16:10:22 +10:00
Damien Elmes
f3bb845961 Update incompatible Rust deps 2023-09-28 10:00:47 +10:00
Damien Elmes
ce11927f97 Update compatible Rust deps
Fixes a CVE in tungstenite
2023-09-28 09:54:56 +10:00
Damien Elmes
5004cd332b
Integrate FSRS into Anki (#2654)
* Pack FSRS data into card.data

* Update FSRS card data when preset or weights change

+ Show FSRS stats in card stats

* Show a warning when there's a limited review history

* Add some translations; tweak UI

* Fix default requested retention

* Add browser columns, fix calculation of R

* Property searches

eg prop:d>0.1

* Integrate FSRS into reviewer

* Warn about long learning steps

* Hide minimum interval when FSRS is on

* Don't apply interval multiplier to FSRS intervals

* Expose memory state to Python

* Don't set memory state on new cards

* Port Jarret's new tests; add some helpers to make tests more compact

https://github.com/open-spaced-repetition/fsrs-rs/pull/64

* Fix learning cards not being given memory state

* Require update to v3 scheduler

* Don't exclude single learning step when calculating memory state

* Use relearning step when learning steps unavailable

* Update docstring

* fix single_card_revlog_to_items (#2656)

* not need check the review_kind for unique_dates

* add email address to CONTRIBUTORS

* fix last first learn & keep early review

* cargo fmt

* cargo clippy --fix

* Add Jarrett to about screen

* Fix fsrs_memory_state being initialized to default in get_card()

* Set initial memory state on graduate

* Update to latest FSRS

* Fix experiment.log being empty

* Fix broken colpkg imports

Introduced by "Update FSRS card data when preset or weights change"

* Update memory state during (re)learning; use FSRS for graduating intervals

* Reset memory state when cards are manually rescheduled as new

* Add difficulty graph; hide eases when FSRS enabled

* Add retrievability graph

* Derive memory_state from revlog when it's missing and shouldn't be

---------

Co-authored-by: Jarrett Ye <jarrett.ye@outlook.com>
2023-09-16 16:09:26 +10:00
Damien Elmes
0c6e3eaa93
Integrate the FSRS optimizer (#2633)
* Support searching for deck configs by name

* Integrate FSRS optimizer into Anki

* Hack in a rough implementation of evaluate_weights()

* Interrupt calculation if user closes dialog

* Fix interrupted error check

* log_loss/rmse

* Update to latest fsrs commit; add progress info to weight evaluation

* Fix progress not appearing when pretrain takes a while

* Update to latest commit
2023-09-05 18:45:05 +10:00
Damien Elmes
ff53625408 Update nightly formatter
Rustfmt is now capable of formatting let Some(..) else {} blocks
2023-09-02 16:13:50 +10:00
Damien Elmes
3b7c5d71ab Update Rust deps 2023-08-23 11:44:33 +10:00
Damien Elmes
a35c1a058d Extract inline images as part of media check
We also need to get to the bottom of what's causing this:
https://forums.ankiweb.net/t/anki-browse-extremely-laggy/32533
2023-07-31 12:23:16 +10:00
Damien Elmes
7a34f83d40 Update regex crate for .extract()
Also update yanked hermit-abi
2023-07-31 12:20:07 +10:00
Damien Elmes
85c2769f80
Update Rust and Python deps (#2567)
* Update Python deps

* Update semver-compat Rust deps

* Update most crates to latest semver

* Update to latest axum-client-ip
2023-07-01 18:26:43 +10:00
Damien Elmes
f032242b65 Add must_use annotations to generated protobufs 2023-06-30 17:02:36 +10:00
Damien Elmes
b2e7ab522b Remove some unused Rust dependencies 2023-06-24 19:30:29 +10:00
Damien Elmes
40e1520acb Drop workspace-hack in favor of workspace deps
Workspace deps were introduced in Rust 1.64. They don't cover all the
cases that Hakari did unfortunately, but they are simpler to maintain,
and they avoid a couple of issues that Hakari had:

- It sometimes made updating dependencies harder due to the locked versions,
so you had to disable Hakari, do the updates, and then re-generate (
e.g. 943dddf28f)
- The current Hakari config was breaking AnkiDroid's build, as it was
stopping a cross-compile from functioning correctly.
2023-06-23 17:41:31 +10:00
Damien Elmes
b37063e20a More service generation refactoring
- Dropped the protobuf extensions in favor of explicitly listing out
methods in both services if we want to implement both, as it's clearer.
- Move Service/Method wrappers into a separate crate that the various
clients can import, to easily get at the list of backend services and
their correct indices and comments.
2023-06-22 09:46:09 +10:00
Damien Elmes
dee7860f08 Bump openssl version
Fixes a moderate-severity security issue
2023-06-22 09:46:09 +10:00
Damien Elmes
553303fc12
Refactor service generation (#2552)
* Automatically elide empty inputs and outputs to backend methods

* Refactor service generation

Despite the fact that the majority of our Protobuf service methods require
an open collection, they were not accessible with just a Collection
object. To access the methods (e.g. because we haven't gotten around to
exposing the correct API in Collection yet), you had to wrap the collection
in a Backend object, and pay a mutex-acquisition cost for each call, even
if you have exclusive access to the object.

This commit migrates the majority of service methods to the Collection, so
they can now be used directly, and improves the ergonomics a bit at the
same time.

The approach taken:

- The service generation now happens in rslib instead of anki_proto, which
avoids the need for trait constraints and associated types.
- Service methods are assumed to be collection-based by default. Instead of
implementing the service on Backend, we now implement it on Collection, which
means our methods no longer need to use self.with_col(...).
- We automatically generate methods in Backend which use self.with_col() to
delegate to the Collection method.
- For methods that are only appropriate for the backend, we add a flag in
the .proto file. The codegen uses this flag to write the method into a
BackendFooService instead of FooService, which the backend implements.
- The flag can also allows us to define separate implementations for collection
and backend, so we can e.g. skip the collection mutex in the i18n service
while also providing the service on a collection.
2023-06-19 15:33:40 +10:00
Damien Elmes
dd95f6f749 Check for stale licenses.json in minilints
+ Add an anki_process library with some helpers for command running.
2023-06-17 14:01:27 +10:00
Damien Elmes
9b028e8f3d Bump Chrono now that Rumo's TZ parser has been merged
https://github.com/chronotope/chrono/pull/978

+ Update workspace hack/licenses
2023-06-16 11:43:12 +10:00
Damien Elmes
b618ab93a5 Update hakari and licenses 2023-05-29 17:54:00 +10:00
Damien Elmes
1ff27b4ab7 Bump h2 version
https://github.com/hyperium/h2/issues/674
2023-04-19 15:31:13 +10:00
Damien Elmes
0466e220f3 Move ascii_percent_encoding into a separate repo
This makes it easier to update independently, and means we don't need
to exclude it from formatting/tests.
2023-04-12 08:45:23 +10:00
Damien Elmes
781ff16683 Update from yanked crossbeam-channel 2023-04-12 08:29:26 +10:00
Damien Elmes
dc8c4438d7 Update iana-time-zone and windows crates, as windows 0.47 yanked 2023-04-12 08:25:53 +10:00
Damien Elmes
a84d699271 Bump tempfile version to drop old remove_dir_all version
https://rustsec.org/advisories/RUSTSEC-2023-0018
2023-03-06 18:23:19 +10:00