Commit Graph
21 Commits
Author SHA1 Message Date
vangel76andClaude Sonnet 5.5 c1f2ae16b8 Merge upstream/main into docs/parity-refresh-2
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-11 21:51:14 +01:00
fjamespriceandClaude Opus 5.5 b02d952e76 perf(camera-raw): the GPU Dehaze opens the dark channel like the CPU (#9273)
main's #9316 opens Dehaze's dark channel (a maximum filter of the same
radius after the minimum) and scales the 0.95 weight by the ratio of the
two means, so a sky beside a dark object clears instead of keeping a
bright halo. The GPU pass built the transmission from the minimum alone,
so its preview kept the halo that OK no longer applied.

The pass now does the same: fs_min gains a maximum mode for the opening,
fs_air sums the dark channel and its opening per tile and then turns the
sums into the weight, and the packing pass reads the weight from that
texel instead of a constant.

The CPU mean is now summed in f64. Its f32 running sum over the copy's
few hundred thousand cells drifted by about 1e-5, which the low
transmission beside haze multiplied past the GPU tests' 1/4096 (2.7e-4 in
clarity_texture_and_dehaze_with_shadows_highlights_and_per_pixel_stages);
with f64 the GPU matches to 1.6e-5 on the halo scene.

New test dehaze_opens_the_dark_channel_like_the_cpu develops #9316's
scene (a clear sky and a dark tower) both ways at three strengths. Dehaze
+40 on the 858x572 proxy: 5.1-7.7 ms on the GPU vs 17.7 ms on the CPU.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 02:42:52 -05:00
fjamespriceandClaude Opus 5.5 6025c504cf perf(camera-raw): develop Dehaze, Clarity and Texture on the GPU in the preview (#6916)
Step 3 of #6916. Dehaze, Clarity and Texture run as fragment passes
(box, minimum and guided filters) around step 2's Shadows and
Highlights, so every setting but Detail develops on the GPU with one
readback.

- algo: camera_raw::spatial resolves Dehaze, Clarity and Texture per
  frame; develop builds them the same way (130 output hashes unchanged,
  same speed). PerPixel gains the three stages, per_pixel() refuses only
  Detail, and Whites/Blacks are measured after any spatial stage.
- gpu: camera_raw_filters.wgsl; the tone frame's pyramid is made on
  demand; plans record four segments around the main shader's passes.
  Dehaze's light uses two exact selections (cutoff value, then cutoff
  index among its ties). Its <=768 px copy comes from the CPU
  (Dehaze::cells, develop's own code), cached per source and white
  balance: on WARP the GPU's copy split CPU ties at the cutoff and moved
  the light by 5.7e-3.
- GPU vs CPU at most 7.6e-5 (Vulkan, DX12, WARP), tolerance 1/4096.
  858x572: Dehaze +40 6.0 ms vs 29 ms, Clarity +50 3.5 vs 16 ms,
  Texture +50 3.4 vs 10 ms, everything 19 ms vs 650-690 ms (Vulkan).

Part of #6916.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 02:42:52 -05:00
fjamespriceandClaude Opus 5.5 f41d0ad6d9 docs(hardware-parity): leave the status line to main
The status line changes with every hardware change on main, and this
stack's edit to it conflicted three times in three days. The GPU filters
row and the revision row still describe this change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014nuVUeq1gmQSpF78xazkX9
2026-11-09 02:41:55 -05:00
fjamespriceandClaude Opus 5.5 a60090fff5 perf(camera-raw): develop Shadows and Highlights on the GPU in the preview (#6916)
Step 2 of #6916: the local Laplacian filter behind Shadows and Highlights
(Paris, Hasinoff, Kautz 2011, sampled as in Aubry et al. 2014, as
local_tone.rs does) as wgpu fragment passes, chained in front of step 1's
per-pixel pass with no readback in between.

- algo: local_tone exposes its constants and resolves the sliders into
  LocalTone / TonePass (the remapping is a method); the CPU filter runs
  those passes. PerPixel gains local_tone and measure_whites_blacks;
  whites_blacks_model() exposes the Whites and Blacks tables;
  quantile_rank() is the one rank rule. CPU output unchanged bit for bit
  (86 hashes, 8-bit and float, 171x113 to 2100x1300) and as fast.
- gpu: camera_raw_tone.rs/.wgsl. Pyramid levels are R32Float textures; the
  remapped pyramids of up to 96 references sit in one Rgba32Float atlas per
  level, four per tile. The filter's quantiles, and Whites and Blacks'
  points after it, are exact order statistics on the GPU (16 thresholds per
  round, 8 rounds); a pass renders the Whites and Blacks rows into the
  table texture. Textures, passes and bind groups are planned once per
  frame size. Pipelines build with the rest on the existing thread.
- ui-egui: the proxy worker sends Shadows and Highlights frames to the GPU;
  Dehaze, Texture, Clarity and Detail still use the CPU for the frame.

GPU vs CPU at 8, 16 and 32 bits: at most 9.9e-6 (RTX 5060 Ti, Vulkan and
DX12), 1.03e-5 (WARP); tests keep 1/4096. 858x572 proxy, release: Shadows
+50 8.7 ms (Vulkan) / 10.6 ms (DX12) vs 147-300 ms on the CPU.

Part of #6916.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-09 02:41:55 -05:00
vangel76andClaude Opus 5.5 0edca67199 Docs: re-measure localization at 2,431 keys, Xwayland tilt/eraser, pen right-click partial
Re-ran cargo xtask i18n-coverage on the merged tree: 2,431 keys, per-language
counts and catalog rows recounted; 35 registered languages (23 outside the
key-language table). Linux Wayland tilt and eraser end work through Xwayland
like pressure. The right-click Brush Preset picker row is partial while a pen
barrel right-click with Windows Ink on still paints (#5364).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-08 13:30:41 +01:00
vangel76andClaude Sonnet 5.5 bd4f62f989 Merge upstream/main into docs/parity-refresh-2
Keep main's rows; re-measure the localization counts on the merged tree.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-07 16:58:54 +01:00
vangel76andClaude Sonnet 5.5 26edfe8b18 Merge upstream/main into docs/parity-refresh-2
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-07 13:25:40 +01:00
RickiNano 265fedc687 Merge remote-tracking branch 'origin/main' into fix/windows-pen-eraser-end-2285
# Conflicts:
#	apps/photocraft/src/tablet.rs
#	crates/tablet/Cargo.toml
#	crates/tablet/src/lib.rs
#	crates/tablet/src/windows.rs
#	crates/ui-egui/src/lib.rs
#	crates/ui-egui/src/services.rs
#	docs/hardware-parity.md
2026-11-06 19:53:07 +01:00
RickiNano 1aa85bd796 Windows: the pen's eraser end selects the Eraser (#2285)
The pointer hooks read PEN_FLAG_INVERTED from GetPointerPenInfo and
report the pen end through Services::pen_end, so flipping the pen
switches to the Eraser and the tip restores the previous tool, as on
macOS. A WH_CALLWNDPROC hook beside WH_GETMESSAGE catches
WM_POINTERLEAVE, which Windows documents as sent, not posted.
PEN_FLAG_ERASER alone is an eraser button on the barrel and does not
switch tools.
2026-11-06 19:45:17 +01:00
f23d173933 Add an opt-in WinTab backend for pen pressure on Windows (#11331)
* Add an opt-in WinTab backend for pen pressure on Windows

Windows Ink stays the default. Preferences > Tools > Pen Tablet has a Tablet
input dropdown (Windows Ink (default) / WinTab). WinTab opens a WinTab 1.4
system context on PhotoCraft's window and polls pressure and the eraser end
(tilt on devices that report orientation axes; rotation only with a pen and
driver that report twist) into the stylus feed. The row says to turn Windows
Ink off in the tablet's software utility; the choice applies at next launch.

- crates/tablet: Windows-only wintab/wintab-sys backend. Devices with
  orientation axes use the orientation packet; pressure-only devices open a
  packet without it and report neutral tilt. Leaving is the driver's hardware
  proximity message (WT_PROXIMITY) and the packet's out-of-context status, with
  a long fallback for drivers that never report either. Overlap priority
  follows window focus, and the message hook requests a frame for each WinTab
  message so pressure-only strokes update without cursor movement.
- apps/photocraft: install the backend when the preference is on; poll it at
  the start of each frame; the installed wake repaints the UI.
- ui-egui: TabletPollFn service; the Windows-only Pen Tablet row with the
  Tablet input dropdown and the note.
- engine: tools.tabletInput (windowsInk/winTab), default windowsInk.
- docs: hardware-parity WinTab gap entry, qualifying tilt to orientation axes
  and rotation to twist-reporting pens.

Tested locally on a Wacom tablet with Windows Ink off: pressure, tilt and the
eraser end reach the brush (rotation where the pen reports twist); the default
path is unchanged.

* WinTab: a message that finds the state borrowed is skipped, not a panic in the hook

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* WinTab: rustfmt

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Scorecard: count the Tablet input setting

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: FredApps <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-06 18:39:40 +01:00
5c157e8400 Build the GPU compositor off the UI thread (#9969)
* Prepare GPU compositor in background

* Add compositor startup performance scenarios

* Generate scorecard in scratch CI

* Fix pipeline build type inference

* Address compositor startup review and document measurements

* Run startup performance checks on scratch CI

* Remove scratch performance job

* Count failed GPU attempts in frame timing

* Make shader fingerprint test portable

* Address review: run first-document scenario as a guarded group; share COMPOSITOR_BUILDING constant

* Handle compositor startup benchmark failures

* Fix frame timing after upstream merge

* Keep GPU startup failures on CPU fallback

* Record the failed GPU attempt of a deferred redraw, and bound --reps

A redraw deferred after a failed GPU composite carries that attempt's time to its end, where it is
recorded once beside the CPU time. Perf::record clears the attempt so a direct CPU refresh doesn't
inherit the last one's. perf_scenarios caps --reps.

* Refresh cached canvases after compositor build

* Expose canvas cache key to GPU completion handler

* ci: drop the GPU compositor probe job

AGENTS.md: feature and fix PRs don't add or change CI, and app workflows
only call the shared craft-common-actions workflows. The probe example
stays as a manual tool (cargo run -p photocraft-gpu --example
compositor_build_probe).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: FredApps <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-05 22:49:12 +01:00
vangel76andClaude Sonnet 5.5 a24965166a Merge upstream/main into docs/parity-refresh-2
Keeps the refreshed parity rows and merges the new upstream rows and
revision history entries (Art History Brush, Camera Raw GPU preview,
snapshot dialog, UI scale presets, preference counts).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-26 01:12:40 +01:00
a222c2aee4 Integration: Calibration keeps the Camera Raw preview on the CPU develop (#5128, #6923)
#6923 develops the Camera Raw dialog's preview on the GPU whenever no spatial stage is set,
from `per_pixel`'s stages. #5128 adds Calibration (primaries and Shadows tint) to the CPU
develop between white balance and Dehaze, which those stages don't run, so with both merged
a Calibration-only change previewed unchanged on the GPU while Open applied it. `per_pixel`
now returns None when Calibration is set, so the dialog develops on the CPU then. The
white and black points stay as they were, so the dialog's points cache is still right once
Calibration goes back to neutral. The hardware parity doc and BUG-204-3's note now say so.

Co-authored-by: Fabio Lissi <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 13:12:57 +01:00
7a70220777 Integration: one gpu test binary, no GPU pass for neutral settings (#6923)
- crates/gpu/tests/camera_raw.rs was its own test binary taking
  testkit's gpu_lock; since #8644 the crate's integration tests are one
  binary (tests/it) sharing crate::GPU_LOCK, so in that binary it would
  open a device next to the other modules. Moved into tests/it with
  GPU_LOCK; the testkit dev-dependency goes.
- Default (neutral) settings uploaded, rendered and read back the proxy
  although the CPU develop returns at once. CameraRawGpu::develop now
  leaves them to the CPU; neutral_settings_skip_the_gpu_round_trip fails
  without it (backend "gpu").
- docs/hardware-parity.md: the CPU range was one backend's (21-28 ms);
  measured 11-16 ms on an RTX 5070 Ti, so 11-28 ms, machine-dependent.

Co-authored-by: p0rps <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 20:45:52 +02:00
vangel76 0f4312c10c Merge current parity updates and preserve newer feature status 2026-10-21 20:02:25 +02:00
fjamespriceandClaude Opus 5.5 49df3fb921 perf(camera-raw): develop the preview's per-pixel stages on the GPU (#6916)
Step 1 of #6916: one wgpu fragment pass for develop's per-pixel stages
(white balance and exposure, Contrast without Texture or Clarity, Whites
and Blacks, Vibrance and Saturation, tone curves, Color Mixer, Color
Grading, vignette, grain in full-resolution coordinates).

- algo: camera_raw::per_pixel resolves those stages' constants and
  tables; the CPU develop builds its own from the same functions, so its
  output is unchanged bit for bit.
- gpu: CameraRawDevelop (camera_raw.rs, camera_raw.wgsl), curves and
  Whites/Blacks rows in one R32Float table texture, readback for the
  histogram and scopes. Built on demand, not with the compositor (#6419).
- ui-egui: the proxy worker develops on the GPU when the settings have no
  spatial stage; Rendering Mode CPU, no GPU canvas, a software adapter, a
  fault or a failed develop use the CPU develop. The pipeline builds on a
  thread at the first open. describe() reports developMs and
  developBackend.

GPU vs CPU at 8, 16 and 32 bits: at most 2.7e-5 (RTX 5060 Ti, Vulkan and
DX12), 6.7e-6 (WARP); tests hold 1/4096. 858x572 proxy, release: CPU
20.7-28.1 ms, GPU 2.7 ms.

Part of #6916.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 11:10:13 -04:00
Ernie SmithandClaude Sonnet 5.5 0e97ac4ca8 Make adapter choice Linux-only everywhere, not just the dropdown
The Preferences row was Linux-only, but PHOTOCRAFT_GPU_ADAPTER and
performance.gpuAdapter were honoured on every platform, so Windows and macOS
could pick a non-default adapter without being tested for it. Ignore the
request off Linux (and in CPU mode, as before), and don't make a launch
standalone for a variable that is ignored there.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-19 16:19:51 -04:00
Ernie SmithandClaude Sonnet 5.5 b892c0412e Choose the graphics adapter on multi-GPU Linux machines (#1885)
With the backend on auto, Linux installed no adapter selector, so wgpu took
the first discrete GPU the driver listed. On a machine with an eGPU, a
laptop dGPU and an iGPU that was not the one the user wanted.

- performance.gpuAdapter: a case-insensitive piece of the adapter's name
  (several words must all appear); empty is automatic.
- PHOTOCRAFT_GPU_ADAPTER overrides it for one launch.
- Preferences > Performance > Advanced > GPU adapter lists the adapters the
  instance found; a saved adapter that is absent stays listed, marked.
- A missing adapter, or one that can't present to the window, falls back to
  the automatic choice with a note in System Info. CPU mode ignores it.
- Shown on Linux only; tested on Linux only. Windows and macOS need their own
  work (the startup code honours the setting there, but it is untested).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-19 13:16:53 -04:00
vangel76andClaude Opus 5.5 adba2cec8f Docs: refresh ui, localization, brush and hardware parity docs against main (#4419)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 21:36:35 +02:00
Brandon ThomasandClaude Opus 5.5 939c8f2c70 Progress docs: target-app parity, gaps, alpha gate, readiness by audience (#2696)
Progress docs per craftrules standards/progress-docs.md: target-app parity (merges parity-estimate.md), gaps, roadmap with alpha gate, readiness by audience (full / mainstream / essentials) with Opus 5.5 hours, and UI, brush, format, hardware and localization parity docs. docs/parity.md is now docs/parity-checklist.md.

The Windows test failure (file_dialog::tests::save_dialogs_remember_where_each_document_was_last_saved) is pre-existing on main: the test hard-codes POSIX paths.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-10 15:09:04 -04:00