|
|
abbe9d4c0b
|
fix(local-tool): DeviceGroup.__del__ access violation 全面修復
上一個 commit (a6a121a) 只修了 script 結束時的 cleanup,但使用者仍在
connect 重試路徑看到 access violation:
connect attempt 1 failed → 新 connect attempt 2 → GC 回收 attempt 1
的舊 DeviceGroup → __del__ → kp_disconnect_devices 對已失效的 native
handle → OSError: access violation
根因:`_device_group = None` 只是清掉 Python reference,舊物件的 __del__
會延遲到下一次 GC cycle(可能發生在新 connect call 的 allocation 時),
此時 native handle 已 invalid。
修法:
- 新增 `_clear_device_group()` helper:先 kp.core.disconnect_devices 把
native handle 正常釋放(errors silenced),再設 None
- 全檔搜 `_device_group = None` 共 12 處,除了初始宣告(L40)和兩個 helper
自身(_clear_device_group / _cleanup)以外全部替換為 _clear_device_group()
- 涵蓋所有 code path:connect retry / firmware load reconnect / disconnect
handler / reset handler / error fallback
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
2026-04-16 17:20:12 +08:00 |
|
|
|
a6a121ae86
|
fix(local-tool): suppress KneronPLUS DeviceGroup.__del__ access violation
Windows 上 bridge script 結束時 Python GC 呼叫 DeviceGroup.__del__ →
kp_disconnect_devices 對已釋放的 native handle 操作 → OSError: access
violation reading 0x00...0C。這是 KneronPLUS SDK 的 destructor 沒做
null check 的已知問題,不影響功能但會印嚇人的 stack trace 到 stderr。
修法:
- 新增 _cleanup() 函式:明確 kp.core.disconnect_devices + 把
_device_group 設 None(讓 __del__ 成 no-op)
- atexit.register(_cleanup) 確保 interpreter 關閉前 cleanup
- main() return 後也同步呼叫一次(belt-and-suspenders)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
2026-04-16 15:40:30 +08:00 |
|
|
|
96dee565b3
|
fix(local-tool): 補上 Kneron KL520/KL720 韌體檔案
根因:KL520 在 USB Boot 模式下(fw=KDP2 Loader)需要先載入韌體到 RAM
才能接受模型載入。kneron_bridge.py connect 流程會自動呼叫
kp.core.load_firmware_from_file(),但前提是找到韌體檔案:
scripts/firmware/KL520/fw_scpu.bin + fw_ncpu.bin
scripts/firmware/KL720/fw_scpu.bin + fw_ncpu.bin
這些檔案在 M1 從 edge-ai-platform 搬程式碼時漏了,補入。
Makefile 的 payload-windows/linux/macos 的 cp -R server/scripts/
會自動帶入 firmware/ 子目錄。
KL520: scpu 51KB + ncpu 39KB
KL720: scpu 128KB + ncpu 2.0MB
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
2026-04-12 23:11:47 +08:00 |
|
|
|
c54f16fca0
|
Initial commit: visionA monorepo with local-tool subproject
local-tool/: visionA-local desktop app
- M1: Wails shell + Go server + Next.js UI + Mock mode (macOS dmg ready)
- M2: i18n (zh-TW/en) + Settings 4-tab refactor
- M3: Embedded Python 3.12 runtime (python-build-standalone) + KneronPLUS wheels
- M4: Windows Inno Setup script (build on Windows runner)
- M5: Linux AppImage script + udev rule (build on Linux runner)
- M6: ffmpeg (GPL, pending legal review) + yt-dlp bundled
- Lifecycle: watchServer health check, fatal native dialog,
Wails IPC raise endpoint, stale process cleanup
.autoflow/: full PRD / Design Spec / Architecture / Testing docs
(4 rounds tri-party discussion + cross review)
.github/workflows/: macOS / Windows / Linux build CI
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
2026-04-11 22:10:38 +08:00 |
|