Skip to content

Commit 484ae15

Browse files
unnawutclaude
andcommitted
workloads: rename runner-rust to workloads and flatten crate layout
Drop the workspace-with-one-member structure. The Rust binary is now a single-package crate at workloads/, package name lean-bench-workloads. Updates Python orchestrator paths, build.rs (no more pop-pop to find the manifest), README layout, .gitignore, and stray comments. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c65a0b6 commit 484ae15

11 files changed

Lines changed: 25 additions & 49 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/runner-rust/target
1+
/workloads/target
22
Cargo.lock.local
33
*.swp
44
.DS_Store

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ leanBench/
181181
│ ├─ bench.py invokes binary, samples resources, writes JSON
182182
│ ├─ sysinfo.py CPU / RAM / OS detection + fingerprint
183183
│ └─ sampler.py psutil-based CPU/memory polling
184-
├─ runner-rust/ Rust workload binary
184+
├─ workloads/ Rust binary, one subcommand per workload → JSON stdout
185185
│ ├─ Cargo.toml pins leanSig + leanMultisig SHAs
186-
│ └─ crates/lean-bench-runner/ one subcommand per workload → JSON stdout
186+
│ └─ src/main.rs workload dispatch + per-sample timing
187187
├─ scripts/
188188
│ ├─ build_index.py scans results/*.json → results/index.json (CI)
189189
│ └─ dev_server.py live-reload preview (uv run serve)

runner-rust/crates/lean-bench-runner/Cargo.toml

Lines changed: 0 additions & 23 deletions
This file was deleted.

runner/bench.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def select_workloads(args) -> list[tuple[str, str, int | None]]:
103103
]
104104

105105

106-
RUST_DIR = ROOT / "runner-rust"
106+
RUST_DIR = ROOT / "workloads"
107107

108108

109109
def build_runner() -> Path:
@@ -120,17 +120,17 @@ def build_runner() -> Path:
120120
`.cargo/config.toml` — that config doesn't apply when leanMultisig is
121121
consumed as a git dep, so we set it here instead.
122122
"""
123-
print("Building lean-bench-runner (release)...", flush=True)
123+
print("Building lean-bench-workloads (release)...", flush=True)
124124
env = {**os.environ, "RUSTFLAGS": "-C target-cpu=native"}
125125
r = subprocess.run(
126-
["cargo", "build", "--release", "--bin", "lean-bench-runner",
126+
["cargo", "build", "--release", "--bin", "lean-bench-workloads",
127127
"--manifest-path", str(RUST_DIR / "Cargo.toml")],
128128
cwd=ROOT,
129129
env=env,
130130
)
131131
if r.returncode != 0:
132132
sys.exit("cargo build failed")
133-
return RUST_DIR / "target" / "release" / "lean-bench-runner"
133+
return RUST_DIR / "target" / "release" / "lean-bench-workloads"
134134

135135

136136
def run_workload(binary: Path, subcmd: str, samples: int, warmup: int) -> dict:

scripts/remote_bench.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,12 +410,12 @@ def _git(*args: str) -> str | None:
410410

411411
def _discover_signers_cache() -> Path | None:
412412
"""Find a local benchmark_signers_cache_<footprint>.bin matching the
413-
pinned leanMultisig SHA in runner-rust/Cargo.toml. The cache file is
413+
pinned leanMultisig SHA in workloads/Cargo.toml. The cache file is
414414
content-addressed by the hash of signer #0's pubkey, so it's stable
415415
across leanMultisig SHAs as long as the XMSS scheme params don't change
416416
— but we still narrow to the pinned-SHA checkout dir to avoid grabbing
417417
a stale file from an older Rust toolchain or build."""
418-
cargo_toml = Path("runner-rust/Cargo.toml")
418+
cargo_toml = Path("workloads/Cargo.toml")
419419
if not cargo_toml.is_file():
420420
return None
421421
text = cargo_toml.read_text()

site/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ async function renderRun() {
10561056
const t = rec.toolchain || {};
10571057
// GitHub `tree/<sha>` shows the working dir at that commit — better than
10581058
// `commit/<sha>` which shows just the diff. Both SHAs are pinned to the
1059-
// upstream leanEthereum repos via runner-rust/Cargo.toml.
1059+
// upstream leanEthereum repos via workloads/Cargo.toml.
10601060
const treeBase = (repo) => `https://github.com/leanEthereum/${repo}/tree/`;
10611061
const provEntries = [
10621062
["rustc", t.rustc, null],
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
[workspace]
2-
resolver = "2"
3-
members = ["crates/lean-bench-runner"]
4-
5-
[workspace.package]
1+
[package]
2+
name = "lean-bench-workloads"
63
version = "0.1.0"
74
edition = "2024"
85
rust-version = "1.87"
6+
resolver = "2"
7+
8+
[[bin]]
9+
name = "lean-bench-workloads"
10+
path = "src/main.rs"
911

10-
[workspace.dependencies]
12+
[dependencies]
1113
serde = { version = "1.0", features = ["derive"] }
1214
serde_json = "1.0"
1315
clap = { version = "4.5", features = ["derive"] }

runner-rust/crates/lean-bench-runner/build.rs renamed to workloads/build.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
use std::{env, fs, path::PathBuf};
66

77
fn main() {
8-
let workspace_cargo = workspace_root().join("Cargo.toml");
9-
println!("cargo:rerun-if-changed={}", workspace_cargo.display());
8+
let cargo_toml = manifest_dir().join("Cargo.toml");
9+
println!("cargo:rerun-if-changed={}", cargo_toml.display());
1010

11-
let Ok(text) = fs::read_to_string(&workspace_cargo) else { return };
11+
let Ok(text) = fs::read_to_string(&cargo_toml) else { return };
1212

1313
if let Some(rev) = find_rev(&text, "leansig") {
1414
println!("cargo:rustc-env=LEANSIG_SHA={rev}");
@@ -18,11 +18,8 @@ fn main() {
1818
}
1919
}
2020

21-
fn workspace_root() -> PathBuf {
22-
let mut p = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
23-
p.pop();
24-
p.pop();
25-
p
21+
fn manifest_dir() -> PathBuf {
22+
PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap())
2623
}
2724

2825
fn find_rev(text: &str, dep_name: &str) -> Option<String> {

runner-rust/crates/lean-bench-runner/src/main.rs renamed to workloads/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! lean-bench-runner — single binary that runs one workload per invocation
1+
//! lean-bench-workloads — single binary that runs one workload per invocation
22
//! and prints a JSON record of per-sample timings on stdout.
33
//!
44
//! The Python orchestrator wraps each invocation to sample CPU and memory,

0 commit comments

Comments
 (0)