Commit Graph
6071 Commits
Author SHA1 Message Date
FredApps 13ca2272a9 Merge pull request #2307 from FredApps/fix/786-psd-hue-level-writers
psd: share raw hue and levels block writers
2026-11-19 08:44:35 +07:00
texjer bf11227dae Merge main into craft-develop-inpaint: the crate now also holds spline, curve and lut 2026-11-18 20:41:04 -05:00
aiongg b013967b02 Sync fixes: main's JXL capability test, settling layer through runtime::egui 2026-11-19 01:35:39 +00:00
David Mann 88e2642794 Merge remote-tracking branch 'origin/next' into anchor/12707-drag-handles
# Conflicts:
#	crates/draw/src/ui/pen/bezier/mod.rs
2026-11-19 02:34:27 +01:00
David Mann 93e68f35a1 Merge remote-tracking branch 'origin/next' into anchor/12708-edit-existing
# Conflicts:
#	crates/draw/src/ui/pen/bezier/mod.rs
#	crates/draw/tests/it/bezier.rs
2026-11-19 02:31:29 +01:00
David Mann a2154f728f Merge remote-tracking branch 'origin/next' into anchor/12732-segment-reach
# Conflicts:
#	crates/draw/src/ui/pen/bezier/mod.rs
#	crates/draw/tests/it/bezier.rs
2026-11-19 02:25:36 +01:00
David Mann ad32b91d50 Merge pull request #2284 from davidmann4/anchor/12709-alt-subpath
Add Anchor: Alt selects or copies the whole subpath (photocraft#12709)
2026-11-19 02:15:12 +01:00
David Mann 117389d4a1 Merge pull request #2306 from davidmann4/fix/next-red-dock-settle
Lazy::show_or: a view that leaves its room takes none (next is red since #2273)
2026-11-19 02:14:53 +01:00
William Dunn 4141fe7a9f craft-gpu: provider-neutral GPU job traits and the wgpu backend (#663)
* craft-gpu: add the GPU job traits and the shared providers.

This carries over crates/gpu, crates/gpu-wgpu, crates/gpu-null, and crates/gpu-providers from the cut-down #160 branch, with minimal workspace wiring.

None of these crates names a vendor or any app. craft-gpu defines GpuJob and ProviderRegistry. craft-gpu-null is an in-memory context for tests. craft-gpu-providers holds the shared craft.* WGSL providers. craft-gpu-wgpu is the wgpu backend, native and WebGPU.

* craft-gpu: real device wiring, device loss and async readback (RFC-0022)

Addresses skylartaylor's review gate on #663 at 138f7b2. RFC-0022 has merged
since that review. This follows its acceptance requirements.

WgpuContext now requests a real device. DeviceCaps comes from that device,
reflecting the limits and features actually enabled on it. Buffers are real
wgpu::Buffer values when a device exists. The no-adapter case still degrades
to the same staging behavior as craft-gpu-null. The RFC defines that case
explicitly as the no-adapter path. Device loss is registered via
set_device_lost_callback. It surfaces as GpuFault::DeviceLost. It never
surfaces as a panic. The recovery is stated on GpuContext's trait docs.

GpuContext::read_buffer is no longer a required method. The primitives are
request_read and poll_reads. That mirrors craft-worker-host's own
HostMessage::GpuJobs to WorkerMessage::GpuBatchDone split one level down.
read_buffer stays as a default blocking convenience. It resolves immediately
on the null and staging paths. Native wgpu blocks on
Device::poll(wait_indefinitely). On wasm32 it returns GpuFault::Operation,
since a blocking wait there would freeze the one thread map_async's own
callback needs to run on.

crates/gpu-wgpu/src/tests.rs adds a real-backend suite, gated on
adapter-probe plus non-wasm32. It runs upload, readback and device-loss
tests against a real WgpuContext. It also runs three craft-gpu-providers
CPU-stand-in providers against that same real WgpuContext. It skips with a clear message when no adapter is present.
Verified against lavapipe with mesa-vulkan-drivers, using
--features adapter-probe,native-vulkan: every test passes. That run first
caught a real wgpu panic on buffer lengths that are not a multiple of 4,
COPY_BUFFER_ALIGNMENT. The fix pads real buffers transparently. Every caller
still sees exact, unpadded bytes.

docs/gpu-backends.md and docs/gpu-providers.md are updated to match,
including named consumers (the runtime slice first, then EffectCraft and
FilmCraft) and a device-ownership note for when egui's wgpu renderer is also
running.

* craft-gpu: buffer-size guards, empty-buffer parity, read_buffer keeps other completions

Answers the six findings in CodeRabbit review 5852678306 on PR #663.

upload_buffer on the device path refuses a padded size past the device's
max_buffer_size with GpuFault::InvalidJob before creating the buffer.
request_read guards its staging copy the same way. An oversized request
used to reach wgpu as a validation error on the device's error scope.

Empty buffers are accepted everywhere, matching craft-gpu-null and the
documented staging parity. The device path resolves an empty readback
immediately (wgpu refuses an empty map range). The blanket InvalidJob on
empty upload bytes is gone.

read_buffer no longer eats completions that belong to another
outstanding request. The wgpu override re-queues them for the next
poll_reads. The null context gains an override that takes only its own
completion. The trait's default-body contract is documented: with the
default body, do not interleave read_buffer with an outstanding
request_read.

ReadbackProvider validates the storage-binding cap directly. The old
chunk_buffer call allocated a Vec of slices only to drop it.

parse_u32 and params_contain refuse an empty prefix or needle.
windows(0) panics and the crate's rule is never to crash.

The manifest guard test now also rejects *-engine dependency lines, per
docs/gpu-providers.md.

* craft-gpu: per-job batch results, wasm staging reads resolve

Two findings CodeRabbit raised against the carried copy on PR 662, fixed here where the crates live. dispatch_batch now answers per job in input order. The old first-failure abort discarded outcomes earlier providers had already produced, leaving the caller nothing to reply with and no way to name the jobs worth retrying. A job fed by a failed predecessor fails honestly on its own bad handles. On wasm32 read_buffer now serves the staging backing, whose reads resolve synchronously. The backing on that target is always staging today. The refusal remains for a read that did not resolve synchronously, guarding the future wasm device backing where blocking would hang the tab.

* Add free_buffer and device_status to GpuContext.

Two CodeRabbit findings against crates/gpu-wgpu, both answered at the
trait level since craft-gpu-null has the exact same gap.

free_buffer (lib.rs:313). Every upload_buffer call added an entry to a
backend's buffer table. So did every output buffer a provider's job
created. Nothing ever removed one. Repeated jobs retained memory for
the whole lifetime of a context. The new required method releases a
buffer's resources. A freed handle behaves as invalid afterward, the
same fault an unknown handle already produces.

device_status (lib.rs:401). poll_reads can only attach a device-lost
fault to a read it has something to attach it to. A caller whose event
loop only polls, with nothing pending when loss happens, could never
observe it. The new method, default Ok(()), covers that gap directly;
a backend with no concept of device loss needs no override.

MemContext in this crate's own tests gets the same free_buffer shape as
craft-gpu-null, to keep it compiling under the new required method.

* Implement free_buffer for NullContext.

buffers moves from Vec<Vec<u8>> to Vec<Option<Vec<u8>>>. A handle is a
stable index. Freeing a slot replaces it with None. Removing it
instead would shift every later handle's index out from under its
caller. buffer_len and request_read now reject a freed index the same
way they already reject one that never existed.

Two new tests. One frees a handle and checks another's index and bytes
stay untouched. One frees a handle twice, and a handle that never
existed, and confirms both are a harmless no-op.

* Fix the no-device caps fallback, capture allocation failures, free buffers.

Four CodeRabbit findings against this crate.

The no-device fallback in WgpuContext::new called probe_caps() again
on request_device failure (lib.rs:228). A second, successful adapter
query would then report the adapter's advertised limits as if they
came from a granted device, for a context that holds none. It now
falls back to the plain, fixed caps probe_caps's own doc comment
already promises for that case.

Allocation failures during buffer creation used to reach wgpu's
default uncaptured-error handler (lib.rs:299). That handler panics.
The size check already in place only catches a request past the
device's advertised maximum. It says nothing about whether the device
can actually allocate that many bytes right now. An error scope around
both the output-buffer and the read-staging-buffer creation converts a
failure into a GpuFault instead.

free_buffer for WgpuContext (lib.rs:313) matches the Option-wrapped
shape just added to craft-gpu-null. Both backings, staging and real
device, release a buffer's resources and make the handle behave as
invalid afterward, without shifting any other handle's index.

device_status for WgpuContext (lib.rs:401) reports device loss through
the trait method just added to GpuContext. A caller that only polls
can now observe loss even with nothing pending.

New tests cover the fixed fallback value and a regression check that
the new allocation error scope does not misfire on an ordinary
allocation. They also cover free_buffer on both the staging and the
real-device path. One more covers device_status observing a destroyed
device with nothing outstanding. A genuine out-of-memory condition is not reliably
reproducible in CI; the allocation-failure test is the honest half of
that fix this can run.

* Fix the error-scope API call and run cargo fmt.

wgpu 30.0.1's Device has no pop_error_scope method. push_error_scope
returns an ErrorScopeGuard. pop() lives on that guard. Keep the guard
from push_error_scope and call pop() on it.

Also drops an unneeded mut on a test binding that never mutates its
context. Also runs cargo fmt on the lines the Option-wrapped buffer
changes touched.

* Drop a needless return clippy flagged in the adapter-probe lane.

The fallback branch in WgpuContext::new is the function's own tail
expression once the real-device branch above it has already returned
early. The explicit return on it was redundant.

* Run cargo fmt on the no-device fallback branch.

* Pop the OOM scope before the call that would misuse a failed buffer.

upload_buffer popped its scope only after write_buffer. request_read
popped its scope only after the copy and its submission. A buffer that
failed to create is invalid. Using an invalid buffer raises a VALIDATION
error that an OutOfMemory-only scope never catches. The default
uncaptured-error handler still panicked on a failed create even with the
scope in place. Pop right after create_buffer in both paths and return
before the buffer is used again, with a separate scope around the later
write or copy.

write_buffer only queues its copy into wgpu's PendingWrites. An upload
with no following submission kept the destination and staging buffers
alive inside wgpu-core until some other submit happened. upload_buffer now
flushes with an empty queue.submit right after its own write_buffer call.
A free_buffer right after an upload can now actually release the
allocation.

* Run cargo fmt on the new ordering test.

* craft-gpu-wgpu: correct the crate docs on wasm32 read_buffer

The staging backing serves wasm32 reads synchronously since the staging-reads fix. Only a read that did not complete synchronously faults. The crate-level summary still described the old unconditional fault.

* craft-gpu: sync the docs with the implemented readback behavior

Review asked for three corrections. The backends doc, the providers doc and the trait docs now state that both bundled backends override read_buffer's default body and that wasm32 serves the staging read, with a fault only for a read that did not resolve synchronously. The runtime follow-up paragraph now records that #662 consumed it. The software Vulkan container run is described as local testing. Hosted CI coverage and the pilot consumers' browser and hardware validation remain their own requirements. Em dashes swept from both docs per the house writing rules.

* has_device: say the answer once, in this file's own shape

Clippy 1.100.0 refuses the old body under `needless_bool`. The `if` returned a
bool literal with a bare `false` after it. The cfg attribute sat on the `if`
itself. The whole statement therefore vanished without the adapter-probe
feature.

Two cfg blocks replace it, one per configuration. `probe_caps` in the same
file already has that shape. `Backing::Device` exists only under that feature.
The clippy suggestion on its own would not compile.

The plain clippy leg never saw this. The line compiles only with adapter-probe
on. The all-features leg catches it, as does any workspace build that unifies
the feature in.
2026-11-18 19:05:00 -06:00
FredApps 9da45ec561 Merge pull request #2313 from FredApps/fix/full-validation-shell-oracle-778
ci: align full-validation oracle with Bash conditions
2026-11-19 07:57:03 +07:00
aiongg 9d599676d1 Sync fix: name private items in public docs as code, not links 2026-11-19 00:48:51 +00:00
aiongg f6532f9835 Sync fix: keep main's uri_decode import in the glTF tests 2026-11-19 00:32:21 +00:00
aiongg 7086f23162 Sync fixes: restore the rust-cache lock entries, drop a duplicate import, format 2026-11-19 00:27:45 +00:00
FredApps 1eb0815488 ci: align full gate oracle with Bash condition syntax 2026-11-19 01:15:24 +01:00
Dylan M. Taylor e787321728 feat(jpeg): add reduced-size DCT-scaled decoding (#2296)
* feat(jpeg): add reduced-size DCT-scaled decoding

* Fix cargo fmt and clippy warnings in craft-jpeg

* fix(jpeg): use as_chunks instead of chunks_exact(3) in test
2026-11-18 18:59:59 -05:00
Dylan M. Taylor d7b8dba7b2 craft-plotter: add HP-GL/2 plot and write modules (#2295)
* craft-plotter: add HP-GL/2 plot and write modules

* Make clip::Region and nest::{bounds, outer} pub for clippy
2026-11-18 18:59:55 -05:00
FredApps fa4741d0bb psd: share raw hue and levels block writers 2026-11-19 00:59:54 +01:00
Dylan M. Taylor 3475d9a543 feat(ipp): extract craft-ipp from photocraft-ipp (#2292)
* feat(ipp): extract craft-ipp from photocraft-ipp

* chore(ipp): fix cargo fmt
2026-11-18 18:59:51 -05:00
Dylan M. Taylor 07d5165036 hayro-postscript: add Scanner::parse_object_or_skip (#2287) 2026-11-18 18:59:47 -05:00
David Mann ea83ef02f9 Merge branch 'fix/next-red-dock-settle' into HEAD 2026-11-19 00:56:30 +01:00
David Mann 15fee07c8d Merge branch 'fix/next-red-dock-settle' into HEAD 2026-11-19 00:56:30 +01:00
David Mann 7fcf44cb93 Merge branch 'fix/next-red-dock-settle' into HEAD 2026-11-19 00:56:29 +01:00
David Mann 3d61a66967 Merge branch 'fix/next-red-dock-settle' into HEAD 2026-11-19 00:56:29 +01:00
David Mann b5b1300783 Lazy::show_or: a view that leaves its room takes none
next has been red since #2273 on two counts, both in the dock's settling
host view (3bcc5bec4):

- design-lint: contract/lazy.rs named `egui::LayerId` for the run's
  layer. The run now holds the runtime's `Layer`, the type `Place` and
  `replay::close` already use.
- hovering_a_tab_runs_only_its_group: the dock ran its host view in a
  `scope_builder`, which takes room and item spacing in the Lazy's
  child even when the host leaves the group to the dock. A replayed
  group then sat 4 points lower in flow than a group that ran, so the
  child's extent changed whenever a hovered group ran, layout memory
  asked for a discard pass, and that pass ran every group (5 runs
  where 1 is expected).

`show_or` now runs `add` in a child `Ui` that takes room only when it
returns `Some`, so `otherwise` takes the same place whether it runs or
replays.
2026-11-19 00:55:45 +01:00
Dylan M. Taylor 8008ad3608 chore(doc-binary): mark spec-mandated MD4 BLIP UID as NOSONAR (#2305) 2026-11-18 18:52:05 -05:00
Dylan M. Taylor 00577e538f chore(ci): use [[ ]] in shell scripts (SonarCloud S7688) (#2304) 2026-11-18 18:50:50 -05:00
Dylan M. Taylor 0e6af4121b docs: add CodeRabbit badge to README (#2303) 2026-11-18 18:49:25 -05:00
Dylan M. Taylor b625263e07 feat(cms): add GPL/CSS/ASE/ACB palette I/O (#2297)
* feat(cms): add GPL/CSS/ASE/ACB palette I/O

* chore(cms): fix fmt and clippy
2026-11-18 18:45:56 -05:00
FredApps 027416ac9f Merge pull request #2272 from FredApps/fix/786-psd-fixed-writers
psd: share raw brightness and exposure block writers
2026-11-19 06:44:50 +07:00
8aa61a478a feat(jpeg): add finer_than_first header check (#2302)
Port samhyun’s progressive JPEG sampling guard from storytold/figcraft#1491,
source commit 9aac391e045c3c5894c1112e537d8ea2da382521.

Shared API and existing frame-walker adaptation by Dylan M. Taylor.
Code and base are identical to storytold/craft-libs#2294 at
7f868f0a109aa1c301b79b9aa2c06626689fcd55; this replacement corrects attribution.

Co-authored-by: samhyun <rnflal31@gmail.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-18 18:40:24 -05:00
Dylan M. Taylor 6e7e752947 fix: resolve clippy nonminimal_bool and unexpected_cfgs on main (#2300) 2026-11-18 18:12:07 -05:00
aiongg e8e713ee26 Merge storytold main into next (18 Nov sync)
Merges main at 3b8e426a26.

- crates/ui: main's e-sign dialog (crates/ui/src/esign) moves to craft-cloud-ui beside the
  share dialog, behind craft-cloud-ui's esign feature; craft-ui forwards `esign` and
  re-exports the module.
- crates/proof: main's can_suggest_cased goes to affix/check.rs and its tests to
  affix/tests.rs (next split affix.rs); French wiring in lib.rs.
- crates/svg: main's validated resolver and raster validation stay under tree-render, which
  now also enables gif and image-webp; the shared image-codec helpers are gated on tree.
- craft-ai-agents: main's rev (craft-ai-integrations main), one entry.
- crates/craft: facade dependencies, features and re-exports for main's new crates.
2026-11-18 23:07:38 +00:00
Dylan M. Taylor ce7cefa554 fix: update JXL capability test and format craft-exr (#2298) 2026-11-18 17:58:04 -05:00
el-j 43cd6206c3 Merge origin/main into feat/audio-dsd 2026-11-18 23:43:56 +01:00
David Mann 04ba41419b Merge pull request #2242 from ljkx/fix/15540-dialog-first-field-selected
Dialogs: a dialog that opens on a text field selects its text (photocraft#15540)
2026-11-18 23:27:59 +01:00
Dylan M. Taylor 3b8e426a26 feat(exr): add f32/f16 RGBA writer, compression modes, and chromaticities (#2281) 2026-11-18 17:20:52 -05:00
David MannandClaude Opus 5.5 3ab557ff7c Add Anchor: a drag from a segment pulls out the new anchor's handles
In the reference application a drag from a segment with Add Anchor
Point adds the anchor where the segment was pressed and pulls out its
handles as the Pen does: the out handle follows the pointer and the in
handle mirrors it, in one step. Shift turns the handle to the nearest
45 degrees (an axis keeps the drag's offset along it, a diagonal the
shorter offset), and Alt pressed during the drag breaks the pair so
only the out handle follows. The overlay moved the new anchor instead.

Add Anchor's drag now reports the new `PathEdit::PullAnchor` (insert at
`t`, out handle, in handle once Alt broke the pair), which `apply`
carries out. A click still reports `InsertAnchor`, and the Pen's Auto
Add/Delete keeps moving the anchor it adds. Space moving the anchor
mid-drag is not part of this change: the overlay cannot read Space.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 23:11:53 +01:00
David MannandClaude Opus 5.5 4d78bb2de2 Add Anchor: Alt selects or copies the whole subpath
In the reference application Alt does not turn Add Anchor Point into
Delete Anchor Point: an Alt click on a segment selects every anchor of
its subpath and adds nothing, an Alt drag moves a copy of the subpath
(the copy ends up selected), an Alt click on an anchor deletes nothing,
and the cursor is the arrow with a plus.

The overlay now does the same under Add Anchor, reusing Direct
Selection's Alt segment press (`PathEdit::DuplicateSubpath`, or the
subpath itself on a path that takes no copies). Delete Anchor with Alt
still adds an anchor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 23:03:09 +01:00
David MannandClaude Opus 5.5 0274c3e5a0 Add Anchor: select and edit existing anchors and handles
In the reference application the Add Anchor Point tool edits the
anchors and handles a path already has as Direct Selection does; only
a press on a segment adds an anchor. The overlay took a press on an
anchor and did nothing with it, and never took a handle.

Under Add Anchor a press on an anchor now selects and drags it as
Direct does (Shift adds to the selection), a press on a shown handle
drags it (Alt moves it alone), and a click on empty canvas deselects
the anchors and keeps the path. Alt on an anchor is still Delete
Anchor's click, and a click on a segment still adds an anchor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 22:59:49 +01:00
David MannandClaude Opus 5.5 7f56589f5a Add Anchor: reach a segment within 5 points
The reference application adds an anchor when a click is up to 5 px
from a segment at 100 % and adds none at 6 px. The overlay's segments
hit within a line's 4 points, so a click 4.5 or 5 points away added
nothing under Add Anchor.

craft-behavior's polyline hit shape gets its own reach
(`HitShape::polyline_within`; `polyline` keeps `LINE_REACH`), and the
overlay gives Add Anchor's segments a 5-point reach. Delete Anchor,
Direct Selection and the other tools keep a line's reach.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 22:55:39 +01:00
Dylan M. Taylor 010702ee9b chore: sync Cargo.lock with workspace (#2279) 2026-11-18 16:37:32 -05:00
Dylan M. Taylorandtexjer 6c034902b2 craft-develop: extract spline, curve, and lut modules from LightCraft (#587) (#2274)
Co-authored-by: texjer <texjer@gmail.com>
2026-11-18 16:30:48 -05:00
FredApps bba249ecbf Merge pull request #2270 from FredApps/fix/786-psd-tagged-descriptor-prefix
psd: add bounded recovering descriptor-block prefixes
2026-11-19 04:28:10 +07:00
aiongg 18ffc07519 Merge pull request #2273 from aiongg/frame-cost
Frame cost: shown-chord table, settling host views, one gate answer per frame
2026-11-18 16:19:20 -05:00
texjer ad126d48f9 Merge branch 'craft-develop-inpaint' of https://github.com/texjer/craft-libs into craft-develop-inpaint
# Conflicts:
#	Cargo.lock
2026-11-18 16:13:52 -05:00
Dylan M. Taylor 816f745c02 Merge pull request #2023 from el-j/feat/video-mjpeg-frame
craft-video: Motion JPEG frames convert to VideoFrame (#1231)
2026-11-18 16:11:50 -05:00
texjer bf655268d7 craft-develop: a cancelled inpaint with an impossible patch radius is still cancelled 2026-11-18 16:09:33 -05:00
texjer 440235aadf Merge remote-tracking branch 'origin/main' into craft-develop-inpaint
# Conflicts:
#	Cargo.lock
2026-11-18 16:08:29 -05:00
aiongg e79a3ed16e TransformBox: trial that a frame run twice reports each drag move once
A frame's second pass runs the box's update again with the press still
held at the same point. The proposal it makes equals the one the first
pass reported, and the gesture reports an equal proposal only once, so a
host that applies each Update applies it once per move. The trial runs
a drag with every frame run twice and counts the updates.
2026-11-18 20:59:41 +00:00
aiongg 0392fc439d Commands: the gate answers each command once per frame
The board asked the app's gate again for every resolution: each reader
of a command, the measuring and the real run of each component, and the
re-resolution of every shown reader at the start of each pass. The gate
is a snapshot of what the app knew before the frame, so the board keeps
its answers for the frame and asks once per command. CommandRef::key_text
gives the key without allocating for a command without parameters; the
keymap's lookups and the board's answers use it.
2026-11-18 20:59:41 +00:00