Profile exports for the transaction kernel (1/2)#2391
Draft
huitseeker wants to merge 13 commits intonextfrom
Draft
Profile exports for the transaction kernel (1/2)#2391huitseeker wants to merge 13 commits intonextfrom
huitseeker wants to merge 13 commits intonextfrom
Conversation
9df7700 to
6313753
Compare
Add Cargo.lock changes from adding chrono dependency to bench-transaction for VM profile timestamp functionality.
Replace .unwrap() calls with .expect() in: - bin/bench-note-checker/benches/benchmarks.rs:25 - bin/bench-transaction/src/time_counting_benchmarks/prove.rs:39, 58, 91, 115
Add the VM profile exported from bench-transaction for use in miden-vm synthetic benchmarks.
Add detailed operation information to the VM profile for synthetic benchmark generation. This includes: - OperationDetails struct with op_type, input_sizes, iterations, cycle_cost - Profile export populates operation_details based on instruction mix - Supports falcon512_verify, hperm, hmerge, load_store, arithmetic, control_flow Fixes for realistic workload generation: - Apply minimum iteration counts only when total_cycles >= 10000 - Use MIN_MIX_RATIO (0.1%) threshold to avoid floating-point noise - Only include operations with meaningful mix ratios Added tests: - deserialize_profile_without_operation_details: backward compatibility - deserialize_profile_with_operation_details: forward compatibility - operation_details_consistent_with_total_cycles: cycle validation - tiny_workload_no_minimum_inflation: small workload handling Enables the synthetic-tx-kernel benchmark to generate realistic workloads matching the instruction mix from real transaction profiles.
Adjusted the instruction-mix handling and minimum-iteration logic to avoid inflating low ratios, and added a write-path test to assert `write_vm_profile` emits real `operation_details`. Changes are localized to `bin/bench-transaction/src/cycle_counting_benchmarks/utils.rs`. Changes: - Normalize instruction mix when the sum drifts beyond tolerance to keep cycle budgeting consistent. - Gate minimum iteration bumps so very small raw counts don’t get inflated. - Add a `write_vm_profile` serialization test to validate exported `operation_details`.
58746c8 to
d48ecf0
Compare
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.
Companion PR of 0xMiden/miden-vm#2638
This tackles 0xMiden/miden-vm#2256
This branch makes the transaction kernel benchmark the single source of truth for performance, as discussed in issue above. It adds a VM profile export path in
bench-transaction, defines the profile schema, and writes a concrete JSON profile from real kernel runs so the workload can be reused outside the protocol stack. The profile includes instruction mix and operation details derived from measured cycles, and tests exercise the write path so ratio extraction keeps working as the kernel evolves.Workflow across repos:
benches/synthetic-tx-kernel/profilesin miden-vm.