Skip to content

Nightly: staging → main 2026-12-05 - #1894

Merged
emmertex merged 278 commits into
mainfrom
staging
Dec 4, 2026
Merged

emmertex merged 278 commits into
mainfrom
staging

Conversation

@emmertex

@emmertex emmertex commented Dec 4, 2026

Copy link
Copy Markdown
Owner

Batch of merged PRs in origin/main..origin/staging:

🤖 Generated with Claude Code

blwfish and others added 30 commits December 2, 2026 17:40
…stub), sound or damaged

The format check of the v4 store (`CatalogDb::check_format`, run by `open` and again by `load`) opened the file writable, and
redb flushes on every writable open: the store's modification time changed on every open, so Time Machine and Backblaze
copied the whole catalog again for no edit. It now reads with `redb::ReadOnlyDatabase` and falls back to the writable open
only when the store can't be read as it is (not closed cleanly: redb's own recovery, which is required today; a damaged
file: the old open reports what is wrong with it). The load itself reads the file into memory and never wrote.

Tests: every file of the library folder keeps its bytes and its modification time across an open and a drop without an
edit, for a sound library with edits in its log, a damaged one (stacks, folder loop, 250 History steps, counters behind,
a log record to replay) and one with an unreadable record; reading a catalog for an import writes nothing either (the sound
one failed before this change: catalog.redb's time moved). The first edit of a damaged library writes only what it
changes: every table the edit did not touch has the records it had, and one photo record is written; the lifted counters
reach the store only with a save that changes the head (an album added), in memory until then.

Other writes on the open path, pre-existing and not changed (all conditional on something needing it):
- `FsStore::open` `create_dir_all` (a no-op for an existing folder);
- a snapshot stub written when `catalog.snap` is missing or differs (`library.rs` open_v4_inner), and the entry file when
  missing (`write_entry_if_missing`);
- a new library: redb file created in a temp name and renamed (`library.rs:289`); a v3 library: migration (`migrate_v3`, temp
  store + rename, `keep_copy` backup, `mark_version` for an older store);
- the log at open (`journal.rs` open_from): `truncate` of a torn final record, an appended newline when the last record has none,
  and a damaged log kept as `catalog.log.damaged-<seq>` plus a fresh `snapshot`; a snapshot for a created or older JSON library;
- a store that was not closed cleanly is opened writable for redb's recovery (the fallback above);
- outside `Journal::open`: `LibraryLock::acquire` writes the lock and owner note when the engine locks the library.

Stored fields unchanged; no format bump. Manual: none.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…es not checkpoint after a short session

The probe (open-writes.md) found that every close ran a checkpoint even after no edit: a redb commit (`meta.seq` and
`meta.generation`, 40-56 KiB of pages, a new mtime on the whole 19 MB / ~385 MB store) and a replacement of `catalog.log` by
another empty file (new inode). File-level backups (Time Machine x2, Backblaze) copy the file again each session.

- `CatalogDb::write_tables` returns without a transaction when the catalog is exactly what the store holds (every photo the
  very `Arc` read or written, collections, stacks, previews, remote links, flat-field maps and the head record equal) and the
  store already holds this `seq` (`stored_seq`, kept by open, load and every commit). The check is the checkpoint's own diff, so
  meta/History/settings-only changes still persist (they differ from the baseline), a store another program changed
  (generation) is still rewritten, and an `unlogged` change moves `seq`. Backups, the integrity test and Optimise (which
  checkpoint first) are no-ops on an unchanged catalog too.
- `snapshot_with_unlogged` no longer replaces a log that is already empty (no records, no bytes, file empty or absent): no new
  inode or mtime.
- `Journal::close_with_unlogged`, for the engine's close: a v4 library with a short log (below the policy mid-session
  compaction uses, 2,000 records / 16 MiB), nothing queued unlogged and no lost write only makes the log durable (`flush`) and
  leaves the store alone; otherwise it checkpoints as before (long log, unlogged changes, lost writes, JSON libraries). The
  next open replays the log to exactly the state at close; a crash after the close is the same state.

Readers of the store without the log, all checked: `Journal::backup` (checkpoints first and copies the log too),
`check_integrity` and `optimize` (checkpoint first), `upgrade_backup::keep_copy` (copies store, log and stub),
`transfer::load_readonly` (replays the log), `restore_db` (reloads the baseline only), the lazy `CatalogDb::read_photo` /
`page_ids` / `ids_where` (no caller outside the checkpoint's own tests), and the engine's rename/switch of a library (closes,
then moves or reopens the whole folder).

Tests (through `close_with_unlogged`, not `drop`): a no-edit close leaves every file's bytes, mtime and the log's inode (also
after a log tail); 200 mixed edits (ratings, keywords, keyword list, folder label, label name, albums, stack) then close leave
the store's bytes and mtime and grow the log, and reopening (and again after a crash-like reopen) gives the identical full
catalog state; a log past the threshold is checkpointed and reset; queued and head-only unlogged changes are still saved; a
settings-only edit reaches the next open through the log and then the store; backup+restore, integrity, optimise and an
import read see edits that are only in the log; a no-op checkpoint writes nothing. Each of the three mutants (always
checkpoint, no no-op test, always reset the log) fails them. Measured at 10,000 photos (the probe's method, synthetic records):
a no-edit close 0 KiB written and no mtime change (the probe: 40-48 KiB and a new mtime); 200 scattered ratings then close: store
unchanged, log +15,134 B (the probe: 1,376 KiB of pages and a new mtime).

Stored fields unchanged; no format bump. Manual: none (no page says what close does).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…k::top callers follow its Option

Engine part of the previous commit, small and checked with one `cargo check -p lcc-engine` (compiles; engine tests not run):
- `Session::close_library` calls `Journal::close_with_unlogged` instead of `snapshot_with_unlogged` (one line; the rest of the
  close, including the queued-ops bookkeeping after it, is unchanged).
- `Stack::top` returns `Option<PhotoId>` since CT-G15 (6a1a03216); the engine had two callers that commit missed (my earlier
  "no other caller" was wrong, found by this check): `cmd/convert.rs` compares with `is_some_and`, `cmd/organize.rs fix_active`
  takes the first visible member, else the top, else leaves the selection (no unwrap).

Manual: none.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ery change; a failed log write is still rescued

Review of bb267e48a (fix-review-close.md):
- HIGH: the short-log branch returned `flush()`, so a log write that failed after the last record was queued was never
  rescued by a checkpoint (the review's injected-failure probe lost the edit 150/150; before: 0/150). Any flush failure now
  falls through to `snapshot_with_unlogged` exactly as before (test with `FAIL_WRITES`, 20 libraries).
- MEDIUM: the skip was decided by "the log is short", so a catalog change with no log record was lost when the session also
  logged one. It is now decided by proof: `CatalogDb::log_carries_every_change` rebuilds the store's baseline, applies the log's
  records after the store's `seq` (in order, each must apply, the last must be the journal's `seq`) and compares the result with
  the live catalog as the store holds it (photos by `Arc` or by serialised record, collections, stacks, previews, remote links,
  flat-field maps, the head record with the id counters). Anything the log doesn't carry (any kind of persisted state, an id
  allocated and never used) makes the close checkpoint, so no marker has to be set by every setter. Tests: one per kind of state
  (rating, metadata, collection, collection photos, stack, stack members, label name, keyword list, browsed, folder record, saved
  location, preview, remote link, flat-field map) changed after logging a record, closed, reopened, compared; burned photo,
  collection and stack ids are not handed out again; queued (`unlogged`) changes beside logged records are saved.
- MEDIUM: an older `catalog.redb` restored over a log that holds records the store doesn't follow silently deleted the log. A
  well-formed record whose number is past the next one is now treated as damage: the log is kept as `catalog.log.damaged-<seq>`.
- Boundary tests (the review's 12 surviving mutants): `<` not `<=` on the records (49 / 50 / 51 records) and bytes (limit +1 / 0 / -1)
  limits, the seq check of the no-op checkpoint (a logged op that changes nothing still moves the stored seq), `stored_seq` kept after
  a commit, every term of the baseline comparison (previews, remote, stacks, albums, flat-field maps), the empty-log test reading
  the file. `unlogged == 0` and `lost == 0` are redundant with the strict check (commented), so their mutants are equivalent; the
  `tail_dirty` term is not reachable without a partial write. Mutants re-run: all others fail a test.
- LOW: `set_plugin_fields` with the index a photo already has is a no-op, and a photo whose only difference from the store is the
  in-memory plug-in index (not serialised) counts as unchanged, so a library with plug-in fields no longer rewrites its photos at
  close (test). `load_readonly` follows the log as `Journal::open` does: it stops at the first record that doesn't follow and
  counts it and the rest in `ReadReport::log_records_failed` (test).
- docs/catalog.md says what close does and that the catalog is `catalog.redb` plus `catalog.log` (copy the folder); the manual's
  Libraries page says so too.

Stored fields unchanged; no format bump. Manual: library/libraries.mdx.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ays what close now guarantees

- The fifteen test callers of `Stack::top()` (tests_organize, tests_merge, tests_xmp, tests_edit_in, tests_edit_roundtrip,
  tests_immich_sync, video/tests) compare with `Some(..)`; `cargo test -p lcc-engine --lib` compiles again (d55ba5971 had fixed
  only the two non-test callers). No other crate calls `Stack::top` (ui-egui's `.top()` are egui rectangles).
- `tests_library::close_writes_snapshot_and_view_state` pinned "a close empties the log"; it is now
  `close_saves_the_state_and_the_view_and_the_next_open_reads_it_back` (a short session leaves its edit in the log, the next open
  replays it and the state, selection and view are equal) with a long-log twin: a log at the compaction size is checkpointed by the
  close and left empty.

Manual: none.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…g cases are pinned

From fix-review-close-r2.md:
- MEDIUM: the skip path never checked that `catalog.redb` is the file the session loaded. `log_is_all_there_is` now also needs
  `CatalogDb::is_as_left` (the store's generation is the one held); a store replaced under the running app (an older copy, a
  restore, a sync tool) makes the close checkpoint, which rewrites it whole from memory as it always did. Test: the review's probe,
  the last edit survives and nothing is set aside as damaged.
- LOW: `unlogged == 0` is not redundant (a queued change that changes nothing leaves `seq` where it was, and the engine keeps its
  queue until `seq` has moved by `unlogged`): the guard stays, its comment is corrected, and a test (queued no-op, `seq` advances by
  `unlogged`) fails without it. (`lost == 0` only saves reading the log.)
- LOW: `load_readonly` follows the log with `journal::decode_line_or_resync`, the open's own reading of a line (a torn fragment and
  the record that retried it on one line included), so an import applies what an open replays. Test: three records, one a torn
  fragment plus its retry; the import and the open reach the same state.
- LOW tests: a stale tail (what a crash between a checkpoint and the log's reset leaves) is skipped by the proof; a log with a hole
  (records n+1, n+3, n+3) and a log that stops before the last appended record (a no-op) each fail the proof on their own check.
  Mutants re-run: generation check, `unlogged`, stale skip, `seq != next`, `last_seq`, resync: each fails a test.

Not changed (outside this round): the proof's cost order, exhaustive destructuring of the compared structs, the flush-error log line.

Stored fields unchanged; no format bump. Manual: none.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ase notes

The brand check (cargo xtask brand check, in ci --quick) rejects the legacy product
name outside the allowlist: two doc comments in crates/catalog and the two
release-note files (names and text) said it. Reworded to "legacy library"; the
notes files are renamed to match.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The web build's check (cargo xtask wasm, in ci --quick) failed for lcc-catalog and every crate that
depends on it: Journal::log_is_all_there_is called the v4 store's methods, and on wasm32 the store slot
is Option<()>. The web build keeps no v4 store, so the proof is false there and the close checkpoints, as it
always did. transfer (native-only) is the only reader of decode_line_or_resync and repair_structure, so
they are allowed to be unreached on wasm32 (as progress is).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…mple is refused before it is sized

decode_compressed sized `out` and looped over the header's width x height before looking at the stream, so a file of about
100 bytes naming 2^30 samples took about 2 GiB and tens of seconds (also in header mode when the Exif CFAPattern is
missing). Each sample takes at least 6 bits (3 head, the terminating one, the 2-bit magnitude floor), so a stream shorter
than that is Corrupt. Tests: the hostile header (direct and through a file, both modes, with a time limit) and the 6-bit
boundary (exactly enough, one byte short).

Manual: none, no user-visible change beyond the error.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…s and plug-in fields (third review)

Depth. The walk over a smart album's rules now counts only smart albums toward the depth (a collection set is no step of evaluation; a separate path
stops loops through sets), and takes a base from the caller: the smart albums on the evaluation's stack where the rules are evaluated (one more for an album's
own rules than for a filter's), so a reading made inside an evaluation (a collection inside a set asked on its own) continues the outer count instead of
restarting, and the view of a collection no longer counts the album twice. At 30, 31 and 32 levels the list, the grid view, the count of the view, the sidebar
count (one album and the tally) and one photo at a time give the same answer; a ladder with a set at every level lists on every path as long as evaluation
itself is within its depth; an isn't of an album that evaluation cuts is unknown, not everyone.

Tally. The sidebar count's remembered answers follow smart albums through the sets they test (chain_heights), and AlbumTally/FilterTally keep the plug-in number
fields' generation they were made under: update() declines (so they are made again) when it moved. The setting is the test thread's own in tests, so the tests
that change it can't change it under tests running beside them.

Also: a plug-in text rule with a yes/no value reads the field's text again (`done is true`); smart-album rules nested more than 64 groups (MAX_RULE_NESTING) are
refused by validate_rules, with an iterative RuleSet::nesting, so the walks (recursive on the nesting) cannot run out of stack on a replayed or direct op.
The comments on the branches that evaluation makes unobservable (a gone album field, the walk's depth cut, Reading::False) say so. New tests_random_worlds.rs:
4000 seeded random worlds (plain, gone, set, nested, smart albums, own album field, legacy operators, a trashed photo) against an independent three-valued oracle
over every way of asking.

Tests fail without their fix (checked by mutation): sets counted as depth, base ignoring the evaluation, base off by one for the view, chain_heights ignoring sets,
tally ignoring the generation, bool text, no nesting cap (aborts), a polarity mutant (random worlds). Docs: the stale changelog line, the manual and What's New say
"unless another rule settles it". Left open: Edit Smart Collection's mark for nested-unreadable albums and junk Memories days, and valid_month_day's duplicate in
the engine.

Manual: library/collections.mdx

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ames is refused

A CRX band without data is all zero (as LibRaw), and the zero planes are sized from CMP1 width x height, bounded only by
200 M samples: a 108-byte header naming 14142 x 14142 reserved about 1.2 GiB (3 GB with three wavelet levels) and
returned a flat picture. decode and validate now require count <= 4096 x coded bytes + 65,536 (the TIFF path's rule,
generously). Tests: the hostile header (lossless and three-level) and the exact boundary of the rule.

Manual: none, no user-visible change beyond the error.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…can hold is refused

parse_tile_table bounded only w x h to MAX_SAMPLES (2^30) and the 32766 arm skips check_image, so a strip of about 1 MB
naming 8192 x 131070 samples (an all-zero residual line costs a few bits per thousand samples) forced about 10 GB of
retained lines, band planes, reconstructed planes and output. decode now caps the image at 200 M samples (the biggest
Sony sensors are about 100 MP) and requires each tile to hold data in proportion to the samples it claims (256 per byte
plus 2^20, 30 times looser than the cheapest real picture), in both header and full modes. Tests: the hostile table
(2^30 samples, and 134 M with no data) and the exact boundary of the rule.

Manual: none, no user-visible change beyond the error.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
read_quad_tiles kept going past a tile that failed to decode and returned Ok when any tile worked, leaving the failed
regions zero (black) with no signal; its sibling read_ycbcr_tiles returns the first error. Both now do. This changes a
tolerant behaviour: a truncated or partly corrupt lossless ARW is no longer opened (nothing marks a decoded image as
partial). Test: every tile of a four-tile file corrupted and moved past the end of the file in turn.

Manual: none, no user-visible change beyond the error.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…r of the data it claims

The table-less packed NEF reader sizes its layout from the strip length the file claims and leaves missing rows black
(deliberate salvage of a card pulled mid-write), so a 600 KB file naming 32768 x 32768 12-bit samples opened as a
black 2 GiB picture (check_image's 2048:1 bound passes 2^30 samples from 512 KB), and tiffraw's uncompressed rule was
one sixty-fourth. Salvage now applies in full up to 256 MiB of claimed data (a 100 MP 16-bit sensor); above it a
quarter must be present. Tests: the 600 KB hostile NEF (fails without the rule) and the exact threshold. The existing
truncated-strip tests (60 of 360 bytes) are unchanged.

Manual: none, no user-visible change beyond the error.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
normalized allocated vec![0f32; w*h*cpp] (and the OpcodeList1 float copy) before develop()'s Rgb32f::try_new guard, so
a decoded image near MAX_SAMPLES (including the zero-filled ones the size checks above now catch earlier) aborted in
the allocator on a machine with under about 10 GiB free. Both are try_reserve_exact now, returning the same Limit
error develop gives. Test: an unsatisfiable length is a Limit.

Manual: none.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…bIFDs values

walk_tiff capped each IFD (8192 entries, 4096 child values) and the pending queue, but zero or repeated child values are
never queued and overlapping directories are cheap to make, so the product (1024 x 8192 x 4096 = 3.4e10 steps) was
unbounded in practice; lcc_tiff has a 65,536-entry total. The walk now refuses, as the pending-cap case does (the plan
then reads the whole file), after 65,536 entries or 65,536 SubIFDs values in all. Tests: both budgets at their exact
boundary (16 vs 17 entries of 4096 values; 8 vs 9 directories of 8192 entries).

Manual: none.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…annot overflow; ORF field_rows reserves nothing up front

srw::decode made vec![0; n] and then the three compressed decoders each made another w x h buffer, all before reading a
byte (about 4 GiB peak for 32768 x 32768 and a 100-byte strip, also in header mode). A compressed strip must now hold
data in proportion to its samples (1024 samples a byte plus 2^20, far looser than the cheapest coding), and each coding
makes one buffer. srwc::decode_v2's pred + diff * (mag * 2 + 1) + mag is i64 (it overflowed i32 for a row of 2^21
columns). orf::field_rows no longer Vec::with_capacity(h + 1)s from the header before the strips are checked against the
file. Test: the hostile SRW (both compressions, both modes) and the exact boundary of the rule.

Manual: none.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2^30 u16 samples are 2^31 bytes, past isize::MAX on wasm32, where Rust panics with 'capacity overflow' (panic = abort
in the web profile) instead of failing the allocation; f32 copies fail above 2^29. Test: every buffer built from the
cap is a legal allocation, and a 100 MP sensor still decodes.

Manual: none.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… refuses a category over 16 and a second SOF3 replaces the first

crw::decode_stream floored its block count (w not a multiple of 8) and returned Ok with the tail zero, never checking
that the blocks covered w x h. ljpeg::Scan::decode took a Huffman symbol of 17..=255 as a 16-bit difference, which the
subsampled path and the two-component path already refused. parse_header kept the first SOF3's components when a second
arrived, so nc could pass the documented four. Tests: a 12 x 8 stream (and the exact 8 x 8 control), a DHT patched to
symbol 0x20 on the interleaved path, and a doubled frame header. Not done from the review: cr2's [n, w, 0] slice tag
(real files may rely on treating zeros as absent), vc5's loose per-band bound.

Manual: none.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ted copy apart

render_impl replaced the resampled image with its film-dusted copy and cached that as CacheEntry.sampled, found by
geo (frame, w, h), which does not include the film dust settings: after Film Dust was turned off or changed, a cached
render took the already-repaired pixels as the plain resample. CacheEntry gets a separate dusted slot keyed by
film_dust_key (the infrared plane, sensitivity, expand), memory accounting included. Test: on / off / on / off through
one StageCache equals the uncached render of the same settings (fails 169 vs 38 on the old code).

Manual: none.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… a source

plan() fixed source_offset for every spot without one when a window was rendered (so the window would not choose from the
pixels it happens to hold), Remove spots included; spots::synthesises needs source_offset.is_none(), so the spot stopped
being a content-aware fill and healed from a picked source, while the whole render and the export (and the GPU's
lin_needs_cpu gate) kept the fill. Only spots that copy from a source are given one now. Test: a Remove spot's window
against the whole render (max 235 on the old code, 8 allowed), checked against the heal it used to become.

Manual: none, no user-visible change beyond the fix.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…r at every output depth

plan() grew the rendered window for these effects only when req.depth == U8 ('only 8-bit renders are cut back'), but the
deep path crops with plan.keep as well (since the joint colour NR and Glow), and the GPU cuts deep windows back too, so a
zoomed HDR or 16-bit window read nothing past its edge for them. The depth condition is gone. Test: a Clone spot whose
source lies outside a 16-bit and an HDR window matches the whole render (fails with the 8-bit-only growth).

Manual: none.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ttings arrive as JSON

keep_in_range clamped global controls, curves, HSL curves and levels but nothing inside masks[]: exposure 1e30 (or 1e300,
inf in f32) reached exp2 in the finish stage, 0 x inf is NaN, so the area rendered black and F32Linear exports held NaN;
a mask curve point at 1e300 made the curve LUT NaN. LocalAdjustments::clamped is the engine's clamp_local moved to
develop (mask.adjust now calls it), applied to every mask's adjustments, curve points and mixer bands in keep_in_range
(from_untrusted_json and merged). Tests: extreme masks through both entry points, and each limit exactly.

Manual: none (the limits are the Mask panel's).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The editor gives HSL Curves its own section with an eye (develop.sectionEnabled 'hsl'), but effective() had no 'hsl'
branch (hsl_curves are not controls, so no reset_section clears them, unlike point_colors), so the curves rendered on the
CPU and the GPU with the section off. effective() now clears them (borrowing as before when there are none). Test: on,
off (stored curves kept), and no clone without curves.

Manual: none.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…orking

The EXR path hands samples through unsanitised (the 8-bit codec path clips them in normalize_float), wb_gain's max(0)
removes NaN but keeps +inf, log_lum returns +inf, and the running sums of box_row/box_v then give inf - inf = NaN that
stays in the rest of the row and column through guided_fast, gaussian and tone_base: Highlights/Shadows, Clarity, Texture or
Dehaze blacked the lower-right quadrant of one +inf pixel (and F32Linear export would write the NaN). to_working now maps
+inf to 65504, NaN and -inf to 0 for float sources, and a NaN alpha to 0. Tests: a decoded EXR with inf/NaN pixels (all
finite out, +inf bright, finite samples untouched) and a NaN alpha.

Manual: none.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
quality::compression_luma looks for steps on a hard-coded 8-pixel grid of the 512 px luminance copy, where a source
scaled by 512 / long edge has its JPEG grid 8 x that wide, so a 4000 px JPEG's blocking is mostly invisible to it.
For photos over 512 px QualityFactors::measure now reads up to 256 evenly spread rows at the photo's own resolution
(native_compression); factors_from_luma, for a plane measured on its own, is unchanged. Test: a 1600 x 1200 picture of flat
8 x 8 blocks scores under 30 (the old measure gave 67), a smooth ramp and the same steps shifted off the grid score over
95, and a raw photo is not measured.

Manual: none.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
depth_model::depth returned before caching when the model gave None, an unusable grid or panicked, and lens_blur::resolve
calls it from every plan(): every render re-ran the failing inference under the global BUSY lock. The cache now keeps a
failure (with its time) beside a grid, and takes it for 30 seconds (not for good: the failure may be a busy device);
set_depth_model still clears everything. depth_with takes the model, so the test uses its own and leaves the installed
one to the tests beside it. Test: five renders of a failing model run it once; another photo is its own question; a
working model's grid is cached. Not changed from the review: the key is the pixels and frame, not the photo's identity.

Manual: none.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…re placed on

recolor::measure_pass rendered its proxy with RenderRequest::fit (apply_crop true: the cropped part) but built the
white-balanced proxy and the mask alphas from the plan's whole_frame, which is uncropped when the request is (the crop
tool's view): alpha pixel i was paired with colour pixel i of a different region, squeezed, so the area's hue, lightness
and chroma were wrong while the crop tool was open. The proxy request now takes apply_crop from the frame (cropped or
not). Test: a photo cropped to its blue half with Recolor on its red half, rendered uncropped, recolors the red (it did
not move at all before).

Manual: none.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e9 pixel visits)

MAX_STROKE_DABS bounds the number of dabs, not the area each covers, and BrushStroke.size has no bound: 100,000 points of
size 0.5 on 24 MP are about 10^12 pixel visits in stamp_dabs_with, with no cancel point, and the legacy path lays a dab at
every sample point however close. stamp_step counts each dab at its full unclipped disc (so a zoomed window thins exactly as
the whole frame does) and, over MAX_STAMP_WORK (4e9, a few seconds), keeps every k-th dab and the last. Strokes inside the
budget are unchanged. Test: the step at its exact boundaries (1 / 2 / 7), and a dense 20,000-dab flat stroke thinned 50x covers
what the whole one does (within 0.1) in seconds. Not done from the review: a size clamp (a settings change), a cancel check.

Manual: none.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1234destiny1234 and others added 21 commits December 4, 2026 07:50
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…acing it

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…roid

Recognition kept a trained person out of the gallery (their face was
skipped or swapped for the centroid), so a face named after training
never counted, `mode: rebuildNamed` handed a prototype to anyone named
in scope, and a trained person was scored on one centroid while everyone
else was scored on the mean of their best faces — two different scales
for one threshold.

`face_gallery.rs` is now the one place that says which faces recognition
matches on: a person's confirmed faces, narrowed to the ones their
training chose, widened by the faces confirmed since, minus the ones it
left out. A prototype whose faces were renamed, moved or removed since
is `stale`, and that person's faces are used as the library holds them.
Everyone is scored the same way; the centroid stays as the summary and
as the fallback when a person's embeddings are gone.

- face_prototypes: persist each person's `excluded` faces and decide
  staleness from the faces the library holds (`is_current`)
- face_recognize: `similar()` and the scan gallery read `face_gallery`;
  `faces.trainPrototypes` takes `merge` and reports `excludedFaces`;
  `faces.prototypes`/`faces.person` report `excluded` and `stale`;
  `rebuildNamed` re-embeds only already trained people's faces; a photo
  that will not open no longer fails the whole training
- person page: a Stale badge (and what to do), how many faces are left
  out, and Train Prototype on one face adds it (`merge`)
- tests: a face named after training counts at once, a moved face
  leaves and marks the prototype stale, a trained and an untrained
  person score alike (and not like their centroid), a rebuild trains
  nobody new, `merge` adds instead of replacing
- docs, What's New, changelog, parity and 17 fork catalogs (4 messages)

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…per page

`rebuildNamed` now re-embeds every named face in scope (a model or alignment
change makes all of them stale) and narrows only the prototype plan to the
people who were trained already, so an untrained person's face is refreshed
without gaining a prototype. Covered by a new test.

`faces.person` builds the recognition gallery once and hands its staleness to
the prototype summary, instead of walking the library twice.

`excluded` is documented as capped like `samples`: past the per-person cap the
faces beyond it are forgotten and count towards matching again.

fixes #1886

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
The person page now uses the single-gallery path; keep the standalone
similar wrapper only for focused unit tests to avoid dead-code warnings.

fixes #1886

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…lk::skipped, singular folder count

Review fixes for #1880: the export.importPresets description and the changelog no longer say a
folder with non-preset files gets a failed row (it gets none); FolderWalk loses the field nothing
read, and a folder with only skipped files no longer gets an entry; the unreadable-folder row says
"1 folder inside" rather than "1 folders inside".

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ft-classic

#1886: train face prototypes from the people you named
…tead of wording

Follow-up to #1871 (review by Andrew): add What's New entries for the sidecar settings report
("Saved settings not fully read") and the refused .cube range keywords. The Unavailable test in
lcc-gpu checks each kind shows its reason, agrees with its constant and reads distinctly, not the
literal text; the tiffraw past-the-end test checks the error names the offset and file length, not
the whole sentence; the .cube test drops the equality on RANGE_KEYWORDS and checks that the
keywords real files use are refused.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Follow-up to #1885 (review by Andrew): the comparison counter the purge test bounds was a field and an
increment in release builds too. It is now #[cfg(test)], so a release has neither the field nor the
write on every bisection step. No behaviour change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Catalog: UsedKeywords::probes exists only in test builds
REVIEW3 nits: What's New entries, and three tests assert behaviour instead of wording
…ms-strict

Export presets: a wrong-typed dryRun, names or paths is refused, and a folder import reports what its walk left out
…est a broken one are marked

A collection set reported 0 from album_count (and so library.albums) while its list and grid showed photos; it now counts the photos of the collections in it, each once, trashed photos left out. The sidebar tally keeps no count for a set. A smart collection that tests a smart collection whose rules need fixing, or whose On This Day settings can't be read, is marked in the Collections panel and in library.albums problems; Edit Smart Collection is unchanged. The engine's copy of the On This Day day check is replaced by the catalog's.

Manual: library/collections.mdx.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Deleting a collection returns the smart collections that stay and tested it (smartCollectionsAffected) and the Collections panel names the first three in a toast with Undo. The Import from Another Catalog window shows what could not be read, what changes could not be applied and what names a collection held that are in neither catalog (readLeftOut, readEventsFailed, droppedTotal, with read and dropped). Test Integrity returns what a repair would change in the catalog as opened (inconsistencies, never changed) and the passed message says so. The new UI text is in all 17 languages.

Manual: library/collections.mdx.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
emmertex and others added 2 commits December 5, 2026 01:11
…--quick

`tests_gpu_text.rs` reads the checklist's LR-BEHAV-GPU row with
`include_str!`, so `ci_quick::tests::embedded_files_are_mapped` failed
the full run on all three OSes (Nightly 47266919996). A change to the
checklist now counts as a change to lcc-engine.

Manual: none, no user-visible change.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- Translate "Face Prototypes" and "Clear Face Prototypes" (the
  `faces.prototypes` / `faces.clearPrototypes` command labels) in all 17
  fork catalogs, using each language's existing "Train Face Prototypes"
  wording (`no_language_has_translation_gaps`).
- What's New: the face-prototype entry used an em dash
  (`ui_text_has_no_em_dashes`); a colon now.
- `a_trained_person_and_an_untrained_one_are_scored_the_same_way` gave
  each person two identical faces, so the person's centroid was that
  face and the test's last check (scored on faces, not the centroid)
  could never hold. Each person now has one of either face, as the
  test's own comment describes; the code under test is unchanged.

Manual: none, no user-visible change beyond the two translated labels.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ests

NIGHTLY-2026-12-05: fix the four tests failing the staging → main batch
Catalog: set counts, marks for broken nested collections, delete and import say what they leave out
@emmertex
emmertex merged commit 479ae46 into main Dec 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants