Commit Graph
13657 Commits
Author SHA1 Message Date
FredApps a348a2a460 test(gpu): treat an already-answered request as a skipped smoke check; test_gpu waits without limit
The zero-timeout smoke tests now skip, instead of failing, if the driver
answered first, whether with a success or an initialization error.
test_gpu waits for its timed-out request without a limit while it holds the
GPU lock. A request that never finishes then shows up as a slow test,
instead of the next GPU test starting beside it.

Signed-off-by: FredApps <[email protected]>
2026-11-18 16:31:19 +07:00
FredApps e10c6ec6fe test(gpu): wait for a timed-out request under the GPU lock, and skip when none timed out
bounded_readback's test_gpu now waits for its own timed-out request before
releasing GPU_LOCK, so the next GPU test doesn't start beside a request still
inside the driver. init_timeout no longer reads the process-wide count. The
renderer test skips if the driver answered before the zero timeout, instead of
failing.

Signed-off-by: FredApps <[email protected]>
2026-11-18 15:57:34 +07:00
FredApps c06ae97029 fix(gpu): wait for this renderer's own timed-out request, and test it without a driver
Review follow-ups:

- A timed-out request now returns `GpuContextError::TimedOut` with an
  `AbandonedRequest` handle (same message as before). `GpuRenderer`
  keeps only its own handle and waits on that when dropped, so an
  ordinary adapter failure no longer waits for another renderer's
  abandoned request.
- The result goes through a rendezvous channel, and the receiver is
  dropped on timeout, so an unclaimed context is dropped on the worker
  before the request counts as finished.
- The timeout is now `run_with_timeout`, unit-tested with held work:
  it counts as running until released, and an unclaimed result is
  dropped first.
- The docs say what a `false` from either wait means.

Signed-off-by: FredApps <[email protected]>
2026-11-18 15:44:03 +07:00
FredApps 8543937a76 fix(gpu): wait for a timed-out GPU request before the process exits
`NativeContext::request` gives up after its timeout (10 s by default) but
leaves its `pc_gpu_init` thread inside wgpu and the driver. When the
process then exits, the driver is torn down under that thread, and
Lavapipe crashes the process: on a loaded CI runner two headless GPU
tests took the "no GPU adapter available" path, printed ok, and then
died with SIGSEGV ("error: scalar-to-vector conversion failed" from
LLVM) as the test process exited (#9824's Ubuntu gate).

Count the initialization threads a request gave up on, and add
`NativeContext::wait_for_abandoned_requests(limit)` to wait for them.
A `GpuRenderer` whose request failed now waits (at least 30 s, bounded)
for its abandoned request when it is dropped, so the process no longer
exits under it.

Signed-off-by: FredApps <[email protected]>
2026-11-18 15:25:11 +07:00
FredApps 7cbc2b85e3 Build the craft UI framework below opt-level 2 in test builds (#15565)
* Build the craft UI framework at craft-libs' optimization levels in test builds

The test profile compiled the craft facade and its framework crates at the
opt-level 2 of package."*", serialised in front of every PhotoCraft crate
that uses craft. Build them at 0 (1 for the crates with per-frame or per-pixel
code), as craft-libs does. Test-profile build on 8 cores: 34m53s -> 21m32s.

* Build the framework at opt-level 1, not 0, in test builds

At opt-level 0 the framework's stack frames overflowed the 2 MiB test-thread
stack in ten more photocraft-ui-egui tests on the Windows runner
(0xc00000fd). Level 1 still shares generic instantiations across crates.

* Build the framework's panels, tools and services at opt-level 0 in test builds

At opt-level 1 throughout, the Windows unit leg still built for 67 minutes.
The runtime every frame passes through keeps level 1, so its stack frames
stay small; the panels, tools and services around it, most of the
framework's compile time, build at 0.

* Wrap the test-profile comment
2026-11-18 14:13:03 +07:00
David Mann c337d6e4e8 Merge pull request #15343 from davidmann4/docs/agents-naming-rules
docs(agents): link the names rule from craft-contrib (#15342)
2026-11-17 18:05:56 +01:00
David Mann 01a5b5a389 Merge pull request #15381 from davidmann4/perf/test-speed-quick-wins
Test speed: no font scan in test processes, CMYK profile once, raw-develop at one depth (#15377)
2026-11-17 16:49:07 +01:00
David Mann 4fe336a8c5 Merge pull request #15248 from davidmann4/ci/windows-gpu-tests-when-related
ci: run the Windows GPU tests only when their inputs change (#15247)
2026-11-17 16:48:42 +01:00
David Mann 2b170887fa Merge pull request #15234 from davidmann4/ci/windows-rust-cache-target
ci: let the Windows rust-cache find the short target directory (#15232)
2026-11-17 16:48:17 +01:00
aiongg ed14e1c413 PhotoCraft on the craft UI framework (#15449)
PhotoCraft's UI moves onto the shared craft UI framework in storytold/craft-libs (next branch): shell, dock and panels, hosted dialogs, keyboard, focus, IME and pointer routing, the canvas's view commands, themes and tokens. The engine, document model, file formats, commands and automation stay. PhotoCraft pins storytold/craft-libs next.
2026-11-17 10:41:35 -05:00
FredApps 01b79958a7 ci(freebsd): build every target with the test profile so ui-egui's tests fit the VM (#15360)
* ci(freebsd): build with two cargo jobs so the aarch64 cross build fits the VM

The nightly aarch64 leg (a cold cross build of every target in the shared workflow's 12 GB
FreeBSD guest, CARGO_BUILD_JOBS=4) was killed with exit 137 twenty minutes into ui-egui's
targets, while photocraft-web compiled alongside them (run 43936108201). The same cold build
passed on 15 Nov, so it is at the edge of the guest's memory.

Pass `--jobs 2` through the existing cargo-build-extra-args input. It applies to the build step
of both legs; the x86_64 test commands keep the shared four jobs.

* ci(freebsd): build with the test profile, not two jobs

Two jobs didn't fix it: the x86_64 leg of the dispatched run was SIGKILLed the same way at
--jobs 2 (run 43963415772). The killed rustc was ui-egui's lib test target at -C opt-level=1:
`cargo build --all-targets` builds test targets with the dev profile, so Cargo.toml's
`[profile.test.package.photocraft-ui-egui] opt-level = 0` never applied to the build step. That
one optimised rustc over about 390k lines and 7700 tests ran the 12 GB guest out of memory, and
`cargo test` then rebuilt the same target at opt-level 0 (1m47s on x86_64) anyway.

Pass `--profile test` instead, so the build compiles every target as the tests do: ui-egui at
opt-level 0, debuginfo still off through CARGO_PROFILE_DEV_DEBUG=0 (test inherits dev), and the
test commands reuse the build's artifacts.

* ci(freebsd): test ui-egui with the build's package selection

`cargo test -p photocraft-ui-egui` resolves dependency features without the
other workspace members, so egui, epaint and everything above them got new
hashes. The test step then rebuilt ui-egui's lib tests instead of reusing
the build step's, and that rustc was SIGKILLed in the 12 GB guest.

Run ui-egui's lib, doc and integration tests through
`--workspace --features heif --exclude photocraft-gpu`, which resolves the
same units as the build (checked with cargo's unit graph: 0 units missing
from the build, against 146 for `-p photocraft-ui-egui --lib`). The
integration tests share one command, so all of them run one at a time.
2026-11-17 05:28:19 +01:00
Dylan M. Taylor 2163bd45af security(doc): resolve slice visibility in one sweep, cap resolved slice count (#10959) 2026-11-16 21:59:41 -05:00
Dylan M. Taylor d71e9fd1bf text: bound copies of preserved style data and font names (#11046) 2026-11-16 21:59:36 -05:00
Dylan M. Taylor 43c2d1bd45 Camera Raw sidecar read: one nonblocking open judged by the opened handle (#13359) 2026-11-16 21:59:31 -05:00
Dylan M. Taylor 3ef7d5cf7a oracle_diff example: skip directory symlinks, refuse an oversized dump (#13362) 2026-11-16 21:59:26 -05:00
Dylan M. Taylor ba9ee03d45 docs: prefer shared craft-libs implementations (#15299) 2026-11-16 21:59:22 -05:00
David MannandClaude Opus 5.5 e3e97d17e0 text: nextest test processes skip the shared engine's system font scan (#15377)
cfg!(test) only covers photocraft-text's own tests; every other crate's
test binaries link it as a normal dependency, so each nextest test
process started a background scan of the installed fonts (on Windows
also a reg.exe child for the UI locale) beside the GPU tests, and tests
silently depended on the machine's fonts. Skip it when NEXTEST is set,
as CI runs every test through nextest. Tests that want installed fonts
already build their own engine with TextEngine::with_system_fonts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 02:37:53 +01:00
David MannandClaude Opus 5.5 484483b691 test: build the CMYK test profile once, run large raw-develop sizes at one depth
- cmyk_flatten_profile: synthesise the test profile once per process and
  share one Arc, so CmykSpace's per-allocation cache builds the transforms
  once; exact() reads both rows from one run (4 documents, not 8).
- camera_raw GPU tests: the 858x572 and 1600x900 comparisons run at one
  depth each. The depth only changes the input quantization (8 and 16 bits
  both develop with float = false) and every depth runs at 171x113 above.
- cols_timing is a benchmark without assertions: ignore it like its
  siblings.
- compose: delete clipped_dissolve_is_binary_and_preserves_the_base_shape,
  a byte-identical copy of clipped_dissolve_opacity_fill_is_binary_and_
  preserves_base_shape (whose doc comment names both issues).

Part of #15376.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-17 02:03:03 +01:00
FredApps 957b10cccb test(ui-egui): hold the background redraw in tests that need it still running (#15359)
`a_redraw_across_a_text_gamma_change_and_back_is_not_kept` stepped two frames and expected the
4096x3072 CPU redraw to still be running. Nothing holds the worker, so on the FreeBSD VM
(software Vulkan, 4 cores) the redraw finished within those frames ("the redraw finished before
the change back"; FreeBSD runs on eb3c99d65 and 02e9907f6).

Start the redraw with the existing test hold (`hold_redraws` + `wait_for_held_redraw`, already
used by `an_edit_during_a_redraw_is_not_overwritten_by_blocks_drawn_before_it`) in every test
that needs the redraw running at a later frame: the gamma change and back, the gamma change,
the hidden document's gamma change, Memory Usage dropping mid-redraw, and closing the document.
The hold is released before `settle`, so each redraw still finishes and the kept-composite
assertions still check what they guarded: without `forget_if_gamma_changed` the held redraw
draws every block with the original gamma and is kept, failing the test.
2026-11-17 00:12:23 +01:00
Dylan M. Taylor ee2482c662 Merge pull request #15341 from storytold/cutover/shared-tysh-fallback
psd: preserve lenient TySh recovery through craft-psd
2026-11-16 17:56:31 -05:00
FredApps 566375510e perf: open the benches' PSD files under a benchmark memory budget (#15340)
* perf: open the benches' PSD files under a benchmark memory budget

The PSD import budget (#10503, sized from free RAM since #10897) refuses
the 36 MP PSD in interactive_bench and the 2 GB PSD and 4.4 GB PSB in
large_file_bench on the hosted macOS runner, so P20, P63 and P40-P44 have
been missing from every nightly perf run since 2 November.

The benches time decoding, not admission. They now open these files
under an explicit budget: the app's policy for a machine whose free
memory can't be measured, with the high-memory approval given up front
as file.openAs does with approveHighMemory. Only the bench thread sees it
(photocraft-io's testgen seam), so the app's budget is unchanged.

A failed open is now a row error in the --json report instead of a
panic that lost every row of interactive_bench, and large_file_bench
exits 0 once its report holds the reasons, so cargo xtask perf fails
only the affected rows and says why.

* perf: large_file_bench reports no timing row for a case that failed in any repetition

With the report now read on success, a case whose first open worked and a later one failed would have shown its timing row and hidden the error (CodeRabbit review).
2026-11-16 22:23:24 +01:00
David MannandClaude Opus 5.5 12ba2a00ff docs(agents): rule 10 covers distinctive names, not descriptive words
Matches standards/naming.md rule 1: ordinary descriptive words that
several unrelated products use (Layers, Crop) are fine.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-16 22:11:58 +01:00
FredApps 6a82de1411 Content-Aware Fill: keep the workspace open while a background fill runs (#15338)
With background jobs on, Apply and OK start edit.contentAwareFill as a job
and get {"job", "pending": true} back. The workspace treated that as a
finished fill: OK closed at once, so a fill that then failed or was
cancelled left no workspace to fix and retry from, and Apply refreshed
before the fill had landed and let a second fill start meanwhile.

The workspace now records the job it started. While it runs, the
controls, tools, shortcuts and a second Apply/OK are refused; Cancel (the
button, Esc or the control channel) cancels the job and closes. When the
job ends, a successful OK closes the workspace and a successful Apply
refreshes it; a failed or cancelled fill keeps it open with the reason in
its panel, as a failed synchronous OK does. Jobs of another workspace or
document are ignored. describe() reports pending and pendingJob.

Taken from the Content-Aware Fill part of #8506.
2026-11-16 21:23:28 +01:00
David Mann 0dc498dbf5 docs(agents): link the craft-contrib names rule (standards/naming.md)
Adds golden rule 10: user-facing feature names are our own, taken from
standards/naming.md (RFC-0029), with its check for new names, labels-only
renames and accurate compatibility names.
2026-11-16 20:35:30 +01:00
FredApps 02e9907f68 Merge pull request #15162 from storytold/codex/photo-jpeg-notices
Retain IJG and SIMD notices for shared JPEG encoding
2026-11-16 17:24:14 +01:00
FredApps 097a7a7b79 Merge pull request #15301 from storytold/fredapps/psd-tysh-envelope
PSD type: take the TySh envelope from craft-psd (#778)
2026-11-16 14:48:12 +01:00
FredApps 6fce43018c io: drop an imported TySh when a type layer's block can't be rebuilt
With write_tysh refusing unsafe geometry, a layer without psd_raw can end up
with no generated TySh; the imported block (text from before the edit) was then
kept. Export now drops it so the layer is written as pixels with the existing
warning. TySh selection moves into type_tysh/type_blocks (cognitive complexity).
2026-11-16 13:41:10 +01:00
FredApps 193661aea3 io: keep PSD export's content_blocks under the cognitive-complexity limit 2026-11-16 12:59:29 +01:00
Dylan M. Taylor 619ee36fe5 Merge current main into JPEG notice branch 2026-11-16 06:52:40 -05:00
FredApps 421adc18cf io tests: forge hostile TySh transforms in the bytes (the shared writer refuses them) 2026-11-16 12:37:37 +01:00
FredApps a94e84dd8d text: take the TySh envelope from craft-psd (#778)
parse_tysh/write_tysh/translate_tysh/transform_is_safe become adapters over
craft_psd::text::envelope (extracted from here in craft-libs#1594); only the
Affine <-> [f64; 6] mapping stays. write_tysh/build_tysh return Option: a block
the shared writer refuses (unsafe transform, non-finite bounds, > 8 MiB) is not
written, and export falls back to pixels with its existing warning. craft-psd
re-pinned to craft-libs main eafb50af (additions only in crates/psd).
2026-11-16 12:35:11 +01:00
FredApps d53b5edb60 Merge pull request #11566 from hnoerenberg/fix/gaussian-blur-edge-parity-11528
test(algo): pin the Gaussian blur edge profile and its ATN identity
2026-11-16 11:57:45 +01:00
FredApps 6f4a2cbaed Merge pull request #15036 from Terra854/codex/raw-adapter-safety
Unify shared adapters and preserve RAW calibration and provenance
2026-11-16 11:14:43 +01:00
FredApps 556c1c4348 Merge pull request #15152 from storytold/extract/shared-displace-payload
Use shared PSD Displace payload reader and writer
2026-11-16 11:08:11 +01:00
FredApps 5e5292c1a2 Merge remote-tracking branch 'origin/main' into raw-adapter-safety 2026-11-16 09:57:19 +01:00
FredApps 3a28b6a25e raw: keep the U16 develop sample loop to one range comparison
The per-sample normalization in fill_samples called a helper that tested
range.is_finite() and range <= 0.0 for every sample, which made 24 MP
monochrome U16 develops ~30% slower than main. A single range > 0.0
test gives the same results (NaN, zero, negative and infinite ranges all
end at 0) and restores main's speed; output hashes are unchanged.
2026-11-16 09:57:19 +01:00
FredApps 7ba9f0d619 Merge main into extract/shared-displace-payload 2026-11-16 09:50:24 +01:00
FredApps f8c7076d8e Merge pull request #15218 from storytold/cutover/psd-unicode-names
io: use shared PSD Unicode channel-name framing
2026-11-16 09:25:35 +01:00
hnoerenberg d98386f43b test(engine): import craft_psd in the gaussian edge profile test
The shared PSD crate is craft_psd now. The test still imported photocraft_psd, so the engine test target did not compile on a merge with current main.
2026-11-16 08:25:49 +01:00
FredApps 2d4bc13c49 Merge main into cutover/psd-unicode-names 2026-11-16 08:10:43 +01:00
FredApps ca014193a3 Merge pull request #15210 from storytold/cutover/psd-channel-resources
io: use shared PSD DisplayInfo and alternate spot records
2026-11-16 08:09:16 +01:00
FredApps 46faca42dd Merge pull request #13415 from storytold/switch-photocraft-io
Test shared XCF cancellation and document KRA/ORA limits
2026-11-16 07:58:48 +01:00
FredApps e8531bbfd9 Merge main into codex/raw-adapter-safety
Keep main's newer craft-psd (2284a6bf) and craft-cms (c6eb84d4) pins;
keep this branch's unified fe6b443a pins elsewhere (newer than main's
ad8faa1c). Cargo.lock regenerated from main's lock.
2026-11-16 07:04:22 +01:00
FredApps 1ad3e068b5 Merge main into cutover/psd-unicode-names 2026-11-16 06:52:53 +01:00
FredApps 40076f8c56 Merge main into cutover/psd-channel-resources 2026-11-16 06:52:35 +01:00
FredApps f06fc89d31 Merge branch 'main' into switch-photocraft-io 2026-11-16 06:51:35 +01:00
FredApps ea6ced03b1 Merge pull request #15191 from storytold/refactor/shared-psd-duotone
Use shared PSD Duotone ink records and block assembly
2026-11-16 03:59:00 +01:00
FredApps 471d97c3c2 Merge remote-tracking branch 'origin/main' into w15191
# Conflicts:
#	Cargo.lock
#	crates/io/Cargo.toml
2026-11-16 02:33:37 +01:00
Dylan M. Taylor 8531232050 Merge shared annotation and guide integrations into channel names cutover 2026-11-15 20:23:16 -05:00
Dylan M. Taylor e76ca374e8 Merge pull request #15189 from storytold/refactor/shared-psd-guides
Use shared PSD guides resource decoding
2026-11-15 20:21:08 -05:00