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

Bug Report - Wrong External Function ID Generation in Caiman Assembly #86

Open
meredithmhu opened this issue Feb 29, 2024 · 0 comments
Open

Comments

@meredithmhu
Copy link
Contributor

meredithmhu commented Feb 29, 2024

Previously, before rebasing, an implementation of a benchmark containing two external functions (so more than one external function) failed to compile. This was because Caiman Assembly seemed to misassociate the external function name identifiers with their IDs in the AST. When the references to the names were called, there was an external function ID mismatch, and scheduling.rs wanting the correct external ID could not find the external ID it was looking for.

See screenshot below:
image

This error says that an assertion in scheduling.rs failed. I lost the –explicate_only output unfortunately, but basically, Caiman was not assigning the correct external function IDs to my two external functions, so the file kept failing to compile even though I made the correct references to their function names in my assembly and rust files:

[specification]
Screen Shot 2024-02-29 at 1 46 08 PM

[implementation]
Screen Shot 2024-02-29 at 1 46 31 PM

Currently the function compiles with the external function headers specified out-of-order like this:
Screen Shot 2024-02-29 at 1 34 36 PM

Switching the headers makes it compile the same way.
Screen Shot 2024-02-29 at 1 34 52 PM

Explicate only reveals that the function classes ARE correctly assigned (with sub and mult having different external function IDs).
Screen Shot 2024-02-29 at 1 35 21 PM

This new version of explicate-only is much better in terms of what it specifies and how readable the notation is because of the extra markings! The calls to local-do-external being made in the scheduling language call the correct external function
Screen Shot 2024-02-29 at 1 35 48 PM

An explanation of why this happened would be much appreciated! Although it seems like an issue that has been fixed in the latest main, since this issue went away after rebasing.

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

No branches or pull requests

1 participant