Skip to content

Fix joins for row likes with incompatible kinds #139

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

Merged
merged 3 commits into from
Aug 5, 2021

Conversation

chambart
Copy link
Contributor

@chambart chambart commented Aug 4, 2021

Row_likes used to be only contain fields of kind value. This changed with ocaml-flambda/ocaml#396

Now a join can be performed between a float record and a block that contains fields of incompatible type (with some help from GADTs). This is ok most of the time since they come with different tags, but it is possible to build a row like of unknown tag with unannotated fields accesses. Those can only occur on standard blocks. Float records accesses always comes with annotated accesses.

So we can consider a new invariant for row likes:
If they contains fields of kinds other than value, the tag must be known. And no tag can be used for both value and non value contents.
If this ever end up being too restrictive (with changes to the language allowing new kinds of blocks), we could change row like tags to carry fields kinds

@mshinwell mshinwell added the flambda2 Prerequisite for, or part of, flambda2 label Aug 5, 2021
@mshinwell mshinwell merged commit fb37127 into oxcaml:main Aug 5, 2021
mshinwell pushed a commit that referenced this pull request Aug 6, 2021
* Revert "Temporary hack for bug in Row_like join (#137)"

This reverts commit c9591dc.

* Prevent joins between products of different kinds.

Row likes now have an assumption on fields kinds related to tags

* Add test for the problematic join
mshinwell added a commit to mshinwell/oxcaml that referenced this pull request May 1, 2023
e3076d2 Unboxed types v1 (oxcaml#139)
e68c72d update HACKING.jst.adoc (oxcaml#165)
6c5197b Merge pull request oxcaml#166 from mshinwell/merge-flambda-backend-2023-04-28
0c3dcf9 Fix for ocamldoc
09b9e1c Fix for -zero-alloc-check
71e5e07 Compilation fixes after merge
bf66257 Merge flambda-backend changes
a2556fc Add `[%exclave]` support (oxcaml#51)
ebe9576 Add data race freedom proposal (oxcaml#161)
3f3fc49 Merge pull request oxcaml#159 from riaqn/merge-backend
6c635dc minor changes after merge
99a0d85 Merge flambda-backend changes
2642463 Include the modes of values in debugging information (oxcaml#153)
4ecc8a4 Remove i386 CI check (oxcaml#155)

git-subtree-dir: ocaml
git-subtree-split: e3076d2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flambda2 Prerequisite for, or part of, flambda2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants