AF.3: put the Affinity fuzz targets and corpus back in CI
The maintainers approved the new crate, its fuzz targets and the corpus upstreams in principle (storytold/photocraft#1607), so this undoes the interim opt-in: ci.yml fuzzes preview and import_preview again, corpus --all fetches the Affinity set, and its test runs under the normal corpus feature. The provenance section stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GQPh8UDgMyARR5Hat9UchC
This commit is contained in:
parent
edb42922c1
commit
a8d7c6ef3f
|
|
@ -206,6 +206,8 @@ jobs:
|
|||
- { crate: codecs, name: decode_tiff }
|
||||
- { crate: codecs, name: decode_exr }
|
||||
- { crate: codecs, name: decode_heif }
|
||||
- { crate: affinity, name: preview }
|
||||
- { crate: affinity, name: import_preview, args: "--features io" }
|
||||
- { crate: format, name: load }
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
|
@ -217,7 +219,7 @@ jobs:
|
|||
run: cargo install cargo-fuzz --locked
|
||||
- name: Fuzz
|
||||
working-directory: crates/${{ matrix.target.crate }}
|
||||
run: cargo fuzz run ${{ matrix.target.name }} -- -max_total_time=${{ inputs.fuzz_seconds }}
|
||||
run: cargo fuzz run ${{ matrix.target.name }} ${{ matrix.target.args }} -- -max_total_time=${{ inputs.fuzz_seconds }}
|
||||
- name: Upload crash artifacts
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
|
|
|
|||
|
|
@ -114,11 +114,9 @@ The same reader is shared, as an independent copy, with VectorCraft's `vectorcra
|
|||
(CC0), at pinned commits, each checked against `xtask/affinity-corpus.sha256`. `tests/real_files.rs`
|
||||
parses them; `photocraft-io`'s `tests/affinity_corpus.rs` imports and flattens each one and
|
||||
compares it with the thumbnail Affinity saved in it (mean difference 0–4.6 of 255, with a
|
||||
ceiling per file). This corpus is opt-in on its own: `corpus --all` and CI don't fetch it, so
|
||||
run `cargo xtask corpus --affinity`, then
|
||||
`cargo test -p photocraft-io --release --features corpus-affinity --test affinity_corpus`.
|
||||
ceiling per file).
|
||||
* `fuzz/` has `cargo-fuzz` targets for the whole reader (`preview`), the object stream (`stream`)
|
||||
and the I/O import (`import_preview`), run locally (they aren't in CI's fuzz matrix):
|
||||
and the I/O import (`import_preview`); CI's fuzz job runs `preview` and `import_preview`:
|
||||
|
||||
```sh
|
||||
cd crates/affinity/fuzz
|
||||
|
|
|
|||
|
|
@ -12,9 +12,6 @@ workspace = true
|
|||
[features]
|
||||
# Real-file corpus tests (opt-in; `cargo xtask test-corpus`). Fail when the corpus is missing.
|
||||
corpus = []
|
||||
# The Affinity corpus test (opt-in on its own: `cargo xtask corpus --affinity` fetches its files,
|
||||
# which `--all` and CI leave out until they move to photocraft-corpus).
|
||||
corpus-affinity = []
|
||||
# HEIC/HEIF decode (forwarded to photocraft-codecs; see its `heif` feature).
|
||||
heif = ["photocraft-codecs/heif"]
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,7 @@
|
|||
//! Affinity rendered when saving it. Each file's mean difference from that thumbnail (0–255 per
|
||||
//! channel, both flattened on white, at the smaller of the two sizes) must stay under its ceiling,
|
||||
//! set just above the difference measured when the importer landed.
|
||||
//!
|
||||
//! Opt-in on its own (`--features corpus-affinity`): `corpus --all` and CI don't fetch these files.
|
||||
#![cfg(feature = "corpus-affinity")]
|
||||
#![cfg(feature = "corpus")]
|
||||
#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
|
|
|||
|
|
@ -355,7 +355,7 @@ against committed **sha256 manifests**. All pins are in one place:
|
|||
| `corpus/psd-tools/` | the complete psd-tools test set (309 files) | psd-tools upstream (MIT) | `xtask/psd-tools-corpus.sha256` |
|
||||
| `corpus/heif/` | 9 small HEIC/HEIF files (checkerboards, RGB strips, a grid-tiled photo with EXIF/XMP, each with Apple's decode as `.ref.png`; a 10-bit RGBA file with its source PNG), for the `heif` feature | heic-rs (MIT OR Apache-2.0) and pillow-heif (BSD-3-Clause) upstreams | `xtask/heif-corpus.sha256` |
|
||||
| `corpus/exr/` | the 5 deep OpenEXR test images (scanline deep data with half colour and u32 ID channels; 2.3 MB), checked against the ID manifests of their upstream sidecars | OpenEXR upstream at v3.5.2 (BSD-3-Clause) | `xtask/exr-corpus.sha256` |
|
||||
| `corpus/affinity/` | 21 public Affinity documents (four Affinity 3 `.af` files, `.afdesign` vector art, layer/shape/raster test files, a template with artboards), each holding Affinity's own render as its thumbnail | vector-art (CC0), AFDesignLoad, Jac21/Branding and AssetStoreTemplate (MIT) upstreams. Opt-in: fetched only by `corpus --affinity` (not `--all`, not CI) and tested with `--features corpus-affinity` | `xtask/affinity-corpus.sha256` |
|
||||
| `corpus/affinity/` | 21 public Affinity documents (four Affinity 3 `.af` files, `.afdesign` vector art, layer/shape/raster test files, a template with artboards), each holding Affinity's own render as its thumbnail | vector-art (CC0), AFDesignLoad, Jac21/Branding and AssetStoreTemplate (MIT) upstreams | `xtask/affinity-corpus.sha256` |
|
||||
| `corpus/pngsuite/` | PngSuite | schaik.com release archive (public domain) | (fixed archive) |
|
||||
|
||||
```sh
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ fn list() {
|
|||
corpus/exr/ [{}] the deep OpenEXR test images (BSD-3-Clause), openexr@{}
|
||||
manifest xtask/exr-corpus.sha256. Fetch: --exr
|
||||
corpus/affinity/ [{}] 21 public Affinity 1–3 documents (CC0, MIT): vector-art, AFDesignLoad,
|
||||
Jac21/Branding, AssetStoreTemplate; manifest xtask/affinity-corpus.sha256. Fetch: --affinity (not --all)
|
||||
Jac21/Branding, AssetStoreTemplate; manifest xtask/affinity-corpus.sha256. Fetch: --affinity
|
||||
corpus/pngsuite/ [{}] PngSuite (public domain), {PNGSUITE_URL}. Fetch: --pngsuite
|
||||
corpus/tiff/, corpus/raw/ optional, copied in by hand
|
||||
|
||||
|
|
|
|||
|
|
@ -225,6 +225,5 @@ pub const AFFINITY: PinnedCorpus = PinnedCorpus {
|
|||
},
|
||||
};
|
||||
|
||||
/// Every pinned corpus `--all` fetches (and CI downloads), in fetch order. [`AFFINITY`] is
|
||||
/// fetched only on request (`--affinity`) until its files move to photocraft-corpus.
|
||||
pub const ALL: &[&PinnedCorpus] = &[&PSD_MIXED, &PSD_TOOLS, &PHOTOSHOP, &HEIF, &EXR];
|
||||
/// Every pinned corpus, in fetch order.
|
||||
pub const ALL: &[&PinnedCorpus] = &[&PSD_MIXED, &PSD_TOOLS, &PHOTOSHOP, &HEIF, &EXR, &AFFINITY];
|
||||
|
|
|
|||
Loading…
Reference in New Issue