The panel lays out as the reference application's: three radio rows with their dropdowns, the Dither
checkbox, and Data Order / Table Order radio pairs while a .cube is the LUT. The layer keeps the orders its
.cube was read in (LutSource), and an edit naming only an order reads the kept file again in the new
orders. The Abstract and Device Link rows ask for an ICC profile and say that applying one is not supported
yet (#14428), or that the file is the wrong kind of profile; the layer keeps its LUT.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
#17366 marks numbered layers inside groups as not measured, and an
unmeasured case keeps today's behaviour: with a group holding "Layer 7"
the suggestion is "Layer 1" today, but the first cut of
`next_layer_suggestion` counted every layer and lifted it to
"Layer 8". The counter now reads top-level names only, the reading
#14821 chose for the Layer from Background search, pinned by
`a_numbered_layer_inside_a_group_does_not_count`.
Fixes#17366
`layer.new.layer` without a name and the New Layer dialog took the first
free "Layer N", so a document holding "Layer 7" was offered "Layer 1"
again. `Document::next_layer_suggestion` names one above the highest
exact "Layer <number>" name, 1 when none exists; the command default and
the dialog prefill share that one helper, so an empty or spaces-only
Name gets the name the dialog showed. The other callers of
`next_layer_name` (groups, shapes, Layer from Background) keep the
first-free rule.
Fixes#17366
The PR snapped shapes with a per-edge heuristic (pixel_align.rs, dash-cap tie
rules, a PSD coordinate-frame field threaded through engine, format and caches),
defaulted the option to off, and renamed the existing Rectangle/Triangle
"Align Edges" checkbox to "Snap Bounding Box" next to a second checkbox.
The reference application fits the whole shape at render time: the bounds of
what it paints (fill, or the stroke's outer edge) get a whole-pixel left/top
(a half rounds up) and a whole width/height, and the path is translated and
scaled into that box. Fill and stroke take one transform; curves stay
antialiased; inner edges of several subpaths are not snapped.
- photocraft_vector::align_edges implements that rule; CompiledShape applies it,
so caches, the compositor, previews and extents agree; the fill/stroke split
under layer effects starts from the whole shape's transform.
- Removed pixel_align.rs, the rasterizer helpers it needed, the document-space
drag preview and psd_coordinate_frame (rounding the bounds absorbs the PSD
quantization it was for).
- One Align Edges checkbox (ToolOptions::align_edges, stored and scripted as
useAlignedRendering, older align_edges still read) on every shape tool and the
Pen, on by default and after Reset Tool; it snaps the drag and sets the layer.
- PSD sn2P: written as 1 when on and left out when off, as the reference saves it.
- Dropped the dead path.set param, moved the control-protocol paragraph,
rewrote docs/pixel-aligned-strokes.md, reverted the unrelated raw, font,
Cargo and test-harness changes.
- Tests reproduce the measured cases (rectangles at .25/.4/.5/.6/.75, ellipse
extremes and curve symmetry, 1/2/3 px strokes, rotated rect, Pen triangle,
two subpaths, toggle off, stored path unchanged, one checkbox, Reset Tool).
Co-Authored-By: superplay2021 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
#12887 measured a second half of the rule the reference application holds: it refuses an Indexed pattern from another image, whose colours are not in the document's colour table, and paints only the one carrying that table. Tracking the source mode and not the table lets that case paint. Pin it exactly as it behaves now - the tile's red and green land in a document whose table holds neither - so the follow-up (#16642) is met with a test that says which way the behaviour has to go, and record the same thing where the field is documented: how a repeat definition of pixels already in the library picks its source, and that the PSD raw-block comparison now covers the new field. An index written before the source member still loads the whole pattern with no source, which the library test now strips the member to prove.
Edit > Define Pattern composites the area in the document's pixel format, which stores an Indexed Color document expanded to RGB. Nothing on Pattern said where the tile came from, so a pattern taken from an Indexed image was indistinguishable from an RGB one, and a tool that cares about the difference had nothing to read.
The new field names the source mode. The pixels, the id and what the pattern library lists stay as they were. A pattern read from a file records no source: a .pat or PSD block says what its pixels are, not which document they came from. The library index and .pcraft carry the field, so a defined pattern keeps its source across a restart or a save; files written before it read as no source.
Keeps both test modules in crates/format/tests/it/main.rs: main's camera_raw_roundtrip and this PR's channel_mixer_cmyk.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The clipboards, the presets, the colour proofs and the image-assets list become
Tracked, so the menu's facts can key on their revisions. DocId derives PlainData
and MemoProps. UI: the recent files and the workspaces become Tracked.
craft-layers keys tree ids by their Hash (craft-libs#2774), so photocraft-doc depends on craft-tracked and craft-ui-macros instead of craft's ui feature, and the layering check passes.
The dock keeps an Arc<Workspace> and a Tracked spec model, the toolbar rail
takes Tracked slots, the Layers panel holds its rows as plain data in a
Tracked, and the menu bar is a Tracked model keyed for the native menu's
sync. PhotoCraft states the Creative component set. Export As lists its
resample methods, and layer.exportAs describes them, in the engine's order.
Part of #15476
Resolve the conflict in crates/engine/src/adjust_params.rs: keep this
branch's generic mixer_row (RGB rows of 4, ink rows of 5) and main's
rounding to whole percentages before clamping (#14414).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
History gets a generation that every change takes a fresh number from, and
the snapshot list one through DocState::snapshots_mut, so the History rows
rebuild only when either moves. Artboard pages and the layers a Move drag
takes along are computed once per document revision; set_active_layer moves
the revision like the other layer selection changes, through one
bump_selection_revision. The view-only revision steps of history options,
the channel eyes and Isolate Layers go through bump_view_revision; Isolate
Layers still marks the document modified.
DocQueries drops every entry when the open document set changes, and counts
what it computes, which the idle trial asserts stays unchanged. Fill layers'
thumbnails key on impl Hash for Fill. A new trial checks the Layers rows'
revision follows a rename and both disclosure toggles.
- Thumbnails, bounds and selection masks key on Surface::generation();
surface_fingerprint and the Debug-formatted fill revision are gone. Fill
layers key on Fill::fingerprint, a hash of every field.
- Layers panel rows take parents and ancestors from the layer index, and the
rows revision comes from the document revision and the index serial instead
of hashing view-state lists each pass. Expanding a group and collapsing an
effects list move a view revision, which keeps a clean document clean.
- isolation_shows, top_level and with_descendants read the layer index
(LayerIndex::roots) instead of walking or scanning subtrees;
Document::layer_count counts from the index.
- The status bar values, the title's copyright mark and the pasteboard's
uncovered rects are computed once per document revision (DocQueries).
- photocraft_doc::walks() counts Document::walk calls per thread for count
trials.
Part of #15709.
Document.layers is a LayerTree that builds an id index on first lookup and drops it on any mutable access. Layer lookups and selected_layers use the index instead of walking the document.
main (#15449) moved the adjustment editors onto the craft UI framework and deleted basic.rs, which held this PR's CMYK Channel Mixer editor. The framework ChannelMixer has red, green and blue rows only, so a CMYK mixer is now kept out of it: values::from_params refuses a mixer with ink keys (CMYK_MIXER_UNAVAILABLE), the Properties panel shows that message and edits nothing, and Image > Adjustments > Channel Mixer refuses to open in a CMYK document with the same reason. A CMYK editor in craft-libs is the follow-up.
ui_tests.rs keeps main's tests; the test of the deleted egui editor is replaced by cmyk_channel_mixer_is_kept_out_of_the_rgb_editor, and the every-kind Properties test expects the refusal for a CMYK mixer. The Tokens::mixer_rgb/mixer_ink fields added for the deleted editor are dropped (no user left).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A split Blend If slider faded as (v - low) / (high - low), so the fade
started a level late and every value between the halves showed a little
less of the layer than the reference application. 8-bit documents now
fade as (v - low + 1) / (high - low + 1) on the black side and
(high - v + 1) / (high - low + 1) on the white side, on the CPU
(BlendRange::weight_8bit through blend_if_weight) and the GPU (bi_ramp,
flagged per pass in p4.z). Unsplit points and 16/32-bit documents keep
their behaviour.
Indexed Color documents store RGB pixels, so Color Table found each
pixel's index again as the nearest entry, and entries of one colour
lost their own pixels (#14342). The document now keeps each pixel's
index (Document::color_indices) where it is known: recorded when a
palette PNG is opened, by Image > Mode > Indexed Color and by Color
Table itself. Color Table uses it while the layer still has exactly the
recorded tiles; after any other change it maps by nearest colour as
before. A known index past a shrunk table stays black until the table
grows back over it.
The native format saves the indices only while they hold for the layer
as saved, and pairs them with the loaded layer on open.
A PSD gradient fill (GdFl) or Gradient Overlay (GrFl) with Smoothness
above 0, a method other than Classic or Lab stops (an overlay also with
midpoints off the middle) keeps Photoshop's own gradient next to the
dense stops baked from it: colour stops, midpoints, Smoothness, method
and opacity stops, in the GradientInterpolation record the overlay
already had (now with midpoints and opacity stops) and in a new
Fill::Gradient `interpolation` field. The compositors still render the
baked stops.
The Properties gradient editor, the on-canvas widget and the Layer
Style page show and edit those stops; gradient.fill.set/stop edit them
and bake again (geometry edits leave the bake exact), and
gradient.fill.set takes `method` and `smoothness`. A preset replaces
the record. A PSD save writes the kept gradient (Intr, the method
enum) while the render stops still match it, so read, write, read
keeps it; .pcraft keeps it too and older files still load.
A new live shape kind, LiveShape::Triangle { rect, corner_radius }, draws an isosceles triangle that fills the dragged box (apex at the top centre, then bottom right, bottom left). The engine no longer turns a triangle into an inscribed 3-sided polygon. Triangles saved before this are 3-sided polygons and keep that geometry.
The .pcraft manifest stores a live triangle in a new optional triangle_live field beside live (as arrow_live does), so older builds open the file and show the saved path. PSD export writes no vogk for a triangle, as for polygons.
Arms the new kind forces: live_kind, the axis-aligned transform, params, the corner radius widgets and the Properties Shape section (Corner radius only). Shift keeps today's equilateral triangle, sent as its tight box.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Model-Effort: Opus 5.5 drove; Fable 5.2 briefed; Sonnet 5.5 wrote at medium
live_path rounds a star's outer points and leaves its inner points
sharp corners, as the reference application does: a 5-point star at
Star Ratio 50 % with corner radius 10 has 15 anchors instead of 20.
Plain polygons keep rounding every vertex.
The on-canvas corner radius widget shows knobs at the outer points only
and takes its largest radius from them, so it previews the same path
as shape.create.
Imported documents need durable conversion evidence and native pixel operations before XCF conversion can produce editable PhotoCraft data. This adds bounded document/report types, lossless pattern construction and `.pcraft` persistence, plus native HDR, percentile, noise, convolution, Average, coverage and matting kernels and checked Smart-filter mixing. Runtime color models/depths are retained; source attachments remain inert. Native SVG operations retain parsing, lowering, rendering and parser-tree destruction on one bounded worker, including nested resources; WebAssembly reports a controlled error for depths requiring native isolation.
Native filter corrections cover matte black points and signed HDR, extent-wide Smart-filter coverage, flat-image identity Auto Levels, opaque FillHoles capability, exact unselected channel preservation, coverage-preserving Average selection and bounded pattern expansion. Checked Smart-filter mixing rejects nonfinite native F32 samples, preserves unchanged Normal pixels without regenerating CMYK separations, and recovers representable alpha mixtures after an overflowing difference. HDR blend overflow retries use cold F64 arithmetic while retaining ordinary finite results and integer-depth behavior. Both opaque and alpha-bearing F32 mask recovery retain signed/HDR colors.
Stored pattern declarations remain lossless and inert. Dense PSD/PAT/ASL pattern export now checks dimensions and one shared plane-allocation budget before conversion. PAT/ASL report conversion errors; PSD/PSB report named omission warnings. Matching raw PSD pattern blocks remain verbatim. CMYK offsets retain the established brightness convention.
Command registration, XCF decoding and frontend workflows follow in dependent parts. The contributor entry is the author's existing chosen entry.
<!-- native-foundations-fixes-20261107:start -->
Small noise, convolution and point-operation edits admit their clipped work area on large owners while retaining output/workspace limits and whole-owner FillHoles bounds. HDR toning retains skipped transparent native samples. Normal Smart-filter strength interpolates stored CMYK/Lab/ink planes with premultiplied coverage, preserving unchanged channels. Bitmap Custom Pattern reads compact patterns in bounded row bands and ranks the complete map once. Embedded SVG isolation failures propagate independently of strict mode; ordinary invalid images can still be omitted, and private native parses share the complete-operation worker. The import-report regression now primes the layer blob cache and requires its specific limit diagnostic.
<!-- native-foundations-fixes-20261107:end -->
<!-- adversarial-5810371597:start -->
Import-report accounting uses portable fixed costs. HDR scene means use F64. Bitmap pattern ranking preflights a 256 MiB input/order/output budget, uses fallible allocation and heap-scratch-free sorting. Average uses the supplied image domain and retains one global mean across output tiles. Non-Normal Smart-filter coverage is classified once across the complete mixing extent. A fallible filter dispatcher and engine error conversion preserve checked native diagnostics and cancellation. Smart-filter engine integration remains in part 5 (#11032).
<!-- adversarial-5810371597:end -->
## Six-part series
Each branch is hosted in Terra854/photocraft, and every PR targets storytold/photocraft:main. Merge in the order below. Later drafts currently show cumulative diffs while prerequisites are unmerged; their descriptions link to isolated comparisons. Rebase each part onto current upstream main after its prerequisites merge, including squash-merge ancestry, and rerun affected checks before requesting review.
| Part | Upstream PR | Fork branch | Scope |
| --- | --- | --- | --- |
| 1 | [#11009](https://github.com/storytold/photocraft/pull/11009) | xcf-support-v2-01-import-data | Document/native-format data and pixel foundations |
| 2 | [#11029](https://github.com/storytold/photocraft/pull/11029) | xcf-support-v2-02-decoder | Bounded transport/records, precision, metadata, editable text and paths |
| 3 | [#11030](https://github.com/storytold/photocraft/pull/11030) | xcf-support-v2-03-effects-core | Native effect frames and primary tone/color/spatial/resource/transform adapters |
| 4 | [#11031](https://github.com/storytold/photocraft/pull/11031) | xcf-support-v2-04-effects-graphs | Remaining adapters, bounded graph lowering, coverage installation and source evidence |
| 5 | [#11032](https://github.com/storytold/photocraft/pull/11032) | xcf-support-v2-05-engine | Native commands, import preparation, historical choices, editing and persistence workflows |
| 6 | [#11033](https://github.com/storytold/photocraft/pull/11033) | xcf-support-v2-06-frontends | Desktop/web UI, CLI/MCP, translations, GPU diagnostics and qualification/docs |
The full integration remains preserved on `xcf-support-v2`; original #7098 remains available for reference.
## Validation
<!-- main-catchup-0d08cb7dd:start -->
Updated to upstream `main` at `0d08cb7dd` and restacked all six branches. Part 1 is `640a01f43`; full integration is `24cd17301`. The final six-part tree exactly matches the full integration tree.
The merge preserves both upstream's new tests/crop translations and the XCF historical-open tests/report labels. The automation adapter now preserves import-source protection across multiple granted read roots: relative source names cover every matching candidate so newly shadowing files cannot expose the original to overwrite, while absolute source names remain precise. Existing ordered reads and implicit-save provenance are retained. Read-only import source identity is kept independently of whether its library root grants an implicit Save target. Focused regressions cover source aliases, removed files, denied candidates, changing root precedence, and read-only library imports; the Windows escape fixture also uses a real junction when symlink privileges are unavailable. The new upstream UI import fixture also uses the native import outcome type.
Local validation passed affected host all-target checks, core and native frontend/automation unit and integration suites, forced-Vulkan GPU unit and integration suites, pinned IO corpora, strict all-target Clippy, formatting, layering, panel command dispatch, WASM, adversarial command tests, and the quick CPU performance harness. Offscreen historical-XCF prompt and conversion-report captures were reviewed. The first two PR boundaries also passed independent all-target engine checks. Tests used the pinned craft-fonts input, four Rayon workers, serial tests for large fixtures and opt-level=0 for engine/UI test glue; pixel/format crates retained their repository settings. Quick mode uses small documents and does not enforce full-size budgets. The part 1 push triggered fresh [CI](https://github.com/storytold/photocraft/actions/runs/42885527754) and [SonarCloud](https://github.com/storytold/photocraft/actions/runs/42885527740) runs. After upstream approval, CI passed the Linux gate, Windows unit/integration tests, no-HEIF tests, pinned corpora and web build. SonarCloud's instrumented archive, coverage shards and actual scan remain skipped behind its token guard; its outer green status does not mean coverage ran. Catching up with main therefore retriggered normal tests but did not remove that SonarCloud skip. Older validation below remains evidence for its explicitly named earlier commits.
<!-- main-catchup-0d08cb7dd:end -->
<!-- average-no-extent-4517477902:start -->
Average no-extent follow-up at part 1 `f8ddb626f` (full integration `882def329`), carried through all six branches. The checked Average dispatcher now uses the requested `area` when no owner extent is supplied; an explicit extent retains its existing clipping behavior. Other filters, the Average pixel kernel and resource admission are unchanged.
The new regression fails against the preceding revision and passes with the fix. It covers `apply`, one-pixel explicit tiling, and the cancellable tiled API at 8/16/32-bit, signed/HDR colors, hidden RGB, native alpha preservation, unchanged source data and pixels outside the requested area. Validation passed the algorithm unit/integration suite (935 tests; 27 existing ignored), strict all-target algorithm Clippy, formatting, layering, WASM (24 crates plus HEIF), and independent all-target engine checks of the first two PR boundaries. The broader suites below remain evidence for their named earlier commits and were not rerun for this dispatcher-only follow-up.
<!-- average-no-extent-4517477902:end -->
<!-- review-20261110:start -->
Review follow-up at part 1 `a3144d559` (full integration `b5fd3e211`), carried through all six branches. Average admits long thin regions within its existing pixel/workspace budgets, clamps finite selection coverage, and uses owner extents for off-canvas replay. HDR Toning also adapts over the owner extent. Pattern GPU uploads now use bounded bands; the warning-free `document_to_psd` API returns `Result` on pattern export failure and reuses prepared pattern blocks. Warning-enabled exports retain explicit omission warnings.
Five filter regressions fail against the previous revision and pass with the fixes. Local validation passed 1,597 algorithm/compositor/GPU tests with Vulkan, all 129 GPU integration tests separately on DX12 with FXC (the app uses FXC when no bundled DXC is present), a separate forced DX12 pattern upload/readback test, 1,144 IO unit and 675 pinned IO integration tests, 10 affected engine tests, strict all-target Clippy, formatting, layering, WASM and quick CPU performance checks. The first two PR boundaries passed independent all-target engine checks. This Intel driver's DX12/DXC configuration rejects the unchanged `fs_adjust` pipeline (`0x80070057`); DX12/FXC and Vulkan both pass. The full workspace suite was not rerun; earlier broad evidence below remains tied to its named commits. Quick performance mode does not enforce full-size budgets.
A separate 24 MP signed/HDR RGBA32F public Average-kernel probe retained exact mean RGB and original alpha. Three alternating runs had medians of 1,274.713 ms before and 1,259.885 ms after; this small difference is within run variation and is not a speedup claim.
The Minor/Poor-tradeoff report-deserialization finding remains open and documented. Encoded records are capped at 32 MiB and individual arrays are bounded, but compact targets can still amplify transient decoded memory before aggregate validation rejects the report. Early shared-budget deserialization is not implemented in this follow-up.
<!-- review-20261110:end -->
<!-- main-catchup-7c64653d5:start -->
Updated to upstream `main` at `7c64653d5` and restacked all six branches. Part 1 is `cbf068d5f`; full integration is `206f71012`. The full integration tree exactly matches part 6.
The merge retains main's alpha-preserving Average behavior with bounded checked processing, and uses it consistently for XCF coverage conversion and native replay. Historical XCF normalization and import preparation now run through main's resumable Place flow and Open as Smart Object; regression tests cover source byte order and native Edit Contents. XCF report/filter labels also cover the seven languages main promoted to menu-complete status.
The current tree passed affected host all-target checks, core/IO, GPU, engine and frontend suites, strict all-target Clippy, formatting, layering, panel command dispatch, WASM and the web build, adversarial command tests, pinned IO corpora and the quick CPU performance harness. Offscreen historical-XCF prompt and conversion-report captures were reviewed. The first two PR boundaries also passed independent all-target engine checks. Tests used CI-pinned craft-fonts `b076417b5880bd4154bd22f00695b1d28c6bea83`, four Rayon workers, serial tests for RAM-heavy suites and opt-level=0 for engine/UI test glue; pixel and format crates kept repository settings. Quick performance mode uses smaller documents and does not enforce full-size budgets. Older measurements below remain evidence for their named earlier commits.
<!-- main-catchup-7c64653d5:end -->
<!-- percentile-owner-4502952267:start -->
Percentile owner-bounds follow-up at part 1 `93946db04` (full integration `f7264af14`): nonempty owner bounds now supply edge samples without a dense whole-owner admission check. The unchanged preflight still bounds clipped output, padded halo, workspace and CPU work; dense-image adapter limits remain in place. Two new regressions failed with `InvalidGeometry` before the fix and pass afterward, covering small edits on 81 MP and wider sparse owners, clamped-edge oracles, fractional selections, source preservation, clipped requests, invalid domains, oversized output, work limits and cancellation.
This follow-up passed 903 algorithm tests (887 unit + 16 integration; 27 existing ignored), all-target strict algorithm Clippy, formatting, layering and WASM (24 crates plus the HEIF configuration). Only sampling-bound admission changed; percentile processing and resource-preflight code are byte-for-byte unchanged. The broader qualification below remains tied to its explicitly named earlier commits; the full workspace suite was not rerun for this one-file follow-up.
<!-- percentile-owner-4502952267:end -->
<!-- native-foundations-validation-20261107:start -->
The production fixes at part 1 `c16e274b8` (full integration `6f8349cd5`) passed 7,245 affected algorithm/compositor/document/engine/native-format/IO tests across 46 binaries, with 65 existing ignored tests, plus doctests, affected all-target strict Clippy, layering, WASM, adversarial command tests, formatting and the pinned IO corpus (1,107 unit + 661 integration tests, 26 existing ignored). The final diagnostics regressions also passed independently on the foundation and full integration branches. The first PR passed an independent all-target engine check. Tests used four Rayon/test workers and the existing CI font pin; engine test glue used opt-level=0, and the foundation-only diagnostic probe also used opt-level=0 for its algorithm dependency. The full integration tree exactly matches the final sixth branch.
Paired 24 MP release probes used three timed repetitions per version after warm-ups, alternating order, matching inlining controls, opaque parameters and a current public-API control, with four Rayon workers. Timings are completed operations on this host.
| Probe | Before (ms) | After (ms) | Public API (ms) |
| --- | ---: | ---: | ---: |
| HDR toning | 830.3 | 834.4 | 791.2 |
| Rgb-Normal | 1070.5 | 1069.3 | 1079.7 |
| Cmyk-Normal | 683.0 | 669.7 | 691.5 |
| Rgb-Multiply | 1103.1 | 1303.3 | 1297.5 |
The extent-wide coverage prepass adds 200.2 ms (18.2%) in the alpha-preserving Multiply case. This is the measured cost of applying one consistent coverage rule; the Normal RGB/CMYK controls remain near baseline.
The uniform HDR probe's middle-gray output changed from 0.200004 to 0.180000 (target 0.18); the public control agrees. Mixer probes check native colors and alpha at sampled positions. The quick CPU application harness also completed; its saved cross-machine comparison was skipped, and quick mode does not apply full-size budgets. No budgets or baselines changed.
<!-- native-foundations-validation-20261107:end -->
Earlier validation of full integration `c003e3f50`, before these follow-up fixes, completed the upstream `main` catch-up at `c101cbfb7` on 2026-11-07. The cumulative series passed affected host all-target checks, foundation and IO suites, GPU, engine and frontend suites, strict Clippy, layering, WASM, adversarial command tests, formatting, pinned IO corpora and the quick CPU performance harness. Offscreen historical-XCF prompt and conversion-report captures were reviewed. Local tests used CI-pinned craft-fonts `b076417b5880bd4154bd22f00695b1d28c6bea83`, four Rayon workers and temporary opt-level=0 overrides for engine/UI test glue; pixel and format crates retained repository settings. The full UI library passed 5,330 tests, and the final dialog-dispatch cleanup passed 945 focused dialog tests.
The decoder and engine PR boundaries also passed independent all-target checks. The full `xcf-support-v2` integration tree matches the final sixth branch exactly. SVG stack regressions retain their 512 KiB caller, isolated complete native lifecycle and 100 retained group levels.
The matched performance figures below were measured before this main integration; the HDR recovery arithmetic and bounded tile implementation are preserved.
Forward filter-mask mixing retains its existing four-buffer allocation optimization and arithmetic. Its matched 24 MP RGBA32F probes measured opaque pixels at 392.410→182.842 ms, semitransparent pixels at 383.321→179.916 ms, and signed HDR pixels at 373.696→183.903 ms (five-run medians, 50–53% faster).
Inverse filter-mask recovery now processes at most eight native tiles in parallel, with four reusable scratch buffers per slot and ordered surface publication. Small inputs, one-worker operation and WebAssembly use the same serial tile helper. All F64 and integer pixel arithmetic is unchanged. Bitwise regressions compare full/partial/missing tiles, negative coordinates, differing defaults and hidden/zero-alpha outputs across 30 format combinations; an explicit one-worker/two-worker comparison checks both execution paths.
Matched 24 MP HDR inverse-recovery public-API probes measured 166.972→90.565 ms (opaque, 45.8% faster), and 433.325→130.707 ms (semitransparent, 69.8% faster). Five-run medians use four Rayon workers on this host; all runs assert recovered HDR samples at three positions. The existing F64 precision and HDR saturation bounds are preserved.
Mask recovery retains signed/HDR colors, extreme finite values, subnormals and exact full coverage. The PSD/PSB regression uses a real blur on spatially varying HDR pixels and partial masks; raw exported channels must match the unmasked filter result, and reimported Smart caches must match independently authored masked values.
The prior quick CPU application harness completed. Its saved cross-machine baseline comparison was skipped, so the paired public-API measurements above provide the direct before/after evidence. No performance budgets or baselines changed.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* Added image adjustments and filters for averaging, channel noise, convolution, percentile effects, alpha and coverage editing, black matte removal, HDR toning, and automatic tone, contrast, and color correction.
* Added Smart-filter blending controls for opacity and blend modes.
* Import-conversion information is preserved when saving and reopening documents.
* **Improvements**
* Improved handling of deeply nested SVGs and large patterns, with bounded pattern processing and warnings when pattern export is not possible.
* Improved stability when blending extreme HDR values and applying filters to HDR images.
* Improved transparency handling for channel-selective filters and added clearer feedback when image processing or export cannot be completed.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Fixes#2223. Carries the in-place flat Save of #5865 (closed as superseded by this PR) and revives what #2515 (@kayrockscreenprinting, closed when its author stepped away) added beyond it.
File › Save now writes back over a flat file when that file still holds the document: one plain opaque layer the format can store, and only when the file held a single image. A JPEG (and a TIFF, Targa or DDS) asks its format options first, as Photoshop does; Cancel writes nothing. A JPEG whose lone layer has transparency it can't keep is offered as a PNG. Multi-image files (animations, multi-page TIFFs, multi-size icons, multi-part EXRs) still go through Save As; the source image count is kept through crash recovery.
Co-authored-by: kayrockscreenprinting <[email protected]>
* Add path text placement ranges and drag gestures
* Preview path placement and track bounded canvas damage
* Preserve legacy path anchors and show overflow markers
* Match path marker hit targets and directional cursors
* Fix path placement lint failures
* Cover path text body movement and position locks
* Keep open path text movable at range endpoints
* Target the type path after attaching text
* Fix path text range rendering and placement lifecycle
* Map vertical path text and preserve drag branch continuity
* Cover path placement lifecycle and preview damage regressions
* Preserve closest branch projection and fix CI regressions
* Normalize path endpoints and bind gestures to their viewport
* Simplify viewport ownership guards for Clippy
* Document path placement invariants and regression cases
* Fix path placement ownership, validation and geometry caching
* Correct path placement regression fixtures
* Ignore transient path geometry cache in UI state equality
* fix: allow path text flips with stale placement ranges
* fix: retain path text handles after shortening curves
* test: account for layer translation in path placement drags
* fix: mark path text range with x and o markers on the path
The beginning marker is an x and the end a small circle, both on the
path, with a plus in the circle while the range hides glyphs. The
cursor's triangle points right over the beginning, left over the end,
and both ways over the text body, which moves the whole range.
Direct Selection leaves an anchor or handle under a marker to path
editing; Path Selection always takes the marker.
* fix: resolve coincident path text markers by lap or drag direction
The x and o markers coincide on a closed path's full lap and on an
empty or end-clamped open range. A full lap now moves the whole text;
otherwise the first motion picks the beginning (backward) or the end
(forward). Marker fixtures press on the path, where the markers now
sit.
* fix: let either end of a full-lap path text range be dragged
Text attached to a closed path fills one lap, so its x and o markers
coincide and every press moved the whole text, leaving no way to
shorten the range. As the text begins just ahead of that point and
ends just behind it, a press ahead along the path now grabs the
beginning and one behind grabs the end; the point itself still moves
the whole text.
* test: check full-lap marker drags do not flip the text
* fix: read and write the path text range in PSD
Type on a path keeps its range in the Txt2 frame as /2 /6 [start end],
in curve-segment units with -1 for the default. Three reference-editor
files in ag-psd's test set fix the mapping: text-path ends a third into
the first segment and draws only "so" of "some text", and
text-path-26/27 move the start on an open path.
Import reads both ends (and the flipped flag) into the layer's start and
end. Export writes an open path whole with its start and end in the
range, instead of cutting the path at the start, and a closed path's
limited end as a range from its start. Path text in a document that
never came from a PSD now gets a Txt2 block, so its path is saved at
all, and the warning that the end limit is lost is gone.
* fix: let both selection tools grab a path text marker on an anchor
Direct Selection gave an anchor under a marker the click, so an open
path's default markers (on its end anchors) and a closed path's
coincident full-lap markers (on its first anchor) could not be moved
with that tool. In the reference editor either selection tool drags a
marker wherever the pointer shows the text bar with a triangle, so the
marker now wins for both tools.
The Direct Selection tests for reshaping a type path (#9114) drag its
last anchor, where the default end marker sits; they now end the
range short of it. To reshape at an anchor under a marker, drag the
marker off it or select the anchor with a marquee and nudge it.
* fix: keep explicit and empty path text ranges through PSD
An explicit end at the path's end stays explicit, so centered and right type keeps its alignment within the span. A closed range whose ends meet reads as empty, not as a full lap.
* ci: re-run checks after a download outage
* ci: re-run checks after a download outage
* fix: preserve legacy path text anchors through PSD
* ci: re-run checks against current main
---------
Co-authored-by: FredApps <[email protected]>