From 7e79eb2592b50117c9a4312636c054111a15cc4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 29 Sep 2026 03:47:25 +0300 Subject: [PATCH] =?UTF-8?q?scripts:=20link-fixtures.sh=20=E2=80=94=20give?= =?UTF-8?q?=20a=20worktree=20the=20gitignored=20root=20fixtures/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The root `fixtures/` directory is listed in `.gitignore` (line 2) and is not committed, so `git worktree add` hands every lane worktree a tree WITHOUT it. Every fixture-backed gate then reports green having checked nothing: the ec-h264 JVT conformance gates, the ec-flac xiph corpus, the ec-opus RFC 6716 vectors and the ec-av1 pins all take a missing-fixture skip. That is how a_real_aomenc_lossless_444_key_frame finished in 0.05s with nothing decoded, and it is why a worktree run of the conformance gates measures nothing at all. link-fixtures.sh resolves the primary checkout through `git rev-parse --git-common-dir` (which works from any linked worktree), symlinks its `fixtures/` into the current tree -- a symlink, never a copy -- no-ops with a clear message when the directory is already there, and REFUSES loudly (exit 2) when the primary checkout has no `fixtures/` at all, naming the generator scripts instead of leaving a silent hole. `--check` reports what it would do and exits non-zero, for a batch preflight. Documented in lanes/COMMON-20260901.md beside the batch env line, with EC_REQUIRE_FIXTURES=1 as the shared env that turns an absent fixture into a failure in every crate. --- lanes/COMMON-20260901.md | 7 ++++ scripts/link-fixtures.sh | 74 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100755 scripts/link-fixtures.sh diff --git a/lanes/COMMON-20260901.md b/lanes/COMMON-20260901.md index 4b8a1045..f6b3280d 100644 --- a/lanes/COMMON-20260901.md +++ b/lanes/COMMON-20260901.md @@ -15,6 +15,13 @@ WORKING RULES (binding): `systemd-run --user --scope -p MemoryMax=8G` and bound ffmpeg with `-t`. - Test scope: `cargo test -p ec-av1 --lib` only (plus `cargo check -p ec-av1`). Never the workspace suite. Set `EC_AV1_REQUIRE_AOMENC=1` so an absent oracle FAILS, never SKIPs. +- FIRST STEP of every lane, after `git worktree add`: `scripts/link-fixtures.sh`. The root + `fixtures/` directory is gitignored (`.gitignore:2`), so a worktree does NOT get it and + every fixture-backed gate (JVT/FLAC-xiph/RFC-6716 vectors, the ec-av1 pins) skips GREEN + having tested nothing. The script symlinks the primary checkout's `fixtures/` in + (`--check` for a preflight; it refuses loudly if the primary has none). Set + `EC_REQUIRE_FIXTURES=1` in EVERY batch unit (with EC_AV1_REQUIRE_FFMPEG / + EC_AV1_REQUIRE_AOMENC) so an absent fixture FAILS instead of skipping. - Oracle: `~/.cache/aom-oracle/build/aomenc` and instrumented `aomdec` (scripts/build-aom-oracle.sh, scripts/instrument-aom-oracle.sh; rungs EC_TRACE=1 / EC_TRACE_COEFF=1 / EC_TRACE_MODE=1 / EC_AV1_PREFILT_DUMP). Ours: EC_TRACE_COEFF / EC_TRACE_MODE / EC_TRACE_MODE_STEP in decode.rs. diff --git a/scripts/link-fixtures.sh b/scripts/link-fixtures.sh new file mode 100755 index 00000000..086240d9 --- /dev/null +++ b/scripts/link-fixtures.sh @@ -0,0 +1,74 @@ +#!/usr/bin/env bash +# link-fixtures.sh — give this worktree the primary checkout's root `fixtures/`. +# +# The root `fixtures/` directory is listed in `.gitignore` (line 2) and is NOT +# committed, so `git worktree add` gives every lane worktree a tree WITHOUT it. +# Every test that reads a fixture through `/../../fixtures` then reports +# green having checked nothing: this is the "gate skips on its own failure" +# class, and it has already cost false verdicts (lane-av1skipfix 2026-09-29). +# +# This script makes a SYMLINK, never a copy: the fixtures are large and the +# lane worktrees exist to run tests, not to duplicate data. +# +# Usage: scripts/link-fixtures.sh [--check] +# (no args) create the symlink, or no-op if fixtures/ is already there +# --check report what would happen and exit non-zero if the fixtures are +# absent; for a batch preflight +# +# Idempotent and safe to run from any worktree of this repo. + +set -uo pipefail + +ROOT=$(cd -- "$(dirname -- "$0")/.." && pwd) +cd "$ROOT" || exit 2 + +# `--git-common-dir` resolves to the PRIMARY checkout's .git from any linked +# worktree (a linked worktree's own .git is a FILE, not the common dir), so +# this works identically in the primary tree and in ~/.cache/wt/. +COMMON=$(git rev-parse --git-common-dir 2>/dev/null) || { + echo "link-fixtures: not inside a git repository ($ROOT)" >&2 + exit 2 +} +COMMON=$(cd -- "$COMMON" && pwd) || exit 2 +PRIMARY=$(dirname -- "$COMMON") +SOURCE="$PRIMARY/fixtures" + +CHECK=0 +[ "${1:-}" = "--check" ] && CHECK=1 + +report() { # report + echo "link-fixtures: $1 — $2" + echo " primary checkout: $PRIMARY" + echo " this tree: $ROOT" +} + +if [ -e "$ROOT/fixtures" ] || [ -L "$ROOT/fixtures" ]; then + if [ -L "$ROOT/fixtures" ] && [ -d "$ROOT/fixtures" ]; then + report "already linked" "$ROOT/fixtures -> $(readlink -f "$ROOT/fixtures")" + exit 0 + fi + if [ -d "$ROOT/fixtures" ]; then + report "already a real directory" "nothing to do ($ROOT/fixtures)" + exit 0 + fi + report "REFUSING" "$ROOT/fixtures exists but is neither a directory nor a live symlink; remove it by hand" >&2 + exit 2 +fi + +if [ ! -d "$SOURCE" ]; then + report "REFUSING" "the primary checkout has no fixtures/ at $SOURCE" >&2 + echo " It is gitignored, so it exists only where someone generated it:" >&2 + echo " scripts/gen-fixtures.sh (containers) and scripts/fetch-vectors.sh" >&2 + echo " (conformance vectors). Run one there, then re-run this script." >&2 + exit 2 +fi + +if [ "$CHECK" = 1 ]; then + report "would link" "$ROOT/fixtures -> $SOURCE" + exit 1 +fi + +ln -s "$SOURCE" "$ROOT/fixtures" || exit 2 +report "linked" "$ROOT/fixtures -> $SOURCE" +echo " Fixtures are now reachable; run your crate's gates with" +echo " EC_REQUIRE_FIXTURES=1 so an absent fixture FAILS instead of skipping."