> For AI agents: the complete documentation index is available at https://open-spaced-repetition.github.io/ts-fsrs/llms.txt, the full documentation bundle is available at https://open-spaced-repetition.github.io/ts-fsrs/llms-full.txt.

# Playground

Run the current workspace build directly in your browser. Monaco reads the real `ts-fsrs` and `@open-spaced-repetition/binding` declarations, so hover information, diagnostics, completions, and go-to-definition match the packages in this repository.


Browser lab

## Run typed examples in a Worker

ts-fsrs schedulerWASIP1 trainer

Loading typed editor…

Worker output

Edit the example and run it. The page stays responsive while scheduling or training executes off the main thread.


## Train with the WASIP1 binding

The companion package's browser entry, CSV conversion, `FSRSBindingItem` / `FSRSBindingReview` creation, and every optimizer call stay inside the same dedicated Worker. The main thread only reads the selected `File` as text and sends that text to the Worker.


Model versionFSRS6FSRS7Review timezoneStudy day starts at00:0001:0002:0003:0004:0005:0006:0007:0008:0009:0010:0011:0012:0013:0014:0015:0016:0017:0018:0019:0020:0021:0022:0023:00Scheduling penalties

FSRS7 normalizes intervals by the actual length of each study day, retaining fractional and same-day intervals. The selected timezone and rollover hour determine these boundaries; a complete study day counts as 1 even when DST makes it 23 or 25 hours long. Adds FSRS7 training penalties for interval growth and short intervals. Off by default; this does not change scheduling formulas.

Select revlog.csvTrain in dedicated Worker[Download the sample revlog.csv](https://github.com/open-spaced-repetition/fsrs-rs/files/15046782/revlog.csv)

Select a CSV file to begin.

revlog.csv schema (all columns required)| Field | Type | Meaning and constraints |
| --- | --- | --- |
| `card_id` | string | Stable card identifier. Rows with the same value form one history; quote values that contain commas. |
| `review_time` | signed 64-bit integer | Unix timestamp in milliseconds. FSRS6 uses whole study days; FSRS7 uses fractional study days normalized to their actual lengths. |
| `review_rating` | unsigned integer (1–4) | 1 Again, 2 Hard, 3 Good, or 4 Easy. |
| `review_state` | unsigned integer (0–3) | State before the answer: 0 New, 1 Learning, 2 Review, or 3 Relearning. Retained history begins at the last New/Learning block. |
| `review_duration` | unsigned integer | Required non-negative answer duration in milliseconds. |


The link downloads a [sample `revlog.csv`](https://github.com/open-spaced-repetition/fsrs-rs/files/15046782/revlog.csv) from `fsrs-rs`: 123,730 review records, 4,626,708 bytes. Parsing uses the binding's Rust `csv` implementation, so quoted fields, embedded commas, and CRLF records are supported. The converter groups rows by `card_id`, sorts each history by `review_time`, and keeps the history beginning at the last New/Learning block. The selected IANA timezone resolves local time and daylight-saving transitions for each timestamp; the selected `nextDayStartsAt` hour assigns earlier local reviews to the previous study day. For FSRS6, the converter derives each `FSRSBindingReview.deltaT` as the whole-day distance between those study dates. Both models create training items only when the current review has `deltaT > 0`.

FSRS7 is the default and uses the same timezone and study-day boundaries. It divides the elapsed time within each study day by that day's actual length and adds the portions across days, preserving fractional and same-day intervals. A complete study day counts as 1 even when DST makes it 23 or 25 hours long.
You need to select the same model for CSV conversion and training.

For FSRS6, enable short-term parameters to model same-day reviews, or turn them off to train long-term-only weights. FSRS7 training always uses `enableShortTerm: true`. Either way the complete returned `weights` array is displayed without rounding or truncation.
