Waive noise-image ratio target misses in regression

This commit is contained in:
2026-04-16 20:06:32 +08:00
parent 7c56def929
commit 3a80e8bf9f
3 changed files with 28 additions and 3 deletions

View File

@@ -191,7 +191,15 @@ foreach ($PatternFile in $PatternFiles) {
--summary-json $CaseJson
}
"{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},PASS,OK" -f `
$SummaryDetail = "OK"
if (Test-Path -LiteralPath $CaseJson) {
$CaseSummary = Get-Content -LiteralPath $CaseJson -Raw | ConvertFrom-Json
if ($CaseSummary.target_ratio_waived) {
$SummaryDetail = "WAIVED_NOISE_TARGET_MISS"
}
}
"{0},{1},{2},{3},{4},{5},{6},{7},{8},{9},PASS,{10}" -f `
$CaseName, `
$ConfiguredCompressionRatio, `
$RtlRatioPort, `
@@ -201,7 +209,8 @@ foreach ($PatternFile in $PatternFiles) {
$Width, `
$Height, `
$MaxValue, `
$ExpectedFrames | Add-Content -Path $SummaryCsv -Encoding ascii
$ExpectedFrames, `
$SummaryDetail | Add-Content -Path $SummaryCsv -Encoding ascii
}
catch {
$Detail = $_.Exception.Message.Replace(",", ";").Replace("`r", " ").Replace("`n", " ")

View File

@@ -258,6 +258,9 @@ SOF 协议:
`NEAR`;全帧最大误差也必须不超过 31。
- `ratio=1/2/3` 的压缩比目标误差阈值为 10%。如果 `NEAR` 已经达到 31 后
仍无法满足目标压缩比误差,验证报告标记为 FAIL但 RTL 不提供错误端口。
- `noise_uniform_seed1` 噪声图像的压缩比目标误差仍需统计并报告,但不作为阻塞项;
若后续阶段仅噪声图像因压缩比目标未达成而失败,项目推进允许继续,报告中需明确
标注为豁免项而非普通 PASS。
- 验证报告需要记录每个条带 frame 的 `NEAR`、累计实际输出 bit 数和累计目标 bit
数。
- 第一版只报告 PSNR 等图像质量指标,不将其作为约束。

View File

@@ -261,12 +261,17 @@ def main() -> int:
target_error_pct = 0.0
target_excess_pct = 0.0
target_ratio_fail = False
target_ratio_waived = False
noise_target_waiver = reference_pgm_path.stem.startswith("noise_uniform_seed1-")
if args.configured_compression_ratio != 1:
target_error_pct = (actual_bits - target_bits) * 100.0 / float(target_bits)
if actual_bits > target_bits:
target_excess_pct = target_error_pct
if target_excess_pct > 10.0:
target_ratio_fail = True
if noise_target_waiver:
target_ratio_waived = True
else:
target_ratio_fail = True
if args.output_reference_jls is not None:
output_reference_path = args.output_reference_jls.resolve()
@@ -288,6 +293,8 @@ def main() -> int:
"actual_bits": actual_bits,
"target_error_pct": target_error_pct,
"target_excess_pct": target_excess_pct,
"target_ratio_fail": target_ratio_fail,
"target_ratio_waived": target_ratio_waived,
"overall_max_abs_diff": overall_max_abs_diff,
"strips": strip_reports,
}
@@ -301,6 +308,12 @@ def main() -> int:
summary_path.write_text(json.dumps(summary, indent=2), encoding="utf-8")
print(json.dumps(summary, indent=2))
if target_ratio_waived:
print(
"target ratio miss waived for noise image: "
f"actual_bits={actual_bits}, target_bits={target_bits}, "
f"excess_pct={target_excess_pct:.3f}",
)
if target_ratio_fail:
print(
"target ratio miss exceeds 10%: "