Skip to content

fix(bench): repair three dead fixture references#69

Merged
g4bri3lDev merged 1 commit into
mainfrom
fix/bench-missing-fixtures
Jul 22, 2026
Merged

fix(bench): repair three dead fixture references#69
g4bri3lDev merged 1 commit into
mainfrom
fix/bench-missing-fixtures

Conversation

@g4bri3lDev

Copy link
Copy Markdown
Member

cargo bench panicked before running a single benchmark. Found while benchmarking dizzy dithering in #68; pre-existing on main.

Criterion constructs every benchmark group before executing any of them, so a single missing fixture takes down the whole run — including the synthetic groups that need no files at all.

Three dead references, not one

reference reality
katzi.png exists nowhere in the repo
marienplatz.png only exists at images/benchmark_only/marienplatz.png
benchmark_only/test7.jpeg does not exist — so bench_full_res was dead too

The third one means full_res has been non-functional for as long as the fixture was missing, which nobody noticed because the run died earlier anyway.

Fix

  • real_images now uses cat.png and olympiapark.png. Both exist, and both are 800×480 like every other file in images/ — which keeps that group's hardcoded Throughput::Elements(800 * 480) honest. I added a comment saying so, because picking a differently-sized fixture there would silently produce wrong throughput numbers rather than an error.
  • bench_full_res points at benchmark_only/marienplatz.png (1280×960). Its doc comment claimed 6240×4160, which was wrong for any file present; corrected.
  • load_fixture becomes try_load_fixture, warning and skipping instead of panicking. That is the root-cause fix: fixture drift should cost you one group, not the entire benchmark suite.

Verification

cargo bench --bench dithering -- --test now constructs and runs every group:

Testing real_images/burkes_spectra6_auto/night     Success
Testing real_images/burkes_spectra6_auto/vivid     Success
Testing real_images/burkes_spectra6_auto/detail    Success
Testing real_images/burkes_spectra6_auto/daylight  Success
Testing full_res/burkes_spectra6_auto              Success

cargo test --workspace (76 unit + 5 regression suites, 40 fixture comparisons) and cargo clippy --workspace -- -D warnings both clean. No library code touched.

`cargo bench` panicked before running anything. Criterion constructs every
benchmark group before executing any of them, so one missing fixture took down
the whole run -- including groups that need no files at all.

Three references were dead, not one:
- real_images referenced katzi.png, which exists nowhere in the repo
- real_images referenced marienplatz.png as if it were in images/, but it only
  exists under images/benchmark_only/
- bench_full_res referenced benchmark_only/test7.jpeg, which does not exist,
  so that group had been dead too

Replaces the two real_images entries with cat.png and olympiapark.png, which
exist and are 800x480 like every other file in images/ -- keeping the group's
hardcoded 800x480 throughput honest. Points bench_full_res at
benchmark_only/marienplatz.png (1280x960) and corrects its doc comment, which
claimed 6240x4160.

Also replaces load_fixture with try_load_fixture, which warns and skips instead
of panicking, so future fixture drift degrades one group rather than the run.
@g4bri3lDev
g4bri3lDev merged commit 082b627 into main Jul 22, 2026
8 checks passed
@g4bri3lDev
g4bri3lDev deleted the fix/bench-missing-fixtures branch July 22, 2026 13:45
@github-actions github-actions Bot mentioned this pull request Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant