Skip to content

Improve backend stability and config tooling#880

Open
omni624562 wants to merge 1 commit into
EasyIME:masterfrom
omni624562:codex/pime-stability-fixes
Open

Improve backend stability and config tooling#880
omni624562 wants to merge 1 commit into
EasyIME:masterfrom
omni624562:codex/pime-stability-fixes

Conversation

@omni624562
Copy link
Copy Markdown

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 PIMELauncher backend 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.py
  • python -m unittest tests.test_backend_resilience
  • rustfmt --edition 2021 --check src\main.rs src\backend_manager.rs src\protocol.rs
  • cargo check in PIMELauncher
  • x86 and x64 PIMETextService Release builds with Visual Studio 2022/CMake
    使用 Visual Studio 2022/CMake 成功建置 x86 與 x64 PIMETextService Release 版本。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant