feat(bench): turnkey real-CU scaffolding — fixture schema + bench CLI#8
Merged
Conversation
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>
…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
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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 frombench.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/deployfor--program-name) or builds it withcargo 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-molluskto convert a validatedBenchPlanintosolana-instruction/solana-accounttypes, run it, and feed the real CU into the existing report pipeline — validated by the Linux SBF CI job.Tests / docs
benchCLI validate-and-summarise + invalid-plan-rejects are integration-tested (socket-free).bench.tomlschema; CHANGELOG updated.🤖 Generated with Claude Code