feat(mollusk): execute a BenchPlan for real compute units#9
Closed
MerlijnW70 wants to merge 2 commits into
Closed
Conversation
Wire the turnkey path end-to-end in the Linux-only cu-profiler-mollusk crate: `MolluskBackend::from_plan(plan, program_name)` converts a validated `BenchPlan` into Mollusk scenario setups — parsing each fixture's base58 program/account addresses and hex instruction/account data into `solana-instruction`/`solana-account` types — and meters real `compute_units_consumed`, feeding the existing report pipeline. Parsing happens once up front (fail-fast on malformed fixtures); a fresh Mollusk harness + Instruction is built per run. Pure helpers (decode_hex, parse_pubkey) and the plan->setup conversion are unit-tested, plus an end-to-end test that runs the demo .so from a declarative plan and asserts real metered CU. This crate is workspace-detached (Solana/SBF stack, not buildable on Windows), so it is verified by the Linux SBF CI job, not the local gate. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add `run_plan(plan, program_name) -> Report` tying a validated BenchPlan through MolluskBackend + the core Profiler into a Mollusk-tagged report, and a thin Linux-only `cu-profiler-bench` binary that reads bench.toml, runs it, and renders the report. This completes the turnkey path as a *separate* binary in the detached crate, deliberately NOT a feature-gated dependency of the main CLI — the core/CLI stay Solana-free and Windows-buildable (the project invariant). run_plan is covered by an end-to-end test that meters the demo .so from a declarative plan. Verified by the Linux SBF CI job (the crate does not build on the local Windows gate). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Stacked on #8 (depends on
cu_profiler_core::bench::BenchPlan). The Feature-3 follow-up: completes the turnkey real-CU path at the library level.What
MolluskBackend::from_plan(plan, program_name)builds a live execution backend straight from a validatedBenchPlan:solana-instruction/solana-accounttypes (fail-fast, once, up front);Molluskharness +Instructionis built per run;compute_units_consumed, which flows through the existing canonical-log → parser → report pipeline.No hand-written harness — a declarative
bench.tomlin, real metered CU out.Verification boundary (important)
This lives in the workspace-detached, Linux-only
cu-profiler-molluskcrate (the Solana/SBF stack does not build on Windows, where the local grade-A gate runs). I therefore could not compile it locally — it is verified by the Linux SBF CI job, not the local gate. The pure helpers (decode_hex,parse_pubkey) and the plan→setup conversion are unit-tested, plus an end-to-end test that runs the demo.sofrom a declarative plan and asserts real metered CU.If the SBF CI job flags a Solana-API mismatch I'll iterate on it.
Not yet wired
Making
cu-profiler bench(the CLI from #8) call this on Linux needs a feature-gated CLI dependency on the detached crate — a separate step. This PR delivers the library API + tests.🤖 Generated with Claude Code