fix: 修复 And 识别器引用多结果 ROI 时 Or 子识别未按候选框短路的问题 fix #1313#1349
Open
overflow65537 wants to merge 2 commits into
Open
fix: 修复 And 识别器引用多结果 ROI 时 Or 子识别未按候选框短路的问题 fix #1313#1349overflow65537 wants to merge 2 commits into
overflow65537 wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
你好——我已经查看了你的修改,看起来很棒!
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进之后的审查。
Original comment in English
Hey - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
There was a problem hiding this comment.
Hey - 我在这里给出了一些总体反馈:
- 在
and_中围绕cache_sub_results_/pending_sub_results_的猜测性缓存逻辑,在多个返回路径上都涉及手动快照和对resize的调用;建议把这部分封装进一个 RAII 辅助工具中(例如,一个在作用域结束时自动回滚或提交的 guard),以减少将来新增早返回路径时忘记恢复状态的风险。 - 在
recognition_param_uses_roi_target中,requires { value.roi_target; }这个检查有些脆弱,它依赖于参数变体上一个不明显的隐式接口;你可能需要改成对已知、具有roi_target的参数类型进行显式处理,从而让依赖分析更加健壮,也更易于维护。
给 AI Agent 的提示
Please address the comments from this code review:
## Overall Comments
- The speculative caching logic around `cache_sub_results_`/`pending_sub_results_` in `and_` involves manual snapshots and `resize` calls on multiple return paths; consider encapsulating this in an RAII helper (e.g., a guard that automatically rolls back or flushes) to reduce the risk of future early-return paths forgetting to restore state.
- In `recognition_param_uses_roi_target`, the `requires { value.roi_target; }` check is somewhat brittle and relies on a non-obvious implicit interface of param variants; you may want to replace this with explicit handling of the known param types that have `roi_target` to make the dependency analysis more robust and easier to maintain.帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的评审。
Original comment in English
Hey - I've left some high level feedback:
- The speculative caching logic around
cache_sub_results_/pending_sub_results_inand_involves manual snapshots andresizecalls on multiple return paths; consider encapsulating this in an RAII helper (e.g., a guard that automatically rolls back or flushes) to reduce the risk of future early-return paths forgetting to restore state. - In
recognition_param_uses_roi_target, therequires { value.roi_target; }check is somewhat brittle and relies on a non-obvious implicit interface of param variants; you may want to replace this with explicit handling of the known param types that haveroi_targetto make the dependency analysis more robust and easier to maintain.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The speculative caching logic around `cache_sub_results_`/`pending_sub_results_` in `and_` involves manual snapshots and `resize` calls on multiple return paths; consider encapsulating this in an RAII helper (e.g., a guard that automatically rolls back or flushes) to reduce the risk of future early-return paths forgetting to restore state.
- In `recognition_param_uses_roi_target`, the `requires { value.roi_target; }` check is somewhat brittle and relies on a non-obvious implicit interface of param variants; you may want to replace this with explicit handling of the known param types that have `roi_target` to make the dependency analysis more robust and easier to maintain.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
改进复合识别逻辑,以正确处理带有 ROI 依赖的 AND/OR 组合,以及推测性子识别结果缓存。
Bug Fixes:
Enhancements:
Original summary in English
Summary by Sourcery
Improve composite recognition logic to correctly handle AND/OR combinations with ROI dependencies and speculative sub-recognition caching.
Bug Fixes:
Enhancements:
Bug 修复:
增强功能:
Original summary in English
Summary by Sourcery
改进复合识别逻辑,以正确处理带有 ROI 依赖的 AND/OR 组合,以及推测性子识别结果缓存。
Bug Fixes:
Enhancements:
Original summary in English
Summary by Sourcery
Improve composite recognition logic to correctly handle AND/OR combinations with ROI dependencies and speculative sub-recognition caching.
Bug Fixes:
Enhancements: