Skip to content

Add match_stability: pre-match settle gating + match persistence#395

Merged
JE-Chen merged 1 commit into
devfrom
feat/match-stability-batch
Jun 23, 2026
Merged

Add match_stability: pre-match settle gating + match persistence#395
JE-Chen merged 1 commit into
devfrom
feat/match-stability-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 23, 2026

Copy link
Copy Markdown
Member

摘要

新增 region_stability / match_persistence比對前安定閘命中跨幀穩定性,作用於注入幀。在動畫進行中比對是主要不穩定來源;smart_waits.wait_until_screen_stable 以布林閘控即時輪詢迴圈,無法對可注入幀序列評分穩定度,也無法檢查某命中是否跨幀維持。

region_stability 以相鄰幀 SSIM 評分序列安定度({stable, mean_ssim, min_ssim});match_persistence 確認 template 在每一幀都找到且命中中心於 agree_px 內一致({persisted, n_hits, jitter},jitter=0 穩如磐石)。重用 ssim.ssim_compare + visual_match.match_template + grounding_consensus.consensus_point,不新增比對程式。幀可注入。Qt-free。

五層

  • 核心:utils/match_stability/region_stabilitymatch_persistence
  • Facade / Executor AC_region_stability + AC_match_persistence / MCP ac_region_stability + ac_match_persistence / Script Builder(Image)。
  • 文件:v180 EN + Zh + toctree。更新日誌:root EN + zh-TW + zh-CN。

測試

test_match_stability_batch.py — 相同幀穩定、移動元素不穩定、單幀 trivially stable、命中跨幀維持、缺幀不維持、wiring + facade。7 passed。ruff / bandit / radon / float-scan / Qt-free 全乾淨。

Matching mid-animation is a top flakiness source; wait_until_screen_stable
gates a live loop with a boolean and can't score an injectable frame sequence
or check a match held steady. region_stability scores consecutive-frame SSIM;
match_persistence confirms a template is found in every frame with the centres
agreeing within agree_px. Reuses ssim + visual_match + grounding_consensus.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 25 complexity · 0 duplication

Metric Results
Complexity 25
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit fbe54d8 into dev Jun 23, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/match-stability-batch branch June 23, 2026 23:40
@sonarqubecloud

Copy link
Copy Markdown

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