Skip to content

feat(a16): real in-session benchmark capture and compare - #23

Open
Gift-Stack wants to merge 5 commits into
mainfrom
feat/a16-benchmark
Open

Gift-Stack wants to merge 5 commits into
mainfrom
feat/a16-benchmark

Conversation

@Gift-Stack

Copy link
Copy Markdown
Contributor

bench.listSnapshots and bench.compare were empty stubs — and the contract had no way to even create a run. A16 now has a real, self-contained benchmark engine built from the sandbox's own executed-transaction metrics (no dependency on @ton/sandbox/jest-reporter files, which need a Blueprint/Jest project).

What this does

  • New bench.capture method (contract + client + hook + both mocks in lockstep): snapshots real aggregates from the workspace's tx history — transactions, total/compute/action/storage fees, compute gas, message cells/bits, max tree depth. All money/gas as bigint→decimal strings.
  • bench.listSnapshots returns stored runs (newest first); bench.compare computes real per-metric diffs — deltaPct guarded for zero baselines, regression flagged only when a lower-is-better metric grew.
  • BenchmarkPanel gets a capture bar; existing run-vs-baseline pickers + delta table now work against real data.
  • Fixed a field-name bug found during verification: action phase message size is totalMessageSize in @ton/core 0.63 (totalMsgSize doesn't exist), which had cells/bits reading 0.

Verification

  • pnpm tsc green; bridge smoke ALL OK.
  • Live check (1 send → baseline; +1y, 3 sends → current): all 9 metrics real and non-zero — e.g. total fees 280757→1903107 (+577.84%, regression), compute gas 2246→8984 (+300%, regression), storage fees 0→779546 (regression), tree depth 2→2 (0%, not flagged). deltaPct math and regression flags script-asserted.

This branch has not been deployed

No deployments
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.

1 participant