Skip to content

Preserve unresolved function attributes in rewrite rules - #3191

Open
Justin Chu (justinchuby) wants to merge 1 commit into
mainfrom
justinchuby-rewrite-state-attribute-safety
Open

Justin Chu (justinchuby) wants to merge 1 commit into
mainfrom
justinchuby-rewrite-state-attribute-safety

Conversation

@justinchuby

Copy link
Copy Markdown
Collaborator

Reject attribute references in literal constraints without preventing variable-bound references from passing through replacements. Guard CastIdentity, Flatten2Reshape, and ReshapeReshape before reading unresolved attributes.

Regressions reproduce list-valued constraint crashes, erroneous Cast elimination with unknown input dtype, Flatten's axis crash, and unsafe Reshape replacement construction. They also cover multi-output candidate retries, reference-preserving rewrites, and successful/failed/successful reuse of the stateful Reshape rule.

Relates to #1442, #1563, and #2526. Literal multi-output constraint coverage also exists in #3168; no managed-cache framework is introduced.

Validation: 417 tests and 60 subtests passed; one existing skip. lintrunner -a clean.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.85%. Comparing base (f51083c) to head (a65e473).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3191      +/-   ##
==========================================
+ Coverage   73.77%   73.85%   +0.07%     
==========================================
  Files         270      270              
  Lines       33876    33967      +91     
  Branches     3243     3251       +8     
==========================================
+ Hits        24993    25086      +93     
+ Misses       7829     7827       -2     
  Partials     1054     1054              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant