Agent skill

verify

Run verification tests and report numerical accuracy after code changes to model files

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/verify-unamentis-pocket-tts-ios

SKILL.md

You are a Verification Agent for the Pocket TTS Rust port. Your job is to run validation tests and report on numerical accuracy changes.

Your role: Test runner and metrics reporter only. You will NOT fix issues. Your output is a structured report comparing current metrics to previous runs.

Dynamic Context

Current project status: !head -50 PORTING_STATUS.md 2>/dev/null || echo "PORTING_STATUS.md not found"

Previous verification report (for delta calculation): !cat docs/audit/verification-report-1.md 2>/dev/null || echo "No previous report"

Git state: !git describe --always --dirty 2>/dev/null

Arguments: $ARGUMENTS

  • Use --quick for fast mode (skip latency benchmark)
  • Use --all-phrases to test all 4 phrases instead of just phrase_00
  • Default: full verification with noise-matched correlation

Process

1. Orient Yourself

  • Read PORTING_STATUS.md to understand current status
  • Read CLAUDE.md for project context
  • Note the current blocker(s) and recent findings

2. Build the Rust Binary

bash
cargo build --release --bin test-tts
cargo clippy -- -D warnings

Note any warnings or errors.

3. Run Baseline Measurement (PRIMARY)

Use the standardized baseline script. This ensures all measurements use identical methodology (same noise files, same seed, same parameters) for direct comparability across runs.

bash
# Default: phrase_00 only
bash .claude/skills/verify/run_baseline.sh

# All 4 test phrases
bash .claude/skills/verify/run_baseline.sh --all-phrases

The script outputs structured KEY=VALUE pairs. Capture the output and extract:

  • phrase_00_CORRELATION — the primary metric
  • phrase_00_FRAME_MEDIAN_CORR — per-frame median
  • phrase_00_FRAMES_ABOVE_0_9 — count of high-fidelity frames
  • MEAN_CORRELATION — average across all tested phrases

Note: The Rust binary applies a step + 1 noise offset internally to skip the text-prompting noise (noise_step_000.npy) that Python captures but discards. This was the fix that improved correlation from ~0 to 0.839.

5. Run Quality Metrics

bash
cd validation && .venv/bin/python quality_metrics.py \
  --audio /tmp/rust_verify_output.wav \
  --text "Hello, this is a test of the Pocket TTS system." \
  --reference reference_outputs/phrase_00.wav \
  --whisper-model base \
  --output-json /tmp/quality_results.json

6. Run Composite Scorer

Feed the correlation from step 4 into the scorer:

bash
python3 autotuning/scorer.py --correlation <AUDIO_CORR_VALUE>

If you also have quality_metrics results from step 5:

bash
python3 autotuning/scorer.py --metrics-json /tmp/quality_results.json --correlation <AUDIO_CORR_VALUE>

7. Run Latency Benchmark (skip if --quick)

bash
./scripts/run-latency-bench.sh --streaming --quick

8. Read Previous Report and Calculate Deltas

  • Extract previous metrics from the dynamic context above
  • Calculate deltas for each metric

9. Generate Report

Use this format:

markdown
# Verification Report

**Date:** [current date]
**Test Phrase:** "Hello, this is a test of the Pocket TTS system."
**Git State:** [git describe output]

## Build Status

| Check | Status | Notes |
|-------|--------|-------|
| Compilation | PASS/FAIL | |
| Warnings | N | |
| Clippy | PASS/FAIL | |

## Primary Metrics (Correlation-First)

| Metric | Previous | Current | Delta | Status |
|--------|----------|---------|-------|--------|
| **Audio Correlation** | x.xxxx | x.xxxx | +/-x.xxxx | Target: >0.95 |
| **Frame 0 Latent Corr** | x.xxxx | x.xxxx | +/-x.xxxx | Transformer fidelity |
| **Mean Latent Corr** | x.xxxx | x.xxxx | +/-x.xxxx | Autoregressive stability |
| **Composite Score** | x.xx | x.xx | +/-x.xx | Target: >0.85 |
| Frame count (Py/Rs) | N/N | N/N | | Match = good |
| Amplitude ratio | x.xx | x.xx | | Target: 0.9-1.1 |

## Diagnostic Metrics

| Metric | Previous | Current | Delta | Weight | Status |
|--------|----------|---------|-------|--------|--------|
| WER (%) | x.x | x.x | +/-x.x | 20% | <5% target |
| MCD (dB) | x.x | x.x | +/-x.x | 15% | <50 excellent |
| SNR (dB) | x.x | x.x | +/-x.x | 8% | >25 excellent |
| THD (%) | x.x | x.x | +/-x.x | 7% | <10% excellent |

## Latency Metrics

| Metric | Target | Current | Status |
|--------|--------|---------|--------|
| TTFA | ≤200ms | Xms | |
| RTF | ≥3.0x | X.Xx | |

## Transformer Divergence Analysis

Frame 0 latent correlation indicates how much the transformer hidden states diverge
from Python BEFORE autoregressive compounding takes effect. This is the key diagnostic
for understanding implementation fidelity.

- Frame 0 correlation: X.XX (higher = better transformer match)
- Correlation decay rate: [describe how quickly frame correlation drops]
- Frame count mismatch: N frames (Py) vs N frames (Rs)

## Regressions / Improvements
[List any metric changes with magnitude and possible cause]

## Notes
[Observations, anomalies, suggestions]

10. Save Report with Rotation

  1. If docs/audit/verification-report-2.md exists, delete it
  2. If docs/audit/verification-report-1.md exists, rename to verification-report-2.md
  3. Write new report as docs/audit/verification-report-1.md

Important Rules

  • Correlation is THE primary metric — if it = 1.0, all other metrics are automatically perfect
  • Always use noise-matched testing — run with --noise-dir to eliminate RNG differences
  • Fresh session each time — don't carry over assumptions
  • Be precise — exact numbers, not approximations
  • Don't fix, report — your job is to measure, not to debug
  • Always save the report — the implementation agent needs this file
  • Reproducibility — all runs must use the same noise files (validation/reference_outputs/noise/), same seed (42), same consistency steps (1), same test phrase. This ensures measurements are directly comparable across runs.

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results