fix(playback): report software scaler results and scope smoke ring diagnostics

The software-renderer fallback now reports which scaler options mpv
accepted and which it rejected (with mpv's error), instead of always
printing success. The smoke's black-canvas diagnostics read only the
failed session's rings (<sessionId>-g<N>), not every impv-fc ring in
/dev/shm.

Addresses Greptile review feedback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
4grayandClaude Opus 5.5 committed 2026-09-29 19:39:52 +02:00
1 parent 893c9d62a6
commit 6fc2b201ae
3 files changed
+20 -8

No files matched your search

@@ -20,7 +20,6 @@ import {
*/
const SHM_DIRECTORY = '/dev/shm';
const SHM_PREFIX = 'impv-fc-';
const FRAME_SHM_MAGIC = 0x564d5046;
const FRAME_SHM_RING_SLOTS = 3;
const HEADER_BYTES = 56 + FRAME_SHM_RING_SLOTS * 16;
@@ -103,10 +102,16 @@ export function describeFrameRing(
};
}
export function describeFrameRings(): FrameRingDiagnostics[] | string {
/**
* The helper names its rings `/<sessionId>-g<generation>`, so the prefix
* keeps stale or concurrent sessions out of the report.
*/
export function describeFrameRings(
sessionId: string
): FrameRingDiagnostics[] | string {
try {
return readdirSync(SHM_DIRECTORY)
.filter((entry) => entry.startsWith(SHM_PREFIX))
.filter((entry) => entry.startsWith(`${sessionId}-g`))
.map((entry) =>
describeFrameRing(
entry,
@@ -146,7 +151,7 @@ export async function expectRenderedFrame(
videoHeight: session.videoHeight,
stats: session.stats,
},
frameRings: describeFrameRings(),
frameRings: describeFrameRings(sessionId),
};
const body = JSON.stringify(diagnostics, null, 2);
console.log(`[frame-copy smoke diagnostics] ${body}`);
@@ -803,12 +803,19 @@ void applySoftwareRendererOptions(const std::set<std::string>& sessionKeys) {
{"dscale", "bilinear"},
{"sigmoid-upscaling", "no"},
};
std::string applied;
std::string failed;
for (const auto& [key, value] : kOptions) {
if (sessionKeys.count(key) == 0) {
mpv_set_property_string(g_state.mpv, key, value);
if (sessionKeys.count(key) != 0) continue;
const int result = mpv_set_property_string(g_state.mpv, key, value);
std::string& list = result < 0 ? failed : applied;
list += (list.empty() ? "" : ", ") + std::string(key) + "=" + value;
if (result < 0) {
list += std::string(" (") + mpv_error_string(result) + ")";
}
}
std::fprintf(stderr, "software renderer: using bilinear scalers\n");
std::fprintf(stderr, "software renderer: applied [%s]; failed [%s]\n",
applied.c_str(), failed.c_str());
}
struct HelperArgs {
+1 -1
View File
@@ -93,7 +93,7 @@ The Linux portable build uploads `packaged-frame-copy-smoke` reports and traces
even when the smoke fails. Check the paused-frame screenshot and trace before
classifying a zero rendered-frame signal as an infrastructure flake. A zero
signal also attaches `frame-copy-diagnostics` (the session's stream stats,
including mpv's drop counter, and each helper ring read from `/dev/shm`) and
including mpv's drop counter, and its helper rings read from `/dev/shm`) and
`mpv-log`, the session's verbose mpv log. A `latestSeq` of 0 means the helper
never published; a `latestFrameSignal` of 0 means mpv rendered black; a
visible ring frame behind a black canvas points at the preload pump.