Skip to content

feat(bench): turnkey real-CU scaffolding — fixture schema + bench CLI#8

Merged
MerlijnW70 merged 3 commits into
mainfrom
feat/bench-scaffolding
Jun 21, 2026
Merged

feat(bench): turnkey real-CU scaffolding — fixture schema + bench CLI#8
MerlijnW70 merged 3 commits into
mainfrom
feat/bench-scaffolding

Conversation

@MerlijnW70

Copy link
Copy Markdown
Owner

Lands the locally-verifiable scaffolding for the turnkey real-CU path (roadmap item 3). The Solana/SBF stack does not build on Windows (where the local grade-A gate runs), so this PR contains only the host-buildable, gate-certified half; the live Mollusk execution is a focused follow-up the Linux SBF CI job validates.

What

  • cu_profiler_core::bench::BenchPlan — a declarative instruction/account fixture schema parsed from bench.toml (program id, hex instruction data, accounts with signer/writable/lamports/owner/data), with base58 + hex validation. Pure Rust, no Solana dependencies, builds everywhere the core does. Fully unit-tested.
  • cu-profiler bench — validates the plan, resolves the program .so (--program, else $SBF_OUT_DIR / target/deploy for --program-name) or builds it with cargo build-sbf (--build), and prints the prepared plan.

Why this split

Per the research, the measurement engine and report pipeline already exist; the hard part is expressing an instruction as data (the schema here) and the Windows-incompatible Solana execution. This PR delivers the schema + CLI surface + build orchestration — all gate-certifiable — and isolates the unverifiable-on-Windows Mollusk execution into the follow-up, rather than pushing blind execution code onto a public repo.

Follow-up (not in this PR)

Wire cu-profiler-mollusk to convert a validated BenchPlan into solana-instruction/solana-account types, run it, and feed the real CU into the existing report pipeline — validated by the Linux SBF CI job.

Tests / docs

  • Pure schema validation (base58/hex, unknown-key rejection, empty plan) and artifact-path resolution are unit-tested; bench CLI validate-and-summarise + invalid-plan-rejects are integration-tested (socket-free).
  • reference §15 documents the command and the bench.toml schema; CHANGELOG updated.
  • Local gate: grade A.

🤖 Generated with Claude Code

Land the locally-verifiable half of the turnkey real-CU path:

- `cu_profiler_core::bench::BenchPlan` — a declarative instruction/account
  fixture schema (program id, hex data, accounts) parsed from `bench.toml`,
  with base58 + hex validation. Pure Rust, no Solana deps, builds on every
  host the core targets; fully unit-tested.
- `cu-profiler bench` — validates the plan, resolves the program `.so`
  (`--program` / `$SBF_OUT_DIR` / `target/deploy`) or builds it with
  `cargo build-sbf` (`--build`), and reports the prepared plan.

The live Mollusk execution that converts a validated plan into real
compute units lives in the Linux-only `cu-profiler-mollusk` crate (the
SBF/Solana stack does not build on Windows, where the local gate runs),
and is the focused follow-up the SBF CI job validates. This commit is
fully gate-certified on the host.

Docs: reference §15 documents `bench` + the bench.toml schema; CHANGELOG.
Gate: grade A.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
intentos-dev and others added 2 commits June 21, 2026 16:09
…cutor

Close the gap where `cu-profiler bench` validated a plan but did not
measure. It now delegates real Mollusk measurement to the Linux
`cu-profiler-bench` executor over PATH (a runtime sibling, never a build
dependency — the main CLI stays Solana-free / Windows-buildable):

- with `--program-name`: run the executor and forward its result; if it
  is not installed, fail with the exact command to run (no silent
  half-measure);
- without `--program-name`: validate the plan and summarise (a lint run).

Dropped the unused `--program` flag and the now-redundant artifact
resolution. Integration tests cover validate-only, invalid-plan
rejection, and the clear error when the executor is absent. Docs §15 and
CHANGELOG updated. Gate: grade A.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
# Conflicts:
#	CHANGELOG.md
#	crates/cu-profiler-cli/src/args.rs
#	crates/cu-profiler-cli/src/main.rs
#	crates/cu-profiler-cli/tests/cli.rs
@MerlijnW70 MerlijnW70 merged commit 5c59ea6 into main Jun 21, 2026
4 checks passed
@MerlijnW70 MerlijnW70 deleted the feat/bench-scaffolding branch June 21, 2026 14:24
@MerlijnW70 MerlijnW70 mentioned this pull request Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants