Skip to content

Commit 74f886e

Browse files
author
MStarRobotics
committed
Split Linux profile and parser DMD binaries
1 parent 4396142 commit 74f886e

2 files changed

Lines changed: 76 additions & 7 deletions

File tree

.github/workflows/linux-gap-close.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ jobs:
107107
chmod +x linux_gap_close.sh
108108
./linux_gap_close.sh \
109109
--python-bin ./.venv/bin/python \
110-
--dmd-bin "$THREADED_DMD"
110+
--profile-dmd-bin ./.locald/dmd-nightly/linux/bin64/dmd \
111+
--parser-dmd-bin "$THREADED_DMD"
111112
112113
- name: Run Linux parser comparison
113114
if: always()

linux_gap_close.sh

Lines changed: 74 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
55
PYTHON_BIN="${PYTHON_BIN:-$SCRIPT_DIR/.venv/bin/python}"
66
ARTIFACT_ROOT="${ARTIFACT_ROOT:-$SCRIPT_DIR/artifacts/linux_gap_close}"
77
DMD_BIN="${DMD_BIN:-$SCRIPT_DIR/.locald/dmd-nightly/linux/bin64/dmd}"
8+
PROFILE_DMD_BIN="${PROFILE_DMD_BIN:-$DMD_BIN}"
9+
PARSER_DMD_BIN="${PARSER_DMD_BIN:-$DMD_BIN}"
810
LDC2_BIN="${LDC2_BIN:-$SCRIPT_DIR/.locald/ldc-1.42.0/bin/ldc2}"
911
CLANG_BIN="${CLANG_BIN:-clang}"
1012
PARSER_THREADS="${PARSER_THREADS:-1,2,4,8}"
@@ -23,7 +25,9 @@ Runs Linux-focused closure for remaining "partial" items:
2325
Options:
2426
--python-bin <path> Python executable (default: .venv/bin/python)
2527
--artifact-root <path> Output root (default: artifacts/linux_gap_close)
26-
--dmd-bin <path> DMD binary for not_done_experiments profile/parser tasks
28+
--dmd-bin <path> Legacy default DMD binary for both profile/parser tasks
29+
--profile-dmd-bin <path> DMD binary for dmd_profile_compare
30+
--parser-dmd-bin <path> DMD binary for parser_incompiler_parallel
2731
--ldc2-bin <path> LDC2 binary path
2832
--clang-bin <path> Clang binary path
2933
--parser-threads <csv> Parser in-compiler thread counts (default: 1,2,4,8)
@@ -41,7 +45,14 @@ while [[ $# -gt 0 ]]; do
4145
case "$1" in
4246
--python-bin) PYTHON_BIN="$2"; shift 2 ;;
4347
--artifact-root) ARTIFACT_ROOT="$2"; shift 2 ;;
44-
--dmd-bin) DMD_BIN="$2"; shift 2 ;;
48+
--dmd-bin)
49+
DMD_BIN="$2"
50+
PROFILE_DMD_BIN="$2"
51+
PARSER_DMD_BIN="$2"
52+
shift 2
53+
;;
54+
--profile-dmd-bin) PROFILE_DMD_BIN="$2"; shift 2 ;;
55+
--parser-dmd-bin) PARSER_DMD_BIN="$2"; shift 2 ;;
4556
--ldc2-bin) LDC2_BIN="$2"; shift 2 ;;
4657
--clang-bin) CLANG_BIN="$2"; shift 2 ;;
4758
--parser-threads) PARSER_THREADS="$2"; shift 2 ;;
@@ -66,6 +77,16 @@ if [[ ! -x "$PYTHON_BIN" ]]; then
6677
exit 2
6778
fi
6879

80+
if [[ ! -x "$PROFILE_DMD_BIN" ]]; then
81+
echo "Profile DMD binary not executable: $PROFILE_DMD_BIN" >&2
82+
exit 2
83+
fi
84+
85+
if [[ ! -x "$PARSER_DMD_BIN" ]]; then
86+
echo "Parser DMD binary not executable: $PARSER_DMD_BIN" >&2
87+
exit 2
88+
fi
89+
6990
mkdir -p "$ARTIFACT_ROOT"
7091

7192
if ! command -v perf >/dev/null 2>&1; then
@@ -90,16 +111,63 @@ log "Step 2/4: Analyze release sweep"
90111

91112
log "Step 3/4: Linux not_done subset (dmd profile + in-compiler parser threading)"
92113
"$PYTHON_BIN" "$SCRIPT_DIR/not_done_experiments.py" \
93-
--out-dir "$NOT_DONE_DIR" \
94-
--tasks dmd_profile_compare,parser_incompiler_parallel \
95-
--dmd "$DMD_BIN" \
114+
--out-dir "$NOT_DONE_DIR/profile" \
115+
--tasks dmd_profile_compare \
116+
--dmd "$PROFILE_DMD_BIN" \
117+
--ldc2 "$LDC2_BIN" \
118+
--clang "$CLANG_BIN" \
119+
--task-timeout 900
120+
121+
"$PYTHON_BIN" "$SCRIPT_DIR/not_done_experiments.py" \
122+
--out-dir "$NOT_DONE_DIR/parser" \
123+
--tasks parser_incompiler_parallel \
124+
--dmd "$PARSER_DMD_BIN" \
96125
--ldc2 "$LDC2_BIN" \
97126
--clang "$CLANG_BIN" \
98127
--parser-threads "$PARSER_THREADS" \
99128
--parser-repeats "$PARSER_REPEATS" \
100129
--parser-file-count "$PARSER_FILE_COUNT" \
101130
--task-timeout 900
102131

132+
"$PYTHON_BIN" - "$NOT_DONE_DIR/profile/status.csv" "$NOT_DONE_DIR/parser/status.csv" "$NOT_DONE_DIR/status.csv" "$NOT_DONE_DIR/status.md" <<'PY'
133+
import csv
134+
import sys
135+
from pathlib import Path
136+
137+
profile_csv = Path(sys.argv[1])
138+
parser_csv = Path(sys.argv[2])
139+
out_csv = Path(sys.argv[3])
140+
out_md = Path(sys.argv[4])
141+
142+
rows = []
143+
fieldnames = set()
144+
for path in (profile_csv, parser_csv):
145+
if not path.exists():
146+
continue
147+
with path.open("r", encoding="utf-8") as handle:
148+
reader = csv.DictReader(handle)
149+
for row in reader:
150+
rows.append(row)
151+
fieldnames.update(row.keys())
152+
153+
ordered = ["task", "status", "task_key"] + sorted(k for k in fieldnames if k not in {"task", "status", "task_key"})
154+
with out_csv.open("w", newline="", encoding="utf-8") as handle:
155+
writer = csv.DictWriter(handle, fieldnames=ordered)
156+
writer.writeheader()
157+
for row in rows:
158+
writer.writerow({key: row.get(key, "") for key in ordered})
159+
160+
lines = [
161+
"# Linux not_done status",
162+
"",
163+
"| Task | Status | Task Key |",
164+
"|---|---|---|",
165+
]
166+
for row in rows:
167+
lines.append(f"| {row.get('task', '')} | {row.get('status', '')} | {row.get('task_key', '')} |")
168+
out_md.write_text("\n".join(lines) + "\n", encoding="utf-8")
169+
PY
170+
103171
log "Step 4/4: Build summary"
104172
"$PYTHON_BIN" - "$RELEASE_DIR" "$NOT_DONE_DIR" "$SUMMARY_FILE" <<'PY'
105173
import csv
@@ -114,7 +182,7 @@ summary_file = Path(sys.argv[3])
114182
latest_csv = release_dir / "latest20" / "results_raw.csv"
115183
compat_csv = release_dir / "compatible20" / "results_raw.csv"
116184
status_csv = not_done_dir / "status.csv"
117-
parser_speedup_csv = not_done_dir / "parser_incompiler_parallel" / "speedup.csv"
185+
parser_speedup_csv = not_done_dir / "parser" / "parser_incompiler_parallel" / "speedup.csv"
118186
119187
def count_ok_fail(path: Path):
120188
ok = fail = 0

0 commit comments

Comments
 (0)