From bcbffd6e4debab0aee7a6e3f8c5efc10d72c8f3c Mon Sep 17 00:00:00 2001 From: Hermes Date: Wed, 7 Oct 2026 14:03:33 +0800 Subject: [PATCH] gate: give every run its own raw frame files The three tiers run side by side by design (copy is I/O, x265 is CPU, nvenc is the GPU ASIC) and they share the stage directory - but the gate's raw frame files had FIXED names, so two concurrent gates overwrote each other's decodes. Measured: a comparison reported 100% of frames below 0.85 - which reads exactly like a systematic defect and was nothing but two runs writing ssim_ref.yuv at once. The raws are now tagged with the pid and the file tag. A single-file conversion failed its gate on this and the 'defect' was entirely my own harness. --- scripts/library_run.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/library_run.py b/scripts/library_run.py index f658323..406a837 100644 --- a/scripts/library_run.py +++ b/scripts/library_run.py @@ -340,8 +340,13 @@ def ssim_vs_source(src_local, out_local, info, workdir, tag, dur=SSIM_WINDOW): """ start = max(0.0, (info["dur"] / 2) - dur / 2) cmp_scale = "480:270" - ref = os.path.join(workdir, "ssim_ref.yuv") - out = os.path.join(workdir, "ssim_out.yuv") + # The raw frame files MUST be per-run: the tiers run side by side (by design - copy is I/O, + # x265 is CPU, nvenc is the GPU ASIC) and they share this stage directory, so fixed names let + # two concurrent gates overwrite each other's decodes. Measured: a comparison came out with + # 100% of frames below 0.85 (a convincing-looking 'systematic defect') that was nothing but two + # runs writing ssim_ref.yuv at the same time. + ref = os.path.join(workdir, "ssim_%d_%s_ref.yuv" % (os.getpid(), tag)) + out = os.path.join(workdir, "ssim_%d_%s_out.yuv" % (os.getpid(), tag)) counts = [] # Decode WITHOUT an input seek, and cut the window with the trim filter on absolute PTS. #