ClashGO v0.4.0-beta
·
9 commits
to main
since this release
Changed
- Frame-hot-path template matching is single-scale by default
(internal/vision/vision.go) —MatchTemplateno longer blindly
escalates every call to a 5-step multi-scale search (0.8–1.2). That
escalation cost 5Resizeallocations + 5 cgo matches per call on the
per-frame path. Callers that genuinely need density-scale tolerance
callMatchMultiScaleexplicitly (named templates hit the scaled
template cache). Expected effect: per-frame template matching cgo work
drops from 5×N to N matches (N = templates checked). - Pooled result Mats on the classifier and loot-OCR paths
(internal/game/templates.go,internal/game/loot.go) — the result
Mat forMatchTemplateresults now comes from the shared vision Mat
pool (vision.GetMat/PutMat) instead ofgocv.NewMat()+Close()
per template per frame. Zero result-Mat heap allocation on the
classifier tick and loot OCR hot paths. - Persistent ADB shell pipe is now enabled by default
(internal/config/config.go) —UseShellPipe: true. Removes the
~100–300msapp_processJVM spin-up per tap during attack cycles
(measured 30–80ms/command on USB, more on WiFi ADB). Automatic
fallback to the legacy one-shot transport is verified
(routeTap→markPipeBroken→ legacy tap path), and pipe start
failure logs a warning and degrades gracefully.
Fixed
--onceCLI runs now exit cleanly (cli.go,internal/bot/bot.go)
— main() previously blocked forever onctx.Done()after the bot
finished its final attack, so a--oncerun hung with the process
alive after the session summary printed.Bot.Done()exposes a
channel that closes on graceful attack-cap shutdown, and main()
selects on it.- Boot survives a wedged
wm size(internal/bot/bootorchestrator.go)
— when thewm sizeshell call fails (BlueStacks returning
"ADB: closed" while SurfaceFlinger still serves frames), the boot
orchestrator now falls back to the live screencap's 12-byte header
for authoritative pixel dimensions instead of aborting the whole
boot and leaving the Start button dead.
Verified
- Full end-to-end live run on BlueStacks Air (860×732): boot → calibrate
→ attack search → loot OCR → EDrag Rush attack (100% deploy, 3 stars,
2.1M elixir) → graceful shutdown, exit code 0.