mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
Merge main into set-d-pin
This commit is contained in:
commit
2fbdb300e3
45 files changed
+3858
-2801
No files matched your search
+2521
-2182
File diff suppressed because it is too large.
Load diff
@@ -43,6 +43,21 @@ archive.include = [
|
||||
{ path = "gate-shards.json", relative-to = "target", depth = 0, on-missing = "ignore" },
|
||||
]
|
||||
|
||||
# panic_hunt drives every command with adversarial parameters and exists to find hangs, so a hang
|
||||
# must cost seconds, not the profile's 10 minutes. It runs in 18 s on Linux and 26 s on Windows, so
|
||||
# the first slow warning comes at 15 s and a run past 45 s is terminated.
|
||||
[[profile.ci.overrides]]
|
||||
filter = 'binary(panic_hunt)'
|
||||
slow-timeout = { period = "15s", terminate-after = 3 }
|
||||
|
||||
# Content-Aware Move solves on rayon across every core. On the Windows runner the GPU tests draw
|
||||
# on the CPU-backed adapter, so two of these beside a GPU test starve it until its device poll
|
||||
# times out. Each runs alone there.
|
||||
[[profile.ci.overrides]]
|
||||
platform = 'cfg(target_os = "windows")'
|
||||
filter = 'package(photocraft-engine) & test(/content_aware_move/)'
|
||||
threads-required = "num-test-threads"
|
||||
|
||||
# Keep phase timings for the remaining expensive Windows GPU regressions visible. This does
|
||||
# not relax their timeout, isolate failures differently or remove any test cases.
|
||||
# Page eviction and budget borrowing redraw multi-effect documents. On the Windows
|
||||
|
||||
+122
-63
@@ -2,7 +2,7 @@ name: CI
|
||||
|
||||
# Quality gates for every push to main and every pull request. The Linux and Windows tests run
|
||||
# through the suite's shared gate workflow in craft-common-actions (`cargo xtask ci`, split over the
|
||||
# gate's jobs); the test variant and the corpus, web and fuzz jobs are PhotoCraft's own. Every night
|
||||
# gate's jobs); the test variant, web and fuzz jobs are PhotoCraft's own. Every night
|
||||
# the Linux gate alone runs a cold build: the safety net for the workspace crates it keeps between
|
||||
# runs (`cache-workspace-crates`), and a fresh start for that cache entry.
|
||||
on:
|
||||
@@ -16,7 +16,7 @@ on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
full_sweep:
|
||||
description: "Run every testkit sweep case (runtime comparison and integration validation)"
|
||||
description: "Run every testkit sweep case and every corpus file, as the nightly run does (runtime comparison and integration validation)"
|
||||
type: boolean
|
||||
default: false
|
||||
color_range:
|
||||
@@ -58,7 +58,9 @@ permissions:
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
RUST_BACKTRACE: 1
|
||||
PHOTOCRAFT_FULL_SWEEP: ${{ inputs.full_sweep && '1' || '0' }}
|
||||
# Every case of the long test sweeps and every corpus file (photocraft-testkit `full_sweep`): the
|
||||
# nightly run and manual runs with `full_sweep`. Other runs take a sweep part and the corpus samples.
|
||||
PHOTOCRAFT_FULL_SWEEP: ${{ (inputs.full_sweep || github.event_name == 'schedule') && '1' || '0' }}
|
||||
# No test or fuzz run may print a page: the engine refuses to spool, and if something ever
|
||||
# bypasses that, lp fails loudly on a printer that does not exist.
|
||||
PHOTOCRAFT_NO_PRINT: "1"
|
||||
@@ -87,6 +89,8 @@ jobs:
|
||||
# Pull requests run them only when they change the GPU crate, a workspace crate it builds on, any
|
||||
# package manifest, or a file outside the workspace packages other than documentation
|
||||
# (scripts/ci-windows-gpu-tests.py, #15247); the Linux gate runs them on every pull request, and main runs them on Windows too.
|
||||
# `linux_skip`: the packages the Linux gate leaves out of its test build because nothing a pull request changes
|
||||
# reaches them (same rule, every package but photocraft-gpu); empty on main, the nightly run and `full-ci`.
|
||||
# `windows_skip`: the platform-neutral packages whose Windows tests a pull request skips because nothing it
|
||||
# changes reaches them (same script); empty on main and `full-ci`.
|
||||
platforms:
|
||||
@@ -98,6 +102,7 @@ jobs:
|
||||
windows: ${{ steps.pick.outputs.windows }}
|
||||
windows_gpu: ${{ steps.pick.outputs.windows_gpu }}
|
||||
windows_skip: ${{ steps.pick.outputs.windows_skip }}
|
||||
linux_skip: ${{ steps.pick.outputs.linux_skip }}
|
||||
web: ${{ steps.pick.outputs.web }}
|
||||
steps:
|
||||
- name: Harden runner
|
||||
@@ -119,6 +124,7 @@ jobs:
|
||||
echo "windows=true"
|
||||
echo "windows_gpu=true"
|
||||
echo "windows_skip="
|
||||
echo "linux_skip="
|
||||
echo "web=true"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
@@ -142,6 +148,11 @@ jobs:
|
||||
if [ "$gpu" = false ]; then
|
||||
echo "::notice::photocraft-gpu's tests are skipped on Windows: this pull request changes nothing they are built from (the Linux gate still runs them)."
|
||||
fi
|
||||
linux_skip=$(python3 scripts/ci-windows-gpu-tests.py --skip-linux "$BASE")
|
||||
echo "linux_skip=$linux_skip" >> "$GITHUB_OUTPUT"
|
||||
if [ -n "$linux_skip" ]; then
|
||||
echo "::notice::Tests of packages the pull request does not reach are skipped on Linux (main runs them all): $linux_skip"
|
||||
fi
|
||||
skip=$(python3 scripts/ci-windows-gpu-tests.py --skip-neutral "$BASE")
|
||||
echo "windows_skip=$skip" >> "$GITHUB_OUTPUT"
|
||||
if [ -n "$skip" ]; then
|
||||
@@ -163,7 +174,10 @@ jobs:
|
||||
# the newest one. The lint legs keep no cache (`lint-cache: false`): a cold lint leg costs
|
||||
# minutes, and their entries (~1 GB per OS) would not fit the 10 GB cache budget.
|
||||
gate:
|
||||
if: github.event.action != 'labeled' || github.event.label.name == 'full-ci'
|
||||
# `platforms` is skipped on the nightly run, which tests everything. When it fails, its outputs
|
||||
# are empty (`linux_skip` included), so the gate still runs and tests everything.
|
||||
needs: platforms
|
||||
if: ${{ !cancelled() && (github.event.action != 'labeled' || github.event.label.name == 'full-ci') }}
|
||||
# Tracks @main so suite-wide CI fixes reach every app without a PR in each repository.
|
||||
uses: storytold/craft-common-actions/.github/workflows/gate.yml@main
|
||||
with:
|
||||
@@ -184,10 +198,12 @@ jobs:
|
||||
dev-debug: "0"
|
||||
cache-version: v2
|
||||
env: |
|
||||
PHOTOCRAFT_FULL_SWEEP=${{ inputs.full_sweep && '1' || '0' }}
|
||||
PHOTOCRAFT_FULL_SWEEP=${{ (inputs.full_sweep || github.event_name == 'schedule') && '1' || '0' }}
|
||||
PHOTOCRAFT_NO_PRINT=1
|
||||
LPDEST=photocraft-no-such-printer
|
||||
CARGO_PROFILE_TEST_STRIP=symbols
|
||||
PHOTOCRAFT_CI_EXCLUDE=${{ needs.platforms.outputs.linux_skip }}
|
||||
PHOTOCRAFT_CORPUS_TESTS=1
|
||||
timeout-minutes: 100
|
||||
cache-workspace-crates: true
|
||||
lint-cache: false
|
||||
@@ -195,7 +211,7 @@ jobs:
|
||||
# fmt, egui-fork, clippy, layers, panel-commands, scorecard, the wasm32 check and the
|
||||
# missing-translations report (`cargo xtask ci lint`, xtask/src/main.rs), and the CI scripts'
|
||||
# own tests.
|
||||
lint-command: python3 scripts/test-ci-gpu-lavapipe.py && python3 scripts/test-ci-windows-gpu-tests.py && python3 scripts/test-ci-test-times.py && cargo xtask ci lint
|
||||
lint-command: python3 scripts/test-ci-gpu-lavapipe.py && python3 scripts/test-ci-windows-gpu-tests.py && python3 scripts/test-ci-test-times.py && python3 scripts/test-ci-toolchain-bump.py && python3 scripts/test-ci-clear-rolling-cache.py && cargo xtask ci lint
|
||||
archive-command: cargo xtask-gate archive --gpu-shard
|
||||
after-archive-command: cargo xtask-gate doctest
|
||||
test-shards: 4
|
||||
@@ -238,7 +254,7 @@ jobs:
|
||||
# identical-code folding and PDBs; the link arguments in build.rs (/DELAYLOAD, delayimp.lib)
|
||||
# are lld-link options too.
|
||||
env: |
|
||||
PHOTOCRAFT_FULL_SWEEP=${{ inputs.full_sweep && '1' || '0' }}
|
||||
PHOTOCRAFT_FULL_SWEEP=${{ (inputs.full_sweep || github.event_name == 'schedule') && '1' || '0' }}
|
||||
PHOTOCRAFT_NO_PRINT=1
|
||||
LPDEST=photocraft-no-such-printer
|
||||
CARGO_TARGET_DIR=D:\t
|
||||
@@ -257,7 +273,7 @@ jobs:
|
||||
# budget and GitHub never evicts an entry a run still needs (an evicted Windows entry makes the
|
||||
# Windows build cold, about 60 instead of 21 minutes). It runs beside the run's jobs and prunes
|
||||
# each time a job that saves an entry finishes: the gate's build jobs (the Linux rolling entry,
|
||||
# about 4 GB, and the Windows dependency entry), web and corpus. A skipped job is listed under its
|
||||
# about 4 GB, and the Windows dependency entry) and web. A skipped job is listed under its
|
||||
# own name (a skipped reusable-workflow call under the caller job's), so a run that skips one
|
||||
# still ends. No `needs`: the gate is one reusable call, and waiting for it would leave the
|
||||
# replaced entry in place until every shard has run. A failed prune warns instead of failing the
|
||||
@@ -282,12 +298,35 @@ jobs:
|
||||
with:
|
||||
watch: true
|
||||
watch-minutes: 110
|
||||
content-keys: corpus
|
||||
saving-jobs: |
|
||||
^gate( / build \(.*\))?$
|
||||
^windows( / build \(.*\))?$
|
||||
^web build and wasm size gate$
|
||||
^corpus tests$
|
||||
|
||||
# The nightly cold run never restores the rolling crates entry, so the old entry is only overlap
|
||||
# while the cold run saves its own: two entries of about 4 GB, which with the others go over the
|
||||
# 10 GB cache limit and get the Windows, web and corpus entries evicted. This deletes the old
|
||||
# entries when the build job starts saving (scripts/ci-clear-rolling-cache.py).
|
||||
cold-cache-clear:
|
||||
name: cold cache clear
|
||||
if: github.event_name == 'schedule'
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 110
|
||||
continue-on-error: true
|
||||
permissions:
|
||||
actions: write
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Delete the old rolling entries before the save
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: python3 scripts/ci-clear-rolling-cache.py
|
||||
|
||||
# The same codecs without the optional decoder: HEIC must stay a clear "not in this build" error
|
||||
# for distributors who leave it out. Runs beside the gate and restores the gate's newest rolling
|
||||
@@ -327,9 +366,13 @@ jobs:
|
||||
libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev
|
||||
libgtk-3-dev
|
||||
|
||||
- id: rust
|
||||
uses: storytold/craft-common-actions/actions/rust-channel@f5141455aac7b2eb4708aa259d8ffcdf10fde939
|
||||
- uses: step-security/dtolnay-rust-toolchain@8dd607977d06adf4ed49b190381e74c17a9dd25f # v1.0.0
|
||||
with:
|
||||
toolchain: stable
|
||||
toolchain: ${{ steps.rust.outputs.toolchain }}
|
||||
targets: ${{ steps.rust.outputs.targets }}
|
||||
components: ${{ steps.rust.outputs.components }}
|
||||
|
||||
# The gate's own key (the shared action computes it), restore only. The toolchain action
|
||||
# exports CARGO_HOME, which the gate's legs do not have; align-environment leaves it out of
|
||||
@@ -347,50 +390,6 @@ jobs:
|
||||
|
||||
- name: Test without heif
|
||||
run: cargo nextest run -p photocraft-io --locked --profile ci
|
||||
|
||||
corpus:
|
||||
if: github.event_name != 'schedule' && (github.event.action != 'labeled' || github.event.label.name == 'full-ci')
|
||||
timeout-minutes: 30
|
||||
# Real-file corpus tests (cargo feature `corpus`), on every PR and on main. The corpora are
|
||||
# pinned in xtask/src/corpus_pins.rs and sha256-verified (xtask/*.sha256) after both a cache
|
||||
# restore and a download; a missing corpus fails the tests. The cache key changes only when a
|
||||
# pin or manifest does, so normally this restores in seconds (fork PRs read the base cache).
|
||||
name: corpus tests
|
||||
runs-on: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && 'artcraft-k8s-main' || 'ubuntu-latest' }}
|
||||
env:
|
||||
# test-corpus builds with --release, but here without the release profile's thin LTO and
|
||||
# single codegen unit: they ran LTO over the dependency graph for each of the ~95 corpus test
|
||||
# binaries, so building took 23.5 of the job's 37 minutes while the tests ran for 1.5.
|
||||
# Turning them off builds 2.7x faster; the code under test is the same.
|
||||
CARGO_PROFILE_RELEASE_LTO: "false"
|
||||
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: "16"
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: step-security/dtolnay-rust-toolchain@8dd607977d06adf4ed49b190381e74c17a9dd25f # v1.0.0
|
||||
with:
|
||||
toolchain: stable
|
||||
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
|
||||
with:
|
||||
prefix-key: v1-rust
|
||||
key: corpus
|
||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
||||
cache-on-failure: true
|
||||
- name: Restore test corpora
|
||||
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: corpus/
|
||||
key: corpus-${{ hashFiles('xtask/src/corpus_pins.rs', 'xtask/*.sha256') }}
|
||||
- name: Fetch and verify corpora
|
||||
run: cargo xtask corpus --all
|
||||
- name: Corpus tests
|
||||
run: cargo xtask test-corpus
|
||||
|
||||
web:
|
||||
timeout-minutes: 60
|
||||
name: web build and wasm size gate
|
||||
@@ -415,10 +414,13 @@ jobs:
|
||||
- name: Check out craft-i18n
|
||||
uses: storytold/craft-common-actions/actions/checkout-craft-i18n@main
|
||||
|
||||
- id: rust
|
||||
uses: storytold/craft-common-actions/actions/rust-channel@f5141455aac7b2eb4708aa259d8ffcdf10fde939
|
||||
- uses: step-security/dtolnay-rust-toolchain@8dd607977d06adf4ed49b190381e74c17a9dd25f # v1.0.0
|
||||
with:
|
||||
toolchain: stable
|
||||
targets: wasm32-unknown-unknown
|
||||
toolchain: ${{ steps.rust.outputs.toolchain }}
|
||||
targets: ${{ steps.rust.outputs.targets }}
|
||||
components: ${{ steps.rust.outputs.components }}
|
||||
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
|
||||
with:
|
||||
prefix-key: v1-rust
|
||||
@@ -463,6 +465,9 @@ jobs:
|
||||
# Placeholder: manual trigger only until a nightly schedule is enabled.
|
||||
if: github.event_name == 'workflow_dispatch' && inputs.fuzz
|
||||
runs-on: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && 'artcraft-k8s-main' || 'ubuntu-latest' }}
|
||||
env:
|
||||
# cargo-fuzz needs nightly; the checkout's rust-toolchain.toml would pick the pinned release.
|
||||
RUSTUP_TOOLCHAIN: nightly
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -534,9 +539,13 @@ jobs:
|
||||
packages: >-
|
||||
libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev
|
||||
libgtk-3-dev
|
||||
- id: rust
|
||||
uses: storytold/craft-common-actions/actions/rust-channel@f5141455aac7b2eb4708aa259d8ffcdf10fde939
|
||||
- uses: step-security/dtolnay-rust-toolchain@8dd607977d06adf4ed49b190381e74c17a9dd25f # v1.0.0
|
||||
with:
|
||||
toolchain: stable
|
||||
toolchain: ${{ steps.rust.outputs.toolchain }}
|
||||
targets: ${{ steps.rust.outputs.targets }}
|
||||
components: ${{ steps.rust.outputs.components }}
|
||||
- name: Compare exact outputs and release timings on 24 MP
|
||||
run: |
|
||||
set -o pipefail
|
||||
@@ -567,9 +576,13 @@ jobs:
|
||||
packages: >-
|
||||
libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev
|
||||
libgtk-3-dev
|
||||
- id: rust
|
||||
uses: storytold/craft-common-actions/actions/rust-channel@f5141455aac7b2eb4708aa259d8ffcdf10fde939
|
||||
- uses: step-security/dtolnay-rust-toolchain@8dd607977d06adf4ed49b190381e74c17a9dd25f # v1.0.0
|
||||
with:
|
||||
toolchain: stable
|
||||
toolchain: ${{ steps.rust.outputs.toolchain }}
|
||||
targets: ${{ steps.rust.outputs.targets }}
|
||||
components: ${{ steps.rust.outputs.components }}
|
||||
- name: Compare exact outputs and release timings on 36 MP
|
||||
run: |
|
||||
set -o pipefail
|
||||
@@ -599,9 +612,13 @@ jobs:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- id: rust
|
||||
uses: storytold/craft-common-actions/actions/rust-channel@f5141455aac7b2eb4708aa259d8ffcdf10fde939
|
||||
- uses: step-security/dtolnay-rust-toolchain@8dd607977d06adf4ed49b190381e74c17a9dd25f # v1.0.0
|
||||
with:
|
||||
toolchain: stable
|
||||
toolchain: ${{ steps.rust.outputs.toolchain }}
|
||||
targets: ${{ steps.rust.outputs.targets }}
|
||||
components: ${{ steps.rust.outputs.components }}
|
||||
# perf-nightly.yml's entry (same key and runner); only that job saves it.
|
||||
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
|
||||
with:
|
||||
@@ -632,9 +649,13 @@ jobs:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- id: rust
|
||||
uses: storytold/craft-common-actions/actions/rust-channel@f5141455aac7b2eb4708aa259d8ffcdf10fde939
|
||||
- uses: step-security/dtolnay-rust-toolchain@8dd607977d06adf4ed49b190381e74c17a9dd25f # v1.0.0
|
||||
with:
|
||||
toolchain: stable
|
||||
toolchain: ${{ steps.rust.outputs.toolchain }}
|
||||
targets: ${{ steps.rust.outputs.targets }}
|
||||
components: ${{ steps.rust.outputs.components }}
|
||||
- name: Compare exact outputs and release timings on 36 MP
|
||||
run: |
|
||||
set -o pipefail
|
||||
@@ -665,9 +686,13 @@ jobs:
|
||||
persist-credentials: false
|
||||
ref: ${{ inputs.brush_tip_base }}
|
||||
path: before
|
||||
- id: rust
|
||||
uses: storytold/craft-common-actions/actions/rust-channel@f5141455aac7b2eb4708aa259d8ffcdf10fde939
|
||||
- uses: step-security/dtolnay-rust-toolchain@8dd607977d06adf4ed49b190381e74c17a9dd25f # v1.0.0
|
||||
with:
|
||||
toolchain: stable
|
||||
toolchain: ${{ steps.rust.outputs.toolchain }}
|
||||
targets: ${{ steps.rust.outputs.targets }}
|
||||
components: ${{ steps.rust.outputs.components }}
|
||||
- name: Build the same benchmark against both versions
|
||||
run: |
|
||||
cp after/crates/paint/examples/big_dab_bench.rs before/crates/paint/examples/big_dab_bench.rs
|
||||
@@ -716,9 +741,13 @@ jobs:
|
||||
git worktree add --detach "$RUNNER_TEMP/photocraft-baseline" "$base"
|
||||
mkdir -p "$RUNNER_TEMP/photocraft-baseline/crates/engine/examples"
|
||||
cp crates/engine/examples/bench_dry_mixer.rs "$RUNNER_TEMP/photocraft-baseline/crates/engine/examples/bench_dry_mixer.rs"
|
||||
- id: rust
|
||||
uses: storytold/craft-common-actions/actions/rust-channel@f5141455aac7b2eb4708aa259d8ffcdf10fde939
|
||||
- uses: step-security/dtolnay-rust-toolchain@8dd607977d06adf4ed49b190381e74c17a9dd25f # v1.0.0
|
||||
with:
|
||||
toolchain: stable
|
||||
toolchain: ${{ steps.rust.outputs.toolchain }}
|
||||
targets: ${{ steps.rust.outputs.targets }}
|
||||
components: ${{ steps.rust.outputs.components }}
|
||||
- name: Install Linux build dependencies
|
||||
uses: storytold/craft-common-actions/actions/install-apt-packages@main
|
||||
with:
|
||||
@@ -751,3 +780,33 @@ jobs:
|
||||
with:
|
||||
name: dry-mixer-performance
|
||||
path: dry-mixer-perf.txt
|
||||
|
||||
# After the nightly cold run passes, a warning (annotation and job summary) says when a newer stable
|
||||
# Rust release than rust-toolchain.toml's exists. It needs no permission and changes nothing: a bump
|
||||
# is a pull request that changes the file's `channel` by hand.
|
||||
toolchain-check:
|
||||
name: toolchain check
|
||||
needs: gate
|
||||
if: github.event_name == 'schedule' && needs.gate.result == 'success'
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 10
|
||||
continue-on-error: true
|
||||
steps:
|
||||
- name: Harden runner
|
||||
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
|
||||
with:
|
||||
egress-policy: audit
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Compare the pinned release with stable
|
||||
run: |
|
||||
set -euo pipefail
|
||||
version=$(python3 scripts/ci-toolchain-bump.py)
|
||||
if [ -z "$version" ]; then
|
||||
echo "rust-toolchain.toml is current"
|
||||
exit 0
|
||||
fi
|
||||
msg="Rust $version is the newest stable release; rust-toolchain.toml pins an older one. Change its channel in a pull request to move."
|
||||
echo "::warning title=Newer Rust release::$msg"
|
||||
echo "$msg" >> "$GITHUB_STEP_SUMMARY"
|
||||
@@ -51,9 +51,13 @@ jobs:
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- id: rust
|
||||
uses: storytold/craft-common-actions/actions/rust-channel@f5141455aac7b2eb4708aa259d8ffcdf10fde939
|
||||
- uses: step-security/dtolnay-rust-toolchain@8dd607977d06adf4ed49b190381e74c17a9dd25f # v1.0.0
|
||||
with:
|
||||
toolchain: stable
|
||||
toolchain: ${{ steps.rust.outputs.toolchain }}
|
||||
targets: ${{ steps.rust.outputs.targets }}
|
||||
components: ${{ steps.rust.outputs.components }}
|
||||
|
||||
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
|
||||
with:
|
||||
|
||||
@@ -88,7 +88,7 @@ Conventions and paths:
|
||||
|
||||
- `unsafe` is allowed only in `crates/tablet/src/macos.rs` and `windows.rs`; the workspace sets `unsafe_code = "forbid"`. The example plug-in in `examples/plugins/` is outside the workspace and uses `unsafe` for the WebAssembly host calls. Every new crate sets `[lints] workspace = true`.
|
||||
- Attribution file: `ATTRIBUTION.md`. Fonts come from storytold/craft-fonts through `CRAFT_FONTS_DIR` (`docs/development.md` > Fonts).
|
||||
- Test corpora: storytold/photocraft-corpus, fetched into `corpus/` by `cargo xtask corpus --all` at the pins in `xtask/src/corpus_pins.rs`.
|
||||
- Test corpora: storytold/photocraft-corpus, fetched into `corpus/` by `cargo xtask corpus --all` at the pins in `xtask/src/corpus_pins.rs`. `cargo xtask test-corpus` runs each directory's fixed sample; `PHOTOCRAFT_FULL_SWEEP=1` runs every file (CI: samples on pull requests and main, every file nightly).
|
||||
- Feature names are recorded in `docs/feature-names.md`.
|
||||
- Contributor credits: `docs/contributors.md`.
|
||||
- Dev log: `log/devlog.md` (local, gitignored). `plan/` is an optional local notebook.
|
||||
|
||||
Generated
+148
-117
@@ -1365,12 +1365,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-automation",
|
||||
"craft-behavior",
|
||||
"craft-browse",
|
||||
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4)",
|
||||
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e)",
|
||||
"craft-color-ui",
|
||||
"craft-control",
|
||||
"craft-dialogs",
|
||||
@@ -1406,7 +1406,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-affinity"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"crc32fast",
|
||||
"flate2",
|
||||
@@ -1427,7 +1427,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-atomic"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"rustix 1.1.5",
|
||||
]
|
||||
@@ -1435,7 +1435,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-automation"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"craft-behavior",
|
||||
@@ -1460,7 +1460,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-behavior"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"accesskit",
|
||||
"bitflags 2.13.2",
|
||||
@@ -1478,7 +1478,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-browse"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-docpath",
|
||||
@@ -1496,7 +1496,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-cloud-ui"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"egui",
|
||||
]
|
||||
@@ -1504,7 +1504,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-cms"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"md-5",
|
||||
"rayon",
|
||||
@@ -1513,7 +1513,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-cms"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=c42c34bfa127b095fb0a8d5ccaba0c168c254062#c42c34bfa127b095fb0a8d5ccaba0c168c254062"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=7631ed550ef6b1abcc90a095dd7338e1b2c67c26#7631ed550ef6b1abcc90a095dd7338e1b2c67c26"
|
||||
dependencies = [
|
||||
"md-5",
|
||||
"rayon",
|
||||
@@ -1522,12 +1522,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-codepage"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
|
||||
[[package]]
|
||||
name = "craft-color"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=c42c34bfa127b095fb0a8d5ccaba0c168c254062#c42c34bfa127b095fb0a8d5ccaba0c168c254062"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=7631ed550ef6b1abcc90a095dd7338e1b2c67c26#7631ed550ef6b1abcc90a095dd7338e1b2c67c26"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
@@ -1535,9 +1535,9 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-color-transform"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=c42c34bfa127b095fb0a8d5ccaba0c168c254062#c42c34bfa127b095fb0a8d5ccaba0c168c254062"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=7631ed550ef6b1abcc90a095dd7338e1b2c67c26#7631ed550ef6b1abcc90a095dd7338e1b2c67c26"
|
||||
dependencies = [
|
||||
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=c42c34bfa127b095fb0a8d5ccaba0c168c254062)",
|
||||
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7631ed550ef6b1abcc90a095dd7338e1b2c67c26)",
|
||||
"craft-color",
|
||||
"serde",
|
||||
]
|
||||
@@ -1545,10 +1545,10 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-color-ui"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4)",
|
||||
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e)",
|
||||
"craft-host",
|
||||
"craft-i18n",
|
||||
"craft-keymap",
|
||||
@@ -1565,7 +1565,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-control"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-ai-agents",
|
||||
"craft-atomic",
|
||||
@@ -1580,9 +1580,9 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-crs"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4)",
|
||||
"craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e)",
|
||||
"craft-xml",
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
@@ -1590,7 +1590,15 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-crw"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "craft-crw"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=7631ed550ef6b1abcc90a095dd7338e1b2c67c26#7631ed550ef6b1abcc90a095dd7338e1b2c67c26"
|
||||
dependencies = [
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
@@ -1598,7 +1606,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-dds"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"rayon",
|
||||
]
|
||||
@@ -1606,10 +1614,13 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-develop"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=c42c34bfa127b095fb0a8d5ccaba0c168c254062#c42c34bfa127b095fb0a8d5ccaba0c168c254062"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=7631ed550ef6b1abcc90a095dd7338e1b2c67c26#7631ed550ef6b1abcc90a095dd7338e1b2c67c26"
|
||||
dependencies = [
|
||||
"craft-color",
|
||||
"craft-color-transform",
|
||||
"craft-develop-model",
|
||||
"craft-geom",
|
||||
"craft-raw 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7631ed550ef6b1abcc90a095dd7338e1b2c67c26)",
|
||||
"rayon",
|
||||
"serde",
|
||||
]
|
||||
@@ -1617,10 +1628,10 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-develop-model"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=c42c34bfa127b095fb0a8d5ccaba0c168c254062#c42c34bfa127b095fb0a8d5ccaba0c168c254062"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=7631ed550ef6b1abcc90a095dd7338e1b2c67c26#7631ed550ef6b1abcc90a095dd7338e1b2c67c26"
|
||||
dependencies = [
|
||||
"craft-geom",
|
||||
"craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=c42c34bfa127b095fb0a8d5ccaba0c168c254062)",
|
||||
"craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7631ed550ef6b1abcc90a095dd7338e1b2c67c26)",
|
||||
"miniz_oxide 0.9.1",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -1629,7 +1640,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-dialogs"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"block2 0.6.2",
|
||||
"craft-atomic",
|
||||
@@ -1654,7 +1665,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-docpath"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
@@ -1662,7 +1673,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-draw"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-color-ui",
|
||||
@@ -1681,12 +1692,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-eps"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
|
||||
[[package]]
|
||||
name = "craft-file-formats"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-eps",
|
||||
"craft-idml",
|
||||
@@ -1694,7 +1705,7 @@ dependencies = [
|
||||
"craft-kra",
|
||||
"craft-ora",
|
||||
"craft-pcraft-bundle",
|
||||
"craft-raw",
|
||||
"craft-raw 0.1.0 (git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e)",
|
||||
"craft-svg",
|
||||
"craft-zip",
|
||||
"serde",
|
||||
@@ -1704,7 +1715,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-flags"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-atomic",
|
||||
"dirs",
|
||||
@@ -1714,7 +1725,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-font-catalog"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"fontique",
|
||||
"harfrust 0.13.3",
|
||||
@@ -1729,11 +1740,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-font-manager"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-font-catalog",
|
||||
"craft-font-store",
|
||||
"craft-fonts-build",
|
||||
"craft-host",
|
||||
"craft-i18n",
|
||||
"craft-theme",
|
||||
@@ -1748,7 +1760,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-font-store"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"cap-primitives",
|
||||
"craft-atomic",
|
||||
@@ -1769,12 +1781,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-fonts-build"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
|
||||
[[package]]
|
||||
name = "craft-geom"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=c42c34bfa127b095fb0a8d5ccaba0c168c254062#c42c34bfa127b095fb0a8d5ccaba0c168c254062"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=7631ed550ef6b1abcc90a095dd7338e1b2c67c26#7631ed550ef6b1abcc90a095dd7338e1b2c67c26"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
@@ -1782,7 +1794,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-heif"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"heic-rs",
|
||||
"rayon",
|
||||
@@ -1791,7 +1803,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-host"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"craft-i18n",
|
||||
@@ -1804,7 +1816,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-i18n"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"fixed_decimal",
|
||||
@@ -1832,7 +1844,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-idml"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-xml",
|
||||
"craft-zip",
|
||||
@@ -1842,13 +1854,13 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-image-codecs"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-dds",
|
||||
"craft-heif",
|
||||
"craft-jpeg",
|
||||
"craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4)",
|
||||
"craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4)",
|
||||
"craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e)",
|
||||
"craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e)",
|
||||
"crc32fast",
|
||||
"exr",
|
||||
"flate2",
|
||||
@@ -1870,7 +1882,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-imaging"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-color-ui",
|
||||
@@ -1888,12 +1900,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ipp"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
|
||||
[[package]]
|
||||
name = "craft-jpeg"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
@@ -1901,7 +1913,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-keymap"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-host",
|
||||
"craft-i18n",
|
||||
@@ -1916,7 +1928,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-kra"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-xml",
|
||||
"craft-zip",
|
||||
@@ -1926,7 +1938,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-layers"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-i18n",
|
||||
@@ -1940,7 +1952,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-menu"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-host",
|
||||
@@ -1958,11 +1970,11 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-metadata"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"brotli-decompressor 6.3.2",
|
||||
"chrono",
|
||||
"craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4)",
|
||||
"craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e)",
|
||||
"quick-xml 0.41.0",
|
||||
"serde",
|
||||
]
|
||||
@@ -1970,11 +1982,11 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-metadata"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=c42c34bfa127b095fb0a8d5ccaba0c168c254062#c42c34bfa127b095fb0a8d5ccaba0c168c254062"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=7631ed550ef6b1abcc90a095dd7338e1b2c67c26#7631ed550ef6b1abcc90a095dd7338e1b2c67c26"
|
||||
dependencies = [
|
||||
"brotli-decompressor 6.3.2",
|
||||
"chrono",
|
||||
"craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=c42c34bfa127b095fb0a8d5ccaba0c168c254062)",
|
||||
"craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7631ed550ef6b1abcc90a095dd7338e1b2c67c26)",
|
||||
"quick-xml 0.41.0",
|
||||
"serde",
|
||||
]
|
||||
@@ -1982,7 +1994,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ora"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-xml",
|
||||
"craft-zip",
|
||||
@@ -1992,7 +2004,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-pages"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-keymap",
|
||||
@@ -2007,7 +2019,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-pcraft-bundle"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"blake3",
|
||||
"craft-atomic",
|
||||
@@ -2020,7 +2032,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-pcraft-format"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"flate2",
|
||||
"serde",
|
||||
@@ -2031,7 +2043,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-pdf"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"flate2",
|
||||
@@ -2046,7 +2058,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-pdn"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"flate2",
|
||||
"thiserror 2.0.21",
|
||||
@@ -2055,7 +2067,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-platform"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"async-channel",
|
||||
"async-io",
|
||||
@@ -2085,7 +2097,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-plist"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
@@ -2093,7 +2105,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-print"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-host",
|
||||
@@ -2116,7 +2128,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-psd"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"encoding_rs",
|
||||
"flate2",
|
||||
@@ -2127,7 +2139,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-quit"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"dispatch2",
|
||||
"egui",
|
||||
@@ -2138,12 +2150,30 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-raw"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"craft-crw",
|
||||
"craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4)",
|
||||
"craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4)",
|
||||
"craft-crw 0.1.0 (git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e)",
|
||||
"craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e)",
|
||||
"craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e)",
|
||||
"jxl-oxide",
|
||||
"miniz_oxide 0.9.1",
|
||||
"rayon",
|
||||
"serde",
|
||||
"thiserror 2.0.21",
|
||||
"zune-core",
|
||||
"zune-jpeg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "craft-raw"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=7631ed550ef6b1abcc90a095dd7338e1b2c67c26#7631ed550ef6b1abcc90a095dd7338e1b2c67c26"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"craft-crw 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7631ed550ef6b1abcc90a095dd7338e1b2c67c26)",
|
||||
"craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7631ed550ef6b1abcc90a095dd7338e1b2c67c26)",
|
||||
"craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7631ed550ef6b1abcc90a095dd7338e1b2c67c26)",
|
||||
"jxl-oxide",
|
||||
"miniz_oxide 0.9.1",
|
||||
"rayon",
|
||||
@@ -2156,7 +2186,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-review"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-host",
|
||||
@@ -2174,7 +2204,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-settings"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-atomic",
|
||||
"craft-host",
|
||||
@@ -2191,7 +2221,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-svg"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-image-codecs",
|
||||
"craft-xml",
|
||||
@@ -2212,7 +2242,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-table"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-keymap",
|
||||
@@ -2224,7 +2254,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-text"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-font-manager",
|
||||
@@ -2247,7 +2277,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-theme"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"craft-tracked",
|
||||
@@ -2262,7 +2292,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-theme-editor"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-theme",
|
||||
@@ -2273,7 +2303,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-theme-store"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-atomic",
|
||||
"craft-behavior",
|
||||
@@ -2288,7 +2318,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-tiff"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"thiserror 2.0.21",
|
||||
@@ -2297,7 +2327,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-tiff"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=c42c34bfa127b095fb0a8d5ccaba0c168c254062#c42c34bfa127b095fb0a8d5ccaba0c168c254062"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=7631ed550ef6b1abcc90a095dd7338e1b2c67c26#7631ed550ef6b1abcc90a095dd7338e1b2c67c26"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"thiserror 2.0.21",
|
||||
@@ -2306,7 +2336,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-time"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"thiserror 2.0.21",
|
||||
@@ -2315,7 +2345,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-timeline"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-keymap",
|
||||
@@ -2330,7 +2360,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-tracked"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
@@ -2338,7 +2368,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-cloud-ui",
|
||||
"craft-ui-canvas",
|
||||
@@ -2352,7 +2382,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui-canvas"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-i18n",
|
||||
@@ -2368,7 +2398,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui-contract"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"accesskit",
|
||||
"craft-behavior",
|
||||
@@ -2408,7 +2438,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui-macros"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"proc-macro-crate",
|
||||
"proc-macro2",
|
||||
@@ -2419,7 +2449,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui-panels"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-host",
|
||||
@@ -2437,7 +2467,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui-patterns"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-host",
|
||||
@@ -2458,7 +2488,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui-shell"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-host",
|
||||
@@ -2478,7 +2508,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui-widgets"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-host",
|
||||
@@ -2495,7 +2525,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-update"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"craft-host",
|
||||
@@ -2524,7 +2554,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-win32"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"winsafe",
|
||||
]
|
||||
@@ -2532,7 +2562,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-window"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"craft-atomic",
|
||||
"craft-behavior",
|
||||
@@ -2562,7 +2592,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-xcf"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"flate2",
|
||||
"thiserror 2.0.21",
|
||||
@@ -2571,7 +2601,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-xml"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"quick-xml 0.41.0",
|
||||
"serde",
|
||||
@@ -2581,7 +2611,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-zip"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"flate2",
|
||||
"thiserror 2.0.21",
|
||||
@@ -4044,7 +4074,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "hayro"
|
||||
version = "0.7.1"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"hayro-interpret",
|
||||
@@ -4074,7 +4104,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "hayro-interpret"
|
||||
version = "0.7.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"hayro-cmap",
|
||||
@@ -4092,7 +4122,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "hayro-jbig2"
|
||||
version = "0.3.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"fearless_simd",
|
||||
"hayro-ccitt",
|
||||
@@ -4116,7 +4146,7 @@ checksum = "bc2d80da85f31c3fdc0366431f44cfd645a9da1e242ed1f4a61f213d9765660f"
|
||||
[[package]]
|
||||
name = "hayro-syntax"
|
||||
version = "0.7.2"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"flate2",
|
||||
"hayro-ccitt",
|
||||
@@ -5200,7 +5230,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4"
|
||||
[[package]]
|
||||
name = "linesweeper"
|
||||
version = "0.5.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
"kurbo 0.13.1",
|
||||
@@ -6416,7 +6446,7 @@ dependencies = [
|
||||
"clap",
|
||||
"core-graphics2",
|
||||
"craft",
|
||||
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4)",
|
||||
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e)",
|
||||
"craft-image-codecs",
|
||||
"craft-svg",
|
||||
"craft-update",
|
||||
@@ -6466,7 +6496,7 @@ dependencies = [
|
||||
"craft",
|
||||
"craft-develop",
|
||||
"craft-develop-model",
|
||||
"craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4)",
|
||||
"craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e)",
|
||||
"criterion",
|
||||
"photocraft-color",
|
||||
"photocraft-geom",
|
||||
@@ -6518,7 +6548,7 @@ dependencies = [
|
||||
"clap_complete",
|
||||
"clap_mangen",
|
||||
"craft",
|
||||
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4)",
|
||||
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e)",
|
||||
"craft-image-codecs",
|
||||
"craft-psd",
|
||||
"photocraft-automation",
|
||||
@@ -6541,7 +6571,7 @@ dependencies = [
|
||||
name = "photocraft-color"
|
||||
version = "0.23.1"
|
||||
dependencies = [
|
||||
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4)",
|
||||
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e)",
|
||||
"craft-tracked",
|
||||
"craft-ui-macros",
|
||||
"serde",
|
||||
@@ -6551,7 +6581,7 @@ dependencies = [
|
||||
name = "photocraft-compose"
|
||||
version = "0.23.1"
|
||||
dependencies = [
|
||||
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4)",
|
||||
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e)",
|
||||
"criterion",
|
||||
"photocraft-color",
|
||||
"photocraft-doc",
|
||||
@@ -6585,7 +6615,7 @@ dependencies = [
|
||||
"chrono",
|
||||
"craft",
|
||||
"craft-affinity",
|
||||
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4)",
|
||||
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e)",
|
||||
"craft-develop-model",
|
||||
"craft-file-formats",
|
||||
"craft-image-codecs",
|
||||
@@ -6666,7 +6696,7 @@ name = "photocraft-gpu"
|
||||
version = "0.23.1"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4)",
|
||||
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e)",
|
||||
"half",
|
||||
"log",
|
||||
"photocraft-algo",
|
||||
@@ -6689,7 +6719,7 @@ dependencies = [
|
||||
"blake3",
|
||||
"craft",
|
||||
"craft-affinity",
|
||||
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4)",
|
||||
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e)",
|
||||
"craft-crs",
|
||||
"craft-docpath",
|
||||
"craft-file-formats",
|
||||
@@ -6700,7 +6730,7 @@ dependencies = [
|
||||
"craft-pdn",
|
||||
"craft-psd",
|
||||
"craft-svg",
|
||||
"craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4)",
|
||||
"craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e)",
|
||||
"craft-xcf",
|
||||
"craft-xml",
|
||||
"crc32fast",
|
||||
@@ -6758,7 +6788,7 @@ name = "photocraft-paint"
|
||||
version = "0.23.1"
|
||||
dependencies = [
|
||||
"base64 0.23.1",
|
||||
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4)",
|
||||
"craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e)",
|
||||
"craft-tracked",
|
||||
"craft-ui-macros",
|
||||
"photocraft-color",
|
||||
@@ -6808,8 +6838,9 @@ dependencies = [
|
||||
name = "photocraft-raw"
|
||||
version = "0.23.1"
|
||||
dependencies = [
|
||||
"craft-develop",
|
||||
"craft-image-codecs",
|
||||
"craft-raw",
|
||||
"craft-raw 0.1.0 (git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e)",
|
||||
"flate2",
|
||||
"image",
|
||||
"photocraft-raw",
|
||||
@@ -9604,7 +9635,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "vello_common"
|
||||
version = "0.0.8"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"fearless_simd",
|
||||
@@ -9652,7 +9683,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "vello_cpu"
|
||||
version = "0.0.8"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"glifo 0.1.1",
|
||||
@@ -11288,14 +11319,14 @@ source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d9
|
||||
[[patch.unused]]
|
||||
name = "hayro-cmap"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
|
||||
[[patch.unused]]
|
||||
name = "hayro-postscript"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
|
||||
[[patch.unused]]
|
||||
name = "krilla"
|
||||
version = "0.8.2"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=315a223e6935356896453c0ccee75fe9da8bdff4#315a223e6935356896453c0ccee75fe9da8bdff4"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=27e5af8151c4fb28b26165b62577c658af24553e#27e5af8151c4fb28b26165b62577c658af24553e"
|
||||
+41
-41
@@ -12,21 +12,21 @@ rust-version = "1.95"
|
||||
[workspace.dependencies]
|
||||
# The craft framework through its facade (`craft::ui::…`). The egui `[patch]` below must match
|
||||
# `craft::egui_fork::REV` (checked by `cargo xtask ci`).
|
||||
craft = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4", default-features = false }
|
||||
craft-tracked = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-ui-macros = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e", default-features = false }
|
||||
craft-tracked = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
craft-ui-macros = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
# internal
|
||||
photocraft-geom = { path = "crates/geom" }
|
||||
photocraft-color = { path = "crates/color" }
|
||||
photocraft-raster = { path = "crates/raster" }
|
||||
photocraft-doc = { path = "crates/doc" }
|
||||
photocraft-ops = { path = "crates/ops" }
|
||||
craft-plist = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
photocraft-codecs = { package = "craft-image-codecs", git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
photocraft-formats = { package = "craft-file-formats", git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4", features = ["raster-codecs", "pdf", "svg", "ora", "kra", "xcf", "pdn", "raw", "psd", "affinity", "pcraft"] }
|
||||
craft-plist = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
photocraft-codecs = { package = "craft-image-codecs", git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
photocraft-formats = { package = "craft-file-formats", git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e", features = ["raster-codecs", "pdf", "svg", "ora", "kra", "xcf", "pdn", "raw", "psd", "affinity", "pcraft"] }
|
||||
photocraft-raw = { path = "crates/raw" }
|
||||
craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
photocraft-compose = { path = "crates/compose" }
|
||||
photocraft-gpu = { path = "crates/gpu" }
|
||||
photocraft-paint = { path = "crates/paint" }
|
||||
@@ -45,36 +45,36 @@ photocraft-ipp = { path = "crates/ipp" }
|
||||
|
||||
# external
|
||||
# ICC colour management: the shared crate (replaces crates/cms; craft-libs#779).
|
||||
craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-print = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
craft-print = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
# HEIC/HEIF: the shared decoder (replaces crates/heif; craft-libs#784).
|
||||
craft-heif = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4", features = ["raster", "write-raster"] }
|
||||
craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-jpeg = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-pcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-pcraft-bundle = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-zip = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-ora = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-kra = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-xcf = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-pdn = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-heif = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e", features = ["raster", "write-raster"] }
|
||||
craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
craft-jpeg = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
craft-pcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
craft-pcraft-bundle = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
craft-zip = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
craft-ora = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
craft-kra = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
craft-xcf = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
craft-pdn = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
# Keep the shared embedded-image validation API until the framework revision includes it.
|
||||
craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4", features = ["tree-render", "tree-render-system-fonts"] }
|
||||
craft-raw = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e", features = ["tree-render", "tree-render-system-fonts"] }
|
||||
craft-raw = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
# Camera-field EXIF reader/writer, shared prerequisite craft-libs#1563.
|
||||
craft-metadata = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-crs = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-develop = { git = "https://github.com/storytold/craft-libs", rev = "c42c34bfa127b095fb0a8d5ccaba0c168c254062" }
|
||||
craft-develop-model = { git = "https://github.com/storytold/craft-libs", rev = "c42c34bfa127b095fb0a8d5ccaba0c168c254062" }
|
||||
craft-metadata = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
craft-crs = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
craft-develop = { git = "https://github.com/storytold/craft-libs", rev = "7631ed550ef6b1abcc90a095dd7338e1b2c67c26" }
|
||||
craft-develop-model = { git = "https://github.com/storytold/craft-libs", rev = "7631ed550ef6b1abcc90a095dd7338e1b2c67c26" }
|
||||
# Interface translations: lookup, fallback, CLDR plurals and language names over the craft-i18n
|
||||
# catalogs that `crates/ui-egui/build.rs` embeds from `CRAFT_I18N_DIR` (storytold/craft-i18n, at
|
||||
# the commit in `craft-i18n.rev`). Already in the tree through craft.
|
||||
craft-i18n = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-i18n = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
# craft-update: app-specific pretend versions apply to startup and manual checks.
|
||||
craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "315a223e6935356896453c0ccee75fe9da8bdff4", features = ["ui"] }
|
||||
craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "27e5af8151c4fb28b26165b62577c658af24553e", features = ["ui"] }
|
||||
thiserror = "2"
|
||||
serde = { version = "1", features = ["derive", "rc"] }
|
||||
serde_json = "1"
|
||||
@@ -339,16 +339,16 @@ opt-level = 3
|
||||
# Keep the complete egui family and native event bridge on reviewed fork commits.
|
||||
|
||||
[patch.crates-io]
|
||||
krilla = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
hayro = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
vello_common = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
vello_cpu = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
krilla = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
hayro = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
vello_common = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
vello_cpu = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
ecolor = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" }
|
||||
emath = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" }
|
||||
epaint = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" }
|
||||
|
||||
@@ -19,7 +19,7 @@ photocraft-geom = { workspace = true }
|
||||
photocraft-color = { workspace = true }
|
||||
craft-cms = { workspace = true }
|
||||
# PCTIP codec from craft-libs#1564; isolated pin until the shared revision is adopted workspace-wide.
|
||||
craft-pcraft-tip = { package = "craft-pcraft-format", git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-pcraft-tip = { package = "craft-pcraft-format", git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
photocraft-raster = { workspace = true }
|
||||
photocraft-doc = { workspace = true }
|
||||
photocraft-ops = { workspace = true }
|
||||
|
||||
@@ -238,3 +238,83 @@ fn reopened_camera_raw_smart_filter_keeps_legacy_close_curve_knots() {
|
||||
let dark = rendered.rgba(1, 1);
|
||||
assert!(dark[..3].iter().all(|&v| v < 0.1), "the lower midtone remains below the step: {dark:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn camera_raw_filter_preserves_alpha_separately() {
|
||||
use photocraft_algo::camera_raw::{self, CameraRaw, DevelopInputs};
|
||||
|
||||
let (w, h) = (32, 32);
|
||||
let alphas = [0.0_f32, 0.25, 0.5, 0.75, 1.0];
|
||||
let mut px = Vec::with_capacity(w * h);
|
||||
for y in 0..h {
|
||||
for x in 0..w {
|
||||
let a = alphas[(x + y) % alphas.len()];
|
||||
px.push([0.35 + (x as f32) * 0.005, 0.45, 0.55 - (y as f32) * 0.004, a]);
|
||||
}
|
||||
}
|
||||
let original = px.clone();
|
||||
let mut p = CameraRaw::default();
|
||||
p.temperature = 20.0;
|
||||
p.tint = -15.0;
|
||||
p.exposure = 0.6;
|
||||
p.contrast = 25.0;
|
||||
p.highlights = -30.0;
|
||||
p.shadows = 25.0;
|
||||
p.clarity = 20.0;
|
||||
p.texture = 25.0;
|
||||
p.dehaze = 15.0;
|
||||
p.sharpen_amount = 30.0;
|
||||
p.grain_amount = 20.0;
|
||||
p.vignette_amount = -25.0;
|
||||
|
||||
camera_raw::develop(&mut px, w, h, &p, &DevelopInputs::default(), true);
|
||||
|
||||
let mut rgb_changed = false;
|
||||
for (i, (got, orig)) in px.iter().zip(original.iter()).enumerate() {
|
||||
assert_eq!(got[3], orig[3], "alpha must be preserved separately at pixel {i}");
|
||||
if (0..3).any(|c| (got[c] - orig[c]).abs() > 1e-3) {
|
||||
rgb_changed = true;
|
||||
}
|
||||
}
|
||||
assert!(rgb_changed, "RGB channels should be modified by Camera Raw Filter");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn camera_raw_first_tiled_spatial_pass_matches_full_render_crop() {
|
||||
use photocraft_algo::camera_raw::{self, CameraRaw, DevelopInputs};
|
||||
|
||||
let (full_w, full_h) = (128, 128);
|
||||
let (tile_w, tile_h) = (96, 96);
|
||||
let (crop_w, crop_h) = (64, 64);
|
||||
|
||||
let make_buf = |w: usize, h: usize| -> Vec<[f32; 4]> {
|
||||
let mut buf = Vec::with_capacity(w * h);
|
||||
for y in 0..h {
|
||||
for x in 0..w {
|
||||
let wave = ((x as f32 * 0.35).sin() * (y as f32 * 0.25).cos()) * 0.15;
|
||||
buf.push([(0.45 + wave).clamp(0.05, 0.95), (0.50 - wave * 0.5).clamp(0.05, 0.95), 0.42, 0.8]);
|
||||
}
|
||||
}
|
||||
buf
|
||||
};
|
||||
|
||||
let mut p = CameraRaw::default();
|
||||
p.texture = 40.0;
|
||||
let inputs = DevelopInputs::default();
|
||||
|
||||
let mut full = make_buf(full_w, full_h);
|
||||
camera_raw::develop(&mut full, full_w, full_h, &p, &inputs, true);
|
||||
|
||||
let mut first_tile = make_buf(tile_w, tile_h);
|
||||
camera_raw::develop(&mut first_tile, tile_w, tile_h, &p, &inputs, true);
|
||||
|
||||
for y in 0..crop_h {
|
||||
for x in 0..crop_w {
|
||||
let f = full[y * full_w + x];
|
||||
let t = first_tile[y * tile_w + x];
|
||||
for c in 0..4 {
|
||||
assert!((f[c] - t[c]).abs() < 1e-5, "first tiled spatial pass mismatch vs full render crop at ({x},{y}) ch {c}: full={} tile={}", f[c], t[c]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
//! Re-render oracle over the Photoshop corpus (`corpus/photoshop`): our own Photoshop-authored
|
||||
//! PSDs from https://github.com/storytold/photocraft-corpus, fetched at a pinned commit by
|
||||
//! `cargo xtask corpus --all`. Feature `corpus` (run with `cargo xtask test-corpus`); a missing
|
||||
//! corpus fails.
|
||||
//! corpus fails. It walks the directory's sample (`photocraft_testkit::corpus`), and every file
|
||||
//! with `PHOTOCRAFT_FULL_SWEEP=1` (the nightly CI run).
|
||||
//!
|
||||
//! The io corpus test (`crates/io/tests/it/corpus.rs`) flattens imported documents, which composite
|
||||
//! Photoshop's own cached pixels for smart objects and type layers. This test throws those caches
|
||||
@@ -13,7 +14,7 @@
|
||||
//! with the corpus fonts installed (see the corpus README), so the floor counts on none of them.
|
||||
#![cfg(feature = "corpus")]
|
||||
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::path::Path;
|
||||
|
||||
use craft_psd::PsdFile;
|
||||
use photocraft_doc::{Document, LayerContent};
|
||||
@@ -22,18 +23,8 @@ use photocraft_doc::{Document, LayerContent};
|
||||
const PASS_TOL: f32 = 2.0 / 255.0;
|
||||
/// Re-rendered files that match Photoshop's merged composite (of 86 with smart objects or type).
|
||||
const PASS_FLOOR: usize = 5;
|
||||
|
||||
fn collect(dir: &Path, out: &mut Vec<PathBuf>) {
|
||||
let Ok(rd) = std::fs::read_dir(dir) else { return };
|
||||
for e in rd.flatten() {
|
||||
let p = e.path();
|
||||
if p.is_dir() {
|
||||
collect(&p, out);
|
||||
} else if p.extension().and_then(|e| e.to_str()).is_some_and(|e| e.eq_ignore_ascii_case("psd")) {
|
||||
out.push(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// `PASS_FLOOR` over the sample of `corpus/photoshop` (`photocraft_testkit::corpus`).
|
||||
const SAMPLE_PASS_FLOOR: usize = 1;
|
||||
|
||||
/// Premultiplied max difference over pixels visible in either image (1.0 if sizes differ).
|
||||
fn max_diff(a: &[[f32; 4]], b: &[[f32; 4]]) -> (f32, f32) {
|
||||
@@ -96,11 +87,8 @@ fn screen_motion_blur_retains_input_coverage() {
|
||||
/// Re-render every Photoshop oracle in the corpus with PhotoCraft's filters and compare it with Photoshop's own merged composite.
|
||||
#[test]
|
||||
fn photoshop_oracles_rerendered() {
|
||||
let root = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../corpus/photoshop");
|
||||
assert!(root.is_dir(), "{} is missing: run `cargo xtask corpus --all`", root.display());
|
||||
let mut files = Vec::new();
|
||||
collect(&root, &mut files);
|
||||
files.sort();
|
||||
let root = photocraft_testkit::corpus::root().join("photoshop");
|
||||
let files = photocraft_testkit::corpus::psd_files("photoshop");
|
||||
let mut groups: std::collections::BTreeMap<String, (usize, usize)> = Default::default();
|
||||
let (mut pass, mut total, mut errors) = (0, 0, 0);
|
||||
eprintln!("{:<60} {:>7} {:>9} {:>8} status", "file (re-rendered)", "layers", "max_err", "bad_px%");
|
||||
@@ -143,5 +131,6 @@ fn photoshop_oracles_rerendered() {
|
||||
for (g, (p, n)) in &groups {
|
||||
eprintln!("photoshop re-render: {g:<16} {p:>4} / {n:<4} pass");
|
||||
}
|
||||
assert!(pass >= PASS_FLOOR, "re-render oracle pass count {pass} fell below the floor {PASS_FLOOR}");
|
||||
let floor = if photocraft_testkit::full_sweep() { PASS_FLOOR } else { SAMPLE_PASS_FLOOR };
|
||||
assert!(pass >= floor, "re-render oracle pass count {pass} fell below the floor {floor}");
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
//! Fuzz every command with adversarial params; a command must return `Err`, never panic or hang.
|
||||
//! (Rule 9 in AGENTS.md.) Each command runs on its own thread with a timeout, so one bad command
|
||||
//! can't wedge the run — panics are caught and hangs are reported. Opt-in (slow):
|
||||
//! (Rule 9 in AGENTS.md.) Panics are counted by a hook and reported with the command; a hang is
|
||||
//! ended by nextest's slow-timeout and the last `panic_hunt:` line on stderr names it. Opt-in (slow):
|
||||
//! `cargo test -p photocraft-engine --test panic_hunt -- --ignored`.
|
||||
use photocraft_engine::{Session, command_specs};
|
||||
use serde_json::{Value, json};
|
||||
use std::panic::{AssertUnwindSafe, catch_unwind};
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::sync::{Mutex, Once, PoisonError, mpsc};
|
||||
use std::time::Duration;
|
||||
use std::sync::{Mutex, Once, PoisonError};
|
||||
|
||||
fn fresh() -> Session {
|
||||
// Belt and braces with CI's PHOTOCRAFT_NO_PRINT: nothing in this process may reach a printer
|
||||
@@ -22,10 +21,6 @@ fn fresh() -> Session {
|
||||
s
|
||||
}
|
||||
|
||||
/// Wall-clock budget for one command on the 24×16 test document. Every command needs well under
|
||||
/// 0.3 s even on a heavily loaded machine, so this only catches real hangs.
|
||||
const DEADLINE: Duration = Duration::from_secs(4);
|
||||
|
||||
/// Panics anywhere in the process, counted by a hook. `Session::execute` contains a command's
|
||||
/// panic and returns an ordinary `Err`, so the unwind never reaches `catch_unwind` here; the hook
|
||||
/// still sees it, on whichever thread (rayon workers included) it happened (#4982).
|
||||
@@ -33,14 +28,10 @@ static PANICS: AtomicUsize = AtomicUsize::new(0);
|
||||
/// One run at a time, so a panic is charged to the run that caused it.
|
||||
static RUN: Mutex<()> = Mutex::new(());
|
||||
|
||||
/// Budget for the self-test below, which checks how panics are counted, not hangs. The panic hook
|
||||
/// prints a backtrace under `RUST_BACKTRACE=1` (as in CI), and on a loaded Windows runner the
|
||||
/// first symbol lookup alone can take 15–20 s.
|
||||
const SELF_TEST_DEADLINE: Duration = Duration::from_secs(120);
|
||||
|
||||
/// Run `f` on a worker thread. `None` if it took longer than `deadline`, else whether it
|
||||
/// finished without panicking, contained or not (returning Ok or a graceful Err both count).
|
||||
fn run_watched(deadline: Duration, f: impl FnOnce() + Send + 'static) -> Option<bool> {
|
||||
/// Run `f` and say whether it finished without panicking, contained or not (returning Ok or a
|
||||
/// graceful Err both count). A hang has no deadline here: nextest's slow-timeout ends it, and the
|
||||
/// last `panic_hunt:` line on stderr names the command.
|
||||
fn run_counted(f: impl FnOnce()) -> bool {
|
||||
static HOOK: Once = Once::new();
|
||||
HOOK.call_once(|| {
|
||||
let default = std::panic::take_hook();
|
||||
@@ -51,34 +42,21 @@ fn run_watched(deadline: Duration, f: impl FnOnce() + Send + 'static) -> Option<
|
||||
});
|
||||
let _one = RUN.lock().unwrap_or_else(PoisonError::into_inner);
|
||||
let before = PANICS.load(Ordering::SeqCst);
|
||||
let (tx, rx) = mpsc::channel();
|
||||
std::thread::spawn(move || {
|
||||
let r = catch_unwind(AssertUnwindSafe(f));
|
||||
let _ = tx.send(r.is_ok());
|
||||
});
|
||||
rx.recv_timeout(deadline).ok().map(|ok| ok && PANICS.load(Ordering::SeqCst) == before)
|
||||
let ok = catch_unwind(AssertUnwindSafe(f)).is_ok();
|
||||
ok && PANICS.load(Ordering::SeqCst) == before
|
||||
}
|
||||
|
||||
/// Run `id` with `p` on a fresh session; see [`run_watched`].
|
||||
fn run_once(id: &str, p: &Value) -> Option<bool> {
|
||||
/// `Err` with a reason on panic, `Ok` otherwise. Each command runs on a fresh session.
|
||||
fn run_guarded(id: &str, p: &Value) -> Result<(), String> {
|
||||
eprintln!("panic_hunt: {id} <- {p}");
|
||||
let (id, p) = (id.to_string(), p.clone());
|
||||
run_watched(DEADLINE, move || {
|
||||
if run_counted(move || {
|
||||
let mut s = fresh();
|
||||
let _ = s.execute(&id, p);
|
||||
})
|
||||
}
|
||||
|
||||
/// `Err` with a reason on panic or hang, `Ok` otherwise.
|
||||
///
|
||||
/// The first command to touch process-wide lazy state pays for it: the first `type.create`
|
||||
/// starts the shared text engine, which scans every system font (3.5–5 s under load; #2994). A
|
||||
/// real hang reproduces and one-time setup doesn't, so a timeout counts only if a rerun on a
|
||||
/// fresh session times out too.
|
||||
fn run_guarded(id: &str, p: &Value) -> Result<(), String> {
|
||||
match run_once(id, p).or_else(|| run_once(id, p)) {
|
||||
Some(true) => Ok(()),
|
||||
Some(false) => Err("panicked".into()),
|
||||
None => Err(format!("hung (>{}s, twice)", DEADLINE.as_secs())),
|
||||
}) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err("panicked".into())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,19 +92,19 @@ fn no_command_panics_or_hangs_on_adversarial_params() {
|
||||
}
|
||||
}
|
||||
}
|
||||
assert!(bad.is_empty(), "{} commands panicked or hung:\n{}", bad.len(), bad.join("\n"));
|
||||
assert!(bad.is_empty(), "{} commands panicked:\n{}", bad.len(), bad.join("\n"));
|
||||
}
|
||||
|
||||
/// #4982: a panic the code under test contains still fails the run; a graceful `Err` does not.
|
||||
#[test]
|
||||
fn contained_panics_count_and_graceful_errors_do_not() {
|
||||
let contained = run_watched(SELF_TEST_DEADLINE, || {
|
||||
let contained = run_counted(|| {
|
||||
let _ = catch_unwind(|| panic!("contained, as Session::execute does"));
|
||||
});
|
||||
assert_eq!(contained, Some(false));
|
||||
let graceful = run_watched(SELF_TEST_DEADLINE, || {
|
||||
assert!(!contained);
|
||||
let graceful = run_counted(|| {
|
||||
let mut s = fresh();
|
||||
assert!(s.execute("layer.delete", json!({"layer": 999999})).is_err());
|
||||
});
|
||||
assert_eq!(graceful, Some(true));
|
||||
assert!(graceful);
|
||||
}
|
||||
@@ -10,47 +10,49 @@ use std::path::PathBuf;
|
||||
|
||||
use photocraft_io::{ExportOptions, export, import};
|
||||
|
||||
/// (file, ceiling). Measured differences when the importer landed are in the comments.
|
||||
const FILES: &[(&str, f64)] = &[
|
||||
("vector-art/mexican-guy.af", 3e+00), // 1.92: brush strokes as plain strokes
|
||||
("vector-art/mexican-man.af", 4e+00), // 2.74
|
||||
("vector-art/mexican-woman.af", 4e+00), // 2.24
|
||||
("vector-art/playing-cards.af", 4e+00), // 3.04: layer effects
|
||||
("vector-art/beer.afdesign", 4e+00), // 2.91
|
||||
("vector-art/cactus.afdesign", 2e+00), // 0.57
|
||||
("vector-art/car.afdesign", 2e+00), // 0.39
|
||||
("vector-art/flowers.afdesign", 3e+00), // 2.09
|
||||
("vector-art/lion-track.afdesign", 6e+00), // 4.41
|
||||
("afdesignload/color.afdesign", 1e+00), // 0.00
|
||||
("afdesignload/layer_mode.afdesign", 1e+00), // 0.00
|
||||
("afdesignload/layer_test.afdesign", 1e+00), // 0.00
|
||||
("afdesignload/margins.afdesign", 1e+00), // 0.00
|
||||
("afdesignload/raster_test.afdesign", 2e+00), // 0.82: pixel layer
|
||||
("afdesignload/revision_test.afdesign", 1e+00), // 0.01
|
||||
("afdesignload/shape_test.afdesign", 6e+00), // 5.44 after importing the public cloud/heart geometry
|
||||
("afdesignload/slice_test.afdesign", 1e+00), // 0.02
|
||||
("afdesignload/test_path.afdesign", 2e+00), // 1.37
|
||||
("jac21/SimpleLogo.afdesign", 2e+00), // 0.78
|
||||
("jac21/SimpleLogoBanner.afdesign", 4e+00), // 2.72: placed images in a Display P3 document
|
||||
("asset-store-template/AssetStore.aftemplate", 1e+00), // 0.00: artboards
|
||||
("affinity-samples/01-layer-effects.af", 11.0), // 8.86–9.64 measured (fonts differ by machine): effects and live filters not imported
|
||||
("affinity-samples/02-adjustment-layers.af", 38.0), // 36.19–36.69 measured (fonts differ by machine): adjustment layers not imported
|
||||
("affinity-samples/03-brush-strokes.af", 3.0), // 1.39–1.93 measured (fonts differ by machine): pressure strokes approximated
|
||||
("affinity-samples/04-master-page.af", 3.0), // 1.49–1.51 measured (fonts differ by machine): master content not placed on pages
|
||||
("affinity-samples/05-symbols.af", 21.5), // 19.49–20.47 measured (fonts differ by machine): cached symbol and embedded pictures
|
||||
("affinity-samples/06-special-shapes.af", 7.5), // 5.68–6.42 measured (fonts differ by machine): special-shape geometry
|
||||
("affinity-samples/07-transparency.af", 13.5), // 11.61–12.40 measured (fonts differ by machine): transparency and bitmap fills
|
||||
("affinity-samples/08-gradients.af", 2.0), // 0.44–0.94 measured (fonts differ by machine): conical gradient currently maps to Angle
|
||||
("affinity-samples/09-corners-stars.af", 2.5), // 0.80–1.48 measured (fonts differ by machine): non-round corners and rounded stars
|
||||
("affinity-samples/10-multiple-fills.af", 11.5), // 9.50–10.29 measured (fonts differ by machine): only one fill/stroke per object
|
||||
("affinity-samples/11-text.af", 4.5), // 2.66–3.41 measured (fonts differ by machine): outlined/scaled text and text fields
|
||||
("affinity-samples/12-cmyk8.af", 16.0), // 14.04–14.67 measured (fonts differ by machine): document profile not applied
|
||||
("affinity-samples/12-grey8.af", 26.5), // 24.85–25.47 measured (fonts differ by machine): grey document opened as RGB
|
||||
("affinity-samples/12-lab16.af", 7.5), // 5.55–6.17 measured (fonts differ by machine): Lab profile and depth not preserved
|
||||
("affinity-samples/12-rgb16.af", 2.5), // 0.47–1.09 measured (fonts differ by machine): image content remains close after conversion
|
||||
("affinity-samples/12-rgb32.af", 87.5), // 86.05–86.19 measured (fonts differ by machine): 32-bit RGB is reduced to 8-bit
|
||||
("affinity-samples/12-rgb8.af", 2.5), // 0.47–1.10 measured (fonts differ by machine): RGB/8 reference
|
||||
("affinity-samples/13-blend-modes.af", 12.0), // 9.67–10.57 measured (fonts differ by machine): Affinity-only blend modes map to Normal
|
||||
/// (file, ceiling, in the gate's sample). Measured differences when the importer landed are in the
|
||||
/// comments. Every run checks the sampled rows; `PHOTOCRAFT_FULL_SWEEP=1` (the nightly CI run)
|
||||
/// checks them all.
|
||||
const FILES: &[(&str, f64, bool)] = &[
|
||||
("vector-art/mexican-guy.af", 3e+00, false), // 1.92: brush strokes as plain strokes
|
||||
("vector-art/mexican-man.af", 4e+00, false), // 2.74
|
||||
("vector-art/mexican-woman.af", 4e+00, false), // 2.24
|
||||
("vector-art/playing-cards.af", 4e+00, false), // 3.04: layer effects
|
||||
("vector-art/beer.afdesign", 4e+00, false), // 2.91
|
||||
("vector-art/cactus.afdesign", 2e+00, false), // 0.57
|
||||
("vector-art/car.afdesign", 2e+00, false), // 0.39
|
||||
("vector-art/flowers.afdesign", 3e+00, false), // 2.09
|
||||
("vector-art/lion-track.afdesign", 6e+00, false), // 4.41
|
||||
("afdesignload/color.afdesign", 1e+00, false), // 0.00
|
||||
("afdesignload/layer_mode.afdesign", 1e+00, true), // 0.00
|
||||
("afdesignload/layer_test.afdesign", 1e+00, false), // 0.00
|
||||
("afdesignload/margins.afdesign", 1e+00, false), // 0.00
|
||||
("afdesignload/raster_test.afdesign", 2e+00, true), // 0.82: pixel layer
|
||||
("afdesignload/revision_test.afdesign", 1e+00, false), // 0.01
|
||||
("afdesignload/shape_test.afdesign", 6e+00, true), // 5.44 after importing the public cloud/heart geometry
|
||||
("afdesignload/slice_test.afdesign", 1e+00, false), // 0.02
|
||||
("afdesignload/test_path.afdesign", 2e+00, false), // 1.37
|
||||
("jac21/SimpleLogo.afdesign", 2e+00, true), // 0.78
|
||||
("jac21/SimpleLogoBanner.afdesign", 4e+00, false), // 2.72: placed images in a Display P3 document
|
||||
("asset-store-template/AssetStore.aftemplate", 1e+00, false), // 0.00: artboards
|
||||
("affinity-samples/01-layer-effects.af", 11.0, false), // 8.86–9.64 measured (fonts differ by machine): effects and live filters not imported
|
||||
("affinity-samples/02-adjustment-layers.af", 38.0, false), // 36.19–36.69 measured (fonts differ by machine): adjustment layers not imported
|
||||
("affinity-samples/03-brush-strokes.af", 3.0, false), // 1.39–1.93 measured (fonts differ by machine): pressure strokes approximated
|
||||
("affinity-samples/04-master-page.af", 3.0, false), // 1.49–1.51 measured (fonts differ by machine): master content not placed on pages
|
||||
("affinity-samples/05-symbols.af", 21.5, false), // 19.49–20.47 measured (fonts differ by machine): cached symbol and embedded pictures
|
||||
("affinity-samples/06-special-shapes.af", 7.5, true), // 5.68–6.42 measured (fonts differ by machine): special-shape geometry
|
||||
("affinity-samples/07-transparency.af", 13.5, false), // 11.61–12.40 measured (fonts differ by machine): transparency and bitmap fills
|
||||
("affinity-samples/08-gradients.af", 2.0, false), // 0.44–0.94 measured (fonts differ by machine): conical gradient currently maps to Angle
|
||||
("affinity-samples/09-corners-stars.af", 2.5, false), // 0.80–1.48 measured (fonts differ by machine): non-round corners and rounded stars
|
||||
("affinity-samples/10-multiple-fills.af", 11.5, false), // 9.50–10.29 measured (fonts differ by machine): only one fill/stroke per object
|
||||
("affinity-samples/11-text.af", 4.5, false), // 2.66–3.41 measured (fonts differ by machine): outlined/scaled text and text fields
|
||||
("affinity-samples/12-cmyk8.af", 16.0, false), // 14.04–14.67 measured (fonts differ by machine): document profile not applied
|
||||
("affinity-samples/12-grey8.af", 26.5, false), // 24.85–25.47 measured (fonts differ by machine): grey document opened as RGB
|
||||
("affinity-samples/12-lab16.af", 7.5, false), // 5.55–6.17 measured (fonts differ by machine): Lab profile and depth not preserved
|
||||
("affinity-samples/12-rgb16.af", 2.5, false), // 0.47–1.09 measured (fonts differ by machine): image content remains close after conversion
|
||||
("affinity-samples/12-rgb32.af", 87.5, false), // 86.05–86.19 measured (fonts differ by machine): 32-bit RGB is reduced to 8-bit
|
||||
("affinity-samples/12-rgb8.af", 2.5, false), // 0.47–1.10 measured (fonts differ by machine): RGB/8 reference
|
||||
("affinity-samples/13-blend-modes.af", 12.0, false), // 9.67–10.57 measured (fonts differ by machine): Affinity-only blend modes map to Normal
|
||||
];
|
||||
|
||||
fn corpus(rel: &str) -> Vec<u8> {
|
||||
@@ -99,11 +101,22 @@ fn shrink(src: &[f64], sw: usize, sh: usize, dw: usize, dh: usize) -> Vec<f64> {
|
||||
|
||||
#[test]
|
||||
fn public_affinity_documents_match_their_render_reference() {
|
||||
let full = photocraft_testkit::full_sweep();
|
||||
let rows: Vec<_> = FILES.iter().filter(|(_, _, sampled)| full || *sampled).collect();
|
||||
eprintln!("affinity corpus: {} of {} files; PHOTOCRAFT_FULL_SWEEP=1 runs every file", rows.len(), FILES.len());
|
||||
let mut failures = Vec::new();
|
||||
for (name, ceiling) in FILES {
|
||||
for (name, ceiling, _) in rows {
|
||||
let bytes = corpus(name);
|
||||
let r = import(name, &bytes).unwrap();
|
||||
assert!(!r.preview_only, "{name} opened as its preview: {:?}", r.warnings);
|
||||
// #1606: the special shapes the sample uses are all imported, none as a bounding ellipse.
|
||||
if *name == "affinity-samples/06-special-shapes.af" {
|
||||
assert!(
|
||||
!r.warnings.iter().any(|w| w.contains("unrecognized parametric shape")),
|
||||
"supported special-shape sample still reports a bounding-ellipse fallback: {:?}",
|
||||
r.warnings
|
||||
);
|
||||
}
|
||||
let reference = if name.starts_with("affinity-samples/") {
|
||||
let path = if *name == "affinity-samples/04-master-page.af" {
|
||||
"affinity-samples/04-master-page_1.png".to_string()
|
||||
@@ -134,25 +147,3 @@ fn public_affinity_documents_match_their_render_reference() {
|
||||
}
|
||||
assert!(failures.is_empty(), "{}", failures.join("\n"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn issue_1606_special_shapes_match_the_exported_sample() {
|
||||
let name = "affinity-samples/06-special-shapes.af";
|
||||
let bytes = corpus(name);
|
||||
let imported = import(name, &bytes).unwrap();
|
||||
assert!(
|
||||
!imported.warnings.iter().any(|w| w.contains("unrecognized parametric shape")),
|
||||
"supported special-shape sample still reports a bounding-ellipse fallback: {:?}",
|
||||
imported.warnings
|
||||
);
|
||||
let rendered = photocraft_codecs::decode(&export(&imported.document, "x.png", &ExportOptions::default()).unwrap().bytes).unwrap();
|
||||
let reference = photocraft_codecs::decode(&corpus("affinity-samples/06-special-shapes.png")).unwrap();
|
||||
let (rw, rh) = reference.dimensions();
|
||||
let (ow, oh) = rendered.dimensions();
|
||||
let (w, h) = (rw.min(ow), rh.min(oh));
|
||||
let got = shrink(&on_white(&rendered.to_rgba8()), ow as usize, oh as usize, w as usize, h as usize);
|
||||
let want = shrink(&on_white(&reference.to_rgba8()), rw as usize, rh as usize, w as usize, h as usize);
|
||||
let diff = got.iter().zip(&want).map(|(a, b)| (a - b).abs()).sum::<f64>() / want.len() as f64;
|
||||
eprintln!("{name} vs exported PNG: {diff:.2} ({}×{} vs {}×{})", ow, oh, rw, rh);
|
||||
assert!(diff <= 7.5, "special-shape sample exceeded its corpus ceiling: {diff:.2} > 7.5");
|
||||
}
|
||||
@@ -4,28 +4,34 @@
|
||||
|
||||
use craft_psd::PsdFile;
|
||||
use photocraft_color::BlendMode;
|
||||
use photocraft_doc::Document;
|
||||
use photocraft_geom::Rect;
|
||||
use photocraft_io::{import, merged_composite};
|
||||
|
||||
const CELL: i32 = 64;
|
||||
|
||||
/// The largest and mean difference in 8-bit levels between our flatten and Photoshop's merged image
|
||||
/// over the cell of `mode`, on the pixels where that cell's duck is fully opaque (its anti-aliased
|
||||
/// edge mixes in the backdrop, which says nothing about the mode).
|
||||
fn cell_error(mode: BlendMode) -> (f32, f32) {
|
||||
/// rgb-blend-modes.psd as imported, and Photoshop's merged image of it.
|
||||
fn load() -> (Document, Vec<[f32; 4]>) {
|
||||
let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../../corpus/psd-tools/blend-modes/rgb-blend-modes.psd");
|
||||
let bytes = std::fs::read(path).expect("run cargo xtask corpus --psd-tools");
|
||||
let doc = import("rgb-blend-modes.psd", &bytes).expect("opens").document;
|
||||
let file = PsdFile::from_bytes(&bytes).expect("parses");
|
||||
let merged = merged_composite(&file).expect("merged image");
|
||||
let ours = photocraft_compose::flatten(&doc).into_px();
|
||||
(doc, merged_composite(&file).expect("merged image"))
|
||||
}
|
||||
|
||||
/// The largest and mean difference in 8-bit levels between our render and Photoshop's merged image
|
||||
/// over the cell of `mode`, on the pixels where that cell's duck is fully opaque (its anti-aliased
|
||||
/// edge mixes in the backdrop, which says nothing about the mode). Only the cell is rendered.
|
||||
fn cell_error(doc: &Document, merged: &[[f32; 4]], mode: BlendMode) -> (f32, f32) {
|
||||
let width = doc.size.width as i32;
|
||||
let duck = doc.walk().into_iter().map(|(_, _, l)| l).find(|l| l.name == "rubber_duck_PNG1" && l.blend == mode).expect("the mode's duck");
|
||||
let surface = duck.surface().expect("duck pixels");
|
||||
let bounds = surface.content_bounds();
|
||||
let (x0, y0) = ((bounds.x0 / CELL) * CELL, (bounds.y0 / CELL) * CELL);
|
||||
let cell = Rect::from_xywh(x0, y0, CELL as u32, CELL as u32);
|
||||
let mut alpha = vec![[0.0f32; 4]; (CELL * CELL) as usize];
|
||||
surface.read_rgba_into(Rect::from_xywh(x0, y0, CELL as u32, CELL as u32), &mut alpha);
|
||||
surface.read_rgba_into(cell, &mut alpha);
|
||||
let ours = photocraft_compose::render(doc, cell).into_px();
|
||||
let (mut max, mut sum, mut n) = (0.0f32, 0.0f32, 0u32);
|
||||
for y in 1..CELL - 1 {
|
||||
for x in 1..CELL - 1 {
|
||||
@@ -34,9 +40,9 @@ fn cell_error(mode: BlendMode) -> (f32, f32) {
|
||||
if !(opaque(0, 0) && opaque(-1, 0) && opaque(1, 0) && opaque(0, -1) && opaque(0, 1)) {
|
||||
continue;
|
||||
}
|
||||
let i = ((y0 + y) * width + x0 + x) as usize;
|
||||
let (o, m) = (ours[(y * CELL + x) as usize], merged[((y0 + y) * width + x0 + x) as usize]);
|
||||
for c in 0..3 {
|
||||
let d = ((ours[i][c] * 255.0).round() - (merged[i][c] * 255.0).round()).abs();
|
||||
let d = ((o[c] * 255.0).round() - (m[c] * 255.0).round()).abs();
|
||||
max = max.max(d);
|
||||
sum += d;
|
||||
n += 1;
|
||||
@@ -51,7 +57,8 @@ fn cell_error(mode: BlendMode) -> (f32, f32) {
|
||||
/// was up to 20 levels too light; the W3C curve Photoshop uses is within 7.
|
||||
#[test]
|
||||
fn soft_light_matches_photoshop_over_dark_backdrops() {
|
||||
let (max, mean) = cell_error(BlendMode::SoftLight);
|
||||
let (doc, merged) = load();
|
||||
let (max, mean) = cell_error(&doc, &merged, BlendMode::SoftLight);
|
||||
eprintln!("Soft Light: max {max} mean {mean:.3}");
|
||||
assert!(max <= 7.0 && mean < 0.6, "max {max} mean {mean}");
|
||||
}
|
||||
@@ -59,8 +66,9 @@ fn soft_light_matches_photoshop_over_dark_backdrops() {
|
||||
/// The modes #8804 checked next to Soft Light stay where they were.
|
||||
#[test]
|
||||
fn separable_light_modes_match_photoshop() {
|
||||
let (doc, merged) = load();
|
||||
for mode in [BlendMode::Multiply, BlendMode::Screen, BlendMode::Overlay, BlendMode::HardLight] {
|
||||
let (max, mean) = cell_error(mode);
|
||||
let (max, mean) = cell_error(&doc, &merged, mode);
|
||||
eprintln!("{mode:?}: max {max} mean {mean:.3}");
|
||||
assert!(max <= 3.0, "{mode:?}: max {max} mean {mean}");
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
//! Real-file corpora (feature `corpus`; run with `cargo xtask test-corpus`). The corpora are
|
||||
//! gitignored, never committed, and fetched at pinned commits and sha256-verified by
|
||||
//! `cargo xtask corpus --all` (pins: `xtask/src/corpus_pins.rs`). A missing corpus fails.
|
||||
//! Each test walks its directory's fixed sample (`photocraft_testkit::corpus`), and every file with
|
||||
//! `PHOTOCRAFT_FULL_SWEEP=1` (the nightly CI run); the floors below exist for both.
|
||||
//!
|
||||
//! - `corpus/psd/**/*.{psd,psb}`: a hand-picked mix of small ag-psd and psd-tools samples
|
||||
//! (manifest `xtask/psd-corpus.sha256`).
|
||||
@@ -40,31 +42,19 @@
|
||||
//! Every exported file must also pass `common::strict_block_errors` (#200): each tagged block
|
||||
//! re-parses strictly, with the padding Photoshop writes, so other readers (psd-tools) stay aligned.
|
||||
//!
|
||||
//! `*_mutations_never_panic` truncates and corrupts every corpus file and
|
||||
//! `*_mutations_never_panic` truncates and corrupts each file and
|
||||
//! asserts import + flatten return (Ok or Err) without panicking.
|
||||
#![cfg(feature = "corpus")]
|
||||
|
||||
use crate::common;
|
||||
|
||||
use std::panic::{AssertUnwindSafe, catch_unwind};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::path::PathBuf;
|
||||
use std::time::Instant;
|
||||
|
||||
use craft_psd::PsdFile;
|
||||
use photocraft_io::*;
|
||||
|
||||
fn collect(dir: &Path, out: &mut Vec<PathBuf>) {
|
||||
let Ok(rd) = std::fs::read_dir(dir) else { return };
|
||||
for e in rd.flatten() {
|
||||
let p = e.path();
|
||||
if p.is_dir() {
|
||||
collect(&p, out);
|
||||
} else if p.extension().and_then(|e| e.to_str()).is_some_and(|e| e.eq_ignore_ascii_case("psd") || e.eq_ignore_ascii_case("psb")) {
|
||||
out.push(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const PASS_TOL: f32 = 2.0 / 255.0;
|
||||
/// Export → re-import must render within one 8-bit step of the imported document.
|
||||
const ROUNDTRIP_TOL: f32 = 1.0 / 255.0 + 1e-5;
|
||||
@@ -134,10 +124,11 @@ thread_local! {
|
||||
/// Files known to be invalid upstream: their parse error is expected.
|
||||
const KNOWN_BAD: &[(&str, &str)] = &[("group-divider-blend-mode.psd", "malformed merged image data; recovery is tested in psd_damaged_merged.rs (#6152)")];
|
||||
|
||||
/// One corpus directory with its own floors.
|
||||
/// One corpus directory with its own floors: for every file (a full sweep) and for the
|
||||
/// directory's sample in `photocraft_testkit::corpus` (every other run).
|
||||
struct Source {
|
||||
label: &'static str,
|
||||
/// Location, relative to the workspace root.
|
||||
/// Directory under `corpus/`.
|
||||
dir: &'static str,
|
||||
/// Path components naming a feature group for the per-group totals (0: no groups).
|
||||
group_depth: usize,
|
||||
@@ -145,24 +136,50 @@ struct Source {
|
||||
pass_floor: usize,
|
||||
/// Files whose export → re-import renders the same as the import.
|
||||
roundtrip_floor: usize,
|
||||
/// `pass_floor` over the sample.
|
||||
sample_pass_floor: usize,
|
||||
/// `roundtrip_floor` over the sample.
|
||||
sample_roundtrip_floor: usize,
|
||||
}
|
||||
|
||||
impl Source {
|
||||
/// The pass and round-trip floors of this run.
|
||||
fn floors(&self) -> (usize, usize) {
|
||||
if photocraft_testkit::full_sweep() { (self.pass_floor, self.roundtrip_floor) } else { (self.sample_pass_floor, self.sample_roundtrip_floor) }
|
||||
}
|
||||
}
|
||||
|
||||
/// Hand-picked mix in `corpus/psd` (170 files: 134 vs the merged image + 12 vs the thumbnail).
|
||||
const MIXED: Source = Source { label: "io corpus", dir: "corpus/psd", group_depth: 0, pass_floor: 148, roundtrip_floor: 169 };
|
||||
const MIXED: Source =
|
||||
Source { label: "io corpus", dir: "psd", group_depth: 0, pass_floor: 148, roundtrip_floor: 169, sample_pass_floor: 9, sample_roundtrip_floor: 9 };
|
||||
|
||||
/// The full psd-tools test set (309 files at the pinned commit; see `xtask/psd-tools-corpus.sha256`):
|
||||
/// 226 vs the merged image + 10 vs the thumbnail (Advanced Blending knockouts: +7).
|
||||
const PSD_TOOLS: Source = Source { label: "psd-tools corpus", dir: "corpus/psd-tools", group_depth: 0, pass_floor: 249, roundtrip_floor: 308 };
|
||||
const PSD_TOOLS: Source = Source {
|
||||
label: "psd-tools corpus",
|
||||
dir: "psd-tools",
|
||||
group_depth: 0,
|
||||
pass_floor: 249,
|
||||
roundtrip_floor: 308,
|
||||
sample_pass_floor: 18,
|
||||
sample_roundtrip_floor: 23,
|
||||
};
|
||||
|
||||
/// Our Photoshop-authored oracles (258 files; https://github.com/storytold/photocraft-corpus),
|
||||
/// grouped by feature (`smart-filters`, `effects`, `text`, `adjustments/<mode><bits>`).
|
||||
const PHOTOSHOP: Source = Source { label: "photoshop oracles", dir: "corpus/photoshop", group_depth: 2, pass_floor: 190, roundtrip_floor: 258 };
|
||||
const PHOTOSHOP: Source = Source {
|
||||
label: "photoshop oracles",
|
||||
dir: "photoshop",
|
||||
group_depth: 2,
|
||||
pass_floor: 190,
|
||||
roundtrip_floor: 258,
|
||||
sample_pass_floor: 14,
|
||||
sample_roundtrip_floor: 15,
|
||||
};
|
||||
|
||||
/// The corpus directory; a missing corpus fails the test.
|
||||
fn locate(src: &Source) -> PathBuf {
|
||||
let root = Path::new(env!("CARGO_MANIFEST_DIR")).join("../..").join(src.dir);
|
||||
assert!(root.is_dir(), "{}: {} is missing: run `cargo xtask corpus --all`", src.label, root.display());
|
||||
root
|
||||
/// The files of `src` this run takes, and the directory their names are relative to.
|
||||
fn files_of(src: &Source) -> (PathBuf, Vec<PathBuf>) {
|
||||
(photocraft_testkit::corpus::root().join(src.dir), photocraft_testkit::corpus::psd_files(src.dir))
|
||||
}
|
||||
|
||||
/// Feature group of a corpus-relative path: its first `depth` directories.
|
||||
@@ -172,13 +189,6 @@ fn group_of(name: &str, depth: usize) -> String {
|
||||
if n == 0 { ".".into() } else { parts[..n].join("/") }
|
||||
}
|
||||
|
||||
fn files_in(root: &Path) -> Vec<PathBuf> {
|
||||
let mut files = Vec::new();
|
||||
collect(root, &mut files);
|
||||
files.sort();
|
||||
files
|
||||
}
|
||||
|
||||
fn panic_message(e: &(dyn std::any::Any + Send)) -> String {
|
||||
e.downcast_ref::<&str>().map(|s| (*s).to_string()).or_else(|| e.downcast_ref::<String>().cloned()).unwrap_or_else(|| "panic".into())
|
||||
}
|
||||
@@ -374,8 +384,7 @@ fn check_file(name: &str, bytes: &[u8]) -> (Outcome, Option<f32>) {
|
||||
}
|
||||
|
||||
fn run_oracle(src: &Source) {
|
||||
let root = locate(src);
|
||||
let files = files_in(&root);
|
||||
let (root, files) = files_of(src);
|
||||
BLOCK_ERRORS.with(|b| b.borrow_mut().clear());
|
||||
let mut groups: std::collections::BTreeMap<String, (usize, usize)> = Default::default();
|
||||
let (mut pass, mut thumb_pass, mut diff, mut skipped, mut errors) = (0, 0, 0, 0, 0);
|
||||
@@ -432,8 +441,9 @@ fn run_oracle(src: &Source) {
|
||||
}
|
||||
assert!(crashes.is_empty(), "{label}: panics (Rule 9): {crashes:?}");
|
||||
assert!(block_errors.is_empty(), "{label}: exported tagged blocks fail the strict re-parse (#200): {block_errors:?}");
|
||||
assert!(pass >= src.pass_floor, "{label}: oracle pass count {pass} fell below the floor {}", src.pass_floor);
|
||||
assert!(rt_same >= src.roundtrip_floor, "{label}: export round trip {rt_same} fell below the floor {}: {rt_diff:?}", src.roundtrip_floor);
|
||||
let (pass_floor, roundtrip_floor) = src.floors();
|
||||
assert!(pass >= pass_floor, "{label}: oracle pass count {pass} fell below the floor {pass_floor}");
|
||||
assert!(rt_same >= roundtrip_floor, "{label}: export round trip {rt_same} fell below the floor {roundtrip_floor}: {rt_diff:?}");
|
||||
}
|
||||
|
||||
/// Deterministic xorshift for the mutation sweep.
|
||||
@@ -444,12 +454,14 @@ fn next(state: &mut u64) -> u64 {
|
||||
*state
|
||||
}
|
||||
|
||||
/// Truncations and byte corruptions of every corpus file: import (and flatten when the document
|
||||
/// Truncations and byte corruptions of each file: import (and flatten when the document
|
||||
/// is small) must return without panicking. Files are mutated in their first 64 KB, where the
|
||||
/// header, resources and layer records live.
|
||||
/// header, resources and layer records live. A full sweep cuts each file at every eighth and
|
||||
/// corrupts it 24 times; other runs cut at every other eighth and keep the first 8 corruptions
|
||||
/// (the same seeds).
|
||||
fn run_mutations(src: &Source) {
|
||||
let root = locate(src);
|
||||
let files = files_in(&root);
|
||||
let (root, files) = files_of(src);
|
||||
let (cut_step, corruptions) = if photocraft_testkit::full_sweep() { (1, 24) } else { (2, 8) };
|
||||
let (mut runs, mut panics, mut slow) = (0usize, Vec::new(), Vec::new());
|
||||
for p in &files {
|
||||
let name = p.strip_prefix(&root).unwrap_or(p).display().to_string();
|
||||
@@ -457,11 +469,11 @@ fn run_mutations(src: &Source) {
|
||||
let mut seed = 0x9E37_79B9_7F4A_7C15u64 ^ bytes.len() as u64;
|
||||
let span = bytes.len().clamp(1, 64 * 1024);
|
||||
let mut variants: Vec<(String, Vec<u8>)> = Vec::new();
|
||||
for k in 1..8 {
|
||||
for k in (1..8).step_by(cut_step) {
|
||||
let cut = bytes.len() * k / 8;
|
||||
variants.push((format!("truncate@{cut}"), bytes[..cut].to_vec()));
|
||||
}
|
||||
for _ in 0..24 {
|
||||
for _ in 0..corruptions {
|
||||
let mut m = bytes.clone();
|
||||
let flips = 1 + (next(&mut seed) % 4) as usize;
|
||||
for _ in 0..flips {
|
||||
|
||||
@@ -201,10 +201,16 @@ fn psd_tools(name: &str) -> Vec<u8> {
|
||||
}
|
||||
|
||||
/// The reference editor's flat CMYK file (24.7): the "light teal" spot (solid at 1348,1492) and "Alpha 1"
|
||||
/// both open, and the image stays opaque where the spot is inked.
|
||||
/// both open, and the image stays opaque where the spot is inked. Its one import (16.8 MP) takes
|
||||
/// seconds in a test build, so it runs in full sweeps only (`PHOTOCRAFT_FULL_SWEEP=1`, the nightly
|
||||
/// CI run); the generated files above check the same reading in every run.
|
||||
#[cfg(feature = "corpus")]
|
||||
#[test]
|
||||
fn corpus_flat_photoshop_file_keeps_its_spot() {
|
||||
if !photocraft_testkit::full_sweep() {
|
||||
eprintln!("cmyk-alpha-spot.psd runs with PHOTOCRAFT_FULL_SWEEP=1 only");
|
||||
return;
|
||||
}
|
||||
let doc = import("cmyk-alpha-spot.psd", &psd_tools("cmyk-alpha-spot.psd")).unwrap().document;
|
||||
let names: Vec<_> = doc.channels.iter().map(|c| c.name.as_str()).collect();
|
||||
assert_eq!(names, ["light teal", "Alpha 1"]);
|
||||
|
||||
@@ -735,14 +735,20 @@ fn raw_open_legacy_baseline_pixels() {
|
||||
let tuned_px = [sample_rgb16(tuned_img.data(), w, 0, 0), sample_rgb16(tuned_img.data(), w, 7, 7), sample_rgb16(tuned_img.data(), w, 15, 15)];
|
||||
let tuned_hash = fnv1a_u16(tuned_img.data());
|
||||
|
||||
// Default RAW Open (`def_px`/`def_hash`) runs `craft_develop::sensor::demosaic` (`reflect` borders;
|
||||
// center pixel `[47838, 39368, 49721]` matches legacy bit-for-bit); `tuned_px`/`tuned_hash` reflects
|
||||
// the `craft_develop` cutover for `RawTuning` (`camera_raw::develop`). Whole-image hashes differ by
|
||||
// 1 LSB between MSVC and glibc `libm` float math on Windows.
|
||||
let expected_def_hash = if cfg!(target_os = "windows") { 9_388_097_638_634_194_548 } else { 4_616_854_110_774_268_375 };
|
||||
let expected_tuned_hash = if cfg!(target_os = "windows") { 5_472_991_315_859_343_413 } else { 17_835_173_337_254_648_648 };
|
||||
assert_eq!(
|
||||
(def_px, def_hash, wb, tuned_px, tuned_hash),
|
||||
(
|
||||
[[29624, 25113, 50386], [47838, 39368, 49721], [54364, 41011, 44877]],
|
||||
4_077_782_316_697_218_873,
|
||||
[[29689, 25226, 50514], [47838, 39368, 49721], [54535, 41252, 44908]],
|
||||
expected_def_hash,
|
||||
false,
|
||||
[[39218, 33230, 65535], [63447, 52123, 65535], [65535, 54111, 59021]],
|
||||
13_721_670_327_866_894_160,
|
||||
[[39311, 33399, 65535], [63418, 52119, 65535], [65535, 54440, 59060]],
|
||||
expected_tuned_hash,
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -800,13 +806,17 @@ fn raw_open_camera_wb_legacy_baseline_pixels() {
|
||||
let tuned_px = [sample_rgb16(tuned_img.data(), w, 0, 0), sample_rgb16(tuned_img.data(), w, 7, 7), sample_rgb16(tuned_img.data(), w, 15, 15)];
|
||||
let tuned_hash = fnv1a_u16(tuned_img.data());
|
||||
|
||||
// Default RAW Open (`def_px`/`def_hash`) runs `craft_develop::sensor::demosaic` (`reflect` borders;
|
||||
// center pixel `[51905, 40291, 54669]` matches legacy bit-for-bit); `tuned_px`/`tuned_hash` reflects
|
||||
// the `craft_develop` cutover for `RawTuning` (`camera_raw::develop`).
|
||||
let expected_tuned_hash = if cfg!(target_os = "windows") { 16_896_394_607_103_456_502 } else { 1_068_984_693_251_983_675 };
|
||||
assert_eq!(
|
||||
(def_px, def_hash, tuned_px, tuned_hash),
|
||||
(
|
||||
[[32172, 25684, 55879], [51905, 40291, 54669], [54973, 41164, 49114]],
|
||||
11_079_887_031_689_206_845,
|
||||
[[41995, 33769, 65535], [65535, 53416, 65535], [65535, 54256, 62211]],
|
||||
14_795_269_389_460_323_633,
|
||||
[[32235, 25796, 56002], [51905, 40291, 54669], [55142, 41405, 49143]],
|
||||
11_523_078_668_107_121_059,
|
||||
[[42084, 33938, 65535], [65535, 53409, 65535], [65535, 54586, 62244]],
|
||||
expected_tuned_hash,
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
//! Smart objects and smart filters through PSD export, over every corpus file that has them
|
||||
//! (feature `corpus`; run with `cargo xtask test-corpus`).
|
||||
//! Smart objects and smart filters through PSD export, over the corpus files of the run that have
|
||||
//! them (the samples of `photocraft_testkit::corpus`, every file with `PHOTOCRAFT_FULL_SWEEP=1`;
|
||||
//! feature `corpus`; run with `cargo xtask test-corpus`).
|
||||
//!
|
||||
//! For each file: import → export → import must give back, layer for layer, a live smart object
|
||||
//! (not pixels) with the same embedded file (byte-identical), transform, filter list, filter
|
||||
@@ -12,23 +13,10 @@
|
||||
|
||||
use crate::common;
|
||||
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::Arc;
|
||||
|
||||
use photocraft_doc::{Document, LayerContent, SmartObject, SmartSource};
|
||||
|
||||
fn collect(dir: &Path, out: &mut Vec<PathBuf>) {
|
||||
let Ok(rd) = std::fs::read_dir(dir) else { return };
|
||||
for e in rd.flatten() {
|
||||
let p = e.path();
|
||||
if p.is_dir() {
|
||||
collect(&p, out);
|
||||
} else if p.extension().and_then(|e| e.to_str()).is_some_and(|e| e.eq_ignore_ascii_case("psd") || e.eq_ignore_ascii_case("psb")) {
|
||||
out.push(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn smarts(doc: &Document) -> Vec<(String, SmartObject)> {
|
||||
doc.walk()
|
||||
.into_iter()
|
||||
@@ -141,20 +129,22 @@ fn re_embed(doc: &mut Document) -> bool {
|
||||
any
|
||||
}
|
||||
|
||||
/// Files with smart objects in the corpus samples.
|
||||
const SAMPLE_SMART_FILES: usize = 5;
|
||||
|
||||
#[test]
|
||||
fn smart_objects_round_trip_through_psd() {
|
||||
let root = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../corpus");
|
||||
assert!(root.join("photoshop").is_dir(), "{} is missing: run `cargo xtask corpus --all`", root.display());
|
||||
let mut files = Vec::new();
|
||||
for d in ["psd", "psd-tools", "photoshop"] {
|
||||
collect(&root.join(d), &mut files);
|
||||
}
|
||||
files.sort();
|
||||
let root = photocraft_testkit::corpus::root();
|
||||
let files: Vec<_> = ["psd", "psd-tools", "photoshop"].into_iter().flat_map(photocraft_testkit::corpus::psd_files).collect();
|
||||
let (mut checked, mut objects, mut with_filters, mut edited, mut embedded) = (0, 0, 0, 0, 0);
|
||||
let mut failures = Vec::new();
|
||||
for p in &files {
|
||||
let name = p.strip_prefix(&root).unwrap_or(p).display().to_string();
|
||||
let bytes = std::fs::read(p).unwrap_or_default();
|
||||
// A smart object needs a placed-layer block: files without one are not imported.
|
||||
if !bytes.windows(4).any(|w| matches!(w, b"SoLd" | b"SoLE" | b"PlLd")) {
|
||||
continue;
|
||||
}
|
||||
let Ok(imp) = photocraft_io::import(&name, &bytes) else { continue };
|
||||
let doc = imp.document;
|
||||
let n = smarts(&doc).len();
|
||||
@@ -218,6 +208,7 @@ fn smart_objects_round_trip_through_psd() {
|
||||
for f in &failures {
|
||||
eprintln!(" FAIL {f}");
|
||||
}
|
||||
assert!(checked >= 30, "only {checked} corpus files with smart objects");
|
||||
let floor = if photocraft_testkit::full_sweep() { 30 } else { SAMPLE_SMART_FILES };
|
||||
assert!(checked >= floor, "only {checked} corpus files with smart objects");
|
||||
assert!(failures.is_empty(), "{} failures", failures.len());
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
//! geometry (ink bounds and alpha overlap) and is reported; the assertions are loose.
|
||||
|
||||
#[cfg(feature = "corpus")]
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::path::Path;
|
||||
|
||||
#[cfg(feature = "corpus")]
|
||||
use photocraft_doc::Layer;
|
||||
@@ -17,21 +17,6 @@ use photocraft_geom::Rect;
|
||||
#[cfg(feature = "corpus")]
|
||||
use photocraft_raster::Surface;
|
||||
|
||||
#[cfg(feature = "corpus")]
|
||||
fn collect(dir: &Path, out: &mut Vec<PathBuf>) {
|
||||
let Ok(rd) = std::fs::read_dir(dir) else {
|
||||
return;
|
||||
};
|
||||
for e in rd.flatten() {
|
||||
let p = e.path();
|
||||
if p.is_dir() {
|
||||
collect(&p, out);
|
||||
} else if p.extension().and_then(|e| e.to_str()).is_some_and(|e| e.eq_ignore_ascii_case("psd") || e.eq_ignore_ascii_case("psb")) {
|
||||
out.push(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "corpus")]
|
||||
fn walk<'a>(layers: &'a [Layer], out: &mut Vec<&'a Layer>) {
|
||||
for l in layers {
|
||||
@@ -51,11 +36,7 @@ fn alpha(s: &Surface, r: Rect) -> Vec<f32> {
|
||||
#[cfg(feature = "corpus")]
|
||||
#[test]
|
||||
fn corpus_text_layers() {
|
||||
let root = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../corpus/psd");
|
||||
assert!(root.is_dir(), "{} is missing: run `cargo xtask corpus --all`", root.display());
|
||||
let mut files = Vec::new();
|
||||
collect(&root, &mut files);
|
||||
files.sort();
|
||||
let files = photocraft_testkit::corpus::all_psd_files("psd");
|
||||
let mut engine = photocraft_text::TextEngine::with_system_fonts();
|
||||
let (mut n, mut good_geometry) = (0, 0);
|
||||
for f in files {
|
||||
@@ -149,11 +130,9 @@ fn corpus_tysh_lossless() {
|
||||
#[cfg(feature = "corpus")]
|
||||
#[test]
|
||||
fn corpus_photoshop_txt2_survives_an_unedited_save() {
|
||||
let root = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../corpus/photoshop/text");
|
||||
assert!(root.is_dir(), "{} is missing: run `cargo xtask corpus --photoshop`", root.display());
|
||||
let mut files = Vec::new();
|
||||
collect(&root, &mut files);
|
||||
files.sort();
|
||||
// The run's Photoshop files (its sample, or all with PHOTOCRAFT_FULL_SWEEP=1) of `text/`.
|
||||
let text = photocraft_testkit::corpus::root().join("photoshop/text");
|
||||
let files: Vec<_> = photocraft_testkit::corpus::psd_files("photoshop").into_iter().filter(|f| f.starts_with(&text)).collect();
|
||||
let txt2 = |doc: &photocraft_doc::Document| doc.metadata.psd_global_blocks.iter().find(|b| &b.1 == b"Txt2").map(|b| b.2.clone());
|
||||
let mut checked = 0;
|
||||
for f in &files {
|
||||
@@ -165,7 +144,7 @@ fn corpus_photoshop_txt2_survives_an_unedited_save() {
|
||||
assert!(txt2(&back) == Some(before), "{name}: Txt2 changed on an unedited save");
|
||||
checked += 1;
|
||||
}
|
||||
assert!(checked > 0, "no Photoshop type files with Txt2 in {}", root.display());
|
||||
assert!(checked > 0, "no Photoshop type files with Txt2 in {}", text.display());
|
||||
println!("Txt2 kept byte-for-byte in {checked} Photoshop type files");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
//! Layered TIFF against the real-file corpora (feature `corpus`; `cargo xtask test-corpus`):
|
||||
//! every PSD that imports is written as a layered TIFF and read back, and the result must equal
|
||||
//! Layered TIFF against the real-file corpora (feature `corpus`; `cargo xtask test-corpus`): every
|
||||
//! PSD of the run (every file of psd, psd-tools and photoshop with `PHOTOCRAFT_FULL_SWEEP=1`, the
|
||||
//! psd-tools sample of `photocraft_testkit::corpus` otherwise) that imports is written as a layered
|
||||
//! TIFF and read back, and the result must equal
|
||||
//! the PSD round trip of the same document: the same layer structure (count, names, kinds) and
|
||||
//! the same render (within one 8-bit step). The layers go through the same PSD mapping in both
|
||||
//! directions, so any difference is a bug in the layer-data transcoder or the TIFF glue, not in
|
||||
@@ -14,23 +16,10 @@
|
||||
#![cfg(feature = "corpus")]
|
||||
|
||||
use std::panic::{AssertUnwindSafe, catch_unwind};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use photocraft_doc::{Document, Layer};
|
||||
use photocraft_io::*;
|
||||
|
||||
fn collect(dir: &Path, out: &mut Vec<PathBuf>) {
|
||||
let Ok(rd) = std::fs::read_dir(dir) else { return };
|
||||
for e in rd.flatten() {
|
||||
let p = e.path();
|
||||
if p.is_dir() {
|
||||
collect(&p, out);
|
||||
} else if p.extension().and_then(|e| e.to_str()).is_some_and(|e| e.eq_ignore_ascii_case("psd") || e.eq_ignore_ascii_case("psb")) {
|
||||
out.push(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn structure(layers: &[Layer], out: &mut Vec<String>, depth: usize) {
|
||||
for l in layers {
|
||||
out.push(format!(
|
||||
@@ -61,15 +50,16 @@ const MAPPED: &[&[u8; 4]] = &[
|
||||
b"iOpa", b"clbl", b"infx", b"knko", b"lspf", b"fxrp", b"brst", b"shmd", b"Patt", b"FEid", b"FXid", b"FMsk", b"artb", b"artd", b"cinf",
|
||||
];
|
||||
|
||||
/// Files of the psd-tools sample this test takes (the others are Lab or Multichannel).
|
||||
const SAMPLE_TESTED_FLOOR: usize = 20;
|
||||
|
||||
#[test]
|
||||
fn corpus_round_trips_through_layered_tiff() {
|
||||
let root = Path::new(env!("CARGO_MANIFEST_DIR")).join("../../corpus");
|
||||
assert!(root.join("psd").is_dir(), "corpus missing: run `cargo xtask corpus --all`");
|
||||
let mut files = Vec::new();
|
||||
for sub in ["psd", "psd-tools", "photoshop"] {
|
||||
collect(&root.join(sub), &mut files);
|
||||
}
|
||||
files.sort();
|
||||
let root = photocraft_testkit::corpus::root();
|
||||
let full = photocraft_testkit::full_sweep();
|
||||
// Six encodes, decodes and renders per file: other runs keep to the psd-tools sample.
|
||||
let dirs: &[&str] = if full { &["psd", "psd-tools", "photoshop"] } else { &["psd-tools"] };
|
||||
let files: Vec<_> = dirs.iter().flat_map(|d| photocraft_testkit::corpus::psd_files(d)).collect();
|
||||
assert!(!files.is_empty());
|
||||
let (mut tested, mut crashes, mut failures) = (0usize, Vec::new(), Vec::new());
|
||||
let mut dropped: std::collections::BTreeMap<String, usize> = Default::default();
|
||||
@@ -145,5 +135,6 @@ fn corpus_round_trips_through_layered_tiff() {
|
||||
}
|
||||
assert!(crashes.is_empty(), "crashes: {crashes:?}");
|
||||
assert!(failures.is_empty(), "{} failures (see above)", failures.len());
|
||||
assert!(tested > 100, "only {tested} files tested");
|
||||
let floor = if full { 100 } else { SAMPLE_TESTED_FLOOR };
|
||||
assert!(tested >= floor, "only {tested} files tested");
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
//! Vector data ⇄ PSD: synthetic round trips of paths, shape layers and vector masks, plus a
|
||||
//! corpus check (`corpus/psd`, feature `corpus`) that compares our rasterization
|
||||
//! of every plain shape layer with the pixels Photoshop stored for it.
|
||||
//! corpus check (`corpus/psd`: its sample in `photocraft_testkit::corpus`, every file with
|
||||
//! `PHOTOCRAFT_FULL_SWEEP=1`; feature `corpus`) that compares our rasterization of every plain
|
||||
//! shape layer with the pixels Photoshop stored for it.
|
||||
|
||||
#[cfg(feature = "corpus")]
|
||||
use std::path::{Path as FsPath, PathBuf};
|
||||
#[cfg(feature = "corpus")]
|
||||
use std::sync::Arc;
|
||||
|
||||
@@ -358,29 +357,13 @@ fn vector_mask_roundtrip_and_removal() {
|
||||
assert!(roundtrip(&g).layers[1].vector_mask.is_some());
|
||||
}
|
||||
|
||||
#[cfg(feature = "corpus")]
|
||||
fn collect(dir: &FsPath, out: &mut Vec<PathBuf>) {
|
||||
let Ok(rd) = std::fs::read_dir(dir) else { return };
|
||||
for e in rd.flatten() {
|
||||
let p = e.path();
|
||||
if p.is_dir() {
|
||||
collect(&p, out);
|
||||
} else if p.extension().and_then(|e| e.to_str()).is_some_and(|e| e.eq_ignore_ascii_case("psd") || e.eq_ignore_ascii_case("psb")) {
|
||||
out.push(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Every plain shape layer in the corpus (solid fill, no stroke, no effects, visible fill):
|
||||
/// our fill coverage vs the alpha of Photoshop's pixels. Reported; asserted loosely.
|
||||
#[cfg(feature = "corpus")]
|
||||
#[test]
|
||||
fn corpus_shape_coverage_matches_photoshop() {
|
||||
let root = FsPath::new(env!("CARGO_MANIFEST_DIR")).join("../../corpus/psd");
|
||||
assert!(root.is_dir(), "{} is missing: run `cargo xtask corpus --all`", root.display());
|
||||
let mut files = Vec::new();
|
||||
collect(&root, &mut files);
|
||||
files.sort();
|
||||
let root = photocraft_testkit::corpus::root().join("psd");
|
||||
let files = photocraft_testkit::corpus::psd_files("psd");
|
||||
let (mut n, mut good) = (0, 0);
|
||||
for p in &files {
|
||||
let name = p.strip_prefix(&root).unwrap_or(p).display().to_string();
|
||||
@@ -416,7 +399,8 @@ fn corpus_shape_coverage_matches_photoshop() {
|
||||
}
|
||||
}
|
||||
eprintln!("vector corpus: {good}/{n} plain shape layers with IoU > 0.97");
|
||||
assert!(n == 0 || good * 10 >= n * 9, "{good}/{n}");
|
||||
assert!(n > 0, "no plain shape layers in the corpus files of this run");
|
||||
assert!(good * 10 >= n * 9, "{good}/{n}");
|
||||
}
|
||||
|
||||
/// (layer name, block key, data).
|
||||
@@ -427,11 +411,7 @@ type NamedBlock = (String, [u8; 4], Arc<Vec<u8>>);
|
||||
#[cfg(feature = "corpus")]
|
||||
#[test]
|
||||
fn corpus_vector_blocks_survive_roundtrip() {
|
||||
let root = FsPath::new(env!("CARGO_MANIFEST_DIR")).join("../../corpus/psd");
|
||||
assert!(root.is_dir(), "{} is missing: run `cargo xtask corpus --all`", root.display());
|
||||
let mut files = Vec::new();
|
||||
collect(&root, &mut files);
|
||||
files.sort();
|
||||
let files = photocraft_testkit::corpus::psd_files("psd");
|
||||
let keys: [&[u8; 4]; 6] = [b"vmsk", b"vsms", b"vogk", b"vstk", b"vscg", b"SoCo"];
|
||||
let mut checked = 0;
|
||||
for p in &files {
|
||||
@@ -469,4 +449,5 @@ fn corpus_vector_blocks_survive_roundtrip() {
|
||||
}
|
||||
}
|
||||
eprintln!("vector corpus: {checked} vector blocks byte-identical after round trip");
|
||||
assert!(checked > 0, "no vector blocks in the corpus files of this run");
|
||||
}
|
||||
@@ -7,7 +7,7 @@ license.workspace = true
|
||||
rust-version.workspace = true
|
||||
|
||||
[dependencies]
|
||||
craft-ipp = { git = "https://github.com/storytold/craft-libs", rev = "315a223e6935356896453c0ccee75fe9da8bdff4" }
|
||||
craft-ipp = { git = "https://github.com/storytold/craft-libs", rev = "27e5af8151c4fb28b26165b62577c658af24553e" }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
@@ -15,6 +15,7 @@ testgen = ["dep:image", "dep:flate2"]
|
||||
corpus = []
|
||||
|
||||
[dependencies]
|
||||
craft-develop.workspace = true
|
||||
craft-raw.workspace = true
|
||||
# Synthetic fixture output used only by the retired format-parser tests.
|
||||
image = { workspace = true, features = ["jpeg"], optional = true }
|
||||
|
||||
+1
-21
@@ -75,27 +75,7 @@ pub fn cct(xy: [f64; 2]) -> f64 {
|
||||
/// Approximate temperature of an EXIF `LightSource` code (the
|
||||
/// CalibrationIlluminant tags use the EXIF 2.3 table). `None` for unknown.
|
||||
pub fn illuminant_temperature(code: u32) -> Option<f64> {
|
||||
Some(match code {
|
||||
17 => 2856.0, // Standard light A
|
||||
18 => 4874.0, // Standard light B
|
||||
19 => 6774.0, // Standard light C
|
||||
20 => 5503.0, // D55
|
||||
21 => 6504.0, // D65
|
||||
22 => 7504.0, // D75
|
||||
23 => 5003.0, // D50
|
||||
24 => 3200.0, // ISO studio tungsten
|
||||
3 => 2850.0, // Tungsten
|
||||
1 | 4 | 9 => 5500.0, // Daylight, flash, fine weather
|
||||
10 => 6500.0, // Cloudy
|
||||
11 => 7500.0, // Shade
|
||||
12 => 6430.0, // Daylight fluorescent
|
||||
13 => 5000.0, // Day white fluorescent
|
||||
14 => 4150.0, // Cool white fluorescent
|
||||
15 => 3525.0, // White fluorescent
|
||||
16 => 2925.0, // Warm white fluorescent
|
||||
2 => 4200.0, // Fluorescent
|
||||
_ => return None,
|
||||
})
|
||||
u16::try_from(code).ok().and_then(craft_develop::sensor::color::illuminant_temperature)
|
||||
}
|
||||
|
||||
/// Bradford chromatic adaptation from white `src` to white `dst` (XYZ).
|
||||
|
||||
+156
-5
@@ -467,13 +467,77 @@ fn develop(s: &Sensor, opts: &DevelopOptions, allow_fused: bool) -> Result<Devel
|
||||
}
|
||||
};
|
||||
let names = |p: &[u8]| p.iter().map(|c| ['R', 'G', 'B'][usize::from(*c).min(2)]).collect::<String>();
|
||||
if bayer && fused {
|
||||
if bayer && fused && matches!(opts.demosaic, Demosaic::Bilinear | Demosaic::Ahd) {
|
||||
let p = cfa.phase(c.x, c.y);
|
||||
pattern = Some(names(&p));
|
||||
let method = match opts.demosaic {
|
||||
Demosaic::Bilinear => craft_develop::sensor::Method::Bilinear,
|
||||
Demosaic::Ahd | Demosaic::Mhc => craft_develop::sensor::Method::Ahd,
|
||||
};
|
||||
let mut o = vec![0u16; w * h * 3];
|
||||
par::chunks_mut_grouped(&mut o, band * w * 3, jobs, |b, chunk| {
|
||||
let y0 = b * band;
|
||||
let rows = chunk.len() / (w * 3);
|
||||
let y_start = y0.saturating_sub(PAD);
|
||||
let y_end = (y0 + rows + PAD).min(h);
|
||||
let sh = y_end - y_start;
|
||||
let mut strip = vec![0.0f32; w * sh];
|
||||
for (r, row) in strip.chunks_exact_mut(w).enumerate() {
|
||||
fill_row(y_start + r, row);
|
||||
}
|
||||
let norm = craft_develop::sensor::Normalized {
|
||||
width: w,
|
||||
height: sh,
|
||||
cpp: 1,
|
||||
data: strip,
|
||||
cfa: Some(craft_develop::sensor::Cfa { width: 2, height: 2, pattern: p.to_vec(), origin_x: 0, origin_y: y_start % 2 }),
|
||||
};
|
||||
let dem = craft_develop::sensor::demosaic(&norm, method);
|
||||
let top_pad = y0 - y_start;
|
||||
let dem_f32: Vec<f32> = dem.data[top_pad * w..(top_pad + rows) * w].iter().flat_map(|px| *px).collect();
|
||||
encode_plain(&dem_f32, chunk);
|
||||
});
|
||||
fused_out = Some(o);
|
||||
} else if bayer && fused {
|
||||
// No padded plane either: every band normalizes its own rows.
|
||||
let p = cfa.phase(c.x, c.y);
|
||||
pattern = Some(names(&p));
|
||||
let mut o = vec![0u16; w * h * 3];
|
||||
demosaic_fused(w, h, p, opts.demosaic, &to_xyz, jobs, &fill_row, &mut o, &encode_plain);
|
||||
fused_out = Some(o);
|
||||
} else if matches!(opts.demosaic, Demosaic::Bilinear | Demosaic::Ahd) {
|
||||
let (cfa_w, cfa_h, cfa_pat) = if bayer {
|
||||
let p = cfa.phase(c.x, c.y);
|
||||
pattern = Some(names(&p));
|
||||
(2, 2, p.to_vec())
|
||||
} else {
|
||||
let pat = Pattern::of(cfa, c.x, c.y);
|
||||
pattern = Some(pat.colors.chunks(pat.w.max(1)).map(names).collect::<Vec<_>>().join("/"));
|
||||
(pat.w, pat.h, pat.colors)
|
||||
};
|
||||
let mut norm_data = vec![0.0f32; w * h];
|
||||
par::chunks_mut(&mut norm_data, band * w, |b, chunk| {
|
||||
for (r, row) in chunk.chunks_exact_mut(w).enumerate() {
|
||||
fill_row(b * band + r, row);
|
||||
}
|
||||
});
|
||||
let norm = craft_develop::sensor::Normalized {
|
||||
width: w,
|
||||
height: h,
|
||||
cpp: 1,
|
||||
data: norm_data,
|
||||
cfa: Some(craft_develop::sensor::Cfa { width: cfa_w, height: cfa_h, pattern: cfa_pat, origin_x: 0, origin_y: 0 }),
|
||||
};
|
||||
let method = if !bayer {
|
||||
craft_develop::sensor::Method::Bilinear
|
||||
} else {
|
||||
match opts.demosaic {
|
||||
Demosaic::Bilinear => craft_develop::sensor::Method::Bilinear,
|
||||
Demosaic::Ahd | Demosaic::Mhc => craft_develop::sensor::Method::Ahd,
|
||||
}
|
||||
};
|
||||
let dem = craft_develop::sensor::demosaic(&norm, method);
|
||||
rgb = dem.data.into_iter().flatten().collect();
|
||||
} else {
|
||||
let mut plane = Padded::new(w, h);
|
||||
let stride = plane.stride;
|
||||
@@ -606,6 +670,31 @@ fn fused_band_bytes(w: usize, h: usize, band_rows: usize, window: bool) -> u64 {
|
||||
rgb.saturating_add(window)
|
||||
}
|
||||
|
||||
// Shared Bayer strip demosaic at the pinned craft-develop revision. Count outer
|
||||
// buffers per live strip and the nested AHD tile scratch per active rayon worker.
|
||||
fn shared_bayer_peak(w: usize, h: usize, rows: usize, ahd: bool, jobs: usize, workers: usize) -> u64 {
|
||||
let w64 = w as u64;
|
||||
let strip = rows.saturating_add(2 * PAD).min(h);
|
||||
let pixels = w64.saturating_mul(strip as u64);
|
||||
// The normalized strip, shared RGB result and flat RGB interior. Reserving a
|
||||
// gain row and CFA/neighbor tables here also covers the normalization peak.
|
||||
let mut per_band = pixels.saturating_mul(16).saturating_add(w64.saturating_mul((rows as u64).saturating_mul(12).saturating_add(4)));
|
||||
per_band = per_band.saturating_add(4096);
|
||||
let mut tile_scratch = 0u64;
|
||||
if ahd && w >= 4 && strip >= 4 {
|
||||
const TILE: usize = 128;
|
||||
const MARGIN: usize = 6;
|
||||
let tiles = w.div_ceil(TILE).saturating_mul(strip.div_ceil(TILE));
|
||||
// Returned tile pixels and the collecting Vec's three-word tuples.
|
||||
per_band = per_band.saturating_add(pixels.saturating_mul(12)).saturating_add((tiles as u64).saturating_mul(5 * std::mem::size_of::<usize>() as u64));
|
||||
// Mosaic/colour, two greens, two RGB and two Lab candidates and two
|
||||
// homogeneity arrays; also allow the two-byte CFA-period allocation.
|
||||
let per_tile = ((w.min(TILE) + 2 * MARGIN) as u64).saturating_mul((strip.min(TILE) + 2 * MARGIN) as u64).saturating_mul(63).saturating_add(2);
|
||||
tile_scratch = per_tile.saturating_mul(workers.min(jobs.saturating_mul(tiles)) as u64);
|
||||
}
|
||||
per_band.saturating_mul(jobs as u64).saturating_add(tile_scratch)
|
||||
}
|
||||
|
||||
/// Checks the peak of the two development phases. The CFA and non-Bayer green
|
||||
/// planes are freed before the u16 output is allocated; the AHD scratch and the fused band
|
||||
/// buffers are bounded by reducing simultaneous bands when needed. The fused path never holds
|
||||
@@ -647,7 +736,15 @@ fn working_memory(w: usize, h: usize, cfa: bool, bayer: bool, shape: Shape, opts
|
||||
// The fused Bayer path has no whole plane: each worker's window is counted with its band.
|
||||
let plane = if fused && bayer { 0 } else { plane };
|
||||
let mut mosaic = pixels.saturating_mul(frame).saturating_add(plane).saturating_add(table);
|
||||
if bayer && opts.demosaic == Demosaic::Ahd {
|
||||
if bayer && fused && matches!(opts.demosaic, Demosaic::Bilinear | Demosaic::Ahd) {
|
||||
let rows = par::band_rows(w);
|
||||
jobs = jobs.min(h.div_ceil(rows)).max(1);
|
||||
let strip_peak = |jobs| shared_bayer_peak(w, h, rows.min(h), opts.demosaic == Demosaic::Ahd, jobs, workers.max(1));
|
||||
while jobs > 1 && mosaic.saturating_add(strip_peak(jobs)) > limits.max_alloc {
|
||||
jobs -= 1;
|
||||
}
|
||||
mosaic = mosaic.saturating_add(strip_peak(jobs));
|
||||
} else if bayer && opts.demosaic == Demosaic::Ahd {
|
||||
mosaic = mosaic.saturating_add(crate::demosaic::AHD_TABLE_BYTES);
|
||||
let scratch = crate::demosaic::ahd_scratch(w as u64, h as u64).saturating_add(band_of(crate::demosaic::AHD_BAND, true));
|
||||
// At least one band must fit, even when no parallelism is available.
|
||||
@@ -909,10 +1006,18 @@ mod tests {
|
||||
|
||||
fn assert_fused_matches_full(s: &Sensor, opts: &DevelopOptions, what: &str) {
|
||||
let full = develop(s, opts, false).unwrap();
|
||||
let (ow, oh) = (full.width as usize, full.height as usize);
|
||||
for threads in [1, 3, 16] {
|
||||
let fused = with_threads(threads, || develop(s, opts, true).unwrap());
|
||||
assert_eq!((full.width, full.height), (fused.width, fused.height), "{what} {threads}");
|
||||
assert!(full.rgb == fused.rgb, "{what} {threads} threads: fused output differs");
|
||||
// Full-frame uses `craft_develop::sensor::demosaic` (`reflect` borders) while `fused`
|
||||
// uses `PAD` replicate borders; compare interior pixels where both border modes agree.
|
||||
for y in PAD..oh.saturating_sub(PAD) {
|
||||
for x in PAD..ow.saturating_sub(PAD) {
|
||||
let i = (y * ow + x) * 3;
|
||||
assert_eq!(full.rgb[i..i + 3], fused.rgb[i..i + 3], "{what} {threads} threads at ({x},{y}): fused output differs");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -935,6 +1040,35 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fused_bayer_ahd_matches_full_frame_across_odd_strip_boundaries() {
|
||||
// Our in-code synthetic sensor is textured; this width yields 109-row bands, so
|
||||
// successive strips include a different source CFA phase. Include the real sensor
|
||||
// edges as well as the internal seams rather than trimming the compared output.
|
||||
let (w, h) = (600, 350);
|
||||
let mut s = test_sensor(w, h, crate::Cfa::bayer("RGGB"), 1);
|
||||
s.color.calibrations.push(color::Calibration {
|
||||
temperature: 6500.0,
|
||||
color_matrix: [[0.61, 0.23, 0.16], [0.18, 0.73, 0.09], [0.07, 0.16, 0.77]],
|
||||
forward_matrix: None,
|
||||
camera_calibration: color::IDENTITY,
|
||||
});
|
||||
s.color.as_shot_neutral = Some([0.57, 1.0, 0.73]);
|
||||
let opts = DevelopOptions { demosaic: Demosaic::Ahd, ..Default::default() };
|
||||
for orientation in [1, 6] {
|
||||
s.orientation = orientation;
|
||||
let full = develop(&s, &opts, false).unwrap();
|
||||
let fused = with_threads(3, || develop_sensor(&s, &opts).unwrap());
|
||||
assert_eq!((fused.width, fused.height), (full.width, full.height));
|
||||
assert_eq!(fused.rgb.len(), full.rgb.len());
|
||||
let ow = full.width as usize;
|
||||
let first_difference = full.rgb.as_chunks::<3>().0.iter().zip(fused.rgb.as_chunks::<3>().0).enumerate().find(|(_, (full, fused))| full != fused);
|
||||
if let Some((p, (full, fused))) = first_difference {
|
||||
panic!("orientation {orientation} at ({}, {}): expected {full:?}, got {fused:?}", p % ow, p / ow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fused_development_matches_for_every_orientation_and_look() {
|
||||
use crate::Cfa;
|
||||
@@ -1030,13 +1164,13 @@ mod tests {
|
||||
assert!(working_memory(11648, 8736, true, true, FUSED, &opts, 1).is_ok());
|
||||
}
|
||||
|
||||
/// The fused bilinear / MHC, X-Trans and LinearRaw paths run fewer bands at once when the bands
|
||||
/// The fused MHC, X-Trans and LinearRaw paths run fewer bands at once when the bands
|
||||
/// of every worker don't fit next to the output, as AHD does. A very wide, short Bayer frame
|
||||
/// (262144 x 455: 15 bands of 32 rows, about 147 MB a band with its window) needs 2.92 GB
|
||||
/// with all 15 at once against the default 2 GiB, and develops with 9.
|
||||
#[test]
|
||||
fn fused_bands_at_once_are_capped_by_the_memory_limit() {
|
||||
let opts = DevelopOptions { demosaic: Demosaic::Bilinear, ..Default::default() };
|
||||
let opts = DevelopOptions { demosaic: Demosaic::Mhc, ..Default::default() };
|
||||
let table = (GAMMA_STEPS as u64 + 2) * 4;
|
||||
let (w, h) = (262144usize, 455usize);
|
||||
let band = 32 * 262144 * 12 + (32 + 2 * PAD as u64) * (262144 + 2 * PAD as u64) * 4;
|
||||
@@ -1059,6 +1193,23 @@ mod tests {
|
||||
assert_eq!(working_memory(1000, 2000, false, true, FUSED, &x, 32).unwrap(), 5);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn shared_bayer_strips_reduce_jobs_when_only_one_fits() {
|
||||
let (w, h, workers) = (1024usize, 400usize, 4);
|
||||
let rows = par::band_rows(w);
|
||||
let base = (w * h * 6) as u64 + (GAMMA_STEPS as u64 + 2) * 4;
|
||||
let bilinear = shared_bayer_peak(w, h, rows, false, 1, workers);
|
||||
let ahd = shared_bayer_peak(w, h, rows, true, 1, workers);
|
||||
assert!(bilinear < ahd);
|
||||
for (demosaic, band) in [(Demosaic::Bilinear, bilinear), (Demosaic::Ahd, ahd)] {
|
||||
let mut opts = DevelopOptions { demosaic, ..Default::default() };
|
||||
opts.limits.max_alloc = base + band;
|
||||
assert_eq!(working_memory(w, h, true, true, FUSED, &opts, workers).unwrap(), 1);
|
||||
opts.limits.max_alloc -= 1;
|
||||
assert!(working_memory(w, h, true, true, FUSED, &opts, workers).is_err());
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn working_memory_accounts_for_padding_and_at_least_one_ahd_band() {
|
||||
let mut opts = DevelopOptions { demosaic: Demosaic::Ahd, ..Default::default() };
|
||||
|
||||
@@ -65,6 +65,13 @@ pub(crate) fn chunks_mut_limited<T: Send>(buf: &mut [T], chunk: usize, jobs: usi
|
||||
chunks_mut(buf, chunk, f);
|
||||
return;
|
||||
}
|
||||
chunks_mut_grouped(buf, chunk, jobs, f);
|
||||
}
|
||||
|
||||
/// A hard task count even when every worker fits: `f` may wait on nested rayon
|
||||
/// work, in which case an outer task can be suspended while its worker helps.
|
||||
pub(crate) fn chunks_mut_grouped<T: Send>(buf: &mut [T], chunk: usize, jobs: usize, f: impl Fn(usize, &mut [T]) + Sync + Send) {
|
||||
let chunk = chunk.max(1);
|
||||
let per_group = buf.len().div_ceil(chunk).div_ceil(jobs.max(1)).max(1);
|
||||
chunks_mut(buf, chunk.saturating_mul(per_group), |group, part| {
|
||||
for (local, c) in part.chunks_mut(chunk).enumerate() {
|
||||
|
||||
@@ -1280,3 +1280,60 @@ fn adjusted_crop_and_omitted_gain_table_notices_survive_development() {
|
||||
spec.default_crop_origin_double = None;
|
||||
check(&spec, Rect::new(3, 2, 11, 8), false, true);
|
||||
}
|
||||
|
||||
/// Compare PhotoCraft's `develop_sensor` output converted from encoded ProPhoto RGB (D50, gamma 1.8)
|
||||
/// into unclipped linear Rec.709/D65 against `craft_develop::sensor` at the same stage.
|
||||
#[test]
|
||||
fn raw_open_matches_craft_develop_in_unclipped_linear_rec709_d65() {
|
||||
use craft_develop::sensor::{Cfa as SharedCfa, Method as SharedMethod, Normalized as SharedNormalized, demosaic as shared_demosaic};
|
||||
|
||||
// ProPhoto RGB (ROMM, D50) -> Bradford D50->D65 -> linear Rec.709/D65.
|
||||
const PROPHOTO_TO_REC709_D65: [[f64; 3]; 3] =
|
||||
[[2.034_366_8, -0.727_642_7, -0.306_724_1], [-0.228_827_2, 1.231_751_6, -0.002_924_4], [-0.008_565_5, -0.153_287_2, 1.161_852_7]];
|
||||
let apply3 = |m: &[[f64; 3]; 3], v: [f64; 3]| -> [f64; 3] {
|
||||
[m[0][0] * v[0] + m[0][1] * v[1] + m[0][2] * v[2], m[1][0] * v[0] + m[1][1] * v[1] + m[1][2] * v[2], m[2][0] * v[0] + m[2][1] * v[1] + m[2][2] * v[2]]
|
||||
};
|
||||
|
||||
let (w, h) = (32, 32);
|
||||
// Mid-tone grey Bayer patch (RGGB) at ~25% of white = 65535.
|
||||
let samples = vec![16384u16; w * h];
|
||||
let spec = DngSpec::cfa(w, h, samples.clone());
|
||||
let s = sensor(&spec.build());
|
||||
let dev = develop_sensor(&s, &DevelopOptions { orient: false, ..Default::default() }).unwrap();
|
||||
assert_eq!((dev.width as usize, dev.height as usize), (w, h));
|
||||
|
||||
// Shared `craft_develop::sensor` path in linear Rec.709/D65 on the same normalized sensor.
|
||||
let norm = SharedNormalized {
|
||||
width: w,
|
||||
height: h,
|
||||
cpp: 1,
|
||||
data: samples.iter().map(|&v| f32::from(v) / 65535.0).collect(),
|
||||
cfa: Some(SharedCfa { width: 2, height: 2, pattern: vec![0, 1, 1, 2], origin_x: 0, origin_y: 0 }),
|
||||
};
|
||||
let cam_rgb = shared_demosaic(&norm, SharedMethod::Ahd);
|
||||
|
||||
// Compare interior pixels (avoiding Bayer border effects) in linear Rec.709/D65.
|
||||
for y in 4..(h - 4) {
|
||||
for x in 4..(w - 4) {
|
||||
let idx = (y * w + x) * 3;
|
||||
let pp_lin = [
|
||||
(f64::from(dev.rgb[idx]) / 65535.0).powf(1.8),
|
||||
(f64::from(dev.rgb[idx + 1]) / 65535.0).powf(1.8),
|
||||
(f64::from(dev.rgb[idx + 2]) / 65535.0).powf(1.8),
|
||||
];
|
||||
let pc_rec709 = apply3(&PROPHOTO_TO_REC709_D65, pp_lin);
|
||||
|
||||
let p = cam_rgb.get(x, y);
|
||||
let shared_rec709 = [f64::from(p[0]), f64::from(p[1]), f64::from(p[2])];
|
||||
|
||||
for c in 0..3 {
|
||||
assert!(
|
||||
(pc_rec709[c] - shared_rec709[c]).abs() < 5e-3,
|
||||
"linear Rec.709/D65 mismatch at ({x},{y}) ch {c}: photocraft={} shared={}",
|
||||
pc_rec709[c],
|
||||
shared_rec709[c]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
//! Real-file corpus sweeps (`corpus/`, fetched by `cargo xtask corpus --all`): a full sweep
|
||||
//! ([`full_sweep`]: the nightly CI run) takes every file, every other run a fixed sample per
|
||||
//! directory. The samples are chosen for coverage, not taken as the first files: together they
|
||||
//! hold every colour mode and depth, PSD and PSB, and every tagged block key the directory has
|
||||
//! outside its large files, plus the cases the corpus tests guard (each oracle kind, smart objects,
|
||||
//! vector blocks, type), at small canvas sizes so that each corpus test stays near a second.
|
||||
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
/// Whether this run takes every case of the long sweeps ([`crate::Sweep`]) and every corpus file:
|
||||
/// `PHOTOCRAFT_FULL_SWEEP=1`, set by the nightly CI run and by a manual run's `full_sweep` input.
|
||||
pub fn full_sweep() -> bool {
|
||||
std::env::var_os("PHOTOCRAFT_FULL_SWEEP").is_some_and(|v| v == "1")
|
||||
}
|
||||
|
||||
/// The workspace's `corpus/` directory.
|
||||
pub fn root() -> PathBuf {
|
||||
Path::new(env!("CARGO_MANIFEST_DIR")).join("../../corpus")
|
||||
}
|
||||
|
||||
/// The fixed sample of `corpus/<dir>` (paths relative to it), empty for a directory without one.
|
||||
pub fn sample(dir: &str) -> &'static [&'static str] {
|
||||
match dir {
|
||||
"psd" => PSD,
|
||||
"psd-tools" => PSD_TOOLS,
|
||||
"photoshop" => PHOTOSHOP,
|
||||
_ => &[],
|
||||
}
|
||||
}
|
||||
|
||||
/// The PSD and PSB files of `corpus/<dir>` this run takes, sorted: all of them in a full sweep,
|
||||
/// otherwise the directory's sample. Fails when the directory is missing, or when a sample file is
|
||||
/// (a pin moved: choose its replacement for the sample).
|
||||
pub fn psd_files(dir: &str) -> Vec<PathBuf> {
|
||||
let base = root().join(dir);
|
||||
let all = all_psd_files(dir);
|
||||
if full_sweep() {
|
||||
eprintln!("corpus/{dir}: all {} files (PHOTOCRAFT_FULL_SWEEP=1)", all.len());
|
||||
return all;
|
||||
}
|
||||
let picked: Vec<PathBuf> = sample(dir).iter().map(|name| base.join(name)).collect();
|
||||
let missing: Vec<&PathBuf> = picked.iter().filter(|p| !all.contains(p)).collect();
|
||||
assert!(missing.is_empty(), "corpus/{dir}: sample files missing from the corpus (update the sample in photocraft-testkit): {missing:?}");
|
||||
eprintln!("corpus/{dir}: sample of {} of {} files; PHOTOCRAFT_FULL_SWEEP=1 runs every file", picked.len(), all.len());
|
||||
picked
|
||||
}
|
||||
|
||||
/// Every PSD and PSB file of `corpus/<dir>`, sorted, in every run: for the corpus tests fast
|
||||
/// enough to walk a whole directory. Fails when the directory is missing.
|
||||
pub fn all_psd_files(dir: &str) -> Vec<PathBuf> {
|
||||
let base = root().join(dir);
|
||||
assert!(base.is_dir(), "{} is missing: run `cargo xtask corpus --all`", base.display());
|
||||
let mut all = Vec::new();
|
||||
collect(&base, &mut all);
|
||||
all.sort();
|
||||
all
|
||||
}
|
||||
|
||||
fn collect(dir: &Path, out: &mut Vec<PathBuf>) {
|
||||
let Ok(rd) = std::fs::read_dir(dir) else { return };
|
||||
for e in rd.flatten() {
|
||||
let p = e.path();
|
||||
if p.is_dir() {
|
||||
collect(&p, out);
|
||||
} else if p.extension().and_then(|e| e.to_str()).is_some_and(|e| e.eq_ignore_ascii_case("psd") || e.eq_ignore_ascii_case("psb")) {
|
||||
out.push(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// `corpus/psd`: the files ag-psd wrote (another writer's structures); its psd-tools copies are in
|
||||
/// [`PSD_TOOLS`].
|
||||
const PSD: &[&str] = &[
|
||||
"ag-psd/layer-mask/src.psd", // layer mask, FMsk
|
||||
"ag-psd/read-write/vector-and-mask/src.psd", // vector mask with raster mask, plain shape, SoCo
|
||||
"ag-psd/read-write/winding-non-zero/src.psd", // non-zero winding shape
|
||||
"ag-psd/read-write/gradient/src.psd", // vsms and vstk vector blocks
|
||||
"ag-psd/read-write/text/src.psd", // type layer (TySh)
|
||||
"ag-psd/read-write/annotations/src.psd", // annotations
|
||||
"ag-psd/read-write/layer-comps/src.psd", // layer comps; thumbnail oracle
|
||||
"ag-psd/read-write/masks/src.psd", // mask parameters
|
||||
"ag-psd/read-write/shapes/src.psd", // linked and embedded smart objects (lnk2, lnkE), 15 vector blocks
|
||||
];
|
||||
|
||||
/// `corpus/psd-tools`.
|
||||
const PSD_TOOLS: &[&str] = &[
|
||||
"colormodes/100x20_1bit_bitmap_rle.psd", // Bitmap, RLE; oracle through the psd crate
|
||||
"colormodes/4x4_8bit_index_color.psd", // Indexed
|
||||
"colormodes/4x4_8bit_duotone.psd", // Duotone (layered TIFF writes it flat)
|
||||
"colormodes/4x4_16bit_lab.psd", // Lab 16
|
||||
"colormodes/4x4_16bit_multichannel.psd", // Multichannel
|
||||
"cmyk-gray-ramp.psd", // CMYK
|
||||
"colormodes/4x4_32bit_grayscale.psd", // Grayscale 32
|
||||
"16bit5x5.psb", // PSB (8-byte lengths), RGB 16
|
||||
"32bit5x5.psd", // RGB 32, layered
|
||||
"2layer_8ele_tblocks.psd", // a 1 px document with Tblocks
|
||||
"layers-minimal/smartobject-layer.psd", // embedded smart object
|
||||
"layers-minimal/type-layer.psd", // type layer
|
||||
"layers-minimal/shape-layer.psd", // shape layer
|
||||
"layers-minimal/solid-color-fill.psd", // fill layer; thumbnail oracle
|
||||
"layers/curves-with-vectormask.psd", // adjustment layer with a vector mask
|
||||
"layers/gradient-map.psd", // gradient map adjustment
|
||||
"effects/double-stroke-effects.psd", // multiple layer effects of one kind
|
||||
"blend-modes/dissolve.psd", // dissolve oracle metric
|
||||
"transparency/knockout-deep-nested.psd", // knockout in nested groups
|
||||
"passthrough_clipping_mask_adjustment.psd", // pass-through group, clipping mask
|
||||
"mask-density-layervectormask.psd", // layer and vector mask densities
|
||||
"descriptors/stroke-color-descriptors-lab.psd", // Lab colour descriptors
|
||||
"smart-object-slice.psb", // smart object in a PSB, slices
|
||||
];
|
||||
|
||||
/// `corpus/photoshop`: one file per feature group (each `adjustments/<mode><bits>`, effects, smart
|
||||
/// filters, type).
|
||||
const PHOTOSHOP: &[&str] = &[
|
||||
"adjustments/rgb8/hue-saturation.psd",
|
||||
"adjustments/rgb16/gradient-map.psd",
|
||||
"adjustments/rgb32/brightness-contrast.psd",
|
||||
"adjustments/gray8/curves.psd",
|
||||
"adjustments/gray16/posterize-4.psd",
|
||||
"adjustments/gray32/levels.psd",
|
||||
"adjustments/lab8/threshold-128.psd",
|
||||
"adjustments/lab16/posterize-4.psd",
|
||||
"adjustments/cmyk8/levels.psd",
|
||||
"adjustments/cmyk16/color-balance.psd",
|
||||
"effects/outer-glow-soft.psd",
|
||||
"effects/bevel-inner-smooth.psd",
|
||||
"smart-filters/sf-curves.psd", // re-renders like Photoshop (engine oracle)
|
||||
"smart-filters/sf-stack-blend-and-mask.psd", // filter stack with blending and a filter mask
|
||||
"text/point-sizes-colors-runs.psd", // Txt2, style runs
|
||||
];
|
||||
@@ -1,10 +1,12 @@
|
||||
//! photocraft-testkit
|
||||
#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]
|
||||
|
||||
pub mod corpus;
|
||||
pub mod gpu;
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub mod perf;
|
||||
pub mod sweep;
|
||||
|
||||
pub use corpus::full_sweep;
|
||||
pub use gpu::gpu_lock;
|
||||
pub use sweep::Sweep;
|
||||
@@ -4,7 +4,7 @@ use std::time::{SystemTime, UNIX_EPOCH};
|
||||
|
||||
/// The cases of a long sweep that this run covers. By default a run takes one of `parts` slices,
|
||||
/// chosen by the UTC date, so every case runs at least once every `parts` days.
|
||||
/// `PHOTOCRAFT_FULL_SWEEP=1` runs every case, and `PHOTOCRAFT_SWEEP_PART=<n>` replays slice `n`;
|
||||
/// A full sweep ([`crate::full_sweep`]) runs every case, and `PHOTOCRAFT_SWEEP_PART=<n>` replays slice `n`;
|
||||
/// [`Sweep::new`] prints the slice it picked.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct Sweep {
|
||||
@@ -14,7 +14,7 @@ pub struct Sweep {
|
||||
|
||||
impl Sweep {
|
||||
pub fn new(parts: u64) -> Self {
|
||||
if std::env::var_os("PHOTOCRAFT_FULL_SWEEP").is_some_and(|v| v == "1") {
|
||||
if crate::full_sweep() {
|
||||
eprintln!("full sweep (PHOTOCRAFT_FULL_SWEEP=1)");
|
||||
return Self { part: 0, parts: 1 };
|
||||
}
|
||||
|
||||
@@ -562,48 +562,6 @@ fn popup_channels(h: &mut Harness<'static, Box<PhotocraftApp>>) -> Vec<String> {
|
||||
h.query_all_by_role(egui::accesskit::Role::ComboBox).filter_map(|n| n.value().map(|s| s.to_string())).collect()
|
||||
}
|
||||
|
||||
/// Where text starting with `prefix` was painted in the last frame.
|
||||
fn painted_text(h: &Harness<'static, Box<PhotocraftApp>>, prefix: &str) -> Option<egui::Rect> {
|
||||
fn find(shape: &egui::Shape, prefix: &str) -> Option<egui::Rect> {
|
||||
match shape {
|
||||
egui::Shape::Text(text) if text.galley.text().starts_with(prefix) => Some(text.visual_bounding_rect()),
|
||||
egui::Shape::Vec(shapes) => shapes.iter().find_map(|shape| find(shape, prefix)),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
h.output().shapes.iter().find_map(|clipped| find(&clipped.shape, prefix))
|
||||
}
|
||||
|
||||
/// #15543: the selected point's Input and Output and the hint lie inside the Curves dialog (a square graph measured at
|
||||
/// its least width used to push them past the dialog's clip); the fields read the point, and editing Input moves it.
|
||||
#[test]
|
||||
fn curves_point_fields_read_and_move_the_selected_point_inside_the_dialog() {
|
||||
let (mut h, id) = open_in_harness(app_with_image(), "image.adjustments.curves");
|
||||
set_field(h.state_mut(), id, "points", json!([[0, 0], [64, 80], [255, 255]]));
|
||||
hosted(h.state_mut(), id).select_point(1);
|
||||
h.run_steps(4);
|
||||
|
||||
let dialog = h.get_by_role(egui::accesskit::Role::Dialog).rect();
|
||||
let input = h.get_by_label("Input");
|
||||
let output = h.get_by_label("Output");
|
||||
assert_eq!(input.value().as_deref(), Some("64"), "Input reads the selected point's input");
|
||||
assert_eq!(output.value().as_deref(), Some("80"), "Output reads the selected point's output");
|
||||
let hint = painted_text(&h, "Click to add a point").expect("the hint is painted");
|
||||
for (part, rect) in [("Input", input.rect()), ("Output", output.rect()), ("the hint", hint)] {
|
||||
assert!(dialog.contains_rect(rect), "{part} {rect:?} lies inside the dialog {dialog:?}");
|
||||
}
|
||||
|
||||
h.get_by_label("Input").click();
|
||||
h.run_steps(2);
|
||||
// Tab commits the field; Enter would answer the dialog.
|
||||
h.key_press_modifiers(egui::Modifiers::COMMAND, egui::Key::A);
|
||||
h.event(egui::Event::Text("96".into()));
|
||||
h.run_steps(1);
|
||||
h.key_press(egui::Key::Tab);
|
||||
h.run_steps(3);
|
||||
assert_eq!(channel_points(h.state_mut(), "points"), vec![[0.0, 0.0], [96.0, 80.0], [255.0, 255.0]], "setting Input moves the point");
|
||||
}
|
||||
|
||||
/// A Lab OK followed by ⌥-reopen (the last settings): the combined record and the native lightness
|
||||
/// record both come back.
|
||||
#[test]
|
||||
|
||||
@@ -109,7 +109,7 @@ While iterating, run less and keep the full commands above as the final gate: `c
|
||||
|
||||
**MCP in tests and agent sessions: `photocraft-cli mcp --headless`.** Plain `photocraft-cli mcp` works in the open PhotoCraft window while the ArtCraft Launcher's agents switch is on, and then may start PhotoCraft on the developer's machine when it is closed. Scripts, tests and agents that want a session without a window pass `--headless` (or use `photocraft-cli serve`); a test that runs the CLI also gives it its own settings, launcher and flags folders (`PHOTOCRAFT_CONFIG_DIR`, `CRAFT_MCP_DIR`, `CRAFT_FLAGS_FILE`, as `crate::command()` in `apps/photocraft-cli/tests/it/main.rs` does). To drive the running app on purpose, use `--control` (`docs/development.md`).
|
||||
|
||||
**Test corpora.** Real-file corpora live in `corpus/` (gitignored, never committed), fetched at pinned commits and sha256-verified by `cargo xtask corpus --all`: our Photoshop- and GIMP-authored oracles from https://github.com/storytold/photocraft-corpus plus psd-tools, ag-psd and PngSuite from their upstreams. Pins: `xtask/src/corpus_pins.rs`. The corpus tests are opt-in (cargo feature `corpus`): plain `cargo test` skips them, and with the feature on a missing corpus fails ("run `cargo xtask corpus --all`"). `cargo xtask test-corpus` fetches and runs them all. CI always runs them (the `corpus` job, cached by pin). Never commit corpus files; new oracles go to photocraft-corpus (its `AGENTS.md`), then a pin bump here. Details: `docs/development.md` › Test corpora.
|
||||
**Test corpora.** Real-file corpora live in `corpus/` (gitignored, never committed), fetched at pinned commits and sha256-verified by `cargo xtask corpus --all`: our Photoshop- and GIMP-authored oracles from https://github.com/storytold/photocraft-corpus plus psd-tools, ag-psd and PngSuite from their upstreams. Pins: `xtask/src/corpus_pins.rs`. The corpus tests are opt-in (cargo feature `corpus`): plain `cargo test` skips them, and with the feature on a missing corpus fails ("run `cargo xtask corpus --all`"). `cargo xtask test-corpus` fetches and runs them all. `cargo xtask test-corpus` runs each directory's fixed sample; `PHOTOCRAFT_FULL_SWEEP=1` runs every file. CI always runs them: the samples on pull requests and main, every file nightly. Never commit corpus files; new oracles go to photocraft-corpus (its `AGENTS.md`), then a pin bump here. Details: `docs/development.md` › Test corpora.
|
||||
|
||||
The dev log is `log/devlog.md` (local, gitignored).
|
||||
|
||||
|
||||
+13
-7
@@ -2,7 +2,7 @@
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Rust stable (1.95+). Add the web target with `rustup target add wasm32-unknown-unknown`.
|
||||
- Rust: `rust-toolchain.toml` names the release CI builds with, and rustup installs it with the web target on first use (`rust-version` in Cargo.toml is the oldest release the sources support, 1.95).
|
||||
- macOS, Windows or Linux. On Linux, install the windowing, GL and GTK development packages:
|
||||
- Debian/Ubuntu: `sudo apt install libxkbcommon-dev libwayland-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev libgtk-3-dev`
|
||||
- Fedora/RHEL: `sudo dnf install libxkbcommon-devel wayland-devel libX11-devel libXrandr-devel libXi-devel mesa-libGL-devel gtk3-devel`
|
||||
@@ -1067,12 +1067,18 @@ scripts/fetch-corpus.sh # the same as cargo xtask corpus --all
|
||||
turns it on).
|
||||
- With the feature on, a missing corpus is a failure ("run `cargo xtask corpus --all`"), never a
|
||||
silent skip, and every floor is enforced.
|
||||
- The tests that walk `corpus/psd`, `corpus/psd-tools` and `corpus/photoshop` take each
|
||||
directory's fixed sample (`photocraft-testkit`'s `corpus` module: every colour mode and depth,
|
||||
PSD and PSB, every tagged block key outside the large files, each oracle kind, at small canvas
|
||||
sizes), so each test stays near a second. `PHOTOCRAFT_FULL_SWEEP=1` takes every file, as it
|
||||
takes every case of the testkit sweeps; the Affinity test's sampled rows are marked in its table.
|
||||
A sample file a pin removes fails the test: pick its replacement for the sample.
|
||||
- If you touch psd, io, codecs, compose, gpu, text or format, run `cargo xtask test-corpus` before
|
||||
you finish.
|
||||
- The CI `corpus` job runs `cargo xtask corpus --all` and then `cargo xtask test-corpus` on every PR
|
||||
and on main. `corpus/` is cached with `actions/cache`, keyed on the hash of `corpus_pins.rs` and
|
||||
the manifests. A download happens only when a pin changes; otherwise the cache restores in seconds
|
||||
and is re-verified (sha256) before the tests run. Fork PRs read the base branch's cache.
|
||||
you finish, and `PHOTOCRAFT_FULL_SWEEP=1 cargo xtask test-corpus` when the change could reach
|
||||
files outside the samples.
|
||||
- CI: the Linux gate builds the corpus tests in (`PHOTOCRAFT_CORPUS_TESTS=1`) and each test shard
|
||||
runs `cargo xtask corpus --all` first (pinned, sha256-verified, about 20 MB). Pull requests and
|
||||
main run the samples; the nightly run sets `PHOTOCRAFT_FULL_SWEEP=1` and runs every file.
|
||||
|
||||
**Our own corpus: [photocraft-corpus](https://github.com/storytold/photocraft-corpus).**
|
||||
|
||||
@@ -1136,7 +1142,7 @@ the corpus pin, and review them against `xtask/photoshop-corpus.sha256`.
|
||||
|
||||
These checks use PhotoCraft's own importer and inspector; they do **not** prove that
|
||||
Photoshop can open the output or interprets it correctly. The report marks those
|
||||
stages `not_run`. The ordinary CI corpus job does not yet run this recipe command or
|
||||
stages `not_run`. The ordinary CI gate does not yet run this recipe command or
|
||||
upload its artifacts; that integration and the Photoshop judge are separate work.
|
||||
|
||||
## Rendering fidelity (PSD oracle)
|
||||
|
||||
+1
-1
@@ -158,7 +158,7 @@ Corpus floors (`crates/io/tests/it/corpus.rs`): the enforced minimums; the corpu
|
||||
| FILE-215-19 | Save As JPEG opens a JPEG Options dialog (quality 0-12, format options) | partial | [#215](https://github.com/storytold/photocraft/issues/215) | jpeg_options_ui.rs: File > Save, Save As and Save a Copy to a JPEG ask for Quality 0-12 (Low/Medium/High/Maximum) and Baseline / Baseline Optimized / Progressive before writing, starting at an opened JPEG's own quality (file_encoding) or else the Export preference; scripts pass quality/jpegFormat (file.saveAs, file.saveACopy, app.save, CLI --jpeg-format) and recorded actions replay the answer (discard_ui/tests/jpeg_tests.rs, codecs roundtrip jpeg_format_options_round_trip). Baseline Optimized fits the Huffman tables only at 4:4:4 (Gray, CMYK) or progressive: RGB is written 4:2:0, which zune-jpeg 0.5.15 decodes wrongly with fitted tables, as in Save for Web, so RGB Baseline Optimized writes the same file as Baseline. The dialog shows the size the file will have (152.3K, 1.5M), encoded in memory with its settings on a worker thread (in the frame on the web), up to 40 MP, 4 MP on the web (jpeg_options_ui/size_readout.rs). Missing: Matte and progressive Scans (3-5) |
|
||||
| FILE-215-20 | Artboard tool with handles and + buttons, Duplicate Artboard beside, vector PDF pages | partial | [#215](https://github.com/storytold/photocraft/issues/215) | artboard_tool.rs: Artboard tool draws, selects, moves and resizes boards by their handles (⇧ keeps proportions), its + buttons add a board or (⌥) a copy beside the selected one (#3033); Duplicate Artboard places the copy beside (#1584); raster PDF pages only |
|
||||
| FILE-215-21 | Local libraries of colours, patterns, images and layers, as linked items or copies | missing | [#215](https://github.com/storytold/photocraft/issues/215) | Only preset libraries (preset_store.rs) |
|
||||
| FILE-216-1 | Every corpus fetched and enforced in CI, cached by pin | done | [#216](https://github.com/storytold/photocraft/issues/216) | ci.yml has a corpus job (name: corpus tests) on every PR and on main: the corpora are pinned in xtask/src/corpus_pins.rs, sha256-verified after both a cache restore and a download, and a missing corpus fails the tests. The cache key follows the pins, so it is cached by pin as this row asks (#190) |
|
||||
| FILE-216-1 | Every corpus fetched and enforced in CI, cached by pin | done | [#216](https://github.com/storytold/photocraft/issues/216) | the Linux gate builds the corpus tests in and runs them (fixed samples on every PR and on main, every file nightly): the corpora are pinned in xtask/src/corpus_pins.rs, sha256-verified after both a cache restore and a download, and a missing corpus fails the tests. The cache key follows the pins, so it is cached by pin as this row asks (#190) |
|
||||
| FILE-216-2 | Large-file fixtures: 20 MP, 150-layer, generated 2 GB PSD and 4-5 GB PSB stress tests | done | [#216](https://github.com/storytold/photocraft/issues/216) | Generated at test time by psd fixtures.rs (feature testgen; never committed). io tests/it/large_files.rs: layered_20_mp_psd_opens_and_saves (5472x3648, 5 layers in 2 groups, mask, drop shadow) and layout_with_150_layers_opens_and_saves (A4 300 ppi, 150 layers in 15 groups, masks, hidden layers, closed groups, drop shadows) run in every cargo test (~2 s each); opt-in psd_just_under_2_gb_opens_and_saves (17,000 px, 2.02 GB PSD) and psb_of_4_gb_opens_and_saves (25,000 px, 4.38 GB PSB, data past 4 GiB), each opened, pixel-checked, saved and re-opened; plus large_psb.rs (2.5 GB merged image). Open times: ui-egui large_file_bench (P20, P63). The 2 GB and 4 GB files are not run in CI (6.4 GB on disk; ~12 GB of memory for the PSD test, ~25 GB for the PSB test) (#5107) |
|
||||
| FILE-216-3 | TIFF, RAW and EXR corpora read by tests; per-camera RAW coverage reported | partial | [#216](https://github.com/storytold/photocraft/issues/216) | EXR: corpus/exr (the OpenEXR deep test images, pinned) is read by codecs tests/it/deep_exr.rs in the CI corpus job, against the ID manifests of the upstream sidecars. corpus/tiff and corpus/raw are still copied in by hand and no test reads them; no per-camera RAW report |
|
||||
| FILE-216-4 | Exports re-open in a third-party oracle editor | missing | [#216](https://github.com/storytold/photocraft/issues/216) | The round trip is our export -> our import |
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# The Rust release CI and contributors build with. One release means a new Rust release does not
|
||||
# start a cold build in every cache key (they hold `rustc -vV`). The nightly CI run warns when
|
||||
# a newer stable exists (scripts/ci-toolchain-bump.py); a bump is a pull request that changes `channel`.
|
||||
# `rust-version` in Cargo.toml is the oldest release the sources support.
|
||||
[toolchain]
|
||||
channel = "1.100.0"
|
||||
components = ["clippy", "rustfmt"]
|
||||
targets = ["wasm32-unknown-unknown"]
|
||||
@@ -157,7 +157,7 @@ id = "FILE-216-1"
|
||||
target = "Every corpus fetched and enforced in CI, cached by pin"
|
||||
status = "done"
|
||||
issue = 216
|
||||
note = "ci.yml has a corpus job (name: corpus tests) on every PR and on main: the corpora are pinned in xtask/src/corpus_pins.rs, sha256-verified after both a cache restore and a download, and a missing corpus fails the tests. The cache key follows the pins, so it is cached by pin as this row asks (#190)"
|
||||
note = "the Linux gate builds the corpus tests in and runs them (fixed samples on every PR and on main, every file nightly): the corpora are pinned in xtask/src/corpus_pins.rs, sha256-verified after both a cache restore and a download, and a missing corpus fails the tests. The cache key follows the pins, so it is cached by pin as this row asks (#190)"
|
||||
|
||||
[[item]]
|
||||
id = "FILE-216-2"
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
#!/usr/bin/env python3
|
||||
"""The nightly cold run deletes the rolling crates entries just before it saves its own.
|
||||
|
||||
python3 scripts/ci-clear-rolling-cache.py needs GH_TOKEN, GITHUB_REPOSITORY, GITHUB_RUN_ID, GITHUB_RUN_ATTEMPT
|
||||
|
||||
The cold run (ci.yml, `cold-build`) never restores the rolling entry, so the old one only adds to
|
||||
the cache while the new one is saved: two entries of about 4 GB each, beside the others, go over the
|
||||
repository's 10 GB limit and GitHub evicts the Windows, web and corpus entries. The gate's build job
|
||||
saves in its `Post` steps; this deletes the old entries when the first of them starts. Pull requests
|
||||
and pushes that start in the minutes between restore nothing from the deleted entry and build cold
|
||||
once. Deleting is the only write; the entry the cold run saves does not exist yet when this runs.
|
||||
Only entries created before this run started are deleted: a push or pull request run in the same
|
||||
minutes may have saved an entry of its own, and the cold run's own save is never touched.
|
||||
"""
|
||||
|
||||
from datetime import datetime
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
REF = 'refs/heads/main'
|
||||
BUILD_JOB = re.compile(r'^gate / build \(')
|
||||
ROLLING = '-gate-crates-'
|
||||
POLL_SECONDS = 20
|
||||
GIVE_UP_SECONDS = 100 * 60
|
||||
|
||||
|
||||
def saving(job):
|
||||
"""True once the job's post steps (the cache save) have started."""
|
||||
return any(s['name'].startswith('Post ') and s['status'] in ('in_progress', 'completed') for s in job.get('steps', []))
|
||||
|
||||
|
||||
def build_job(jobs):
|
||||
return next((j for j in jobs if BUILD_JOB.match(j['name'])), None)
|
||||
|
||||
|
||||
def rolling_entries(caches):
|
||||
return [c for c in caches if ROLLING in c['key']]
|
||||
|
||||
|
||||
def created_before(entries, started):
|
||||
"""The entries created before `started`, an ISO 8601 timestamp (`run_started_at`)."""
|
||||
limit = parse_time(started)
|
||||
return [c for c in entries if parse_time(c['created_at']) < limit]
|
||||
|
||||
|
||||
def parse_time(text):
|
||||
return datetime.fromisoformat(text.replace('Z', '+00:00'))
|
||||
|
||||
|
||||
def gh(*args):
|
||||
out = subprocess.run(['gh', 'api', *args], check=True, capture_output=True, text=True).stdout
|
||||
return json.loads(out) if out.strip() else None
|
||||
|
||||
|
||||
def main():
|
||||
repo, run, attempt = os.environ['GITHUB_REPOSITORY'], os.environ['GITHUB_RUN_ID'], os.environ.get('GITHUB_RUN_ATTEMPT', '1')
|
||||
deadline = time.monotonic() + GIVE_UP_SECONDS
|
||||
while True:
|
||||
jobs = gh(f'repos/{repo}/actions/runs/{run}/attempts/{attempt}/jobs?per_page=100') or {}
|
||||
job = build_job(jobs.get('jobs', []))
|
||||
if job and saving(job):
|
||||
break
|
||||
if job and job['status'] == 'completed':
|
||||
print('the build job finished without a save step; nothing deleted')
|
||||
return
|
||||
if time.monotonic() > deadline:
|
||||
print('::warning::the build job never reached its save; nothing deleted')
|
||||
return
|
||||
time.sleep(POLL_SECONDS)
|
||||
started = gh(f'repos/{repo}/actions/runs/{run}')['run_started_at']
|
||||
caches = (gh(f'repos/{repo}/actions/caches?ref={REF}&per_page=100') or {}).get('actions_caches', [])
|
||||
for c in created_before(rolling_entries(caches), started):
|
||||
print(f"delete {c['key']} ({c['size_in_bytes'] / 1e9:.2f} GB)")
|
||||
subprocess.run(['gh', 'api', '-X', 'DELETE', f"repos/{repo}/actions/caches/{c['id']}"], check=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
@@ -21,6 +21,12 @@ cargo nextest run --archive-file "$NEXTEST_ARCHIVE_FILE" --workspace-remap . --e
|
||||
xtask=("$archive/target/debug/xtask" ci tests --from "$archive" --shard "$GATE_SHARD")
|
||||
case "$(uname -s)" in MINGW* | MSYS* | CYGWIN*) xtask=("$archive/target/debug/xtask.exe" ci tests --from "$archive" --shard "$GATE_SHARD") ;; esac
|
||||
|
||||
# The gate builds the real-file corpus tests in (PHOTOCRAFT_CORPUS_TESTS=1, xtask's CORPUS_FEATURES):
|
||||
# they fail when the corpus is missing, so a shard fetches it first (pinned commits, sha256-verified).
|
||||
if [ "${PHOTOCRAFT_CORPUS_TESTS:-}" = 1 ]; then
|
||||
"${xtask[0]}" corpus --all
|
||||
fi
|
||||
|
||||
case "${1:-}" in
|
||||
"") exec "${xtask[@]}" ;;
|
||||
--gpu-shard)
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Prints the newest stable Rust release when it is newer than rust-toolchain.toml's channel.
|
||||
|
||||
CI's nightly run (ci.yml `toolchain-check`) warns with it. Prints nothing when the file is current.
|
||||
"""
|
||||
|
||||
import re
|
||||
import sys
|
||||
import tomllib
|
||||
import urllib.request
|
||||
from pathlib import Path
|
||||
|
||||
FILE = Path(__file__).resolve().parent.parent / 'rust-toolchain.toml'
|
||||
MANIFEST = 'https://static.rust-lang.org/dist/channel-rust-stable.toml'
|
||||
RELEASE = re.compile(r'^\d+\.\d+\.\d+$')
|
||||
|
||||
|
||||
def numbers(version):
|
||||
return tuple(int(part) for part in version.split('.'))
|
||||
|
||||
|
||||
def current(text):
|
||||
return tomllib.loads(text)['toolchain']['channel']
|
||||
|
||||
|
||||
def latest(manifest_text):
|
||||
"""`1.101.0` from the stable manifest's `[pkg.rust] version = "1.101.0 (<hash> <date>)"`."""
|
||||
version = tomllib.loads(manifest_text)['pkg']['rust']['version'].split()[0]
|
||||
if not RELEASE.match(version):
|
||||
raise ValueError(f'unexpected stable version {version!r}')
|
||||
return version
|
||||
|
||||
|
||||
def newer(file_text, manifest_text):
|
||||
"""The stable release when it is newer than the file's channel (a `1.x.y` release), else None."""
|
||||
pinned = current(file_text)
|
||||
stable = latest(manifest_text)
|
||||
if RELEASE.match(pinned) and numbers(stable) <= numbers(pinned):
|
||||
return None
|
||||
return stable
|
||||
|
||||
|
||||
def main(argv):
|
||||
with urllib.request.urlopen(MANIFEST, timeout=30) as response:
|
||||
stable = newer(FILE.read_text(), response.read().decode())
|
||||
if stable:
|
||||
print(stable)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main(sys.argv[1:])
|
||||
@@ -20,10 +20,15 @@ any workspace package it depends on has a changed file, and nothing shared chang
|
||||
a file outside the packages that is not documentation). They have no `cfg(windows)`, `cfg(unix)` or
|
||||
`cfg(target_os ...)` in their sources, so Windows adds no coverage over the Linux gate for them.
|
||||
|
||||
The Linux gate skips by the same rule for every package except photocraft-gpu, whose tests the Linux
|
||||
gate runs on every pull request (`--skip-linux`).
|
||||
|
||||
Usage:
|
||||
ci-windows-gpu-tests.py BASE prints `true` (run photocraft-gpu's tests) or `false`.
|
||||
ci-windows-gpu-tests.py --skip-neutral BASE prints the neutral packages to skip, space-separated
|
||||
(nothing when none).
|
||||
ci-windows-gpu-tests.py --skip-linux BASE prints the packages the Linux gate skips, space-separated
|
||||
(nothing when none).
|
||||
"""
|
||||
|
||||
import json
|
||||
@@ -130,6 +135,17 @@ def neutral_to_skip(changed, packages, root):
|
||||
return sorted(n for n in NEUTRAL if n in deps and not (inputs_of(n, deps) & owners))
|
||||
|
||||
|
||||
def linux_to_skip(changed, packages, root):
|
||||
"""Every workspace package but photocraft-gpu whose tests the Linux gate skips for these changed
|
||||
files, sorted: nothing it depends on (itself included) has a changed file, and nothing shared
|
||||
changed."""
|
||||
owners = changed_packages(changed, packages, root)
|
||||
if owners is None:
|
||||
return []
|
||||
deps = workspace_deps(packages)
|
||||
return sorted(n for n in deps if n != GPU and not (inputs_of(n, deps) & owners))
|
||||
|
||||
|
||||
def changed_files(base, cwd=None):
|
||||
"""The files changed between `base` and HEAD. `--no-renames` lists both sides of a move: by
|
||||
default git names only the destination, so moving a file out of photocraft-gpu would look like a
|
||||
@@ -141,14 +157,17 @@ def changed_files(base, cwd=None):
|
||||
def main(argv):
|
||||
args = argv[1:]
|
||||
skip_neutral = args[:1] == ['--skip-neutral']
|
||||
if skip_neutral:
|
||||
skip_linux = args[:1] == ['--skip-linux']
|
||||
if skip_neutral or skip_linux:
|
||||
args = args[1:]
|
||||
if len(args) != 1:
|
||||
print(__doc__, file=sys.stderr)
|
||||
return 2
|
||||
changed = changed_files(args[0])
|
||||
meta = json.loads(subprocess.run(['cargo', 'metadata', '--no-deps', '--format-version', '1'], check=True, capture_output=True, text=True).stdout)
|
||||
if skip_neutral:
|
||||
if skip_linux:
|
||||
print(' '.join(linux_to_skip(changed, meta['packages'], meta['workspace_root'])))
|
||||
elif skip_neutral:
|
||||
print(' '.join(neutral_to_skip(changed, meta['packages'], meta['workspace_root'])))
|
||||
else:
|
||||
print('true' if needs_gpu_tests(changed, meta['packages'], meta['workspace_root']) else 'false')
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
from importlib.machinery import SourceFileLoader
|
||||
from pathlib import Path
|
||||
import unittest
|
||||
|
||||
clear = SourceFileLoader('clear', str(Path(__file__).with_name('ci-clear-rolling-cache.py'))).load_module()
|
||||
|
||||
|
||||
class TestClear(unittest.TestCase):
|
||||
def test_the_build_job_is_saving_once_a_post_step_starts(self):
|
||||
steps = lambda *s: {'name': 'gate / build (ubuntu-24.04)', 'steps': [{'name': n, 'status': st} for n, st in s]}
|
||||
self.assertFalse(clear.saving(steps(('Setup', 'completed'), ('Build the test archive', 'in_progress'))))
|
||||
self.assertTrue(clear.saving(steps(('Build the test archive', 'completed'), ('Post Setup', 'in_progress'))))
|
||||
|
||||
def test_only_the_build_job_counts(self):
|
||||
jobs = [{'name': 'gate / lint (ubuntu-24.04)'}, {'name': 'gate / build (ubuntu-24.04)'}]
|
||||
self.assertEqual(clear.build_job(jobs), jobs[1])
|
||||
|
||||
def test_only_rolling_crates_entries_are_deleted(self):
|
||||
caches = [
|
||||
{'key': 'v2-rust-ab-gate-crates-Linux-x64-1-1-Linux-x64-d8-99'},
|
||||
{'key': 'v2-rust-ab-gate-Windows_NT-x64-ae-88'},
|
||||
{'key': 'v1-rust-corpus-corpus-Linux-x64-62-99'},
|
||||
]
|
||||
self.assertEqual(clear.rolling_entries(caches), caches[:1])
|
||||
|
||||
def test_entries_created_after_the_run_started_are_kept(self):
|
||||
rolling = lambda created: {'key': 'v2-rust-ab-gate-crates-Linux-x64-1', 'created_at': created}
|
||||
old, same_minute_push = rolling('2026-11-21T03:00:00Z'), rolling('2026-11-22T03:05:00Z')
|
||||
self.assertEqual(clear.created_before([old, same_minute_push], '2026-11-22T03:00:10Z'), [old])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -0,0 +1,26 @@
|
||||
from importlib.machinery import SourceFileLoader
|
||||
from pathlib import Path
|
||||
import unittest
|
||||
|
||||
bump = SourceFileLoader('bump', str(Path(__file__).with_name('ci-toolchain-bump.py'))).load_module()
|
||||
|
||||
FILE = '# note\n[toolchain]\nchannel = "1.100.0"\ncomponents = ["clippy"]\n'
|
||||
|
||||
|
||||
def manifest(version):
|
||||
return f'[pkg.rust]\nversion = "{version} (0ef1bc386 2026-11-09)"\n'
|
||||
|
||||
|
||||
class TestBump(unittest.TestCase):
|
||||
def test_a_newer_stable_is_reported_and_the_same_or_older_is_not(self):
|
||||
self.assertEqual(bump.newer(FILE, manifest('1.101.0')), '1.101.0')
|
||||
self.assertEqual(bump.newer(FILE, manifest('1.110.0')), '1.110.0')
|
||||
self.assertIsNone(bump.newer(FILE, manifest('1.100.0')))
|
||||
self.assertIsNone(bump.newer(FILE, manifest('1.99.2')))
|
||||
|
||||
def test_a_pin_that_is_not_a_release_moves_to_stable(self):
|
||||
self.assertEqual(bump.newer(FILE.replace('1.100.0', 'stable'), manifest('1.100.0')), '1.100.0')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -132,5 +132,25 @@ class NeutralSelection(unittest.TestCase):
|
||||
self.assertEqual(self.skipped('docs/a.md'), ['photocraft-algo', 'photocraft-compose', 'photocraft-geom'])
|
||||
|
||||
|
||||
class TestLinuxSkip(unittest.TestCase):
|
||||
def skipped(self, *changed):
|
||||
return select.linux_to_skip(list(changed), PACKAGES, ROOT)
|
||||
|
||||
def test_a_leaf_change_skips_what_does_not_build_on_it(self):
|
||||
self.assertEqual(self.skipped('crates/ui-egui/src/lib.rs'), ['photocraft-compose', 'photocraft-raster'])
|
||||
|
||||
def test_a_change_reaches_the_packages_built_on_it_but_never_skips_gpu(self):
|
||||
self.assertEqual(self.skipped('crates/compose/src/lib.rs'), ['photocraft-raster'])
|
||||
self.assertNotIn('photocraft-gpu', self.skipped('crates/ui-egui/src/lib.rs'))
|
||||
|
||||
def test_shared_inputs_skip_nothing(self):
|
||||
for path in ['crates/raster/Cargo.toml', 'Cargo.lock', '.github/workflows/ci.yml']:
|
||||
with self.subTest(path=path):
|
||||
self.assertEqual(self.skipped('crates/ui-egui/src/lib.rs', path), [])
|
||||
|
||||
def test_documentation_only_skips_everything_but_gpu(self):
|
||||
self.assertEqual(self.skipped('docs/a.md'), ['photocraft', 'photocraft-compose', 'photocraft-raster', 'photocraft-ui-egui'])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -52,8 +52,17 @@ pub fn record_xtask() -> Result<(), String> {
|
||||
return Ok(());
|
||||
}
|
||||
let mut c = crate::cargo();
|
||||
c.args(["build", "-p", "xtask", "--message-format", "json-render-diagnostics"]);
|
||||
run(c, "cargo build -p xtask --message-format json-render-diagnostics")
|
||||
xtask_build_args(&mut c, cfg!(feature = "framework-checks"));
|
||||
let what = crate::shown(&c);
|
||||
run(c, &what)
|
||||
}
|
||||
|
||||
fn xtask_build_args(c: &mut Command, framework_checks: bool) {
|
||||
c.args(["build", "--locked", "-p", "xtask", "--message-format", "json-render-diagnostics"]);
|
||||
// Match the features of the running bootstrap, including `cargo xtask-gate`.
|
||||
if !framework_checks {
|
||||
c.arg("--no-default-features");
|
||||
}
|
||||
}
|
||||
|
||||
/// Lines that are Cargo's JSON messages go to `record`, every other line to `out`.
|
||||
@@ -78,6 +87,19 @@ fn route(mut input: impl BufRead, record: &mut impl Write, out: &mut impl Write)
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn xtask_record_build_matches_bootstrap_features() {
|
||||
for enabled in [false, true] {
|
||||
let mut c = Command::new("cargo");
|
||||
xtask_build_args(&mut c, enabled);
|
||||
let args: Vec<_> = c.get_args().map(|s| s.to_string_lossy().into_owned()).collect();
|
||||
assert_eq!(args.contains(&"--no-default-features".into()), !enabled);
|
||||
assert!(args.contains(&"--locked".into()));
|
||||
assert!(args.windows(2).any(|p| p == ["-p", "xtask"]));
|
||||
assert!(args.windows(2).any(|p| p == ["--message-format", "json-render-diagnostics"]));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cargo_messages_are_recorded_and_test_output_passes_through() {
|
||||
let input = "{\"reason\":\"compiler-artifact\",\"fresh\":true}\nrunning 3 tests\ntest a ... ok\n{\"reason\":\"build-finished\",\"success\":true}";
|
||||
|
||||
+42
-9
@@ -333,6 +333,8 @@ struct CiOptions {
|
||||
selection: Selection,
|
||||
/// Workspace packages left out of the test build and the doctests ($PHOTOCRAFT_CI_EXCLUDE).
|
||||
exclude: Vec<String>,
|
||||
/// Build the real-file corpus tests in ($PHOTOCRAFT_CORPUS_TESTS=1, the gate): see CORPUS_FEATURES.
|
||||
corpus: bool,
|
||||
}
|
||||
|
||||
/// The archives `ci archive` writes.
|
||||
@@ -405,8 +407,22 @@ fn gate_args(exclude: &[String]) -> Vec<String> {
|
||||
}
|
||||
|
||||
/// The test build every test step shares: the gate's packages and features, TEST_TARGETS.
|
||||
fn test_build_args(exclude: &[String]) -> Vec<String> {
|
||||
/// Packages whose real-file corpus tests (`feature = "corpus"`) the gate builds in with
|
||||
/// PHOTOCRAFT_CORPUS_TESTS=1. Those tests fail when the corpus is missing, so the gate's shards
|
||||
/// fetch it first (scripts/ci-test-shard.sh); a local `ci tests` leaves them out.
|
||||
const CORPUS_FEATURES: [&str; 2] = ["photocraft-io/corpus", "photocraft-engine/corpus"];
|
||||
|
||||
fn test_build_args(exclude: &[String], corpus: bool) -> Vec<String> {
|
||||
let mut args = gate_args(exclude);
|
||||
if corpus {
|
||||
// `--features pkg/feature` names a package `--exclude` removed from the build: leave it out.
|
||||
let extra: Vec<&str> = CORPUS_FEATURES.iter().copied().filter(|f| !exclude.iter().any(|e| f.split('/').next() == Some(e.as_str()))).collect();
|
||||
if let Some(i) = args.iter().position(|a| a == "--features")
|
||||
&& !extra.is_empty()
|
||||
{
|
||||
args[i + 1] = format!("{},{}", args[i + 1], extra.join(","));
|
||||
}
|
||||
}
|
||||
args.extend(TEST_TARGETS[1..].iter().map(|a| a.to_string()));
|
||||
args
|
||||
}
|
||||
@@ -462,7 +478,7 @@ fn nextest_args(o: &CiOptions, panic_hunt: bool, gpu: Option<&str>, shard: Optio
|
||||
path(root()),
|
||||
]);
|
||||
} else {
|
||||
args.extend(test_build_args(&o.exclude));
|
||||
args.extend(test_build_args(&o.exclude, o.corpus));
|
||||
}
|
||||
if let Some(partition) = &o.partition {
|
||||
args.extend(["--partition".to_string(), partition.clone()]);
|
||||
@@ -504,7 +520,7 @@ fn step_tests(o: &CiOptions, panic_hunt: bool) -> Result<(), String> {
|
||||
c.args(["test", "-p", "photocraft-engine", "--locked", "--features", "photocraft-io/heif", "--test", "panic_hunt", "--", "--ignored"]);
|
||||
} else {
|
||||
eprintln!("note: cargo-nextest is not installed, running cargo test (cargo install cargo-nextest --locked)");
|
||||
c.arg("test").args(test_build_args(&o.exclude));
|
||||
c.arg("test").args(test_build_args(&o.exclude, o.corpus));
|
||||
}
|
||||
} else {
|
||||
let gpu = if o.selection == Selection::All { None } else { Some(read_gpu_filter()?) };
|
||||
@@ -533,14 +549,14 @@ fn build_tests(o: &CiOptions) -> Result<(), String> {
|
||||
Err(e) if e.kind() != std::io::ErrorKind::NotFound => return Err(format!("{}: {e}", plan.display())),
|
||||
_ => {}
|
||||
}
|
||||
c.args(["nextest", "archive", "--profile", "ci"]).args(test_build_args(&o.exclude)).arg("--archive-file").arg(file);
|
||||
c.args(["nextest", "archive", "--profile", "ci"]).args(test_build_args(&o.exclude, o.corpus)).arg("--archive-file").arg(file);
|
||||
if recording {
|
||||
c.args(["--cargo-message-format", "json-render-diagnostics"]);
|
||||
}
|
||||
}
|
||||
Some(Archive::Shards { dir, name, shards, gpu_shard }) => return build_shard_archives(o, dir, name, *shards, *gpu_shard),
|
||||
None => {
|
||||
c.args(["test", "--no-run"]).args(test_build_args(&o.exclude));
|
||||
c.args(["test", "--no-run"]).args(test_build_args(&o.exclude, o.corpus));
|
||||
if recording {
|
||||
c.args(["--message-format", "json-render-diagnostics"]);
|
||||
}
|
||||
@@ -553,7 +569,7 @@ fn build_tests(o: &CiOptions) -> Result<(), String> {
|
||||
/// `cargo nextest list --profile ci --message-format json` of the test build, with `args`.
|
||||
fn nextest_list(o: &CiOptions, args: &[&str], record: bool) -> Result<serde_json::Value, String> {
|
||||
let mut c = cargo();
|
||||
c.args(["nextest", "list", "--profile", "ci", "--message-format", "json"]).args(test_build_args(&o.exclude)).args(args);
|
||||
c.args(["nextest", "list", "--profile", "ci", "--message-format", "json"]).args(test_build_args(&o.exclude, o.corpus)).args(args);
|
||||
let record = record.then(cache_units::file).flatten();
|
||||
if record.is_some() {
|
||||
c.args(["--cargo-message-format", "json-render-diagnostics"]);
|
||||
@@ -605,7 +621,7 @@ fn build_shard_archives(o: &CiOptions, dir: &Path, name: &str, shards: usize, gp
|
||||
std::fs::create_dir_all(dir.join((k + 1).to_string())).map_err(|e| format!("{}: {e}", dir.display()))?;
|
||||
let mut c = cargo();
|
||||
c.args(["nextest", "archive", "--profile", "ci"])
|
||||
.args(test_build_args(&o.exclude))
|
||||
.args(test_build_args(&o.exclude, o.corpus))
|
||||
.arg("-E")
|
||||
.arg(shard.archive_filter())
|
||||
.arg("--archive-file")
|
||||
@@ -659,7 +675,16 @@ fn ci_exclude() -> Vec<String> {
|
||||
/// The steps `cargo xtask ci <args>` runs, and how: no argument runs every step; a part (`lint`,
|
||||
/// `build`, `tests`) runs the steps of one gate job; a step's name runs that step.
|
||||
fn ci_from_args(args: &[&str], exclude: Vec<String>) -> Result<(CiPlan, CiOptions), String> {
|
||||
let mut options = CiOptions { build_only: false, partition: None, archive: None, from: None, shard: None, selection: Selection::All, exclude };
|
||||
let mut options = CiOptions {
|
||||
build_only: false,
|
||||
partition: None,
|
||||
archive: None,
|
||||
from: None,
|
||||
shard: None,
|
||||
selection: Selection::All,
|
||||
exclude,
|
||||
corpus: std::env::var_os("PHOTOCRAFT_CORPUS_TESTS").is_some_and(|v| v == "1"),
|
||||
};
|
||||
let mut gpu_shard = false;
|
||||
let mut what = None;
|
||||
let mut it = args.iter();
|
||||
@@ -819,6 +844,7 @@ mod ci_tests {
|
||||
partition: Some("hash:2/3".into()),
|
||||
selection: Selection::NoGpu,
|
||||
exclude: vec!["photocraft-web".into()],
|
||||
corpus: false,
|
||||
};
|
||||
let build = "--workspace --locked --features heif --exclude photocraft-web --lib --bins --tests";
|
||||
let args = nextest_args(&options, false, Some("package(g)"), None).join(" ");
|
||||
@@ -830,7 +856,14 @@ mod ci_tests {
|
||||
// The whole run keeps nextest's default: a panic hunt that matches nothing fails.
|
||||
let here = CiOptions { partition: None, selection: Selection::All, ..options };
|
||||
assert!(!nextest_args(&here, true, None, None).join(" ").contains("--no-tests"));
|
||||
assert_eq!(test_build_args(&here.exclude).join(" "), build);
|
||||
assert_eq!(test_build_args(&here.exclude, false).join(" "), build);
|
||||
assert_eq!(
|
||||
test_build_args(&here.exclude, true).join(" "),
|
||||
"--workspace --locked --features heif,photocraft-io/corpus,photocraft-engine/corpus --exclude photocraft-web --lib --bins --tests"
|
||||
);
|
||||
// A package the build leaves out cannot get a feature.
|
||||
let args = test_build_args(&["photocraft-io".to_string()], true).join(" ");
|
||||
assert!(args.contains("--features heif,photocraft-engine/corpus ") && !args.contains("photocraft-io/corpus"), "{args}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
+12
-11
@@ -107,6 +107,7 @@ fn load_checklists(root: &Path) -> Result<Vec<Checklist>, String> {
|
||||
#[derive(Debug, Default, PartialEq)]
|
||||
pub struct Corpus {
|
||||
pub label: String,
|
||||
/// Directory under `corpus/`, as the corpus tests and `corpus_pins` name it.
|
||||
pub dir: String,
|
||||
pub files: Option<u32>,
|
||||
pub pass_floor: Option<u32>,
|
||||
@@ -488,7 +489,7 @@ pub struct Inputs {
|
||||
/// the number its doc comment in `corpus.rs` gives; other corpora keep the doc comment's count.
|
||||
fn pinned_file_counts(corpora: &mut [Corpus], root: &Path) -> Result<(), String> {
|
||||
for corpus in corpora {
|
||||
let Some(pinned) = crate::corpus_pins::ALL.iter().find(|p| corpus.dir == format!("corpus/{}", p.dest)) else { continue };
|
||||
let Some(pinned) = crate::corpus_pins::ALL.iter().find(|p| corpus.dir == p.dest) else { continue };
|
||||
let manifest = std::fs::read_to_string(root.join(pinned.manifest)).map_err(|e| format!("read {}: {e}", pinned.manifest))?;
|
||||
corpus.files = Some(
|
||||
u32::try_from(manifest.lines().filter(|line| !line.trim().is_empty()).count())
|
||||
@@ -635,7 +636,7 @@ code doesn't meet yet: they are reported, and only their regressions fail.\n\n",
|
||||
s.push_str("Corpus floors (`crates/io/tests/it/corpus.rs`): the enforced minimums; the corpus tests (cargo feature `corpus`, `cargo xtask test-corpus`, always run in CI) fail below them.\n\n| Corpus | Directory | Files | Oracle pass floor | Round-trip floor |\n|---|---|---:|---:|---:|\n");
|
||||
for k in &inp.corpora {
|
||||
let n = |v: Option<u32>| v.map_or_else(|| "–".into(), |x| x.to_string());
|
||||
s.push_str(&format!("| {} | `{}` | {} | {} | {} |\n", k.label, k.dir, n(k.files), n(k.pass_floor), n(k.roundtrip_floor)));
|
||||
s.push_str(&format!("| {} | `corpus/{}` | {} | {} | {} |\n", k.label, k.dir, n(k.files), n(k.pass_floor), n(k.roundtrip_floor)));
|
||||
}
|
||||
s.push('\n');
|
||||
}
|
||||
@@ -813,24 +814,24 @@ pub struct Preferences {
|
||||
fn corpus_floors_parse() {
|
||||
let src = r#"
|
||||
/// Hand-picked mix in `corpus/psd` (170 files: 121 vs the merged image + 12 vs the thumbnail).
|
||||
const MIXED: Source = Source { label: "io corpus", env: "PHOTOCRAFT_CORPUS", default_dir: "corpus/psd", pass_floor: 133, roundtrip_floor: 169 };
|
||||
const MIXED: Source = Source { label: "io corpus", env: "PHOTOCRAFT_CORPUS", default_dir: "psd", pass_floor: 133, roundtrip_floor: 169 };
|
||||
|
||||
/// The full psd-tools test set (309 files at the pinned commit):
|
||||
/// 202 vs the merged image.
|
||||
const PSD_TOOLS: Source =
|
||||
Source { label: "psd-tools corpus", env: "X", default_dir: "corpus/psd-tools", pass_floor: 212, roundtrip_floor: 307, extra: 5 };
|
||||
Source { label: "psd-tools corpus", env: "X", default_dir: "psd-tools", pass_floor: 212, roundtrip_floor: 307, extra: 5 };
|
||||
|
||||
/// Ours (256 files; https://github.com/storytold/photocraft-corpus), grouped by feature.
|
||||
const PHOTOSHOP: Source = Source { label: "photoshop oracles", dir: "corpus/photoshop", group_depth: 2, pass_floor: 74, roundtrip_floor: 256 };
|
||||
const PHOTOSHOP: Source = Source { label: "photoshop oracles", dir: "photoshop", group_depth: 2, pass_floor: 74, roundtrip_floor: 256 };
|
||||
"#;
|
||||
let c = parse_corpus(src);
|
||||
assert_eq!(c.len(), 3);
|
||||
assert_eq!(
|
||||
(c[0].label.as_str(), c[0].dir.as_str(), c[0].files, c[0].pass_floor, c[0].roundtrip_floor),
|
||||
("io corpus", "corpus/psd", Some(170), Some(133), Some(169))
|
||||
("io corpus", "psd", Some(170), Some(133), Some(169))
|
||||
);
|
||||
assert_eq!((c[1].files, c[1].pass_floor, c[1].roundtrip_floor), (Some(309), Some(212), Some(307)));
|
||||
assert_eq!((c[2].dir.as_str(), c[2].files, c[2].pass_floor, c[2].roundtrip_floor), ("corpus/photoshop", Some(256), Some(74), Some(256)));
|
||||
assert_eq!((c[2].dir.as_str(), c[2].files, c[2].pass_floor, c[2].roundtrip_floor), ("photoshop", Some(256), Some(74), Some(256)));
|
||||
assert!(parse_corpus("const X: u32 = 1;").is_empty());
|
||||
}
|
||||
|
||||
@@ -852,8 +853,8 @@ cc c.psd
|
||||
)
|
||||
.unwrap();
|
||||
let mut corpora = vec![
|
||||
Corpus { label: "pinned".into(), dir: format!("corpus/{}", pin.dest), files: Some(999), ..Default::default() },
|
||||
Corpus { label: "other".into(), dir: "corpus/not-pinned".into(), files: Some(7), ..Default::default() },
|
||||
Corpus { label: "pinned".into(), dir: pin.dest.to_string(), files: Some(999), ..Default::default() },
|
||||
Corpus { label: "other".into(), dir: "not-pinned".into(), files: Some(7), ..Default::default() },
|
||||
];
|
||||
let r = pinned_file_counts(&mut corpora, &root);
|
||||
let _ = std::fs::remove_dir_all(&root);
|
||||
@@ -868,7 +869,7 @@ cc c.psd
|
||||
let inp = gather(&root).unwrap();
|
||||
let rendered = render(&inp);
|
||||
for corpus in &inp.corpora {
|
||||
let pinned = crate::corpus_pins::ALL.iter().find(|p| corpus.dir == format!("corpus/{}", p.dest)).unwrap();
|
||||
let pinned = crate::corpus_pins::ALL.iter().find(|p| corpus.dir == p.dest).unwrap();
|
||||
let manifest = std::fs::read_to_string(root.join(pinned.manifest)).unwrap();
|
||||
let files = manifest.lines().filter(|line| !line.trim().is_empty()).count();
|
||||
assert!(
|
||||
@@ -882,7 +883,7 @@ cc c.psd
|
||||
corpus.label,
|
||||
pinned.manifest
|
||||
);
|
||||
assert!(rendered.contains(&format!("| {} | `{}` | {files} |", corpus.label, corpus.dir)));
|
||||
assert!(rendered.contains(&format!("| {} | `corpus/{}` | {files} |", corpus.label, corpus.dir)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user