Expose song render failures
This commit is contained in:
parent
36ef9109c2
commit
03cd6007f8
5 changed files with 50 additions and 3 deletions
|
|
@ -237,6 +237,7 @@ static async Task SongScoreAsync(Dictionary<string, string> options)
|
|||
var script = await File.ReadAllTextAsync(scriptCopy, Encoding.UTF8);
|
||||
var timelinePath = Path.Combine(timelineRoot, $"{safeCandidateId}.csv");
|
||||
var dspPath = Path.Combine(candidateDir, "candidate.dsp");
|
||||
var failurePath = Path.Combine(audioDir, "render-failure.txt");
|
||||
|
||||
var candidateWav = Path.Combine(audioDir, "candidate.wav");
|
||||
var metrics = new List<SpeechScoreMetric>();
|
||||
|
|
@ -278,7 +279,9 @@ static async Task SongScoreAsync(Dictionary<string, string> options)
|
|||
verdict = "render-failed";
|
||||
evaluation = render is null
|
||||
? "Faust was not available to render this song candidate."
|
||||
: $"Faust render produced no samples. stderr: {render.Stderr}";
|
||||
: $"Faust render produced no samples. stdout: {render.Stdout} stderr: {render.Stderr}";
|
||||
await File.WriteAllTextAsync(failurePath, evaluation, Encoding.UTF8);
|
||||
artifacts.Add(Artifact("render-failure", failurePath));
|
||||
metrics.Add(new SpeechScoreMetric("render_failed", 1, 1));
|
||||
}
|
||||
else
|
||||
|
|
@ -311,6 +314,8 @@ static async Task SongScoreAsync(Dictionary<string, string> options)
|
|||
await File.WriteAllTextAsync(timelinePath, ProbeTimelineReport.ToCsv([]), Encoding.UTF8);
|
||||
verdict = "render-failed";
|
||||
evaluation = $"Candidate could not be parsed, lowered, or prepared for render: {ex.GetType().Name}: {ex.Message}";
|
||||
await File.WriteAllTextAsync(failurePath, evaluation, Encoding.UTF8);
|
||||
artifacts.Add(Artifact("render-failure", failurePath));
|
||||
metrics.Add(new SpeechScoreMetric("render_failed", 1, 1));
|
||||
metrics.Add(new SpeechScoreMetric("candidate_invalid", 1, 1));
|
||||
}
|
||||
|
|
@ -4748,6 +4753,24 @@ static string SongEvaluatorReport(SongChallenge challenge, IReadOnlyList<IpaTria
|
|||
builder.AppendLine(CultureInfo.InvariantCulture, $"| {result.CandidateId} | {result.Verdict} | {MetricValue(result, "log_mel_cosine"):0.######} | {MetricValue(result, "audio_score"):0.######} | {MetricValue(result, "musical_instrument_score"):0.######} | {MetricValue(result, "producer_musicianship_score"):0.######} | {MetricValue(result, "required_studio_docs_present"):0.######} | {MetricValue(result, "template_loop_risk"):0.######} | {MetricValue(result, "noise_percussion_risk"):0.######} | {MetricValue(result, "candidate_motion_coverage"):0.######} | {MetricValue(result, "candidate_first_second_energy_share"):0.######} | {MetricValue(result, "mode_collapse_risk"):0.######} | {MetricValue(result, "rms_ratio"):0.######} | {MetricValue(result, "centroid_ratio"):0.######} |");
|
||||
}
|
||||
|
||||
var failures = results
|
||||
.Where(result => result.Verdict.Equals("render-failed", StringComparison.OrdinalIgnoreCase))
|
||||
.ToArray();
|
||||
if (failures.Length > 0)
|
||||
{
|
||||
builder.AppendLine();
|
||||
builder.AppendLine("## Render Failure Details");
|
||||
foreach (var failure in failures)
|
||||
{
|
||||
var failureArtifact = failure.Artifacts.FirstOrDefault(artifact => artifact.Kind.Equals("render-failure", StringComparison.OrdinalIgnoreCase));
|
||||
builder.AppendLine($"- `{failure.CandidateId}`: {failure.EvaluationSummary}");
|
||||
if (failureArtifact is not null && !string.IsNullOrWhiteSpace(failureArtifact.Uri))
|
||||
{
|
||||
builder.AppendLine($" - failure_artifact: `{failureArtifact.Uri}`");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return builder.ToString();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -78,16 +78,24 @@ function Start-CodexAgentJob {
|
|||
}
|
||||
$args += "-"
|
||||
|
||||
Start-Job -Name $JobName -ArgumentList $CodexCommand, $args, $PromptPath, $LogPath -ScriptBlock {
|
||||
Start-Job -Name $JobName -ArgumentList $CodexCommand, $args, $PromptPath, $LogPath, $RepoRoot -ScriptBlock {
|
||||
param(
|
||||
[string]$JobCodexCommand,
|
||||
[string[]]$JobArgs,
|
||||
[string]$JobPromptPath,
|
||||
[string]$JobLogPath
|
||||
[string]$JobLogPath,
|
||||
[string]$JobRepoRoot
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Continue"
|
||||
New-Item -ItemType Directory -Force -Path (Split-Path -Parent $JobLogPath) | Out-Null
|
||||
$dotnetHome = Join-Path $JobRepoRoot ".dotnet_cli_home"
|
||||
$nugetHome = Join-Path $JobRepoRoot ".nuget_packages"
|
||||
New-Item -ItemType Directory -Force -Path $dotnetHome, $nugetHome | Out-Null
|
||||
$env:DOTNET_CLI_HOME = $dotnetHome
|
||||
$env:NUGET_PACKAGES = $nugetHome
|
||||
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = "1"
|
||||
$env:DOTNET_NOLOGO = "1"
|
||||
Add-Content -LiteralPath $JobLogPath -Value "[$([DateTimeOffset]::UtcNow.ToString("O"))] $JobCodexCommand $($JobArgs -join ' ')"
|
||||
Get-Content -LiteralPath $JobPromptPath -Raw | & $JobCodexCommand @JobArgs 2>&1 | Tee-Object -FilePath $JobLogPath -Append
|
||||
[pscustomobject]@{
|
||||
|
|
|
|||
Loading…
Reference in a new issue