Repository navigation
Enable Lean consistency trace validation for remaining e2e tests #8927
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
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
cbdb7fe
Enable Lean consistency trace validation for remaining e2e tests
achamayou ffcc97e
Prefix LLVM_PROFILE_FILE for consistency-traced nodes
achamayou 173421c
Replay consistency traces in Replay e2e traces job
achamayou 37b6f34
Merge remote-tracking branch 'origin/main' into achamayou-turbo-waddle
achamayou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| #!/usr/bin/env python3 | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the Apache 2.0 License. | ||
| """Replay recorded consistency traces against the Lean model. | ||
|
|
||
| usage: consistency_trace_replay.py CONSISTENCY_REPLAY DIRECTORY... | ||
| """ | ||
|
|
||
| import concurrent.futures | ||
| import functools | ||
| import os | ||
| import pathlib | ||
| import subprocess | ||
| import sys | ||
|
|
||
|
|
||
| def replay(replayer, path): | ||
| result = subprocess.run( | ||
| [replayer, str(path)], | ||
| capture_output=True, | ||
| text=True, | ||
| check=False, | ||
| ) | ||
| output = ((result.stdout or "") + (result.stderr or "")).strip() | ||
| return result.returncode == 0, output | ||
|
|
||
|
|
||
| def main(replayer, *directories): | ||
| paths = sorted( | ||
| path | ||
| for directory in directories | ||
| for path in pathlib.Path(directory).rglob("*_consistency_trace/*.ndjson") | ||
| ) | ||
| with concurrent.futures.ThreadPoolExecutor(os.cpu_count()) as pool: | ||
| results = list(pool.map(functools.partial(replay, replayer), paths)) | ||
| rejected = 0 | ||
| for path, (accepted, output) in zip(paths, results, strict=True): | ||
| rejected += not accepted | ||
| print(f"{'OK ' if accepted else 'FAIL'} {path}: {output}") | ||
| print(f"{len(paths) - rejected} accepted, {rejected} rejected") | ||
| return 0 if paths and not rejected else 1 | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| if len(sys.argv) < 3: | ||
| sys.exit(__doc__) | ||
| sys.exit(main(*sys.argv[1:])) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.