fdb

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 13 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 fdb runs the Full-Duplex Bench overlap suite.

Every recording has the same shape: the user says something, the agent begins answering, and then a second event happens while the agent is still talking. What the agent should do about that second event is the whole test, and it differs by category:

user_interruption  the user takes the floor    → stop, and answer the new thing
user_backchannel   the user says "mm-hm"       → keep going
background_speech  someone else's speech       → keep going, do not respond
talking_to_other   the user addresses someone  → keep going, do not respond

Two of those want the agent to yield and two want it to hold, which is why a system that scores well by always yielding is not a system that handles overlap - and why this suite is worth running as four categories rather than one number.

Scoring is mechanical, from the timed record: whether the agent was making sound in the window after the event, and how quickly it stopped. No judge model is involved, so the numbers are reproducible and say exactly what they measured.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Breakdown

func Breakdown(result bench.Result) map[Category]CategorySummary

Breakdown summarises a result by category, because the four conditions want opposite behaviour and one number hides that.

func RecordingID

func RecordingID(taskID string) string

RecordingID strips the trial suffix a repeated run appends, so attempts of one recording group together. A single run has no suffix and is unchanged.

func Run

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

Run executes the suite.

func TranscriptFileName

func TranscriptFileName(caseID string) string

TranscriptFileName turns a case identifier into one path segment.

func WriteTranscript

func WriteTranscript(dir string, record TranscriptRecord) error

WriteTranscript records one attempt under dir, named after the case.

Types

type Category

type Category string

Category is one of the four overlap conditions.

const (
	Interruption     Category = "user_interruption"
	Backchannel      Category = "user_backchannel"
	BackgroundSpeech Category = "background_speech"
	TalkingToOther   Category = "talking_to_other"
)

func Categories

func Categories() []Category

Categories lists them in the order the report uses.

func (Category) ShouldYield

func (category Category) ShouldYield() bool

ShouldYield reports what the agent is supposed to do about the event.

type CategorySummary

type CategorySummary struct {
	Total         int     `json:"total"`
	Failed        int     `json:"failed"`
	NotApplicable int     `json:"not_applicable"`
	Applicable    int     `json:"applicable"`
	Passed        int     `json:"passed"`
	Rate          float64 `json:"rate"`
}

CategorySummary is one condition's reading.

NotApplicable is reported rather than folded in: those are recordings where the agent was not speaking when the event arrived, which says something about latency and nothing about overlap.

type Options

type Options struct {
	Root       string
	Endpoint   string
	Token      string
	Model      string
	Cell       bench.Cell
	Categories []Category
	// Limit bounds how many recordings run. A limited run is explicitly not a
	// complete cell, and the report says so.
	Limit int
	// Repeat is how many times each recording runs. Zero and one both mean
	// once, and leave every identifier exactly as a single run produces them.
	//
	// One attempt cannot classify a recording here. Two runs of the same forty
	// recordings against the same executable disagreed on five of them - a
	// recording moved from fail to pass, another from pass to fail, three
	// between failing and having nothing to overlap - while both runs reported
	// the same number of passes, so the category total looked settled while a
	// seventh of what it summed had moved. Every per-recording claim this suite
	// has ever made was sampled once. Repeats are how a defect is told from
	// noise, and Stability is how the answer is read.
	Repeat int
	// YieldWindow is how long the agent has to stop after an interruption
	// before it counts as not having stopped. Zero selects 1 s.
	YieldWindow time.Duration
	// HoldWindow is how long after a non-interruption event the agent is
	// expected to still be speaking. Zero selects 1 s.
	HoldWindow time.Duration
	Timeout    time.Duration
	Progress   func(string)
	// RuntimeAttestor captures exact graph execution evidence for each sample.
	RuntimeAttestor bench.RuntimeAttestor
	// Evidence receives only new candidate attempts and exact audio captured
	// from the same Realtime session used by the deterministic scorer.
	Evidence candidate.Plugin
	// EvidenceOrigin must explicitly identify a production or hermetic shared
	// endpoint whenever Evidence is configured.
	EvidenceOrigin candidate.RunOrigin
	// Transcripts, when set, is a directory receiving one timed record per
	// attempt. It changes nothing about how a run is scored; it keeps the
	// evidence a score is derived from, so a latency can be decomposed after
	// the fact instead of by rebuilding the server and running again.
	Transcripts string
}

Options configures a run.

type Sample

type Sample struct {
	ID        string
	Category  Category
	AudioPath string
	// ContextText is the user's first turn, the one the agent answers.
	ContextText string
	// EventText is what happens over the agent's answer.
	EventText string
	// EventStartMS and EventEndMS are when it happens, from the recording's
	// own annotations rather than from anything this harness detects.
	EventStartMS float64
	EventEndMS   float64
	// EventAudibleAfterMS is how long after EventStartMS the recording first
	// carries sound. See audible.go: the annotation says where the event clip
	// was placed, and the clip begins with whatever silence the speaker left.
	EventAudibleAfterMS float64
}

Sample is one recording.

func Load

func Load(root string, categories []Category, limit int) ([]Sample, error)

Load reads the dataset.

type Stability

type Stability struct {
	// Recordings is how many distinct recordings were attempted.
	Recordings int
	// Trials is the smallest number of attempts any recording received. One
	// means the run cannot say anything here, and Mixed will be zero because
	// nothing had the chance to disagree with itself.
	Trials int
	// AlwaysPassed, AlwaysFailed and AlwaysNotApplicable reached the same
	// verdict on every attempt.
	AlwaysPassed        int
	AlwaysFailed        int
	AlwaysNotApplicable int
	// Mixed reached more than one verdict. These are the recordings whose
	// single-run verdict means nothing, and their identities are kept because
	// the useful next step is to look at them rather than to count them.
	Mixed []string
}

Stability answers the question a single run cannot: is this recording's verdict a property of the system or of the afternoon.

Two runs of the same forty recordings against the same executable disagreed on five of them and reported the same number of passes, so the total looked settled while a seventh of what it summed had moved. A recording that passes every time and one that passes half the time are different facts, and an aggregate cannot tell them apart. Only a repeated run can, which is why this reads the attempts rather than the summary.

func Measure

func Measure(result bench.Result) Stability

Measure groups a result's attempts by recording and reports how consistent each one was.

type TranscriptRecord

type TranscriptRecord struct {
	Case         string   `json:"case"`
	Recording    string   `json:"recording"`
	Trial        int      `json:"trial"`
	Category     Category `json:"category"`
	EventStartMS float64  `json:"event_start_ms"`
	EventEndMS   float64  `json:"event_end_ms"`
	// EventAudibleAfterMS is how long after the annotation the event's speech
	// actually begins, which is where the scorer's windows open.
	EventAudibleAfterMS float64           `json:"event_audible_after_ms"`
	ShouldYield         bool              `json:"should_yield"`
	Outcome             bench.TaskOutcome `json:"outcome"`
	Transcript          bench.Transcript  `json:"transcript"`
}

TranscriptRecord is one attempt's timed record together with the annotation it was scored against, so the file can be read without the dataset beside it.

The graph execution evidence is deliberately dropped. It is fifty kilobytes of deployment identity per attempt, it is already carried in the result, and it says nothing about when anything happened.

Jump to

Keyboard shortcuts

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