Skip to content

Conversation

carolynzech
Copy link
Contributor

@carolynzech carolynzech commented Apr 17, 2025

Summary

  • fda814b: Make the autoharness filter flags work on the standard library by moving them to kani_compiler_flags, which ensures they're passed to all Kani compiler invocations.
  • c0430ec: Print the crate name in our output tables.
  • 093fc6b: Breaking Change to rename --include-function and --exclude-function to mention patterns instead, which makes it clearer that they talk about substrings of the total paths (e.g., modules). Also implement the suggestion from Autoharness Misc. Improvements #3922 (comment) so that the flags are no longer mutually exclusive.
  • 9e35fca: Let the above flags filter on crate names as well.
  • 66444e4: Warn if an exclude flag makes an include flag moot.

Detail

Some more context on why f933799c54b09210cb267963ff1dc431c7a9385a allows for both flags to be passed now: I realized as part of #3984 how when we call cargo rustc for a cargo kani invocation, we don't pass --reachability to dependencies to avoid running harnesses in them. The problem is that we can't do the same for our cargo command to build the standard library, since that uses cargo build, which does not have the same ability to pass flags only to the final compiler invocation and not the dependencies. So we end up passing --reachability=AllFns to the dependencies of the standard library as well and generate automatic harnesses for them. If we can pass both filter flags, we can run commands like kani autoharness --std --include-pattern core --exclude-pattern miniz_oxide, which will include functions from the core crate while excluding functions in the miniz_oxide that just happen to have the word "core" in them.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@github-actions github-actions bot added the Z-EndToEndBenchCI Tag a PR to run benchmark CI label Apr 17, 2025
@carolynzech
Copy link
Contributor Author

#4024 includes the changes required to include the crate name as part of kani autoharness --list; since that's really more of a list subcommand change than an autoharness change, I thought it was better in its own PR.

@carolynzech
Copy link
Contributor Author

carolynzech commented Apr 17, 2025

Leaving this PR in draft until I add a test for using --include and --exclude together (and update the book documentation to mention that this is possible), but I've done some local testing on the standard library and it's looking good.

@carolynzech carolynzech force-pushed the autoharness-filter-std branch 2 times, most recently from d62a6b9 to 58ad115 Compare April 17, 2025 17:24
@carolynzech carolynzech force-pushed the autoharness-filter-std branch from 58ad115 to 3a758ab Compare April 17, 2025 17:25
@carolynzech carolynzech marked this pull request as ready for review April 17, 2025 17:27
@carolynzech carolynzech requested a review from a team as a code owner April 17, 2025 17:27
@carolynzech carolynzech changed the title Autoharness: Filtering in the Standard Library Autoharness: Update Filtering Options Apr 17, 2025
@carolynzech carolynzech enabled auto-merge April 17, 2025 17:29
@carolynzech carolynzech added this pull request to the merge queue Apr 17, 2025
Merged via the queue into model-checking:main with commit 717e99d Apr 17, 2025
26 checks passed
@carolynzech carolynzech deleted the autoharness-filter-std branch April 17, 2025 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-EndToEndBenchCI Tag a PR to run benchmark CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants