Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d345cbc
docs(ffmpeg): plan local oracle qualification
gunwooterry Nov 5, 2026
3ba2112
test(ffmpeg): qualify selected local oracles
gunwooterry Nov 5, 2026
894de68
docs(ffmpeg): plan shared oracle qualification
gunwooterry Nov 5, 2026
08de865
test(ffmpeg): centralize oracle qualification
gunwooterry Nov 5, 2026
45ba153
fix(ffmpeg): retain qualified oracle paths
gunwooterry Nov 5, 2026
19f0ccf
docs(ffmpeg): plan invocation discovery
gunwooterry Nov 5, 2026
eaf1fb0
test(ffmpeg): inventory oracle process boundaries
gunwooterry Nov 5, 2026
7b5b810
test(audio): fix conversion reference CPU profile
gunwooterry Nov 5, 2026
721ce6d
test(ffmpeg): discover delegated process calls
gunwooterry Nov 5, 2026
50a563c
test(ffmpeg): reject replaced historical boundaries
gunwooterry Nov 5, 2026
eaf046e
docs(ffmpeg): record scalar reference scope
gunwooterry Nov 5, 2026
bb5c812
test(ffmpeg): classify oracle invocation evidence
gunwooterry Nov 5, 2026
efa6a18
test(ffmpeg): bind every invocation input file
gunwooterry Nov 5, 2026
0b8af37
test(ffmpeg): enforce source-bound classification rules
gunwooterry Nov 5, 2026
6015171
chore: merge current main
gunwooterry Nov 5, 2026
86b40de
fix(ffmpeg): preserve qualified oracle handoffs
gunwooterry Nov 5, 2026
30ccef4
fix(ffmpeg): use file-relative oracle support
gunwooterry Nov 5, 2026
de75b9b
fix(ffmpeg): qualify FLAC tests per platform
gunwooterry Nov 5, 2026
6aeeea1
fix(ffmpeg): qualify transport fixtures per platform
gunwooterry Nov 5, 2026
76a7e98
ci(ffmpeg): provision structural discovery parser
gunwooterry Nov 5, 2026
09c7fed
docs(ffmpeg): clarify migrated oracle scope
gunwooterry Nov 5, 2026
f217c2f
Merge origin/main into fix/local-oracle-qualification
gunwooterry Nov 5, 2026
aead179
fix(ffmpeg): retain configured oracle selectors
gunwooterry Nov 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 47 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ jobs:
crates/coreav-worker/**
crates/coreav-transcode/**
crates/coreav-cli/**
test-support/**
scripts/test_oracle.py
scripts/oracle_free.py
scripts/oracle_pin*.py
scripts/oracle-ffmpeg*.env
scripts/install-oracle-ffmpeg-macos.sh
crates/coreav-backend-dav1d/**
crates/coreav-backend-libvpx/**
crates/coreav-isobmff/src/source.rs
Expand Down Expand Up @@ -229,6 +235,30 @@ jobs:
- run: python3 -I -m unittest discover -s .github/workflows/tests -p 'test_*.py'
env:
PYTHONDONTWRITEBYTECODE: '1'
# The encoder programs of `coreav transcode`, black boxes for
# coreav-transcode's tests (docs/design/transcode.md): the pinned
# FFmpeg and an x264 program built from the commit of its libx264
# (scripts/oracle-ffmpeg.env), its source deleted after the build.
# With `CI` set the tests
# fail instead of skipping when either is missing.
- name: Cache the encoder programs
id: encoders-cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ${{ runner.temp }}/coreav-encoders
key: linux-x64-encoders-${{ hashFiles('scripts/oracle-ffmpeg.env', 'scripts/install-oracle-ffmpeg.sh', 'scripts/install-x264.sh') }}
- name: Install the pinned FFmpeg and build x264
if: steps.encoders-cache.outputs.cache-hit != 'true'
run: |
sudo apt-get install -y --no-install-recommends nasm
scripts/install-oracle-ffmpeg.sh "$RUNNER_TEMP/coreav-encoders"
scripts/install-x264.sh "$RUNNER_TEMP/coreav-encoders"
- name: Verify the pinned encoder oracle
run: |
python3 -I scripts/oracle_pin.py --verify-bin "$RUNNER_TEMP/coreav-encoders"
echo "COREAV_FFMPEG=$RUNNER_TEMP/coreav-encoders/ffmpeg" >> "$GITHUB_ENV"
echo "COREAV_FFPROBE=$RUNNER_TEMP/coreav-encoders/ffprobe" >> "$GITHUB_ENV"
echo "$RUNNER_TEMP/coreav-encoders" >> "$GITHUB_PATH"
- run: cargo clippy --workspace --all-targets -- -D warnings
# The H.264 decoder's safe mode, without its default feature `fast`
# (docs/design/h264.md).
Expand Down Expand Up @@ -276,26 +306,6 @@ jobs:
cargo clippy -p coreav-decode-oracle --features native-vp9,native-h264 --all-targets -- -D warnings
cargo test -p coreav-backend-libopus --features libopus
cargo test -p coreav-worker --features libopus
# The encoder programs of `coreav transcode`, black boxes for
# coreav-transcode's tests (docs/design/transcode.md): the pinned
# FFmpeg and an x264 program built from the commit of its libx264
# (scripts/oracle-ffmpeg.env), its source deleted after the build.
# With `CI` set the tests
# fail instead of skipping when either is missing.
- name: Cache the encoder programs
id: encoders-cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ${{ runner.temp }}/coreav-encoders
key: linux-x64-encoders-${{ hashFiles('scripts/oracle-ffmpeg.env', 'scripts/install-oracle-ffmpeg.sh', 'scripts/install-x264.sh') }}
- name: Install the pinned FFmpeg and build x264
if: steps.encoders-cache.outputs.cache-hit != 'true'
run: |
sudo apt-get install -y --no-install-recommends nasm
scripts/install-oracle-ffmpeg.sh "$RUNNER_TEMP/coreav-encoders"
scripts/install-x264.sh "$RUNNER_TEMP/coreav-encoders"
- name: Verify the pinned encoder oracle
run: python3 -I scripts/oracle_pin.py --verify-bin "$RUNNER_TEMP/coreav-encoders"
- name: Require exact native FFV1 pixels and probe fields
timeout-minutes: 15
run: |
Expand Down Expand Up @@ -423,6 +433,15 @@ jobs:
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Provision the registered macOS oracle or select oracle-free tests
run: |
if [[ "$(uname -m)" == arm64 ]]; then
scripts/install-oracle-ffmpeg-macos.sh "$RUNNER_TEMP/coreav-test-oracle"
echo "COREAV_FFMPEG=$RUNNER_TEMP/coreav-test-oracle/ffmpeg" >> "$GITHUB_ENV"
echo "COREAV_FFPROBE=$RUNNER_TEMP/coreav-test-oracle/ffprobe" >> "$GITHUB_ENV"
else
echo 'No registered oracle on this architecture; run the explicit oracle-free selection'
fi
- run: cargo clippy --workspace --all-targets -- -D warnings
- run: cargo clippy -p coreav-h264 --no-default-features --all-targets -- -D warnings
- run: cargo clippy -p coreav-cli --features ffmpeg-fallback --all-targets -- -D warnings
Expand All @@ -438,12 +457,12 @@ jobs:
--features coreav-cli/libvpx,coreav-backend-libvpx/libvpx,coreav-worker/libvpx,coreav-decode-oracle/libvpx \
--all-targets -- -D warnings
cargo clippy -p coreav-cli --features libvpx,dav1d,ffmpeg-fallback --all-targets -- -D warnings
env -u CI cargo test -p coreav-backend-dav1d --features dav1d
env -u CI cargo test -p coreav-backend-libvpx --features libvpx
- run: env -u CI cargo test --workspace
env -u CI python3 -I scripts/oracle_free.py cargo test -p coreav-backend-dav1d --features dav1d
env -u CI python3 -I scripts/oracle_free.py cargo test -p coreav-backend-libvpx --features libvpx
- run: env -u CI python3 -I scripts/oracle_free.py cargo test --workspace
- run: |
env -u CI cargo test -p coreav-cli --features ffmpeg-fallback --test strict_safe --test strict_safe_limit
env -u CI cargo test -p coreav-cli --features native-h264 --test strict_safe --test strict_safe_limit
env -u CI python3 -I scripts/oracle_free.py cargo test -p coreav-cli --features ffmpeg-fallback --test strict_safe --test strict_safe_limit
env -u CI python3 -I scripts/oracle_free.py cargo test -p coreav-cli --features native-h264 --test strict_safe --test strict_safe_limit
- run: cargo test -p coreav-cli --features ffmpeg-fallback --test docs_site --test transcode_selection
- run: |
cargo test --release -p coreav-isobmff --test hostile -- --ignored
Expand Down Expand Up @@ -496,11 +515,11 @@ jobs:
run: cargo clippy -p coreav-py --features thumbnail --all-targets -- -D warnings
- name: Test workspace including Windows fallback
if: ${{ !cancelled() }}
run: env -u CI cargo test --workspace --no-fail-fast
run: env -u CI python3 -I scripts/oracle_free.py cargo test --workspace --no-fail-fast
- if: ${{ !cancelled() }}
run: |
env -u CI cargo test -p coreav-cli --features ffmpeg-fallback --test strict_safe --test strict_safe_limit
env -u CI cargo test -p coreav-cli --features native-h264 --test strict_safe --test strict_safe_limit
env -u CI python3 -I scripts/oracle_free.py cargo test -p coreav-cli --features ffmpeg-fallback --test strict_safe --test strict_safe_limit
env -u CI python3 -I scripts/oracle_free.py cargo test -p coreav-cli --features native-h264 --test strict_safe --test strict_safe_limit
- if: ${{ !cancelled() }}
run: cargo test -p coreav-cli --features ffmpeg-fallback --test docs_site --test transcode_selection
- if: ${{ !cancelled() }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/codec-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ on:
- docs/design/png-bmp-yuv-actions.md
- scripts/tests/test_registered_candidate.py
- scripts/oracle-ffmpeg.env
- scripts/oracle-ffmpeg-macos.env
- scripts/install-oracle-ffmpeg.sh
- scripts/install-x264.sh
- scripts/clip_check.py
Expand All @@ -81,6 +82,8 @@ on:
- scripts/opus_encode_check.py
- scripts/oracle_audio.py
- scripts/oracle_pin.py
- scripts/oracle_pin_macos.py
- scripts/test_oracle.py
- scripts/oracle-audio-args.txt
- scripts/thumbnail_oracle.py
- scripts/remux_check.py
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/deny.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,23 @@ jobs:
# docs/measurements/compat-ffprobe.md says what its JSON evidence
# holds (tools/compat-corpus/record.py). It runs here, not in ci.yml,
# because the notes it reads are behind that workflow's path filter.
- name: Cache the pinned test oracle
if: steps.result.outputs.reuse != 'true'
id: test-oracle-cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ${{ runner.temp }}/coreav-test-oracle
key: linux-x64-test-oracle-${{ hashFiles('scripts/oracle-ffmpeg.env', 'scripts/install-oracle-ffmpeg.sh') }}
- name: Install the pinned test oracle
if: steps.result.outputs.reuse != 'true' && steps.test-oracle-cache.outputs.cache-hit != 'true'
run: scripts/install-oracle-ffmpeg.sh "$RUNNER_TEMP/coreav-test-oracle"
- name: Verify the test oracle before real Python discovery
if: steps.result.outputs.reuse != 'true'
run: |
python3 -I scripts/oracle_pin.py --verify-bin "$RUNNER_TEMP/coreav-test-oracle"
echo "COREAV_FFMPEG=$RUNNER_TEMP/coreav-test-oracle/ffmpeg" >> "$GITHUB_ENV"
echo "COREAV_FFPROBE=$RUNNER_TEMP/coreav-test-oracle/ffprobe" >> "$GITHUB_ENV"
echo "$RUNNER_TEMP/coreav-test-oracle" >> "$GITHUB_PATH"
- name: Check the command-coverage set against its rules
if: steps.result.outputs.reuse != 'true'
env:
Expand All @@ -141,6 +158,16 @@ jobs:
# added under docs/measurements (docs/design/h264.md, "A round's bars:
# one analyzer, complete reports"). It runs here, not in ci.yml, because
# that workflow's filter skips a change to docs/measurements alone.
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1
if: steps.result.outputs.reuse != 'true'
with:
node-version: 24
- name: Install structural invocation discovery
if: steps.result.outputs.reuse != 'true'
run: |
set -euo pipefail
npm install --prefix "$RUNNER_TEMP/oracle-discovery" --no-audit --no-fund --save-exact @ast-grep/cli@0.50.0
echo "$RUNNER_TEMP/oracle-discovery/node_modules/.bin" >> "$GITHUB_PATH"
- name: Check the measurement analyzers
if: steps.result.outputs.reuse != 'true'
env:
Expand Down
3 changes: 3 additions & 0 deletions bench/npx/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

HERE = Path(__file__).resolve().parent
ROOT = HERE.parent.parent
sys.path.insert(0, str(ROOT / 'scripts'))
import test_oracle
sys.path.insert(0, str(HERE.parent / 'shared'))
from benchlib import R2, append_jsonl, download, machine, sha256_file, write_json # noqa: E402

Expand Down Expand Up @@ -215,6 +217,7 @@ def main():
parser.add_argument('--cache', default='/tmp/npx-cache')
parser.add_argument('--path', choices=('native', 'wasi'), default='native')
args = parser.parse_args()
test_oracle.require('ffmpeg', 'ffprobe')
native = os.environ.get('COREAV_BIN')
if not native or not MODULE.exists() or not (NATIVE_PACKAGE / 'bin' / 'coreav').exists():
raise SystemExit('needs COREAV_BIN, packages/cli/scripts/build.sh and scripts/platform.sh linux-x64')
Expand Down
3 changes: 3 additions & 0 deletions bench/range-audio/gaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
HERE = Path(__file__).resolve().parent
sys.path.insert(0, str(HERE.parent / 'shared'))
from benchlib import R2 # noqa: E402
sys.path.insert(0, str(HERE.parents[1] / 'scripts'))
import test_oracle

WINDOW = 64 << 10

Expand Down Expand Up @@ -55,6 +57,7 @@ def main():
parser.add_argument('--stream', type=int, default=None)
parser.add_argument('--only', default='')
args = parser.parse_args()
test_oracle.require('ffmpeg', 'ffprobe')
files = json.loads(Path(args.inputs).read_text())['files']
if args.only:
files = [f for f in files if any(f['sha256'].startswith(p) for p in args.only.split(','))]
Expand Down
3 changes: 3 additions & 0 deletions bench/range-audio/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
EXTRA = {}

NATIVE = ROOT / 'target' / 'edge' / 'edge-native'
sys.path.insert(0, str(ROOT / 'scripts'))
import test_oracle
CLI = ROOT / 'target' / 'dist' / 'coreav'
# R2 requests one object may cost the CLI at most: the warm-up and the
# trials, each under its reader's cap of 10,000.
Expand Down Expand Up @@ -126,6 +128,7 @@ def main():
parser.add_argument('--max-requests', type=int, default=400_000,
help='R2 requests the whole run may make (Class B, 0.36 USD per million)')
args = parser.parse_args()
test_oracle.require('ffmpeg', 'ffprobe')
data = json.loads(Path(args.inputs).read_text())
files = (data['held_out'] if args.held_out else data['files'])[:args.limit]
if args.only:
Expand Down
28 changes: 9 additions & 19 deletions crates/coreav-audio/src/convert/oracle.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#![allow(clippy::indexing_slicing, clippy::unwrap_used)]

#[path = "../../../../test-support/oracle.rs"]
mod test_oracle;

use super::*;
use std::io::Write;
use std::path::{Path, PathBuf};
use std::path::Path;
use std::process::{Command, Stdio};

fn format(format: SampleFormat) -> (&'static str, &'static str) {
Expand All @@ -22,6 +25,9 @@ fn reference(
channels: usize,
planar: bool,
) -> Vec<u8> {
// FFmpeg's arm64 SIMD path rounds half-LSB ties away from even;
// its C path and CoreAV round to even.
const SCALAR_CONVERSION_REFERENCE: [&str; 2] = ["-cpuflags", "0"];
let (input_format, _) = format(source);
let (output_format, sample_format) = format(target);
let layout = format!(
Expand All @@ -30,6 +36,7 @@ fn reference(
);
let mut child = Command::new(ffmpeg)
.args(["-v", "error", "-nostdin"])
.args(SCALAR_CONVERSION_REFERENCE)
.args(include_str!("../../../../scripts/oracle-audio-args.txt").split_whitespace())
.args(["-f", input_format, "-ar", "48000", "-ac"])
.arg(channels.to_string())
Expand Down Expand Up @@ -61,24 +68,7 @@ fn reference(

#[test]
fn sample_conversion_is_exact_against_the_pinned_oracle() {
let Some(ffmpeg) = std::env::var_os("COREAV_FFMPEG").map(PathBuf::from) else {
assert!(
std::env::var_os("CI").is_none(),
"CI requires COREAV_FFMPEG"
);
eprintln!("skipping sample conversion oracle; set COREAV_FFMPEG");
return;
};
let root = Path::new(env!("CARGO_MANIFEST_DIR")).join("../..");
assert!(
Command::new("python3")
.arg(root.join("scripts/oracle_pin.py"))
.arg("--verify-bin")
.arg(ffmpeg.parent().unwrap())
.status()
.unwrap()
.success()
);
let ffmpeg = test_oracle::require().ffmpeg().to_path_buf();
let formats = [
SampleFormat::S16,
SampleFormat::S24,
Expand Down
11 changes: 4 additions & 7 deletions crates/coreav-audio/tests/flac_encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

mod support;

#[path = "../../../test-support/oracle.rs"]
mod test_oracle;

use coreav_audio::flac::encode::FlacSink;
use coreav_audio::{Error, LimitKind, Limits, OutputFormat, SampleFormat, Sink};

Expand Down Expand Up @@ -103,13 +106,7 @@ fn complete_roundtrips_include_all_channels_widths_and_block_tails() {

#[test]
fn escaped_and_five_bit_files_decode_completely_with_the_independent_oracle() {
let Some(program) = std::env::var_os("COREAV_FFMPEG") else {
assert!(
std::env::var_os("COREAV_REQUIRE_FFMPEG").is_none(),
"set COREAV_FFMPEG to the verified oracle"
);
return;
};
let program = test_oracle::require().ffmpeg().to_path_buf();
for bits in [16, 24] {
let samples: Vec<u8> = (0..4096i64)
.flat_map(|index| {
Expand Down
9 changes: 4 additions & 5 deletions crates/coreav-backend-dav1d/tests/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
clippy::indexing_slicing
)]

#[path = "../../../test-support/oracle.rs"]
mod test_oracle;

use std::path::{Path, PathBuf};
use std::process::Command;

Expand All @@ -21,11 +24,7 @@ use coreav_decode::{
use coreav_isobmff::{Allowlist, Budget, FileSource, Source, probe};

fn ffmpeg() -> PathBuf {
let path = std::env::var_os("PATH").expect("PATH");
std::env::split_paths(&path)
.map(|d| d.join("ffmpeg"))
.find(|p| p.is_file())
.expect("ffmpeg on PATH")
test_oracle::require().ffmpeg().to_path_buf()
}

fn generate(dir: &Path, name: &str, size: &str, pix_fmt: &str, extra: &[&str]) -> PathBuf {
Expand Down
9 changes: 4 additions & 5 deletions crates/coreav-backend-ffmpeg/tests/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
clippy::indexing_slicing
)]

#[path = "../../../test-support/oracle.rs"]
mod test_oracle;

use std::path::{Path, PathBuf};
use std::process::Command;

Expand All @@ -18,11 +21,7 @@ use coreav_decode::{Codec, CodecConfig, ConfigKind, Decoder, Limits, Packet, Str
use coreav_isobmff::{Allowlist, Budget, FileSource, Source, probe};

fn ffmpeg() -> PathBuf {
let path = std::env::var_os("PATH").expect("PATH");
std::env::split_paths(&path)
.map(|d| d.join("ffmpeg"))
.find(|p| p.is_file())
.expect("ffmpeg on PATH")
test_oracle::require().ffmpeg().to_path_buf()
}

fn generate(dir: &Path, name: &str, args: &[&str]) -> PathBuf {
Expand Down
9 changes: 4 additions & 5 deletions crates/coreav-backend-h264/tests/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
clippy::indexing_slicing
)]

#[path = "../../../test-support/oracle.rs"]
mod test_oracle;

use std::path::{Path, PathBuf};
use std::process::Command;

Expand All @@ -25,11 +28,7 @@ use coreav_decode::{
use coreav_isobmff::{Allowlist, Budget, FileSource, Source, probe};

fn ffmpeg() -> PathBuf {
let path = std::env::var_os("PATH").expect("PATH");
std::env::split_paths(&path)
.map(|d| d.join("ffmpeg"))
.find(|p| p.is_file())
.expect("ffmpeg on PATH")
test_oracle::require().ffmpeg().to_path_buf()
}

fn generate(dir: &Path, name: &str, args: &[&str]) -> PathBuf {
Expand Down
Loading
Loading