Improve backend stability and config tooling#880
Open
omni624562 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary / 摘要
This PR extracts stability and performance-oriented fixes from WIME back to PIME, without WIME branding, mockups, installer-only changes, or the larger candidate window UI redesign.
此 PR 將 WIME 中較適合回饋給 PIME 的穩定性與效能修正獨立整理出來,不包含 WIME 品牌改名、mockup、限定 installer,或較大型的候選窗 UI 重構。
Changes / 變更內容
Improve
PIMELauncherbackend startup responsiveness by avoiding holding the async state lock while spawning a backend.改善
PIMELauncher啟動 backend 時的反應速度,避免在 spawn backend 時持有 async state lock,降低其他 client 被阻塞的機會。Run Python backends unbuffered and flush protocol replies to reduce typing latency.
讓 Python backend 以 unbuffered 模式執行,並在送出 protocol 回應時 flush,降低打字延遲。
Avoid protocol parsing allocations in backend output handling.
優化 backend output 的 protocol parsing,避免不必要的配置。
Make C++ RPC handling more tolerant of missing JSON fields and absent
showCandidates.讓 C++ RPC 處理對缺少 JSON 欄位或沒有
showCandidates的回應更具容錯性。Reduce pipe reconnect wait time and increase pipe read buffer size.
縮短 pipe 重新連線等待時間,並增加 pipe read buffer 大小。
Recreate the overlapped I/O event after pipe resets.
pipe reset 後會重新建立 overlapped I/O event,避免一次斷線後後續 RPC 難以恢復。
Keep the Python backend alive after one malformed or failing request, with regression tests.
Python backend 遇到單次 malformed 或失敗 request 後會繼續運作,並加入 regression tests。
Harden cinbase config loading/saving so shipped defaults are layered under user settings and internal state is not persisted.
強化 cinbase 設定讀寫,先載入內建預設值再覆蓋使用者設定,並避免內部狀態被寫入設定檔。
Reset cinbase loading flags even when loading threads fail.
即使 cinbase 載入 thread 發生錯誤,也會正確重設 loading flag,避免輸入法永久停在載入狀態。
Fix New Chewing config tab switching and static file cache refresh behavior.
修正新酷音設定頁 tab 切換,以及靜態檔快取造成設定頁更新不即時的問題。
Allow config tools to save intentionally empty symbol/keyboard data.
允許設定工具儲存刻意清空的符號或鍵盤資料。
Validation / 驗證
python -m py_compile python\server.py python\cinbase\config.py python\cinbase\__init__.py python\cinbase\configtool.py python\input_methods\chewing\config_tool.pypython -m unittest tests.test_backend_resiliencerustfmt --edition 2021 --check src\main.rs src\backend_manager.rs src\protocol.rscargo checkinPIMELauncherPIMETextServiceRelease builds with Visual Studio 2022/CMake使用 Visual Studio 2022/CMake 成功建置 x86 與 x64
PIMETextServiceRelease 版本。