Commit Graph
374 Commits
Author SHA1 Message Date
FredApps 041c8db2f7 Merge pull request #3482 from dotCooCoo/fix/keyword-names-no-trailing-asterisk
LRC-LIB-KEYWORDS: a new keyword name cannot end in an asterisk
2026-11-20 21:04:02 +07:00
FredApps d501e3c5d4 Merge pull request #3469 from dotCooCoo/feat/keywording-enter-keywords
LRC-LIB-KEYWORDS: the Keywording panel's Enter Keywords view edits keywords as text
2026-11-20 21:03:57 +07:00
FredApps 32b6768a58 Merge branch 'main' into album-counts-background 2026-11-18 16:22:35 +07:00
FredApps a22949d9b7 Merge branch 'main' into fix/keyword-names-no-trailing-asterisk 2026-11-18 16:22:27 +07:00
dotCooCoo 494116a381 Merge main into feat/keywording-enter-keywords 2026-11-17 18:25:35 -08:00
FredApps 1f8e1ef1ad Merge branch 'main' into fix/1619-shutter-precision
# Conflicts:
#	crates/catalog/src/model.rs
#	crates/engine/src/files/tests.rs
#	docs/parity-checklist.md
2026-11-13 20:49:01 +01:00
skylar taylor-barrick d7372407bb fix(catalog): make held caller logs writable for rollback 2026-11-12 20:28:09 -06:00
skylar 18e8980d2a test(catalog): gate Unix-only folder test imports 2026-11-12 20:06:31 -06:00
skylar 5c5981898c fix(catalog): bind log recovery to observed files 2026-11-12 18:50:54 -06:00
skylar e689453e57 fix(catalog): refuse gaps in synchronous fallback logs 2026-11-12 18:01:17 -06:00
skylar 19985a3f19 fix(catalog): reopen fallback appends in the accepted folder 2026-11-12 17:28:07 -06:00
skylar 690f6cfb58 fix(catalog): verify staging identity after streamed writes 2026-11-12 16:53:15 -06:00
skylar 5fa4d0eba6 Merge current main into library folder safety work 2026-11-12 15:52:20 -06:00
dotCooCoo cec94f6e5e Keywords: test more names ending in an asterisk
Create Keyword and valid_name now also refuse a*, a | b*, * alone and
a * (a space before the asterisk).
2026-11-12 08:58:58 -08:00
cezar 1a301fc2d8 LR-EDIT-LENSBLUR: camera-like Lens Blur with AI subject focus and per-mask bokeh
Part of the Lens Blur row (`LR-EDIT-LENSBLUR`, ⬜ → 🟡: no depth map yet). Related: #377 (SAM 3 subject selection, used here for the Lens Blur focus).

## Problem

Lens Blur settings existed but nothing rendered them: there was no way to add a shallow depth of field, keep the subject sharp while the rest falls out of focus, or blur only part of a photo through a mask.

## Change

**Edit → Lens Blur** (`section.lensBlur`, ⌘6)
- **Apply**, **Amount**, **Boost** (brighter bokeh highlights) and **Transition** (how gradually the blur grows away from what is in focus, so the subject doesn't look cut out).
- **In Focus**: *Subject* (a mask) or a fixed shape: **Auto / Round / Horizontal / Vertical**, buttons drawn in code that work on the light themes.
  - **Move & Resize** (tool `lensBlurShape`) drags the ellipse on the photo and stretches it by its handles. Each drag is one undo step; a shape button puts the ellipse back in the middle.
- **Find Subject** (`lensBlur.findSubject`) runs only when clicked, never automatically on Apply.
  - It starts from the focus point the camera recorded, when the file has one (Sony ILCE-1 and ILCE-7SM3, the models `lightcraft_meta` reads today). Otherwise it starts from the subject estimate.
  - SAM 3 keeps the prominent people and animals: those at the focus point and those of a similar size. When the focus point falls on neither, it falls back to an object click at that point.
  - The result is a normal Object mask ("Lens Blur Subject") that can be refined in Masking.
  - It runs on the background segment worker, and on remote SAM 3 too (`Operation::Subject`). While the mask is pending, the UI shows a spinner and the render keeps the subject estimate in focus, so the photo is never blurred whole.
  - Without the model, it returns the model-missing error, changes nothing, and the UI offers the SAM 3 download.
- **Brush Refinement**: Focus and Blur brushes painted on the photo (`lensBlur.brushStroke`, `lensBlur.brushReset`), with Size, Feather, Flow, Amount and Auto Mask.
- While Apply is off, In Focus, the shapes, Move & Resize and Find Subject are disabled.

**Masking: a Lens Blur block in every mask** (`section:maskLensBlur`, under Refine Edges)
- **Blur: Selection / Outside**. Outside blurs what the mask leaves out, without inverting the mask's other adjustments.
- **Amount**, **Boost** and **Transition**, per mask. The header's eye switches the block off and keeps its values; the header folds the block.
- Stored as `lens_blur`, `lens_blur_outside`, `lens_blur_boost`, `lens_blur_transition` and `lens_blur_off` on `LocalAdjustments`, set through `mask.adjust`.

**Rendering** (`crates/pipeline/src/lens_blur.rs`)
- Runs in the scene-linear stage after denoise; its settings are part of `pre_nr_key`.
- Disc (bokeh) kernel at four levels on coarse grids, with a normalized convolution weighted by the circle of confusion, so sharp areas don't bleed halos into the blur. Transition uses a chamfer distance to the in-focus area.
- The radius is relative to the long edge, so the blur doesn't depend on resolution. The work stays bounded on large exports: the disc kernel has a fixed size, and each level's coarse grid stays within a cell budget.
- Zoomed windows, both 8-bit and deep (16-bit/float), read around them and are cut back to the request. The grids follow the whole output's origin, and the automatic subject estimate is made once from the whole photo. A window therefore matches the whole render.
- GPU path: read back, apply on the CPU, upload (`crates/gpu/src/render.rs`).
- Hostile values (NaN or infinite sizes, out-of-range areas and focus points, oversized stroke lists) are sanitized or rejected, never a panic.

All new strings are in the 17 locales.

**Not in this PR:**
- Real depth. The falloff is the image distance from the focus, not scene depth; a depth model (e.g. Depth Anything V2 Small on candle) would be a separate PR.
- Rotating the ellipse.
- Aperture shapes.
- Focus points for more camera makes and models.
- Find Subject doesn't resume by itself after the SAM 3 download (the Masking tools do). Like the existing Object / Describe jobs, it shows no row in the activity stack.

## How it was checked

- [x] Full `cargo xtask ci` on Windows 11 x86_64 after the latest merge of `main` (465c8722):
  - fmt, clippy, heif, parity, layers, assets and wasm pass;
  - every Lens Blur test passes;
  - the only failures are five tests outside this change that fail on Windows on `main` too: `export::tests::sixteen_bit_zip_tiff_is_never_larger_than_uncompressed`, the two GPU out-of-memory tests in `gpu::ctx`, `dialog_role::settings_is_a_dialog_too` (needs craft-fonts) and `folder_drop::dont_ask_again_moves_the_next_drop_at_once`.
- [x] Tests that fail without the change:
  - **pipeline**:
    - the `lens_blur` tests: shapes and moved or hostile areas, blur growth away from the focus, the fallback while an AI mask is pending, brushes, masks blurring their selection or outside with Transition, hostile input;
    - `large_image_blur_work_is_bounded`: on a 60 MP export with the strongest global and per-mask settings, the disc kernel stays a fixed size and every level's coarse grid stays within its cell budget, including an offset render window;
    - window/full-render parity at U8 and U16, including the automatic subject.
  - **engine**: brushes with undo; Find Subject without the model changes nothing; deleting the focus mask clears the focus; a partial effect preset sets `lens_blur`; with the `sam` feature, Find Subject fills the waiting mask.
  - **segment**: `prominent_subjects`, and remote `Subject` validation.
  - **catalog**: `op_variants_are_versioned` with the new format version.
  - **ui-egui**: the brushes painting on the photo, the shape buttons, the controls disabled while Apply is off, Move & Resize with undo and redo, the mask block (side, sliders, eye, folding).
- [x] User-visible change: ran the app and looked at the result (dark and light themes).

## Screenshots

**Before / after**

<img width="1402" height="952" alt="before" src="https://github.com/user-attachments/assets/8baceb99-7708-4c25-990c-8da29b6bc1b4" />
<img width="1320" height="937" alt="after" src="https://github.com/user-attachments/assets/a1476510-558a-4460-8766-b25bda0dfd3d" />

**Edit → Lens Blur** and **the mask's Lens Blur block**

<img width="457" height="626" alt="main painel" src="https://github.com/user-attachments/assets/47a19637-29a8-4446-a003-2eef416975b7" />
<img width="463" height="333" alt="mask painel" src="https://github.com/user-attachments/assets/345ffc14-66d2-4adc-af3c-b756727201de" />

## Merging

- **Overlap:** #1713 (Clearfall; a draft since 2026-10-14 that conflicts with main) implements the same row on the CPU. It has aperture shapes and XMP roundtrip, which this PR lacks. This PR adds the per-mask block, SAM 3 Find Subject from the camera's focus point, the GPU path and window parity. Only one should land; happy to port what #1713 has that this lacks.
- **Existing edits and libraries:** unchanged. Lens Blur is off by default and every new field is omitted from the JSON at its default, so existing settings keep their JSON and hashes.
- **Shared numbers taken:** catalog format `VERSION` 12 (`crates/catalog/src/journal.rs`). main already uses 10 (`Mask.on_photo`) and 11 (`EmbeddedLens.source`), so Lens Blur takes one past them. If another pull request lands with 12 first, I'll take the next one when I merge main. No render-cache, look or process version change.
- **Where it came from:** own implementation; nothing derived from GPL code or Adobe data. The camera focus point comes from the existing `lightcraft_meta` reader; subject selection uses SAM 3 through the existing segment crate.
- **New dependencies, `unsafe`, build scripts, network access, spawned processes, deleted files, CI or `xtask` gate changes:** none. The remote SAM 3 protocol gains one request (`Operation::Subject`). An older worker rejects it with an error, as `docs/ai-masks.md` notes.

## Checklist

- [x] No new panic path in non-test code
- [x] New text on screen goes through `tr()` with keys in all `locales/*.json`; ⌘6 opens the new section (KEY-SECTIONS)
- [x] `docs/parity-checklist.md` rows updated (LR-EDIT-LENSBLUR 🟡, LR-MASK-SLIDERS, KEY-SECTIONS); `docs/gaps.md` has no Lens Blur entry
- [x] New code has a caller
- [x] No new assets (the shape icons are drawn in code)
- [x] Ready to merge

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
  * Added Lens Blur with adjustable strength, highlight boost, and transition controls, plus Round, Wide, and Tall focus shapes.
  * Keep a subject or selected mask in focus, find people or animals automatically, and refine focus or blur with brushes. Move and resize the focus area directly on the photo.
  * Apply Lens Blur to individual masks, including selections or areas outside them.
* **Bug Fixes**
  * Improved Lens Blur rendering for cropped views and preserved focus-mask assignments correctly when masks are edited.
* **Documentation**
  * Updated feature and control guides, with Lens Blur interface translations added across multiple languages.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-11 08:02:05 +01:00
dotCooCoo ee8ecc9abf Merge main into fix/keyword-names-no-trailing-asterisk 2026-11-10 20:31:14 -08:00
dotCooCoo 4856e293f4 Merge main into feat/keywording-enter-keywords 2026-11-10 19:11:45 -08:00
Nathaniel Ledford 0d2dd9a974 A library's files were written by path, so a path that came to lead
somewhere else (a share mounted over the folder, the folder moved away
and another put in its place) made the session write into that other
folder: its catalog.snap and catalog.log were replaced, and dropping the
lock removed the owner note of the program that had the library open.

OpenedFolder records the folder's device and inode number (and when it
was made, where the file system keeps that) when a library opens, and
check() asks, with one stat, whether the path still leads to it. A drive
or share mounted again gets another device number, and some file systems
number their folders anew at every mount, so a folder also counts when
it holds exactly the owner note this session's lock wrote (the lock
vouches for it, and the note holds a value no other lock's note has), or
when it has the same inode number and both creation times are known and
equal; on the same device two different creation times are two folders,
since an inode number is given again to a folder made later. FsStore
(both stores of a library, the snapshot worker), the catalog log's
thread and the lock's owner note ask before they write; a refusal is an
ordinary write error that names the path, so the changes stay queued,
the app says why they are unsaved, and saving goes on once the folder is
back. The thumbnail cache gets a gate that the library closes the same
way, and its takeover, prune and clear passes look at it every 256
files.

The catalog log is opened by its path for each batch and appended to
only while it is as long as what the thread wrote. A copy of the folder
put at the path holds the note and counts as the library, but its log
lacks what was written after the copy was made: it is refused like a
failed write (reported, with later changes taken meanwhile), and the
snapshot the app takes for held records replaces it, instead of going on
writing into the folder that was moved away. A longer log is cut back
only after a write of the thread's own failed.

The lock removes the owner note only when it is the one it wrote, in the
folder it locked. Reopening a path whose folder was replaced takes that
folder's own lock instead of handing the old one over, so does the
check_library preflight, and a lock taken in another folder than the
stores recorded is refused. A Move import removes its originals only
after the catalog log is on disk, not when it was handed to the log's
thread.

Windows reports no folder identity through std (nightly only): there the
check only asks that a folder is still at the path.
2026-11-07 15:32:03 -05:00
FredApps 10db03b091 LR-IMP-FORMATS: withdraw compressed ORF decoding pending provenance review (#3916)
* LR-IMP-FORMATS: withdraw compressed ORF decoding

Remove the decoder introduced in #3775 pending provenance review while preserving uncompressed ORF layouts and embedded previews. Add unsupported probe/decode regressions, remove the prior provenance narrative, and restore camera coverage records to preview-only.

* LR-IMP-FORMATS: refresh ORF support status and render caches

* LR-IMP-FORMATS: document ORF withdrawal regressions
2026-11-07 15:56:03 +01:00
a856df5f42 Write camera make and lens make to EXIF on export (#3828)
* Write camera make and lens make to EXIF on export

PTGui and similar stitching tools read EXIF Make/LensMake to identify camera and lens; without them, exported JPEGs from CR2 files are not recognized the same way as Adobe's export.

Add make and lens_make fields to catalog Meta, populate them from the raw's EXIF on import in meta_of, and write them as EXIF Make and LensMake tags in export_metadata.

Test: export_writes_camera_make_and_lens_make_to_exif failed before the change and passes after.

* Export: read Make and LensMake on import and write them, with Model on its own

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Export: strip the maker from Model only as a separate word

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: eliets2 <287273517+eliets2@users.noreply.github.com>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 10:56:51 +01:00
2a35db6bcf Add flash, exposure bias and serial rules to smart albums (#3821)
* Add flash, exposure bias and serial rules to smart albums

Smart albums cannot filter by flash fired, exposure bias or camera serial even though the file metadata is already parsed.

Add flash, exposure_bias and camera_serial to Meta, copy them in meta_of and on reload, and add flash, exposureBias and cameraSerial rule fields evaluated in Rule::matches.

Test: flash_exposure_bias_and_serial_rules failed before the change and passes after.

* Rules editor: Exposure Bias takes negative values

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: eliets2 <287273517+eliets2@users.noreply.github.com>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 10:14:19 +01:00
ba282d3637 LR-IMP-FORMATS: pure-Rust clean-room compressed Olympus ORF bitstream decoder (#3775)
* LR-IMP-FORMATS: pure-Rust compressed Olympus ORF bitstream decoder

* LR-IMP-FORMATS: address CodeRabbit review feedback on PR #3747

* orf: bound predictor arithmetic, bit widths, and stream consumption

* orf: use unsigned magnitude abs_diff for predictor differences

* docs: correct Olympus verified-body count in parity header

* orf: saturating wbits derivation, widen pixel shift to i64 before clamp

* docs: sync raw parity headline figures with coverage tables

* docs: record clean-room provenance and report 58 newly unlocked bodies for compressed ORF

* docs: note LibRaw derivation and pending clean-room reimplementation for compressed ORF

* LR-IMP-FORMATS: pure-Rust clean-room compressed Olympus ORF bitstream decoder

* LR-IMP-FORMATS: sync orfc path in parity docs and correct mainstream weighted depth sum

* LR-IMP-FORMATS: address CodeRabbit review feedback on ORF gap and evidence sync

* Convert Negative 1/4: lightcraft-film, the negative conversion maths from Film Lab (#2490)

The film model, levels in density space, film presets, colour and tone of
Film Lab's core (same author, MIT), without the PhotoCraft-only sharpening
and JSON scanning, plus a whole-scan measurement (base, black and white
points, neutral balance) a host stores with a photo's settings. A library
with no caller yet.

Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>

* LR-IMP-FORMATS: address CodeRabbit PR #3775 review (round 2)

- orf.rs: scope sample-based bit-depth inference to Word16 branch only
  (from_word16 flag prevents heuristic from running on compressed ORF data)
- orfc.rs: reject truncated compressed streams before allocating the frame
  (minimum 1 bit per pixel check)
- orfc.rs: remove feedback_shift_644 == 15 special case (ordinary exponent)
- ROADMAP/README/target-app-parity: fix '78 bodies' to '58 more bodies
  (2 verified)' — 78 is total Olympus+OM count, 58 were newly unlocked
- target-app-parity: RAW readiness 80% -> 87%, recompute weighted sums
- parity-checklist: refresh summary via cargo xtask parity --write

Generated with Antigravity

* LR-IMP-FORMATS: address CodeRabbit PR #3775 review (round 3)

- target-app-parity: RAW camera decoding 85% -> 89% (559+721 of 1446)
- target-app-parity: mainstream practitioner row lists ORF as per-model
  verification, not as unfinished decoder alongside CR3/HE NEF
- log_writer: check_regular_directory_entry before truncate open
  (prevents symlink-following truncation of files outside the library)

Generated with Antigravity

* LR-IMP-FORMATS: regenerate parity summary after film crate merge

cargo xtask parity --write: 83.2% of 543 in-scope rows (was 83.5%/532);
sync target-app-parity.md checklist references to match.

Generated with Antigravity

---------

Co-authored-by: Yorgos S. <smyrgeorge@gmail.com>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
2026-11-05 22:23:31 +01:00
476f9ee86a catalog: history steps and versions share segmentation grids (#2154) (#2203)
* catalog: history steps and versions share segmentation grids (#2154)

Every history step stored its own copy of each segmentation grid, so a
photo with AI masks rewrote every unchanged grid (about 220 KB each) with
every slider change: on a real library, 183.6 MB of a 187.8 MB
catalog.snap was duplicated grids (830 copies of 126 distinct ones).

Snapshots now keep each distinct grid once, in Catalog.grids (a new
serialization detail, format v10), and the masks of the photo's settings,
versions and history steps refer to it by index (SegMask.grid, with the
data omitted). The table is built while the snapshot is written and is
never held in the live catalog: Journal::open resolves the references
back to inline data (Catalog::repair), so rendering, hash64, presets,
XMP and log records are unchanged, and catalogs written before v10 load
and are upgraded as before. A reference past the table (a damaged
snapshot) is cleared and reported, rendering nothing.

Measured on 90 history steps over one 1024x1024 grid: the snapshot drops
every step's copy of the grid (1.29 MB -> 0.30 MB in the fixture; on the
reporter's library, the grids shrink from 181.8 MB to the 25.9 MB of
distinct grids).

* catalog: the snapshot's shared grids cover the import look too (#2154)

A photo's import look (Photo.import_look, the settings a user default
preset gave the photo on import) can hold segmentation masks, and its
grids can be the same grids that the develop settings, versions or
history steps hold. The snapshot writer referred to such a grid by its
table index, but the table was built from the other settings holders
only and the load resolved only those, so the look's mask came back
empty with a dangling reference.

Photo::settings_holders lists every settings holder (develop settings,
versions, history steps, import look). The writer builds the table from
it and the load resolves references through the same list, so a holder
added there is covered on both sides.

New test import_look_masks_share_the_table_and_resolve_on_load: a look
whose mask shares a grid with the develop settings and a history step,
plus a grid only the look holds. It reloads exactly, and the table holds
both grids once each. Before this change the look's mask came back as
data "" with grid Some(0).

* catalog: state what a snapshot copy shares (#2154)

The snapshot writer copies the catalog to serialize it. Its photos are shared (Catalog.photos holds Arc<Photo>), so the copy is a pointer per photo, not a deep copy; the comment said so without saying which tables are copied. It now lists them, and notes that the derived indexes start empty on the copy.

* develop: a segmentation grid reference is written only by a snapshot (#2154)

The inline serialization of a mask wrote its `grid` whenever one was
set. A `grid` can be set in memory from a document: a mask given to a
command (mask.update, develop.merge) or read from a preset goes through
the derived Deserialize, and such a value stayed in the live catalog.
The next snapshot wrote it inline, and on load the index resolved to
whatever grid sat at that position in the new table, so a mask could
take another mask's grid without a repair being reported. The same
stray value also changed hash64 for identical settings.

The inline form no longer writes `grid`, so it is the pre-v10 form
again. Only the snapshot interner writes a reference, into the table it
builds, so a snapshot cannot hold an index that points elsewhere.

New tests: stray_grid_is_never_written_outside_the_interner (develop)
and stray_grid_from_a_document_is_not_written_as_a_reference (catalog: a
stray reference is not resolved to another photo's grid after a reload).
Both failed before this change: the first wrote "grid":3, the second
loaded photo one's grid into photo two.

* Address review for pull request 2203

* Format the files this pull request changes

* catalog: don't clone a grid that is already in the snapshot's table

The snapshot's grid interning indexed with `entry(m.data.clone())`:
the whole grid was copied before the map said whether it was already
there, so every history step that repeats a mask's grid paid a needless
allocation and copy on the snapshot path. The lookup is borrowed now
(`contains_key`), and a grid is cloned (into the pool and the table)
only when it is new, in the same first-appearance order.

The background snapshot also held two catalogs: `snapshot_in_background`
clones the catalog for the worker, and `write_snapshot` cloned it again
to attach the grid pool. The writer now takes the catalog by value and
the background path hands over its copy, so a snapshot in flight holds
one catalog; the synchronous path keeps its own single clone.

Not observable in behaviour: the grid tests and the catalog suite pass
unchanged.

* Tests: the hostile-mask test names the new grid field

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: eliets2 <287273517+eliets2@users.noreply.github.com>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 21:42:07 +01:00
eliets2andeliets2 1ff2211cd4 catalog: resync finds the retry record from the end, not every marker (#2124) (#2179)
* catalog: resync finds the retry record from the end, not every marker (#2124)

A damaged log line made only of the record-start marker repeated N times cost O(N^2):
resync scanned every occurrence of the marker and ran a from_utf8 + decode_record for each,
so a 2 MB line (~300k markers) hung library open effectively forever. Only the retry record
can follow a torn fragment (it re-encodes the same ops with the same seqs), so resync now
takes the LAST occurrence of the marker and requires a fragment to precede it; the
seq <= last + 1 gate and the CRC check are unchanged.

Adds a regression test: a 300k-marker line followed by a valid retried record opens in well
under a second and still recovers the record (torn_fragments == 1).

* catalog: drop unneeded mut bindings in the resync regression test

* catalog: count the start markers resync decodes instead of timing the cost test

The cost test asserted a one-second wall-clock limit, which a slow worker can miss without any regression. The test now counts the start markers that resync decodes on the hostile line, through a counter that exists only in test builds, and asserts that at most the last one is decoded. The production path is unchanged.

* Repair review branch integration

* Address review for pull request 2179

* Format the files this pull request changes

* Repair review branch integration

* Address review for pull request 2179

* Format the files this pull request changes

* catalog: pin recovery of a rules retry with nested seq values on the final line

A failed append can leave its fragment glued to a CRC-valid SetAlbumRules
retry whose rules hold several nested {"seq":1} values, and the damaged
line can be the log's last. Picking the last raw {"seq": occurrence as
the record start rejects the whole record and truncates the final line,
losing the valid operation (issue #2124). The regression opens such a log
and asserts the operation is replayed and the log file is preserved.

* catalog: bound the resync scan and require the record header on candidates

Every header-shaped marker in a damaged line still became a resync
candidate, and each attempt decodes the rest of the line, so a crafted
final line of many {"seq":N,"crc":M,"op": markers made Journal::open
spend quadratic work on one load (CWE-407). Two changes:

- a candidate must now match the full record header shape, digits after
  {"seq": and after ,"crc": and a trailing ,"op":, so nested markers
  (a rule value such as {"seq":1}) and junk never reach decode_record;
- a per-line budget of 64 MiB of candidate suffixes, checked with
  checked_add, stops the scan once it is spent; the line then reads as
  damage, which open handles safely.

The new regression stuffs a final line with 5000 header-shaped markers
and asserts a bounded number of candidate decodes via the existing
counter (not timing), that open still succeeds with the line dropped as
a torn tail, and that a CRC-valid retry after the junk is still
recovered.

---------

Co-authored-by: eliets2 <287273517+eliets2@users.noreply.github.com>
2026-11-05 20:44:20 +01:00
dotCooCoo e4aecb94c6 Merge main into feat/keywording-enter-keywords 2026-11-05 01:44:51 -08:00
FredAppsandClaude Opus 5.5 2e66a00d55 Tests: two catalog flakes; a readback waits as long as a render (#3777)
a_failed_write_is_held_reported_and_retried raced the log thread: it
could fail the first append before the second arrived, which is then
refused by design. The test now hands both over in one append.

a_file_path_rule_allocates_nothing_per_photo counted heap blocks on every
thread, so the test harness's own thread could fail it (four blocks, on
PRs that don't touch this code). An allocation per photo is thousands, so
the bound stays far below that.

read_texture waited 10 s where the render path waits 60 s, so a view
could be dropped from a headless screenshot while earlier work ran.

The GPU guide now says what the code does about the window's card.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 06:39:08 +01:00
2ddb43896b PERF-STEP-STALL: stepping and flagging never wait for the drive, and no change is ever dropped (#3557)
* PERF-STEP-STALL: stepping and flagging never wait for the drive; the catalog log is written and synced by its own thread, and nothing handed to it is ever dropped

On Windows a write to the catalog log waited for a sync of the same file in
flight, and each flag, rating or step synced on the UI thread, so culling on
a busy drive froze the window. FsStore now hands log appends to a thread
that writes and syncs them in order, batching what arrives during a sync.

No change is lost: the thread keeps every byte it has not yet synced. A
write or sync that fails is held and retried (cutting any fragment first),
later appends are refused with the reason (the engine keeps them queued, as
for any failed save), the held records count as unsaved so the quit prompt
warns, and a snapshot is made due. Cuts, replaces and reads act on the
logical log (synced bytes plus held ones), so the log never has a gap.
A clean quit's closing snapshot holds everything; dropping the store waits
for the thread.

Tests drive a slow drive (a sync hook that sleeps) and a failing one
through test-only fault hooks (doc-hidden, keyed by library folder): with 300 ms syncs the slowest flag is
0.2 ms (305 ms with the log written on the caller, as before); every change
made during slow saves reopens after a flush, a drop and a close; a failed
write is reported, retried and lands with no gap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* PERF-STEP-STALL: review fixes: a reopen reads what the log thread was handed, the quit check reads the held status now, a covering snapshot clears it, a cut to the synced length reaches the file

- open_stores flushes the old journal's log thread before the same
  library's files are read again (Settings, Libraries; a reopen).
- Session::refresh_unsaved, called by the quit check, reads what the log
  thread holds at that moment, not as of the last frame.
- Journal::unwritten is None once a snapshot holds every op (the closing
  snapshot after a failed log reset no longer makes the quit prompt say
  changes would be lost); wants_snapshot follows it.
- A cut to exactly the synced length with bytes held cuts the file, so
  bytes a failed sync left there never come back on the next open.
- A caller that waits over a minute for the drive gets a timed-out error,
  not "the writer stopped".

Each fix has a test that fails without it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* PERF-STEP-STALL: a reopen and the quit check wait for what the log thread was handed

Review of #3557:
- Opening the same library again while its log thread can't write what
  it was handed now fails and keeps the open library (with the held
  change, retried). Before, the new catalog was read from files missing
  it.
- The quit check flushes the log thread first instead of reading only
  the failure it had already reported. A change accepted but not yet
  written, then failed, is saved by the closing snapshot before the
  window may close; if that fails too, the unsaved prompt shows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* PERF-STEP-STALL: a reopen goes ahead when the snapshot already holds every change

Review of #3557: the reopen was refused whenever the old log's flush
failed. When a completed snapshot covers every op, nothing is missing
from the files, so the open now goes ahead and only logs the error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
2026-11-05 05:25:04 +01:00
OneSlipandClaude Opus 5.5 077f4a507f GPU-FULL: more of the render on the GPU, loupe drafts from GPU textures (#1065)
* GPU-FULL-1: LUT profiles, Refine Edges and soft proofs render on the GPU

These three sent the whole loupe / compare / export render back to the CPU
pipeline (media::develop and lightcraft_gpu::render declined them).

- LUT profiles: the .cube table rides in the finish kernel's aux buffer
  (LUT_* parameters); lut_apply mirrors Lut3d::apply (trilinear, domain),
  applied after grain and blended by the profile amount, as on the CPU.
- Refine Edges: the cross guided filter Auto Mask already ran on the device,
  now with a combine mode (max for strokes, mix by sqrt(refine) for Refine),
  applied to the combined alpha before the mask's invert and amount.
- Soft proofing: proof-space gamut mapping and the destination / display
  gamut warnings in the kernel (PROOF_* parameters, GAMUT_WARN and warning
  colours generated from the CPU constants), for output spaces and displays.

Equivalence tests (RTX 5070, DX12): LUT profiles at three amounts and a
non-default domain, Refine 15/60/100 on two masks, proofs in 16 combinations
of space, output, display and warnings - all max 1 LSB, mean <= 0.0005 LSB.
The tests also check that strong refine and the destination warning change
the image (so they aren't comparing two unchanged renders).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* GPU-FULL-2: spot removal, defringe and the histogram on the GPU

Spots and defringe made every render that had them (and every white
balance or spot edit) read the resampled image back, run the scene-linear
stage on the CPU and upload it again. Now only the ProRAW local tone map
(off by default) does.

- Defringe: OkLab pass, separable lightness min/max filter, per-pixel
  apply. Parameters come from the new optics::defringe_params, which the
  CPU stage now uses too.
- Spots: new spot module (spot_prep / spot_apply over each spot's box, the
  Heal tone correction as device Gaussians), spot by spot in place so each
  reads what the earlier ones left, as on the CPU. Remove's automatic
  source: spot_score rates the 48 candidates on the device and only the
  scores come back. Layout, candidates, spoke directions, radii and ranking
  are shared helpers in pipeline::spots (spots::apply uses them; behaviour
  unchanged, pipeline tests green).
- Histogram: counted with atomics on the device on Histogram::of_srgb8's
  sampling grid (exact), instead of a CPU pass over the readback.

Tests: spots (clone, heal, auto remove incl. near the edge where no
candidate fits, brushed strokes, feather 0, cut by the edge, overlapping)
and defringe (purple/green, hue ranges, preview and full size) max 1 LSB;
the device histogram equals the CPU count of the returned image for small,
sampled (>1 MP) and windowed renders; the scoring kernel picks the CPU's
candidate. (The edge case caught a real bug: "doesn't fit" was written as a
decimal literal that rounds below f32::MAX.) Unit tests that create the
device now take turns with the crash-sentinel test, which swaps a global.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* GPU-FULL-2: fix the spot kernels' build; GPU tests fail when kernels don't build

07d4680b's spot module declared `const F32_MAX = bitcast<f32>(...)`, which
naga can't evaluate as a constant: the kernels failed to build, the device
was unavailable, and the equivalence tests skipped as if there were no
adapter - so that commit's GPU tests didn't actually run. f32::MAX is now a
function, and the equivalence suite (and the device unit test) fail instead
of skipping when an adapter exists but the kernels don't build.

Re-verified on the RTX 5070 (DX12), all on the device: 21 equivalence tests
incl. the 8 spot cases (max 1 LSB), defringe, the exact device histogram,
and the auto-source unit test.

Adds an ignored thumbnail throughput bench (tests/thumbs_bench.rs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* GPU-FULL-3: thumbnails render on the GPU once the device is ready

Every cached job (grid and filmstrip thumbnails, preset and profile
previews, faces, quick stand-ins) was forced onto the CPU. They now use the
GPU when lightcraft_gpu::ready() - so they never block on device creation
at startup (1.8 s incl. kernels here) and render on the CPU until then.
Views and exports keep waiting for the device as before.

tests/thumbs_bench.rs (ignored): six workers rendering 256 px thumbnails of
512 px sources with preset-like settings (NR, sharpening, clarity, grading,
a gradient mask): RTX 5070 3.6 ms each vs 4.3-5.2 ms on 32 CPU threads,
with the cores left free for raw decoding.

Engine and UI suites: unchanged (only the 12 failures that predate this
branch on Windows: tests_sync paths, tests_model_setup).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* GPU-FULL-4: the loupe's drafts are drawn straight from the GPU

Rendering and drawing now share one device: the desktop app creates the
window's wgpu device with the adapter's limits and hands it to the GPU
renderer (lightcraft_gpu::adopt_window_device, on a background thread at
startup, under the crash sentinel; a device that doesn't suit falls back to
one of the renderer's own, as before).

A drag's drafts of the views are RenderJob::on_screen: the render ends in an
Rgba8Unorm texture (lightcraft_gpu::render_display -> Output::Display, new
`present` kernels: unwritten-pixel count, row padding for the copy) and
egui-wgpu draws it as a native texture (ui-egui ScreenTextures, implemented
by the app) - no readback, no conversion to egui pixels, no re-upload. The
readback's checks run on the device (atomic unwritten count, device
histogram). Renders that need pixels keep the readback: the settled full
render (view cache, overlays, screenshots), thumbnails, exports, overlays,
windows that spots grew, a monitor profile.

- engine: RenderJob::on_screen, RenderResult::frame (ScreenFrame).
- ui-egui: Tex::native / Tex::id() (21 draw sites), Renderer
  set_screen_textures, natives per slot (freed when pixels return),
  ui.inspect perf.gpuWindowDevice / screenTextures / mainOnGpu.
- app: WindowTextures, window device limits, LIGHTCRAFT_GPU_WINDOW=0 to opt
  out.

Tests: crates/gpu/tests/display.rs adopts a device in its own process and
checks the texture holds exactly the readback's pixels (padded and
unpadded widths, draft and full), the histogram matches, and overlays /
grown windows come back as pixels. In the app (RTX 5070, a 45 MP CR3 from
the user's library copy): all 90 drafts of a drag drawn from GPU textures,
1.69 ms vs 2.05 ms median per draft render with the readback; the frame
screenshot shows the image correctly; pixels return after the drag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* GPU-FULL-2: the denoise runner tests take turns with the crash-sentinel tests

Building a denoise runner creates a device and compiles kernels under the
init marker. Running in parallel with backend::tests, it could arm the marker
the test had just set, so "is removed afterwards" failed now and then. The
runner tests now hold DEVICE_TEST_LOCK while they build, like the render tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* GPU-FULL-4: fix the build after merging upstream main

Upstream's QuickJob panic guard builds a RenderResult (add `frame: None`),
its idle-trim test builds a Tex (add `native: None`), and its on_exit test
builds App (add the WindowTextures slot).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* GPU-FULL-2: upstream's blur tests take turns with the crash-sentinel tests

gaussian_matches_cpu and bench_kernels create the device, so they hold
DEVICE_TEST_LOCK like every other device test in lightcraft-gpu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Tests: the same-folder export test compares paths separator-blind (Windows)

The written path is the original's folder (`\` on Windows) joined with `Exports/IMG_1.jpg`;
the expected one had `\Exports`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Tests: the folder-drop tests find folder widgets separator-blind (Windows)

The folder tree spells its paths with `/`; the tests built widget ids from Windows paths with
`\`, so none was found and every test failed on Windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Tests: the Windows path fixes take the same form as in the other PR branches

So the branches merge into main without conflicts between their copies of the fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* GPU-FULL: headless screenshots read back GPU-drawn views; LIGHTCRAFT_GPU_LIMITS caps the adopted device

Review of PR #1065:
- A headless `ui.screenshot` taken mid-drag showed the photo as a white
  rectangle: the GPU-resident draft left no CPU copy. With keep_pixels
  (control channel) the renderer now keeps each view's frame, and
  `cpu_textures` reads it back through `ScreenTextures::read`
  (`lightcraft_gpu::read_texture`). Drawing still never reads back, so
  drags keep the speed-up.
- Adopting the window's device skipped LIGHTCRAFT_GPU_LIMITS; `Gpu::adopt`
  now caps its limits the same way `Gpu::new` does.

Tests: a_headless_screenshot_reads_back_a_view_drawn_from_the_gpu (ui-egui),
the_limits_override_caps_an_adopted_device (gpu); the display test uses
read_texture and skips through lightcraft_testkit::skip!.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* GPU-FULL: review fixes (CodeRabbit 2026-10-21) and slideshow/print draw GPU-drawn views

- the window-device adoption is announced before its thread starts: until it finishes, the
  settings' warm-up and renders don't create a device of their own (they raced it)
- the device error / device-lost handlers go on only after the kernels build, so a declined
  window device keeps the window's own handler
- releasing a slot frees its GPU-resident texture and kept frame
- a soft proof into a colour space drafts full size on the GPU; only one to a device profile
  counts as proofed for `handles`
- docs: Fill spots and device-profile soft proofs render on the CPU
- slideshow, slide layout and print draw `Tex::id()` (the GPU texture when there is one)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* GPU-FULL: the display test skips when LIGHTCRAFT_GPU=0 switches the GPU off

It panicked ("GPU rendering is off") instead of skipping like the other GPU tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* GPU-FULL: a view readback never panics on a lost device

read_texture (headless screenshots of GPU-drawn views) polled the device
directly. On a lost device wgpu 30 panics in Device::poll; it now goes
through the same guard as the renderer's own polls (poll_device): a lost
device returns an error, stops the GPU and is not polled again. Review of
PR #1065. Also quiets a browser-build dead-code warning on OnScreen::Frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* GPU-FULL: an HDR edit's histogram shows the HDR range on the on-screen GPU path too

develop_on_screen returned the GPU's SDR histogram for both its Display and Image arms; it now
applies lightcraft_pipeline::hdr_histogram as develop_reporting does (None for drafts, windows,
proofs and non-HDR edits, which keep the GPU's histogram).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* GPU-FULL: the Navigator draws the photo's texture as it is drawn in the loupe

The Navigator falls back to the main view's texture before the photo has a thumbnail. It drew
`t.tex`, which is stale (or the 1x1 placeholder) when the main view holds a GPU-resident draft;
it now draws `Tex::id()`, like every other draw site.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* GPU-FULL: the egui 0.37 lifecycle test's texture names no native id

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* GPU-FULL: rustfmt the lifecycle test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* GPU-FULL: the second window fits the frame's size; freed GPU frames drop their views

The second window sized its image from the texture handle, which is only a
1x1 placeholder for a GPU-resident render; it now uses the frame's size.
When a GPU-resident render can't be shown and every native texture is
freed, the views pointing at them (Before, Region, Compare tiles) are
dropped too, so they render again as pixels instead of drawing a freed id.
Test: freeing_gpu_frames_drops_the_views_drawn_from_them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(gpu): LIGHTCRAFT_GPU_ADAPTER picks the card for rendering too

The variable chose the card only for AI Denoise and the face detector
(two copies of the same enumerate-and-match code); photo rendering
always took the first high-performance adapter, on a two-card machine
the one driving the screens.

One helper, backend::pick_adapter, now serves the render device
(Gpu::new), the denoise network and the face detector: the first
hardware card whose name contains the value (any case), else the
high-performance one. A name that matches no card is logged and falls
back instead of failing. backend::may_adopt_window_device says whether
rendering may share the window's device (only for the window's card).
Name matching is unit-tested without a GPU; the equivalence tests print
the card they ran on. Documented in docs/gpu-pipeline.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* GPU-FULL: a view switching to a GPU texture releases its pixel image

Review of #1065 (CodeRabbit nitpick): when a slot that had pixels switched to
a GPU-resident texture, its egui texture kept the full-size image, never drawn
while the native texture is set. Tex::show_native now swaps it for a 1x1
placeholder on the switch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(gpu): LIGHTCRAFT_GPU_ADAPTER picks among several matches in a defined order and logs once

Review of #3428:
- several cards match: the one whose whole name it is, then dedicated before built-in before
  virtual cards, then wgpu's order (backend::choose_named_adapter); the log names every match
  and the one used;
- no match: the default choice, with a warning that lists the cards;
- a name matching only a software renderer: never used, and the warning says so;
- each line is logged once (backend::log_once), though the render device, AI Denoise and the
  face models each ask;
- tests on fake adapter lists: a_fake_adapter_list_picks_in_a_defined_order,
  a_choice_is_logged_once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* GPU-FULL: the release note gives the GPU's documented bound against the CPU (3 levels, mean under half a level)

Review of PR #3544.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* GPU-FULL: the window's device isn't adopted when LIGHTCRAFT_GPU_ADAPTER names another card

With #3428 merged, Gpu::new already makes the render device on the named card; the window's
device was still adopted first, so the app rendered on the screen's card whatever the variable
said. backend::may_adopt_window_device (tested on names in backend.rs) now decides: another
card named renders on a device of its own, and the window stays on the screen's card.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 05:10:32 +01:00
dotCooCoo 29480c7796 Keywords: Enter Keywords gives up a hidden edit after any selection change
The app counts selection changes before and after every command and at
the end of each UI pass. An Enter Keywords edit keeps the count from
when it started, so selecting other photos and then the same photos
again between two passes still gives the edit up.

The Add keyword box gathers the photos' keywords once per typed text,
for the hierarchy check and both lists of offers, instead of up to
three times. Catalog::keyword_suggestions_among takes that list.
2026-11-04 12:01:51 -08:00
FredApps 9423635e8c LR-EDIT-OPTICS-PROFILE: merge main (#3550 took catalog format 10; EmbeddedLens.source moves to format 11) 2026-11-04 13:21:54 +01:00
FredApps ca557c7d4e Merge remote-tracking branch 'origin/main' into pr-3550
# Conflicts:
#	docs/parity-checklist.md
2026-11-04 12:19:58 +01:00
FredApps 36b244286a Merge remote-tracking branch 'origin/main' into pr-3073
# Conflicts:
#	docs/gaps.md
2026-11-04 12:11:30 +01:00
Dylan M. Taylor 00b020cf2f catalog: bound keyword list path expansion and index synonym merges (#3641)
* catalog: bound keyword list path expansion and index synonym merges

* address review: hold keyword list writer to the path budget the reader enforces

* address review: charge the emitted parent path in the keyword list writer
2026-11-03 22:51:11 -05:00
06c1b9ae07 Use crw craftlib (#3503)
* CRW-LIB: decode Canon CRW through the shared craft-crw crate

LightCraft decodes Canon CRW (the CIFF raws of the EOS D30, D60, 10D, 300D and the
PowerShot G1/G6) through craft-libs' `craft-crw`, the clean-room decoder derived and
verified on the `clean-room-crw-format-decode` branch and moved there with its frozen
tables and derivation record. `crates/raw/src/vendor/crw.rs` is now the adapter: it maps
the crate's header and samples onto `RawImage` (CFA, levels, active area, orientation,
as-shot white balance, the make/model/time records a CRW keeps instead of Exif) and
converts the capture time through chrono. The dependency is a local path
(`../craft-libs/crates/crw`) until the craft-libs branch merges; then it becomes a git
revision.

Everything LightCraft-side from that branch comes along unchanged: `probe_bytes` fills
metadata gaps from the decoder's records so CRW imports name their camera; the EOS D60
bundled camera profile and its chart-measured dual-illuminant matrices (`chart_table.rs`,
`spectral::Camera` carries its illuminant pair) give the D60 a Kelvin white-balance scale;
CRW joins the JPEG-fitted starting look, the catalog's raw formats and `lightcraft-cli
calibrate`; `RENDER_CACHE_VERSION` 71; the CC0 CRW corpus entries for `cargo xtask corpus`;
coverage, parity, gaps, raw-parity, target-app-parity and ROADMAP updates. The G5 stays
preview-only (the crate refuses it with the reason) and the robustness test keeps its CRW
sample.

What does not come along: the decoder, its tables and `crw_oracle.rs` (now craft-crw's
digest-pinned sample test) and the derivation record, which lives in craft-libs
`crates/crw/clean-room/`. `clean-room/crw/` here keeps only the EOS D60 chart-calibration
document and its capture list, with a README pointing at the record.

Gates: fmt, clippy -D warnings (raw all targets; engine, catalog, cli), lightcraft-raw tests
(475 + 134, the corpus files decoding through the adapter), catalog tests, engine lib tests
(1,300 pass; the two failures, `tests_import::recursive_discovery_…` and
`originals::tests::write_targets_pin_absent_paths_…`, are in files unchanged from main),
`cargo xtask parity`, `assets`, `layers`, `coverage.py --check`.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* no message

* no message

* Update documentation after moving code to craft-libs

* Review coment fixes

* CRW: pin craft-crw f3b62ec, a truncated entropy stream is Corrupt

craft-libs #472 makes craft_crw::decode refuse a stream that ends more than
Limits::max_stream_end_fill (64 samples, one block) before the frame does,
instead of filling the rest with predictor values and returning success.
The adapter already maps craft_crw::Error::Corrupt to RawError::Corrupt;
a regression test proves a truncated CRW now fails at this boundary (it
decoded as a flat frame on the old pin) while its header still reads.

Only craft-crw moves; craft-ui/docpath/update/window stay on c5a1cbf.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Code review comment fix

* Add some tests

---------

Co-authored-by: Robert Woldberg <314159+rwoldberg@users.noreply.github.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-02 20:41:34 -05:00
Brandon Thomas c37e73137e Merge PR #3442 2026-11-01 22:06:44 -05:00
OneSlipsandClaude Opus 5.5 2ad7207127 LR-MASK-GEOMETRY: masks stay on the photo under lens corrections, Upright, Transform and Rotate
Mask coordinates lived on the corrected frame, so a Transform, Upright or lens-correction change
moved the photo under them and the masked look stayed behind, offset from the person it was drawn
on (4.3 px on a 240 px render under Vertical 25 + Rotate 4: about 100 px at 6000 px). Rotate Left /
Right turned the crop but not the masks.

A mask's coordinates are now on the photo before the warp (Mask::on_photo, catalog format 10):
the CPU render, the GPU render, Auto Mask brush windows and the on-photo tools map them through
the warp (Frame::for_mask, Warp::from_source). Rotate Left / Right turns masks with the photo
(mask_space::turn). The AI models see the photo without lens corrections, Upright, Transform,
crop or flips, so stored Object / Prompt selections stay on their content and changing those
doesn't ask the model again. Older masks (no on_photo) render where they were and move onto the
photo, without moving, at their next edit (mask_space::attach).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 03:14:38 +10:00
OneSlipsandClaude Opus 5.5 29443e117c LR-EDIT-OPTICS-PROFILE: merge main (#3430 integration round 3, #3390)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 03:45:27 +10:00
dotCooCoo 1ad3f4e69e LRC-LIB-KEYWORDS: a new keyword name can't end in an asterisk
The keyword help says "Keywords cannot end with an asterisk ( * )." The
Keywording panel marks a keyword that only some of the selected photos
have with one.

keywords::valid_name checks a name, and Catalog::check_keyword_name
refuses a level ending in `*` that the library does not have yet. These
now refuse such a name: keyword.create (Create Keyword Tag),
keyword.edit (Edit Keyword Tag), keyword.rename, keyword.merge, a new
parent in keyword.move, photo.setMeta `keywords` and `addKeywords`
(the Add keyword box), keyword.setShortcut, keyword.saveSet,
library.import `keywords` and the keyword painter. A name with `*`
inside (`a*b`) is allowed.

Keywords read from sidecars, XMP, catalogs, keyword list files and the
op log are kept as they are, and a keyword the library already has can
still be given to photos.
2026-10-31 09:46:54 -07:00
NetterSilverandClaude Haiku 5.5 9d4f33a77c Match library search date: token case-insensitively
Found while testing crates/catalog/src/query.rs:178 (token_matches, the "date" branch at :215)

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-31 09:25:18 +00:00
NetterSilverandClaude Haiku 5.5 7e92c28b23 Reject shutter fractions with a non-positive numerator or denominator
Found while testing crates/catalog/src/model.rs:160 (parse_shutter_seconds)

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-31 08:05:02 +00:00
FredApps 95455a73ce Merge main into branch, combining the parity checklist rows both sides edited 2026-10-31 07:28:20 +01:00
aiongg 1f111b5e80 Merge track r3-t07
# Conflicts:
#	crates/engine/src/tests/libops.rs
#	docs/gaps.md
#	docs/parity-checklist.md
#	docs/whats-new.md
2026-10-31 02:30:21 +00:00
aiongg 0fa59f8846 Merge track r3-t05
# Conflicts:
#	crates/ui-egui/locales/cs-formats.json
#	crates/ui-egui/locales/cs.json
#	crates/ui-egui/locales/de-formats.json
#	crates/ui-egui/locales/de.json
#	crates/ui-egui/locales/es-formats.json
#	crates/ui-egui/locales/es.json
#	crates/ui-egui/locales/fi-formats.json
#	crates/ui-egui/locales/fi.json
#	crates/ui-egui/locales/fr-formats.json
#	crates/ui-egui/locales/fr.json
#	crates/ui-egui/locales/id-formats.json
#	crates/ui-egui/locales/id.json
#	crates/ui-egui/locales/it-formats.json
#	crates/ui-egui/locales/it.json
#	crates/ui-egui/locales/ja-formats.json
#	crates/ui-egui/locales/ja.json
#	crates/ui-egui/locales/ka-formats.json
#	crates/ui-egui/locales/ka.json
#	crates/ui-egui/locales/pl-formats.json
#	crates/ui-egui/locales/pl.json
#	crates/ui-egui/locales/pt-br-formats.json
#	crates/ui-egui/locales/pt-br.json
#	crates/ui-egui/locales/ru-formats.json
#	crates/ui-egui/locales/ru.json
#	crates/ui-egui/locales/sv-formats.json
#	crates/ui-egui/locales/sv.json
#	crates/ui-egui/locales/uk-formats.json
#	crates/ui-egui/locales/uk.json
#	crates/ui-egui/locales/vi-formats.json
#	crates/ui-egui/locales/vi.json
#	crates/ui-egui/locales/zh-hans-formats.json
#	crates/ui-egui/locales/zh-hans.json
#	crates/ui-egui/locales/zh-hant-formats.json
#	crates/ui-egui/locales/zh-hant.json
#	docs/gaps.md
#	docs/parity-checklist.md
#	docs/whats-new.md
2026-10-31 02:30:12 +00:00
aiongg 67b636329a Merge track r3-t03
# Conflicts:
#	crates/ui-egui/src/tests/drop_import.rs
#	crates/ui-egui/tests/it/main.rs
#	docs/gaps.md
#	docs/parity-checklist.md
#	docs/whats-new.md
2026-10-31 02:29:52 +00:00
aiongg 46982a5c4f Merge track r3-t02
# Conflicts:
#	docs/gaps.md
#	docs/parity-checklist.md
#	docs/whats-new.md
2026-10-31 02:29:22 +00:00
aiongg 9c471f3934 Merge PR #3383: PERF-SMART: a File path rule over a non-ASCII path folds case in stack buffers instead of allocating two strings per photo 2026-10-31 02:09:27 +00:00
aiongg 42fbec83dc Merge PR #2725: LRC-LIB-CATALOG-LOCK: quitting on macOS removes the lock's owner note 2026-10-31 02:08:09 +00:00
aiongg cc2c3fc754 Merge PR #2714: Never crash: History is bounded on load and by every op that sets it (#2579 item 8) 2026-10-31 02:08:09 +00:00
aiongg b18753a79c Merge PR #3121: PERF-CATALOG: a smart album's per-photo test stops storing an answer nothing can read 2026-10-31 02:08:07 +00:00
aiongg 87956cf4ea Merge PR #2530: Return None from shift_iso for impossible calendar dates
crates/catalog/src/dates.rs: kept main's trim and tail check, added the PR's round-trip date check.
2026-10-31 02:08:06 +00:00