fdbench

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package fdbench runs FD-Bench, the endpointing and timing suite.

Each conversation is a recording of a person speaking in several turns, with the exact sample offsets of every turn alongside it. Between turns there is a gap where a reply belongs. That makes three things measurable without a judge model and without any interpretation:

response latency  how long after a turn ends the agent starts speaking
prematurity       whether it started while the person was still talking
missed turns      whether it answered at all before the next turn began

Those three are in tension, which is the point of measuring them together. A system tuned for latency starts talking over people; one tuned to never interrupt waits so long that the conversation stops working. A single number would hide the trade, so this reports all three.

Index

Constants

View Source
const TimestampRate = 16_000

TimestampRate is the rate the released .timestamps offsets are expressed in. The prepared WAVs are 24 kHz, but the annotations retain the 16 kHz sample indices of FD-Bench's source audio. Treating those indices as 24 kHz compresses every turn to two thirds of its real position and scores agent audio against the wrong speaker turn.

Variables

This section is empty.

Functions

func Conditions

func Conditions(root string) ([]string, error)

Conditions lists what a dataset root contains, so a run can name its partition rather than guessing at one.

func Count

func Count(root string, conditions []string) (int, error)

Count reports how many conversations a set of conditions contains, which is what a cell's expected task count must be.

func Run

func Run(ctx context.Context, options Options) (bench.Result, error)

Run executes the suite.

Types

type Conversation

type Conversation struct {
	ID        string
	Condition string
	AudioPath string
	Turns     []Turn
}

Conversation is one recording and its annotations.

func Load

func Load(root string, conditions []string, limit int) ([]Conversation, error)

Load reads conversations from one or more conditions.

The dataset is partitioned by synthesiser, difficulty, and noise level, and those are not interchangeable: a result from the clean set says nothing about the 0 dB set. Conditions are therefore selected explicitly rather than merged.

func LoadSample added in v0.2.0

func LoadSample(root string, conditions []string, perCondition int, seed int64) ([]Conversation, error)

LoadSample reads perCondition conversations from each condition, chosen by a seeded shuffle of that condition's names so the sample is reproducible and not biased toward whatever sorts first. Conditions smaller than the sample are read whole.

type Options

type Options struct {
	Root       string
	Conditions []string
	Endpoint   string
	Token      string
	Model      string
	Cell       bench.Cell
	Limit      int
	// SamplePerCondition, when positive, replaces Limit with a seeded random
	// sample of this many conversations from each condition.
	SamplePerCondition int
	SampleSeed         int64
	// LatencyBudget is how long after a turn ends a reply may take before it
	// counts as late. Zero selects 2 s, which is roughly where a person starts
	// wondering whether the line dropped.
	LatencyBudget time.Duration
	Timeout       time.Duration
	// WaitConfigured starts each replay only after session.updated; see
	// bench.SessionConfig.WaitConfigured. Off keeps earlier campaigns comparable.
	WaitConfigured bool
	// Player replays with a client that stops and truncates cancelled
	// responses; see bench.SessionConfig.Player.
	Player   bool
	Progress func(string)
	// RuntimeAttestor captures exact graph execution evidence per conversation.
	RuntimeAttestor bench.RuntimeAttestor
	// Evidence receives every newly executed candidate conversation and exact
	// audio from the deterministic scorer's shared Realtime session.
	Evidence       candidate.Plugin
	EvidenceOrigin candidate.RunOrigin
	// Transcripts, when set, is a directory receiving one timed record per
	// conversation, together with the turn boundaries it was scored against.
	// It changes nothing about the score; it keeps the evidence the score was
	// derived from, so a premature start or a missed turn can be read back
	// against the audio instead of re-run.
	Transcripts string
}

Options configures a run.

type TranscriptRecord

type TranscriptRecord struct {
	Case          string            `json:"case"`
	Condition     string            `json:"condition"`
	Turns         []Turn            `json:"turns"`
	LatencyBudget float64           `json:"latency_budget_ms"`
	Outcome       bench.TaskOutcome `json:"outcome"`
	Transcript    bench.Transcript  `json:"transcript"`
}

TranscriptRecord is one conversation's timed record beside the annotations it was judged by, so a retained file can be read without the dataset.

type Turn

type Turn struct {
	StartMS float64
	EndMS   float64
	// AudibleEndMS is where the speech inside the turn actually stops, which
	// is earlier than EndMS by however much silence the synthesiser left. See
	// audible.go. It equals EndMS when nothing in the turn falls silent.
	AudibleEndMS float64
}

Turn is one span of user speech.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL