keymanapp / keymanapp/keyman

bug(web): repeated selection of same prediction eventually gives different predictions

Open
#6,456 4 comments 0 reactions 0 assignees View on GitHub
bug web/ web/predictive-text/
Dominant language
Pascal
Stars
534
Forks
143
Avg merge
2d 10h
Merged PRs (30d)
113

Description

**Describe the bug**

If you repeatedly type the same prefix, then select the same suggestion offered, (for example, m, then select **more**), then eventually the predictions offered will change (for example, instead of **more**, you'll be offered **members**). This smells like an arithmetic overflow perhaps?

https://github.com/keymanapp/keyman/issues/6005#issuecomment-1079780269 may be related? (Discovered this while trying to repro).

**To Reproduce**

1. Go to testing/prediction-ui
2. Type m (on hardware keyboard to avoid fat finger), select first suggestion (**more**) from the banner.
3. Repeat step 2, 15 times.
4. On the last repeat, you'll find **members** is offered as the first suggestion, instead of **more**. Eventual output is `more more more more more more more more more more more more more more more members `;

Log of suggestions (added `console.log('suggestions: '+JSON.stringify(suggestions));` to end of `ModelCompositor.predict()` in [model-compositor.ts](https://github.com/keymanapp/keyman/blob/01217a76ae43a83d20520f0445cb6af4b625133b/common/predictive-text/worker/model-compositor.ts#L424):

* [log.txt](https://github.com/keymanapp/keyman/files/8393012/log.txt)

**Expected behavior**

The predictions should be consistent.

---

**KeymanWeb:**
- OS:
- Browser: Chrome 99
- KeymanWeb Version: 15.0.224-beta (also repro on 15.0.20-beta)
- URL: keymanweb/testing/prediction-ui/

---

**Keyboard**
- Keyboard name: us

**Model**
- Model name: simple-en-trie.js (example.en.trie)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.