Skip to content

inference: apply tmerge limit elementwise to the Union (#50927) #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

kpamnany
Copy link
Collaborator

@kpamnany kpamnany commented Feb 10, 2025

PR Description

This allows forming larger unions, as long as each element in the Union is both relatively distinct and relatively simple. For example:

tmerge(Base.BitSigned, Nothing) == Union{Nothing, Int128, Int16, Int32, Int64, Int8}
tmerge(Tuple{Base.BitSigned, Int}, Nothing) == Union{Nothing, Tuple{Any, Int64}}
tmerge(AbstractVector{Int}, Vector) == AbstractVector

Disables a test from dc8d885, which does not seem possible to handle currently.

This makes somewhat drastic changes to make this algorithm more commutative and simpler, since we dropped the final widening to Any.

Checklist

Requirements for merging:

@kpamnany
Copy link
Collaborator Author

Doesn't fix the failure.

@kpamnany kpamnany closed this Feb 10, 2025
@kpamnany kpamnany deleted the kp-backport-50927 branch February 10, 2025 16:52
@kpamnany kpamnany restored the kp-backport-50927 branch April 15, 2025 18:51
@kpamnany kpamnany reopened this Apr 15, 2025
This allows forming larger unions, as long as each element in the Union
is both relatively distinct and relatively simple. For example:

    tmerge(Base.BitSigned, Nothing) == Union{Nothing, Int128, Int16, Int32, Int64, Int8}
    tmerge(Tuple{Base.BitSigned, Int}, Nothing) == Union{Nothing, Tuple{Any, Int64}}
    tmerge(AbstractVector{Int}, Vector) == AbstractVector

Disables a test from dc8d885, which does not seem possible to handle currently.

This makes somewhat drastic changes to make this algorithm more
commutative and simpler, since we dropped the final widening to `Any`.

Co-authored-by: pchintalapudi <34727397+pchintalapudi@users.noreply.github.com>
Co-authored-by: Oscar Smith <oscardssmith@gmail.com>
@kpamnany kpamnany force-pushed the kp-backport-50927 branch from 541e83b to f098f5c Compare April 15, 2025 18:53
@kpamnany kpamnany requested a review from Drvi April 15, 2025 18:56
Copy link

This PR is stale because it has been open 30 days with no activity. Comment or remove stale label, or this PR will be closed in 5 days.

@github-actions github-actions bot added the stale This pull request is inactive label May 16, 2025
@github-actions github-actions bot closed this May 21, 2025
@kpamnany kpamnany deleted the kp-backport-50927 branch June 27, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
port-to-master stale This pull request is inactive
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants