Skip to content

Tier 2: bundle of open upstream PRs (hot pixels, Fujifilm recipes, mask curves, keys, GPU robustness) - #256

Merged
emmertex merged 39 commits into
mainfrom
upstream/tier2-bundle
Oct 17, 2026
Merged

emmertex merged 39 commits into
mainfrom
upstream/tier2-bundle

Conversation

@emmertex

Copy link
Copy Markdown
Owner

Bundles the open "Tier 2" upstream PRs (features and robustness) into one PR. Each upstream PR's own commits are cherry-picked with -x (merge commits inside a PR skipped), followed by a port commit for each that renames to the lcc_* crates, LccApp and lcc_brand env helpers and fits the change into the fork's Classic UI.

Upstream PR Author What it brings Status
storytold/lightcraft#1350 @PiMinusMax Detail: Remove Hot Pixels, a mosaic outlier filter, on for newly imported raws (#1345) included. New RawImage fields filled in, file loaders take the third outliers argument everywhere, and LIGHTCRAFT_PROFILE now reads through lcc_brand::env_is_set("PROFILE")
storytold/lightcraft#1209 @MohammadTeimori Fujifilm film-simulation settings (film recipe) from the MakerNote, with photo.fujiRecipe included. The recipe card and Copy recipe sit in the fork's Metadata panel (panels/metadata.rs), not upstream's Info card
storytold/lightcraft#2065 @helgehelge123 Hold Space over a tool to pan and click-zoom, as in Lightroom (#1895); a held Space toggles only once included, with one change. Crop is left out of the Space hand: the fork's crop view always shows the whole photo and never zooms, so upstream's crop test was dropped
storytold/lightcraft#1822 @bitshiftza Shift+P picks and advances in every view (fixes #1707); Presets loses its default key included. The fork's grid-only Shift+P handling and its "Presets (Shift+P)" hints (strip, Classic presets column, menu) are removed. KEY-PRESETS is now 🟡 (upstream's own rating)
storytold/lightcraft#1917 @marcoarnulfo Backslash shows and hides the Filter Bar in the grids partly: tests only. The fork already binds \ as a Library module key (module.rs LIBRARY_KEYS). Upstream's grid_key_command remap would have toggled the bar twice, so it is left out. One test is adapted: with Show Original moved to another key, \ stays the Filter Bar key in Library
storytold/lightcraft#1856 @switch87 Crop: save, name, reorder and delete your own aspect ratios, and hide built-in ones (#1854) included
storytold/lightcraft#2014 @marcoarnulfo Favourite presets listed first in a Favorites group (#1999) included (chosen over #2017, see below). The group uses the fork's remembered folding (group_is_open) and starts open
storytold/lightcraft#2017 @helgehelge123 The same feature, plus a clickable star on every preset row left out: it duplicates #2014
storytold/lightcraft#2111 @helgehelge123 A Curve in every mask (RGB / R / G / B, CPU and GPU, presets shared with the Tone Curve) (#1932) included. CurveTarget is merged into the fork's Tone Curve editor, so the parametric drag and graph stay for the photo. The GPU still steps aside for pixel-filter plug-ins
storytold/lightcraft#1848 @bogusyogi GPU: renders queue for device memory; running out of memory never retires the GPU (#1764) included
storytold/lightcraft#1984 @lincleejun GPU: a lost device is not polled again, and a poll that panics fails only that render (#1858) included
storytold/lightcraft#1970 @LochLogic Control port: a per-run token is required before any request (auth), plus #1991's single-stream serving included. TOKEN_ENV became control_auth::token_env() / env_token() (<PREFIX>_CONTROL_TOKEN with the legacy fallback). getrandom was added to apps/app. docs/showcase/run.py reads its prefix and settings folder from brand.toml. Reconciled with the fork's #1991 from #254 (see conflict notes)

Not included: #2092 (it will be done separately). #1901, #1384, #673 and #672 are already in the fork from #250.

#2014 or #2017 (favourite presets, upstream issue #1999)

Both add a Favorites group above the preset groups, built in grouped(). #2014 was chosen for four reasons:

  • It is the smaller change. It stays inside the Favorites group: its own ids (presetFavorites, presetFav:<id>), no Export Group… and no Move to Group target, and its label goes through tr("Favorites"). #2017 marks the group builtin: true to get it translated.
  • It comes with a headless UI test (tests_preset_favorites.rs) as well as the unit test.
  • #2017 also turns part of each preset row into a star button, found by pointer position inside the row. That adds a second click target to a row without an accessible name of its own. The context menu already offers Add to / Remove from Favorites.
  • #2014's group ids could not clash with a user group called "Favorites", and it fitted the fork's Classic preset folding with a one-line change.

Conflict notes

  • Classic UI: the film recipe goes into the fork's Metadata panel. The mask Curve reuses the fork's Tone Curve editor (ParametricCurve and param_drag are kept). The favourites group uses app.ui.group_open. The Space hand skips Crop. The preset hints lose "(Shift+P)".
  • Control port: fork User-facing bug fixes: bundle of open upstream PRs #254 brought its own #1991 (serve_lines(&stream, &stream)). This PR keeps upstream #1970's serve_stream + close_gracefully with the token check, and keeps User-facing bug fixes: bundle of open upstream PRs #254's test that a program started meanwhile doesn't hold the connection open (now authenticated). lcc-cli --connect and lcc-cli mcp --connect both go through lcc_mcp::Remote, which sends the token from <PREFIX>_CONTROL_TOKEN or <settings>/control-token-<port>, the file the app writes.
  • Docs: short docs/parity-checklist.md updates: new LR-EDIT-DETAIL-HOTPIXELS and LR-MASK-CURVE rows, notes on LR-CROP-ASPECT, LR-PRE-PANEL, LR-META-EXIF-FULL, LR-BEHAV-GPU, KEY-TOGGLEZOOM and KEYC-RATING, one changelog line, and a regenerated summary. Upstream's whats-new.md entries were not carried over. No upstream-only CI or packaging files came along (apps/lightcraft/Cargo.toml was dropped).
  • i18n: "Remove Hot Pixels", "Film recipe" and "Copy recipe" are translated in the fork's locale overlay (locales/fork/*.json).
  • Render cache / look version: no bump. Hot-pixel removal is a develop setting (detail.nrOutliers), so the settings hash already keys it. Empty mask curves are not serialized, so existing hashes are unchanged.

Tests

  • cargo clippy --workspace --all-targets -- -D warnings: clean
  • cargo fmt --all --check: clean
  • cargo xtask brand check: OK
  • cargo xtask docs --check and cargo xtask parity: OK
  • cargo test -p lcc-ui-egui --test '*' (accessibility included): pass. tab_walks_the_right_panels_top_to_bottom now finds the strip by its "Presets" name.
  • Targeted tests, all passing:
    • lcc-raw hotpixel
    • lcc-meta / lcc-engine fuji, curve, crop_aspects, control_auth
    • lcc-pipeline local_curve
    • lcc-gpu, all tests, including mask-curve equivalence and OOM / lost-device fallback, on a real GPU
    • lcc-app control_server
    • lcc-cli connect
    • lcc-ui-egui space_hand, shortcuts, filter_bar_key, crop_aspects, preset favourites, tests_curve, i18n
    • full lib suites of lcc-engine, lcc-pipeline, lcc-develop and lcc-meta
  • Already failing on origin/main, and not changed here:
    • lcc-ui-egui lib: tests_folder_drop::local_photos_are_refused_with_the_reason, tests_panels::sidebar_sections_collapse_and_remember_it, tests_panels::local_photos_cannot_be_added_to_albums_until_they_join_my_photos and headless::tests::a_persons_page_shows_their_faces_and_back_returns_to_everyone, checked on an origin/main worktree.
    • lcc-mcp backend::tests::{valid_replies…, malformed_replies…} fail on Windows when the whole lib suite runs, on main too (connection reset). They pass when run alone.

🤖 Generated with Claude Code

PiMinusMax and others added 30 commits October 17, 2026 22:35
Noise model fitted to the image, candidates 5 sigma above every same-colour neighbour, kept when two or
more direct neighbours are lit (real light); adjacent hot pairs are replaced too. LIGHTCRAFT_HOT_PIXELS=0
turns it off, LIGHTCRAFT_HP_DEBUG=1 prints statistics. Renders are cached apart from older ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 59c23372e28a41c804ae5b93e5141d2395a37282)
…rns it on)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit cac3857ed20881941409603f9881941f8045a931)
…arison switch (merged upstream)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 03aec0f01f6e457dac5155df4166d87d895265df)
…_SPOT knobs), statistics under LIGHTCRAFT_PROFILE

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit fefc51747fce1d6377479901d6beca422ee1f638)
…osaic before demosaicing. It is

true in `DevelopSettings::for_raw` and false by default, so edits saved before the box existed keep
their look. The loaders take the flag (no more `LIGHTCRAFT_HOT_PIXELS`), a decoded source records
it, and a cached raw source decoded with the other setting is decoded again. The box shows for raws
only (`check:detail.nrOutliers`).

(cherry picked from commit 56ffdb547b9ff1ed5d3572507c17f8b7e649a3ef)
… three-argument file loaders, lcc_brand PROFILE env

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A RAF or JPEG can be inspected without changing pixels, so the Info panel and photo.fujiRecipe can show the in-camera recipe.

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit ca1950aceeccc24a6be75db3db9755d26a1935c3)
A stored tone of 24 is −1.5 on the camera dial, not an unknown code.

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit e9c22607f5a0c730cd047de6e384cd8ffc3d483d)
… recipe card sits in the fork's Metadata panel

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With Crop, Masking, Remove, Red Eye or a picker on the photo, a held
Space lends the pointer to the view until the key is up, as Lightroom's
temporary Hand / Zoom: a click zooms to the click-zoom ratio at the
point clicked (or back to Fit), a drag pans the zoomed photo, and the
tool gets neither. A tap (under 0.4 s, no click) still toggles the zoom,
on its release. Space's auto-repeat no longer toggles the zoom again.

ui.key takes action press|down|up so a script can hold a key over a
ui.pointer drag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit f296a6fb936d64c68385da3dd490bdf631dc5c55)
…ut of the Space hand (the Classic crop view is never zoomed)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…its default Shift+P (#1707)

(cherry picked from commit f90becab2632d0c3ea5cb52f04a3885c76d6fc83)
…d strip lose the Shift+P hint; lcc names

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ows and hides the Filter Bar in the grids

The fork already has this key as a Library module key (crates/ui-egui/src/module.rs, LIBRARY_KEYS),
so upstream's grid_key_command remap is left out (it would toggle the bar twice). Its tests are
kept; a remapped Show Original leaves backslash as the Library's Filter Bar key here.

(cherry picked from commit 77b6c222427ef4eb79ca02c778def26720efec75)

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

Failing tests first: crop.aspects lists the built-ins, crop.saveAspect adds
named ratios without a limit, crop.moveAspect / crop.deleteAspect reorder and
remove them, crop.hideAspect hides built-ins (not Free / Original), and all of
it persists in prefs.json, sanitized on load.

(cherry picked from commit 166a0933f05c4035ed6d07bdcca57d13908c5961)
… and crop.aspects (#1854)

The crop tool's own aspect ratios live in the engine next to the point-curve
presets: named, unlimited, in the user's order, with built-in ratios that can be
hidden (Free and Original always show). Saved in prefs.json; a hand-edited file
loads only what the commands would accept.

(cherry picked from commit 25be657872303bb48397db04acb9b62f49818baa)
…spect menu (#1854)

(cherry picked from commit 9d7a2242f605aaa9e421abc79a862fc090793a3e)
…our own ratios (#1854)

The Custom row gets a Name field and Save: the ratio is kept in the menu under
that name and applied. Saved ratios are listed below the built-ins, and the
aspect button shows a saved ratio's name. Edit List turns the menu into one to
reorder (up / down) and delete saved ratios and to hide built-in ones (Free and
Original always show); the menu stays open while editing and closes when a
ratio is picked. The Custom fields move to TextField.

(cherry picked from commit efd1811683a41325b7d96cb76b8058096b7d397c)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…as profiles are (#1999)

(cherry picked from commit b4bfe3ae360304c4379f34724d6743a38282bb9b)
…the Classic panel's remembered folding and starts open

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A mask now has point curves of its own (`Mask::curve`, master + red /
green / blue as in the Tone Curve, no parametric part). The per-pixel
stage applies them after the photo's Tone Curve, on the same encoded
values, mask by mask in list order, each weighted by the mask's alpha:
e + a * (curve(e) - e). Feather, Amount, Invert and combined components
are all in that alpha already.

The curve is not written while it has no points, so masks without one
keep their JSON and every cached preview its hash. A linear curve renders
bit-identically to no curve. `local_curve_luts` builds the tables for the
CPU and, next, the GPU kernel; until the kernel has them, renders with a
local curve are not tried on the GPU.

Part of #1932.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit ede40c071fdd6fa9070570ff13eaf16f81ea3629)
`finish_block` uploads one slot per mask (its table set, or -1) after
the mask terms, then each local Curve's three tables, built by the same
`local_curve_luts` the CPU uses; the kernel applies them after the Tone
Curve, mask by mask, weighted by the mask's alpha, as the CPU does.
Renders with a local Curve no longer fall back to the CPU.

`CURVE_N` is now the pipeline's `CURVE_LUT_N`, so the table size can't
drift. Equivalence: a "masks (local curves)" case (RGB + blue curve on a
feathered radial, a mask without a curve between, red + green curves at
60 % Amount on an inverted mask) matches the CPU within 1 LSB, and a
test checks the curves change the GPU render.

Part of #1932.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit feb5bf4fcb8fa86fe6e05eacd60d6f0c06dc4b7f)
`develop.curve`, `curve.reset`, `curve.presets`, `curve.applyPreset` and
`curve.savePreset` take an optional `mask` (a mask id): they then work on
that mask's local Curve instead of the photo's Tone Curve. The channels
are the Tone Curve's point channels (no parametric curve); the presets
are the same, so a curve saved from a mask applies to the Tone Curve and
the other way round. An unknown mask, a channel a mask's curve doesn't
have, or a `mask` that isn't an id is an error and changes nothing.

`CurvePreset` gets `from_points` / `apply_points` / `matches_points` on
`PointCurves`; the Tone Curve versions go through them.

Tests: the commands on two masks (one undo step each, the other mask and
the Tone Curve untouched, presets both ways, resets), and the XMP sidecar
round trip now carries a mask's curve.

Part of #1932.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit ae7dd2267fb91ba373b0b4227f7453c6a27c8736)
The Tone Curve's editor now takes a `CurveTarget`: the photo's Tone
Curve, or one mask's local Curve. For a mask it shows the RGB, Red,
Green and Blue channels (no parametric curve, Refine Saturation or
targeted adjustment), sends the curve commands with `mask`, and keeps
its channel apart from the Tone Curve's (`mask_curve_channel`). Its
widgets are `maskCurve…` (`maskCurve`, `maskCurveChannel:red`,
`dropdown:maskCurvePreset`, `button:maskCurveReset`, …). The Masking
panel opens it from a Curve flyout after Blacks.

UI tests: the flyout shows the mask's editor without a parametric
channel; a drag adds a point to the mask's curve in one undo step and
leaves the Tone Curve; a double-click resets one channel; the preset
dropdown applies to and saves from the mask; Reset clears its curve.

Docs: LR-MASK-CURVE (new, ✅) in the parity checklist, notes on
LR-MASK-SLIDERS and LR-MASK-EFFECTS (effects don't keep the curve yet),
gpu-pipeline.md and What's New.

Closes #1932.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit d5f7e1f71f912431e3195c31231d1949600e13fe)
… fork's Tone Curve editor (parametric drag kept for the photo); GPU still steps aside for pixel-filter plug-ins; lcc names

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… GPU (#1764)

wgpu hands back an invalid buffer when create_buffer runs out of memory. Dropped, it went
into the shared free pool or the shared source; another thread's render reused it, failed
with "Buffer with '' label is invalid" (a validation error) and retired the GPU.

- Each fresh allocation (buffers, uploads, readback staging) runs in its own out-of-memory
  error scope: the render records OutOfMemory and gets a placeholder, so no invalid buffer
  is pooled or shared. Uploads create the buffer unmapped and fill it through the queue.
  A failed upload is never cached as the shared source.
- budget.rs: a fair (FIFO) weighted semaphore over device memory; a lone render always
  runs. wgpu reports no memory size, so the budget starts at max(1.5x the largest buffer,
  1 GiB), halves on out of memory and grows back by a sixteenth per success. Waiting ends
  at shutdown.
- A render that still runs out is retried once with the device to itself before the CPU.
- Fault::OutOfMemory simulates it; unit tests cover the budget, fallback.rs the retry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit a36af3961ec482363de4d49d90522ea30baf9498)
…the render (#1858)

Once a Vulkan or DX12 device is lost, wgpu 30 panics in `Device::poll`
instead of returning an error: the device error is not a `PollError`, so
`wgpu_core.rs` hands it to `handle_error_fatal`. The readback assumed the
wait would fail. A render whose readback found the device lost panicked
(caught by `try_render`), and while it unwound, a buffer going back to
the pool polled again from a destructor (`Gpu::trim`). That second panic
aborted the app ("panic in a destructor during cleanup"), as in the
reporter's logs on an Intel UHD 620 under Vulkan, each time a merge lost
the device.

The render device's three polls (the readback, `trim`, `sync`) now go
through `Gpu::poll`, which stops polling a lost device (the device-lost
callback, or a poll that panicked) and turns a panicking poll into an
error that retires the GPU. The render then fails over to the CPU and the
app keeps running. A GPU retired for another reason (a validation error)
keeps a live device and is still polled, so its pooled buffers are freed.

Regression tests run in a child process (they lose the device):
- `a_poll_on_a_lost_device_neither_panics_nor_aborts`: polls panic as
  wgpu's do on a lost Vulkan device; a readback, then an unwinding render
  whose destructor trims the pool. Before the fix the child aborts with
  SIGABRT and the log line above.
- `a_really_lost_device_is_not_polled_again`: a Metal device really lost
  (4200 unsubmitted command buffers, past wgpu-hal's 4096) is not polled
  again. Before the fix the poll still reaches wgpu.
- `a_retired_but_live_device_is_still_polled`: a GPU retired by a
  validation error still polls (and releases its buffers).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RbXK4njy12cpm4PG12Xrqt
(cherry picked from commit 389a2cd)
…e GPU tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LochLogic and others added 8 commits October 17, 2026 23:17
The `--control` server bound to 127.0.0.1 but ran any JSON request from any
local process. Every connection must now open with
{"method":"auth","params":{"token":…}}, the same handshake PhotoCraft's
control port uses; anything else gets one error reply and is closed.

- The app takes the token from --control-token / LIGHTCRAFT_CONTROL_TOKEN or
  makes 32 random bytes per run, and writes it to control-token-<port> in the
  settings folder (Windows release builds have no console, so printing it
  would not reach anyone).
- lightcraft-cli run/mcp --connect send the env token or that file's, and
  report a refused token as such; docs/showcase/run.py does the same.
- Shared helpers in lightcraft_engine::control_auth (constant-time compare,
  token never echoed in replies). docs/control-protocol.md documents it.

Tests: control_auth unit tests, server tests (no/wrong token runs nothing,
HTTP-smuggled auth refused), client tests (token sent first, refusal
reported). Checked end to end on Windows 11 with the desktop app and CLI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 497b65f566578b3da14b06165f8076d9bf393467)
…o inheritable try_clone, #1991)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 552be202ab503e977f76d45625247f5725d36bd3)
…rough lcc_brand, the fork's #1991 stream handling kept, getrandom in apps/app, showcase script reads brand.toml

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ujifilm recipe), changelog line, summary regenerated

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hift+P hint now

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…opy recipe) in the fork's locale overlay

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing serve_stream keeps #254's no-clone test, parity rows merged

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@emmertex
emmertex enabled auto-merge October 17, 2026 13:03
The ported upstream PRs added their entries to docs/whats-new.md, which
holds upstream's entries only (cargo xtask notes). They now live in
docs/whats-new/ as the fork's own entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Add Shift-to-skip behavior during culling

10 participants