Commit 6b4553b
fix(boost): rebuild trie on vocab change, not on every status flip
The phrase-boost trie rebuild effect depended on the raw `status` string as a
proxy for "the model's tokenizer changed". But `status` also flips on recording
start/stop, file transcribe, and each chunk-progress tick (setStatus with a
percentage string). Every flip re-ran parseBoostPhrases (~88ms on the 64k-line
medical list) and the trie rebuild, and pushed fresh boost-warning arrays that
forced the giant phrase-list textarea to reconcile. On load, status cycles
idle -> loadingModel -> creatingSessions -> modelReady, so this fired several
times back to back: the "My Computer tab frozen on load" the user saw. The
earlier fix (d103856) only stopped the casing-expand on the prebuilt path; the
parse + rebuild + warning-state churn on every status value remained.
Fix: publish the loaded tokenizer's vocab signature as `tokenizerVocabSig` state
(set after the model is created, cleared on dispose) and key the rebuild effect
on it instead of `status`. The vocab signature changes only on a real model
load/swap, so the trie rebuilds exactly once per model change and unrelated
status churn no longer touches it.
Covered by a tier-3 e2e (boost-rebuild-on-status.spec.js): with verbose logging
on and a Custom boost list, it asserts the "[Boost] rebuilding trie" count does
not grow across a full transcribe cycle. Verified the test fails when the effect
is reverted to depend on `status`.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 583ba67 commit 6b4553b
2 files changed
Lines changed: 120 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
520 | 531 | | |
521 | 532 | | |
522 | 533 | | |
| |||
1660 | 1671 | | |
1661 | 1672 | | |
1662 | 1673 | | |
1663 | | - | |
1664 | | - | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
1665 | 1680 | | |
1666 | 1681 | | |
1667 | 1682 | | |
| |||
1746 | 1761 | | |
1747 | 1762 | | |
1748 | 1763 | | |
1749 | | - | |
| 1764 | + | |
1750 | 1765 | | |
1751 | 1766 | | |
1752 | 1767 | | |
| |||
1769 | 1784 | | |
1770 | 1785 | | |
1771 | 1786 | | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
1772 | 1790 | | |
1773 | 1791 | | |
1774 | 1792 | | |
| |||
1842 | 1860 | | |
1843 | 1861 | | |
1844 | 1862 | | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
1845 | 1868 | | |
1846 | 1869 | | |
1847 | 1870 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
0 commit comments