Skip to content

fix analyze coverage bugs#922

Merged
fangyangci merged 14 commits into
mainfrom
fangyangci/fixAnalyze_bugs
Jun 23, 2026
Merged

fix analyze coverage bugs#922
fangyangci merged 14 commits into
mainfrom
fangyangci/fixAnalyze_bugs

Conversation

@fangyangci

Copy link
Copy Markdown
Contributor

No description provided.

@fangyangci fangyangci requested a review from a team as a code owner June 19, 2026 02:38
@fangyangci fangyangci marked this pull request as draft June 22, 2026 02:33
@fangyangci fangyangci marked this pull request as ready for review June 22, 2026 06:44

@DingmaomaoBJTU DingmaomaoBJTU left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of PR #922 (fix analyze coverage bugs). Three separate bug fixes are bundled here. The
ode_stable_key fix and return-tuple reorder are correct. The
esolve_rule_parquet_path refactor introduces regressions described in inline comments.

Comment thread src/winml/modelkit/analyze/utils/rule_loader.py Outdated
Comment thread src/winml/modelkit/analyze/utils/rule_loader.py
Comment thread src/winml/modelkit/analyze/core/runtime_checker_query.py Outdated
Comment thread src/winml/modelkit/analyze/core/runtime_checker_query.py
Comment thread src/winml/modelkit/analyze/core/runtime_checker.py
Comment thread tests/unit/analyze/models/test_rule_loader.py
fangyangci and others added 4 commits June 21, 2026 23:59
- Guard `ref_device = devices[0]` against an empty device list so a
  programmatic `device=None` exits cleanly (exit 2) instead of raising an
  unguarded IndexError that bypasses the command-wide error handling.
- For `ep=auto` + `device=all`, resolve the best available EP per device
  rather than picking one EP from a single ref device and fanning it across
  unrelated devices. Add an auto-all case to test_selection_matrix.
…anup

Address PR #922 review feedback:

- WINMLCLI_RULES_DIR / WINMLCLI_RULES_DIR_FOR_DEBUG now resolve a single
  directory and are no longer split on os.pathsep. This removes the
  half-supported multi-dir behavior where only the first listed directory was
  ever probed, making rule lookup deterministic with no surprising fallback.
- Update docstrings, the rules README, and the CHANGELOG migration note to
  match the single-directory semantics; refresh tests accordingly.
- In _load_parquet_rule_table, drop the resolved_parquet_path temporary and
  check parquet_path.exists() only after the cache-hit early return (avoids a
  filesystem probe on every cache hit). Document that the per-instance cache
  assumes the rule-dir env vars are stable for the query's lifetime.
@fangyangci fangyangci enabled auto-merge (squash) June 22, 2026 09:20

@DingmaomaoBJTU DingmaomaoBJTU left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up review of PR #922. Both previously flagged bugs in resolve_rule_parquet_path are addressed — Bug 1 via an explicit single-directory design, Bug 2 via an intentional semantic change (documented and tested). The cache warning is addressed with an explanatory comment. One minor note inline.

Comment thread src/winml/modelkit/analyze/utils/rule_loader.py
Comment thread src/winml/modelkit/analyze/utils/rule_loader.py
Comment thread src/winml/modelkit/analyze/core/runtime_checker_query.py

@DingmaomaoBJTU DingmaomaoBJTU left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All previously flagged bugs are addressed. Bug 1 (multi-dir search) is resolved by making single-directory support explicit — _get_env_rules_dir no longer splits on os.pathsep, and the README/CHANGELOG are updated. Bug 2 (for_debug fallback removal) is an intentional semantic change: when WINMLCLI_RULES_DIR_FOR_DEBUG is set, lookup returns the debug-dir candidate exclusively; this is documented, tested, and explained in the commit message. The cache warning is addressed with a comment and the parquet_path.exists() probe is correctly moved after the cache-hit return. The
ode_stable_key fix and tuple-reorder fix are correct and well-tested. LGTM.

@fangyangci fangyangci merged commit 77176b4 into main Jun 23, 2026
9 checks passed
@fangyangci fangyangci deleted the fangyangci/fixAnalyze_bugs branch June 23, 2026 02:45
fangyangci added a commit that referenced this pull request Jun 23, 2026
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.

2 participants