215 std::optional<int> reported_samples,
241 std::optional<int> reported_samples,
260 std::int64_t tolerance_samples = 0);
Deterministic offline signal metrics for rendered audio buffers.
Owning multi-channel audio buffer with contiguous storage.
Definition buffer.hpp:119
Definition audio_artifacts.hpp:20
LatencyObservationMode
How the report was watched while the render ran.
Definition latency_evidence.hpp:71
@ per_block_poll
Hosted slot: poll between blocks (no flag surface).
Definition latency_evidence.hpp:73
@ processor_flag_and_poll
Direct Processor: poll + the latency-changed flag.
Definition latency_evidence.hpp:72
@ none
Not watched.
Definition latency_evidence.hpp:74
constexpr int kLatencyEvidenceSchemaVersion
Schema version of the emitted object. Bump on any breaking field change.
Definition latency_evidence.hpp:274
LatencyReportObservation
Whether the report held still for the duration of the render.
Definition latency_evidence.hpp:64
@ unobservable
The surface offers no way to watch it.
Definition latency_evidence.hpp:67
@ changed
The value moved, or a change was flagged, mid-render.
Definition latency_evidence.hpp:66
@ stable
Same value at every observation point.
Definition latency_evidence.hpp:65
LatencyReportStatus
Whether a latency report could be read at all, and whether it was sane.
Definition latency_evidence.hpp:56
@ query_failed
The query was attempted and errored.
Definition latency_evidence.hpp:59
@ unsupported
This format/host cannot expose latency. NOT a zero.
Definition latency_evidence.hpp:58
@ available
A value was read. It may legitimately be zero.
Definition latency_evidence.hpp:57
@ invalid
A value was read but is nonsensical (e.g. negative).
Definition latency_evidence.hpp:60
std::string latency_evidence_summary(const LatencyEvidence &evidence)
One-line human summary, suitable for a test failure message.
const char * to_string(LatencyReportStatus status)
LatencyPolicy
The probe used to turn audio into a delay measurement.
Definition latency_evidence.hpp:78
@ marker_offset
The author declares a unique input marker and any intrinsic response offset (e.g.
Definition latency_evidence.hpp:88
@ none
Definition latency_evidence.hpp:79
@ delayed_passthrough_null
Compare the output against the input delayed by D, sweeping D.
Definition latency_evidence.hpp:84
LatencyMeasurementStatus
What the probe concluded.
Definition latency_evidence.hpp:92
@ mismatch
Measured delay disagrees with the report.
Definition latency_evidence.hpp:94
@ not_measurable
The response cannot pin a delay down. See reason.
Definition latency_evidence.hpp:95
@ not_requested
No measurement was asked for.
Definition latency_evidence.hpp:96
@ match
Measured delay agrees with the report, within tolerance.
Definition latency_evidence.hpp:93
LatencyEvidence measure_delayed_passthrough(const pulp::audio::Buffer< float > &input, const pulp::audio::Buffer< float > &output, std::optional< int > reported_samples, const DelayedNullOptions &options={})
Sweep the delay D that best explains output as a copy of input, and compare it against reported_sampl...
LatencyEvidence & apply_report_observation(LatencyEvidence &evidence)
Fold a report-observation fact into already-measured evidence.
LatencyEvidence measure_marker_offset(const pulp::audio::Buffer< float > &input, const pulp::audio::Buffer< float > &output, std::optional< int > reported_samples, const MarkerOffsetOptions &options={})
Measure delay as output_onset - input_marker - intrinsic_response_offset and compare it against repor...
LatencyContractOutcome
The gating verdict.
Definition latency_evidence.hpp:100
@ satisfied
Proven: the report matches the audio.
Definition latency_evidence.hpp:101
@ not_requested
Neutral — nothing was claimed, so nothing failed.
Definition latency_evidence.hpp:104
@ inconclusive
A measurement was requested but could not be drawn.
Definition latency_evidence.hpp:103
@ violated
Disproven: they disagree.
Definition latency_evidence.hpp:102
LatencyEvidence & apply_expected_samples(LatencyEvidence &evidence, int expected, std::int64_t tolerance_samples=0)
Additionally require the latency to equal expected, pinning the value rather than only its self-consi...
std::string latency_evidence_to_json(const LatencyEvidence &evidence)
Serialize evidence to a JSON object string.
Knobs for measure_delayed_passthrough.
Definition latency_evidence.hpp:184
double null_floor_db
The residual at the best delay must be at least this far below the input level for the output to coun...
Definition latency_evidence.hpp:192
double ambiguity_margin_db
The best delay must beat every non-adjacent competing delay by at least this margin.
Definition latency_evidence.hpp:196
std::int64_t max_delay_samples
Largest delay considered, in samples.
Definition latency_evidence.hpp:187
std::int64_t tolerance_samples
|measured - reported| may not exceed this and still be a match.
Definition latency_evidence.hpp:198
One processor's latency evidence: the facts, the measurement, the verdict.
Definition latency_evidence.hpp:108
std::string reason
Why the outcome is inconclusive, or why the measurement was not possible.
Definition latency_evidence.hpp:169
bool gates_failure() const
True when the evidence must fail a gate: a disproven report, or a measurement that was asked for and ...
Definition latency_evidence.hpp:175
std::int64_t tolerance_samples
How far |delta| may stray and still count as a match.
Definition latency_evidence.hpp:127
LatencyObservationMode observation_mode
Definition latency_evidence.hpp:117
std::optional< double > ambiguity_margin_db
How much worse the best COMPETING delay nulled, in dB — the winner's margin of victory.
Definition latency_evidence.hpp:150
std::optional< int > expected_samples
An optional INTENDED latency, independent of what the processor reports.
Definition latency_evidence.hpp:163
LatencyReportObservation report_observation
Definition latency_evidence.hpp:116
LatencyPolicy policy
Definition latency_evidence.hpp:120
LatencyMeasurementStatus measurement_status
Definition latency_evidence.hpp:121
std::optional< std::int64_t > measured_samples
The delay actually observed in the audio, in samples.
Definition latency_evidence.hpp:123
std::optional< double > null_depth_db
Residual level at the winning delay, relative to the input, in dB.
Definition latency_evidence.hpp:143
LatencyContractOutcome contract_outcome
Definition latency_evidence.hpp:166
std::optional< int > reported_samples
The report at the start of the render.
Definition latency_evidence.hpp:113
std::optional< std::int64_t > delta_samples
measured - reported. Null unless both are known.
Definition latency_evidence.hpp:125
LatencyReportStatus report_status
Definition latency_evidence.hpp:110
std::optional< int > final_reported_samples
The report at the end of the render, when observable.
Definition latency_evidence.hpp:115
Knobs for measure_marker_offset.
Definition latency_evidence.hpp:219
double onset_threshold
|sample| at or above this linear level counts as the onset.
Definition latency_evidence.hpp:228
std::int64_t intrinsic_response_offset
Delay the processor adds for reasons other than latency — e.g.
Definition latency_evidence.hpp:226
std::int64_t input_marker_frame
Frame of the marker in the input.
Definition latency_evidence.hpp:222
std::int64_t tolerance_samples
Definition latency_evidence.hpp:229