drawElement self-verify PSNR gate cannot detect missing low-contrast content
I maintainer di solito rispondono entro 1 giorno
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Describe the bug
The drawElement self-verify gate cannot detect a missing low-contrast element, because
PSNR is magnitude-weighted. An entire element can be absent from a rendered frame and
still score well above the pass threshold, so the damaged frame ships with a clean exit
code.
The gate is in packages/producer/src/services/render/stages/captureStreamingStage.ts:341:
db = await psnrDb(buf, truth);
...
if (db < verifyMinDb) { throw new DrawElementVerificationError(...) }
psnrDb takes FFmpeg's average: PSNR across components
(packages/engine/src/utils/psnr.ts:13), and verifyMinDb defaults to 32
(psnr.ts:43). PSNR falls as the magnitude of the difference grows. A whole element
that is merely low-contrast against its background produces a small magnitude over a
modest area, so it scores high and passes.
The failure mode this permits is the worst kind we can ship: a video that is wrong, with
no warning and exit code 0. High-contrast damage in the same frame is caught, which is
why this reads as "some elements render and some silently do not" rather than as a
general breakage.
Steps to reproduce
No project needed. This measures the gate itself against synthetic 4K frames, using the
same comparison psnrDb performs.
#!/usr/bin/env bash
set -uo pipefail
FF="${FF:-ffmpeg}"; W=/tmp/psnr; rm -rf $W; mkdir -p $W; cd $W
BG="0x12122E"; BAND=324 # 3840x324 = 1,244,160 px = 15.0% of a 4K frame
mkframe(){
if [ -z "$2" ]; then
$FF -v error -y -f lavfi -i "color=c=$BG:s=3840x2160:d=1" -frames:v 1 "$1"
else
$FF -v error -y -f lavfi -i "color=c=$BG:s=3840x2160:d=1" \
-vf "drawbox=x=0:y=900:w=3840:h=$BAND:color=$2:t=fill" -frames:v 1 "$1"
fi
}
cmp_psnr(){ $FF -hide_banner -i "$1" -i "$2" -lavfi psnr -f null - 2>&1 \
| grep -o 'average:[^ ]*' | head -1; }
mkframe truth.jpg ""
for spec in "0x161632:~4/255 luma delta" "0x1E1E42:~10/255 luma delta" \
"0x262556:~22/255 luma delta" "0xFFFFFF:white (control)"; do
col="${spec%%:*}"; label="${spec#*:}"
mkframe damaged.jpg "$col"
db=$(cmp_psnr damaged.jpg truth.jpg)
printf " %-26s %-20s %s\n" "$label" "$db" \
"$(awk -v d="${db#average:}" 'BEGIN{print (d+0>=32)?"PASSES 32 dB gate -> damage ships":"fails gate -> caught"}')"
done
truth.jpg is the background with the panel missing; damaged.jpg is the correct frame.
The PSNR between them is exactly what the gate computes when the panel fails to draw.
Expected behavior
A frame missing an entire visible element fails verification, regardless of that
element's contrast against its background.
Actual behavior
~4/255 luma delta average:44.141763 PASSES 32 dB gate -> damage ships
~10/255 luma delta average:35.739625 PASSES 32 dB gate -> damage ships
~22/255 luma delta average:31.063362 fails gate -> caught
white (control) average:10.743118 fails gate -> caught
An element covering 15% of a 4K frame can go completely missing and still score 44 dB,
12 dB clear of the floor. The gate only starts catching it somewhere around a 12/255
luma delta at that coverage, and the threshold moves with area: a smaller element needs
proportionally more contrast before the gate notices it is gone.
Two separate holes
1. The metric is wrong for the question. PSNR answers "how far off are these pixels
on average", but the gate is asking "did any content go missing". Those come apart
precisely when the missing content is low-contrast. Raising HF_DE_VERIFY_MIN_DB is not
a fix: 44 dB would need a floor above 44, which would then reject ordinary JPEG encoder
noise. A presence-sensitive check is needed instead, for example a per-region or
worst-block comparison rather than a whole-frame average, so a fully wrong region cannot
be averaged away by a correct background.
2. The gate does not run on most frames. It is guarded by
const truth = session.deVerifyFrames?.get(idx) (captureStreamingStage.ts:337), so
frames without a sampled truth image are not checked at all. Even damage severe enough
to fail the threshold ships if it lands on an unsampled frame.
Scope of what is proven here
This demonstrates that the verification gate is blind to this class of damage. It does
not explain why drawElement omits a low-contrast element in the first place. Those are
separate bugs, and this one is worth fixing on its own: without a gate that can see the
damage, the underlying drop stays invisible in production no matter what causes it.
Until the metric is fixed, it is worth considering whether the streaming path should
fail loudly rather than proceed when it cannot verify a frame, since a hard failure is
recoverable and a silently wrong deliverable is not.
Environment
FFmpeg 7.0.2-static (linux x64)
Node.js v22.22.2
Gate packages/engine/src/utils/psnr.ts resolveDeVerifyMinDb() default 32
Call packages/producer/src/services/render/stages/captureStreamingStage.ts:341
Also packages/engine/src/services/parallelCoordinator.ts:613 (same gate, disk path)
- Lingua principale
- TypeScript
- Stelle
- 54.1k
- Fork
- 4.9k
- Merge medio
- 7h 2m
- PR unite (30g)
- 782
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di heygen-com/hyperframes
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
heygen-com/hyperframes#5117 ·
I maintainer di solito rispondono entro 1 giorno
-
Docs: clarify that "Enable auto-update" is only available in the Claude Code terminal (CLI) /plugin UIForse già presa @rumi7911 l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
heygen-com/hyperframes#5027 ·
I maintainer di solito rispondono entro 1 giorno
-
fix(producer): propagate useGpu to HDR layered streaming encoderForse già presa @Monster-GM l’ha presa 3 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 87/100
heygen-com/hyperframes#5002 ·
I maintainer di solito rispondono entro 1 giorno
-
skills: remoteHeadSha() can open a Git Credential Manager dialog on Windows (GIT_TERMINAL_PROMPT does not cover GUI helpers; slug unvalidated)Forse di nuovo libera @RaphaelFakhri l’ha presa 7 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
heygen-com/hyperframes#4702 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Studio catalog prompt editor has no accessible nameForse già presa @lorenzozanee l’ha presa 14 giorni fa. Apertabug difficulty/easy triage/ready
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
heygen-com/hyperframes#4384 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di heygen-com/hyperframes
Issue simili
-
Bump Firebase JS SDK (12.19.0 → 13.0.0)Forse già presa @SelaseKay l’ha presa oggi. ApertaNeeds Attention type: enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
invertase/react-native-firebase#9364 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 4 giorni
-
[fullsend] E2E: rhdh-version-override — run-e2e.sh overrides RHDH_VERSION to non-existent 2.1Apertae2e-failure ready-to-code
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
redhat-developer/rhdh-plugin-export-overlays#4261 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] 官网文档的图片挂了Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
area:cli bug triage:in-progress
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno