edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiB9b67700Tahinli3 days ago4021 commits
| 1 | //! Where a REAL-LIBRARY fixture is read from, and the one presence probe every |
| 2 | //! gate that needs one routes through. |
| 3 | //! |
| 4 | //! The clips these gates read (`h264-1080p-23.976-8bit.mp4`, |
| 5 | //! `h264-2160p-23.976-8bit.mp4`, `real-library-manifest.tsv`) are |
| 6 | //! multi-megabyte encodes of a shared library, not pins: they cannot be |
| 7 | //! committed under `crates/<crate>/fixtures/` the way the `.obu` pins are |
| 8 | //! ([`crate_pin`](crate::stream)), so they live in the gitignored ROOT |
| 9 | //! `fixtures/` — `.gitignore:2`. A linked worktree therefore never has that |
| 10 | //! directory, and a gate that skips on its absence reports GREEN having |
| 11 | //! asserted nothing: the class `lane-av1skipfix` closed for the pins, still open |
| 12 | //! for the clips. |
| 13 | //! |
| 14 | //! TWO defects met here, both of which this module closes: |
| 15 | //! |
| 16 | //! 1. **Silent skip.** `h264_clip_frames` and each gate's own |
| 17 | //! `if !clip.exists() { eprintln!("SKIP …"); return; }` skipped with no env |
| 18 | //! escape, so `EC_AV1_REQUIRE_FFMPEG=1` — a batch run's way of saying "this |
| 19 | //! gate must actually run" — did not make the ABSENT CLIP a failure. The |
| 20 | //! `a_1080p_multi_tile_stream_decodes_sample_exact_through_both_decoders` |
| 21 | //! gate printed `SKIP the 1080p tile round trip: no fixture` and libtest |
| 22 | //! reported `ok` on a tree with no root `fixtures/` at all. |
| 23 | //! |
| 24 | //! 2. **Two roots.** `scripts/verify-fixture-library.sh` validates |
| 25 | //! `$EC_FIXTURES` (defaulting to `$ROOT/fixtures`) while these gates read |
| 26 | //! `$ROOT/fixtures` unconditionally. Pointing the preflight at a library |
| 27 | //! elsewhere reported `resolve 0 missing` and `GREEN` while the clip gates' |
| 28 | //! root was absent — GREEN with an absent root, the exact false green this |
| 29 | //! module exists to kill. So [`root`] honours `EC_FIXTURES` FIRST: the |
| 30 | //! preflight and the gates now resolve the same tree, and when it is unset |
| 31 | //! the preflight's default IS the gates' root, so its mode-(i) finding fires |
| 32 | //! exactly when the clip gates will skip. |
| 33 | //! |
| 34 | //! The shape is the crate's existing convention, not a new one: the |
| 35 | //! assert-under-require / print-one-line-otherwise probe is the same one |
| 36 | //! `crates/ec-h264/tests/conformance.rs::require_fixtures` and the per-crate |
| 37 | //! `require_fixture` helpers use, and the file's own presence check lives HERE, |
| 38 | //! inside the probe that owns it — a bare `clip.exists()` at a call site is |
| 39 | //! precisely what the anti-regression scan for the sibling (tool) class |
| 40 | //! rejects. |
| 41 | |
| 42 | use ; |
| 43 | |
| 44 | /// The envs that turn an absent library clip into a hard failure. |
| 45 | /// |
| 46 | /// * `EC_REQUIRE_FIXTURES` — the fleet-wide convention, the same one |
| 47 | /// `scripts/verify-fixture-library.sh` and every per-crate `require_fixture` |
| 48 | /// honour, and the one `EC_REQUIRE_FIXTURES=1` in the preflight's docs names. |
| 49 | /// * `EC_AV1_REQUIRE_FFMPEG` / `EC_AV1_REQUIRE_AOMENC` — this crate's own |
| 50 | /// requirement flags ([`have_ffmpeg`](crate::encode::tests::have_ffmpeg)). |
| 51 | /// Every gate reachable through [`require`] also decodes its result through |
| 52 | /// ffmpeg, so a batch that sets them has already said the gate must run; a |
| 53 | /// missing clip must not be the softer failure. |
| 54 | /// |
| 55 | /// All three are checked, not just one: a run that sets only the preflight's |
| 56 | /// env, and a run that sets only this crate's, both get the failure. |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | /// The fixture root the tests read, in precedence order: |
| 64 | /// |
| 65 | /// 1. `EC_FIXTURES` — the same variable `scripts/verify-fixture-library.sh` |
| 66 | /// resolves, so its verdict and these gates' bytes are the same tree. This |
| 67 | /// is the half of the two-roots mismatch that the preflight cannot fix from |
| 68 | /// its side. |
| 69 | /// 2. `<crate>/../../fixtures` — the gitignored root `fixtures/`, the default |
| 70 | /// the preflight uses when `EC_FIXTURES` is unset. |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | /// `require` on a path relative to [`root`]: |
| 79 | /// `require("video/h264-1080p-23.976-8bit.mp4", …)`. The literal is |
| 80 | /// LIBRARY-RELATIVE, which is the row shape `scripts/gen-fixture-library.sh` |
| 81 | /// reads back out of this file, so the preflight keeps resolving these paths. |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | /// The one presence probe for a library fixture. Returns the path when the file |
| 87 | /// is there. When it is not: |
| 88 | /// |
| 89 | /// * under [`required()`] — PANIC, naming the resolved path, so the gate is RED |
| 90 | /// instead of green-with-nothing-checked; |
| 91 | /// * otherwise — prints exactly ONE `SKIP` line naming the resolved path and the |
| 92 | /// three ways out (link the library, point `EC_FIXTURES` at it, or set a |
| 93 | /// require env), and returns `None`. |
| 94 | /// |
| 95 | /// A caller that gets `None` must `return` WITHOUT printing a second line: the |
| 96 | /// path and the escape hatch are already on the one line above, and a second |
| 97 | /// "no fixture" line is the noise that hid this defect from a reading of the |
| 98 | /// output. |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | /// [`require`] for a path the caller resolved itself — an `EC_AV1_WALL_CLIP` |
| 104 | /// override, which names a clip OUTSIDE any library root, so it must not be |
| 105 | /// joined onto one. |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | |
| 157 | |
| 158 | |
| 159 | |
| 160 | |
| 161 |