## Summary by Sourcery
围绕共享的 `ReclamationMode` 枚举统一回收任务模式处理方式,并相应更新 UI 和配置流程。
New Features:
- 引入共享的 `ReclamationMode` 枚举,在各类回收主题和任务中统一用于表示算法模式。
Bug Fixes:
- 确保 `RelaunchAnchor` 模式选择在使用新的基于位标志(bitflag)的模式值时,仍能正确映射到 `RA-1` 和
`RA-15`,并保持已序列化配置中的现有行为不变。
Enhancements:
- 更新回收设置视图模型,使其暴露统一的模式列表;该列表会根据当前选中的主题动态重建,同时在可能的情况下保留当前选择。
- 调整 `ReclamationTask` 及相关配置类,使用新的 `ReclamationMode` 枚举来替代原先按主题划分的整型模式值。
- 在主题或底层任务数据变更时刷新回收模式选项,以保持 UI 与模型的同步。
<details>
<summary>Original summary in English</summary>
## Summary by Sourcery
Unify reclamation task mode handling around a shared ReclamationMode
enum and update UI and config flows accordingly.
New Features:
- Introduce a shared ReclamationMode enum used across reclamation themes
and tasks to represent algorithm modes.
Bug Fixes:
- Ensure RelaunchAnchor mode selection correctly maps to RA-1 and RA-15
using the new bitflag-based mode values while maintaining existing
behavior in serialized configs.
Enhancements:
- Update reclamation settings view model to expose a unified mode list
that is dynamically rebuilt based on the selected theme while preserving
the current selection where possible.
- Adjust ReclamationTask and related config classes to use the new
ReclamationMode enum instead of theme-specific integer modes.
- Refresh reclamation mode options whenever the theme or underlying task
data changes to keep the UI and model in sync.
</details>
增强内容:
- 将原本分别使用整数和主题特定表示的回收模式,统一替换为在任务配置和视图模型中通用的 `ReclamationMode` 枚举。
- 更新回收设置的 UI,使其根据所选主题动态生成模式列表,并在主题变化时保持已选模式同步。
- 调整配置转换和任务序列化逻辑,使其使用新的枚举来读写回收模式,同时保持现有行为不变。
<details>
<summary>Original summary in English</summary>
## Summary by Sourcery
围绕共享的 `ReclamationMode` 枚举统一回收任务模式处理方式,并相应更新 UI 和配置流程。
New Features:
- 引入共享的 `ReclamationMode` 枚举,在各类回收主题和任务中统一用于表示算法模式。
Bug Fixes:
- 确保 `RelaunchAnchor` 模式选择在使用新的基于位标志(bitflag)的模式值时,仍能正确映射到 `RA-1` 和
`RA-15`,并保持已序列化配置中的现有行为不变。
Enhancements:
- 更新回收设置视图模型,使其暴露统一的模式列表;该列表会根据当前选中的主题动态重建,同时在可能的情况下保留当前选择。
- 调整 `ReclamationTask` 及相关配置类,使用新的 `ReclamationMode` 枚举来替代原先按主题划分的整型模式值。
- 在主题或底层任务数据变更时刷新回收模式选项,以保持 UI 与模型的同步。
<details>
<summary>Original summary in English</summary>
## Summary by Sourcery
Unify reclamation task mode handling around a shared ReclamationMode
enum and update UI and config flows accordingly.
New Features:
- Introduce a shared ReclamationMode enum used across reclamation themes
and tasks to represent algorithm modes.
Bug Fixes:
- Ensure RelaunchAnchor mode selection correctly maps to RA-1 and RA-15
using the new bitflag-based mode values while maintaining existing
behavior in serialized configs.
Enhancements:
- Update reclamation settings view model to expose a unified mode list
that is dynamically rebuilt based on the selected theme while preserving
the current selection where possible.
- Adjust ReclamationTask and related config classes to use the new
ReclamationMode enum instead of theme-specific integer modes.
- Refresh reclamation mode options whenever the theme or underlying task
data changes to keep the UI and model in sync.
</details>
</details>
* perf: FFT/sparse fast path for masked TM_CCOEFF_NORMED
* perf: optimize masked ccoeff matching
* perf: tune masked ccoeff dispatcher and remove fixed overhead
- sync_cache_revision: atomic acquire/release double-check avoids
taking the mutex on every preproc_and_match call. No-mask hot path
no longer pays for the singleton at all (init hoisted into the
FFT/sparse branch).
- should_fallback_to_opencv: pick whichever path is empirically
faster instead of only catching dense-mask small-result cases:
* result < 1000 && K < 2000: keep sparse (OpenCV setup dominates)
* result < 12000 && K >= 500: fallback (covers GameStart 200x120/
58x58 and 138x130/105x105 dead zones)
* K*result < 25M: fallback (covers SmileyOnWork 880x80/20x21 and
similar long-thin / small-template FFT-loses cases)
Windows MSVC x64 (min-of-2, n=803/1402):
coverage: regressions 198 -> 50, mean 10.5ms -> 7.4ms (1.40x)
perf: regressions 86 -> 3, mean 854us -> 296us (2.90x)
Android arm64-v8a NEON (single run, n=803/1402):
coverage: regressions 0, mean 125ms -> 80ms (1.72x)
perf: regressions 1 (1.20x edge), mean 6.4ms -> 2.8ms (10.95x)
* perf(masked-matcher): merge 3-channel I² into a single FFT in σ_I² compute
σ_I²(x,y) = Σ_c [(M ⋆ I_c²) - (M ⋆ I_c)² / N]
= Σ_c (M ⋆ I_c²) - (1/N) Σ_c (M ⋆ I_c)²
↑ this term is linear in I_c², so by convolution linearity
Σ_c (M ⋆ I_c²) = M ⋆ Σ_c I_c².
Precompute I_sq_sum = Σ_c I_c² in spatial domain and do a single
FFT + single IFFT instead of three. The second term Σ_c (M ⋆ I_c)²
still requires per-channel computation (squaring is non-linear).
Net: -2 FFTs and -2 IFFTs per match() call (15 → 11 transforms).
Validated min-of-3 runs on the 10 largest FFT-path cases per platform:
windows: 8/10 cases -22%, 2 cases (66x41 templ) unchanged
android: 8/10 cases -22%, 2 cases (66x41 templ) unchanged
The two unchanged cases have very small templates where FFT is not
the bottleneck (cvtColor / convertTo / split dominate). Correctness
preserved across 1800 iterations × 10 cases on both platforms.
* fix: 测试代码忘记删除了
* fix: make TemplResource::m_revision atomic
* chore: 调一下匹配参数
* feat: 在日志中标记匹配路径(优化实现 vs cv::matchTemplate)