Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
audio_artifacts.hpp File Reference

JSON metrics artifacts for failing render scenarios (harness PR 1B). More...

#include "audio_metrics.hpp"
#include <filesystem>
#include <string>
#include <string_view>

Go to the source code of this file.

Namespaces

namespace  pulp
namespace  pulp::test
namespace  pulp::test::audio

Functions

std::string pulp::test::audio::metrics_to_json (const BufferMetrics &metrics, std::string_view scenario)
 Serialize metrics to a JSON string.
std::filesystem::path pulp::test::audio::write_metrics_artifact (const BufferMetrics &metrics, std::string_view scenario)
 Write metrics_to_json() to <temp>/pulp-audio-metrics/<sanitized-scenario>.json (overwriting any previous run's artifact for the same scenario) and return the path.

Variables

constexpr std::int64_t pulp::test::audio::kMetricsArtifactSchemaVersion = 1
 Current artifact schema version.

Detailed Description

JSON metrics artifacts for failing render scenarios (harness PR 1B).

When a scenario assertion fails, the test writes the analyzed BufferMetrics as a JSON document so a failing local/CI run leaves a machine-readable record of what the signal actually looked like (peak/RMS/DC/NaN/clipping per channel) without re-running the render. Serialized via choc::value + choc::json (CHOC-first policy). The schema carries a schema_version field plus scenario provenance so downstream tooling can evolve without guessing.