Skip to content
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

jkind subsumption #3525

Open
wants to merge 39 commits into
base: aspsmith/normalize-jkind
Choose a base branch
from
Open

Conversation

liam923
Copy link
Contributor

@liam923 liam923 commented Jan 29, 2025

Improve the implementation of Jkind.sub_jkind_l to give a proper subsumption check. The implementation is based on the rules in jane/doc/proposals/kind-inference.md. At the moment, this check is quadratic because we don't have a proper comparison function on types. But based on my anecdotal experience building and running tests, this doesn't seem to hurt performance too bad.

@liam923 liam923 requested a review from goldfirere January 29, 2025 19:46
@liam923 liam923 force-pushed the liam-jkind-subsumption branch 3 times, most recently from bf21eef to 8ff9303 Compare January 29, 2025 20:07
match decl.type_manifest, decl.type_kind with
| None, _ -> decl
| Some _, (Type_record _ | Type_record_unboxed_product _ | Type_variant _ | Type_open)
when not (Builtin_attributes.has_or_null_reexport decl.type_attributes)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Revisit this after rebase

Copy link
Collaborator

@goldfirere goldfirere left a comment

Choose a reason for hiding this comment

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

Partial review. More to come.

utils/misc.ml Outdated Show resolved Hide resolved
typing/types.mli Show resolved Hide resolved
typing/jkind.mli Outdated Show resolved Hide resolved
typing/jkind.mli Show resolved Hide resolved
@liam923 liam923 force-pushed the liam-jkind-subsumption branch from 2229bad to ee61b4c Compare January 31, 2025 22:35
@goldfirere
Copy link
Collaborator

Note to self: I've reviewed through "Promote tests" (except for the files that GitHub knows I haven't finished yet)

Copy link
Collaborator

@goldfirere goldfirere left a comment

Choose a reason for hiding this comment

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

A bunch more review. Still more to go! (I have not yet reviewed constraint.ml, fuel.ml, quality.ml, recursive.ml, or the main payload in jkind.ml.)

Copy link
Collaborator

@goldfirere goldfirere left a comment

Choose a reason for hiding this comment

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

All tests reviewed 🎉

@goldfirere
Copy link
Collaborator

After reviewing the tests, I'm pleased to report that I didn't spot any soundness bugs! 🔉 Now onto the actual implementation, which I can happily lower my level of scrutiny, as I'm pretty sure it's basically correct via the tests.

typing/jkind.ml Outdated Show resolved Hide resolved
typing/jkind.ml Show resolved Hide resolved
typing/jkind.ml Outdated Show resolved Hide resolved
typing/jkind.ml Show resolved Hide resolved
typing/jkind.ml Outdated Show resolved Hide resolved
typing/jkind.ml Outdated Show resolved Hide resolved
typing/jkind.ml Outdated Show resolved Hide resolved
@goldfirere
Copy link
Collaborator

OK. I have reviewed everything in this patch up to now. Looking pretty good!

@liam923 liam923 marked this pull request as ready for review February 3, 2025 13:32
@goldfirere
Copy link
Collaborator

I've reviewed commits up through "Improve subsumption comments"

@goldfirere
Copy link
Collaborator

Reviewed most recent commits.

@goldfirere
Copy link
Collaborator

Reviewed most recent commits.

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