-
Notifications
You must be signed in to change notification settings - Fork 0
Lead with an authenticated RTL CI transcript #3
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,32 @@ | ||
| { | ||
| "schema_version": "edge-ai-rtl-lab.ci-receipt.v1", | ||
| "repository": "Labeeb2339/edge-ai-rtl-lab", | ||
| "run_id": 30224621114, | ||
| "run_url": "https://github.com/Labeeb2339/edge-ai-rtl-lab/actions/runs/30224621114", | ||
| "commit": "6fd552b16f41dfa138c61f06aeb11ac26fb9acd8", | ||
| "created_at": "2026-07-26T23:08:54Z", | ||
| "conclusion": "success", | ||
| "regressions": [ | ||
| { | ||
| "command": "python tools/run_regression.py --sim iverilog --vec-len 1 --random-cases 40", | ||
| "summary": "Simulator: iverilog; vectors: 47 (7 corner + 40 deterministic random); seed: 0x5eed2339", | ||
| "result": "PASS: 47 vectors checked (VEC_LEN=1, OUT_W=16)" | ||
| }, | ||
| { | ||
| "command": "python tools/run_regression.py --sim iverilog --vec-len 8 --random-cases 200", | ||
| "summary": "Simulator: iverilog; vectors: 211 (11 corner + 200 deterministic random); seed: 0x5eed2339", | ||
| "result": "PASS: 211 vectors checked (VEC_LEN=8, OUT_W=16)" | ||
| }, | ||
| { | ||
| "command": "python tools/run_regression.py --sim iverilog --vec-len 17 --random-cases 100", | ||
| "summary": "Simulator: iverilog; vectors: 111 (11 corner + 100 deterministic random); seed: 0x5eed2339", | ||
| "result": "PASS: 111 vectors checked (VEC_LEN=17, OUT_W=16)" | ||
| } | ||
| ], | ||
| "synthesis": { | ||
| "command": "yosys -p 'read_verilog -sv -DSYNTHESIS rtl/int8_dot_product.sv; chparam -set VEC_LEN 8 int8_dot_product; hierarchy -check -top int8_dot_product; proc; opt; check -assert; stat'", | ||
| "tool": "Yosys 0.33 (git sha1 2584903a060)", | ||
| "result": "Found and reported 0 problems.", | ||
| "generic_cell_count": 36 | ||
| } | ||
| } |
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,98 @@ | ||
| #!/usr/bin/env python3 | ||
| """Rebuild the checked-in RTL CI receipt from an authenticated GitHub run log.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import argparse | ||
| import json | ||
| import re | ||
| import subprocess | ||
| from pathlib import Path | ||
|
|
||
| ROOT = Path(__file__).resolve().parents[1] | ||
| REPOSITORY = "Labeeb2339/edge-ai-rtl-lab" | ||
| DEFAULT_RUN_ID = 30224621114 | ||
|
|
||
|
|
||
| def _gh(*arguments: str) -> str: | ||
| completed = subprocess.run( | ||
| ["gh", *arguments], cwd=ROOT, check=True, capture_output=True, text=True | ||
| ) | ||
| return completed.stdout | ||
|
|
||
|
|
||
| def _payload(run_id: int) -> dict[str, object]: | ||
| metadata = json.loads( | ||
| _gh( | ||
| "run", | ||
| "view", | ||
| str(run_id), | ||
| "--repo", | ||
| REPOSITORY, | ||
| "--json", | ||
| "databaseId,headSha,status,conclusion,createdAt,url", | ||
| ) | ||
| ) | ||
| if metadata.get("status") != "completed" or metadata.get("conclusion") != "success": | ||
| raise SystemExit("the selected CI run is not a completed success") | ||
|
|
||
| log = _gh("run", "view", str(run_id), "--repo", REPOSITORY, "--log") | ||
| commands = re.findall( | ||
| r"Run (python tools/run_regression\.py --sim iverilog[^\r\n]+)", log | ||
| ) | ||
| summaries = re.findall(r"(Simulator: iverilog; vectors: [^\r\n]+)", log) | ||
| results = re.findall(r"(PASS: \d+ vectors checked \(VEC_LEN=\d+, OUT_W=\d+\))", log) | ||
| if not (len(commands) == len(summaries) == len(results) == 3): | ||
| raise SystemExit("could not recover the three expected regression records") | ||
|
|
||
| yosys_command_match = re.search(r"Run (yosys -p '[^\r\n]+')", log) | ||
| yosys_tool_match = re.search(r"(Yosys \d+\.\d+ \(git sha1 [^)]+\))", log) | ||
| yosys_result_match = re.search(r"(Found and reported \d+ problems\.)", log) | ||
| cell_count_match = re.search(r"Number of cells:\s+(\d+)", log) | ||
| if not all( | ||
| (yosys_command_match, yosys_tool_match, yosys_result_match, cell_count_match) | ||
| ): | ||
| raise SystemExit("could not recover the Yosys structural-check record") | ||
|
|
||
| return { | ||
| "schema_version": "edge-ai-rtl-lab.ci-receipt.v1", | ||
| "repository": REPOSITORY, | ||
| "run_id": metadata["databaseId"], | ||
| "run_url": metadata["url"], | ||
| "commit": metadata["headSha"], | ||
| "created_at": metadata["createdAt"], | ||
| "conclusion": metadata["conclusion"], | ||
| "regressions": [ | ||
| {"command": command, "summary": summary, "result": result} | ||
| for command, summary, result in zip( | ||
| commands, summaries, results, strict=True | ||
| ) | ||
| ], | ||
| "synthesis": { | ||
| "command": yosys_command_match.group(1), | ||
| "tool": yosys_tool_match.group(1), | ||
| "result": yosys_result_match.group(1), | ||
| "generic_cell_count": int(cell_count_match.group(1)), | ||
| }, | ||
| } | ||
|
|
||
|
|
||
| def main() -> None: | ||
| parser = argparse.ArgumentParser(description=__doc__) | ||
| parser.add_argument("--run-id", type=int, default=DEFAULT_RUN_ID) | ||
| parser.add_argument("--output", type=Path) | ||
| args = parser.parse_args() | ||
| output = args.output or ROOT / "evidence" / f"rtl-ci-run-{args.run_id}.json" | ||
| if not output.is_absolute(): | ||
| output = ROOT / output | ||
| output.parent.mkdir(parents=True, exist_ok=True) | ||
| output.write_text( | ||
| json.dumps(_payload(args.run_id), indent=2, sort_keys=False) + "\n", | ||
| encoding="utf-8", | ||
| newline="\n", | ||
| ) | ||
| print(f"wrote {output.relative_to(ROOT)}") | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
--outputis an absolute path outside the repository (for example, a temporary file used to compare a freshly captured receipt), the receipt is written successfully but this status message raisesValueErrorbecausePath.relative_to(ROOT)only accepts descendants ofROOT. This makes a valid-looking--outputinvocation exit nonzero after modifying the requested file; print the absolute path or fall back when it is outside the repository.Useful? React with 👍 / 👎.