Skip to content

kani-driver needs its own notion of Kani Metadata #1758

Closed

Description

@tedinski

We handle metadata in three places:

  1. In kani-compiler, we accumulate metadata in the GotoCtx. We then translate this into:
  2. In kani_metadata, we record the "file format" for Kani metadata. We then read this into:
  3. In kani-driver, we then apply a "merge" operation to produce one overall metadata structure.

This last step is an inappropriate hack. It "worked" when metadata consisted of nothing but a flat array of proof harnesses. But now we want richer structure allowing us to aggregate this information better.

Further, that was (maybe) never even the right behavior because it meant we accumulated together all proof harnesses from dependencies as well, when we really only care about the "main crate" we're building.

The solution is to define our own metadata data types in kani-driver and compute them from the flat serialization format from kani_metadata. (Though we might even want to put these types in kani_metadata, since they'd be generally usable functions for consuming this information...)

Activity

  1. celinval commented on Oct 6, 2022

    @celinval
    Contributor

    I have two questions about the description:

    1. Are you talking about the entire metadata or just the harness metadata?
    2. What do you mean by "we record the file format"?

    Further, that was (maybe) never even the right behavior because it meant we accumulated together all proof harnesses from dependencies as well, when we really only care about the "main crate" we're building.

    Yes, I don't think merging was the correct way here. I would strongly prefer if we don't have different notions of metadata format. This will likely cause some confusion.

  2. celinval commented on Oct 6, 2022

    @celinval
    Contributor

    BTW, #1 might not be clear, but I'm thinking about the vtable metadata. Note that with MIR Linker, there will be only one relevant metadata file.

  3. tedinski commented on Oct 7, 2022

    @tedinski
    ContributorAuthor

    Ooh, good point, mir linker will change how metadata is collected.

    So originally I was just thinking this was an internal problem for kani-driver, but that might mean there are implications for kani_metadata too.

  4. added
    [C] Internal
    on Nov 14, 2022
  5. feliperodri commented on Nov 5, 2026

    @feliperodri
    Member

    Closing: fixed in 5b6700e; kani-driver/src/project.rs; kani-driver/src/list/collect_metadata.rs. Reopen with a minimal repro if it still happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [C] Internal

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions