Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Profiling a workload

Akita ships one profile harness for complete PCS measurements. It runs the public statement preparation, setup, commitment, proof generation, encoding, and verification needed by a real opening proof. It also records the generated schedule and proof size breakdown.

Run the canonical profile

Run this command from crates/akita-pcs:

AKITA_MODE=onehot_fp128 AKITA_NUM_VARS=36 \
  cargo run --release --no-default-features \
  --features parallel,profile-onehot-fp128,transcript-blake2b \
  --example profile

This build contains only the adaptive fp128 one hot profile and its required protocol features. Schedule rows are loaded from the external artifact, while a narrow build keeps unrelated profile-mode monomorphizations out of the binary.

The harness requires --release. Set AKITA_ALLOW_DEBUG_PROFILE=1 only when debugging the harness itself.

What the default statement proves

onehot_fp128 commits to one multilinear polynomial with entries and opens it at one 36 coordinate point. The source stores one selected position in each 256 entry chunk.

The public statement proves commitment and opening consistency. One hot is the prover representation that lets Akita skip zero work. A host constraint system can prove the one hot property separately when its application needs that claim.

The admitted row from the external schedule artifact chooses the ring dimensions for the root and every later fold. The report prints the selected sequence. The application does not choose a fixed ring dimension for this run.

Read the main phases

The profile output separates these phases:

PhaseWork included
Statement preparationDeterministic witness, opening point, and expected value generation
Setup and preparationPublic setup construction and exact retained NTT prewarming
CommitCommitment to the source polynomial groups
ProveComplete opening proof generation
EncodeCompressed proof serialization and size accounting
VerifyReplay with the configured multi threaded verifier pool
Verify with one threadReplay of the same proof with one verifier worker

Statement preparation belongs to the harness, not the PCS. Use the named setup, commit, prove, encode, and verify phases for protocol comparisons.

Choose the workload

VariableDefaultMeaning
AKITA_MODEonehot_fp128Configuration and source representation
AKITA_NUM_VARS32Number of multilinear variables; use 36 for parity measurements
AKITA_NUM_POLYS1Number of polynomials in the final group
AKITA_PROFILE_PROVE_THREADSRayon defaultProver worker count
AKITA_PROFILE_VERIFY_THREADSProver countVerifier worker count
RAYON_NUM_THREADSRayon defaultFallback worker count

The compiled binary accepts only modes enabled by its feature set. An unknown mode prints the available names.

The repository also provides dense, small field, grouped, recursive setup, and multi chunk modes. Use the narrow feature that owns the selected mode when collecting numbers for comparison.

Record a Perfetto trace

Tracing is enabled by default for the profile harness.

VariableDefaultPurpose
AKITA_PROFILE_TRACE1Write a Chrome and Perfetto trace
AKITA_PROFILE_MONITOR1 when tracingRecord process CPU, host CPU, and memory counters
AKITA_PROFILE_MONITOR_INTERVAL_MS100Resource sampling interval in milliseconds
AKITA_PROFILE_LOGtraceConsole tracing filter
AKITA_PROFILE_ANSI1Colored terminal logs
AKITA_PROFILE_SPAN_CLOSES1Print span close events

The trace contains counters for effective CPU cores, CPU percentage, resident memory, virtual memory, and logical CPU count. One effective core means one core was busy for the complete sampling interval.

After writing the trace, the harness writes a sibling *.summary.json. The summary records the run identity, Git revision, exact peak resident memory, root wall time, CPU pool use, counter statistics, and time for every span label.

Inspect it without opening Perfetto:

jq '{run, root, peak_rss_gib, cpu_utilization}' \
  profile_traces/akita_nv36_onehot_fp128_*.summary.json
jq '.spans["AkitaCommitmentScheme::batched_prove"]' \
  profile_traces/akita_nv36_onehot_fp128_*.summary.json

The sampled memory line shows when memory changes. The exact process high water mark records the largest resident set even when a short peak falls between samples.

Compare thread policies

Set prover and verifier counts before the process starts. Rayon fixes its global pool during initialization.

A prover value of zero lets Rayon choose. A verifier value of zero reuses the resolved prover count. A positive verifier value creates a separate pool when the counts differ. The harness prints both resolved counts.

Build without parallel to measure the same workload sequentially:

AKITA_MODE=onehot_fp128 AKITA_NUM_VARS=32 \
  cargo run --release --no-default-features \
  --features profile-onehot-fp128,transcript-blake2b \
  --example profile

Measure response model data

Normal profile runs measure the production prover path. Response model calibration adds full witness scans, so enable it explicitly for those runs:

AKITA_MODE=onehot_fp128 AKITA_NUM_VARS=32 \
  cargo run --release --no-default-features \
  --features parallel,profile-onehot-fp128,transcript-blake2b,response-model-diagnostics \
  --example profile

This mode records exact source and response energies, planned caps, accepted nonces, and attempt counts. Those additional scans change prover work, so keep their results separate from normal performance measurements.

Continue the analysis