forge
Explore
Log in

Don't you dare go Hollow

scripts: link-fixtures.sh — give a worktree the gitignored root fixtures/

Browse files at this commit

7e79eb2592b50117c9a4312636c054111a15cc4eAhmet Kaan GümüşParent: 2183936
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.mdmodified+7 -0
@@ -15,6 +15,13 @@ WORKING RULES (binding):
15 `systemd-run --user --scope -p MemoryMax=8G` and bound ffmpeg with `-t`.15 `systemd-run --user --scope -p MemoryMax=8G` and bound ffmpeg with `-t`.
16 - Test scope: `cargo test -p ec-av1 --lib` only (plus `cargo check -p ec-av1`). Never the16 - Test scope: `cargo test -p ec-av1 --lib` only (plus `cargo check -p ec-av1`). Never the
17 workspace suite. Set `EC_AV1_REQUIRE_AOMENC=1` so an absent oracle FAILS, never SKIPs.17 workspace suite. Set `EC_AV1_REQUIRE_AOMENC=1` so an absent oracle FAILS, never SKIPs.
18+- FIRST STEP of every lane, after `git worktree add`: `scripts/link-fixtures.sh`. The root
19+ `fixtures/` directory is gitignored (`.gitignore:2`), so a worktree does NOT get it and
20+ every fixture-backed gate (JVT/FLAC-xiph/RFC-6716 vectors, the ec-av1 pins) skips GREEN
21+ having tested nothing. The script symlinks the primary checkout's `fixtures/` in
22+ (`--check` for a preflight; it refuses loudly if the primary has none). Set
23+ `EC_REQUIRE_FIXTURES=1` in EVERY batch unit (with EC_AV1_REQUIRE_FFMPEG /
24+ EC_AV1_REQUIRE_AOMENC) so an absent fixture FAILS instead of skipping.
18 - Oracle: `~/.cache/aom-oracle/build/aomenc` and instrumented `aomdec` (scripts/build-aom-oracle.sh,25 - Oracle: `~/.cache/aom-oracle/build/aomenc` and instrumented `aomdec` (scripts/build-aom-oracle.sh,
19 scripts/instrument-aom-oracle.sh; rungs EC_TRACE=1 / EC_TRACE_COEFF=1 / EC_TRACE_MODE=1 /26 scripts/instrument-aom-oracle.sh; rungs EC_TRACE=1 / EC_TRACE_COEFF=1 / EC_TRACE_MODE=1 /
20 EC_AV1_PREFILT_DUMP). Ours: EC_TRACE_COEFF / EC_TRACE_MODE / EC_TRACE_MODE_STEP in decode.rs.27 EC_AV1_PREFILT_DUMP). Ours: EC_TRACE_COEFF / EC_TRACE_MODE / EC_TRACE_MODE_STEP in decode.rs.
scripts/link-fixtures.shadded+74 -0
@@ -0,0 +1,74 @@
1+#!/usr/bin/env bash
2+# link-fixtures.sh — give this worktree the primary checkout's root `fixtures/`.
3+#
4+# The root `fixtures/` directory is listed in `.gitignore` (line 2) and is NOT
5+# committed, so `git worktree add` gives every lane worktree a tree WITHOUT it.
6+# Every test that reads a fixture through `<crate>/../../fixtures` then reports
7+# green having checked nothing: this is the "gate skips on its own failure"
8+# class, and it has already cost false verdicts (lane-av1skipfix 2026-09-29).
9+#
10+# This script makes a SYMLINK, never a copy: the fixtures are large and the
11+# lane worktrees exist to run tests, not to duplicate data.
12+#
13+# Usage: scripts/link-fixtures.sh [--check]
14+# (no args) create the symlink, or no-op if fixtures/ is already there
15+# --check report what would happen and exit non-zero if the fixtures are
16+# absent; for a batch preflight
17+#
18+# Idempotent and safe to run from any worktree of this repo.
19+
20+set -uo pipefail
21+
22+ROOT=$(cd -- "$(dirname -- "$0")/.." && pwd)
23+cd "$ROOT" || exit 2
24+
25+# `--git-common-dir` resolves to the PRIMARY checkout's .git from any linked
26+# worktree (a linked worktree's own .git is a FILE, not the common dir), so
27+# this works identically in the primary tree and in ~/.cache/wt/<lane>.
28+COMMON=$(git rev-parse --git-common-dir 2>/dev/null) || {
29+ echo "link-fixtures: not inside a git repository ($ROOT)" >&2
30+ exit 2
31+}
32+COMMON=$(cd -- "$COMMON" && pwd) || exit 2
33+PRIMARY=$(dirname -- "$COMMON")
34+SOURCE="$PRIMARY/fixtures"
35+
36+CHECK=0
37+[ "${1:-}" = "--check" ] && CHECK=1
38+
39+report() { # report <state> <detail>
40+ echo "link-fixtures: $1 — $2"
41+ echo " primary checkout: $PRIMARY"
42+ echo " this tree: $ROOT"
43+}
44+
45+if [ -e "$ROOT/fixtures" ] || [ -L "$ROOT/fixtures" ]; then
46+ if [ -L "$ROOT/fixtures" ] && [ -d "$ROOT/fixtures" ]; then
47+ report "already linked" "$ROOT/fixtures -> $(readlink -f "$ROOT/fixtures")"
48+ exit 0
49+ fi
50+ if [ -d "$ROOT/fixtures" ]; then
51+ report "already a real directory" "nothing to do ($ROOT/fixtures)"
52+ exit 0
53+ fi
54+ report "REFUSING" "$ROOT/fixtures exists but is neither a directory nor a live symlink; remove it by hand" >&2
55+ exit 2
56+fi
57+
58+if [ ! -d "$SOURCE" ]; then
59+ report "REFUSING" "the primary checkout has no fixtures/ at $SOURCE" >&2
60+ echo " It is gitignored, so it exists only where someone generated it:" >&2
61+ echo " scripts/gen-fixtures.sh (containers) and scripts/fetch-vectors.sh" >&2
62+ echo " (conformance vectors). Run one there, then re-run this script." >&2
63+ exit 2
64+fi
65+
66+if [ "$CHECK" = 1 ]; then
67+ report "would link" "$ROOT/fixtures -> $SOURCE"
68+ exit 1
69+fi
70+
71+ln -s "$SOURCE" "$ROOT/fixtures" || exit 2
72+report "linked" "$ROOT/fixtures -> $SOURCE"
73+echo " Fixtures are now reachable; run your crate's gates with"
74+echo " EC_REQUIRE_FIXTURES=1 so an absent fixture FAILS instead of skipping."