Commit Graph
3891 Commits
Author SHA1 Message Date
Fabio Lissi 07bc258bbd Avoid case probes for unrelated Batch paths 2026-11-02 11:37:52 -06:00
yoriswind 488ab1ab14 Merge commit '289dd0a874763d6528bab2184a87a1b53771c02a' into codex/atn-dialog-calculations 2026-11-02 09:37:49 -08:00
yoriswind 0681361e6e Preserve Batch sources and cancellable action filters
Resolve recorded layer targets per Batch input and refuse destructive EXR Save and Close output. Prepare custom Shape Blur kernels in cancellable jobs, retaining Smart Filter progress and geometry. Preserve supported ATN descriptor metadata, defaults, channel sources and three-value LUT shapers; cover rebuilt naming rules, non-identity Custom kernels and float lookup dither.
2026-11-02 09:37:49 -08:00
Fabio Lissi f14da98cc3 Resolve Batch log aliases in future output directories 2026-11-02 11:36:46 -06:00
Fabio Lissi 00f75988b9 Match measured Photoshop Batch naming and error logs 2026-11-02 11:30:58 -06:00
Fabio Lissi 50360ac4ef Record portable nudges, document switches, and type positions 2026-11-02 11:30:37 -06:00
ljkx 945cf2218d Crop with Delete Cropped Pixels off turns the Background into Layer 0 (#10867)
A crop with Delete Cropped Pixels off now turns the Background into a
normal layer named "Layer 0", as in Photoshop, within the crop's one
history step: straight, extending and turned crops, and crops with a
target W x H x Resolution. The pixels past the canvas stay on every
layer, and the area an extending crop adds is transparent on every
layer instead of taking the background colour. A turned crop converts
the Background before the turn, so it turns like the other layers and
keeps its overhang.

Delete Cropped Pixels on is unchanged. Image > Reveal All keeps its
current result (the Background stays, its extension takes the
background colour) by calling the inner crop with a keep-Background
flag. Content-Aware crop fill with Delete off was not measured and is
left as it is.

Adds crates/engine/tests/it/crop_delete_off_background.rs. The #7086
test now locks the cropped layer back into a Background, the state
documents saved before this change still hold.
2026-11-02 18:29:48 +01:00
dotCooCoo 447f3d7afc Adjustments: Equalize's choices stay with their document, and a string selectedAreaOnly is not exported
Saving an action whose Equalize step has `selectedAreaOnly: "true"` wrote
a bare Equalize event, although the command refuses the string. Export
now accepts only the boolean `true` for that setting.

The Equalize dialog records the document it was opened for. OK while
another document is active leaves the dialog open and runs nothing.
2026-11-02 08:40:36 -08:00
Fabio Lissi 180cbe651a Merge current main into Batch branch 2026-11-02 10:18:27 -06:00
David MannandClaude Opus 5.5 719786c234 Merge main into feat/history-snapshot-options
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 17:00:59 +01:00
David MannandClaude Opus 5.5 5814cc0131 Merge main into feat/ui-217-4-columns-unit
Status lines and the prefs count follow main: 9 of 183 preferences do nothing with Column Size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 17:00:36 +01:00
David MannandClaude Opus 5.5 fb38a51f2a Merge main into fix/crop-invalid-rect
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-02 16:49:47 +01:00
David MannandClaude Opus 5.5 c01d82198a Integration: a Background selection keeps its modifier, and Move needs a layer destination (#10702, #10753)
A Cmd-click adding the Background to the selection loaded as a plain select that replaced
the selection; a Move to an ordinal of a channel loaded as a layer arrange. Found by
CodeRabbit on #10776.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 16:47:11 +01:00
David MannandClaude Opus 5.5 0b36deeca4 Merge main into fix/crop-hidden-resample-budget
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 16:44:29 +01:00
David MannandClaude Opus 5.5 89b4ca021b Merge main into fix/remove-enable-animations
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 16:42:54 +01:00
David MannandClaude Opus 5.5 aa20410a50 Merge main into fix/snapshot-followups
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-02 16:36:14 +01:00
David MannandClaude Opus 5.5 50fd920b3b Integration: a gallery effect's own step keeps its panel name bytes on save (#10632)
The remembered name was the Latin-1 reading of the bytes, so a GBK or Shift_JIS name was
written back garbled. Found by CodeRabbit on #10776.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 16:33:29 +01:00
David MannandClaude Opus 5.5 c03c97222b Integration: Trap, Match Color, Custom and gallery steps that record a key twice stay kept steps (#10630, #10631, #10632)
The first value played and saved, the other was dropped. Same rule as the Group I and
Distort mappers' `setting`. Found by CodeRabbit on #10776.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 16:30:02 +01:00
Khawar Zamman Wani e6a0b9ad20 fix: validate memory approvals before I/O and remove prompt panic 2026-11-02 19:28:00 +05:30
Khawar Zamman Wani d59dc3ebe9 fix: clear remaining PSD admission clippy diagnostics 2026-11-02 19:18:33 +05:30
Khawar Zamman Wani 1eb092539f fix: resolve PSD memory CI compilation and lint errors 2026-11-02 19:09:59 +05:30
Khawar Zamman Wani 582a285b5d fix: enforce scoped PSD memory admission and complete retry integration 2026-11-02 19:01:15 +05:30
David MannandClaude Opus 5.5 e155cf85bf Integration: batch tests read composed pixels with Buffer::into_px after main's #10514 (#10704, #10618)
Main's buffer reuse (#10514) gives Buffer a Drop impl, so moving .px out of it no longer compiles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 14:09:34 +01:00
David Mann 4c95a2d4bd Merge main 5d9c57e60d into integration batch 12 2026-11-02 13:54:27 +01:00
David MannandClaude Opus 5.5 027d191312 Integration: the dither test reads pixels with as_chunks (clippy chunks_exact_to_as_chunks) (#10704)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 13:34:57 +01:00
David MannandClaude Opus 5.5 218a84b801 Merge PR #10704: Actions: restore command options for ATN playback
With our fix-up 8a0f959d29 on top of the author's head 072a87e7b0.
Conflicts with the batch resolved: Image Size keeps #10702's point sizes and
writes `scaleStyles` only when true (no key and false play the same in the
reference application, so recorded steps save back unchanged); Convert to
Profile takes #10704's options; new tests carry #10743's `encoding` field;
#10702's absolute-intent test expects the new Convert to Profile flags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 12:57:10 +01:00
David MannandClaude Opus 5.5 568bf40943 Integration: a Filter Gallery effect's recorded event exports again next to #10628's mask and merge events (#10632)
#10628 refuses an `_atnEvent` that is not a string; #10632 stores the effect's own event
there as an object, so every gallery step loaded from its own event failed Save Actions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 12:51:07 +01:00
Khawar Zamman Wani bcc060180f feat(io,engine,ui): adaptive PSD/PSB memory budget and interactive confirmation
- Distinguish available physical RAM from swap and commit headroom
- Adaptive soft and hard import thresholds with native fallback
- Interactive preflight confirmation modal before pixel decoding
- Headless and command parameters for explicit high-memory approval
- One-shot source-bound validation rejecting altered sources or degraded RAM
- Process-wide serialized decode gate with reentrancy support
- Documentation and synthetic regression test coverage
2026-11-02 17:11:03 +05:30
Trevor BrownandClaude Fable 5.1 dab1280b1b Layer Style: a drag on the image moves a Gradient Overlay (#10763)
With the dialog on a Gradient Overlay page, a drag on the image moves the gradient's centre (params.offset, a fraction of the layer's bounds) by the pointer's movement over the layer's size, as a drag moves a shadow. Tests in layer_style and gradient_overlay.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-02 05:57:36 -05:00
Khawar Zamman Wani 5d9c57e60d Linux: return memory of closed documents to the system (#8743) (#10515)
* perf: reuse large buffers so a pinned glibc trim threshold costs no speed (#10479)

With MALLOC_TRIM_THRESHOLD_ set (#8743), glibc maps every allocation over
128 KiB fresh, so tiles, compositor bands and filter scratch were page-faulted
in on every call: viewport compose 3.6x slower, Gaussian Blur up to 1.8x,
.pcraft save 2.4x.

- photocraft_raster::scratch: a process-wide, capped pool of large Vec
  buffers (u8/u16/f32/[f32; 4]). A miss drops the oldest buffers worth its
  size down to a 256 MiB floor, so peak memory stays near glibc's defaults.
  The engine releases the pool after any command that closes a document,
  Headless::close does too, and an idle thread releases it after 2 s unused.
- Tiles, compose Buffer/masks/bands, algo Image and the blur paths, engine
  adjustment/filter scratch, GPU tile upload and io import buffers go through
  the pool.
- .pcraft save reuses one zstd FrameCompressor per worker (byte-identical).
- interactive_bench reports minor page faults per run.

36 MP, trim threshold set vs glibc defaults: viewport 5.6 vs 6.1 ms (was
22.7), Blur r4 445 vs 437 ms (was 852), Curves CPU proxy 35.0 vs 35.7 ms
(was 50), flatten 146 vs 147 ms (was 237), save .pcraft 251 vs 230 ms (was
545). RSS after closing a 5400x7200 document: 21 MB with trim set.

* fix(linux): restart once with glibc's trim threshold set so closed documents return memory (#8743)

With glibc's default malloc, the memory of a closed document stays with the
process: freeing a large buffer raises glibc's dynamic mmap threshold, so
later tile buffers land in heap pages glibc keeps. A session that opened and
closed a 5400x7200 document held ~450 MiB afterwards.

photocraft_engine::malloc_tuning::apply(), called first in both binaries'
main, re-executes the binary once with MALLOC_TRIM_THRESHOLD_=131072 on Linux
with glibc: same PID, arguments, argv[0] and environment, in safe Rust
(CommandExt::exec). A malloc variable or glibc.malloc.* tunable the user or a
package already set is left alone, so setting MALLOC_TRIM_THRESHOLD_ opts
out. No-op on macOS, Windows, musl and wasm.

Depends on the scratch-buffer pool (#10479), without which the pinned
threshold slows filters, previews, flatten and .pcraft save by 26-209%.

* fix: corpus tests build again; return remaining pooled buffers (#10479 review)

- Corpus-gated io tests and the Photoshop-oracle test moved `.px` out of a
  `Buffer`, which now implements `Drop` (E0509 with `--features corpus`):
  use `into_px()`.
- io: masks, the merged image, extra channels, smart-filter masks,
  smart-object pixels and patterns give their `interleave` buffers back to
  the scratch pool after writing them.
- compose: recycle the mask values of a pass-through group, `effect_shape`
  and both `split_parts` callers.
- Styled Free Transform preview copies each band out instead of moving it,
  so the band returns to the pool.
- interactive_bench: the fault count covers each whole run, untimed setup
  included; say so.

* fix: corpus tests build again; return remaining pooled buffers (#10479 review)

- Corpus-gated io tests and the Photoshop-oracle test moved `.px` out of a
  `Buffer`, which now implements `Drop` (E0509 with `--features corpus`):
  use `into_px()`.
- io: masks, the merged image, extra channels, smart-filter masks,
  smart-object pixels and patterns give their `interleave` buffers back to
  the scratch pool after writing them.
- compose: recycle the mask values of a pass-through group, `effect_shape`
  and both `split_parts` callers.
- Styled Free Transform preview copies each band out instead of moving it,
  so the band returns to the pool.
- interactive_bench: the fault count covers each whole run, untimed setup
  included; say so.

* fix: recycle the masks of adjustment-atop and shape layers (#10479 review)

* fix: recycle the masks of adjustment-atop and shape layers (#10479 review)

* fix: recycle effect hiding masks (#10479 review)

* fix: recycle effect hiding masks (#10479 review)

* fix: recycle knockout, CMYK and GPU shape masks; release the pool when Split/Merge Channels close a document (#10479 review)

* fix: recycle knockout, CMYK and GPU shape masks; release the pool when Split/Merge Channels close a document (#10479 review)

* fix: release the pool when a closed document's cancelled workers exit; idle-release switch for tests; don't pool PSD planes (#10479 review)

* fix: release the pool when a closed document's cancelled workers exit; idle-release switch for tests; don't pool PSD planes (#10479 review)

* fix: release the pool for workers cancelled before their document closes; take the pool lock for budget and idle-release changes (#10479 review)

* fix: release the pool for workers cancelled before their document closes; take the pool lock for budget and idle-release changes (#10479 review)

* fix: idle release rechecks activity under the lock; try_take_exact releases the pool and retries before failing (#10479 review)

* fix: idle release rechecks activity under the lock; try_take_exact releases the pool and retries before failing (#10479 review)

* test: cover a successful try_take_exact miss; name the failed-reservation test for what it checks (#10479 review)

* test: cover a successful try_take_exact miss; name the failed-reservation test for what it checks (#10479 review)

* fix: pool the final GPU effect shape buffer and return it after use (#10479 review)

* fix: pool the final GPU effect shape buffer and return it after use (#10479 review)

* docs: describe scratch pool lifecycle regression invariants

* test: verify polling releases cancelled document scratch buffers

* perf: recycle remaining transform selection and PSD scratch buffers

* fix: free PSD gather bands before allocating channel planes

* test: assert exact scratch take reuses pooled storage
2026-11-02 09:30:46 +01:00
Khawar Zamman Wani 86ddfb72f7 Reuse large buffers so returning freed memory to the OS doesn't slow filters (#10479) (#10514)
* perf: reuse large buffers so a pinned glibc trim threshold costs no speed (#10479)

With MALLOC_TRIM_THRESHOLD_ set (#8743), glibc maps every allocation over
128 KiB fresh, so tiles, compositor bands and filter scratch were page-faulted
in on every call: viewport compose 3.6x slower, Gaussian Blur up to 1.8x,
.pcraft save 2.4x.

- photocraft_raster::scratch: a process-wide, capped pool of large Vec
  buffers (u8/u16/f32/[f32; 4]). A miss drops the oldest buffers worth its
  size down to a 256 MiB floor, so peak memory stays near glibc's defaults.
  The engine releases the pool after any command that closes a document,
  Headless::close does too, and an idle thread releases it after 2 s unused.
- Tiles, compose Buffer/masks/bands, algo Image and the blur paths, engine
  adjustment/filter scratch, GPU tile upload and io import buffers go through
  the pool.
- .pcraft save reuses one zstd FrameCompressor per worker (byte-identical).
- interactive_bench reports minor page faults per run.

36 MP, trim threshold set vs glibc defaults: viewport 5.6 vs 6.1 ms (was
22.7), Blur r4 445 vs 437 ms (was 852), Curves CPU proxy 35.0 vs 35.7 ms
(was 50), flatten 146 vs 147 ms (was 237), save .pcraft 251 vs 230 ms (was
545). RSS after closing a 5400x7200 document: 21 MB with trim set.

* fix: corpus tests build again; return remaining pooled buffers (#10479 review)

- Corpus-gated io tests and the Photoshop-oracle test moved `.px` out of a
  `Buffer`, which now implements `Drop` (E0509 with `--features corpus`):
  use `into_px()`.
- io: masks, the merged image, extra channels, smart-filter masks,
  smart-object pixels and patterns give their `interleave` buffers back to
  the scratch pool after writing them.
- compose: recycle the mask values of a pass-through group, `effect_shape`
  and both `split_parts` callers.
- Styled Free Transform preview copies each band out instead of moving it,
  so the band returns to the pool.
- interactive_bench: the fault count covers each whole run, untimed setup
  included; say so.

* fix: recycle the masks of adjustment-atop and shape layers (#10479 review)

* fix: recycle effect hiding masks (#10479 review)

* fix: recycle knockout, CMYK and GPU shape masks; release the pool when Split/Merge Channels close a document (#10479 review)

* fix: release the pool when a closed document's cancelled workers exit; idle-release switch for tests; don't pool PSD planes (#10479 review)

* fix: release the pool for workers cancelled before their document closes; take the pool lock for budget and idle-release changes (#10479 review)

* fix: idle release rechecks activity under the lock; try_take_exact releases the pool and retries before failing (#10479 review)

* test: cover a successful try_take_exact miss; name the failed-reservation test for what it checks (#10479 review)

* fix: pool the final GPU effect shape buffer and return it after use (#10479 review)

* docs: describe scratch pool lifecycle regression invariants

* test: verify polling releases cancelled document scratch buffers

* perf: recycle remaining transform selection and PSD scratch buffers

* fix: free PSD gather bands before allocating channel planes

* test: assert exact scratch take reuses pooled storage
2026-11-02 09:29:59 +01:00
Fabio Lissi 198f9499ad Report missing named action layers without changing query errors 2026-11-02 01:31:27 -06:00
Fabio Lissi 2240200130 Resolve named layers across action replay handlers 2026-11-02 01:23:41 -06:00
Fabio Lissi 061da0cf7f Resolve named action layers in admission and command handlers 2026-11-02 01:08:50 -06:00
Fabio Lissi 771b33d51e Respect destination case behavior and report repeated Batch cancel 2026-11-02 01:00:31 -06:00
Fabio Lissi ffaeedefa8 Guard late Batch cancellation and report metadata failures 2026-11-02 00:52:59 -06:00
Fabio Lissi b82a354718 Preserve explicit action sources and replay named spelling edits 2026-11-02 00:43:44 -06:00
yoriswind 6ad1e79926 Document image opening diagnostics 2026-11-01 22:31:14 -08:00
Fabio Lissi dc28eb5083 Stream batch directory scans and report cancellations accurately 2026-11-02 00:25:43 -06:00
Fabio Lissi 3191b89064 Preserve styled text and explicit layers in action replay 2026-11-02 00:25:07 -06:00
yoriswind 7798c071d3 fix(actions): propagate failed scripts through recorded parents 2026-11-01 22:11:04 -08:00
yoriswind c10cd89dec fix(batch): retain RAW resolution through tuned development 2026-11-01 21:56:27 -08:00
Fabio Lissi 85cb54025c Guard Batch outputs and preserve partial results 2026-11-01 23:56:10 -06:00
Fabio Lissi 03799b62bc Keep recorded layer targets portable across documents 2026-11-01 23:54:42 -06:00
yoriswind 476948fd30 test(batch): remove redundant profile fixture borrow 2026-11-01 21:41:34 -08:00
yoriswind 4fc3b9ee83 Use supported saved RAW settings for noninteractive Batch opening 2026-11-01 21:29:19 -08:00
yoriswind d898e46030 Apply Batch profile policy without losing import diagnostics 2026-11-01 21:25:16 -08:00
yoriswind b823dd4c96 test(batch): initialize nested playback through its lifecycle 2026-11-01 21:22:00 -08:00
Fabio Lissi 4eba6bd2e9 Merge current main and complete Batch automation options 2026-11-01 23:04:19 -06:00
Fabio Lissi 21c0444559 Merge current main and preserve portable action recording 2026-11-01 23:01:23 -06:00