Skip to content

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

@meredithmhu

Description

@meredithmhu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions