|
| 1 | +--- |
| 2 | +name: triage-issue |
| 3 | +description: > |
| 4 | + Triage an OpenROAD GitHub issue by reproducing the bug and |
| 5 | + minimizing the test case with whittle.py. Use when an issue |
| 6 | + has an attached tarball artifact (.tar.gz) from `make *_issue`. |
| 7 | +argument-hint: <issue-number> |
| 8 | +--- |
| 9 | + |
| 10 | +# Triage OpenROAD Issue |
| 11 | + |
| 12 | +You are triaging OpenROAD issue **$ARGUMENTS**. |
| 13 | + |
| 14 | +## 1. Fetch issue details |
| 15 | + |
| 16 | +```bash |
| 17 | +gh issue view $ARGUMENTS --repo The-OpenROAD-Project/OpenROAD \ |
| 18 | + --json title,body,labels,state,comments |
| 19 | +``` |
| 20 | + |
| 21 | +Look for: |
| 22 | +- Error string (e.g. `GPL-0305`, `GPL-0307`, `DRT-XXXX`) |
| 23 | +- Attached tarball URL (from `make *_issue`) |
| 24 | +- OpenROAD version the bug was reported against |
| 25 | + |
| 26 | +## 2. Download and extract artifact |
| 27 | + |
| 28 | +Download any `.tar.gz` attached to the issue body or comments. |
| 29 | +Extract into a working directory: |
| 30 | + |
| 31 | +```bash |
| 32 | +mkdir -p /tmp/triage-$ARGUMENTS |
| 33 | +cd /tmp/triage-$ARGUMENTS |
| 34 | +tar xzf <downloaded-tarball> |
| 35 | +cd <extracted-dir> |
| 36 | +``` |
| 37 | + |
| 38 | +## 3. Fix the run script |
| 39 | + |
| 40 | +The `run-me-*.sh` scripts from `make *_issue` often need two fixes: |
| 41 | + |
| 42 | +```bash |
| 43 | +# Add set -e to exit on error |
| 44 | +sed -i '2i set -e' run-me-*.sh |
| 45 | + |
| 46 | +# Add -exit so openroad exits after the tcl script |
| 47 | +sed -i 's/openroad -no_init/openroad -exit -no_init/g' run-me-*.sh |
| 48 | +sed -i 's/openroad -no_splash/openroad -exit -no_splash/g' run-me-*.sh |
| 49 | +``` |
| 50 | + |
| 51 | +## 4. Build OpenROAD |
| 52 | + |
| 53 | +Build from the OpenROAD source tree: |
| 54 | + |
| 55 | +```bash |
| 56 | +cd <path-to>/OpenROAD |
| 57 | +bazelisk build :openroad |
| 58 | +``` |
| 59 | + |
| 60 | +The binary is at `bazel-bin/openroad`. Export it: |
| 61 | + |
| 62 | +```bash |
| 63 | +export OPENROAD_EXE=$(pwd)/bazel-bin/openroad |
| 64 | +``` |
| 65 | + |
| 66 | +## 5. Reproduce the bug |
| 67 | + |
| 68 | +Run the step command and confirm the error string appears: |
| 69 | + |
| 70 | +```bash |
| 71 | +cd /tmp/triage-$ARGUMENTS/<extracted-dir> |
| 72 | +./run-me-*.sh 2>&1 | tee reproduce.log |
| 73 | +grep -c "<error-string>" reproduce.log |
| 74 | +``` |
| 75 | + |
| 76 | +If the bug does NOT reproduce with the latest OpenROAD, report this |
| 77 | +on the issue -- the bug may have been fixed. |
| 78 | + |
| 79 | +## 6. Run whittle.py |
| 80 | + |
| 81 | +```bash |
| 82 | +python3 <path-to>/OpenROAD/etc/whittle.py \ |
| 83 | + --error_string "<error-string>" \ |
| 84 | + --base_db_path <path-to>.odb \ |
| 85 | + --use_stdout --exit_early_on_error \ |
| 86 | + --step "./run-me-*.sh" \ |
| 87 | + --persistence 3 --multiplier 2 |
| 88 | +``` |
| 89 | + |
| 90 | +### Monitoring progress |
| 91 | + |
| 92 | +Watch the `[whittle]` lines. Key things to check: |
| 93 | + |
| 94 | +- **ETA growing?** The design may be too large for the current |
| 95 | + persistence level. Try `--persistence 1` for a coarse first pass. |
| 96 | +- **.odb size not shrinking?** The error may depend on most of the |
| 97 | + design. Try increasing `--multiplier`. |
| 98 | +- **Step timeout too long?** Use `--timeout 300` to cap each step |
| 99 | + at 5 minutes. |
| 100 | +- **After 5 minutes** of a step, whittle.py shows the tail of the |
| 101 | + step's log so you can see what it is doing. |
| 102 | + |
| 103 | +### When to abort |
| 104 | + |
| 105 | +- If after 20+ steps the .odb size has not changed, abort and try |
| 106 | + different parameters. |
| 107 | +- If the step itself takes >10 minutes, consider whether the error |
| 108 | + string is specific enough (avoid generic strings like "ERROR"). |
| 109 | + |
| 110 | +## 7. Upload results |
| 111 | + |
| 112 | +Create a new tarball with the whittled .odb: |
| 113 | + |
| 114 | +```bash |
| 115 | +cp whittle_base_result_*.odb <original-odb-path> |
| 116 | +tar czf whittled-$ARGUMENTS.tar.gz <extracted-dir>/ |
| 117 | +``` |
| 118 | + |
| 119 | +Comment on the issue with before/after stats: |
| 120 | + |
| 121 | +```bash |
| 122 | +gh issue comment $ARGUMENTS --repo The-OpenROAD-Project/OpenROAD \ |
| 123 | + --body "Whittled test case: original NNN insts -> MMM insts, \ |
| 124 | +.odb size: XXX MB -> YYY MB. Attached whittled tarball." |
| 125 | +``` |
| 126 | + |
| 127 | +Upload the tarball to the issue comment via the GitHub web UI |
| 128 | +(gh CLI does not support file attachments on comments). |
0 commit comments