* perf(algo): row-parallel local_sharpen with fast-path protect_detail (#5426)
Refs #5426. Follow-up to #5499.
Cause:
While #5499 parallelized local_blur and the per-dab mix in DabTool::Focus,
local_sharpen in crates/algo/src/retouch.rs remained single-threaded.
In addition, protect_detail redundantly evaluated coordinate clamping
and strided memory lookups across 8 neighbors inside the per-channel
inner loop for every pixel in the dab. On large brush sizes (e.g. 1000–2500 px),
strokes took seconds and stalled the application.
Change:
- Process local_sharpen window rows in parallel with Rayon across threads,
with wasm32 serial fallback matching local_blur.
- Hoist protect_detail 3x3 neighborhood offset calculations outside the
channel loop.
- Fast-path interior pixels (x > 0 && x + 1 < w && y > 0 && y + 1 < h)
with direct stride offsets, skipping boundary clamping entirely for >99.9%
of pixels in large brush dabs.
- Add retouch_sharpen_exact integration test verifying bit-for-bit parity
against the frozen scalar implementation across layouts, edges, and channels.
* bench(engine): add bench_sharpen_tool example
* perf(algo): reuse Reduce Noise guide statistics
* fix(algo): use fixed-size chunks for guide statistics
* Reduce Noise: test that the caller routes the cleaned luma guide and both chroma planes
Review follow-up: compares reduce_noise's output (Lab, so planes pass through) with the
independent guided filters run in order.
* test(algo): assert bit-identical output in Reduce Noise routing test
The command line's files open before the first frame, which is what
applies the interface language, so their status line and notices came
out in English in every language. open_paths now applies it first.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The second questionnaire answer (Algeria). The earlier تدرج اللون read
as "colour gradient" beside Gradient تدرج. Hue, Hue/Saturation, Hue
Jitter and Hue Cube follow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The preset file import status (`preset_files_ui::open`) asks for
"Imported {n} brush/pattern/gradient from {file}" plurals; the Arabic
catalog only had the style one, so these results showed in English.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Served script fallbacks were appended to every UI font family in the
order they arrived. A Japanese and a Simplified Chinese face both cover
Han, and egui draws a character with the first face in the stack that has
it, so a Chinese interface drew Han with the Japanese face when that one
had arrived first (fetched for a Japanese text layer, say). ui_faces now
puts the interface language's own served face first, so the stack a
language change rebuilds follows the language; and when that face arrives
after another served face, add_ui_face rebuilds the stack the same way
instead of appending. served::fallback_for_language gives the face.
This orders the served faces only; with an interface language that has
no served face (English), they stay in arrival order.
Review finding on #10006.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A served script fallback joins every egui font family, and egui panics on
a configured font it cannot parse: a host answering a font's path with an
error page, or serving a truncated file, stopped the web UI on its next
layout or font rebuild. add_ui_face now checks the face with
cjk::font_face_is_readable first, as the system-font fallbacks are
checked, and leaves an unreadable one out with a warning. The regression
test panicked in epaint's family.rs before the check.
Review finding on #10006.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
serve_fonts asks for the interface language's served script font once per
language, but the font manifest loads asynchronously: when the first frame
ran before it arrived, no fallback was registered yet, the request found
nothing, and an Arabic interface on an English browser stayed without its
font until the language changed. The manifest load now asks for the
interface language's font along with the browser languages'.
Review finding on #10006.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The web build has no system fonts and embeds no craft fonts, so an Arabic
(or Japanese, Chinese, Korean, Hindi) interface had no font for its labels:
served fonts were registered only in the document text engine. A served
script fallback now also joins the end of every egui font family, and the
font stack theme::install_fonts rebuilds on a language change includes it
again. The web shell asks for the interface language's script font, not
only the browser languages'.
Review finding on #10006.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts in perf/budgets.toml and docs/scorecard.md: both sides added perf rows (P80 here, P81 and P82 from #9942). Kept all three; scorecard regenerated with cargo xtask scorecard.
egui 0.37 lays text out with the Unicode Bidirectional Algorithm, so the
display-order rewrite #5385 added for egui 0.36 now reverses Arabic and
Hebrew layer names and the in-app title a second time. Names go to egui
as typed; the title line asks for a left-to-right paragraph so
"— PhotoCraft" stays at the right; bidi_text::elide cuts a right-to-left
name at its logical end and egui puts the "…" at the left.
Tests lay the text out with egui and compare glyph positions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Honor CARGO_BUILD_TARGET in FreeBSD packaging for aarch64 release builds
package.sh took the arch from uname -m. The release VM is an x86_64 guest that
cross-compiles aarch64 with CARGO_BUILD_TARGET set, so an aarch64 build was
named freebsd-x86_64 and read binaries from the host target dir.
Read the arch from CARGO_BUILD_TARGET when it is set, and read binaries from
target/<triple>/release. Skip the man-page example and the --version run when
cross-building, since the aarch64 binaries cannot run on the x86_64 guest.
Unset CARGO_BUILD_TARGET keeps the old behavior.
* Reject unsupported CARGO_BUILD_TARGET and resolve host-tuple in FreeBSD packaging
Accept only x86_64-unknown-freebsd and aarch64-unknown-freebsd. Any other
target exits 2 before any build, so a non-FreeBSD target cannot be packaged
as an x86_64 FreeBSD archive.
Resolve cargo's host-tuple alias to the real host triple before choosing the
binary dir, so the path matches cargo's output.
* Skip the photocraft-cli --version run when CARGO_BUILD_TARGET is set
A target build's binary may not run on the host (aarch64 on the x86_64 VM),
and under set -e the smoke run would fail the release after the archive is
written. The native path (CARGO_BUILD_TARGET unset) still runs it.