Skip to content

Normalize input_constraints before computing case signature#23

Merged
xieofxie merged 15 commits into
mainfrom
hualxie/update_serialization
Apr 1, 2026
Merged

Normalize input_constraints before computing case signature#23
xieofxie merged 15 commits into
mainfrom
hualxie/update_serialization

Conversation

@xieofxie

Copy link
Copy Markdown
Contributor

Summary

  • Calls normalize_constraint_dict on each input_constraints value in _compute_case_signature so that the compact same_value/same_value_shape representation (emitted by InputValueConstraint.to_dict() for uniform arrays) produces the same signature as the equivalent fully-expanded value list stored by older code.
  • Adds unit tests in tests/unit/analyze/test_check_ops.py constructed via real InputValueConstraint instances, covering backward-compatible signature stability and explicit verification that dict key insertion order has no effect (sort_keys=True).

Test plan

  • python -m pytest tests/unit/analyze/test_check_ops.py -v — 9 tests pass
  • test_all_same_value_array_compact_matches_expanded — compact vs expanded form produce same signature
  • test_key_insertion_order_does_not_affect_signature — dict key order has no effect
  • test_top_level_input_constraints_key_order_does_not_matter — input key ordering has no effect

🤖 Generated with Claude Code

@xieofxie xieofxie requested a review from a team as a code owner March 30, 2026 09:06
@xieofxie

Copy link
Copy Markdown
Contributor Author

So test cases for Where will save size and we could use large sizes

Comment thread src/winml/modelkit/pattern/op_input_gen/op_input_gen.py Outdated
Comment thread src/winml/modelkit/analyze/runtime_checker/check_ops.py
@xieofxie xieofxie enabled auto-merge (squash) April 1, 2026 05:47
@xieofxie xieofxie merged commit d436597 into main Apr 1, 2026
8 checks passed
@xieofxie xieofxie deleted the hualxie/update_serialization branch April 1, 2026 05:53
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.

3 participants