Architecture
Complete rejected-paint verification
Review 5d21356 passes the complete 262-case canonical source suite across
48 files and all 57 selected production workflows across 17 files, with zero
skips, retries, unexpected or flaky results. All 4,036 frozen inputs remain
unchanged through the terminal source, production and seven-spec matrix runs.
The original 384-layout matrix now matches 364 layouts exactly, retaining every prior 362 match, all original 352 matches and the earlier 44 colored matches. CJK, marks and axes match 64/64 each; bidi and joining match 62/64 each; colored matches 48/64. Two colored RTL affine curves with negative tracking newly match in mixed and sideways orientations. Two mismatches and 18 matching-budget errors remain. The matrix invocation therefore exits unsuccessfully; full native acceptance and the broader roadmap are still open.
All 72 independent Float32 references pass in that same invocation. The audit checks 2,318 matched glyph records and 1,406 complete original-text shaping requests, retaining source font priority, axes, GIDs, colors and zero native ink/ownership errors. Every cohort leaves the document unchanged and retires its measurement probes and private font faces. This increases completed coverage; it does not establish lower user latency or sustained editor-wide performance.
The separate corrected horizontal source invocation also passes all 259 cases across 47 files with all 4,031 inputs unchanged. Its original 258/259 run and representation-specific tracking assertion remain preserved. The replacement assertion checks actual tracked original-source ink against zero tracking while retaining every independent Float32, HDR/tiny-alpha, partition and font gate. These are separate complete invocations, not a union of partial results. Terminal reports, exact inputs and audits.
Rejected native paint reuse (private review)
One fallback matching operation retains a bounded LRU of exact ordered paint identities that already failed complete ink or ownership verification. Font-owner identity, geometry, styles, authored colors and paint order distinguish entries. Every hit still checks the captured source, font owners and cancellation. Only a previous rejection can be skipped; a published match still runs the complete original ink and ownership gates. Keys and rejections retire with the operation.
The one-MiB key budget limits retained verification work, not document geometry,
source resolution or the number of candidate preparations. Larger keys bypass
the cache and keep normal verification. Key preparation yields between glyphs.
Public constructors, commands, schema, grants and independent REST contracts
retain their existing behavior. This review does not solve the remaining curved
source-placement differences or complete native/full-roadmap acceptance.
The isolated core passes npm run build, all 3,431 unit/API tests across
347 files, and 16 focused browser tests with zero skips/retries/flaky results.
Three new real-browser faults abort, release the plan or remove its captured
font on a rejection-cache hit: all withhold publication, retire resources and
permit a healthy original-source retry. All nine independent tracked Float32
outputs retain exact HDR/tiny-alpha values and partition words; actual original
source ink differs from its zero-tracking control in every case.
The unchanged original colored sideways diagnostic still reaches its 60-second matching deadline. The implementation avoids 1,034 repeated renders and visits 138 distinct candidates, versus 38 in the uncached source. It publishes no result and retires every private face/probe without changing the document. This measures duplicate work, not a solved rendering case, lower user latency or editor-wide performance. All 4,036 frozen core inputs remain unchanged through terminal checks. The complete 262-case source suite, original 384-layout matrix, 57 selected production workflows and broader roadmap acceptance remain required. Core reports, frozen inputs and diagnostics.
Complete horizontal review and tracked-paint assertion correction
The complete original matrix at review 3c1fcfa matches 362/384 layouts:
three mismatches and 19 matching-budget errors remain. CJK, marks and axes match
64/64 each, bidi 62/64, joining 62/64 and colored 46/64. Every prior 361 match,
original 352 match and 44 earlier colored match remains. The new exact control
is horizontal RTL affine joining with negative letter tracking.
All 72 independent Float32 references pass in the same seven-spec fallback invocation. The audit checks 2,302 matched glyph metadata records and 1,398 original full-context requests, retaining font priority, axes, GIDs and colors, with zero ink/ownership errors. All six cohorts retire probes/private faces without changing the document. All 4,031 frozen inputs remain unchanged through the original source and matrix invocations.
The original canonical source run passes 258/259 cases. Its one failure requires
nonzero private paintLetterSpacing for a mixed Arabic/Hebrew fixture, although
all nine independent Float32 outputs, HDR/tiny alpha and partitions already
match exactly. Tracking can also be encoded in retained positions. The corrected
test compares actual original-source ink with the otherwise identical zero-tracking
source and retains every numeric, original-font, invalid-input and partition gate.
Its fresh focused invocation passes all nine outputs and shows visible tracking
in every case. All 766 engine/source files remain unchanged. A complete corrected
259-case source invocation and main integration remain required; a combined green
source result is not inferred from separate runs. Twenty-two native layouts and
all unfinished broader roadmap gates remain required.
Terminal reports, original assertion and visible-tracking reference.
Horizontal script-aware source placement (private)
The original screen preparation remains available. An additional preparation suppresses letter tracking inside cursive words while retaining authored space tracking and word spacing. If a negative space starts the visual run, its complete original native caret addresses supply the paint start before the following source glyphs are placed. A shared horizontal paint address comes from an original glyph in native visual order. Source text, GIDs, font priority, axis tuples and linear colors remain intact; no comparison pixel fits a displacement. Complete native ink at both opacity samples and per-color ownership still decide publication. No constructor, command, schema, isolated/plugin grant or independent REST boundary changes.
The isolated core passes build/typecheck, all 3,428 unit/API tests with four workers, 72 native controls, 72 independent Float32 references and 57 selected production workflows. The new workflows cover both directions with fallback and single-font source text, exact opacity/Undo and original-bearing reopening. The complete original joining cohort matches 62/64, retaining all 61 previous matches. Its remaining vertical-curve cases are explicitly recorded, not waived. All 4,031 frozen inputs remain unchanged through terminal core checks. The initial review had 71/72 controls, 55 production workflows and 66 independent references; its single-font failure and complete preimages are retained before the source-space correction. A fresh worktree's initial TypeScript check lacked generated font workers; the canonical build generated them and passed. Full 259-case canonical source and original 384-layout matrix acceptance, main integration, and broader public/host/device/memory/performance and complete-roadmap gates remain required. Core reports, source identities and diagnostic evidence.
Shared native source paint origin (private)
Complete original-span allocation now also covers a single authored span across
font items, preserving raw fragment advances before layout-unit conversion.
Existing per-cluster preparations remain available. A separate sideways
preparation retains the first captured source paint address and expresses the
unchanged relative glyph poses through affine translation. This keeps relative
offsets out of separate per-glyph SVG text-address grid conversions. All source text, font priority,
GIDs, axes and colors remain retained; no comparison pixel determines a pose.
Original whole ink at both opacity samples and per-color ownership still decide
publication. Private evidence identifies nativeSharedOrigin; public constructors,
commands, schema, isolated/plugin grants and independent REST contracts stay
unchanged.
The isolated core review passes build/typecheck, all 3,428 unit/API checks with four workers, 56 native controls, all 64 original mark layouts, 60 independent Float32 references and 53 production workflows, including the formerly failing RTL sideways affine saved project. The initial unrestricted unit run had eight timeouts, and the first reference invocation was interrupted by a Vite navigation; both are retained with the successful unchanged-engine reruns. The new single-color reference was also routed to the existing per-glyph overlap assertion; all 60 comparisons were exact before that fixture correction. All 4,030 final inputs remain unchanged through the terminal reference rerun; earlier core identities and the single test-file change are retained separately. Complete canonical source and original 384-layout matrix reruns and broader public/host/device/ memory/performance and full-roadmap acceptance are still required. Core reports and diagnostic evidence.
The complete review f020fb1 now passes one canonical source invocation of
258 cases across 46 files, including the actual 48-reference source-parent test,
with zero retries, skips, flaky or unexpected results. Its original 384-layout
matrix finishes at 361 exact matches, three mismatches and 20 matching-budget
errors. Every prior 360 full-matrix match, original 352 match and 44 earlier
colored-cohort match remains. Cohorts are CJK 64/64, marks 64/64, bidi 62/64,
joining 61/64, axes 64/64 and colored 46/64. The last original mark control is
now exact; 23 native layouts and broader roadmap acceptance still require work.
All 60 independent fallback Float32 references pass in that same fallback invocation. The audit checks 2,296 matched glyph metadata records and 1,395 original full-context requests, including font priority and axis tuples, with zero ink/ownership errors. Every cohort retires probes/private faces without model changes. All 4,030 frozen inputs remain unchanged through both terminal runs. The newer horizontal development is separate and contributes no cases to this aggregate. Main integration and broad public/host/device/memory/performance and original roadmap gates remain required. Terminal reports and retention audit.
Correlated native position rounding (private review)
native-svg-position-rounding.ts offers an additional vertical preparation that
rounds shaped offsets/advances and nominal offsets/advances together in screen
pixels, with Float32 conversion and ties away from zero. Each captured run supplies
its own units per em. Original captured runs remain the provenance; posed copies
never replace the original font, text context, GIDs, axes or colors. The existing
fractional preparations remain, including the identity-transform paths that the
rounded preparation does not match. Private evidence identifies rounded positions.
Complete original ink at both opacities and exact color ownership still decide
publication. No public constructor, command, schema, scripting/REST signature or
grant changes.
The isolated review passes build/typecheck, all 3,428 unit/API checks, 24 focused native controls, 45 emitted production workflows and 48 independent fallback Float32 references. Those retain all 37 earlier production workflows and 42 fallback references. Its complete 257-case source suite also passes. The full original matrix completes at 360/384 exact matches, retaining all 352 previous full-matrix matches and all 44 previous colored matches; 24 layouts still fail. Full native/public/device/performance and broader roadmap acceptance stay open. Terminal results and retention audit. Source, raw diagnostics and verification boundaries.
Vertical source-parent preparation
native-svg-vertical-parent.ts offers a parent frame for straight upright Latin
runs whose uniform metric styling crosses a grapheme boundary. It preserves full
original shaping contexts, font priority, GIDs, axis tuples and source colors.
Original font advances and the first native anchor establish positions when
later SVG character addresses are unreliable. Scalar-splitting boundaries and
unsupported/mixed allocations retain the existing candidate preparations.
Cluster anchors are read once; repeated combining glyphs do not rescan a range.
Only complete original ink at both opacity samples and per-color ownership can
publish a result.
Fallback verification also owns a sixteen-plane reference LRU for one matching operation. Hits and misses check source/font lifetimes and cancellation; every candidate still compares all pixels and ownership. Exit clears the cache. These planes never supply working RGB, positions or document/import geometry limits. No public constructor, schema, scripting/REST signature or grant changes.
The identical 751-file isolated source passes build/typecheck, all 3,428 unit/API
checks, all 256 affected source cases, all four original upright identity controls
and all 33 production workflows. Its original colored cohort matches 42/64
layouts, retaining all 38 prior cache matches and adding the four upright controls.
Parent integration 0a36bb8 also passes build/typecheck, all 3,428 unit/API checks,
all 33 production workflows and the focused four-control browser regression.
Its full original main matrix now completes at 352/384 exact layouts, with all
36 independent paint references passing. Remaining native/public/host/performance
and broader roadmap acceptance gates remain open.
Exact evidence and boundaries.
Signed attachment preparation
Review bd15104 retains the original captured pose of zero-advance glyphs whose
native allocation is negative, while advancing glyphs keep source/visual span
placement. Every previous preparation, full original context/font/GID/color and
exact opacity/ownership gate remains. Its canonical build, 3,428 unit/API checks,
eight upright controls, 37 production workflows and 42 independent paint references
pass. Its complete colored cohort matches 44/64 layouts, retaining every prior
match. The source run passes 255 cases; a separately passing canonical test adds
48 references omitted by an obsolete temporary filename. This is two runs, not a
single 256-case run. Main includes the reviewed implementation and also passes
build/typecheck, all 3,428 unit/API checks, all 37 production workflows and the
eight-control browser regression. Its one complete canonical source run now passes
all 256 cases across 46 files, including the 48-reference source-parent test in
that same invocation. Full native and broader roadmap acceptance stay open.
Canonical source completion.
Integration evidence.
playwright.native-text.config.ts names the canonical source, isolated legacy
and fallback files and rejects missing files before discovery. The full runner
includes every original fallback layout and its independent paint references;
the source-only command remains a separate regression surface.
Connected native float text (schema 60, under verification)
The existing OO TextLayer now enters the float scene through
engine/float-text.ts. Capture snapshots typography and world placement before
awaiting native layout, preserves original SVG chunks and owned font tuples, and
publishes source-linear glyph paint only after exact native ink/color ownership
checks. FloatSceneRenderer prepares visible text before output and reuses its
existing intrinsic-mask/clipping/style/shadow/composition paths.
Renderer-owned preparation is keyed by intrinsic text input, alignment extent, world matrix, document geometry and asset owner. Wrapper opacity/masks/styles do not change that intrinsic key. A 16-cell LRU retains canonical 256-square native Float32 RGBA cells; callers receive owned copies. Preparation eviction retains pinned scenes. View cancellation releases only its waiter; cache clear/dispose aborts owner work and invalidates all leases. Every cache hit checks original sources and private glyph registrations. These are cache budgets, not document or image limits. Main integration verification is pending; the preceding isolated nine-case browser and ten-case focused model/API runs passed. See the exact contract, verification scope and remaining work.
Owned font-stack preparation under verification (private)
native-svg-parent.ts prepares complete source-derived parent streams when
cross-span character addresses are insufficient. It retains original font
priority, full text, source advances, the original first-cluster anchor and
original color ownership. native-svg-authored.ts interleaves existing and
original-authored-range selections; the shared range splitter preserves scalar
boundaries without changing DOM spans. Both suspended iterators retire on exit.
Vertical preparations additionally retain native script-dependent spacing and the original primary font's inherited central baseline, measured from native screen-size font metrics. Straight original-span allocation applies at zero tracking too. Visual-span frames retain original source ranges and signed/grid allocations. Every preparation remains behind the complete exact ink/ownership check; existing preparations remain available. These are private engine changes, with no document schema, OO command, scripting, REST or permission change. Current integration and remaining gates.
Negative vertical paths with multiple original spans use complete-source assembly for a single owned font as well as owned fallback stacks. Path span frames sum original native cluster allocations; RTL parent preparation retains the source layout grid before returning to the screen-font grid. Straight frames retain native fragment accumulation. Every original placement and exact whole-ink/color ownership gate remains. Cross-span clusters and broad font/host acceptance are still open; no public model, command, scripting or REST contract changes. Current integration evidence.
native-svg-fallback.ts traverses the original ordered font stack and assigns
whole supported shaping clusters from retained original font sources. Missing
marks invalidate their complete cluster. Each font keeps its effective private
axis tuple; original styles, SVG chunks and source bytes remain intact. Unknown
families before a usable owned source cannot be skipped; an unused trailing
family does not invalidate a fully covered owned prefix.
Private lazy candidates have no matched status or publication authority.
native-svg-candidates.ts preserves the existing single-source exact ink gate;
fallback assembly verifies the complete original line and per-color ownership
before returning any glyph fields. Candidate search first offers common native
preparations across source instances, then retains the complete coherent-source
and independent native-item search. Lazily discovered bounds terminate the
common pass; already visited uniform choices are not repeated. Cancellation and
finite matching budgets remain. An invocation deadline ends with matching/cleanup; retained fonts keep
source/parent/registration/abort checks until explicit retirement. It removes
only identical paint preparations for one retained font
owner. Whole-source script/direction itemization is reused across selected
ranges. The expanded vertical negative-tracking matrix remains under repair;
this is not accepted public Float32 text support.
native-svg-inline.ts additionally retains unclipped complete-source path
geometry and signed start/end anchor separation in disposable native probes.
The vertical candidate stream can preserve signed source/private allocation,
half-grid anchors and zero-advance attachments while retaining existing
projections. Straight negative RTL preparation has a separate native-inline
rounding candidate. These are private candidates with the same complete ink and
ownership gates. The focused eight-layout mixed-vertical pilot now matches all
eight, including the transformed RTL curve; broader fallback and independent
reference acceptance remain open.
Contract and verification boundary.
Native metric projection now measures shaping scale independently from raster
advance size. native-layout-size.ts subtracts an unkerned calibration pair from
the same pair with an original one-em GPOS adjustment. The private CC0 probe has
no artwork dependency; its temporary font retires before returning. Original
native glyph advance/bounds callbacks remain separate. The existing raster size
probe stays intact for its existing projection.
native-svg-inline-frames.ts can assemble complete original single-span signed
advances across font items, rather than infer the inline frame from enclosed
character rectangles. Corrected and existing candidates retain the same exact
ink/ownership checks. native-svg-span-frames.ts additionally prepares straight
original-span candidates from raw native fragment advances and Float32 spacing,
truncating after the complete original span is present. Its RTL candidate retains
an unrounded single-cluster parent and signed extent for multi-cluster spans;
complete ink/ownership checks decide whether this preparation matches. Existing
placements remain available. Cross-span clusters and curved original-span parent
allocation still require further work. Integrated verification is in progress;
this does not admit public Float32 text.
Cross-span source-cluster paint provenance (private)
Private SVG primitives retain original source clusters across projections.
native-paint-order.ts ranks complete horizontal styled lines using captured
native ordering metadata, preserving original shaped order inside clusters.
Exact whole-line ink and per-color ownership remain publication gates. The current corpus is verified; positional-range path anchors retain original
unfolded metadata when measured advance differs from extent. No public document
field or extension authority is added.
Current evidence and remaining scope.
Original script and resolved native direction items
The private native-text-items.ts selects grapheme-safe script/direction ranges
inside existing original spans. Pinned Unicode property data has complete source
hashes and reproducible generation; native whole-source caret/path metadata
retains resolved geometry. native-svg-glyph.ts shapes every item with complete
original line context, assembles original glyph fields and verifies complete
native ink before publishing. A whole-source nonnegative-spacing probe supplies
native visual order/direction only, independently of original paint poses.
Tracked SVG fragment allocation can retain original font metrics through private
paint spacing. Signed tracked advances, native visual order and original GPOS
fragment allocation pass the focused complete-ink and Float32 matrices. The
complete affected source regression passes; broader native bidi paint
ordering, owned font fallback and connected public Float32 text remain required.
Current evidence and limits.
Private styled source-glyph assembly
native-svg-styled.ts selects existing native span items while retaining complete
line text as shaping context. Original font sources/axis tuples are privately
captured; shared horizontal/path/vertical helpers consume selected source ranges.
Whole original DOM chunks remain. Native per-item and complete-line ink checks
plus synthetic per-color scalar ownership weights guard publication. Source
linear RGB/alpha stay independent of verification pixels. This remains renderer
groundwork; full float TextLayer/tool/scene/transport and broader typography
acceptance are required. Contract and current limits.
Private native vertical source-glyph matching
native-svg-vertical.ts consumes captured whole-source orientation and resolved
caret metadata, retaining original UTF-16 context and original TTB/BTT/LTR/RTL
GSUB/GPOS runs. Independent native metrics and selected-glyph SVG origins support
vertical baseline placement. native-svg-verify.ts shares the complete native/
candidate union-ink gate with horizontal and path matching. Private writing/
baseline metadata feeds scalar canonical coverage and ordered linear WASM paint.
No public TextLayer, model schema or extension authority is added. Full float
text/tool/scene/interchange integration and broader typography remain required.
Private contract.
Captured native SVG glyph paint
Captured text plans can match a uniform horizontal source line, including a native curved baseline, to source-owned SVG glyph primitives and linear Float32 color. Retain whole native chunks, complete temporary font data, native cluster metadata and original glyph IDs. Verify complete native/candidate union ink before publication. Private nominal metrics and native advances handle a separate screen-font projection; they are not document mutation or external scripting/REST surfaces. Parent cancellation, font/read/image/URL/measurement lifetimes apply throughout. Full float text, mixed/vertical/fallback/intrinsic work remains required. Contract and limits.
Path decomposition retains original GIDs, native rotation, off-path visibility
and line placement. A whole-source straight textPath probe preserves native
typographic itemization; native-svg-path.ts combines its native inline metrics
with independent candidate SVG advances and original GPOS for baseline replay.
Complete original/candidate ink equality still gates publication. Immutable
derived baseline strings are shared across glyphs, with bounded preparation and
source/parent checks. Private baseline contract.
Private automatic optical font instances
The source-font matcher captures original numeric size before asynchronous work and projects it onto a declared opsz axis before explicit authored overrides. Original range/avar/metric interpolation and complete native advance/ink checks apply; affine placement/device scale do not rewrite the request. No shared native face or public model changes. Full typography/float integration remains required. Contract and limits.
Complete private compressed-font preparation
Selected WOFF/WOFF2 glyph sources now use complete private SFNT preparation; public font bytes/IDs and ordinary registrations/appearance remain. A pinned memory-only WOFF2/Brotli worker and native WOFF Deflate preserve tables, metrics, composites and instructions. Host fingerprint/directory/checksum/identity/native checks share source/parent leases, cancellation and the existing font-job queue. Captured glyph owners cache checked SFNT only for their lifetime. Native hinting requires retained OpenType layout data; private faces disable declared features rather than discard GSUB/GPOS/GDEF. Full float text remains required. Contract and limits.
Native CSS font-instance projection
Private Canvas-run matching snapshots native weight/stretch and closest owned face descriptors before original-source shaping. Shared pure resolution clamps registered coordinates, applies at most one automatic style axis and preserves later explicit authored overrides. Native whole-run comparison selects only supported style/default modes; it cannot infer arbitrary coordinates or mutate source/native registrations. Numeric authored weights retain fractions omitted by Canvas serialization. Frozen metadata and existing queue/lease/cancellation boundaries remain. Contract and remaining native scope.
Private source shaping and native Canvas matching
Pinned full HarfBuzz 15.0.0 runs lazily in disposable private workers. Retained original SFNT sources, exact explicit axis tuples, original UTF-16 context and strict GID/cluster/metric validation feed a captured plan's private glyph owner. A whole uniform Canvas-run matcher compares complete native ink/advance with positioned glyphs, including two opacity samples, before supplying Float32 paint placements. It introduces no text spans, document mutations or new grants. The ordinary byte renderer does not invoke shaping/matching. Full native bidi/font fallback, compressed/missing/intrinsic glyphs, broader SVG/path/vertical layouts and connected float TextLayer remain required. Contract.
Private native glyph paint dependency — full float text remains required
Captured styled-text plans own private glyph-selector fonts and ordered native Float32 glyph fields. The small isolated binary worker preserves original glyph payloads/maps, host validation compares complete retained tables, and native faces retire with source/parent ownership. Per-glyph scalar coverage and actual WASM retain HDR color/source alpha. This does not identify whole native glyph runs or enable float TextLayer. Compressed sources, glyph zero, intrinsic paint and full scene/tool/interchange acceptance remain required. Current contract and limits.
Source-owned native text preparation — float glyph painting remains open
Private captureStyledTextPlan snapshots whole native shaping chunks, captures
original font definitions/leases and line geometry, and supplies the existing
styled bitmap renderer. Optional source-linear color/addressable-character
metadata creates no new spans and reads no pixels. It does not identify glyph
paint primitives or enable float TextLayer. Checked source ownership survives
model/history removal and rejects retirement, invalid geometry and cancellation.
The ordinary renderer skips the extra metadata work.
Contract and remaining paint work.
Native text color dependency — float text remains in progress
Private engine/float-text-color.ts captures authored CSS source colors as
immutable linear Float32 values without Canvas RGB readback. It preserves
extended channels, source alpha and CSS serialization precision, and owns its
probe/cancellation lifecycle. Native glyph painting and TextLayer integration
remain required; float text/tool validation gates stay in place.
Implemented dependency and remaining native paint contract.
Native linear Patch and Spot Healing
Schema 59 adds explicitly native corrected TIFF values, linear private repair preparation and existing Patch/Healing controls. Shared validation, Undo, isolated/plugin grants and independent REST boundaries remain. Full source validation and retained original samples apply before publication. Signatures, defaults, errors, limits and verification status.
engine/float-retouch.ts owns private native sampling/search/solve preparation;
core/float-patch-assets.ts pins complete original corrections, and
engine/float-patch.ts supplies their affine native replay. Shared prepared-asset
validation retains host, isolated, REST and persistence publication boundaries.
Editable native float vectors
Existing VectorLayer/VectorPath commands now support linear solid and continuous gradient color with separate canonical fill/stroke coverage, native compositing, ancestry, masks, clipping and styles. Pen, shape and Boolean controls use the same editable geometry/history. No schema, grant or REST/browser synchronization change is introduced. Signatures, defaults, paint rules and current verification.
Native float clone values (schema 58)
Explicit CloneStroke.precision:"float32" retains unmasked canonical linear
TIFF sources, once-only scalar brush coverage/opacity and native source-over.
Complete originals and identities validate through shared commands, isolated/
plugin/independent REST commits and source-bearing persistence. Trusted Clone gestures now sample a frozen original FloatScene, keep private
native previews, and stage linear TIFF tiles before one-Undo publication.
Signatures, defaults, errors, coordinates and limits.
Editable native float paint
Float PaintLayers now replay Brush, Pencil, Eraser and solid Fill commands using native linear color, shared canonical scalar coverage and once-only unquantized stroke opacity. Ordered editable strokes, private previews, affine placement, masks/appearance, Undo and source-bearing persistence use existing boundaries. Layer is a valid Brush/Pencil target; preserve an existing ordinary mask choice. Prepared HDR wet strokes now join dry paint on the content-local native grid before current affine placement; inert wet records retain the dry rendering path. Explicit native clone source values use schema 58; byte clone values reject. Current signatures, coordinates, defaults, errors and isolation.
Prepared HDR wet document replay (schema 57)
WetPaintStroke.precision:"float32" versions authoritative linear TIFF pairs.
The shared model rejects byte-document/mask misuse and false schema ages.
validateWetPaintAssets routes HDR values through complete native original pair
capture while byte values retain PNG validation. FloatSceneRenderer pins every
HDR source before publishing, captures fields on each modifier's original grid,
and replays wet/erase/clear in order before current layer projection. A finite
expanded native source retains off-image paint; zero opacity does not choose it.
Only actual HDR tile reference objects bypass byte-role checks, never every use
of their asset ID. Public OO/isolated/REST/history/project/workspace/recipe
transport reuses existing references and commands. Trusted authoring selects
Float32 sessions for raster artwork and byte sessions for mask coverage. It owns
a neutral FloatScene, stages lossless TIFF pairs, shares the existing private
prefix/lease/commit lifecycle and checks original interpretation references as
well as bytes/geometry. Tool admission and the UI registry enable supported
float targets. Broader release gates remain required. Full contract.
Shared HDR wet asset ownership
Private captureHdrWetAssets pins ordered native references through the shared
browser/headless WetAssetProvider; captureHdrWetAssetField connects that owner
to Float64 field reads. Both use complete original TIFF pair validation from
float-wet-tile.ts. Reusable Blob-pair proofs do not bypass geometry, source,
cancellation or lifetime checks. Byte preparation keeps its native PNG contract;
HDR uses no thumbnail color/alpha. The schema 57 integration above connects these
owners to document replay. Signatures, ownership and limits.
Retained masks in the float appearance cache
The bounded native appearance key includes complete retained-plane data and the native dimensions of an asset-backed geometry grid. Raw rectangle coordinates alone are insufficient after a captured perspective is reset. Grid pixels and thumbnails do not enter this geometry dependency. The existing eligible linked rectangle path still reuses completed float pixels for unchanged metadata and integer moves; normal scene capture validates current sources and lifetime before any hit. This changes private invalidation, not document data or grants.
Float mask tool selection
ToolController.canChooseTool distinguishes selecting a tool from starting a
gesture with its current settings. In float documents the UI registry and rail
permit Brush/Pencil selection when an ordinary mask exists. The shared
chooseTool handler sets Mask Hide only when the existing paint target is
incompatible. canUseTool remains the gesture guard, so a direct attempt to
paint float artwork with byte color tools still rejects. Mask values, commands,
native scene rendering, schema and script/plugin authority remain unchanged.
Retained mask-plane increment (schema 56)
The current implementation retains native grid/source provenance and editable mask geometry through projected relinking, shape capture and mapped Brush/Wet fields. Filter masks retain their original native/document mixing phase. Shared OO commands, independent REST sessions and existing isolated/plugin authority remain. Verified tool/export/production behavior and remaining broader acceptance are recorded in the current contract and verification boundary. Earlier scalar-dependency/reset limitations below describe the prior accepted baseline.
Retained scalar-field mappings
mapped-field.ts captures an invertible homogeneous pull matrix with independent
input/source origins. It preserves compiled coefficients without normalization
or another corner solve, and compiles the existing scalar WASM ABI. Native and
worker boundaries validate owned maps, geometry and coverage. Both field entry
points share the same bounded streaming/culling/horizon/cancellation code.
Ordinary linked-mask capture retains its compiled map; forward brush transport
keeps its existing corner/input contract. The public mask model and linkage
guards remain unchanged. Retained native-grid provenance, public mask planes,
tools and transport still need integration before projective relinking ships.
Projected wet composition bounds
projected-wet.ts samples each complete canonical native field window before
bounding its pointwise byte composition by nonzero removal coverage. Replacement
alpha alone cannot bound transparent pigment that clears existing artwork.
Conversion, scratch surfaces, readback and optional once-only opacity mixing use
that integer rectangle; untouched target pixels stay in place. Four nonzero
coverage corners prove full-window bounds without a dense scan. Native sampling,
source validation, cancellation and the coupled-field invariants stay unchanged.
Conservative projective field footprints
Bounded scalar and coupled wet-field windows retain the existing homography, canonical grids, complete bilinear support and native ROI budgets. After the ordinary axis bounds test, constant-sign mapped rectangles may be separated from expanded finite support using convex edge normals. Conservative dot/division roundoff bounds and projection tolerance guard the proof. Horizon branches still split; unknown support and uncertain arithmetic retain native sampling. This only avoids reads/worker packets for proven empty windows, preserving background, source/cancellation validation and all source geometry and public boundaries.
Private wet footprint surfaces
Native wet sessions own a lazily allocated 260×260 coverage surface, reused on the same fixed native cell/gutter grid. Borrow resets transform/compositing state and clears all pixels; drawing and texture sampling remain unchanged. Keep at most one idle surface per session. Concurrent borrows cannot share live pixels; disposal closes idle storage and rejects late output while borrowed textures retire through finally. Custom coverage callbacks keep their existing behavior. The session cleanup owns the pool; prepared array snapshots do not reference it. No public model, command/history, source geometry or extension boundary changes.
Wet feedback and compact native pigment
Live wet sessions retain each carried float cell's complete intersection with
the captured dab support, on the same absolute native lattice. Destination and
original cells stay complete. wet-spatial.ts captures explicit carried-cell
geometry before awaits, rejects missing/inconsistent support and gathers the
same four bilinear neighbors in the same double-precision summation order.
Legacy dense internal fields remain readable. Processor output is owned before
cache writes; native resident/evicted/zero-cache and custom-store failure paths
retain the existing epoch and snapshot boundaries. No field is clipped to a
viewport, image rectangle or nonzero-pixel estimate.
Completed tool prefixes enter the existing viewport queue directly, retaining a frame lease before async preparation. The renderer checks original document, source/host assets, proof, view, backend, gesture owner and lifetime; React later acknowledges that exact frame without preparing it twice. Existing cadence and stale-frame cancellation remain authoritative. New-owner/view transitions retain normal admission. Public commands, schema, prepared PNGs and grants are unchanged. Production timing and exact before/after output verification are tracked in the roadmap; the full sustained all-tool/device performance gate remains open.
Captured projected wet fields (schema 55)
wet-authoring.ts captures original image/master dimensions, perspective and
owner-local-to-image basis while preparing neutral projected pixels/coverage.
Tools author the full brush field in the affine image plane after H. Default
local preparation samples intrinsic content before H; unlinked masks remain
local. projected-wet.ts reconstructs ordered tiles on their prepared native
grid, then streams a five-channel premultiplied replacement/alpha/removal field
through the existing native homography and bounded-ROI machinery. Reconstruction
precedes current layer placement; mask-wide settings apply afterward. Mask
horizon support is unbounded, while finite artwork rejects it atomically.
The worker copies and validates owned inputs/replies; renderer captures pin original sources and reject stale lifetimes/geometry. Preview assets remain private until shared command publication; revision and full ordered-selection changes retire gestures synchronously. Schema 55 gates every owner/history/ embedded context without changing project/workspace containers or privileges. Raster conversion with extended intrinsic wet support uses the existing containing-master conversion, retaining its masks, originals and halos. Exact contract and current limits.
Native Node worker startup
Trusted REST native workers share server/typescript-worker.mjs. It rejects
main-thread registration and registers the existing tsx ESM loader within the
worker before dynamic TypeScript imports. Each worker owns its module graph and
cache; parent startup flags are unnecessary. This avoids scoped tsImport
namespace queries on Node builtins, which fail as file reads on Node 26.
tsx registration contract.
All twelve native entrypoints use this boundary: RAW, TIFF preparation/window reading, PNG validation, font preparation, preflight, vector Boolean operations, selection modification, Color Range, Quick Selection, Select Subject and matting. Existing worker requests/results, native code, queues, termination/cancellation, source ownership and shared OO commands/history remain unchanged. This is trusted host module loading; third-party scripts/plugins keep their separate isolated execution boundary and grants. This bootstrap adds no loader to the API parent; the host keeps its existing TypeScript entrypoint setup.
Independent masks inside smart masters
Smart conversion rebases unlinked ordinary/filter masks into the containing master document while retaining their independent relationship. Ephemeral expansion carries a separate master-to-output affine frame through nested instances; child pose and perspective never become mask linkage. Renderer root/document transforms adapt that frame once, while root document masks keep their existing coordinate contract. Full-frame projected children retain their perspective. A redundant master clip is omitted only for a sole ordinary raster whose complete intrinsic support is contained; out-of-artboard perspective or prepared wet support keeps the clip. Sources, shared commands/history, schema, isolation and separate REST sessions retain their existing boundaries.
Placed coverage back to original pixels
Private scalar-field sampling now supports both quad-to-source and source-to- quad pull mappings. The original authored corners remain authoritative; the forward mode rebases its finite coverage lattice around a fixed field center, keeping large placement out of interpolation and preserving partition identity. Captured masks share the direction flag, asset/lifetime checks, native output feathering and working budgets. This is the native dependency for complete clipped/symmetric brush coverage on projected originals. Public controller and history integration remain required; document schema and grants stay unchanged. Contract.
Schema-50 image perspective placement
Raster and smart-object instances retain normalized four-corner placement through an immutable public PerspectiveTransform and shared layer.update commands. Affine parent transforms stay independent. The bounded original-pixel reader feeds the native sampler; float scenes retain original-derived float windows. Masks project before document-space feather; geometric bounds/hit tests use projected coordinates. Active perspective falls back from the affine WebGPU compositor. World-to-local tool mapping remains gated where still affine. App's perspective gesture captures the actual document, revision, ordered selection, original corners and inverse affine basis. PerspectiveCornerDrag maps canvas displacement into one normalized corner; GesturePreviews validates its shared update without attached mutation. Pointer-up commits once. Owner, selection, revision, tool/modal, pointer and blur cancellation discard the draft; keyboard nudges use the same constructor/setter. The overlay owns fixed screen hit areas and scoped keys, not document data. Numeric controls remain available. Current contract and required follow-up.
Native float tonal strokes
core/float-tonal validates controls; private tonalFloat WASM applies linear
exposure to straight float windows with exact alpha and finite-output checks.
PixelProcessor captures source/coverage/settings before readiness and validates
reply geometry/alpha words. The scene applies strokes sequentially before layer
interpolation. Canvas supplies fixed-grid renderRetouchCoverage with affine
planes and texture ownership; only coverage enters a byte canvas.
applyFloatTonal captures inputs and transfers the nonzero rectangle, retaining
complete-window validation. Preview DTOs append transient strokes; existing
commands/gesture authority own commits, cancellation and Undo. Public
constructors, document schema and permissions stay unchanged. The existing
precision command accepts optional prepared-source mappings. Trusted conversion
stages a native asset view from the same original Blob; attached commands verify
original identity, page, source-color choice and geometry before rebinding.
Precision and source references commit together, with the byte bitmap retained
for Undo. Cancellation/stale preparation releases newly staged views; recipes
explicitly reject recording conversions whose prepared sources cannot travel.
Bounded native float source staging
The preparation worker groups at most eight unchanged encoded tiles behind one
host acknowledgement. FloatTileRepository.appendBatch verifies every tile's
geometry, compressed/raw hashes and native samples before one atomic staging
transaction. It captures metadata and Blob identities before awaiting validation,
so caller mutation cannot retarget the stored bytes. Failure leaves that batch
unstaged; ready publication still requires
the complete ordered manifest. Conversion bands, source geometry, cache formats,
native CMM ownership and separate read budgets remain unchanged. See
FLOAT_SOURCES.md.
Native float appearance
core/float-style compiles strict existing LayerStyle data into linear overlay colors and continuous sRGB selector ranges. The private styleFloat WASM operation returns unchanged-alpha colors and separate float coverage. Captured worker inputs/results remain owned and validated; float-scene applies appearance after intrinsic/clipping construction and before existing mask/fill/opacity/blend. Adjustment interpolation preserves backdrop alpha. No schema or public mutation surface changes. Contract.
core/float-shadow validates the private alpha protocol; convolveAlphaFloat
computes normalized finite Gaussian axes in owned worker/WASM memory.
engine/float-shadow coalesces intrinsic-alpha halo reads within existing native working budgets and retains a
capture-local 16 MiB LRU of Gaussian alpha fields. Source rasters remain native;
only alpha enters convolution. Capture disposal clears these fields. Scene
recursion carries each native region through groups, masks and clipping before
final frame filtering. Ordering and limits.
Direct pointer preview admission
ui/gesture-previews owns one detached snapshot produced by the shared command
validator before React updates controls/overlays. The actual Document owner,
immutable source, ordered selection and pointer gesture bind its authority.
useCanvasRenderer subscribes directly for a warm, stable presented context;
React reuses that exact snapshot instead of repeating validation/preparation.
The drain remains single-active, consumes the latest queued preview and admits
at most one start per animation frame within a gesture. A ready first warm
preview need not wait an extra frame. New owners and view-only work retain
normal admission. Source/owner/selection/gesture/context changes, clear and
cancellation reject stale output; equivalent selection values remain valid.
Private previews never mutate attached artwork/history or retarget a new owner
or source. Actual commands still commit once through the existing OO boundary.
App observes owner, revision and ordered layer-selection publications synchronously
for move/mask, resize, rotation and selection scaling. Selection-only changes do
not advance revision; a change followed by restoration in one task still cancels
the gesture before another pointer event or release can commit it. Equivalent
ordered IDs preserve valid work. Same-owner panning is independent of selection.
No public API, format, source resolution, cache/worker budget or grant changes.
Bounded native float viewport appearances
engine/float-appearance retains one complete native float appearance of at
most 262,144 pixels (4 MiB), including finite shadow support outside the artboard.
A single unmodified native raster, optionally with a linked hard rectangular
mask, can reuse that appearance for exactly representable integer moves in an
aligned 100% view. The key captures all intrinsic layer/source interpretation;
weak original-Blob identity does not retain a source lease. Every render still
captures/prepares current sources, checks lifetime/cancellation and runs the
actual native display/proof transform. Hits avoid derived-source tile rereads;
the retained samples were validated on construction from the immutable original.
Other geometry/graphs/styles use the established renderer. cache:false
bypasses the appearance; clear/disposal drops it. No delivery/native-read,
public mutation, history, serialization or isolation boundary changes.
Native float device proofing
Explicit source/display/device CMM transforms consume genuine float samples. FloatSceneRenderer captures proof settings, composes/filters native pixels, then borrows a proof-keyed display owner. AdaptiveRenderer skips the old byte proof pass for float frames. Native settings preflight, conversion, workspace ownership, cancellation and complete-frame publication retain their host boundaries. Contract and current verification.
Continuous float palette and lookup controls
Private float-gradient compilation feeds gradientFloat through owned windows. FloatLookupProcessor validates complete captured tables and owns separate native lookupFloat memory; multiple immutable handles share one active native table cache. PixelProcessor captures headers before readiness and returns private apply/dispose leases. FloatSceneRenderer prepares and releases leases with captured source lifetimes, including cancellation during preparation. Existing adjustment blending and native-first frame filtering remain unchanged. Cube header capture is private transport validation; shared commands retain full table validation. Exact contracts and verification.
Continuous float color controls
core/float-color strictly captures the three existing DTOs and compiles a private discriminant/control vector. The owned worker calls the new native colorFloat export through bounded windows. Native float64 sRGB transfer/control math rounds color once to float32 and copies alpha. Neutral copies words after finite/alpha validation; active processing validates complete normalized RGB. float-scene runs these stages before existing adjustment blending/coverage and native-first frame filtering. Old native exports retain their contracts; stale pixel modules lacking colorFloat reject explicitly. No public mutation API, schema or host privilege is added. Exact controls, defaults, errors and limits.
Initial float document workflow (F10)
core/float-document gates scene structure and asset roles. engine/float-asset admits originals with bounded display-only thumbnails; float-scene captures original and coverage-source leases, uses float-projection and native float operations, applies each authored erasure through float-coverage before intrinsic clipping shape, runs continuous Curves/Levels through the owned native transfer worker, and converts only final display/output samples. float-delivery/float-tiff own profile-aware file sessions. Model/OO/shared command schema 49, independent source caches and existing host/isolated boundaries remain separate. Exact signatures, defaults, errors, limits and verification.
Captured float White Balance
core/float-white-balance compiles the existing D65-relative control model into
a private RGB affine matrix or exact-neutral identity sentinel. The shared float
gate admits its strict existing DTO. float-scene captures one matrix per layer
before source preparation, applies it through the existing owned native affine
worker, then uses the existing adjustment blend/coverage path. Disposal clears
compiled stages; captured document/source lifetimes remain authoritative.
No byte proxy, new native export, public mutator, schema or plugin grant is
introduced. Contract and remaining scope.
Connected native float blend modes
The float document gate and custom Inspector admit every existing blend enum.
The generated isolated runtime must be rebuilt from that same model validation;
source-host success alone does not establish sandbox support.
engine/float-scene passes raster, isolated group and restored clipping-base
modes to the native float compositor. float-adjustment-blend computes opaque
blend colors, restores the captured backdrop alpha and uses coverage
interpolation; Normal retains its prior exact path. Complete normalized RGB is
required for artistic modes; finite extended Normal remains supported. Pixel
failures publish no output. useCanvasRenderer retains a failure until a current
successful presentation; App hides stale artwork and shows a persistent preview
error instead of Ready. Source ownership, native-first frame order, OO/history,
script/plugin grants and separate REST remain unchanged. Contract and remaining
HDR/precision/performance gates: FLOAT_DOCUMENTS.md.
Native-first float frame sampling
engine/float-scene resolves the captured scene on native world pixels;
engine/float-frame projects the completed finite artboard with the existing
premultiplied float sampler. Frame geometry is captured before awaits. Native
world reads retain outside artwork, while framed reads clip the artboard and
cover its transformed boundary once. Aligned grids preserve exact native words;
nonaligned transparent samples canonicalize RGB. Coverage allocations split wide
or tall work without limiting source/document geometry. Fitted float file reads
already used native-first sampling; fitted canvas previews now share that order
and skip the byte path's extra margin clear. Source leases, cancellation, native
ICC display, OO commands and separate headless REST remain authoritative.
See FLOAT_DOCUMENTS.md for the current contract and limits.
Owned float source storage dependency
Trusted host leases now prepare original-derived, lossless float32 tiles with atomic IndexedDB publication, independent ownership, bounded reads and original-backed corruption repair. The default byte mode remains sRGB8; the initial connected float mode is documented in FLOAT_DOCUMENTS.md. This adds no isolated grant or browser/REST synchronization. Source contract, budgets and remaining integration. The complete roadmap remains active.
Float processing dependency
Private native/worker float32 compositing and affine windows now supply a precision-processing dependency. Default byte documents remain sRGB8; the connected float subset is documented above; no new isolated grant or REST/browser synchronization is added. Numeric contract, verification and required integration. Full F10 and the original roadmap remain open.
Normalized float TIFF input increment
Float TIFF decoding reconstructs original float samples in private workers, applies native ICC before sRGB8 quantization and shares the existing ICC owner queue. Whole-document import guards cancellation, revision and session ownership; original bytes and decode choices remain authoritative. See the input contract and current limits. Full F10/F11 and the original roadmap remain open.
Native RAW master TIFF
Trusted editor.exportRawTiff captures a File or current retained RAW smart-object source and immutable RGB output settings. The private RAW TIFF worker performs native linear RGB16 development/lens sampling and CMM conversion into core/tiff-encoder uint16/float32 tiles. It shares RAW and ICC owner leases; tiff-client validates actual bounded decompression, complete ICC and source/settings/native receipts before publication. Current scene, command/history/persistence and isolated/REST boundaries remain unchanged. Contract.
Explicit RGB precision dependency (F10)
core/color/icc-native compiles explicit RGB input/output profiles over straight RGBA uint8, uint16 and float32 windows. The separate prepareRgb/applyWindow worker protocol uses the same two-owner semaphore, strict settings/result validation, cancellation and owned buffers as legacy sRGB8 proof/output. Native finite/alpha checks and pointer bounds precede publication; mutable returned reports cannot change compiled formats. This internal dependency adds no document/public scripting/REST/renderer or persistence contract. Working-space and high-precision scene integration remain required. Contract.
Profile-aware batch and recipe delivery (F10/W01/W03)
core/color/output-record defines cloned source/receipt DTOs; output-source performs native inspection/hash/compilation. ai/batch/delivery-preset owns the strict source-bearing container; delivery-contract fingerprints settings and verifies accepted receipts. Runner pins original raster/font sources around fitted encoding, and storage owns complete sources/snapshots. Recipe schema 3/package 4 carries a separate delivery preset outside document commands; shared recipe commands/history and private file boundaries remain authoritative. Contract and current verification.
Connected ICC browser workflow (F10/F11)
core/color/profile-source owns immutable inspected ICC resources; color-settings normalizes guarded host preferences; workspace v3 retains complete profile sources. engine/icc-proof applies a fingerprint/settings-keyed transform only to the final private viewport frame, bypassing GPU presentation while proofing. engine/icc-output converts raw native RGBA8 readback directly before PNG/TIFF/PDF encoding; alpha and original target bytes remain independent. UI settings preflight atomically, and stale gesture/proof frames cannot present. That byte workflow stays sRGB8; the initial float mode is documented above; file services remain outside document mutation, isolated scripts and independent REST. See ICC_ENGINE.md for contracts, migration and remaining precision/device gates.
Editable SVG geometric clipping (F02/F11)
core/svg-clip-import compiles readonly local definition graphs into owned cubic silhouettes. It shares the bounded pure core/vector-boolean-kernel with the existing isolated worker entrypoint. Union preserves separate child fill rules; nested clips intersect. Definition styles, source geometry bounds, viewport percentages, bbox content transforms, root viewBox compensation and use placement remain separate. core/svg-import attaches OO LayerMask values, reusing existing group/use owners and wrapping graphics whose host image/text preparation can change their local origin. Authored hard vector masks serialize as clipPath definitions; generated smart viewport boundaries keep private identity-based alpha-mask sampling, while advanced mask controls keep alpha/native coverage. Host admission still validates the entire private document before publication. No schema, command authority, source-resolution or isolation boundary changes. See SVG_CLIPPING.md.
Sibling clipping stacks (F02)
Schema 48 adds optional LayerBaseData.clipped and the shared OO/command flag. core/clipping derives consecutive sibling stacks; orphan members and members behind an adjustment-only base have no intrinsic coverage. engine/clipping prepares a temporary color plane, composes members and restores base alpha once. Base fill precedes members, then the existing base mask/styles and final opacity/blending apply. Pre-fill alpha remains separate for shadows. Pass-through bases become isolated intrinsic groups. Raw cache surfaces remain independent; completed base-only shortcuts are disabled for active clipping stacks. Canvas fallback covers GPU clipping; SVG bakes affected prefixes; Photoshop retains supported individual pixel clipping records and bakes unsupported stacks with explicit loss reporting. Source-isolated preparation preserves the public outer relationship. Contract and remaining scope.
Bounded working-surface recursion carries its captured member/backdrop context. A member remains an eligible member when rendered alone into its private window; nested group children still resolve their own sibling stacks. Never reinterpret that private render as a public orphan or clear the authored flag to work around it.
Compact vector working surfaces
The Canvas compositor uses nativeVectorFootprint for eligible normal-blend vector working windows and compact raw/finished cache retention. The existing canonical native grid still rasterizes paths, and windows stay on the original output-pixel lattice. Masks/overlays do not expand vector ink; shadow support is propagated using the established effect halo. Other compositing conditions retain their full working path while raw retained pixels can remain compact. Cache-disabled rendering preserves the full native reference path.
A private WeakMap retains only geometry keyed by registry-proven complete immutable path arrays. Bounds returned to callers are owned copies; layer placement, parent transforms, styles and allocation windows remain separate. Unregistered/caller-frozen arrays and mutable descendants are remeasured. Shape edits and restored/reopened owners naturally select their corresponding array identities. No public mutation/model/format/permission boundary changes. The dated roadmap records production profile evidence, exact pixels and remaining F14 scope.
Declared alignment inspection (A12)
Design checks now accept optional explicit alignment rules against a canvas or independent key-layer frame, with document-pixel tolerance. Shared authored geometry includes affine parents, path/vertical text origins and active wet-paint/raster-replacement extents. Locked references remain readable; hidden targets, empty/unknown geometry and unresolved numerical precision remain explicit unverified results. Geometry work stays in private workers with scoped metadata and existing read/asset grants. Inspection changes no artwork/history or source bytes.
Omitted alignment policies retain strict version-1 reports; explicit policies use version 2 with measured evidence and complete matched/mismatched/unavailable/excluded coverage. The custom dialog exposes reviewable rules, stale-result protection, download/navigation and document-instance binding. Document schema 47 and existing native project/workspace/permission contracts are unchanged. Inferred alignment intent, bleed, rendered visibility, contrast/legibility and broader A12/roadmap gates remain required. See DESIGN_CHECKS.md for signatures, defaults, errors, limits and the dated verification boundary.
Public vertical text (F08)
Schema 47 adds optional TextLayer writingMode (horizontal-tb, vertical-rl, vertical-lr) and textOrientation (mixed, upright, sideways). Shared OO setters/commands, reusable paragraph formats and awaited native preparation retain logical Unicode and character/font ownership. Vertical wrapping uses the existing logical wrapWidth as physical height. Derived textFrameOrigin and textInlineExtent separate the physical frame from its logical alignment extent; client patches cannot author these caches. Native paths retain their separate textPathOrigin. Defaults preserve legacy horizontal rendering; text that has entered native writing retains its native character-layout marker when switched back to horizontal.
The custom Inspector exposes writing direction, glyph orientation, paragraph height and vertical alignment. Corner resizing follows the inline axis and keeps the opposite frame corner under affine parents. Native projects/workspace/recipes preserve source text, geometry and complete original font/image payloads. Supported native SVG output/reimport retains writing/orientation and whole-line placement; unsupported inline writing/baseline graphs require explicit flattening. Independent REST sessions preserve the fields with estimated headless bounds; they do not synchronize with the browser. See VERTICAL_TEXT.md for the precise contract, limitations and dated verification status. Broader typography/interchange/device/performance and the original roadmap remain open.
Native vertical preparation boundary
Private character-layout/styled-text DTOs accept normalized writing mode and orientation. Native SVG supplies whole-line vertical advances, ink and font substitutions; the shared logical line breaker maps inline coordinates to physical columns. Derived physical origin/extent stays separate from source and caller window transforms. Existing font/source leases and checked bitmap cancellation/release apply. The public schema-47 adapter and native metric/command/transport integration described above use this dependency; the private writing DTO is not a separate public mutation API. See VERTICAL_TEXT.md.
Public baseline ownership and frames
Schema-46 TextLayerData stores authored textPath and derived textPathOrigin beside width/height. OO TextPath values own geometry; attached setters/awaited native preparation submit shared layer.update commands. core/character-layout measures the actual native path and returns a local frame origin without rewriting anchors or layer translation. spatial/preflight/resize consumers include that origin. The existing owned-font surface renders matching baselines; native projects/recipes and measured SVG output retain geometry. The typography broker returns finite bounds/origin and host commit independently validates/recomputes. See TEXT_PATHS.md.
Canvas text-baseline gestures
ToolController stages authored TextPath geometry independently of the document. It captures the owner/revision/selection and inverse complete layer transform, performs screen-space anchor/handle/curve hit testing, translates both handles with anchors and supports Alt-independent handle movement. Frame-coalesced previews contain owned changed anchors and shared immutable remaining geometry. Pointer release rechecks authority and uses the existing OO setter/shared validation in one history transaction; cancellation, selection/revision changes and locks publish no stale edits. CanvasOverlays reuses complete Pen controls, affine translation precision fallback and memoized blocks, drawing open baselines without a closing segment. Nudge uses document-space deltas; masks retain their separate target. This adds no document schema, scripting capability or shortcut binding. See TEXT_PATHS.md.
Native curve preparation
core/text-path snapshots existing cubic anchors and projects reversed/open/closed baselines with a stable closed seam. engine/styled-text uses private SVG textPath fragments, shared owned fonts and the existing checked bitmap lifecycle. Geometry metrics stay in local user coordinates while the caller chooses the pixel work window. The render DTO stays private; current public integration is documented in TEXT_PATHS.md. See STYLED_TEXT.md.
Styled SVG preparation records
SVG inspection keeps unresolved character ranges in optional private text-placement records, outside its uniform placeholder document. The host validates ranges/ownership and rejects already formatted placeholders, privately matches each effective style to canonical font resources, declares selected sources, then applies one shared character update per line. Native whole-line geometry establishes the alphabetic anchor under the original affine hierarchy. Complete clean documents alone are published; public OO/command/plugin boundaries are unchanged. See SVG_CHARACTER_IMPORT.md.
Character formatting integration
Optional schema-45 TextLayerData.characterRanges stores sparse source-indexed overrides. Public constructors/TextLayer methods mutate through existing layer.update validation/history. core/character-layout shares native SVG measurement between synchronous commands and cooperative async preparation, with explicit estimates without a DOM. engine/styled-text-layout retains font leases around metrics/bitmap work. Canvas/SVG output consumes matching native lines. The private scripting broker returns finite bounds only; final host commands independently remeasure and recheck revision, grants and sources. See CHARACTER_TEXT.md for the contract, limits and dated verification status.
Native styled-text preparation groundwork
engine/styled-text snapshots explicit visual lines and per-span character formats, measures native SVG geometry and returns a checked, owned bitmap for one pixel work window. Whole-line shaping, complete selected font bytes, independent source leases, cancellation/failure cleanup and physical alignment remain explicit. This internal boundary now supplies explicit character-range text; omitted-range legacy text retains its Canvas path. See STYLED_TEXT.md.
core/character-format and core/text-ranges define private source-indexed format/edit projections. The shared line breaker supplies identical request sequences to synchronous and cooperative asynchronous measurers, with source-aware cache keys only when requested. engine/styled-text-layout consumes native whole-line SVG advances for wrapping/justification and per-font baseline offsets, then prepares the same checked surface. It retains source leases before awaits and snapshots font declarations for later raster work. Public integration uses shared OO commands; these internal DTOs publish no document mutations.
Native font variation instances
core/font-variations validates authored CSS tuples; fonts/variations resolves immutable requests to separate private binary FontFace instances owned by the source registration. Base registrations remain shared between active stores. Preparation, restoration, immediate sharing and staged promotion retain complete selected native bytes before installing a native entry; a destination can activate them independently after the source closes. Captures pin exact instances before raster work, retain original bytes, validate native state and release leases on success/failure. Unpinned instances use a 64-tuple cache budget; original font/document geometry is unchanged. Source activation and public-font notifications remain distinct from private alias creation. Shared schema-44 commands, OOP members, style inheritance, isolated preloads and independent headless REST use the same field. Acceptance evidence and remaining coverage are recorded in the dated roadmap; see FONT_VARIATIONS.md.
Immutable geometry queries and palette availability
layerBounds privately retains successful canvas-space bounds only for complete roots proven immutable by core/immutable. Keys include the exact document root and layer ID, so shared children, repeated IDs, parent edits and Undo remain scoped correctly. Mutable DTOs, command drafts and caller-only freezing retain fresh traversal. Cached records never escape: each returned bounds object is independently owned, and missing/empty results do not populate arbitrary keys. Palette alignment availability reads the current internal readonly model through the existing pure planner instead of serializing an owned document for each action. Public toJSON() ownership, validation, commands, history and extension contracts are unchanged.
Text update measurement boundary
The shared layer.update reducer preserves cached authored dimensions unless the request includes text, metric/layout fields or legacy explicit width/height normalization. Presence rather than value difference preserves intentional same-text reflow. Linked paragraph bindings resolve only for requested format changes; unrelated edits retain sparse legacy cached fields. Style-library/application/reset commands keep their existing explicit reflow behavior. No model/schema, renderer or extension boundary changes are required.
Shared alignment planner
The read-only layer-layout planner resolves independent roots, stationary reference bounds and parent-space translations from one snapshot. The layer.align reducer changes only validated x/y fields, preserving authored text bounds rather than reflowing against another font environment. OO handles, REST DTOs, isolated commits and semantic recipe recording share this command. See LAYER_ALIGNMENT.md for defaults, examples, errors and verification limits.
SVG font/text reconstruction
The inert XML worker uses pinned CSSTree token/URL/declaration parsing and transports original font Blobs plus validated baseline placements. The host privately prepares native resources, resolves canonical family/style/stretch/weight choices, remaps source aliases and reconstructs TextLayer/FontFile values through OO commands. Temporary registration brackets synchronous layout after asynchronous source/image work; only the final accepted document adopts independently owned sources. See SVG_FONT_IMPORT.md.
Portable font recipe boundary
Recipe schema 2 holds strict face dependencies and existing font command actions; package container 3 reuses shared core font payload capture/encoding/decoding. Recorder history owns dependency metadata while RecipeService snapshots source Blobs. Private font preflight brackets synchronous native planning without holding registrations across awaits. Package execution borrows current sources, prepares a detached Document and stages destination font leases before one ordinary command commit. Batch inputs snapshot package bytes and use the same preflight/admission/persistence path. See FONT_RECIPES.md.
Font-file binding (F08)
Document schema 43 supports separately owned font resources, shared FontFile commands, explicit trusted embedding and native-project 5/workspace persistence. Selected native fonts preload into isolated script workers before text construction; no font chooser, host store, credentials or network grant is exposed there. Portable recipe/package/batch transport is documented separately in FONT_RECIPES.md. Broader font/viewer/device/mixed-source acceptance and professional typography remain open. See the current font-file contract and limits. Earlier font-source sections below describe read-only inspection/preview; explicit embedding is a separate operation.
Font resource ownership
FontSourceStore stages temporary leases before async result publication and releases unadopted/cancelled results, including publication-microtask races. Document views register weak ownership callbacks covering current and complete retained history; an internal store observer collects unreferenced managed records after model/history publication, including observer-failure paths. Explicit host preparations remain caller-owned until adopted. Exports release their pins in finally; retained wet sessions release captured sources when native processing finishes, fails, aborts or is disposed, while completed output tiles retain independent storage. Independent native leases survive other stores closing. FontFile relinking prepares outside synchronous transactions, then adds/replaces/removes through shared commands in one history entry. Source loss rejects navigation before publication. No model/project/workspace/history schema bump or isolated source-import grant is introduced. See FONT_FILES.md.
Font-file source boundary
src/fonts/{parser,sfnt,types} indexes actual containers, validates paged metadata, extracts whole TTC/datafork faces and preserves source identity. Pinned Fontkit executes in a disposable module worker; client owns FIFO scheduling, strict response/digest checks, timeout/cancellation and unregistered native validation. EditorApplication tracks/disposes its font jobs independently of document mutation. The lazy FontSourceInspector registers preview faces only in a same-origin, script-disabled child document and cleans them on replacement/unmount; the visible parent canvas receives only copied pixels, and resizing redraws the sample. No image AssetStore/model/history/schema change or isolated/plugin/REST privilege is introduced. Binary font persistence and document binding remain unfinished. Build-time parser notices and the complete API/lifecycle contract are in FONT_SOURCES.md.
Cold plain-text working geometry
The Canvas viewport bounds eligible normal-blend text to fresh native glyph ink before allocating its content surface, using the existing bounded shadow/raster path. Whole-line shaping, ink overhangs and the exact output-pixel origin remain unchanged. Missing ink metrics, backdrop-dependent processing, live affected layers and non-beneficial bounds retain the full path. Export/reference renders with cache:false remain the independent full-surface comparison. Compact retention alone does not bound cold drawing work; see the dated F14 roadmap evidence.
Document font-management boundary
core/font-management derives owned usage metadata and transforms a private command draft, resolving paragraph inheritance while retaining explicit overrides. document.font.replace uses shared reflow and component.replaceAll lock validation. DocumentFonts is an OO collection; the custom dialog pins owner/revision and shares permission-triggered installed-family discovery. Strict REST and semantic recipes use the same command. No font bytes, schema change, isolated grant or browser/headless synchronization is introduced. See FONT_MANAGEMENT.md.
Layer-row presentation and event ownership
LayerTreeRow contains presentation only. It retains a render only for registry-proven immutable node/thumbnail snapshots with complete shallow equality across all props. Unproven previews render afresh. LayersPanel delegates row click and drag events through contained data-layer IDs, resolves current OO handles at interaction time and uses the current committed callbacks, modifiers and disabled state. Raster/paint rows retain committed-document, pixel-service, fallback and pause dependencies for LayerThumbnail; ordinary thumbnails still derive their branch keys. Selection, locks, collapse and drop feedback remain explicit row inputs. No callback or document handle is hidden in a retained row.
Immutable layer queries
core/model shares a private WeakMap index for findLayer and inherited isLocked queries, keyed by the exact document root only when core/immutable proves recursive immutability. The first query walks that root once; subsequent queries reuse layer references and effective locks. Keys do not use persisted IDs or child identity, so shared subtrees, independent documents and undo/redo states retain separate ancestry. Mutable command drafts and shallow-frozen caller roots retain fresh traversal. The index exposes no mutation API or serialized data and adds no source-resolution or layer cap. Runtime correctness, release and performance acceptance are recorded in the dated roadmap.
Native font feature state
core/font-features owns strict capital/stretch enums and pre-normalization schema-42 admission. core/text-style shares native shorthand/readiness matching and Canvas state across bounds/layout/ink/rendering. TextLayer constructors and attached setters feed the existing command reflow/history boundary. Full paragraph formats normalize missing legacy defaults, while patch/override schemas retain absence; public format access resolves defaults without rewriting stored old data. Native style fields reach resize captures, SVG measurement probes and literal editable output. No new font asset, worker authority or network service is introduced. See native font features.
Multipage TIFF ownership
core/tiff plans a complete main-IFD chain with page-local tile inputs, exact global offsets and whole-file Classic/BigTIFF selection. engine/tiff captures all immutable page snapshots/dependencies, renders native tiles sequentially and assembles compressed private page payloads before directories. EditorApplication resolves actual owned Document handles, validates options and guards selected-session lifetime. ExportDialog uses session keys, including for duplicate persisted IDs, and offers explicit order/inclusion. No model/project/workspace schema or isolated/REST surface changes. See multipage TIFF.
Result-point provenance and trusted ingress
history-provenance owns strict origin/operation schemas and accepted submitted-command summaries. EditorStore records changed commits with private session/weak-observation ownership and parallel current/past/future point maps. History 4 carries full branch/comparison attribution closure; legacy entries stay unchanged and unknown. Document coordinates synchronous host origins and guards accepted publication/observers. Editor, REST, isolated script/plugin host commits, actual recipe/candidate workflows and connected clients supply context at trusted entry points. Async services capture context before preparation and apply it at final commit only. File admission validates record/model consistency but imports never acquire runtime observation or identity authentication. Ordinary unbranched browser files retain current attribution without adding Undo. See HISTORY.md.
Saved comparison ownership and rendering
EditorStore owns immutable pinned comparison pairs/labels/regions and guarded revisioned management; Document exposes constructor-based trusted host methods and exact continuation as a new branch. History 3 extends the existing strict history union; shared captureRetainedHistory/retainedDocuments include every comparison source in native/workspace transport, validation and stage cleanup. EditorApplication privately leases only captured sources for a cancellable regional Canvas reference render; history-comparison computes yielded sRGB8/premultiplied-RGBA differences on the displayed grid. The live renderer/document are untouched. Branch ancestry presentation uses iterative parent-order traversal. Existing document/native/workspace envelopes and isolated grants remain unchanged; see HISTORY.md for compatibility and bounds.
Persistent branch ownership
EditorStore owns immutable branch IDs/names/parents, exact fork origins and accepted tips with 60-transition linear paths. Dispatch after Undo creates an alternative; navigation never overwrites the latest accepted tip. Document exposes guarded OO history-management methods and accepted switch observers. Branch changes publish once and invalidate stale work through revision; switching routes invalidates semantic recording rather than faking redo. Shared captureRetainedHistory/retainedDocuments enumerate strict history-2 closure across native serialization, worker transport, recovery, source checks and abandoned-stage cleanup. Native 3/4 and workspace 2 containers remain; older history-1 readers reject history 2. See HISTORY.md.
Retained history inspection and atomic navigation
EditorStore freezes complete published/initial snapshots, including retained-entry metadata and selections; transaction label validation precedes callbacks/dispatch. This closes the former root/history-reference mutation path. EditorStore.navigateHistory reorders the existing immutable retained snapshots into one destination publication, without executing commands. Document.navigateHistory protects transactions/reentrancy, reports accepted observer failures and delivers per-crossed-step directions to existing recipe observers after publication. Undo/Redo use this path; all store subscribers are notified before observer errors propagate. core/history-inspection.ts derives bounded/disclosed metadata and a chronological timeline without modifying source data. The app-owned HistoryInspectorDialog captures document/revision; EditorApplication.previewHistory leases only adjacent-state sources into private assets/rendering and cancels stale/closed work. REST exposes independent metadata/navigation with revision checks; isolated runtime forbids navigation as it already forbids undo/redo. Formats/budgets remain unchanged; persistent candidate branches and broader provenance stay planned. See HISTORY.md for signatures and limits.
Reusable sRGB palette library (W04)
src/palettes/{model,storage,service}.ts owns strict version-1 inert palette values/JSON packs, separate optional IndexedDB storage, durable revision/generation checks, atomic all-or-nothing imports and lazy observable host state. EditorApplication.palettes is disposed with its owner and is not a document/model collection or isolated API. PaletteColorControl routes existing native color inputs to an app-owned modal; the central owner survives context-menu dismissal, suppresses keyboard actions and validates active document/revision/selection before using the original control callback. ColorInput retains native input/change preview boundaries and commits a chosen saved value once. Management writes never dispatch document edits. Colors are copied opaque sRGB8 values, not linked managed-color resources. No document/project/workspace version changes, network service, new runtime dependency or plugin capability. See COLOR_PALETTES.md.
Reusable artwork library (W04, supported local workflow)
library owns strict entry/package DTOs, private disposable validation/hash workers and a lazy independent IndexedDB entries/blobs/epoch repository. Native project Blobs remain the editable original-bearing truth; no second custom document schema is introduced. EditorApplication captures selected roots and dependencies through the existing OO snapshots, privately loads them and reuses the shared cross-document copy planner and command/undo transaction. The final synchronous publication is ordered against library writes in a readonly database guard. Already decoded private sources use explicit shared bitmap ownership, retaining independent destination lifetime without another full-resolution decode. Source selection capture, preview and library metadata do not mutate live history/save status. See ARTWORK_LIBRARY.md for metadata budgets, errors, cancellation, recovery and inert package boundaries.
Optional website identity host — local signed-fixture workflow verified
Account lifecycle uses private schema-2 SQL transactions and a monotonic authority sequence. Five-minute current-account verification gates linking/deletion; existing-identity reauthentication rotates the cookie, while new linking retains the original verification time. Strict shared account export DTOs whitelist owner metadata outside the editor DOM. Atomic account removal revokes every owner browser and matching proposal; ten-minute hashed identity markers reject anonymous callbacks that predate deletion. Migration retains old users/cookies with no recent-verification authority. Local editor/history/asset and independent plugin/REST boundaries remain unchanged.
server/auth owns registered OpenAI identity-only OIDC, private SQLite account/identity/session authority and same-origin CSRF/callback routes. server/site optionally serves the built editor and these routes behind one configured origin; it does not proxy or change headless REST sessions. account/client and the custom Account dialog keep identity outside the OO document model, isolated runtime, project data and shared editing history. Sign-in opens a separate window, requires explicit new-account/link confirmation and preserves local artwork. One-time browser-bound state/nonce/PKCE, signature verification, session rotation and generation checks reject replay/cancellation/sign-out races. Real OpenAI registration and acceptance remain required. See the precise deployment/protocol contract.
Explicit local ChatGPT document connection — local workflow verified
The separately packaged desktop plugin uses the pinned official MCP SDK over stdio and an owned loopback broker in server/chatgpt. integrations/chatgpt/marketplace holds its portable manifest, skill and local catalog; the build bundles a complete runtime/licenses/archive. Trusted integrations/chatgpt/host binds only a browser-selected DocumentSession, with explicit read-only/default or optional write grants, an origin-pinned private owner credential, cancellation and source/session lifetime checks. Strict typed data goes through shared command parsing, candidate validation and existing OO document dispatch/history; no generated JavaScript is evaluated. Commit authorization and retained idempotency receipts distinguish cancellation from an unknown accepted outcome. The UI exposes pairing, status and disconnect, and protects active canvas gestures. Existing REST documents remain separate; internal command-plugin isolation is unchanged. Actual installation/testing in ChatGPT remains required. See contract and limits.
Local calibrated profile catalog — supported local workflow
core/interchange/lens/xml strictly normalizes Lensfun data in a disposable private worker; it does not fetch DTDs, execute commands or initialize lens WASM during installation. Catalog rows preserve canonical/translated identities, camera crop/mount declarations, supported complete calibration tables and explicit unavailable-record reasons. Original UTF-8 XML is the durable truth. LensLibraryRepository atomically stores only original blobs/descriptors and a deletion/publication generation; LensLibraryService revalidates/reparses them, retains corrupt records for recovery and rejects stale pending installs/reviews. Optional access is lazy and editor disposal cancels jobs/transactions. Trusted editor.lensProfiles and the custom RAW library controls require explicit profile/camera review and never infer crop from equivalent focal length. The selected immutable OO calibration remains self-contained in existing RAW settings and uses the already checked native preparation/command/history path. No isolated file service, REST catalog synchronization or schema change to artwork is introduced. Exact signatures/errors/defaults are in SCRIPTING_API.md; broader photographic/model and full-roadmap gates remain open.
Calibrated RAW profile execution — in implementation
Trusted project opening now restores validated optional retained history through the same internal constructor as workspace restoration. Invalid restoration disposes prepared assets before publication. Ordinary files without history still open cleanly. This preserves explicitly supplied undo/redo artwork and accepted source assets rather than discarding the loader's verified history.
The pure immutable LensProfile constructor and its correction() value retain complete supported Lensfun calibration tables and explicit camera/exposure parameters inside RAW settings. The public model stays object-oriented. Private interchange/lens owns a pinned checked WASM correction/interpolation boundary; disposable browser/Node RAW workers initialize it only for enabled profiles and validate native geometry before demosaicing. Bounded absolute coordinate requests and a source/gain tile cache sample native linear pixels without image-size cutoffs. An accepted source has separate lens/decoder WASM identities. Complete accepted settings/pixels travel through shared commands and source/project/history transport without catalog/decoder dependencies on reopen. UI edits accepted profiles separately from manual coefficients. The trusted XML/library and explicit camera/lens review workflow above supplies these values. Wider models, physical photographic quality, precision, merge and performance gates remain open. Exact contracts and executable examples are in SCRIPTING_API.md; test evidence is in the dated roadmap.
RAW development workflow in implementation
Trusted editor.inspectRaw(file, image = 0, control = {}) performs read-only native sensor preflight. It returns the version-1 camera/decoder, sensor/visible/display geometry, selected-image/count, precision, calibration/white-balance, extra-sample and warning/capability report. It changes no document, assets or history. Controls accept AbortSignal and progress with phases inspecting/developing/encoding and a nullable fraction. Inspection needs the local native worker and full-input buffer; queued inspections/development share one application-context lease. Native failure, malformed results, cancellation and throwing callbacks reject and terminate private work.
The internal checked decoder produces owned linear RGB16/grayscale16; explicit conversion consent is required before the private worker returns an sRGB RGBA8 working PNG. The build omits DNG SDK/RawSpeed/external lossy-JPEG DNG and external ICC-file processing. Reported metadata support is not proof of valid sensor payloads, device memory or photographic fidelity. The connected host workflow now retains original/accepted assets, editable master commands, persistence and review/development controls; automated acceptance and remaining gates are recorded in the dated implementation roadmap. See the connected RAW source-ownership section below. Isolated Scripts/plugins develop only installed RAW sources through current document/assets grants; file opening stays a trusted host service. Separate headless REST file transport/operations are explicit and do not synchronize browser sessions.
Recovery persistence failure boundary
RecoveryRepository.persist guards synchronous transaction setup and request callbacks. A caught failure aborts the entire checkpoint/asset write and is retained as the promise's rejection cause, including when the browser's transaction error is generic. The UI and persistence worker share this path, preserving the previous checkpoint, source bytes and actionable quota name/message without uncaught callback errors.
Recent-file capability detection catches denied global storage access before optional initialization. BroadcastChannel construction and sending are best-effort: notification failure cannot abort startup or misreport an already committed copy as a storage failure. Durable generation remains authoritative without notifications. Active recovery display, commands/history, native pixels, schemas and script/plugin/REST permissions remain unchanged. A footer-subscription isolation prototype is deferred after controlled measurements failed to show a reliable latency benefit; it is not current architecture.
Recent file copies and resource commands
workspace/recent-files.ts owns the separate luma-recent-files IndexedDB database (version 2; entries remain schema 1). entries, blobs and state participate in one transaction for publication, twenty-entry eviction, reference cleanup and generation changes. Payloads are keyed by SHA-256; entries keep exact file metadata, explicit original I/O kind, capture time and MRU rank. A schema-1 database upgrades by adding state while retaining existing stores. Invalid metadata remains discoverable; capture fails without overwriting unreadable entries, and cleanup preserves unknown references until explicit recovery. Removing/clearing advances a durable generation; record compares the generation captured before hashing inside its commit transaction. Copies prepared against an old generation reject, including across tabs without notification delivery.
recent-service.ts owns a serial preparation/read queue, newest-twenty pending File references, cancellation/controllers, observable status and lightweight cross-tab change notifications. Optional capture never makes accepted document I/O fail. Clear/remove/dispose cancel owned jobs; worker replies cannot publish after rejection. recent-hash.ts uses a private one-shot module worker, cloning an immutable Blob handle without transferring original buffers. recent-hash.worker.ts reads 1 MiB slices and core/sha256.ts retains only the hash state/schedule/tail. Source blobs, decoding, IndexedDB/native storage and browser process memory retain their real limits; this is not a whole-process constant-memory guarantee. SHA-256 follows the referenced FIPS algorithm and independent digest fixtures, without an implementation certification claim.
Trusted Editor file opens/imports record after successful commit. Project-download UI records the exact Blob/name it requested; bare host saveProject() returns a Blob without claiming an OS file write or automatically recording a filename. openImage(file, control?) stages decoded assets privately, pins owner/session/revision/lifetime, creates a constructor-validated native-size document at revision zero and publishes only while current. Current edited tabs remain. Disposal invalidates pending I/O generation. The Recent files dialog verifies stored size/hash before handing an independent File to the normal opener; SVG/TIFF/Photoshop preflight is repeated. WorkspaceCommandPalette appends session/recent actions to the static registry and subscribes only while mounted; the top-bar Recent button owns its own status subscription. No background progress rerenders the whole editor. Palette selection tracks action identity, not list position, and waits for deliberate reselection when an item disappears. No document/project/workspace schema or isolated scripting/plugin/REST permission changes.
Workspace layout preferences and keyed docking
ui/workspace-layout.ts validates a strict version-1 preference envelope under luma.workspace-layout.v1: the current docking/visibility/order/preferred-width layout and up to 32 independently copied named layouts. Names are 1–64 trimmed characters with normalized case-insensitive uniqueness. On first read only, missing new preferences import valid luma.panel-widths.v1 widths; legacy bytes are retained. An explicit new responsive layout takes precedence over legacy values. Validation and one successful localStorage write precede publication. Comparing the stored envelope with the last read value rejects detected newer-tab state; Reload saved layouts is explicit. This is not an atomic cross-tab transaction or live preference synchronization.
usePanelLayout separates durable preferences, transient splitter preview and viewport fitting. Hidden docks reserve no width or splitter; viewport changes clamp presentation without rewriting preferences. WorkspaceDock uses stable keyed slots for rail, each dock and canvas, changing actual DOM order as panels move without remounting content. Splitter direction follows the dock side. WorkspaceLayoutDialog owns a detached draft and catches save errors in the modal. Opening/applying layout cancels transient tools/gestures; documents, assets, saved projects/workspaces and command history do not change. Registry actions and rail affordances use existing shortcut capture/modal guards; no default chord or isolated-script/REST API is added.
Local AVIF boundaries
AVIF input and original-source ownership
core/interchange/avif/inspect.ts is a separate general input reader. Keep core/avif.ts strict: it validates the encoder's own output and is not an input whitelist. Inspection reads box headers and bounded metadata through immutable Blob slices, follows primary-item/property/alpha/grid associations, checks item extents and reports precision, CICP/ICC, clean aperture and orientation. Metadata budgets do not limit encoded file size or native source resolution. Unsupported essential properties/derived formats, sequence/timeline content, unresolved color conversion and crop/transform cases produce explicit failures/capability reports.
Trusted EditorApplication.inspectAvif exposes read-only preflight; openAvif prepares a separate native document through engine/avif-import.ts. Internal client.ts owns one private worker, validates replies and actual PNG header geometry, propagates progress/callback errors and terminates on success/error/abort. worker.ts checks consent before loading the locally bundled pinned decoder; decode.ts validates raw geometry, applies supported crop/rotation/mirror addressing into bounded PNG strips, and retains RGB ICC identification for browser color conversion. Libavif still requires compressed input and full native decoded planes; this is not streaming region decode. No source downsampling/application image-size cap is introduced. The checked C ABI is built locally from pinned libavif 1.3.0/AOM 3.12.1 with Emscripten 4.0.10. It checks parsing, decoding, RGBA allocation and color conversion return codes, validates native depth/alpha/CICP against preflight, and copies pixels before releasing native allocations. Optional upstream axis/pixel defaults are removed by the maintained build patch; division/PTRDIFF/allocation checks remain, with RGBA representation checked before native decoding. Real address-space/browser memory and broader codec/device acceptance remain limitations. See build inputs, patch and notices (repository source).
AssetStore retains the original image/avif Blob and normalized frozen {allowPrecisionLoss, assumeSrgb} choices separately from its decoded bitmap. The derived frozen avifReport is reconstructed on decode, not persisted as another source of truth. Crop/orientation are applied without resampling to the presentation bitmap; asset/document/layer dimensions describe that presentation while the report retains encoded extents. Projects, retained workspace history, recovery, portable recipes, brush sources/packs and cross-document copies preserve original bytes and choices. Recovery hashes include the choices. Missing AVIF choices and options on other MIME types reject. Existing document/project/workspace formats and isolated/headless capabilities are unchanged.
Picker/drop/recent-file opening shares explicit preflight review. openAvif stages privately and only publishes at the captured document revision, session, source lifetime and I/O generation. Cancellation, edits, replacement, supersession, disposal and callback errors discard preparation. Success creates a clean revision-zero document while retaining existing edited tabs. Native decoding uses a FIFO application-context lease: waiting requests retain compressed immutable Blobs without workers or decoded planes, and queued abort removes work promptly. This lease bounds concurrent decode jobs; it does not promise a total browser-memory ceiling or unify import and export queues.
Input preflight cannot fully identify an AV1 payload from container properties alone. After consent and native decoding, actual CICP must be checked as well: a known supported RGB space overrides an assumption and updates the decoder report/profile; still-unidentified RGB retains explicit fallback. Native or container PQ/HLG rejects even with ICC/fallback consent. This prevents missing colr properties from relabeling known HDR as sRGB.
Before generic browser decoding, a bounded top-level box/brand scan rejects AVIF bytes declared as PNG/JPEG/WebP/TIFF. This prevents MIME relabeling from bypassing precision/color review; it is routing protection, not proof of a valid AV1 payload. The scan reads box headers and at most the 4 KiB file-type table, skipping compressed image payloads, with the same 16,384-box metadata budget as inspection.
AVIF output pipeline
core/avif.ts validates finite settings/native integer geometry and bounded still-AVIF container metadata. engine/avif.ts owns FIFO capture admission, canonical native raster regions, immutable snapshot/source/font lifetime, cooperative progress and the export-owned full RGBA plane. avif-encoder.ts transfers only that owned plane to one private module worker, validates the reply/container and terminates the worker on success/error/abort. avif-export.worker.ts loads the locally bundled single-thread jSquash encoder/WASM; avif-codec.ts performs RGBA8/YUV444 encoding with lossless alpha and validates/identifies output as sRGB. No shared memory, CDN or server is required. The host watchdog observes referenced source/font revocation during synchronous worker encoding.
Trusted Editor export/preflight and batch variants share this encoder. Batch fitted rendering separates output geometry from the actual pinned source document. Captured originals and the public OO command/history boundary remain unchanged. One full capture/codec runs per application context; queued jobs own no full plane. Codec memory still scales with native output and is not a streaming/constant-memory guarantee. Files remain one flattened still image; no public document/project/workspace version or script/plugin/REST permission changes. See the host contract for defaults, error behavior and limitations.
Linked paragraph styles — schema 40
core/paragraph-styles.ts defines a strict document-scoped library (at most 128 uniquely named/identified styles), a complete reusable ParagraphFormat and optional text bindings with per-field overrides. Format contains font size/family/weight/style, color, alignment, line height, letter/word spacing, kerning, direction, justification, paragraph gap and first-line indent. Text content, frame width and placement remain layer-owned. Resolved concrete typography stays on TextLayerData so native measurement, cache keys, Canvas/GPU fallback, SVG and raster export keep their existing drawing contracts. Model validation rejects missing definitions, inconsistent resolved fields, wrong-layer bindings and pre-schema-40 libraries/bindings, including embedded masters. Documents without the new data avoid style-library validation work.
paragraphStyle.set creates/updates a definition and remeasures every affected root text follower. Existing local overrides remain explicit, including values equal to the old base. layer.update records style-controlled edits as overrides; undefined for an optional controlled property clears that override and restores inheritance. text.paragraphStyle applies, switches or detaches; text.paragraphOverrides.clear resets all or selected keys. Style removal detaches all followers while preserving their concrete formatting. Changed effective text and all binding mutations enforce layer/ancestor locks. A locked follower whose effective format is unchanged permits a base update; name-only updates do not mutate followers. Shared execute/store validation gives atomic rollback and one command/transaction undo, including native measurement errors.
Public ParagraphStyle/ParagraphStyleCollection and TextLayer methods retain ID indirection, detached format snapshots and constructor-based mutation. The isolated runtime receives the same constructor; existing document-write grants/host validation remain unchanged. Headless REST keeps its separate session and approximate font environment. Schema 40 roots/history migrate through the existing store path without injecting styles. Project 3/workspace 2 and recipe/plugin transport versions do not change.
Style scopes stop at component document boundaries. Converting text into a smart master copies its source library into the new independent document; defining/editing/copying embedded masters retains their libraries. Root artwork copied to another document imports only needed definitions, reuses identical existing IDs/format, and remaps conflicting IDs/names without changing unrelated destination text. Concrete fields keep native rendering equivalent to unlinked typography. SVG exports resolved text formatting and explicitly reports loss of native style/override relationships; projects retain those relationships. Based-on inheritance uses schema 41 as described below. Full paragraph/character run styling, variable axes, path text and wider typography quality remain separate requirements.
Native bilateral denoise — schema 39
BilateralDenoiseFilter is an immutable per-instance smart-filter value with radius 2 (integer 0–16 native master pixels), colorSigma 25 (finite 0–255 encoded byte levels), and amount 0.5 (finite 0–1) by default. The full two-dimensional square aperture uses spatial sigma radius/2 and RGB root-mean-square range sigma colorSigma. Each original neighbor receives alpha-byte coverage times exp(-2*(dx²+dy²)/radius²) times exp(-(dr²+dg²+db²)/(6*colorSigma²)). Each channel is the normalized weighted mean, blended with the original center by amount before one final byte rounding. Center alpha and zero-alpha hidden RGB remain unchanged. Outside-artboard/transparent neighbors have zero weight. This is encoded RGB8 smoothing, not RAW/scene-linear development or a learned photographic noise model.
assembly/bilateral-filter.ts runs entirely in the existing pixel worker. It reads an immutable source plane and writes a separate output. One private range-table cache holds 195076 Float64 entries (1560608 bytes); one spatial cache holds at most 1089 entries (8712 bytes). Transient callers receive copies; WASM owns copied tables and input/output. Tiny positive colorSigma is well-defined even when its square underflows: the zero-distance weight stays 1 and other weights tend to zero. Input views are captured before WASM growth, worker requests snapshot before readiness, and returned geometry is validated. Jobs use the existing 4 MP/8192-edge tile budgets; these are not source-image limits.
Radius contributes finite native support before placement. Zero radius, zero colorSigma, zero amount and disabled values bypass native resampling/SVG baking through the shared activity predicate. Other stacks use the existing native grid, filter caching, mask interpolation and adaptive Canvas fallback. Shared smartObject.filters commands, locks/revisions/history, isolated scripts/plugins and separate REST sessions remain the mutation contract. Schema 39 gates bilateral records in roots and embedded masters; previous roots/history migrate without injected filters. Project 3/workspace 2 and package/recipe versions stay unchanged.
Native median denoise — schema 38
MedianFilter is an immutable per-instance smart-filter value. The existing smartObject.filters command, locks, revision checks, history, assets and isolated runtime remain the mutation boundary. Radius is an integer 0–32 native master pixels (default 1); zero is an exact no-op. The finite square aperture contributes its radius to cumulative filter support before instance placement. Active median stacks use the existing native spatial grid, worker queue, bounded tiles, filter cache and filter-mask mixing; they cannot take the tone-only coalescing path. Existing Canvas fallback handles these stacks for the adaptive viewport, and native export uses the same worker.
assembly/median-filter.ts maintains three sliding 256-bin histograms, weighted by original alpha bytes. For each RGB channel it selects the first value whose cumulative weight reaches ceil(total/2), preserving each center pixel's original alpha and all hidden RGB at zero alpha. Transparent neighbors and out-of-artboard padding contribute no weight. This is encoded RGB8 impulse-noise reduction, not RAW development, scene-linear processing or general photographic denoising. A private input/output pair and fixed 3096-byte histogram/rank workspace replace per-aperture sorting. Worker requests snapshot before readiness and validate returned byte geometry. Internal jobs are bounded to 4,000,000 pixels and 8192-pixel edges; these are allocation budgets, not original-image/import limits.
Document schema 38 admits median records; older root or embedded-master versions cannot carry them. Existing 1–37 documents remain readable and root/history versions migrate through the established store path without adding filter defaults. Project 3, workspace 2 and plugin/recipe transport versions stay unchanged. Constructor errors reject invalid, nonfinite, fractional, null and unknown options. The Inspector uses integer paired controls, existing previews/cancel, enable/reorder/remove and single committed undo steps.
Precision bitmap projection
engine/bitmap-projection.ts preserves the ordinary Canvas draw path and selects a double-precision reference path when projected coordinates exceed the subpixel precision range of float32 drawing. It samples native 64×64 source patches through a 64-entry LRU, interpolates recovered encoded-sRGB premultiplied bytes, then writes bounded output patches. Axis-aligned image edges preserve existing half-pixel ties; affine image support uses exact square/pixel intersection. Original image resolution and bytes remain asset-owned. Mutable native canvases receive one privately owned ImageBitmap snapshot, closed on success or failure. Numerical loops check source/cancellation and yield at shared task boundaries.
Raster/mask/texture, native wet and filtered projection callers share this boundary. Ordinary raster draws retain their original five-argument Canvas call and transform order. Raster and mask preparation pin source identity/lifetime; retained mask keys include bitmap identity and dimensions. Texture batches wait for capture/cache/error arrivals before flushing the existing worker conversion. Numerical captures run serially with a shared two-millisecond yield deadline, bounding active native tile retention to one reader per batch; clear/disposal/source changes reject before late worker conversion. Cache retirement remains separate from cancellation. A circle-chord expression selects the stable form near the center and near the endpoint, preventing one floating-point ulp from becoming visible missing coverage at huge radii.
The native reader cache is a per-operation working bound, not a whole-process memory measurement. Original decoded assets, returned patches, renderer caches and other concurrent jobs retain independent ownership/budgets. Public OO mutation/history, document37/project3/workspace2, isolated scripting/plugin permissions and separate REST sessions are unchanged.
Native frequency working partitions
engine/pixel-work-grid.ts partitions independent raster work by aspect ratio. Linear Light/Burn retains the former 1024×1024 pixel budget, with at most 8192 pixels on a working edge. Pixel equations and worker snapshot/result validation stay unchanged; cancellation is checked before and after each awaited blend before publishing pixels.
Recognized native frequency sampling may combine rectangles only when request count falls and estimated total halo work does not increase. Both width-first and height-first candidates include projection/filter margins and prefer at most 1,000,000 sampled pixels, within the existing 4 MP/8192-edge allocation checks. Composition accounts for both nested projection margins. Literal unchanged raster-band eligibility and exact integer unit placement are unchanged; complex masters, affine/fractional placement and masks retain their existing eligibility/fallback behavior. The original 256/512/1024 grids remain available for large halos or unimproved partitions. Document/source geometry is independent of these working budgets.
Canonical ordinary paint coverage
engine/paint-coverage.ts owns raw untextured brush/pencil/eraser/clone coverage and fill geometry. Complete contributing native primitives replay into canonical 256-pixel cells with a support halo and an eight-pixel gradient phase. Rebasing preserves source coordinates at large translations. Scratch allocation stays within 4 MP/8192 edges; larger projected primitives use primitive-coverage.ts pixel-area integration and paint-premultiplied.ts destination-byte composition, without shrinking authored geometry. Proven solid strips at unit flow can overwrite exact opaque RGB; all uncertain edges keep integration. Soft coverage bounds bypass integration only when every possible value produces identical stored bytes.
ActiveStrokeRaster retains at most a 16 MiB raw viewport, independently owns mutable accepted points and stages numerical extensions privately. Superseded/cancelled work cannot install a partial prefix. Native padding has its own bounded allocation; PaintedMaskRaster reserves both viewport and padding bytes in its shared 16 MiB LRU, recalculating reservations when an existing key grows. Numerical replay shares a two-millisecond task deadline across primitives and pixel blocks, including accelerated opaque stamps. Clip/whole-stroke opacity apply once after raw coverage.
This corrects crop-sensitive antialiasing, so some edge pixels differ from older replay. Authored samples, original assets, OO commands/history, schema 37/project 3/workspace 2 and isolated scripting/REST boundaries remain unchanged. Textured/wet coverage, broader backend/device fidelity and sustained/process-memory performance retain their separate acceptance requirements. Current verification is recorded in the implementation roadmap.
Inverse-scaled integral crop positions recover their exact lattice indices before native cell selection and numerical dither, without snapping authored geometry. Native vector masks share this index helper. Cache invalidation controls retention separately from explicit caller cancellation: a direct mask read must survive a viewport cache reset. Busy active-mask entries have exclusive producer leases; concurrent readers replay privately, and retired entries dispose their surfaces after the current lease ends.
Native frequency workflow controls — schema 37, functionally verified
GroupLayerData.frequencyRadius is an optional finite shared radius. LayerGroup exposes its OO setter; Layer.frequencyGroup locates the nearest controller. Attached updates use ordinary strict layer.update validation/locks/history. The smart resolver derives frequency-filter sigma in a private render tree while descending groups, and resets inherited scope when entering a component master. Source DTOs, individual fallbacks and locked correction children are not mutated. Capture the effective scope when isolating, converting, rasterizing or copying artwork into another document plane; Photoshop plane/prefix planning does likewise. Legacy groups remain independent.
PreparedFrequencySeparation owns one full-native capture, a stable private base document and source leases. Native preview extracts only a bounded crop plus Gaussian support, computes low once and encodes high from that exact rounded low. Frames own independent canvases. Commit assembles/probes a fresh private document, so a rejected setting does not consume the base snapshot. Source identity, bitmap/blob/native dimensions, lifetime, revision, selection, cancellation and publication guards remain authoritative. No output asset or undo reaches the host before successful commit.
The dialog coalesces rapid changes through one active preview job and retains only the latest complete frame. Original comparison redraws retained pixels without recomputation; pointer/arrow panning changes native crop coordinates. Busy/cancel state remains separate from preview activity. The inspector exposes a shared radius for a selected band/retouch layer and hides ineffective individual radius fields. Existing script isolation, native export fidelity and working-buffer/source-resolution boundaries remain unchanged. The preceding schema-37 workflow baseline passed build, all 1,381 unit/API cases, 207 native browser cases and 84 normal-production workflows. Current tiling verification is recorded below. Native preview, scope capture, shared controls, retry/cancel, source ownership, workspace/recipe and interchange evidence is in frequency workflow verification. Portrait-quality, sustained/device/process-memory and full F05/F14 acceptance remain open.
Exact native reconstruction and bounded render sharing
A strict structural recognizer can render the captured raster directly where the original low/high/precision arrangement still reconstructs it exactly. It checks native dimensions, source identity, effective radii, appearance, alpha mask and component structure. A conservative retouch-ink intersection keeps full decomposition in every affected native region. Modified filter/mask/geometry/stack states fall back to the ordinary compositor. Authored source bytes, bands and editable strokes remain intact; this is an exact RGB8 identity, not a lower-resolution preview. Radius working-budget errors remain observable.
Exact unit-scale frequency-band planes with safe integer placement may use 512-pixel native tiles so an outer tile plus overscan no longer creates a tiny second request. Affine/fractional placement and halos whose worst-case 512-pixel padded footprint exceeds the existing 4 MP/8192-edge budget retain 256-pixel tiles. Native composition/retouch canvas regions retain their original grid; the ordinary paint correction above does not by itself establish broader tiling equivalence. No source geometry, public model/API or persistent format changes. The main build, all 1,381 unit/API cases, 60 affected native cases and 84 normal-production workflows pass. Fourteen frozen-renderer PNG pairs and six full native 50 MP exports are independently pixel-exact. See native tiling evidence; wider F05/F06/F14 acceptance remains open.
Every Canvas render owns an 8 MiB frequency scratch cache shared with recursive native tiles and cleared on return/failure. Identical source/region/effective-sigma/prefix requests can reuse the rounded low and original input across sibling bands, including cache-free export. Raw source elision applies only to a single frequency filter; arbitrary prefixes and filter-mask mixing retain their own original-input semantics. Existing persistent viewport retention stays separate. Recursive smart sampling checks a shared eight-millisecond task budget; PNG assembly also yields between tiles when its budget expires and rechecks cancellation. These are scheduling checkpoints, not a promise that a browser draw/decode or garbage collection cannot take longer.
Native frequency workflow — introduced in schema 36
engine/frequency-separation.ts owns private source leasing, full native PNG capture, cancellation/revision/selection/source-identity checks and atomic publication. dom/frequency-separation.ts assembles existing OO groups, smart masters, filters and paint layers through commands; original source bytes and IDs remain unchanged. It preserves original appearance on the outer group, ordinary raster erasures in a post-placement coverage mask, and original raster tone in the document phase. Active wet sources are reconstructed with their complete expanded native ink before separation. The source is hidden only at successful commit.
Native low/high/correction planes share the captured master. AssemblyScript kernels perform premultiplied Gaussian sampling, detail/correction encoding and Linear Light/Linear Burn source-over blending in the existing worker. The three-plane encoded-RGB8 rule is exact before affine projection. NativeCompositionFilter makes the native composition and image-frame edge clamp precede resampling; DocumentToneFilter preserves raster tone's post-placement/pre-mask stage. Native filter masks remain native; document-phase masks project native feathered coverage through the full affine map. Reachable-master dependency signatures and the bounded filter cache allow sibling bands to share their rounded Gaussian; cache-free reference/export remains authoritative.
Schema 36 adds these strict filter kinds, raster-erasures masks and two appended blend modes (indices 16/17). Earlier blend indices retain their values. Canvas uses actual WASM for the new blend equations; supported WebGPU blends use WGSL. Smart-filter content retains its existing whole-scene Canvas fallback. Photoshop keys lLit/lbrn follow the Adobe format specification. SVG/Photoshop preparation must preserve pixels through the established baking/report boundaries. No new network, provider, isolated host service or headless renderer is introduced. Full workflow and performance acceptance remain in progress.
Parametric red-eye correction
Schema 35 adds a cross-channel red-eye adjustment with strict threshold/strength fields and immutable RedEyeAdjustment DOM value. Attached changes use existing validation, transactions and history; embedded-master validation applies the same schema-age rule. UI creation captures the active document-space pupil selection into a layer-local editable mask after insertion, within the same transaction. The independent controls use existing paired Slider/number inputs, preview/cancel/commit and lock behavior.
For nontransparent straight encoded RGB8, positive R-max(G,B) >= threshold enables a strength-weighted move of R toward (G+B)/2, rounded once; G/B/alpha remain unchanged. Native rendering delegates bounded 1024-pixel tiles to actual WASM in the pixel worker. The GPU processing pass canonicalizes straight RGB8, packs ceil(threshold) to preserve integer classification through float32 uniforms, and retains normal mask/opacity/blend handling. Unsupported documents retain the existing reference fallback. Source dimensions/bytes are independent of tile budgets. SVG/native Photoshop adjustment-prefix preparation uses the generic raster-bake path and its warnings. This is manual pupil correction; portrait-quality and full F05/F14 gates remain open. Functional verification passed the full 1,363-case unit/API suite, 38 focused browser regressions, seven final feature cases and 120 actual-WGSL software-adapter comparisons (maximum premultiplied RGB error one byte; alpha exact). The final feature run exports a full 50 MP PNG and preserves source bytes/project pixels. Project v3/workspace v2, isolated privileges and REST session separation are unchanged.
Prepared wet prefix reuse and render cadence — functional acceptance; latency open
Private result records carry same-session native raw epochs. Ordinary snapshot()/finish() results remain complete and independently owned. The internal snapshotSince handoff captures hints before queueing and omits only unchanged, previously projected cells; immutable descriptors identify their already owned output. Reverted cells disappear. The trusted adapter shares one current prefix's prepared Blob/bitmap leases into independently owned full views, rebuilding changed cells and validating the complete candidate before replacing those leases. Failure releases private deltas/views/cache without closing earlier caller/render-owned prefixes. Final finish still flushes all original/result records; final authoring can reuse its last prepared pixels without decoding them again.
Active processing storage is checked even when a reuse path reads no pixels. Resident stores retain method-identity checks; native zero-cache stores retain lifetime checks. Finish hands storage ownership to its result, which is decoded/validated/disposed before publication. Source/revision/asset validation and one synchronous OO transaction remain authoritative. Prepared output memory scales with affected stroke area and shares actual bitmaps with frames; the numerical32 MiB working-cache budget remains separate from source/output/process memory. No source geometry or public/schema/isolated/REST boundary changes.
Wet prefixes use their owner as the existing render cadence identity. A first ready prefix can prepare immediately; later prefixes reuse the boundary requested by the previous preparation and add no wait after it has elapsed. At most one start per owner/frame boundary remains. Existing source/view/font/backend invalidation and render leases stay intact. Ordinary paint and transform scheduling retain their behavior.
The isolated build, all 1,354 unit/API cases,65 native cases across10 files and82 production workflows pass. Two separate three-pair production studies preserve exact PNG/project/point/undo results. Continuous-pointer p95 is mixed and remains78.7–106.6 ms. Release-to-History medians improve from52.2–60.7 ms to28.9–32.7 ms; final native-canvas-copy medians improve from58.5–87.8 ms to36.5–64.4 ms. Three releases per fixture, the History-panel layout and headless native-copy proxy limit those observations. Actual main build, all 1,354 unit/API cases across 167 files and 65 native cases across 10 files pass. All 51 non-documentation release resources exactly match the isolated runtime that passes all 82 production workflows. prefix evidence records scope and failures; full F06/T16/F14 and the complete original roadmap remain open.
Resident wet working epochs — functional acceptance; latency target open
A freshly created, unused native private store can be claimed once by the retained session's bounded working cache. Own every incoming typed array before awaiting I/O. Keep intermediate originals, destinations and spatial reservoirs resident within the existing 32 MiB default; evict dirty cells through an atomic native batch, and update cache metadata only after success. Obsolete unpublished epochs can be discarded without a backing write. Custom, previously used, already claimed or method-modified stores retain write-through behavior; a zero-byte cache remains the reference path.
Independent prefix snapshots still own native stores and locks. Each original/result pair is copied in one optional atomic batch, with sequential custom-store fallback. Before finish transfers its original store, flush every referenced original/result in groups bounded by 64 keys and 4 MiB, with source/cancellation/store guards around I/O. Failed eviction, quota, closed/version-changed storage or stale sources publish no host command/assets. Disposal deliberately discards unpublished state; ordinary clear rejects dirty data. These are working-memory policies, not source-resolution limits or durable unsaved gestures.
The applied main worktree passes build, all 1,352 unit/API cases across 167 files and all 56 native browser cases across nine files. All 51 non-documentation release files, including app/worker/WASM, are identical to the isolated candidate that passes all 82 production workflows; only three generated documentation pages differ. Native checks cover exact resident/evicted/zero-cache affine textured symmetry pixels, result ownership, source/store invalidation, atomic eviction rollback, mandatory-result quota rejection and real 50 MP sources. The quota fixture now deposits actual pigment; an unloaded transparent no-op no longer requires backing writes. Three clean alternating release pairs preserve all 720 newly matched points, 108 native PNGs and 108 saved projects, with independently verified exact undo and one intended 21-point operation. sealed evidence records median per-run p95 decreasing from 155.0–177.6 ms to 88.1–119.7 ms across the six fixtures. Every fixture still exceeds 33 ms. Public schema34/project3/workspace2, OO commands/history, isolated permissions and REST/browser separation are unchanged; full F06/F14 and the original roadmap remain open.
Wet gesture working sets — functional acceptance; latency target open
Native backing cells retain complete original pixels. Each dab now samples its spatial reservoir, rasterizes coverage and transfers numerical worker inputs only for the intersection of that cell with the transformed tip support and native halo. Copy exact output into full backing cells, preserving destination bytes outside support and zero carrier outside support. The fixed native coverage grid and per-neighbor summation order stay unchanged.
The private IndexedDB store optionally groups the two new planes and superseded destination records in one native transaction per working cell. Earlier reservoirs remain readable until every dab cell is staged. Cleanup groups contain at most64keys, with cancellation checks between groups and no source-geometry restriction. Resident cache updates follow successful commits; custom stores retain sequential fallback. Schema34/project3/workspace2, public commands, source lifetime and isolation boundaries remain unchanged.
The isolated candidate passes build, all1,352unit/API cases,50native browser cases including injected quota/cache rollback, and six production workflows with18independently decoded PNGs identical to the frozen release. It is applied to the main worktree. The actual head build/full unit/native/production checks and three clean alternating unprofiled release pairs now pass; sealed evidence retains all source, pixel, project and timing proofs. Every measured fixture still exceeds33ms; see PERFORMANCE_BENCHMARKS.md. This does not completeF06/F14 or sustained/device/process-memory gates.
Ordered native wet mask coverage — functional acceptance
The sealed mask evidence records595unique native cases across54files,82production workflows and1,352unit/API cases on byte-identical runtime/unit inputs, with a final actual build. Performance and device gates remain open. Earlier implementation-stage notes below describe their respective historical boundaries.
Schema34 extends mask stroke records with {mode:"wet",stroke:WetPaintStrokeData} while retaining ordinary Hide/Reveal brush records. LayerMask.applyWetPaint returns a value; ordinary mask setters and smartObject.filterMask remain the only attached mutation paths. Field age is checked outside immutable drawing proofs in ordinary/embedded/filter masks. Shared asset discovery/remapping includes both native image pairs and nested original brush textures. wetDocumentOperations and commandHasWetPaint jointly cover every command location that introduces prepared output, so the REST asynchronous gate cannot miss new masks; scripts validate the complete candidate before publishing. Invalid native alpha, stale source/revision and cancellation leave no script/REST edits.
The trusted retained job accepts layer/mask/filter-mask targets, captures a neutral native source, and keeps original source leases and prepared prefixes private. Filter targets include master-to-instance scale; mask x/y/basis/linking remain independent. nativeWetMask reconstructs ordered raw coverage in bounded native ROIs with interpolation halos and integer output clips before affine sampling. Shared nativeRenderTiles anchors complete sampling cells to document coordinates, so differently cropped viewport/export regions retain the same native source footprints. Infinite paint-base coverage is retained. Mask-wide feather/inversion/density apply afterward. Inert wet metadata bypasses this routing and keeps vector SVG geometry. Current raw reconstruction may replay existing operations; sustained performance/memory/device gates remain open. UI selection effects preserve a current newly begun wet gesture rather than applying an older pending preference reset. Pointer release drains samples that arrived during an awaited append before committing the gesture.
Retained wet gesture publication — in verification
EditorApplication._beginWetPaint is an internal trusted adapter, not an isolated-script binding. createPreparedWetPaintJob shares immutable original asset leases into a private base, captures the target's neutral native source plane, and serializes append / prefix encoding / commit. A synchronous brush builder can lease an original texture into this private view without inserting unused host assets. applyWetPaint uses this same publication path with its existing public signature.
WetPaintPreview owns a frozen candidate document and private decoded prefix assets. The tool retires its creator reference when replacing a prefix; viewport preparation takes an independent lease before queueing and releases overwritten/obsolete/finished jobs. Presentation checks the owner, host asset store, base revision, view, font and backend. Earlier completed prefixes may display only within the same current gesture/view. The document/global asset set is unchanged until final native alpha validation, numeric-store cleanup and one synchronous OO transaction. Only referenced, collision-checked assets are shared into the host; failed publication removes exact newly installed records only when current/past/future states do not reference them.
ToolController buffers every accepted coalesced sample, shares the retained engine with trusted one-shot authoring, and commits once on release. Its asynchronous cleanup is token guarded so cancelled older work cannot clear a newer gesture. Smudge/Mixer currently target paint/raster layer pixels. The mask replacement extension is described above; sustained performance and physical-device gates remain open. Prefix output encoding/copying is still work dependent; this is not a universal 60fps claim.
Retained wet-stroke workspaces (internal, verification in progress)
wet-state.ts owns shared result/types and the bounded tile cache. wet-session.ts owns captured settings, serialized append/snapshot/finish/dispose, original native tiles, current canvas epochs, independent per-symmetry reservoirs and cached whole-stroke projections. wet-stroke.ts retains the existing one-shot signature by creating and finishing the same session. No separate numerical engine or alternate document mutation API is introduced.
createWetStrokeSession(initial, readSource, processor, options) captures/validates input before asynchronous storage and processes the initial prefix. append(points) captures only new immutable samples, reserves the existing 20,000 recorded-point budget across pending requests, and runs shared stamp iteration from the first new segment. Completed dabs are not replayed and original regions are read once. Later metadata is derived from the complete accepted prefix. A failed accepted job invalidates private state; invalid input batches reject before mutation. Every complete dab stages all working tiles before advancing its canvas/carrier epoch.
snapshot(crop?) is serialized between appends and owns a fresh private result database. An optional positive integral native crop limits output, never source sampling or full-path transport. Returned prefixes survive later appends, source closure and parent disposal; each owner must dispose its result. Unchanged raw epochs reuse cached selection/opacity projection; changed epochs invalidate that tile's projection. The 32 MiB default cache budget covers all resident work, while backing/result/source/output storage remains workload dependent. finish() rejects new requests, materializes the complete result, removes scratch state and transfers the original job/lock to that result. Disposal/idle abort stop pending work and release private resources after the active operation settles. A custom internal storage factory must return fresh owned stores; reused snapshot stores reject without closing an already returned result.
createDocumentWetStrokeSession shares the existing rendered-document capture/asset/font checks with one-shot preparation. It is read-only; in-place layer authoring still samples the separate neutral target plane. Internal sessions do not appear in isolated script/plugin bindings or independent REST sessions. Actual gesture preview ownership, tool controls/cursors/presets, mask/filter-mask/master workflows and sustained/device gates remain unfinished. This implementation is in numerical/native verification, not a claim of a shipped live mixer/smudge tool or 60fps.
Prepared zero-opacity records retain metadata and references but do not change native reconstruction, visible bounds, SVG baking or GPU capability selection. Explicit null opacity/nativeTransform constructor inputs reject; only undefined defaults. Public model33/project3/workspace2/preset4 contracts are otherwise unchanged.
Prepared wet-paint authoring (schema 33, verification in progress)
core/wet-operation.ts defines distinct prepared replacements rather than colored brush dabs. Output is premasked in native pixels; coverage removes destination and output adds once. Independent operation opacity envelopes the completed replacement once. Paint uses ordered strokes; raster retains its original source and ordered erasure log with captured geometry. Central asset visitors include output, coverage and nested brush textures for persistence/remapping/source capture/history.
engine/wet-authoring.ts prepares complete native spatial output privately through the actual worker/WASM engine. Sampling uses neutral target content before layer/parent appearance, with raster native pixels independent of logical size. Selection, revision, session and source lifetime guard publication. Backing storage releases before publication; PNG dimensions/alpha validate before shared OO commands commit once. Private assets publish only at that synchronous boundary. This adapter does not implement interactive mixer/smudge gestures, incremental previews, mask/filter-mask targets or presets.
core/wet-assets.ts checks premasked alpha through bounded asynchronous streams, identity guards and content proofs. Browser/script commits and independent REST commands share the invariant, with the server's explicit sRGB8 PNG decoder limits. Script cancellation, time, revisions and grants are rechecked before private retouch assets publish; no new host privilege is exposed. wet-native.ts reconstructs content on bounded native surfaces with interpolation halos/integer output clips before transforms/appearance. GPU capability rejects wet content for complete fallback; SVG prepares disclosed native sibling prefixes. SCRIPTING_API.md defines exact defaults/errors/limits. The authored integration evidence records the verification boundary.
Native spatial wet-paint replay — internal authoring dependency in verification
engine/wet-stroke.ts prepares a complete recorded brush/pencil path independently of the viewport. Shared stamp spacing, pressure/tilt/tip geometry and original-first symmetry order feed native dabs; each symmetry copy retains a separate spatial Float32 pigment field. The previous tip basis multiplied by the inverse current basis transports that field through translation, rotation, reflection, shear and changing pressure. wet-spatial.ts gathers native bilinear neighbors by source tile, preserving a fixed per-pixel summation order across backing layouts. It never allocates a transformed source bounding rectangle. Absent neighbors outside the preceding native support are transparent; missing tiles within that support reject as incomplete state.
Every dab reads the same previous canvas/reservoir epoch and stages all native tile results before advancing. Overlapping symmetry copies read preceding copies' completed dabs in the shared iterator order. Initial load uses the current native canvas under each copy. Fixed 256-pixel native coverage cells, with a two-pixel gutter, reuse actual Canvas footprint/texture sampling independently of the backing policy. Flow/pressure opacity applies during deposit/pickup; captured selection and whole-stroke opacity mix the completed original/result once. Unchanged pixels receive zero final blend coverage, preserving even hidden RGB outside the operation. Original/result tile pairs and binary changed-pixel support are prepared replacement data, not yet an authored operation or a live dependency on underlying layers.
wet-store.ts owns a unique private IndexedDB job database. A bounded LRU retains working tiles; evictions preserve their backing records. Completed results own their original/result bytes until explicit asynchronous disposal. Cancellation, callback/processor/source/storage failures dispose the private job and publish no document command or assets. Web Locks protect active jobs across tabs/workers; the next preparation can delete unlocked abandoned job databases after their context terminates. Only the reserved UUID job namespace is eligible. Browsers without Web Locks or database enumeration retain explicit disposal but cannot automatically identify abandoned jobs; broader device/storage acceptance remains open. Cleanup failures surface, and preparation plus cleanup failures retain both causes.
Trusted prepareDocumentWetStroke captures the requested rendered composition/branch, native source identities and font readiness before asynchronous sampling. It validates their lifetime/identity throughout, including source replacement under an unchanged asset ID. Its result can outlive source closure after all bytes are prepared. Rendered-document preparation is read-only; the separate wet-authoring adapter samples neutral target content so its own masks/opacity are not baked twice. No new public DOM constructor, command, schema, script/plugin host service, REST endpoint, preset or UI tool is added by this internal dependency.
Backing cells default to 128 pixels per side (internal policies permit 1–256), with a 32 MiB resident cache by default. Requests still use the numerical core's bounded working allocations; original image/document/stroke geometry remains independent. Unsafe integer pixel centers and noninvertible working bases fail explicitly. Metadata, native source/result/backing data, processing scratch and worker/WASM copies remain workload dependent. One-shot preparation consumes the complete supplied path; retained internal sessions now support appended prefixes. These policies do not prove whole-process memory or interactive latency. Prepared authored commands/history/assets and publication have a sealed baseline; actual interactive tools/previews/cancel/presets and the remaining F06/T16/F14 gates stay open.
Wet paint simulation — internal dependency, authoring workflow unfinished
core/wet-paint.ts defines strict internal load/mix settings; engine/wet-paint.ts validates bounded working tiles and invokes actual AssemblyScript/WASM kernels through the ordinary pixel worker. This is not yet an authored operation, public DOM constructor, tool, script/plugin service or REST endpoint. Document32/project3/workspace2 and portable preset v4 remain unchanged. Mixer/smudge completion still requires native spatial reservoir transport/replay, ordered layer replacement including transparency, shared commands/history/source references, UI gestures/previews, persistence and native/SVG/GPU capability handling.
Reservoirs store Float32 encoded-sRGB premultiplied normalized RGBA, preserving sub-byte pigment between dabs. Initialization interpolates captured source pigment and an RGBA8 loaded color by load (0…1, default0); hidden RGB in transparent inputs contributes no pigment. Source and loaded alpha participate in that interpolation. Load is finite initial pigment, not an automatic refill on every dab. The default loaded color is opaque black.
For each native destination pixel, t = flow * coverage/255. Deposit interpolates original premultiplied RGBA toward carried pigment by t*(1-wetness). Pickup separately interpolates carried pigment toward the pre-deposit destination by t*pickup, avoiding feedback from partially processed output tiles. Flow defaults1, wetness0 and pickup0.5; each is finite0…1. Zero flow/coverage preserves both inputs exactly. Wetness1 preserves destination bytes while allowing pickup. Results have RGBA8 destination pixels and Float32 carried pigment; RGB is zero when an active deposit rounds output alpha to zero. Whole-stroke opacity and captured selection must mix the completed original/result once afterward, never scale each dab's pickup. This is encoded-channel paint mixing, not linear-light, spectral pigment or physical fluid simulation.
Working requests admit at most4,000,000 complete pixels; larger native regions must be tiled without resizing their source. Carrier extent must match destination RGBA components; finite normalized alpha and premultiplied RGB are checked on both sides of the worker. Inputs/settings are captured before worker readiness and exclusively private buffers transfer. Outputs own their bytes across memory growth and subsequent requests. The working budget is not an image/stroke-size cap or a whole-process memory bound. No latency/device/60fps acceptance is implied by numerical correctness.
Image-backed brush textures — authoring integration in verification
core/brush-texture.ts and engine/brush-texture.ts define internal image-backed coverage preparation. BrushTextureSampler reads an existing AssetStore bitmap into a requested output tile or native source crop; original Blob bytes and decoded dimensions remain asset-owned. Working tiles use the existing 4,000,000-pixel/4096-dimension allocation policy, independently of source image geometry. Larger output requests must be split by the caller, never implemented by resizing/rejecting the original. Fractional source rectangles must remain representable and inside the original image. Smoothing is explicit, default true; false requests native nearest-neighbor sampling.
The ordinary pixel worker executes actual brushTextureMask WASM. Alpha mode uses source alpha; rectangular crop inversion uses 255-alpha. Affine inversion subtracts projected alpha from the projected opaque source-image support, preventing antialiased image-frame halos. Luminance mode uses encoded RGB weights (2126R+7152G+722B)/10000, with black as ink by default; inverted luminance uses white as ink. Both luminance modes multiply by source alpha, so transparent input remains transparent. Coverage rounds half up to an 8-bit alpha and returns white RGB. Canvas canonicalizes fully transparent pixels to transparent black. This is encoded-channel coverage, not linear-light or ICC-managed luminance. Conversion happens after native image sampling.
The sampler retains at most 32 MiB of private working surfaces by default, using the existing byte/entry-bounded Canvas cache. Keys include bitmap identity, channel/inversion, exact source crop, output grid and smoothing. Returned canvases are caller-owned copies, never cache-owned buffers; the caller must release them. Explicit clear/disposal invalidates pending publication, and cancellation/source ownership/lifetime checks reject stale results. Retiring viewport-cache retention does not cancel independently owned reads; retired conversions cannot repopulate a newer cache epoch. Worker inputs/settings are copied before readiness and returned type/extent are validated. Cache-copy allocation failure releases its private surface and preserves successfully prepared caller output. The sampler borrows the pixel processor and does not dispose it or the source assets.
prepareAffine additionally projects the original bitmap directly into a bounded working tile through a complete validated source-to-output affine map. The existing transform schema rejects singular/nonfinite matrices; mapped source bounds must remain finite. No source-sized intermediate is allocated. An inverted-alpha projection carries matching opaque image support through the same affine map; inverse coverage is clamped support minus sampled alpha. Callers still apply the intended footprint. Native conversion still happens after projection/sampling.
TexturedStrokeRaster is the asynchronous raw-ink replay adapter for authored textures, in verification. Texture coverage stretches over the existing normalized ellipse or pencil rectangle, modulating its native hardness coverage. Roundness, tilt, pressure and full symmetry copies use the existing shared stamp grid. A texture's orientation matters even on a round tip, so paintStampGeometry has an internal optional preserveTipAngle flag; the default retains existing isotropic geometry for ordinary untextured callers. Small texture footprints retain complete native sampling canvases. Larger footprints use document-anchored 256×128 output cores with a two-pixel projection halo; complete small footprints use at most 260×260 pixels. Footprint mattes reuse canonical ordinary coverage at the same output phase. Disjoint integer core clips apply flow through the native whole-image compositor, preserving repeated low-flow byte rounding. The caller must apply captured selection and whole-stroke opacity once afterward. No point/sample is replaced or dropped.
Append-only replay retains at most a 16 MiB raw prefix, with a separate private staging surface during asynchronous updates. Results reach the caller target and replace the retained prefix only after source/lifetime/cancellation checks. Cancelled partial work cannot advance the prefix. Larger output surfaces replay ephemerally without rejecting their geometry. Source identity/settings/view changes invalidate the prefix; concurrent requests serialize and clear/dispose invalidates pending requests. Returned source tiles are released after drawing, and the adapter borrows rather than closes its processor/assets. These working budgets do not describe whole-process peak memory or prove interactive frame rate.
Authored BrushTexture values and schema-32 brush DTOs now connect the adapters to ordinary paint, masks/filter masks, raster erasures and tonal coverage. Existing shared commands/history/asset validation remain authoritative. Native rendering shares one bounded sampler per renderer; borrowed prefix rasters never dispose that sampler. Texture paint selects complete Canvas fallback. SVG streams source-resolution coverage PNGs before emitting per-dab masks. Central asset visitors retain/remap texture references in projects/workspaces, recipes and cross-document copies; raster/SVG source capture pins these dependencies across asynchronous export. This integration is in verification. Active-tool source controls, gesture ownership and bounded texture cursors are now connected and in verification; source-bearing portable brush presets are now connected and in verification. No new script/plugin privilege, REST rendering operation or completed F06 claim is introduced.
core/text-style.ts applies the complete native font/spacing/direction state for text measurement, Canvas glyph drawing and SVG baseline preparation. It resets absent tracking/word spacing/kerning/direction and rejects unsupported nondefault word spacing/kerning before drawing. It retains native whole-line shaping instead of splitting glyphs or words. TextLayer setters, resetSpacing and strict layer.update share ordinary locks/history; typography patches require text layers. Immutable content signatures already include new primitive typography fields, invalidating reference/GPU glyph caches. Resize gestures capture complete typography and measure the new font size without overriding it with the captured size. Approximate headless bounds do not claim font parity. Schema 25 validates optional wordSpacing/fontKerning and gates them outside any immutable drawing proof; legacy roots/history migrate without inserted defaults. See the TextLayer guide for defaults, limits, feature detection and exact export behavior.
For nonzero word spacing, SVG preparation measures complete native/SVG responses against zero spacing before considering private whitespace-only inline styling. A candidate must match advance and outer non-whitespace character-position/ink responses; scalar advance equality alone is insufficient. Root typography, literal line content and a single shaped text chunk remain intact. Native grapheme boundaries after ASCII normalization guard every optional span and boundary trim. The established boundary-offset fallback handles unsupported/signed cases; a trim that would split a grapheme is declined. Per-layer caches key repeated lines by spacing, batch/candidate and in-line position-read yields preserve cancellation/font pins without dropping edges, and finally releases the hidden closed-shadow host and measurement canvas. The encoder independently validates private span ranges and whitespace/grapheme ownership. This changes no authored model/schema, public command, undo, source asset, REST or isolated script/plugin contract. Combining-mark, font-state, fractional/affine and cross-viewer fidelity gates remain open.
Current implementation baseline
Verified against source on 2026-10-19. The current document schema is 37 (core/model.ts), portable project container 3 (core/project.ts), and workspace snapshot 2 (workspace/repository.ts). These versions describe separate boundaries. Document.fromJSON validates supported schemas 1–37 before upgrading the document; workspace restoration also upgrades validated retained history. Schema additions include layer affine bases (6), guides (7), tonal strokes (8), retouch patches (9), smart components (10), smart filters (11), filter masks (12), linked local-image snapshots (13), layer comps (14), HSL (15), pixel selections/raster erasures (16), Color Balance/Vibrance (17), gradient maps (18), White Balance (19), imported LUTs (20), saved alpha channels (21), native vector stroke styles (22), vector gradient fills (23), native compound paths/fill rules (24), typography spacing (25), paragraph frames (26), justification (27), group pass-through (28), authored pressure response (29), brush-tip/spherical tilt metadata (30), affine brush symmetry (31), image-backed brush textures (32), prepared native wet replacements (33), ordered wet mask replacements (34), red-eye correction (35), frequency/native/document-phase filters, raster-erasure coverage and Linear Light/Burn (36), and inherited group frequency radii (37).
The lower implementation notes preserve incremental design decisions, including superseded limitations. Use this current baseline and the public API references for present behavior; consult the dated roadmap for delivery evidence and outstanding gates. Passing a slice's tests does not establish completion of the broader plan.
TIFF source and editing representation
core/interchange/tiff/inspect.ts reads exact Blob ranges and validates classic/BigTIFF directories/addresses; decode.ts streams the supported strips/tiles into PNG rows. A per-operation module worker owns parser/codec state. The client validates reports/results and terminates on abort/callback errors. engine/tiff-import.ts stages one page's AssetStore and revision-zero OO Document privately, with affine orientation; EditorApplication.openTiff guards session/revision/I/O generation and disposes failed staging before publication. Inspection and conversion warnings precede the UI import action.
The immutable source is the original TIFF Blob plus {page, allowPrecisionLoss}, while ImageAsset.bitmap contains decoded 8-bit editing pixels in raw source coordinates. Project/recipe asset manifests and workspace transport preserve these decode settings; cross-document copies compare them as part of source identity. Recovery captures and hashes settings alongside source bytes/metadata, so distinct pages cannot alias and corrupt settings invalidate a checkpoint. Existing non-TIFF checksum encoding remains unchanged. Document/project/workspace schemas stay 27/3/2; older checkpoints cannot restore choices they never recorded. Source-dependent decoded/output/browser memory remains a real constraint despite row-streamed decompression and no arbitrary import-size cap. The exact supported subset, errors, parser budgets and trusted-only API are in SCRIPTING_API.md.
Raster PDF export boundary
core/pdf.ts owns PDF real/address/page validation and Blob-backed objects with an eight-byte cross-reference offset field. engine/pdf.ts captures the immutable document and shared visible raster/font dependencies before callbacks, reads PNG's canonical native grid, and streams bounded RGB/alpha row buffers into two native Deflate streams. One PDF image/soft mask and one placement matrix preserve source sampling across non-72 DPI; independently placed strips can introduce reader edge shifts. The writer retains compressed output and small object metadata, not a document-sized canvas/full RGBA image. Row width, resident decoded sources, output and PDF readers remain real memory constraints. Source/callback/font/cancellation failures abort private streams and release all native surfaces.
pdfDpi changes physical page geometry only; large pages use bounded MediaBox/UserUnit geometry. Unsupported physical extents appear in the preflight report, while actual export rejects invalid geometry. UI/host output remains a raster page, with editability, metadata, searchability and prepress losses disclosed. No document/project/workspace schema, isolated export privilege, REST rendering route or batch format is added. Generated sRGB/Display P3 ICC profiles now use 4,096-entry ICC-v2 transfer tables for the sRGB piecewise curve; Adobe RGB/linear behavior remains unchanged. Original embedded profiles and source bytes are not rewritten. See SCRIPTING_API.md for signatures, defaults, errors, memory/reader limits and the tested constructor example.
Affine coordinates and masks
core/affine.ts exposes the immutable public AffineTransform value using double-precision coefficients [a c e; b d f; 0 0 1] and column vectors. parent.multiply(child) applies the child first. Positive rotation is clockwise in the downward-positive editor plane. Inverse operations reject singular matrices; extremely ill-conditioned transforms may be singular at working precision.
Layer DTOs store x/y translation separately from an optional invertible basis with zero e/f. core/spatial.ts composes translation(x,y).multiply(basis) and accumulates parent matrices. DOM Layer.transform reads and writes the full local-to-parent transform, splitting its translation into x/y through one validated update. Raster width/height remain placed geometry, not a request to resample original source bytes. Layer selection supports translation, alignment, distribution, rotation, scaling and flipping through shared commands, with selected descendants excluded when their ancestor is also selected.
Canvas and WebGPU composition, inverse hit testing, tool coordinate conversion, transformed layer bounds and mask rendering consume composed matrices. engine/canvas.ts rebases translation against the tile origin in double precision before scaling. Cache placement signatures include the matrix. Reparenting and cross-document transfer preserve world placement through coordinate conversion; source assets remain immutable. Perspective and general warp are not implemented by the affine matrix model.
core/masks.ts composes linked mask geometry with the complete layer matrix; unlinked masks remain in document space. Layer.setMaskLinked converts offsets and basis to retain world placement. A literal mask DTO replacement does not perform that conversion. Selection/path capture maps geometry between source and target planes, including Bézier handles. Feather remains a document-pixel coverage operation after geometry transformation, so scaling geometry does not scale the feather radius. Rotation/scaling of layer or mask planes is distinct from bitmap-mask import and other unfinished mask tools.
Read PRODUCT_BRIEF.md for intent and API.md for both automation surfaces. The product is named Canoli Studio.
Boundaries
| Module | Responsibility |
|---|---|
src/dom |
Public OOP constructors: Document, raster/paint/vector/group layers, paths, strokes, selections, styles and adjustments. Browser-independent. |
src/core/model.ts |
Versioned document DTOs and structural validation. No pixels or UI state in the layer tree. |
src/core/commands.ts, store.ts |
Validated atomic mutation, immutable snapshots, stable IDs, undo/redo. |
src/core/validation.ts |
Strict runtime command schemas for REST and scripting results. |
src/core/assets.ts, project.ts |
Immutable original sources, small thumbnails, portable versioned project files. |
src/editor.ts |
Active document, assets, import/export, script application, session replacement. |
src/engine |
Region compositor, pixel worker bridge, WASM loader, tiled PNG export. |
assembly/pixels.ts |
AssemblyScript pixel kernel compiled to actual WASM. |
src/scripting |
Constructor-based JavaScript runtime and isolated worker runner. |
server |
Optional loopback REST service using the same document model. |
src/ui |
React views, central shortcuts, custom tokens and components. |
UI actions and scripting setters use the DOM. Attached setters emit commands; REST accepts validated command data. Commands update immutable document snapshots. Rendering reads snapshots and immutable source assets. A future AI adapter should return validated operations and new assets through this boundary, with provenance; generated JavaScript is not an AI execution mechanism.
Object identity and transactions
Constructors create detached objects. Adding to a document or owned group establishes ownership. A layer cannot belong to two documents, and groups cannot create cycles. Attached handles resolve their stable ID in the current revision, so retained handles reflect undo/redo. Access to a removed node throws until it exists again. Duplicates have independent node/effect IDs and share the original source asset. Constructor-driven duplicate commands include an ID mapping so replay in a script's host produces the same references.
Document.transaction(label, callback) is synchronous, atomic and one undo entry. Nested transactions and async callbacks are unsupported. Do not schedule asynchronous mutation from a transaction; prepare asynchronous results first. Failed transactions discard document changes; handles created during a failed transaction must be discarded. Active-layer selection (selectedLayer) is session state and does not create history. Pixel selection (selection) is undoable document content. History retains up to 60 metadata revisions, not copied pixel arrays.
The underscore-prefixed methods are internal adapters, not supported external API. DTOs are for serialization and transport, not direct mutation. Current document schema 16 adds pixel selections and raster erasure records; supported older documents migrate after validation. Unknown layer/effect kinds and fields unsupported by a reader fail rather than silently disappearing.
Resolution and memory
No fixed megapixel, image-byte-size, session-pixel-count, or 8192-pixel import cutoff. User requirement: modern high-resolution images retain their original dimensions and source data. Document integer dimensions need only be positive and safely representable in JavaScript; this is a numeric representation constraint, not a product-resolution tier.
Working allocations are independent of document size:
- The browser decodes the original image with
createImageBitmap; original compressed bytes are retained as immutable blobs for the v3 project container. Images are never silently resized on import. Layer placement may fit an image within an existing composition without modifying its source. - The viewport renders only the visible document region. Zooming to 100% requests the corresponding source-resolution region. Screen buffers use a 4 MP / 4096-pixel-side allocation budget, not an import limit. Very dense/high-DPI viewports can use a reduced working preview.
- Each tone operation runs on tiles no larger than 1024 × 1024 in a worker. Tone and Blend If are point operations and require no halo. Drop shadows render padded regions that include blur/offset contributions across tile boundaries; verify seams against a full-region reference.
- Group opacity and blending apply once to an isolated group buffer for the current region. Intermediate canvases are released after compositing.
- PNG export renders full-resolution tiles and feeds rows into
CompressionStream('deflate'). It never creates a document-sized output canvas. Scanline strips target about 4 MB; compressed PNG chunks remain in memory until download. Format dimension restrictions are export-format constraints, never image import limits. - Thumbnails use small separate images, avoiding a second full-size decode per layer row.
This is not a claim of infinite-size support: browser decoding still materializes the source bitmap; original image assets remain resident for undo; the document manifest still materializes JSON; legacy .luma JSON/base64 imports still allocate large strings. Device memory, browser decoders, numeric representation, and output formats impose real constraints. Recoverable decoder/allocation failures must report the actual operation, not invent an MP cutoff. A browser process killed by its OS cannot be caught reliably.
Next scaling boundary: lazy/region-capable image decoding, disk-backed asset storage and caches, streaming manifest/asset I/O beyond the current blob container, cancellation/progress, and expanded GPU coverage where measured performance justifies it. Do not reintroduce document caps to compensate for whole-image buffer allocation. Test 50 MP end to end and dimensions beyond prior cutoffs in model/API tests.
At reduced preview scale, adjustments operate on the resampled working pixels; nonlinear clipping can differ from final full-resolution export. Source-size crops and export use full-resolution processing. The first kernel uses encoded sRGB 8-bit channels; linear-light processing, ICC fidelity, RAW, CMYK and HDR need explicit future design.
Tools and extended document content
ToolController tracks gestures, settings, command previews and a separate transient paint preview. Brush/pencil input accumulates all delivered/coalesced pointer samples, while preview publication is limited to one animation frame. A new empty paint layer is placed with the existing commands once at gesture start; subsequent samples never clone or validate the whole document. Pointer release includes the final endpoint and creates one validated DOM transaction. Escape, focus loss or session replacement cancels the gesture, including in-flight clone capture; a generation counter and document revision prevent stale commits. New paint/vector layers are placed above the selection or inside a selected group with document coordinates preserved. Preview placement uses the same commands.
Paint operations are immutable metadata (points, pressure, clip, style, source-tile references). Each operation renders into the current region, then its opacity applies once. Pencil uses pixel-aligned stamps. Clone snapshots the visible composition in at-most-1024px tiles before committing; staged assets are removed on cancellation/failure. Committed assets remain available for undo, and project serialization includes assets referenced by both rasters and clone operations. Stroke IDs and path IDs regenerate on duplication; original source assets remain shared.
Paint replay reuses one scratch canvas within a drawPaint invocation for ordinary fill, brush, pencil and eraser strokes. Each reuse clears pixels and resets transform, alpha and compositing before drawing. Per-stroke opacity and clipping still apply separately on the unchanged render grid. Clone and live Clone-source paths keep separate replacement surfaces. The scratch is invocation-local, never shared across concurrent renders, and released in finally, including failure paths. Long replays check an approximately 2 ms time budget between strokes and every 32 stamps within cold strokes, yielding through a private MessageChannel task; both ports close before continuing. This creates opportunities for input and painting while retaining operation order and complete-frame presentation. Active incremental previews retain synchronous stamping. A shared stamp iterator preserves interpolation, pressure, spacing and viewport clipping across synchronous previews and cooperative cold replay. The budget is best-effort: a native canvas operation or a batch of 32 expensive stamps is not interrupted; scanning offscreen segments and geometry bounds also remains synchronous.
Vectors store anchors and absolute local Bézier handles, stroke/fill and closure. Attached paths resolve by ID. Marquee regions evaluate ordered Boolean operations into a 4×4 subpixel mask in the WASM worker, with consistent coordinates across tiles; strokes capture that selection in local coordinates. New optional selection/style/fill-opacity fields are additive in prototype schema 1, with defaults for old files. Older builds may reject paint/vector layer kinds rather than silently discard them.
The region compositor isolates content, builds a shadow with padding, adds the color overlay, applies fill opacity to content, applies WASM Blend If to the styled result against preceding siblings, then composites with layer opacity/blend mode. Group child Blend If sees that group's internal backdrop. Color overlay and shadow pixels are browser Canvas operations; per-pixel tonal gates execute in the WASM worker.
npm run build:docs converts repository Markdown into local HTML/CSS under public/developer. Both dev and build generate these pages. The canonical source remains docs/; source-file references are labeled as repository references in the generated pages.
Interactive rendering caches
ActiveStrokeRaster retains one unmasked brush/pencil canvas and draws only newly appended segments with the same stamp grid as full replay. It composites a copy with the captured selection mask and stroke opacity once, then feeds the normal layer/group/effect compositor. This preserves pressure, soft edges, translucent overlaps and export parity. A changed stroke/settings, rewritten or shortened point prefix, transform, viewport or scale resets the surface. The active surface retains at most 16 MiB; larger effect halos use full replay without imposing a document-size limit.
CanvasCache retains up to 64 MiB (and 256 entries) of least-recently-used layer content and active selection-mask canvases. Keys include the document, asset store, complete layer content, absolute placement and render space. Frozen layer signatures are memoized by object identity. Content is cached before its own styles; backdrop-dependent Blend If always runs against the current composition. Ancestors containing a live stroke recompose their children. Reads/writes copy synchronously, so asynchronous jobs cannot retain references to evicted buffers. Session replacement/disposal clears retained pixels and prevents in-flight jobs from repopulating an obsolete cache.
RenderOptions.paintPreview is an internal trusted tool/render adapter, not a scripting or REST mutation API. Export and clone sampling pass cache: false to avoid replacing useful viewport entries with one-off tiles. The same option provides the full-replay reference in renderer regression tests. Completed strokes remain editable metadata; the cache is neither persisted nor part of history. Stroke commit can still replay a changed paint layer once, and complex shadows/Blend If still cost work per frame; there is no universal frame-rate guarantee.
Browser tests in tests/rendering.e2e.ts cover pixel parity, segment work, frame batching, final samples, cancellation, cache eviction, and tone invalidation. The existing high-resolution import/export and tiled-effect tests remain required.
GPU viewport backend
AdaptiveRenderer preserves CanvasRenderer.render() for export, clone capture and reference pixels. Its prepareViewport() selects WebGpuRenderer when a hardware adapter is available in a secure context (HTTPS or localhost), and otherwise prepares a Canvas/WASM frame. Software adapters are rejected in normal operation; an internal constructor option permits them in shader tests. This does not require a backend server, cloud upload, paid service or document-model change.
GPU viewport behavior:
- Source images are drawn into visible-region buffers before upload, never into a GPU texture sized to the entire imported image. Unchanged raw raster, paint and vector content stays in an LRU texture cache. Tone changes reuse the original uploaded raster.
- WGSL implements incremental brush/pencil stamps using the shared stamp-spacing iterator, tone adjustments, captured Boolean selection masks, color overlay/fill opacity, isolated group compositing, all 18 blend modes, and source/underlying Blend If. Brush coordinates are rebased in JS double precision before entering GPU buffers. Stroke opacity and clipping apply once to the accumulated surface.
- Fill/clear, clone and vector primitives currently use reference rasterization on a cache miss and then retain their uploaded texture. Drop-shadow documents use the complete Canvas/WASM path; GPU blur is not implemented. Brushes with projected stamp diameters below two working pixels use the reference path so supersampling cannot erase subpixel marks. These are backend choices, not document/tool restrictions.
- RGBA8 textures use premultiplied alpha and encoded sRGB. GPU preview and committed GPU strokes match; Canvas/export comparisons allow small 8-bit rounding and edge-antialiasing differences. The tested stacked-effect fixture differs by at most four channel values; the tested soft-brush edges by at most eleven, with mean error below 0.1. Do not describe the two backends as bit-identical or claim universal tolerances from these fixtures.
- Cached textures retain at most 64 MiB and 64 entries, plus at most 16 MiB for an active stroke. Renderer-owned live textures have a 192 MiB working budget. These exclude browser/driver overhead, source decoding, Canvas fallback allocations, diagnostic readback buffers and the browser-owned swapchain. Device texture limits, allocation/validation failures and precision-sensitive masks trigger fallback rather than resizing/rejecting the document.
ViewportFrame.present()writes directly to a WebGPU canvas after the UI checks its render generation. It does not read pixels back to the CPU. The host replaces the canvas when switching backend because context types cannot be changed in place. Device-loss notifications request a fresh fallback frame automatically. Session replacement clears caches and invalidates pending frames; every prepared frame must be disposed.
The Canvas factory defaults to drawing surfaces without willReadFrequently; tone readback tiles, Blend If buffers and PNG readback explicitly request CPU-friendly buffers. Drawing surfaces no longer read back a probe pixel on allocation. The reference renderer continues to run per-pixel CPU operations in the WASM worker.
The footer reports GPU accelerated or Standard rendering for the displayed frame. Trusted development code can inspect editor.renderer.gpu.diagnostics (state, cumulative uploads/stamps/cache hits/frames/readbacks and retained/allocated bytes). This is an internal diagnostic, not a scripting or REST API. ViewportFrame.readPixels() exists for explicit GPU test readback only; ordinary viewport rendering does not call it.
tests/webgpu.e2e.ts runs actual WGSL through Chromium's SwiftShader adapter and reads GPU output buffers to check pixels, texture reuse, large-document regions and device-loss recovery. The presentation shader is separately tested against a real GPU texture in the preferred canvas format. The current headless software-adapter environment cannot present a browser-owned WebGPU swapchain canvas reliably; hardware presentation and hardware performance must be checked on a real GPU. Shader tests are not proof of hardware speedup. The regular browser/production suites exercise the automatic Canvas fallback, gestures and exports.
Reference: WebGPU specification, canvas readback contexts.
Parameter controls
src/ui/controls.tsx owns the shared slider/number pair. Both tool options and bounded inspector properties use it. Tool previews update session settings directly; document-property previews remain transient commands until the gesture commits through the DOM. The control tracks pending gestures separately from committed values, so release followed by blur does not duplicate history. Path-width previews use the same command preview path as layer/tone/style adjustments. See the design system for keyboard, numeric-validation and scale rules.
Asynchronous work
Reference-renderer pixel buffers transfer to a dedicated worker and back; the main thread does not execute WASM pixel loops. The adaptive viewport uses GPU shaders when supported and the Canvas compositor otherwise. A serial preview drain starts at most one render per animation frame and takes the newest queued snapshot. It rejects stale revisions, viewports and cancelled/replaced gestures; an earlier prefix of the same live stroke may display while its next frame waits, avoiding starvation during expensive effects. Cursor updates are frame-paced too. Export uses the same region compositor at source scale. Replacing a session releases its assets; callers should finish asset-dependent work before replacing a session.
The constructor API is TypeScript, not compiled to WASM. AssemblyScript is a separate, constrained TypeScript-like language used only for the numeric kernel. It is replaceable behind the worker protocol. The GPU viewport backend and Canvas reference/export renderer share document snapshots without changing the public DOM or document schema.
Scripting boundary
See SCRIPTING_API.md for the public scripting contract, reference and runnable examples.
A sandboxed opaque-origin iframe creates a dedicated worker containing the bundled DOM implementation. The script receives a document snapshot, selected ID and constructor bindings, never host object references, credentials or image bytes. CSP denies network and external code loading. The host validates returned commands, checks that the document/revision has not changed, validates referenced assets, and commits one atomic transaction. A thrown error, invalid result, cancellation, timeout or conflict commits nothing.
The bootstrap transfers a per-run MessagePort to the worker; a separate trusted status channel reports startup/errors and stops the worker. Data, commands and permitted host calls then travel directly between host and worker. Readiness still permits snapshot transfer during worker initialization, without relaying the graph through the iframe. The worker freezes its exclusively owned native clone before ordinary validated Document.fromJSON reconstruction; public mutable inputs retain defensive copies. All callbacks/ports are cleared at completion, and each run gets a new iframe, worker and channels. No result/host reference is reused across runs. CSP, fonts, revision/assets, timeout and command gates remain.
The runner retains the starting document by reference only when it belongs to the internal recursively immutable registry. The subsequent message send makes the isolated copy; mutable inputs still use toJSON() immediately. This avoids a redundant main-thread clone while retaining snapshot semantics across host edits and staged transaction rollback. Public Document.toJSON() remains a defensive copy. Document.fromJSON() asks EditorStore to migrate the schema. For mutable input, the store first makes one owned deep copy; the private worker-owned frozen snapshot can reuse its proven immutable data. The store validates that exact snapshot under its supplied version, validates any retained history, and only then upgrades the owned schema version and freezes it. This avoids a second full-document validation and prevents getter-backed input from changing between validation and ownership. Store construction without the migration option preserves the supplied schema version. Caller metadata stays mutable and independent. Worker/frame lifetimes, CSP and host commit checks are unchanged; the direct data channel replaces the iframe relay.
This is an initial local scripting environment, not a reviewed public plugin security platform. Time is bounded to 5 seconds and result complexity is bounded; worker heap allocation is not strictly metered. Do not describe it as safe for arbitrary hostile code or enable server execution of user scripts. Constructor/command DTO validation alone is not a JavaScript sandbox.
Plugin boundary
src/plugins validates version-1 packages and maintains an immutable registry backed by local browser storage. Installation stores inert data. editor.runPlugin resolves only an installed command, invokes the scripting runner, enforces document read/write permission at the host commit boundary, checks revision/assets, and applies one labeled transaction. Plugins inherit the script runtime's time, command and result limits; there is no privileged page-context execution. The React Plugins panel provides package/source review, explicit installation/replacement, run/stop/output, export and removal. See PLUGINS.md.
REST boundary
The optional local service binds 127.0.0.1:8787 and checks loopback Host and allowed browser origins. It maintains in-memory document sessions separate from browser tabs. Routes cover document commands/history, asset upload/retrieval and asynchronous jobs with polling/cancellation. ApiServerOptions.authToken enables Bearer or X-API-Key authentication (health remains public); an explicitly supplied generation executor owns external provider authorization and billing. No production provider is bundled. These local facilities do not establish public deployment hardening, durable server storage, browser synchronization or server-side execution of arbitrary scripts. See API.md for route-level constraints.
External references
- AssemblyScript introduction
- MDN: canvas sizing and environment-dependent allocation limits
- MDN: createImageBitmap
- PNG specification
Appearance
public/appearance.js is a shared early bootstrap for editor and docs, loaded before styles. It owns validated local preference persistence (luma.appearance.v1), OS media-query changes, cross-tab synchronization, and resolved root theme attributes. AppearanceToggle in the tool rail tracks the resolved theme, toggles light/dark, and exposes AppearanceSelect in a native popover for System mode. AppearanceSelect subscribes to its luma:appearance-change event and requests changes through luma:set-appearance; static docs server-render the same selector and the bootstrap enhances it without React hydration. Appearance is UI state only and has no dependency on the document model, commands, renderer, export, or history. CSS tokens provide both palettes and a no-JavaScript OS fallback for documentation.
Planned intelligent-asset and professional-editor evolution
The full proposed design is in AI_FEATURE_SPECS.md, with dependencies and migration gates in IMPLEMENTATION_ROADMAP.md. It introduces local metadata extraction and review, immutable generation candidates, asynchronous host jobs, versioned masks/provenance, and future permissioned scripting/REST job surfaces. Local extraction and authored layer metadata are implemented as described below; review states, generation jobs, richer masks/provenance and host job APIs remain planned. Preserve the current synchronous transaction and sandbox boundaries; prepare asynchronous outputs first, validate against the document revision, then atomically install assets and accepted document changes. Project schema/storage evolution, color management and format support require explicit migration and conformance work before product claims.
Storage implementation progress
STORAGE_FORMAT.md documents the current v3 checksummed blob container, legacy v1/v2 readers and atomic IndexedDB recovery. RecoveryController coalesces committed snapshots; RecoveryRepository commits assets and checkpoint manifests together. Workspace snapshot v2 additionally retains tabs, bounded undo history and smart-object contents-editing links. Disk-backed decoding, broader crash/device testing and large-file memory guarantees remain open.
Local asset analysis
AssetStore.metadata owns a queued MetadataService; its worker extracts file declarations through exifr and normalizes inert fields. Work is bounded by one concurrent worker and an eight-second deadline. Asset removal/session disposal cancels analysis. Completion is guarded by worker identity; disposal is terminal, message errors fail explicitly, and queue continuation after completion/failure uses a microtask to avoid recursive synchronous failures. Derived results are rebuilt from source blobs after opening a project; no document commands or undo entries are emitted. AssetInfoPanel displays origins and exports privacy-filtered sidecars. See ASSET_METADATA.md for current coverage, output bounds and remaining hardening work. LayerMetadata provides a live OOP handle to authored layer records through layer.update; these persist from schema v2 onward, share locks/history, and remain distinct from worker-derived declarations.
Historical implementation notes
The sections below record successive implementation slices. Earlier schema/status statements describe their original stage and may be superseded by later notes and the current baseline above.
Layer masks
LayerMask stores selection regions or compound closed Bézier geometry plus enabled/inversion/density settings in a mask coordinate plane. Linked masks inherit layer translation; unlinked masks use document coordinates, with optional mask x/y offsets. maskFromSelection captures document-space regions using accumulated layer/ancestor translation. The layer patch is a complete mask replacement, validated in core and exposed through scripting/REST. Schema v3 prevents old readers from silently ignoring masks. Masks leave source assets and geometric bounds unchanged.
Canvas/WASM applies coverage to uncached working content after paint previews and before layer styles; group masks apply to composed children. Export uses identical region coordinates, including existing shadow halos. WebGPU uses the shared selection shader and a separate density/inversion pass, after tone/strokes and before styles/blending. Reference content uploaded for vector/text/raster layers has its mask removed to avoid applying it twice. Existing GPU failure/precision fallback remains available. Vector masks rasterize compound paths through Canvas using even-odd or nonzero fill on a fixed 256-pixel coverage grid with a two-pixel halo. Viewport and export strips crop the same coverage tiles to avoid clip-size-dependent curve differences; the GPU caches coverage per layer and uses its existing inversion/density/compositing pass. Coverage is keyed by geometry, fill rule, render region and layer origin. The OOP path getter returns detached copies; capture from a vector layer converts between source/target coordinate spaces. Bitmap-mask import, rotation and scaling remain T06 work.
Mask feather processing
engine/masks.ts generates raw selection/vector coverage with a complete finite-support halo for each at-most-512-pixel output tile. The featherAlpha WASM ABI performs three horizontal/vertical fractional box passes with sliding sums and float intermediates; only final alpha is rounded. The pixel worker owns execution and scratch memory. RGBA plus two float planes are bounded by the four-million-pixel working-tile guard before allocation; extreme preview zoom/radius combinations fail explicitly. The final coverage canvas is shared by reference/export rendering and GPU uploads. Canvas and GPU cache coverage independently of inversion/density. The GPU rounds density-adjusted coverage to byte alpha before applying it, matching the reference mask surface and limiting accumulated group differences. Source pixels are never blurred; normal styles and group composition happen afterward.
Mask origin resolution is shared by Canvas and WebGPU through core/masks.maskOrigin. Coverage cache signatures use the resolved origin, so parent motion invalidates linked coverage but can reuse stationary unlinked coverage. Layer.setMaskLinked converts offsets when changing planes to preserve world position; it emits an ordinary complete mask update with the existing locks/history. Document data is not mutated when an unlinked mask's layer moves. Reparenting and duplication retain the stored plane and offsets.
Direct mask translation uses the existing UI gesture preview boundary: capture the complete initial mask, preview an x/y replacement, and commit one validated layer.update on release. No renderer, document schema or REST/script contract changes are required. Keyboard nudges use LayerMask.with through the attached layer setter. UI target state is separate from document data; source position and mask linking are unchanged.
Painted masks add kind: "paint" with base coverage and validated ordered brush/pencil operations. Coverage replays through the existing stroke rasterizer, clips in the mask plane, and composites Hide with destination-out or Reveal with source-over before feather/inversion/density. Source tile references are disallowed. Canvas/export share this coverage function; WebGPU uploads and caches its result, then uses the existing mask pass. ToolController captures a mask/coordinate snapshot, publishes transient stroke previews at most once per animation frame and commits one full mask replacement via the public value API. Revision checks prevent stale commits. Painted-mask coverage now retains finished prefixes in the shared viewport cache and appends active points to a bounded tile LRU. Feather processing still runs over affected coverage tiles; preview data carries only the active stroke, target layer ID and hide/reveal mode.
Painted-mask coverage retention
PaintedMaskRaster shares the existing 64 MiB CanvasCache for finished prefix/full raw coverage and keeps at most 16 MiB of active raw stamp surfaces (at most 64 entries). This is additional to the existing ordinary paint-stroke 16 MiB surface. Cache keys include mask identity, render space and resolved origin; signatures include base coverage and full ordered operations. A completed full mask can become the next stroke’s prefix. Active coverage checks settings and the entire point prefix before appending, and resets on edits/undo. Clip, opacity, hide/reveal, feather, inversion and density are applied to disposable copies, preventing cumulative clipping or opacity. Cache eviction/oversized surfaces use fresh rendering without changing document data. Export/reference cache:false bypasses retention. Clearing the renderer releases active mask surfaces, and epoch guards prevent stale asynchronous jobs from repopulating cleared caches.
A layer’s unmasked content signature omits only its own mask. Group signatures retain descendant masks because those affect the group’s rendered children. Canvas and GPU source textures can therefore survive edits to their own masks without hiding child-mask changes. CanvasRenderer.maskDiagnostics reports prefix hits/replays, appended point work and active pixel bytes for verification; these counters are application diagnostics, not a scripting API or hardware speed guarantee.
Transient painted-mask previews
PaintPreview.maskMode distinguishes mask hide/reveal from ordinary artwork strokes. ToolController uses this trusted renderer-only value rather than rebuilding a document command per pointer frame. Canvas and GPU append the active operation only inside coverage rendering, preserving document snapshot identity, history and source content. The target group may reuse its unmasked child composition, but ancestors of a masked child must recompose. The UI may present an older prefix of the same stroke only when document, assets, region, scale, target layer, stroke ID and mask mode still match; cancellation/commit/revision changes invalidate pending previews. Stroke/total-point budgets are checked before and during capture; the final DOM assignment still receives full shared validation.
Selection/vector masks may retain the same ordered brush refinements as a uniform painted base. maskGeometry includes kind, base geometry and strokes in coverage signatures, preventing stale caches when either component changes. Raw coverage first rasterizes regions/paths, then composites strokes; prefix caching and transient previews share this ordering. GPU selection shaders are used directly only when no strokes/feather need reference coverage. Shape/path values remain independently editable through the OOP API; no source rasterization or schema migration is needed.
Mask-pen gestures capture the original immutable LayerMask, revision, resolved origin and a detached editable path snapshot. Hit testing uses a seven-screen-pixel tolerance in that plane. Frames publish complete mask command previews at most once per animation frame; release applies mask.with({paths}) through the attached layer, retaining strokes and mask-wide settings. Cancellation discards previews and revision checks reject stale commits. Keyboard edits resolve the selected mask contour/anchor against the current document; target state is UI-only. Existing layer pen creation remains separate. No schema, REST or scripting signature change is required.
Bézier subdivision uses the pure core/bezier.ts De Casteljau helper. Public VectorPath.splitSegment commits through existing path validation/history; the mask pen splits detached path copies and replaces the attached mask once, retaining its settings and paint refinements.
Mask contour creation retains a draft across pointer releases, including the original document/revision, immutable mask, resolved origin and new anchors. Each pointer gesture clones the draft points; frame previews append one closed contour to the captured mask DTO. No intermediate anchor enters document history. Completion assigns LayerMask.with({paths}) inside a single named transaction. Explicit cancellation clears the draft and previews; revision/selection checks reject stale commits, and the UI discards an idle draft when the document revision changes. Contour drafts are transient tool state and are not saved, recovered, exposed through scripting or sent to REST. Those surfaces continue to accept completed closed path geometry.
Mask curve hit testing uses core/bezier.ts with pointer-relative screen coordinates. An iterative De Casteljau search bounds candidate intervals by control-point boxes and evaluates actual cubic points. It prunes improvements below 0.01 screen pixels, stops at representable parameter/depth bounds, and shares a 65,536-node work budget across a mask. A work-budget error leaves the document unchanged and suggests zooming in or using Insert midpoint. This is a bounded numerical search, not a symbolic nearest-point solver or an image-resolution limit. Anchor/handle hits precede curve hits. Successful curve hits subdivide only the affected segment in a detached mask preview; release commits through the existing mask update. The insertion is fixed at the pointer-down location; moving the new anchor is a subsequent editing gesture. Cancellation cannot leave a selected transient anchor index referring to a different committed anchor.
document.crop delegates to core/crop.ts: validate an integer rectangle, rebase root positions and document-space selections/unlinked masks, then retain all local content and assets. It operates on the command executor’s detached document clone, so schema/coordinate overflow errors discard the entire operation. Existing schema-v3 geometry stores the result; no crop bitmap or new project version is needed. Document-level crop/resize can include locked content because they change the canvas basis rather than local artwork. EditorStore history records whether an entry contains a crop/resize (including transactions); a session-only canvasRevision increments on dispatch/undo/redo of those entries. EditorApplication observes that marker to reset transient tools even for same-dimension crops or scripted transactions. It is not serialized into project document data. The crop dialog captures a document/revision stamp and rejects stale application.
CropController owns a document/revision-bound transient rectangle and pointer gesture, independent of document snapshots and command previews. ToolController delegates crop pointer events and publishes its frame-paced state changes to the UI. CropOverlay presents shading, thirds and screen-sized keyboard-operable handles; CropDialog can initialize from the draft. Pointer release retains a draft, while Apply dispatches Document.crop once. Cancellation clears RAF work and the frame; stale document identities/revisions reject before commit. Enter/Delete/arrows use the existing shortcut registry with crop-specific behavior, and focused handles consume their resize arrows to avoid a second global nudge. Existing canvas-revision resets handle successful crop and undo/redo. Public REST/scripting geometry contracts are unchanged.
The viewport render-region memo depends on current document width/height, not the stable DOM handle identity, so crop/resize and undo immediately request the correct region. An artwork-only clipping container bounds the previous frame while an asynchronous replacement is pending; editing overlays and crop handles can still extend outside the canvas. Pointer conversion uses that container’s canvas-sized bounds.
The internal raster draw boundary now receives the full world matrix, computes visible transformed bounds, and applies that matrix directly when drawing immutable source bitmaps. Tone effects still process bounded output tiles; each tile subtracts its output origin from the same placement matrix. Rotation, reflection and shear are tested at this internal boundary with independent Canvas references, including coverage across the 1024-pixel processing boundary. This does not make general layer transforms serializable or available in the UI; remaining leaf types, masks and GPU reference delegation must still carry complete matrices.
Vector and text leaf drawing now receive full world matrices and apply them directly through applyTransform. Vector culling maps path bounds into world space before testing render-region overlap, preserving paths rotated or sheared into view. Internal fixtures compare transformed Bézier fills and reflected/sheared text pixel-for-pixel with independent Canvas drawing. These boundaries are ready for affine data, but the translation-only schema and remaining paint/mask/tool/GPU boundaries still prevent public layer rotation.
Paint leaf drawing now takes a full world matrix for fills, brush/pencil stamps and clone source tiles. Visible stamp bounds are inverse-mapped into local space; stroke/clone bounds are mapped into world space for culling. ActiveStrokeRaster retains its translation adapter for mask callers but accepts a full matrix and includes it in reuse signatures. Selection coverage inverse-maps output subpixel samples using both diagonal and cross-axis steps in the WASM kernel; omitted cross-axis steps default to zero. The existing 4×4 Boolean coverage rule and bounded processing tiles remain unchanged. This internal WASM ABI change requires rebuilding pixels.wasm together with the JS wrapper. Mask geometry rasterization, GPU native strokes and tools still require affine propagation before stored layer transforms are enabled.
Mask coverage now accepts the mask-plane world matrix through selection/vector geometry, painted refinements, active stamps, prefix caches and feather tiles. Vector coverage keeps the fixed output tile grid and applies the complete matrix within each tile. Raw coverage/cache signatures include that matrix. Canvas composition passes linked/unlinked mask matrices directly. Feather remains a document-pixel coverage operation after geometry transformation, so scaling geometry does not scale the feather radius. Translation adapters remain for callers not yet migrated, particularly GPU mask delegation. General affine GPU sampling, document schema and tools remain unfinished.
GPU layer-mask coverage now receives the complete mask-plane matrix and includes it in its retained texture signature. Translation-only, unfeathered selections retain the existing native shader. Other transformed mask coverage uses the shared Canvas/WASM renderer and uploads the result before GPU density/inversion/compositing. Matrix changes with identical origins invalidate the texture. A SwiftShader test reads the actual uploaded texture, verifies exact alpha agreement with shared coverage, and checks reuse versus invalidation. This is hybrid GPU compositing, not a claim that affine mask geometry is rasterized natively in WGSL.
GPU reference leaf rendering now passes a complete world matrix into a Canvas-only rootTransform option. Its isolated neutral layer uses zero local translation, preventing double application of the source position. The option is an internal Canvas reference basis, not a generic GPU render option, persisted property or scripting API. Raster/vector/text reference callers and clone/fill delegation carry the composed world matrix; native GPU brush/pencil sampling remains a separate migration. An actual GPU texture-readback fixture checks transformed reference geometry against independently specified Canvas curves.
Adjustment layers and tonal primitives
AdjustmentLayer introduces non-destructive, full-stack adjustment layers with kind: "adjustment". Unlike content layers, adjustment layers do not own raster assets or spatial bounds. Instead, they evaluate non-linear transfer functions against the accumulated preceding backdrop stack.
Stack ordering and masking:
- An adjustment layer modifies the accumulated backdrop up to its position in the layer tree.
- Stack bounds: layer masks (selection, vector, or paint) constrain the adjustment's spatial influence. Outside the mask, the backdrop remains completely unchanged.
- Alpha preservation invariant: adjustment layers strictly preserve the backdrop's alpha channel. Transparent pixels remain zero alpha and color; semi-transparent pixels retain their exact alpha.
Transfer math and lookup tables:
- Curves: Evaluated via monotone cubic spline interpolation (Fritsch-Carlson algorithm in
src/core/adjustments.ts), ensuring monotonicity between control points and preventing overshoot artifacts. Generates 256-byte lookup tables per channel (RGB master, red, green, blue). - Levels: Evaluated via piecewise transfer functions mapping input black/white points and midtone gamma to output black/white points.
- Lookup table composition: Precomputed composite 768-byte lookup tables (R, G, B) allow single-pass evaluation across pixel buffers.
- Processing space: Strictly encoded 8-bit sRGB processing space. High dynamic range, 16-bit float, and non-sRGB working spaces remain future architectural milestones.
WASM and WebGPU execution:
- Canvas/WASM Reference Renderer: The backdrop region is read back and passed to the compiled WASM kernel (
applyLutfor 768-byte table lookup,blendAdjustmentfor in-place alpha-preserving interpolation). - WebGPU Compositor: Evaluates Tone adjustments and Master Levels natively in the processing WGSL shader (
case 6uandcase 7u), preserving backdrop alpha and premultiplied color representation. Non-master (per-channel) levels and non-linear spline Curves trigger clean fallback to the reference CanvasRenderer viaAdaptiveRenderer. - Tonal Histogram: Bounded 256-bin histogram computation (R, G, B, Luminance using
0.2126R + 0.7152G + 0.0722B) with mean, median, stdDev, and total pixels statistics. Computed via WASMhistogramkernel with a pure TypeScript fallback.
Generation and batch review corrections (2026-09-30)
Generation must reject unconfigured providers. Procedural providers belong exclusively in test fixtures; no synthetic fallback is permitted in job execution, reference capture, source-image loading, or batch export. The provider bakeoff remains incomplete and must not infer real scores from fixture images or profile constants.
Encoded candidate images must decode successfully, match declared dimensions, and have their transparency verified from decoded pixels. Invalid candidates cannot be promoted into project assets. Masked edits use reference-rendered document pixels, including groups, masks, text, paint and adjustments; capture errors prevent submission. Synchronous recipes reject ai.generate before applying any commands.
Batch runs persist source bytes and completed variant checkpoints. Reload recovery resumes interrupted work and skips successful items; completed variant bytes are hash-checked before reuse. Missing or undecodable sources and rendering/encoding failures fail the item explicitly. PNG, JPEG and WebP deliverables must contain the requested format and dimensions, independent of viewport allocation defaults.
GPU affine stroke and selection sampling
GPU brush/pencil stamps now use complete linear transforms, with centers rebased in double precision before upload. Selection regions carry an inverse transform into normalized local coordinates, preserving rotated/sheared Boolean clips. Incremental surface keys include all matrix coefficients. Brush flow, size-pressure and opacity-pressure settings reach native stamps; bounds honor disabled size pressure. Subpixel marks under non-axis-aligned transforms use the reference path when the sampling grid cannot preserve coverage. Axis-aligned pencil coverage remains analytic.
This is internal rendering support for T07. Stored layer transforms and public tool coordinates remain translation-only until the model/command/tool migration is complete. SwiftShader tests exercise real WGSL correctness, not hardware performance. Transformed antialiasing is compared with bounded tolerances, not claimed to be byte-identical to Canvas.
GPU erasers use destination-out against accumulated paint in both preview and committed replay, including clipped coverage, flow and opacity pressure. Hard brush/pencil edges use 8×8 coverage samples; fully covered interiors skip sampling, and soft gradients retain 4×4 sampling. One hard eraser fixture differs from Canvas by up to 33 alpha values at an antialiased edge (mean below 0.32 over the image); that GPU edge agrees with independent 64×64 numerical circle integration. This is a documented rasterizer difference, not a universal backend tolerance.
Generation job dispatch must check queued state before invoking an adapter. Host abort races settle provider/staging waits even when an adapter ignores its signal; late validation results are discarded. External cancellation billing still requires a production adapter's reconciliation contract. Candidate promotion owns a separate decoded bitmap from the staging shelf. Apply checks revision both before promotion and inside the commit transaction; failed commit removes only the promoted asset, preserving staged pixels for retry.
Candidate placement captures the protected reference before asynchronous promotion. Promotion rechecks candidate identity after bitmap cloning; preview/apply recheck after composite rendering and before returning or committing. Discard or staging disposal during either wait rejects placement, releases temporary assets/surfaces, and leaves document history unchanged. Rollback must not turn a discarded candidate back into a staged candidate. Override approval does not bypass candidate lifetime checks.
The staging repository owns copied protected-edit verification context. It computes reports from actual raw/decoded pixels at staging and again before apply; provider reports are discarded. Invalid references or unreadable candidate pixels cannot be treated as successful verification. Protected application additionally inserts the proposed layer into an isolated document snapshot and renders the complete composite in native-resolution 1024-pixel tiles through the Canvas/WASM renderer. The final comparison includes placement, parent transforms, blending, masks, and existing effects; pixels outside the edit coverage are protected even without a separate protected mask. The final report replaces the raw-candidate report before commit. A violation requires an explicit override, rendering failures reject, and a revision change during verification rejects even when stale placement was previously authorized. Rejection removes the promoted asset without changing document history. Rendering surfaces are bounded; reference, result, and diff buffers still scale with document resolution. Recipe compilation preserves complete recorded layer templates, using constructors for defaults and generating fresh identities before shared command validation.
Batch delivery fitting uses a renderer view that maps output tile regions back into source-document coordinates. RenderOptions.outputSize selects the output aspect ratio independently of the source region, subject to the renderer's working allocation budgets. Both Canvas and GPU derive their sampling scale from that region/output pair. This preserves nested transforms, local mask coordinates, font geometry and effects without rewriting layer DTOs. The delivery view clips contain margins to the source artboard and does not own/dispose the shared renderer. PNG continues to render bounded output tiles; JPEG/WebP use the existing full-output encoding allocation.
Recovery storage v2 retains three session checkpoints. Document and source-metadata/blob SHA-256 checksums are computed before the atomic IndexedDB write. Retained revisions share immutable hashed source records; garbage collection uses their combined references. Restore validates each revision newest-first and returns both its project blob and fallback information for the recovery dialog. Legacy records remain structurally readable. This does not restore undo history or supply portable-file integrity checks.
Portable container v3 adds a raw SHA-256 manifest digest in its 48-byte header and a hexadecimal SHA-256 field per original asset. Save captures the document/source references synchronously, then hashes compressed assets sequentially and returns a Promise
Command discovery reads ShortcutRegistry.actions; palette execution rechecks availability and invokes the same callback rather than constructing a parallel command path. Search ranking is a pure helper. The palette unmounts before dispatching actions that may open another modal, preventing focus restoration from stealing focus from the new dialog. The central shortcut hook treats palette and recovery dialogs as modal state. This adds no new document schema or scripting mutation surface.
Layer filtering is view-only. A pure traversal computes direct matches and the union of matching ancestors while carrying effective visibility/locking down the tree. LayersPanel renders the original layer objects by those IDs, preserving commands, drag targets and active selection. Filter state is not serialized or added to history and resets on document replacement. Collapsed group state remains separate from the temporary filtered expansion.
layer-tree.ts derives the same reverse-sibling visible order and hierarchy
metadata. useLayerTreeKeyboard owns transient roving focus, type-ahead and range
anchors. An anchor captures the actual Document object, ordered visible IDs,
ordered selection and additive base; unambiguous JSON array tokens avoid imported
ID delimiter collisions. A synchronous document subscription invalidates anchors
on external selection publication, even change-and-restore before React renders.
Owner/order changes reset anchors/search; removed focus repairs to a surviving
parent or nearest row. Undo repopulating an empty focused tree transfers focus
from its container back to a row. The App supplies actual current-document identity so old
UI events cannot target a replacement with identical persistent IDs. Selection
cancels tools/previews, rechecks ownership, resolves public layer handles and
calls Document.selectLayers. Row edits retain existing attached commands/Undo.
Immutable model traversal is memoized; mutable previews are recomputed. Fixed
widget bindings live in shortcuts.ts, consume only their contextual keys and
preserve editable fields/native action activation. No schema, REST, scripting or
plugin contract changes are involved.
EditorStore keeps immutable ordered selectedIds plus compatible selectedId, pruning absent handles after commands/undo/redo. LayerSelection is a document-owned OOP view; selected roots exclude descendants whose selected ancestors already receive a transform. Translation, alignment and removal use existing commands inside one transaction and preflight root locks. Script worker transport includes the full set, validates active/set consistency and extends read-only-plugin checks. Multi-layer canvas movement captures root positions and revision at pointer-down, previews a transaction, and validates revision before commit. Selection is not serialized into artwork or undo snapshots.
Batch recipe ownership
New batch configurations persist a deep-cloned recipeSnapshot alongside recipeId. Cost estimation and item execution use this snapshot, so changing or deleting a reusable recipe cannot change an existing run. Missing recipes are rejected before batch creation. Legacy runs with a recipe ID but no snapshot must be recreated explicitly; the runner refuses to infer the historical definition from current recipe storage. Runs without recipes remain supported.
Batch persistence failures
Browser batch storage requires IndexedDB. Open, write, delete, and read failures propagate to callers; browser reads use durable records rather than the headless memory backend. Writes update memory only after the transaction commits. A worker-pool checkpoint failure aborts remaining workers, waits for them to settle, emits run_failed, and makes waitForRun reject. The Batch dialog displays the error. The last durable checkpoint remains available for explicit resume; an unsuccessful persistence attempt cannot itself record a new durable status. Headless Node tests retain an in-memory backend.
Batch execution ownership
Browser start/resume acquires an exclusive Web Lock named for the run and holds it until its worker pool settles. A competing tab fails explicitly instead of interpreting a live run's running items as interrupted work. Browser termination releases ownership automatically. Same-instance starts retain deduplication, and resume waits for a previous local ownership scope to finish. Browsers without Web Locks reject execution rather than silently run without coordination. This covers execution ownership only; remote pause/cancel/review mutations require additional coordination.
Atomic batch updates
BatchStorage.updateRun applies a synchronous mutation inside one IndexedDB read/write transaction. Missing records and callback errors reject and abort. Worker picking/checkpointing, pause/cancel, worker-pool finalization, and review edits use this operation; cancelled item state is preserved against late worker patches. Completed manifests are derived from each service read/export snapshot, rather than persisted by overwriting a potentially stale run. This prevents lost updates in these paths. Start/recovery/retry and deletion still require broader lifecycle coordination.
Batch retry and deletion ownership
Retry acquires the same execution lock as start/resume before resetting failed items. Start/recovery transitions use atomic run mutations and check that preflight has not been superseded by a lifecycle change. Deletion through the batch service rejects active local/remote workers and holds exclusive execution ownership while removing the run and its source/output blobs in one IndexedDB transaction. Deterministic variant blob keys are also removed, including outputs written before their checkpoint. Remote cancellation still needs provider/worker notification and cancellation-output cleanup.
Cross-tab batch control notifications
Pause/cancel persist their state before publishing a same-origin BroadcastChannel notification. Active owners reread the durable run before applying a pause flag or abort signal, avoiding stale-message cancellation of a later run. Disposing a batch runner closes its channel and aborts local workers. Canvas calls already in progress still settle before ownership is released; abort guards prevent subsequent variants and cancelled item state remains durable. Environments without BroadcastChannel retain durable-state checks at worker picking/finalization but cannot promptly notify an in-flight worker.
Atomic batch output publication
Rendering returns encoded bytes without persisting them. commitDeliverable writes the blob and its item checkpoint in one transaction over runs/blobs, after verifying the item still accepts outputs. Cancelled or removed items reject publication. A post-render abort check avoids submitting known-cancelled bytes; the durable-state check also covers cancellation whose notification has not reached the worker. Previously checkpointed variants remain available after cancellation. This prevents new unreferenced outputs from interrupted publication; deletion still removes legacy deterministic variant blobs.
Per-document canvas views
The editor UI retains zoom and pan by live Document object identity in a weak map. Switching tabs immediately reads that document's view; a new document fits once, while later viewport observer notifications preserve the user's view. Explicit Fit and Actual Size actions still reset the active view. Reopening the same project into separate tabs does not share view state merely because serialized document IDs match. View state is session-only, not restored after page reload or included in portable projects.
Current T07 layer matrix migration (schema 6)
Superseding the earlier translation-only schema status: layers may now persist an invertible zero-translation affine basis, composed after the existing x/y translation. DOM Layer.transform reads/writes the full local-to-parent matrix, sharing command validation/history with REST and scripts. Canvas/GPU traversal and hit testing already consume localTransform, so they now render stored matrices. Cross-document copying records the composed world basis when lifting a selected descendant to the destination root. Tool coordinate conversion, reparenting, mask link toggles and alignment are still being migrated; those operations on nontranslation layers are not yet complete.
Recipe stepResult targets may include childPath: number[], a zero-based path through the group at the producing step. Compilation binds this path to that descendant's generated ID when the group is added or duplicated. Later reorders do not change the binding; removal causes subsequent references to fail validation. The recorder emits these references for descendants of added and duplicated groups. Duplicate commands reserve IDs for the whole subtree before simulation so dry-run and transactional execution agree. Existing targets without a child path still resolve the producing root.
Recipe parameter targets resolve exact layer IDs first, then exact names. Multiple name matches fail dry-run by default and with ambiguityStrategy: "fail"; explicit "first" permits choosing the first match; allowMultiple executes against every matching layer. Failed resolution prevents the entire recipe from mutating the document.
Generation accounting recovery foundation: the host-only BudgetLedger.snapshot() returns a detached schema-version-1 snapshot of approvals, accumulated spending, and outstanding reservations. restore(unknown) validates the entire snapshot and all reservation references/identities before atomically replacing memory. Recovery retains over-budget actual charges and revoked/expired approvals. Creation rejects negative prior spending and duplicate budget IDs; reservations reject duplicate outstanding job IDs. This snapshot API is not exposed to scripts/plugins. The durable accounting journal uses it; full job reconstruction remains incomplete; saved candidate restoration is described below.
Browser generation now uses GenerationJournal for authoritative accounting. The service awaits recovery at submit, hashes an immutable request, reserves/deduplicates atomically, and saves dispatch intent before invoking the adapter. Confirmed settlement is asynchronous and durable before output staging; failed writes retain unresolved reservations. Recovered explicit keys return a terminal explanatory job instead of issuing a second provider request. The host can inventory and reconcile persisted accounting even without an in-memory job. Generation dialog approval changes use the durable service method and generation stays disabled until accounting recovery succeeds. Complete job reconstruction and cross-tab execution ownership are still pending. GenerationRecoveryPanel loads unfinished accounting on opening/focus and explicit refresh, displays pending reservations, and exposes cancelRecoveredQueued only for reserved entries. Cancellation uses the journal transaction as the authority, so a stale UI cannot release a request that another tab has already marked dispatched. Failed writes retain the row and budget; successful cancellation refreshes available funds.
Browser generation injects GenerationCandidateStorage alongside the accounting journal. Successful output receives a host-owned candidate identity and is saved with provenance and copied protected context before job completion. Candidate restore is lazy when opening the generation dialog; it validates integrity and image decoding, re-evaluates protection, and marks candidates as restored so placement needs explicit review even if revision numbers happen to match. Saved candidates remain reusable until durable discard. Storage failures keep usable charged output in the current session with an error. Cancellation during storage removes the candidate, while billing settlement remains authoritative.
Completed-job idempotency recovery checks the journal before provider resolution. Matching requests load verified candidate pixels and provenance, reconcile them against saved accounting, and reconstruct a completed GenerationJob with original timestamps and base revision. Concurrent recovery uses one in-flight promise per job. Reading a paid result does not require new consent; incompatible request fingerprints still reject. No result is fabricated for an unresolved or discarded candidate, and recovery never redispatches such requests.
REST generation correction: server/app.ts no longer synthesizes placeholder output by patching PNG headers. Unconfigured generation returns 503, and analysis remains explicitly unsupported. An injected host executor returns validated-size decoded RGBA; the server encodes the complete PNG through the shared encoder. Cancellation/target deletion/shutdown abort execution and prevent late staging. REST idempotency binds normalized inputs within the document and retains keyed records for the server session. This executor boundary remains separate from browser accounting and is not a bundled production-provider integration. The shared headless GenerationJobService also now binds keys to request/provider/budget and retains terminal failures instead of silently charging again.
Batch terminal failure reporting
When workers finish all pending items, any failed item makes the run failed; otherwise cancelled items make it cancelled, and only a run without either outcome becomes completed. A terminal item failure emits run_failed with the persisted run and an actionable error summary. Successfully produced deliverables remain available, and selective retry continues to preserve successful items. Explicit pause/cancel takes precedence over finalization.
Recipe write failure recovery
Recipe saves and deletions write the proposed library to browser storage before replacing the in-memory library. Write failures propagate; the previous saved library remains authoritative. A stopped recording that fails to save remains in RecipeService.pendingRecording for the application session. The recipe dialog exposes retry and JSON export, including after closing and reopening the dialog. Starting another recording is rejected until the pending recording is saved. This draft is not durable: export it before reloading or closing the application when storage remains unavailable. Headless execution without localStorage retains its in-memory behavior. Corrupt-library recovery and cross-tab write coordination are described below.
Candidate-specific protected-edit approval
The generation dialog binds override consent to the selected candidate ID and the currently displayed verification report. Switching candidates clears consent, including when returning to a previously reviewed result. Replacing a report invalidates earlier consent. The application call passes an override only for the approved candidate. Reference preview association remains separate outstanding review work.
Candidate reference preview association
Protected-edit review obtains its Before image from the selected staged candidate's captured protection context, including contexts reconstructed from saved candidate storage. Changing candidates changes the reference image; live document or form changes no longer replace it. The display thumbnail samples into a surface with a maximum 512-pixel edge and does not copy the full reference buffer. This preview is for navigation only; invariant verification continues to use the original full-resolution pixels. Final-composite versus raw-candidate After visualization remains a separate outstanding improvement.
Unreadable recipe library preservation
Recipe loading validates the complete library before replacing its cache, rejecting malformed JSON, non-array roots, invalid entries, and duplicate IDs. A failed read retains the last readable cache and blocks persistence so an apparently empty library cannot overwrite unreadable data. The recipe dialog reports the failure and offers an exact copy of the original stored text for external recovery, plus retry-read after repair or restored storage access. No automatic reset or data deletion occurs. Browser saves, imports and deletions acquire the exclusive luma-recipe-library Web Lock, reload and validate current storage inside the lock, then commit the mutation. Independent tabs cannot overwrite unrelated saves or resurrect deleted records from stale caches. Same-ID writes follow lock order (last committed write wins). These persistence methods and their RecipeService wrappers return promises; callers must await completion. Browsers without Web Locks reject writes explicitly and retain export recovery. Read methods return detached snapshots; use reload() to refresh a cached library.
Generation geometry validation before billing
GenerationJobService validates target/reference integer geometry and representable RGBA byte counts before idempotency lookup, reservation, or dispatch. Supplied references must contain exact RGBA byte lengths; edit/protection masks must match target geometry with one coverage byte per pixel. Masked/protected edits require a matching reference. Invalid feather radii and protected region geometry reject before provider activity. These are format/geometry invariants, not an arbitrary megapixel cap; provider-specific capability constraints remain separate.
Verified-composite review imagery
Final placement verification attaches a transient bounded thumbnail of the rendered composite to the candidate alongside the resulting invariant report, document ID and revision. When this report is shown after a rejected placement, the inspector displays and labels the verified composite rather than the raw candidate, and identifies the checked revision. Raw candidate re-verification clears this derived preview. Placement always renders and verifies again; thumbnails never serve as verification evidence. This does not yet provide a separate pre-apply placement preview operation or persist composite previews across recovery.
Explicit protected placement preview
Check placement invokes a host-only preview branch of the shared placement implementation. It renders into a proposed document, publishes the verified composite report/thumbnail, and removes its temporary promoted asset while restoring candidate review state. It never enters the live document transaction. Concurrent document changes reject preview results; every later Apply rechecks. Preview clears prior UI override consent. The operation is restricted to protected candidates and does not call providers or reserve budget.
Mask containment and protected placement decisions
When a candidate has host-owned protection context, final-composite verification determines whether placement requires an override. Raw candidate differences remain visible for review but do not reject a placement before its mask, opacity, blend and surrounding composition are rendered. A containment mask can therefore safely hide changed protected pixels. This retains exact native-resolution verification of the proposed document before commit and all revision guards; it does not trust a provider-supplied report. Without host protection context, an existing failed report still requires explicit override.
Selected-root rotation
LayerSelection.rotate computes a canvas-space rotation around the union of selected-root bounds, applies it to each root's world matrix, then converts through the unchanged inverse parent matrix. All target matrices are prepared before one shared document transaction. Descendants of selected roots are excluded, inherited locks are preflighted, and every root must have geometry. Layer.transform dispatch provides common command validation and history for UI and scripting.
Multi-selection rotation gesture
The rotation gesture captures selected-root world matrices, inverse parent matrices, shared bounds center, document ID and revision at pointerdown. Pointer moves derive a transaction preview from the captured matrices; pointerup processes its final position and commits the captured root patches in one transaction after the revision guard. Escape/pointer cancellation clears the preview. This extends single-layer rotation without changing the underlying transform commands or serialized representation.
Selected-root scaling
LayerSelection.scale shares the center-transform preparation path with rotate. Positive canvas-axis scale factors are applied around the selected-root geometric union, then converted through each root's inverse parent matrix before a shared transaction. This preserves source geometry and asset identity; validation and transaction rollback reject singular/unrepresentable transforms or invalid roots without partial edits. Uniform presets use the same method as arbitrary-factor scripting.
Multi-selection corner scale gesture
Multi-layer corner scaling captures root world matrices and inverse parent matrices at pointerdown, with the opposite union-bounds corner as the fixed pivot. Pointer coordinates relative to that pivot derive positive horizontal/vertical factors; Shift selects their shared maximum for uniform scaling. Captured matrices drive a transaction preview and one revision-guarded commit, sharing rotation's cancellation lifecycle. Pointer clamping prevents singular/reflected drag results; the DOM's explicit scaling method retains its positive-factor validation contract.
Canvas snapping during movement
The pure snapToCanvas kernel compares translated bounds anchors with canvas edges/centers, choosing the smallest correction within tolerance per axis. Move gestures derive original bounds from the live document (not the already translated preview) and convert a six-screen-pixel threshold to document space using zoom. Corrected canvas deltas flow through existing parent-space movement conversion for single and multiple roots. Guide overlays are transient, pointer-inert, and cleared with the gesture preview; no document schema or serialization changes are introduced.
Stationary-artwork snap targets
artworkSnapBounds traverses visible nonzero-opacity artwork, excludes moving subtrees and suppresses ancestor groups whose bounds would change with the selection. Geometric world bounds contribute edge/center coordinates to the same per-axis nearest-target solver as the canvas. Move gestures cache target bounds once per drag, avoiding repeated hierarchy scans during pointer movement. Canvas targets win exact distance ties by deterministic ordering. Snap results continue through existing canvas-to-parent movement conversion.
Measured spacing during movement
core/spacing.ts measures nearest positive intervals and proposes centering/repeated-gap corrections against the existing cached authored bounds. The six-screen-pixel tolerance remains in document space; existing edge/center/guide attraction wins ties, and corrected axes recheck their orthogonal bands. App derives feedback from the actual executed preview, including affine parent conversion and placement clamping. Captured owner identity, selection and revision guard move publication even when a reopened document has the same stored IDs. SpacingOverlay uses pointer-inert DOM lines, screen-sized rounded labels and bounded collision placement; font loading rechecks label geometry. Settings/feedback remain browser session state, outside documents, commands, projects, plugins and separate REST. Existing shared movement commands retain one-step Undo. See the user contract.
Revision-bound canvas gestures
Layer and mask move gestures and single-layer resize now capture document identity/revision, matching multi-root rotation/scaling. A revision-change effect clears stale gestures, previews and snap guides; pointer updates also check the live revision before calculating from captured geometry or cached snap targets. Subsequent pointerup therefore cannot overwrite an intervening document edit. Gesture previews do not increment revision, so normal pointer movement remains uninterrupted.
Empty recipe recordings
Stopping a recording with no supported actions returns the recorder to idle and rejects without creating or persisting a recipe. The dialog reports this outcome and allows a new recording. Empty recordings never synthesize selection changes. Document renames are recorded as declarative document.rename steps and replay through shared transactional history. Unsupported command coverage remains incomplete.
Recorder coverage and effect bindings
The recorder captures effect additions and updates. Added effects receive fresh IDs at compilation; explicit references to an effect added earlier in the same recipe are mapped to that new ID. Recorded updates use a zero-based effectIndex in the target raster's current effect list; a missing position fails dry-run. Existing explicit effectId recipes remain supported. Unsupported commands are collected and shown in the recording UI, and stopping rejects the entire partial recording instead of silently saving an incomplete recipe. Starting a new recording resets this list. This makes coverage gaps explicit; it does not implement every editor command.
Multi-target recipe steps
Compilation resolves role: "all" to all layers, including nested layers, and allowMultiple: true to all matches for name, kind, tag, parameter and prior-step-output selectors. Each step snapshots its targets before simulation. Individual property/effect operations run once per target; removal and duplication drop descendants of already-targeted groups because those structural operations include the subtree. Dry-run displays an operation per target. Any failed target prevents the entire recipe transaction from committing; successful execution is one undo entry.
Multi-output creation steps retain every output (including creation-time descendant bindings) for subsequent stepResult targets. Multiple results require allowMultiple: true or explicit ambiguityStrategy: "first"; default ambiguous references reject. Insertion parents must resolve to exactly one group. Single-target resolveTarget remains a compatibility helper; compilation uses the plural resolver.
Recipe effect lifecycle also supports effect.remove (optional effectId or zero-based effectIndex, defaulting to the layer's conventional tone effect) and effect.reset (remove all raster effects). The recorder emits positional removal bindings and captures reset directly. Missing removal targets fail dry-run rather than silently succeeding; reset requires a raster target. Both actions participate in multi-target validation and the recipe's single undo transaction.
Authored document guides render as pointer-inert DOM overlays at zoom-scaled document coordinates. Only in-canvas lines are displayed; off-canvas guide data is retained. Move snapping includes authored guide coordinates on the corresponding axis, using the existing six-screen-pixel tolerance and Alt bypass. Overlays are outside the artwork renderer and export pipeline. Session snapping remains opt-in.
The collapsed Guides inspector section uses Guide/GuideCollection for add, orientation/position edits, removal and clear, preserving command validation and undo. Guide visibility is a session-local App setting, shared across tabs in that editor workspace; toggling it changes neither document revision nor saved guide data. Hidden guides are excluded from move snapping. Numeric fields accept negative/fractional coordinates within the model bounds and support keyboard commit/cancel.
Existing guide lines are focusable drag handles only in the Move tool when layer movement is active and the editor is not busy or space-panning. GuideOverlay holds preview positions locally; pointer release submits one collection update. Escape, capture loss, pointer cancellation, document/revision, editability or zoom changes invalidate drafts. Focused guide arrows nudge on the matching axis; Shift uses ten pixels. The empty-document welcome overlay is suppressed when guides exist so guide-only documents remain editable.
Viewport rulers use 1/2/5-based pixel increments with at least 60 screen pixels between labeled ticks. Tick allocation depends on visible viewport extent, not document dimensions. Origins follow zoom/pan and ResizeObserver measurements. Ruler drags preview locally and create one Guide only when released inside the document; Escape/capture loss and document/revision/view changes cancel. Keyboard activation creates a centered guide. Rulers share guide visibility and remain outside artwork exports.
Recipe numeric parameters accept finite numbers or complete decimal strings (optional sign, fraction and exponent). Whitespace-only strings, unit suffixes, arrays, objects, booleans and nonfinite values reject before execution. Numeric layer patch conversion uses the same decimal parser. Boolean parameters accept actual booleans or the exact strings true and false; other coercions reject. Invalid parameters invalidate the entire plan even if conditions skip affected steps, preserving document state and revision.
Recipe compilation accepts an optional available-asset ID set and validates all references in the simulated final document with the shared referencedAssets traversal (raster sources, bitmap masks and clone tiles). Interactive dry-run supplies the active asset store; execution uses the Document's attached store; batch preflight supplies each item's staged store. Missing references invalidate the plan before document mutation or export. Data-only compilers without an asset context cannot establish availability. This guard does not bundle source bytes: JSON recipes containing source asset IDs remain dependent on those assets until portable recipe packaging is implemented.
Retouch tonal kernel foundation
core/retouch/dodgeBurn.ts supplies the internal pure applyDodgeBurn operation for straight-alpha sRGB RGBA tiles. It returns new pixels, never changes source bytes or alpha, and preserves fully transparent hidden RGB and zero-coverage pixels. A one-byte-per-pixel coverage array represents brush/pressure coverage. Exposure and flow are each in [0,1]. Linear-light luminance L uses overlapping range weights: shadows 1−L, midtones 4L(1−L), highlights L. Signed strength spans at most two stops, scaled by exposure, flow, coverage and range weight. With gain g, the luminance curve is L′=gL/(1+(g−1)L); RGB shares its linear-light scale. Protect tones defaults on and limits the common gain before any channel clips. This is a defined Canoli Studio curve, not Photoshop compatibility. Non-sRGB inputs must be converted before use.
The kernel is connected to PixelProcessor.dodgeBurn(pixels, width, height, options, coverage?), which runs it as JavaScript in the existing pixel worker. This method snapshots caller inputs before awaiting worker readiness and transfers only its private pixel copy; it does not detach caller buffers. This is CPU worker execution, not a WASM or GPU retouch kernel. It now renders persistent tonal adjustments through the shared compositor and public DOM/scripting constructors; interactive brush tools remain unfinished. T20 still requires non-destructive stroke storage, sampling controls, preview/commit behavior, healing/patch solvers and performance/browser evidence. The current unit tests establish neutral-ramp monotonicity/direction, neutral-channel equality, alpha/source preservation, zero coverage and input validation; they do not establish complete retouching quality or the healing performance gate.
engine/retouch.ts now supplies internal renderTonalStroke(source, brush, adjustment, space, processor, world?). It validates a brush/pencil path using the existing mask-stroke contract, snapshots inputs, renders pressure/hardness/spacing/flow/selection coverage and sends the sampled source tile to the tonal worker. Flow belongs to brush stamp accumulation and is not multiplied again by the tonal kernel; zero flow returns unchanged pixels. Coverage rasterization uses a fixed 256-output-pixel lattice with two-pixel gutters to make request tiling independent of Canvas clip bounds. Temporary coverage canvases are bounded and released per cell. Persistent tonal adjustments now use this bridge against their preceding live backdrop. Additional sampling policies and interactive tool gestures remain required.
Tonal adjustment layers persist in document schema v8. TonalStroke is a detached constructor value containing an ordinary validated brush/pencil path and tonal parameters. AdjustmentLayer.addTonalStroke appends through shared layer-update commands, preserving masks, inherited locks and undo. The compositor samples the preceding backdrop, applies each stroke in order through bounded working tiles and then applies normal adjustment opacity/mask/blend semantics. GPU capability detection rejects this spatial adjustment kind and uses the Canvas fallback; it must never be treated as a global lookup table. Older document schemas with tonal data reject before migration.
Portable recipe execution through RecipeService captures the active document session generation before repository loading or image decoding. Document activation and service disposal invalidate the generation, including switching away and back to the same document. The private package executor invokes the captured guard after asynchronous preparation and before source installation, alongside existing revision/store/selection checks. Invalidated runs close staged bitmaps and commit no assets or history. Batch execution uses its independent staging document and does not depend on the interactive active session.
Batch estimates compile one plan per item using captured source geometry, final item naming, and merged batch/item parameters. Invalid plans (including enabled AI generation steps unsupported by this runner) reject preflight before workers start. Conditions that skip those steps remain usable. The dialog and persisted runs share the same filename/duplicate-name transformation. This preflight checks plan executability, not source decoding or package integrity: execution still validates actual source bytes, decoded geometry, installed asset references and commands. Asynchronous AI recipe/batch orchestration remains unfinished.
Poisson retouch kernel foundation
src/core/retouch/poisson.ts implements a four-neighbor Dirichlet solve on selected pixels using matrix-free conjugate gradients with an IC(0) preconditioner per encoded-RGB channel. The geometry-only incomplete-Cholesky factor is shared across channels. The numerical formulation follows Pérez, Gangnet and Blake, Poisson Image Editing (2003). Donor pixels must already be aligned to the target; callers supply a padded patch with zero coverage on its outer ring. Holes and disconnected selections use the surrounding target as fixed boundary values. Source guidance transfers donor gradients; mixed guidance chooses the stronger signed gradient per edge/channel. Transparent donor edges fall back to target guidance; transparent targets and target alpha remain unchanged. Coverage feathers the clamped solution against the target. Inputs remain immutable.
PixelProcessor.poissonBlend snapshots target/donor/coverage/options before asynchronous readiness and performs the iterative solve through the allocation-free AssemblyScript/WASM kernel in the pixel worker. A TypeScript numerical backend remains the reference. Private donor and coverage buffers transfer without a second structured-clone copy. Its result includes pixels, convergence, maximum channel iteration count and maximum absolute equation residual before RGB clamping/quantization. Defaults are 500 iterations and 0.001 residual in 8-bit RGB units. Exhausting iterations is an explicit nonconverged result, which future tool commits must reject or recompute. Malformed geometry/options and missing padding reject. This is an internal engine API, not a public healing DOM method. Fixed boundary values do not establish arbitrary C1 gradient continuity. Donor selection, non-destructive patch storage, gestures, cancellation during solving and GPU acceleration remain unfinished.
Run node --import tsx scripts/benchmark-retouch.ts for a correctness-checked Node reference timing baseline, or append --wasm to measure the production numerical backend; it is not browser interaction latency. The initial measurements are in docs/benchmarks/poisson-kernel-node-2026-09-30.json. The 128/256-pixel cases exceed the roadmap's 50 ms requirement, so the performance gate remains open.
The IC(0)/WASM comparison is retained in docs/benchmarks/poisson-kernel-ic0-node-2026-09-30.json and docs/benchmarks/poisson-kernel-wasm-node-2026-09-30.json. Both use unchanged fixtures, tolerance and pixel checks. WASM versus TypeScript regressions cover both guidance modes, irregular masks, varied RGB/alpha and incomplete convergence. WASM memory is host-managed, aligned and reused; out-of-range working-buffer/iteration requests reject rather than truncate. The 256-square median improved from approximately 682 ms (unpreconditioned TypeScript baseline) to 400 ms (WASM IC(0)); this still fails the 50 ms gate and is not a hardware/browser interaction guarantee.
Retouch sampling and patch preparation
retouchSampleDocument captures a detached layer tree for current-layer, current-and-below or all-layers. Current-layer retains only the selected branch, including ancestor transforms, masks, visibility and opacity; selecting a group includes its complete subtree. Current-and-below retains preceding siblings at every ancestor level. Following siblings are excluded. All-layers uses the complete visible composition. Missing targets or unknown modes reject. These are engine sampling semantics, not yet UI options.
sampleRetouchRegion reads native pixels in at-most-1024-square render surfaces; cancellation and readback failure release the current surface and stop further tiles. The returned buffer still scales with the requested region. prepareRetouchPatch captures document/selection/options before asynchronous work, computes a canvas-clipped padded bounding rectangle, rasterizes selection coverage with the existing WASM selection kernel, and samples target/donor pixels from that captured composition. Donor offset uses integer document pixels; selected donor coordinates outside the canvas reject. The worker solves and feathers the patch while preserving target alpha. Empty selection and nonconvergence reject explicitly. Preparation returns pixels/coverage/bounds and solver diagnostics without installing assets or creating history. It is not yet a persisted patch layer, host commit, DOM method or interactive patch/healing tool. Automatic donor search, commit-time session guards, edit storage and the performance/quality gates remain outstanding.
Recipe target and displacement semantics
The active-mask semantic target resolves only the selected layer when it has a mask; missing selection or an unmasked selection fails resolution. It never substitutes another masked layer. Recorded output aliases use generated identifiers independent of user layer names.
Recipe layer.translate actions accept finite numeric dx and dy values (or parameter references resolving to numbers), in the target layer's parent coordinate space. They compile to shared position commands and participate in the recipe's atomic undo transaction. layer.duplicate accepts optional inPlace: true to retain the source position; the default retains the editor's 24-pixel duplicate displacement. The product shadow preset duplicates in place, then translates by its requested offsets. Invalid offsets fail dry-run before any mutations.
Persistent patch adjustments
Document schema v9 adds adjustment.kind: "patch" with assetId, width, and height. The immutable PatchAdjustment scripting/DOM value captures this descriptor. Rendering transforms the referenced corrected RGB/coverage image through the layer matrix in bounded 1024-pixel tiles, interpolates RGB by coverage while preserving preceding alpha, then applies normal adjustment opacity/mask/blend behavior. Corrected colors are stored snapshots, not live Poisson recomputation. Project asset enumeration, cross-document copy and portable recipe collection/remapping retain the referenced images, including patch replacements in layer-update actions. Versions below 9 reject patch data. Solver preparation and persistent patch assets remain separate until the commit/tool integration is completed; callers must not apply feather coverage twice.
The trusted EditorApplication.applyPatch(offset, sampling?, solverOptions?, signal?) operation now captures the selection/document, prepares corrected RGB with binary solver support, encodes original fractional coverage once, and commits one patch layer at the document root. The preparation result retains both unfeathered correctedPixels and coverage-composited pixels. Revision, active-session generation, asset-store identity, selection and cancellation checks precede installation; stale work releases private resources. The host method is not an isolated scripting binding or REST endpoint. Browser PNG encoding/decoding still requires a surface large enough for the selected patch and can fail on device limits; no megapixel import restriction is introduced.
The Patch tool captures a document revision and settings on pointer-down. Pointer motion updates only its integer donor offset and a transient translated selection outline. Pointer-up invokes applyPatch with a controller-owned abort signal; tool cancellation/reset aborts pending work. Shared keyboard registration provides J; editable-field handling remains centralized. Selection geometry is retained after commit and the new patch adjustment becomes selected. The tool currently displays donor geometry rather than a solved pixel preview.
Local donor-search proposal
core/retouch/donor.ts implements deterministic local exemplar scoring. The selection mask marks excluded/damaged pixels. Candidate offsets must keep the selected support and its visible four-neighbor boundary inside the sampled region, avoid all selected pixels, and supply sufficient alpha. Scores compare boundary RGB differences after removing most constant channel offsets (variance plus a 0.01 mean-square color penalty), plus alpha error. Lower score wins; equal scores prefer shorter displacement and then traversal order. The damaged interior's RGB is never used to rank candidates. This is a boundary heuristic, not semantic recognition or a guarantee that an unselected donor is defect-free.
PixelProcessor.findDonor captures caller pixels, mask and options before awaiting worker readiness, and transfers private copies. engine/donor-search.ts captures the requested layer sampling scope, renders a native-resolution window around the selection and proposes an integer document-space offset. Search radius defaults to 64 pixels and is configurable; it is a local search parameter, not an image import cap. Empty/no-context/no-valid-donor inputs reject explicitly. Abort signals stop future sampling and reject late proposals; disposal of a dedicated processor can terminate an in-flight search. No result mutates assets, document data or history. No public DOM/REST binding, automatic healing gesture or confidence threshold ships with this foundation. Exhaustive candidate scoring still needs performance/corpus evaluation and optimization for larger search windows.
Healing stroke integration
renderRetouchCoverage is the shared fixed-grid brush mask rasterizer for tonal and healing paths. prepareHealingStroke captures brush data, selected sampling scope and solver options; renders native coverage and local source pixels; searches intact donor support; and solves a padded patch with fractional coverage applied once. The trusted host EditorApplication.healStroke(brush: BrushStroke, sampling?, solverOptions?, radius = 64, signal?) uses the same private guarded encode/install/transaction path as Patch, with a single Healing stroke history entry. It never changes the current pixel selection to stage a stroke. The method is an application-host service, not an isolated script or REST binding. The tool creates a stroke on pointer-down, accumulates/smooths pressure points with animation-frame overlay updates, and calls the host on pointer-up. Cancellation/reset aborts the owned signal. Each stroke currently becomes a new adjustment layer; editable source-stroke/donor provenance, review/reselection UI, live solved previews and the full public retouch API remain open.
Retouch operations attach their abort signal to their dedicated pixel processor. Aborting terminates that worker and rejects active numerical requests, instead of waiting for donor search/Poisson completion before discarding results. Shared viewport rendering is not terminated; cancellation still checks after an in-flight render/PNG encode/decode. PixelProcessor disposal is idempotent and rejects readiness as well as queued/active requests, including shutdown before the WASM worker becomes ready. Synchronous message-cloning failures remove the failed pending entry and preserve worker usability.
Donor search uses exact packed 32-bit support checks when all selected pixels have the same target alpha. A blocked-source bitmap represents selected/damaged pixels and insufficient donor alpha; shifted word intersections reject invalid candidates. Arbitrary masks and word/row boundaries retain scalar semantics. Variable target alpha falls back to per-pixel comparisons. Boundary scoring, candidate count and deterministic tie-breaking are unchanged. The scalar reference remains executable for parity verification.
When selected support and visible boundary have the same alpha, donor validation packs both into the checked footprint. After validity is established, candidates cannot improve a zero-score winner unless closer: all score terms are nonnegative. Such candidates still increment the valid-candidate count but skip redundant RGB scoring. The scalar path remains exhaustive, including boundary checks, and parity tests verify identical donor/score/count under transparency and distance ties. Nonzero winners and nonuniform-alpha cases retain their existing scoring behavior.
The pixel worker now supplies a WASM packed-validity backend to donor search. One allocation-free ABI call scans all candidate offsets in dy/dx order and returns a private byte validity grid; RGB scoring, counts and tie-breaking remain in TypeScript. Host validation checks grid geometry, support rows, memory size and aligned buffer layout before copying. Returned validity bytes are detached from reusable WASM memory. Variable-alpha support still uses the scalar path. Actual WASM parity checks compare donor, score, counts and errors against the scalar oracle across irregular masks, transparency and 7/31/32/33/65px row widths.
Healing reuses its captured native donor-search pixels when they fully contain the requested target/donor solver rectangles. Extraction copies detached row-aligned RGBA arrays and validates safe integer geometry and source byte length. Incomplete windows return a miss; the solver renders that rectangle normally. This fallback is essential at canvas edges because artwork can extend beyond the artboard and solver halos must preserve those pixels rather than substitute transparency. Reuse is scoped to one captured preparation, not a persistent cache or live-document read.
Candidate target lifetime and repeated placement
Candidate promotion captures the destination AssetStore lifetime before cloning its bitmap and checks it before installation. Shared preview/application also checks that lifetime after rendering and before commit. Closing a document disposes its store and invalidates outstanding placement, even when the document revision remains unchanged or stale placement is authorized. Each promotion receives a fresh project asset identity; the staged candidate identity remains stable. Reapplying after undo therefore preserves assets retained by history, and rollback removes only the current attempt's asset.
Recipe output bindings represent unique layer identities. An output alias equal to its own step ID is valid and binds once. Aliases colliding with another step ID or alias reject both schema validation and execution preflight.
Tonal sculpt public operation
Document.applyTonalSculpt validates a shared operation envelope, constructs immutable BrushStroke/TonalStroke values, and inserts a complete AdjustmentLayer through one root layer.add command. It captures pixel selection by default and keeps path coordinates in document space. This avoids selected-group transforms changing the meaning of public paths. REST /documents/:id/tonal-sculpt adds revision validation then invokes the same DOM method. The existing isolated scripting runtime bundles the method automatically. Rendering remains the existing live-backdrop tonal worker path; no new rasterization or provider dependency is introduced.
Patch source/destination placement
PatchOptions extends Poisson solver options with an independent direction, defaulting to source. prepareRetouchPatch captures and validates the direction and offset before asynchronous work. Destination placement translates the complete Boolean/affine selection in document space and negates the sampling offset; the common bounds/coverage/solver pipeline then processes the resulting repair region. It never mutates the document selection to implement translation. Host lifetime, cancellation and single-layer commit behavior are shared across both modes. Tool settings are captured at gesture start, and the overlay distinguishes donor from destination placement. Gradient guidance remains mode: source | mixed; placement direction does not change the Poisson equation.
Atomic isolated-script patch preparation
The sandbox Document's internal preparation callback sends its command prefix and validated patch request over the existing isolated channel. ScriptRetouch reconstructs that prefix against the captured host snapshot using parsed shared commands, validates referenced assets, and renders using a private asset view. Existing source bitmaps are borrowed; new corrected-pixel assets are owned by the preparation scope. A dedicated pixel worker is aborted when the script scope ends. Prepared layer DTOs are added to the sandbox document through ordinary layer.add commands, allowing subsequent script edits and repairs to reference them.
At final commit, only prepared assets referenced by the resulting document transfer to the live store. Failed transfer/dispatch removes assets installed by that attempt; remaining private assets are closed on disposal. Revision, session-generation and current plugin grants are checked during preparation and before transfer. Script failure/cancellation disposes the scope even if bitmap decoding is still pending; the late continuation checks abort and closes decoded output. Source bitmaps are never closed by private-scope cleanup. No source bytes, provider credentials or browser globals enter the worker. The five-second script budget remains; this change does not claim unlimited background script execution.
Script healing on attached layers
Layer.healSpot delegates to its owning Document, capturing a validated layer identity, document-space center/radius, current selection and options before awaiting the host. DOM validation rejects detached targets, ancestor locks and use inside synchronous transactions. The host reconstructs the command prefix and independently checks layer existence/locks, then constructs a constant-pressure BrushStroke and calls prepareHealingStroke. Default sampling is current-layer; the prepared correction remains a root adjustment. Healing and patch preparation share cancellation, private asset ownership and final transfer; sequential calls can reference prior prepared assets through the reconstructed document. Neither operation changes source raster bytes.
Automatic workspace checkpoint ownership
WorkspaceAutosave owns a sessionStorage tab identity and holds a browser Web Lock for its lifetime. If a cloned tab presents an already-held identity, it acquires a new UUID before saving. Checkpoints use independent automatic:<uuid> IndexedDB keys; manual current and named version keys are untouched. The controller coalesces notifications, serializes writes, waits for transaction completion before acknowledging success, retains dirty state on failure, and exposes an explicit retry/flush. Disposal prevents new saves and retains the writer lock through an already-started transaction. A storage/startup-restore error remains visible and cannot silently publish a blank replacement checkpoint.
Editor startup acquires identity, optionally restores its automatic checkpoint (or the manual fallback), then enables scheduling. Edits made while identity acquisition is pending are scheduled once initialized. Document/session events and viewport setters schedule checkpoints. Per-session project encoding is cached by immutable document snapshot and past/future stack identities, so changes to tab focus, selections or views reuse project blobs. Failed encodings are evicted from the cache. Startup restore validates every project before installing sessions; restored snapshots preserve content, views and the retained undo/redo window. This does not persist a complete crash-durable command log. The identity survives reload through sessionStorage; Recovery also enumerates automatic checkpoints for explicit restoration and removal after tab identity loss.
Automatic workspace discovery and cleanup
SavedWorkspace document entries optionally include a captured name for lightweight listing; older version-1 entries retain generic numbered labels. WorkspaceRepository.listAutomatic scans only automatic keys, validates each envelope independently and reports malformed entries without hiding healthy workspaces. It does not decode image assets or claim project integrity from metadata validation. Restoration by explicit checkpoint identity uses the same all-project validation and copy-session installation path as other workspace restores.
removeAutomatic acquires the matching writer Web Lock with ifAvailable and holds it until its IndexedDB deletion commits. A live tab therefore blocks removal, including the current tab. Closing a browser tab can release that lock asynchronously; an early removal attempt reports a visible error and can be retried after release. Manual and named checkpoints occupy separate keys. No automatic eviction policy is added; cleanup is explicit and confirmed in Recovery.
Retained workspace history
Workspace project blobs opt into a version-1 history envelope inside the checksummed v3 project manifest. parseRetainedHistory validates all snapshot documents, same-document IDs, labels and canvas-change flags, with a combined maximum of 60 past/future entries. Serialization captures history synchronously and embeds the union of image references from the current document and every retained entry, deduplicated by asset ID. Readers verify source completeness/checksums before decode. Every workspace project must validate and decode before any restored session is installed. Restored stores own detached, frozen history snapshots and preserve normal undo/redo, canvas invalidation and branch truncation semantics. Selection remains the saved workspace selection; history traversal filters it as usual. Older checkpoints without history open with empty stacks. Ordinary project downloads still omit history.
Browser storage diagnostics
core/storage-health.ts reads StorageManager estimates and persisted status independently with settled promises. Missing or non-finite/negative estimates remain unavailable; zero quota is not treated as usable capacity. No persistence request occurs during reads. StorageHealthPanel in Recovery owns its loading/error state separately from recovery writes and offers explicit Refresh and Request persistent storage actions. Async results are guarded against unmount or superseding requests. Remaining capacity is clamped to zero and labeled an estimate. Diagnostics neither delete records nor gate imports/saves based on estimated quota; existing transactional write results remain authoritative.
RecoveryController separates failed captures from its pending drain queue. A later public flush moves retained failures into pending only when no newer capture exists. Internal draining never requeues a failed capture, so a persistent quota failure cannot spin; other sessions can progress. Captures retain immutable document snapshots and original source Blob references. Disposal clears both queues and suppresses late save results. Shared storage-error formatting recognizes QuotaExceededError by name across realms and leaves ordinary error details intact; Recovery and workspace autosave use the same actionable quota message.
Smart-object graph foundation
core/smart/types.ts defines detached component masters backed by an original raster asset or a document composition. Compositions may contain ordinary layers/groups and nested smart-object instances, each with independent placement geometry, affine basis, masks and layer styling. Schema 11, the public SmartObjectLayer constructor and Canvas rendering now accept these contracts; see the integration section below.
ComponentRegistry is an immutable snapshot of definitions. Construction validates source geometry and composition layers, rejects duplicate/missing definitions, and rejects dependency cycles through an iterative topological traversal. It counts placed references within masters (including repeated nested references), collects original raster/clone/patch/bitmap-mask assets, and derives transitive dependent masters for invalidation. Root-document placement references are enforced by component commands separately from the registry. Batch replacement validates the entire new graph before returning it and reports invalidated masters from both old and new dependency relationships. Removing a referenced master fails. Definitions and returned collections are detached so callers cannot mutate a stored snapshot. Shared model validation uses temporary raster-shaped validation views for instance geometry and group-shaped asset-collection views; these placeholders are never persisted or rendered.
Document-owned definitions, command-backed undo, project bundling, Canvas rendering and constructor APIs are integrated. Raster conversion is available through the Layers panel and public API. Interactive contents tabs are available through the host workflow below. Multi-layer conversion, smart filters, external links/relinking and rasterization remain unimplemented.
Component render-tree resolution (internal)
resolveSmartDocument validates root placements against a ComponentRegistry and creates an ephemeral ordinary-layer tree for existing compositors. Asset masters resolve to raster instances retaining original asset IDs. Document masters resolve to isolated groups: the outer group retains instance placement, opacity, blending, styles and mask; an inner group scales master coordinates to instance dimensions and clips contents to the master artboard. Nested definitions recurse through the same resolution path. Unlinked masks inside a master are rebased into linked layer-local coordinates before placement so their original master-space location moves with the instance; root-document unlinked masks retain host-document semantics.
Expanded nodes have deterministic collision-free IDs per instance path. Expansion never mutates authored definitions, replaces original image bytes, or persists the expanded tree. A configurable render-tree budget defaults to 4096 materialized nodes and depth 64; invalid/overflowing expansion rejects before rendering. These allocation/complexity budgets do not resize or limit source-image resolution. Root placements reject missing masters. Browser tests exercise the existing CanvasRenderer with cache on/off, master clipping, scoped masks, source replacement across two instances and exact pixel restoration after a 1%→100% transform round trip. Reusing an earlier immutable registry restores earlier rendered pixels. Document integration adds command-backed undo and project persistence; interactive smart-object editing controls remain outstanding.
Recipe condition and delivery-format validation
Recipe conditions validate operator-specific operands at import and compilation: parameter comparisons require a parameter and comparison value, numeric comparisons require finite numbers, truthy requires a parameter, layerExists requires a target, and layerCountEquals requires a nonnegative safe integer. Invalid conditions invalidate the whole plan before commands commit; they never become unconditional operations.
Delivery IDs accommodate the full accepted item-ID and variant-ID combination (up to 129 characters), including persisted manifest verification. The stored ZIP writer adds ZIP64 entry extras and end records when classic counts/sizes/offsets reach sentinel values. It assembles immutable Blob parts instead of allocating a second archive-sized typed array. UTF-8 filenames longer than 65,535 bytes and geometry outside safe integer addressing reject explicitly. These are serialization/runtime boundaries, not image import limits.
Smart-object document integration (schema 13)
The root document owns embedded component definitions; smart-object layers hold an immutable component ID and editable placement dimensions. Shared component.set/component.remove commands validate dependency graphs and protect locked affected placements, including transitive dependencies. DOM constructors, isolated scripts and REST use these commands and normal transactional history. editContents() returns a detached Document snapshot; replaceContents() commits a shared replacement. The host now offers independent editing tabs with explicit apply, as described below.
CanvasRenderer resolves unfiltered components into ephemeral clipped raster/group trees before composition and preserves filtered instances for native-plane rendering. Sources and authored definitions remain unchanged. Visible smart-object layers select Canvas fallback in the adaptive viewport until GPU support is verified. Project and recovery asset collection includes all component sources. Full T21 completion still requires broader pixel-equivalence verification and evaluation of linked-file lifecycle behavior.
Raster-to-smart conversion
smartObject.convertRaster replaces one raster in its existing sibling slot with a new smart-object ID and registers a new master atomically. The DOM allocates IDs before dispatch, ensuring host/script replay and undo/redo use the same identities. No-effect rasters use asset-backed masters; tone-edited rasters use a document master containing the original image reference and effect stack. Placement properties stay on the instance. Master artboards use integer dimensions rounded upward while the instance retains its exact original dimensions. Existing source pixels are never resampled or overwritten.
The resolver maps a document master consisting solely of a full-frame raster with neutral placement/compositing properties directly to a raster instance with the master's tone effects. A second transformed artboard clip would multiply edge antialiasing; the direct path preserves exact conversion pixels. Other composition masters continue to use normal artboard clipping. Multi-layer conversion intentionally establishes an isolated component, so backdrop-dependent blending and adjustments can change when their backdrop is outside the selection.
Independent component copies
ComponentRegistry.reachableFrom walks dependencies iteratively and deduplicates repeated references. withIndependentCopy validates a complete, collision-free ID mapping before cloning definitions and remapping nested instances, preserving internal graph sharing. Original definitions and image assets remain unchanged. The shared smartObject.duplicateIndependent command adds the new graph and placed copy atomically. DOM allocates all IDs before dispatch for deterministic isolated-script replay; REST supplies the same explicit map. Master-document IDs change with their copied component, while their private layer IDs remain scoped to that master. Ordinary layer duplication retains its original shared component ID.
Interactive smart-object contents sessions
EditorApplication maintains ephemeral contents-to-owner session links with a component ID, captured owner revision and last-applied contents revision. Opening serializes and decodes the contents into a separate owned asset store, checks source revision/workspace generation/lifetime after asynchronous loading, then installs a normal document tab. Repeated opens activate the existing editing tab. Detached DOM editContents snapshots retain their existing semantics.
Apply builds a complete candidate registry from the contents tab plus its current top-level artwork, validates the proposed parent document, verifies existing image identities by dimensions and SHA-256, and privately decodes new sources. Both session lifetimes and revisions are checked across preparation. Image installation and one component.replaceAll command occur synchronously after validation; failures remove installed assets and close private bitmaps. Closing an owner disables application but preserves the contents tab. Keep as document removes only the link. Downloading contents does not mark pending edits applied. Recovery stores the ordinary document and assets; apply links are deliberately not persisted, so restored contents remain independent documents.
Cross-document smart-object transfer
Copy-selected-artwork computes the union of reachable component definitions for all selected roots. ComponentRegistry.copyDefinitions clones that closed graph once, preserving diamond/repeated dependency sharing and remapping component IDs. The transfer remaps image references throughout root layers and document/asset masters, including bitmap masks, clone tiles and patch adjustments. Only these reachable sources are collected; unrelated definitions cannot force extraneous image loading.
The full destination command transaction is validated before decoding. Image bitmaps are prepared in a private AssetStore; destination session lifetime and revision are rechecked during preparation and immediately before synchronous asset installation plus command dispatch. Failure closes private bitmaps and removes any installed assets. Component registry replacement and layer additions share one history entry. Captured immutable source blobs allow source closure without invalidating the destination copy.
Spatial-filter WASM worker foundation
PixelProcessor.spatialFilter snapshots input pixels and options before worker readiness, transfers only private bytes, and returns an independently owned RGBA buffer. This is an internal working-tile operation, not a serialized smart-filter stack or public scripting constructor. applySpatialFilter validates geometry and parameters, lays out aligned WASM buffers, and invokes the allocation-free assembly/spatial-filter.ts kernel.
Gaussian blur uses separable normalized Gaussian weights, independent horizontal/vertical sigma, finite support ceil(3 * sigma) and float64 intermediate premultiplied encoded-RGB/coverage values. Samples outside the supplied tile are transparent zero; edges are not renormalized. The result is unpremultiplied only at the final byte write, with RGB zeroed when rounded alpha is zero. Unsharp mask compares original encoded RGB to the unpremultiplied Gaussian result, applies amount and per-channel threshold, preserves original alpha, and leaves fully transparent source pixels unchanged. Zero blur support and zero unsharp amount return exact copies, preserving hidden RGB.
The caller must provide the full filter halo and crop it after processing; tests prove equality between whole-image and halo-tiled results, including image boundaries. Sigma is finite/nonnegative with at most 4096 halo pixels per axis; unsharp amount is 0–5 and threshold 0–255. These are internal work bounds, not document/import limits. Scratch storage consumes 32 bytes per pixel in addition to the RGBA tile and weight tables and is subject to the existing WASM memory maximum. Large-support performance is not yet evaluated. Instance stack serialization and renderer/export integration are described below; filter-mask blending is described below; the Inspector controls are described below.
Smart-filter instance integration (schema 11)
core/smart/filters.ts owns strict stack validation and cumulative support. SmartObjectInstanceData.smartFilters persists at most 32 uniquely identified entries. GaussianBlurFilter, UnsharpMaskFilter, SmartToneFilter, FrequencyBandFilter, NativeCompositionFilter and DocumentToneFilter are immutable constructor values; SmartObjectLayer.addFilter/setFilters route attached changes through smartObject.filters. Detached instances validate settings before storing them. Shared command validation/history applies to REST and isolated scripts. ComponentRegistry validates nested master stacks; schema versions below 11 reject the new fields. The outer project container version is unchanged.
CanvasRenderer asks the resolver to preserve active filtered instances; attempting ordinary expansion of a filtered instance rejects rather than silently dropping its filters. Preserved nodes still count their full logical master tree against the expansion budget. For each output tile, the renderer maps its bounds into the native master plane, renders enough original composition for the cumulative filter halo, clips input to the master artboard, runs ordered WASM kernels, then applies instance scaling/affine placement. NativeCompositionFilter/FrequencyBandFilter use the native image-frame edge boundary; trailing document-tone entries execute after projection. Output-coordinate integer clips avoid affine tile seams; an extra sampling border avoids clamping at native filter edges. Layer masks and styles apply afterward. Nested filtered masters recurse with a depth guard. Finished-layer cache scope includes registry content so nested master edits invalidate parents. Native filtered-tile signatures use the reachable component dependency closure, allowing unchanged captured-source Gaussian planes to survive unrelated retouch edits.
The internal spatial worker convention described above is unchanged. Rendering uses adaptive output tiles to bound typical native sampling footprints. Before allocating source canvases, padded native regions must fit 4,000,000 pixels and an 8192-pixel edge, keeping transient working surfaces within the WASM memory budget. These are working-tile bounds, not document/import limits. Very large cumulative radii, extreme minification and nested filters remain expensive; requests exceeding the bounds fail before canvas allocation. No viewport approximation or source resampling is stored in the document. Performance evaluation and broader rasterization equivalence remain outstanding. The feature is exposed through constructor scripts/shared commands and the Inspector controls described below.
Smart-filter Inspector controls
SmartFiltersPanel receives serialized display values from the existing transient preview document, but reconstructs the matching immutable filter constructor value for every committed stack replacement, removing the serialized kind discriminator before calling strict newer constructors. SmartObjectLayer.setFilters remains the shared mutation boundary. Slider previews emit smartObject.filters to the App preview channel, never to document history. The panel captures the revision at gesture start, cancels previews on revision/selection/session changes and rejects stale commits. Stable slider keys preserve keyboard focus across the panel's own commits. Number fields reuse existing validation and commit behavior; disabled entries retain settings. CSS uses the established semantic tokens and InspectorSection/Slider/Select/Button components.
Approved job inputs and literal recipe names
GenerationJob retains private copies of its submitted request and options. Its public getters return detached snapshots, including reference and mask arrays. Dispatch, output validation and provenance use a captured snapshot; caller or subscriber edits cannot change the approved request or its idempotency identity. Candidate staging requires returned dimensions to equal requested dimensions; a mismatch fails the job without discarding a provider-reported charge. Provider size conversion must be an explicit future contract, never an implicit substitute.
Recorded name targets use { by: "name", pattern: originalName, literal: true }. Literal matching is case-sensitive and performs neither wildcard expansion nor parameter interpolation, including in multi-target resolution. Hand-authored targets without literal: true retain their existing wildcard/interpolation behavior.
Smart-filter mask mixing foundation
PixelProcessor.mixFiltered(original, filtered, mask, density = 1, inverted = false) is an internal worker/WASM operation. All arrays are matching RGBA buffers, and mask alpha supplies raw coverage. Effective filter coverage is 1 - density + density * (inverted ? 1 - alpha : alpha), consistent with ordinary mask density conventions. It interpolates premultiplied encoded-sRGB color and alpha, then unpremultiplies; it does not preserve original alpha as adjustment-layer blending does. Exact zero/one endpoints retain the corresponding input bytes, including hidden RGB; intermediate results whose alpha rounds to zero have zero RGB. The processor snapshots every caller array before worker readiness, never detaches caller buffers, and returns a new result. Inputs are validated before WASM allocation, including finite density and matching buffer geometry. Model, constructor, rendering and persistence integration is described below. The Filter mask Inspector integration is described below.
Smart-filter mask model and renderer integration
Schema 12 stores optional per-instance filter masks, reusing LayerMask constructors and the shared smartObject.filterMask command. Native filtered tiles retain original pixels before worker transfer, rasterize padded raw mask coverage, and invoke mixFiltered before instance resampling. Linked coordinates are native master pixels; unlinked coordinates are rebased from the containing document through the inverse native placement. Resolver expansion converts nested unlinked masks into native linked equivalents. Feather remains in native pixels. Ordinary layer masks/styles apply afterward. Mask changes participate in existing layer/cache signatures; project, nested registry, recovery and cross-document asset reachability include bitmap filter masks. Inspector controls are described below; interactive brush/pencil/eraser refinements are described below. A position-preserving link toggle is available through the DOM and Inspector.
Smart-filter mask Inspector
SmartFilterMaskPanel uses constructor values and the shared mask command for transient previews. It captures revision/selection/lifetime guards and clears previews on unmount or external edits. Paired density/feather controls reuse Slider; selection capture creates an unlinked containing-document mask, while reveal/hide presets create linked constant masks. Enable/invert/remove actions share the same guarded commit path. The ordinary Layer mask section remains independent.
Interactive filter-mask refinements
ToolController reuses the mask-paint gesture with a captured filter-mask target. Native master scale is included when inverse-mapping input and selection clipping. Filter-mask previews publish shared smartObject.filterMask commands at most once per animation frame; ordinary mask previews retain the specialized paint-preview path. Committing appends one immutable stroke through the filterMask setter; selection/revision/lifetime checks prevent stale commits. Changing paint targets cancels pending work. Filter-mask previews reuse unchanged native original/filtered tile pairs as described below. Filter masks retain finished native composites in the existing Canvas cache; local stroke-support signatures let unaffected tiles bypass coverage, feathering and mixing. Large-stack interaction remains above the measured target.
Retained native filter tiles
CanvasRenderer retains exact filtered RGBA and optional original copies in a separate 32 MiB, 64-entry LRU. Under memory pressure it drops original copies before evicting filtered results; a masked render reconstructs a missing original through the existing source renderer without rerunning that tile’s filters. An unmasked render needs only the retained filtered result. Keys include asset-store identity, component identity and padded native tile geometry; signatures include component definitions, filter order/settings and master dimensions. Instance filter-mask changes therefore reuse native results, while edited masters, nested dependencies and filter settings invalidate them. Cache reads and writes copy arrays so worker transfers and asynchronous renders cannot mutate retained pixels. Unlike Canvas round trips, byte retention preserves hidden RGB and alpha exactly. Cache:false bypasses reads/writes. Renderer clearing releases entries and epoch guards prevent already-processing tiles from repopulating the cleared cache. This retention budget does not limit document resolution.
Batch observer isolation and validated generation metadata
BatchRunner and BatchRunnerService publish an independent structured clone to each event listener. Listener changes cannot mutate the executing item, captured configuration, persisted state or another listener's notification. Blob payloads remain immutable browser Blob values. Subscribers must use service methods to request state changes.
Generation records derive hasAlpha from the staged candidate's pixel validation, not the provider's claimed flag. Candidate recovery records and applied-layer transparency keywords therefore describe the validated artwork.
Uniform filter-mask coverage
Before rasterizing native mask coverage, the renderer conservatively checks paint-mask base coverage, density, inversion, transformed stroke bounds and the full finite feather halo against the padded filter tile. Proven fully revealed tiles use filtered pixels directly; proven fully hidden tiles use original pixels without running filters. Unknown, non-paint or fractional coverage retains full rasterization and mixing. The optimization changes neither document resolution nor tile/cache budgets. Independent browser coverage compares against full rasterization rather than only cache bypass.
Uniform endpoints also select which retained buffers are copied: fully hidden tiles request only original pixels, and fully revealed/unmasked tiles request only filtered pixels. Fractional coverage requests both. Every returned array remains a private copy; selective reads preserve LRU refresh, signature checks and the same retained-byte budget.
Filter-mask finished composites share the existing 64 MiB Canvas LRU. Keys distinguish asset store, component, instance and padded native region; signatures include source/filter definitions, mask settings/transform and conservative paint-stroke support including feather halos. Non-paint masks retain full signatures. Raw prefix caching remains available to ordinary masks but is bypassed for filter masks to prioritize finished composites under this budget. Cache bypass disables both completed and filter-pixel retention; renderer epochs prevent stale publication after clearing.
Feather coverage processes a region of at most 1024×1024 in one job when its entire finite halo fits the existing four-million-pixel buffer budget. Larger/over-budget regions retain 512px subdivision. This prevents native filter tiles just over 512px from becoming four coverage jobs, without expanding document limits or allocation budgets. Translated Canvas brush coverage can retain the pre-existing one-level alpha difference across independently rasterized tile layouts; cache-versus-bypass output remains exact in the production fixtures.
PixelProcessor.mixFiltered captures all three caller arrays synchronously, then transfers those private snapshots to the worker. Filtered and mask snapshots are included in the transfer list, avoiding a second structured clone during dispatch. Caller buffers remain usable, including when inputs change before worker readiness; validation failures leave the processor available for subsequent requests.
The WASM filter mixer recognizes identical visible RGBA inputs as an interpolation invariant and avoids the remaining weighted color math for those pixels. Exact endpoint handling runs first to preserve hidden RGB; intermediate mixtures of two fully transparent pixels still canonicalize to transparent black. Unequal visible inputs retain the original premultiplied arithmetic.
Finished filter tiles can be drawn synchronously from CanvasCache under the compositor's current affine transform and output-tile clip. The cache exposes a draw operation, never the retained canvas, so callers cannot retain or mutate its surface. This avoids an intermediate canvas allocation/copy on hits while preserving LRU refresh. Cache-hit lookup and newly rendered tiles share validated padded geometry; context restoration runs in finally even on cache hits and rendering failures.
Painted-mask replay allocates one scratch surface for its stroke sequence. Each overlapping stroke clears the surface, saves/restores context state, applies its own clip and composites opacity exactly once. Standalone and active-stroke calls still own and release their temporary surfaces. The replay releases its scratch canvas in finally; no persistent cache or memory budget is added.
Recipe parameter ownership and Unicode delivery names
Recipe parameter maps use own-property lookup and prototype-free dictionaries. Names such as constructor, toString and __proto__ are ordinary data keys; inherited properties do not satisfy required parameters or override defaults. Interpolation preserves explicitly supplied keys without invoking prototype setters.
Delivery filename stems are limited to 180 UTF-8 bytes at complete Unicode scalar boundaries, with format extensions appended afterward. Lone surrogates are repaired before collision allocation, so the manifest path and encoded ZIP name agree. Collision suffixes reserve space within the same stem budget. This is a filename portability rule, not an image import limit.
Delivery ZIP exports use the shared ZIP/ZIP64 serializer through an asynchronous Blob-input path. CRC reads are bounded to 1 MiB and yield a task between chunks; empty-entry runs yield every 32 entries. The service verifies each output's full byte length and SHA-256 before retaining its immutable Blob for packaging, avoiding an array of all decoded output buffers. Optional AbortSignal checks reject cancelled work before packaging or download. The batch dialog shows verification/packing status and Cancel export; unmount aborts its export. SHA-256 still allocates one complete output buffer, and final Blob/directory assembly is synchronous: this is cooperative packaging, not a streaming archive or a proven multi-gigabyte memory guarantee.
Selection-to-smart conversion
smartObject.convertLayers accepts distinct contiguous sibling IDs plus new component/instance IDs. It validates all targets, ancestry locks, stack contiguity and identity collisions before replacement. It moves cloned authored layers, in stack order, into an embedded master, retaining source assets and nested master references. Bounds include the parent-plane source artboard, layer geometry and conservative cumulative style halos, rounded outward to integral master pixels. Unlinked layer/filter masks retain their independent relationship and rebase into the containing master document without following child affine/perspective placement. The original sibling span is replaced atomically by a neutral smart-object placement; the shared command supplies UI, DOM, isolated scripts and REST with identical validation/history. This introduces group isolation rather than promising equivalence for external backdrop-dependent effects. Local linked snapshots are described below.
Smart-object rasterization preparation and commit
prepareSmartRaster captures authored data, computes outward-rounded document-pixel instance bounds, neutralizes outer compositing properties and uses tiled PNG export to bake content, affine placement and smart filters. Its guarded renderer checks target lifetime/revision between tiles and releases a completed surface when a guard fails. The replacement raster compensates for the parent affine basis, retains outer compositing settings, and rebases linked outer masks. No master or source bytes change.
The application stages decoding privately and checks document revision, session membership, asset-store lifetime and optional AbortSignal before installation. One smartObject.convertToRaster command replaces the sibling slot; failed commit removes the newly installed asset. Isolated scripts use the existing per-script private asset staging service with the rasterize method; preceding commands are simulated, only referenced prepared assets transfer at final commit, and failure discards them. Public SmartObjectLayer.rasterize() is asynchronous. The headless REST command accepts externally prepared raster data; it does not perform Canvas/WASM rendering server-side.
Workspace contents-editing links
SavedWorkspace version 2 adds optional per-document componentEdit: {ownerIndex, componentId, sourceUnchanged, contentsApplied}. Capture records these flags alongside the same synchronous document/history snapshots used for project encoding. Revision counters are session-local; restore maps true flags to the restored sessions' revisions and false flags to a conflict/unapplied sentinel. It never clears a stale source merely because new stores start at revision zero. Owner indexes refer only to documents in this checkpoint, allowing nested sessions and copies restored beside existing work without cross-linking.
Schema validation rejects out-of-range/self owners, cycles, duplicate owner/component editing sessions and link fields in legacy v1 values. Restore decodes every project and validates source-master presence for unchanged-source links before creating sessions; failure disposes decoded assets without installing any tabs. Changed-source links may reference a removed master and retain their existing conflict. Contents whose owner is absent at capture recover as independent documents. Manual, automatic and named checkpoints share capture/restore; per-document project files remain unchanged.
Linked local-image snapshots (schema 13)
Asset component sources may include a strict local-file link record with name, SHA-256, byte length and modification time. The source still names an immutable cached asset with decoded dimensions. Rendering and asset reachability use that cached asset; no external I/O occurs during rendering or project loading. Versions below 13 reject link metadata before migration. Workspace restoration validates historical documents at their declared schemas, then upgrades current, past and future states together so undo cannot regress feature support.
Explicit host relinking hashes the selected File, decodes privately, checks document lifetime/revision, validates shared-master locks and publishes through component.set. Old source bytes remain immutable and retained for history. Serialization and loading verify linked digest/length/dimensions against cached assets, including retained history. Relinking preserves placement dimensions and updates every shared instance; changed input dimensions resample into existing placement geometry. embedSource removes only the declaration. No file handles, paths or credentials are stored; automatic change detection, permission-backed handle persistence and URL-backed links remain unimplemented.
Generation submission validates provider output width/height bounds, decimal megapixel ceiling, pixel step and discrete size pairs, plus unsupported alpha requests, before budget reservation or dispatch. These provider limits do not restrict document imports. Aspect-ratio labels are descriptive presets; explicit pixel constraints govern acceptance. Durable idempotent recovery remains available without revalidating current provider capabilities.
Layer comp model and commands
core/layer-comps.ts provides strict detached snapshots and transaction planning for reusable presentation states. Captures select visibility, position (local translation, affine matrix and available dimensions), and appearance (opacity, fill opacity, blend mode and layer styles). Contents, source assets, filters, masks, lock flags and hierarchy are not copied. Comp identity includes the owning document and target layer IDs. Deleted targets are reported and newly added layers are untouched; changed parent coordinates reject position restoration. Shared command preflight enforces validation and locks before any commit; unchanged locked layers require no command. Comp application becomes one ordinary transaction and supports undo/redo. Schema-14 DocumentData stores optional layerComps. Shared layerComp.set/apply/remove commands serve LayerComp constructors, Document.layerComps and isolated scripting, and strict REST DTOs. Project persistence and retained history include the snapshots. The Properties Layer comps panel captures, restores, renames, recaptures and removes through these constructors; document changes reset its local form/status state.
Canvas cropping rebases saved layer-comp root positions by the crop origin, including targets currently missing from the layer tree. Nested positions stay in their captured parent coordinates. Shared validation rejects overflowing saved coordinates atomically; crop undo/redo retains both artwork and comp state.
Independent smart-master copies and editable contents tabs rebind their saved comps to the copied document identity. Cross-document master transfer additionally remaps saved target and parent IDs to copied layers, preserving presentation values and missing-target records. Top-level source-document comps are not implicitly copied when transferring selected artwork.
Shortcut rebinding
ui/shortcut-bindings.ts normalizes keyboard-event bindings for the shared shortcut dispatcher, checks cross-action collisions across Ctrl/Command modifier variants, and reads/writes version-1 browser preferences under luma.shortcut-bindings.v1. Empty binding arrays disable actions; Escape, Tab, Space and modifier-only keys cannot be captured. Persistence writes occur before callers install the returned settings; malformed saved JSON and storage errors propagate without overwriting prior storage. The application loads preferences at startup, resolves binding conflicts against its registered actions, and memoizes resolved keys independently of live action callbacks. Invalid saved settings fall back to defaults and expose an error in the shortcuts dialog. The dialog captures keyboard input and provides clear/reset controls; successful writes precede active-state updates. ShortcutHints supplies active overrides to toolbar/layer labels and context menus, and the palette receives the effective registry. Preferences apply to this tab immediately and other tabs on reload; there is no live cross-tab synchronization.
PanelResizeHandle provides pointer-captured transient resizing and native keyboard separator semantics. usePanelLayout separates preview and saved widths, imports legacy version-1 luma.panel-widths.v1 preferences when the new layout envelope is absent, persists the current luma.workspace-layout.v1 envelope before updating saved state, and fits visible docks to viewport space. Viewport shrink clamps display without overwriting the preferred saved widths. CSS panel-width variables drive the existing flex layout and ResizeObserver canvas sizing. No document command, project field or image allocation limit is involved.
Layer distribution is a shared layer.distribute command. The geometry planner resolves independent roots, orders their canvas-space bounds deterministically and computes intermediate movements through inverse parent transforms. Endpoint layers and stacking order are unchanged; final shared validation makes invalid coordinates or locks atomic. The constructor LayerSelection API and Layers control dispatch this same command; REST validates the same axis/mode/ID contract.
HSL adjustments (schema 15) use shared strict adjustment validation and the ordinary AdjustmentLayer constructor/commands. engine/hsl.ts is a pure encoded-sRGB reference kernel preserving alpha; the Canvas compositor applies it in bounded 1024-edge tiles before ordinary adjustment mask/opacity blending. It cannot be represented by independent channel LUTs. WebGPU implements HSL as a cross-channel fragment pass followed by the existing adjustment mask/opacity/blend pass. Unsupported compositions still use reference fallback. HSL tile processing runs in the existing pixel worker through the allocation-free AssemblyScript WASM kernel, using private input/settings snapshots before readiness and transferring only private buffers. The JavaScript kernel remains an independent reference for numerical tests. GPU/reference comparisons allow up to three premultiplied RGB byte levels with exact alpha in the tested fixtures; measured device latency remains unfinished.
Font-load completion/failure clears CanvasRenderer's epoch-guarded caches; AdaptiveRenderer's override also clears GPU textures. Renderer disposal removes the font event listeners. The viewport hook independently advances a render dependency on these events, so unchanged document snapshots receive a fresh frame. This refresh changes rendered font pixels without rewriting saved text geometry/history. Explicit bounds reflow and font-file project portability remain open.
Live paint previews published by ToolController are already coalesced once per animation frame. The viewport hook begins those jobs without another animation-frame wait; other document/view updates retain frame coalescing. Rendering remains serialized, and revision/view/stroke guards still reject stale frames. This removes a scheduling delay, not the rendering cost of complex compositions.
Live stroke continuation now subscribes directly to ToolController inside the viewport hook. Captured document identity, preview command, layer, mask mode and stroke ID must still match; structural/document/view changes enter through the React layout effect and existing stale-frame guards. The editor shell uses getUiSnapshot, which remains stable for paint-preview-only updates; pixel consumers use the full getSnapshot. Cursor position has an overlay-local external store so pointer movement does not rerender the shell. Rendering status is not toggled for every live-stroke frame. New gestures, settings and stroke finalization retain normal UI/command updates.
Native raster workflows
RasterEditing is an editor-owned browser service for rendered raster sampling, alpha selection, wand selection and an internal PNG clipboard. It checks document identity/revision, selection identity and asset lifetime across asynchronous work. Copy is read-only; paste stages a new asset and commits one transaction, removing the staged asset on failure.
Schema 16 stores fractional pixel selections as validated run-length coverage and raster erasures as { width, height, stroke } records. The source asset stays immutable. Reference rendering applies erasures in their captured local coordinate geometry; unchanged raster content participates in the live-paint cache. WASM selection rendering evaluates RLE coverage with the same transformed sampling and boolean operations as geometric regions. GPU compositions with raster erasures or pixel-clipped paint fall back to accurate reference rendering. Wand flood fill and outline generation currently run in JavaScript; native-resolution sampled buffers can consume substantial memory.
LayerThumbnail renders committed imported-image and paint-layer branches into at most 64×64 output pixels, debounces refreshes, and drops obsolete results on unmount/source changes. Source keys exclude unrelated branches and selection changes. Original-image thumbnails remain a fallback while rendering. The browser RasterEditing.loadTransparency(id) accepts paint layers as well as imported rasters, including empty layers; it samples the clicked layer independently of active-layer selection. Thumbnail and alpha sampling temporarily treat that branch's visibility as enabled without changing document state. Copy and wand remain scoped to imported raster layers.
Repeated-edit memory and autosave responsiveness — 2026-10-04
The store recursively marks its own immutable snapshots. Common metadata, selection, layer-property and paint commands copy only the root/target path; general commands still use a detached working copy. Reconciliation reuses equal immutable subtrees before publishing, so unchanged pixel coverage and prior strokes are shared across undo entries rather than duplicated. No-op detection uses the reconciled root identity. Validation remains mandatory; selection and drawing-record validation are cached only for recursively frozen, store-owned values, with schema-version checks applied in every context. Restored histories also reconcile adjacent states. The existing 60-entry history contract and project formats are unchanged.
Thumbnail source construction retains only the requested branch without deep-cloning the entire document. Thumbnail keys use immutable property identities rather than serializing stroke/coverage arrays, so unrelated edits and selection changes do not rerender thumbnails. Native sampling callers still receive a detached copy of the requested branch.
Workspace project encoding runs in a dedicated module worker. The main thread captures immutable document/history references and required Blob sources; structured cloning preserves shared references within each request. The worker performs project validation, manifest serialization and encoding, preserving the existing binary format and history-only assets. Worker failures reject pending saves and flow through ordinary autosave error/retry handling; disposal terminates the worker. Non-browser test environments retain the synchronous implementation. Main-thread capture/transfer and document restoration still have costs; this is not a blanket responsiveness guarantee for arbitrarily complex documents.
Raster erasure append commands retain prior immutable records while detaching newly supplied records. This prevents repeatedly cloning and parsing previous pixel clips on every new stroke. Mutable/external values still undergo ordinary validation, and document schema-version checks remain active on cached values.
Color picker previews use ColorInput to coalesce native input events within a task via a cancellable microtask token and commit on the native change boundary (with blur/Enter fallback). The renderer owns animation-frame pacing; the input avoids an additional frame wait. Commit, cancellation and unmount invalidate any queued token so it cannot restore a stale preview. React's synthetic onChange also fires for intermediate native input, so it is not used as the commit boundary. Preview commands remain transient; Escape clears the preview.
engine/content-signature.ts separates raw layer content from mask/style/opacity/blending/visibility and inspector-only properties. Canvas and GPU source caches key immutable content by identity rather than repeatedly stringifying large arrays. Parent-group content still includes child appearance through its children identity, while geometry and padded render space remain in the surface cache key. Color-overlay changes reuse source pixels and apply the new color during composition. Mutable external render inputs retain value-based signatures.
Canvas cursor isolation and idle snapshot avoidance — 2026-10-05
Panel fitting and keyboard resize limits share a reservation for the 88-pixel two-column rail, two six-pixel handles and at least 200 pixels of canvas column. Existing saved widths remain valid and are fitted to the current supported window, including 760 pixels. Panel preferences and cursor refreshes stay outside document mutation/history; these are viewport policies, not source-resolution limits.
ui/CanvasCursor owns native viewport pointer listeners and a dedicated SVG overlay. A single pending animation frame updates position and glyph geometry imperatively. Tool/zoom/size changes still refresh a stationary cursor synchronously through the existing layout effect. Stable App adapters invalidate for actual preferences, source/selection/gesture, viewport/pan/zoom and panel geometry; unrelated status/notification renders do not reread cursor layout. Adapters read current tool data when invoked and skip coordinate lookup while symmetry is Off. Pointer-frame scheduling remains unchanged. Custom-cursor mode bypasses the older React selection-overlay cursor updates; system mode retains them, with Eraser included. The native pointer is hidden only while the custom overlay is visible. Pointer capture retains transform-handle direction during drags; blur, cancellation, leave and context menus clear the overlay.
LayerSelection geometry and ancestry reads use the internal document snapshot rather than public toJSON(), avoiding full artwork/coverage copies for UI enabled-state checks. Public serialization remains detached. UI selection-presence checks use the already-owned snapshot rather than constructing a detached MarqueeSelection.
RecipeService subscribes to document command snapshots only while recording or paused. Idle and stopped recording impose no before/after serialization. Paused recordings still observe commands to align undo navigation, and recorder/document disposal removes subscriptions. Explicit external command observers retain their existing snapshot contract. This fixes actual EditorApplication overhead absent from bare-Document command benchmarks; it does not establish a universal end-to-end latency bound.
Committed paint reuse — 2026-10-05
Canvas committed paint and raster-erasure replay share the existing bounded selection-mask cache, including geometry in the key. Appending to an immutable paint layer can reuse its retained unstyled pixels when the old stroke list is an identity-equal prefix, all other raw-content fields and render geometry match, and the surface remains in cache. Only the appended suffix is rasterized. Changed earlier strokes, undo, geometry changes, mutable inputs or eviction use full replay. Prefix metadata retains at most 64 entries and clears with renderer caches; previews never enter the committed cache. Masking, styles and blending still run after raw content is prepared.
Image resolution resize — 2026-10-06
Document.resizeImage(width, height) dispatches document.resizeImage, distinct from canvas-only document.resize. Execution validates dimensions, transforms root layer placement by the document scale, updates document-space unlinked masks/filter masks, selections, guides and saved root comp placements, then validates the complete document atomically. Nested local content and source assets remain unchanged. The command invalidates transient canvas-space gestures and supports normal undo/redo, REST, isolated scripts and recipe recording/replay. Effects expressed in output-pixel units retain their settings. Existing renderer interpolation handles raster output; no image allocation or arbitrary import-size ceiling is introduced by this command.
Incremental committed raster erasures — 2026-10-07
CanvasRenderer retains metadata for up to 64 immutable raster prefixes alongside the existing bounded surface cache. When erasures are appended, it reuses prior unstyled source pixels only if source/effects/geometry and every earlier erasure identity match; only the new erasures are replayed using their captured geometry. Undo, incompatible edits, resize, mutable inputs, cache eviction and cache clearing use ordinary source rendering and replay. Styles and masks remain later composition stages; preview erasures never enter committed prefix data. This extends the prior paint-prefix optimization to imported images without changing assets, persistence or scripting contracts.
PSD compression consistency — 2026-10-07
The PSD writer applies compression: "raw" to both layer channel payloads and the merged composite. Composite raw bytes are channel-planar RGBA; default/explicit RLE retains PackBits scanlines. Regression checks inspect the binary compression marker independently of parser interpretation and compare all channel bytes for layered and flattened imports, including partial alpha. This does not expand the supported layer/effect subset or establish independent-application interoperability.
Independent PSD composite verification — 2026-10-07
Run node --import tsx scripts/check-psd-interoperability.ts with Python 3 and Pillow installed. The script writes temporary raw/RLE exports, decodes them with Pillow, asserts dimensions and stored white-matted preview channels against explicit expected values (the original 2026-10-07 evidence predates the corrected transparency encoding), reports reader version and source hashes, and removes its own temporary directory. The subprocess has a 30-second timeout. Fixtures cover fractional alpha and three-layer normal composition with a hidden layer. Recorded Pillow 10.3.0 evidence is in benchmarks/psd-pillow-2026-10-07.json. This is independent composite decoding evidence only, not editable-layer semantics, other blend modes, effect preservation, ICC fidelity or full Photoshop compatibility.
PSD composite blend modes — 2026-10-07
PSD merged-image construction now evaluates all 16 document blend modes in encoded sRGB, using straight-color blend functions and source-over alpha composition. Previously layer blend keys were written correctly but the merged image treated every layer as normal. The pure CPU helper follows the existing GPU blend convention, including hue/saturation/color/luminosity. Chromium checks compare opaque and half-alpha inputs for every mode with at most one alpha byte and three premultiplied RGB bytes of tolerance; Canvas can quantize intermediate alpha differently. Independent Pillow raw/RLE fixtures additionally verify exact opaque multiply output. This does not add masks, effects, transformed-layer baking or omitted layer kinds to the PSD exporter.
Freeform lasso gesture
ToolController owns a revision-guarded lasso gesture with frame-coalesced preview points and captured boolean operation. Preview is SVG-only and does not mutate or render a document preview. On release, core/lasso.ts scan-converts the closed contour using even-odd intersections and 4×4 coverage, accumulating coverage-change events at horizontal span boundaries and encoding directly into the existing pixel-selection RLE format. Solid interiors are emitted as runs without visiting each pixel or allocating a row-sized mask. Boolean composition and undo use selection.set through MarqueeSelection. Cancellation clears pending frames and preview points. The CPU conversion is synchronous; very large/complex contours can still take time, and no hardware latency claim is made.
Lasso scan conversion now sorts nonhorizontal edges by their minimum Y and maintains only edges crossing the current subpixel scanline. Edges enter at their lower endpoint and leave at the upper endpoint, preserving even-odd vertex behavior. Intersections retain original endpoint arithmetic, so coverage does not drift from incrementally accumulated coordinates. The dense 20,000-point circle benchmark retains an identical full-selection SHA-256 while avoiding repeated scans of inactive edges. Heavy self-intersection can still increase active-edge and output-run costs.
Tool-start read costs
ToolController lock checks, origin lookups and layer/mask transform lookups read the internal immutable document snapshot. These operations must not call detached public document serialization: a tool start may otherwise copy every old stroke and selection coverage array repeatedly before the first visible mark. Operations requiring their own detached mutable data, including the existing clone sampling snapshot, retain their separate ownership paths.
Compact pixel-selection outlines
Coverage-outline construction advances through neighboring sorted row spans instead of restarting the neighbor search for each island. Consecutive vertical edges with the same X coordinate are emitted as one SVG segment; gaps and ended edges flush independently. Pixel coverage, holes and horizontal boundaries remain unchanged. This reduces both construction work and the retained SVG path size. Boundary tests compare all unit edges against a bitmap oracle; browser selection workflows cover display and selection use. Construction remains synchronous and highly fragmented selections can still exceed a frame budget.
Selection-outline worker lifecycle
CanvasOverlays uses useSelectionOutlines to construct pixel-selection SVG paths in a dedicated module worker. The selected geometry is authoritative immediately; only its display path is asynchronous. A WeakMap keyed by coverage identity retains completed paths across unrelated renders and compatible selection transforms. Selection replacement, clearing and unmount terminate pending work; callbacks also carry a cancellation guard, and rendering looks up only current coverage keys. Thus late results cannot restore an obsolete selection outline. Both ordinary selection and selection-derived overlay paths use the worker result. Worker creation, processing and loading errors are surfaced through the editor error UI. Main-thread message serialization and browser SVG painting still have costs; this is not a universal latency guarantee.
Thumbnail scheduling during gestures
The layers panel passes the tool drawing state to thumbnail components. Pending 120 ms refresh timers are cancelled while a gesture is active and restarted afterward only for a branch whose preview is not current. Preparing the isolated transparency source occurs inside the deferred callback, avoiding preparation for every document snapshot. Existing completion guards discard stale results. Already-running renderer work is not abortable; this scheduling prevents new refreshes during drawing rather than interrupting an in-flight render. Native-resolution transparency selection continues through its independent pixel capture path.
Direct composition of ordinary layer content
Canvas2D layers without an enabled shadow or Blend If and with full fill opacity now reuse their content surface as the final layer surface. Masks and color overlays still apply before normal layer opacity/blending. Adjustment layers retain their separate processing path. Other layers retain the intermediate surface for shadow composition, fill opacity or backdrop-dependent Blend If. Aliased surfaces are released exactly once; cached raw content remains copied into owned working surfaces before mutation.
Unchanged raw layer content can also composite synchronously from CanvasCache.draw directly to its parent target, bypassing cache-to-working-surface copies and allocation. This route excludes active preview layers and their ancestors, adjustment layers, enabled shadows/overlays/Blend If, partial fill opacity and effective masks. Cache key/signature validation and LRU retention remain authoritative, and layer opacity/blending are applied at the target with context save/restore. Cached canvases never escape ownership or survive across an awaited borrow; a cache miss follows the ordinary rendering path.
Finished color-overlay reuse
During a live paint preview, eligible unchanged layers with color overlays replace their raw cache entry with the finished overlaid pixels under a distinct signature incorporating raw content and overlay settings. The same cache key/slot is used, avoiding simultaneous raw and finished allocations and preserving the existing 64 MB/64-surface budget. Subsequent compositions can draw finished pixels directly even after the gesture ends. Active preview branches and layers requiring masks, shadows, Blend If, partial fill opacity or adjustment processing remain excluded. Raw content is still used for active stroke prefixes and ordinary color-picker rendering. A later style change on a promoted layer may rebuild its raw content; failed raw-prefix reads safely take the full rendering path. Cache disabling/eviction and lifetime guards continue to apply.
Exact native pixel selection masks
The WASM selection kernel recognizes one additive pixel-coverage region sampled on its native pixel grid with identity linear transforms and an integer relative tile origin. In that case each output pixel has constant coverage across all sixteen supersamples, so the kernel copies its exact alpha byte while walking RLE spans monotonically. Tile clipping and translated regions retain transparent outside pixels. Scaled/rotated/sheared sampling, fractional grid alignment, vector regions and Boolean combinations continue through the supersampled kernel. The kernel signature, worker boundary and output RGBA format are unchanged.
Pixel coverage in the image worker
Wand matching/flood fill, alpha extraction and RLE coverage encoding execute in the existing PixelProcessor worker. The processor consumes the private captured RGBA buffer via transfer; it never transfers original assets. Only the encoded coverage returns to the host. Request settings are copied before worker readiness, and the existing worker failure/disposal path rejects pending requests. Both wand and transparency loading revalidate the captured document/revision/selection after the worker result before committing through ordinary commands. Rendering/readback for capture and coverage validation/commit remain host work.
Clipboard preparation worker boundary
After native-resolution pixel capture, copy transfers private RGBA data plus the immutable selection snapshot and captured document origin to the image worker. The worker generates selection tiles, multiplies alpha, finds visible bounds, crops and encodes PNG, then returns an immutable Blob and relative crop offset. Selection sampling remains in document coordinates. The host rechecks asset lifetime/document revision/selection target before replacing its clipboard, so a rejected late result preserves the previous clipboard. Native capture/readback and paste asset creation remain on their existing paths. Worker errors use the shared processor rejection mechanism.
Bounded prior paint-state retention
CanvasCache can retain multiple signatures for a paint-layer/geometry key so recently rendered history states remain reusable while budget permits. All versions count against the same global 64 MB and 64-surface limits, with per-key and global LRU eviction. Ordinary writes replace all variants as before; paint-content writes allow history states up to the shared surface limit. Other callers may specify a smaller per-key version count. Reads/draws resolve an exact signature synchronously, so undo/redo can reuse correct pixels without borrowing mutable surfaces or replaying every old stroke. Missing/evicted signatures still fall back to normal rendering. Cache clear releases every variant and its index.
Export execution controls
Host-only ExportControl carries AbortSignal and progress callbacks independently of serialized ExportOptions. Raster exporters check cancellation between tiles/strips and at encoding boundaries, releasing tiles/canvases/PNG stream resources on rejection. The host performs a final cancellation check before exposing the result. The export dialog owns an AbortController, aborts on Cancel/dismiss/unmount and forwards progress locally; the App suppresses intentional-abort errors and checks the signal again before download. Existing callers without controls retain their behavior. Browser encoding, synchronous constructor SVG serialization and individual PSD strips are not interruptible within a call; this is cooperative cancellation, not worker termination.
Retouch patch installation encodes detached corrected RGBA and original coverage directly with the shared PNG encoder. It avoids HTMLCanvasElement.toBlob idle scheduling and a premultiplied Canvas round trip; guarded lifetime/revision checks still run after encoding and before installation. Compression is asynchronous, but PNG row assembly remains on the host thread.
Patch adjustment rasterization retains its fixed tile origin and surface dimensions, but readback and worker blending are restricted to the transformed patch rectangle plus a two-output-pixel interpolation margin. Empty intersections skip the patch correction. The surrounding adjustment composition, masks, opacity and backdrop alpha semantics remain unchanged. This reduces corrected/backdrop buffer transfers for small patches without changing the tile drawing grid.
A normal patch adjustment at full layer/fill opacity, without an effective mask, Blend If, overlay or enabled shadow, can copy its already-corrected content directly to the target. Patch correction preserves backdrop alpha, so no second full-frame worker interpolation is needed in this case. Other adjustment kinds and styled/masked/faded patches retain general blending. The copy uses the current region cropped from the padded content and restores target context state.
Tonal strokes retain fixed-grid brush coverage but derive the exact nonzero coverage bounds before numerical correction. Sparse strokes copy only that rectangle into the Dodge/Burn worker and restore the corrected rows into the detached source tile. The pointwise kernel preserves original dimensions and unaffected pixels; full-tile and empty coverage retain the existing worker path, including option validation. Render-space geometry is captured before asynchronous coverage work.
Retouch coverage rejects cells outside the transformed stroke bounds before canvas allocation and readback, using the same overlap predicate as drawMaskStroke. Intersecting cells retain identical 256-pixel grid origins, fractional phase and two-pixel gutters. The optimization removes empty cell work without moving rasterization boundaries or changing coverage semantics.
Tonal rendering can retain a committed numerical prefix per render tile. Exact straight RGBA bytes share CanvasCache's existing 64 MiB/256-entry budget with canvases; reads and writes copy bytes to preserve ownership and low-alpha colors. Prefix metadata is bounded to 64 entries. Reuse requires immutable committed strokes with an identical prefix, identical immutable prior sibling layers, matching document/asset scope and render geometry, and no live-preview change in the backdrop. Geometry is part of the key, cache clearing invalidates metadata, and cache misses replay normally. Only committed correction is stored; the live tonal stroke, masks and styles are applied afterward. Untrusted/mutable snapshots fall back to replay.
Document activation calls renderer.resetView rather than clearing retained CPU pixels. resetView advances the epoch to invalidate pending cache writes and clears transient strokes, active mask raster state, filtered tiles and GPU caches. The bounded CanvasCache and its scoped paint/raster/tonal metadata survive tab switches; their document/asset/geometry signatures still govern reuse. Explicit clearCache and disposal continue to clear all retained CPU entries and prefix metadata. GPU retention across tabs is not changed by this optimization.
Immutable masked or shadowed non-adjustment layers may retain their finished appearance in the existing raw-content slot. The key includes document/asset scope, padded/world geometry and document-plane transform; an immutable layer identity signature includes all styling and mask changes. Cached appearance is composed with layer opacity/blend mode, while live-affected layers and Blend If stay on the normal path. It replaces rather than duplicates a retained surface under the shared budget. Overlay-only layers keep raw-content reuse for color picking; explicit cache clearing also resets appearance identity metadata.
The WASM selection sampler conservatively rejects whole pixels outside a single additive rectangle/ellipse's local bounding rectangle before sixteen-sample coverage evaluation. It bounds the complete affine pixel footprint and includes a scale/coordinate-dependent rounding allowance; uncertain/nonfinite bounds fall through to the original sampler. Edge pixels and compound/pixel selections retain their existing evaluation. Actual-WASM parity tests force the generic path with duplicate additive geometry across affine transforms, scales and large coordinates.
Canvas presentation may accept a completed intermediate Move/resize/rotation preview while a newer frame from the same live App gesture is queued. Jobs capture gesture identity, original committed snapshot, assets, region, zoom, font revision and backend state. The live gesture ref and committed snapshot must still match; cancellation, commit, revision/document change and viewport changes reject the older frame. This prevents continuous input from starving presentation without weakening committed-frame ordering. ToolController paint previews retain their existing separate same-stroke rule.
Feathered mask tiles restrict the numerical filter to nonzero alpha bounds expanded by the complete three-pass box-filter support (three times the ceiling of each radius). The original padded tile geometry and final crop remain unchanged. Empty tiles skip filtering; dense tiles retain the whole buffer. Actual-WASM parity tests compare reconstructed output against full-surface filtering for fractional radii, document edges, dense and empty masks.
For a single additive geometric selection, the WASM sampler also accepts fully interior pixels without sixteen subpixel evaluations. A conservative affine-footprint box must lie strictly inside the rectangle; ellipse acceptance additionally bounds the maximum normalized squared distance over that box. Coordinate-dependent rounding slack and a strict ellipse margin retain the generic path near edges or uncertain values. Oracle tests compare against generic duplicate additive regions, including thin shapes, reflection, shear and small sampling steps.
Active transform gestures retain a promise for the next animation-frame boundary, requested at preparation start. A subsequent job from the same gesture waits on that existing boundary; if it passed during rendering or between inputs, preparation can begin immediately. Gesture changes and ordinary document updates retain initial animation-frame coalescing; paint retains ToolController batching. Only one preparation is active, pending work is replaced by the latest target, and all existing presentation validity checks remain in force.
Clone gestures publish a normal transient brush coverage preview with a renderer-only ClonePreviewSource. It captures the immutable pre-stroke document, source offset and destination inverse transform; it never installs preview assets or changes document history. Native 256-pixel source tiles use a gesture-owned LRU of at most 60 tiles (15 MiB), plus a temporary assembly canvas at most 1024 square. Visible stroke regions are assembled into the same native rectangles used by committed clone sampling before transformation, avoiding cache-tile antialiasing seams. Source-document boundaries remain transparent. The brush mask, selection clip, opacity and destination styling then use the existing paint pipeline. Clone previews currently use the Canvas2D reference renderer; GPU preparation explicitly declines them.
Clone source draws serialize cache ownership for overlapping viewport/reference jobs. Pointer release, cancellation, reset, completion and failed commits dispose the cache and any private affine sampler. Results arriving after disposal release their canvases and reject; source revision guards reject changes during asynchronous sampling. Commit still captures durable PNG tiles through the existing command transaction and asset cleanup path.
Durable clone source tiles use readback-oriented native canvases and encode detached RGBA with encodeRgbaPng. This avoids canvas.toBlob idle-encoding deferrals accumulating per tile. Each tile remains bounded to 1024 square, original assets remain immutable, and generation/revision checks plus staged-asset cleanup still guard commit. Encoding does not change clone source geometry or the one-transaction history contract.
Clone preview source sampling conservatively rejects native cache tiles and assembly rectangles that cannot intersect any segment of the brush path. Segment clipping uses the maximum brush radius, native interpolation allowance, the inverse transform's footprint of two output pixels, and coordinate-dependent rounding slack. Pressure variation can only reduce coverage relative to this bound. Uncertain/nonfinite bounds retain sampling. Remaining source tiles are assembled on the original native rectangle grid; the actual brush mask and selection still determine pixel coverage. Browser oracles compare sparse sampling with forced full sampling under shear, pressure and reduced view scale.
At clone release, preview sampling is disposed before durable capture begins. The canvas renderer hook skips queued disposed previews, rejects prepared/fallback frames from disposed sources, and suppresses their expected cancellation errors. The last submitted frame remains visible until the committed document is ready. Durable capture retains independent source-sampling resources; completion failure still follows the normal document/error path.
ui/system-fonts.ts owns an observable, browser-session family catalog populated by user-initiated queryLocalFonts(). Typography subscribes to it across panel remounts and offers refresh/error/manual-entry states. No font binaries or enumeration results enter document snapshots, REST sessions or isolated scripting. Canvas continues resolving the selected family and style through the browser's native font matching.
Pen anchor SVG controls are memoized independently with numeric transformed position/handle coordinates, zoom and active-state props. Their comparator checks all eight fields directly, avoiding generic Object.keys allocation for each anchor. Path controls compute transformed coordinates directly into SVG props and mask-outline strings instead of allocating a transformed point plus two handle objects for every anchor. Reconstructed preview DTOs and cursor notifications therefore do not reconcile unchanged anchor subtrees. All anchors and handles remain present, including off-artboard geometry; transform, zoom and selected-mask-anchor changes still update their controls.
Pen controls also reuse whole path subtrees when all anchor/handle coordinates, affine coefficients, zoom, outline/contour state and selected anchor are equal. The comparator intentionally checks geometry rather than DTO identity because command previews may reconstruct unchanged paths. Coordinate transforms and anchor elements are created only for changed path controls. This is a presentation optimization; hit testing, commands and document data are unchanged.
path.update joins the targeted immutable command-copy path: clone the document root, ancestor groups, target vector layer, path array and edited path record only. The patch remains defensively cloned, full validation still runs, and untouched immutable paths are retained. Mutable external documents continue using the general full-copy boundary. This reduces both live Pen preview and committed edit allocation without changing command/API contracts.
Pen gestures freeze their owned baseline path data and retain a mutable copy of only the active anchor. Each existing-path preview snapshots that anchor while retaining frozen unchanged points. path.update defensively clones mutable incoming points but may reuse points recognized by the internal recursive-freeze registry. Arbitrary externally frozen objects do not qualify. Full validation and shared history behavior remain in place; a subsequent pointer event cannot alter an already published preview's active anchor.
Document validation reuses successful per-anchor schema checks for internally recursively frozen vector points. A validation-only path schema retains the public path fields, strictness and shared point-count bound, and checks each uncached anchor through the exact public point schema. Mutable points are rechecked every time; previously unseen frozen points are validated before caching. Public parsing/serialization contracts remain unchanged. This lets an edited path retain validation proofs for unchanged point geometry without treating arbitrary frozen data as valid.
The vector inspector reads its anchor count from the already available preview layer data rather than invoking the defensive VectorPath.points getter. Pen hit testing reads each candidate's points once before scanning it. The public getter still returns an independent copy; internal read-only UI work avoids paying for that copy repeatedly.
Layer thumbnails use the renderer's existing bounded cache, including incremental committed paint-prefix reuse at thumbnail resolution. They retain the 64-pixel output bound and the existing committed-change debounce/gesture pause. Cache keys still include source geometry/assets/artwork; no separate unbounded thumbnail raster cache is introduced. Fresh-render parity is verified after paint, erase, style changes, history navigation and branching edits.
Committed Clone capture retains its original native 1024-pixel grid but skips rectangles outside the conservative full-radius support of all stroke segments, using the shared stroke-region intersection guard. Captured source tiles remain immutable assets, and source-document clipping, affine sampling, staged-asset cleanup and revision checks are unchanged. No downsampling or document-size cap is introduced. Native and overview output parity is checked against full-source capture.
Clone capture transfers each private tile readback to PixelProcessor.encodePng; existing source assets remain owned by the asset store. The pixel worker validates RGBA dimensions, attempts native OffscreenCanvas PNG encoding and falls back to the direct encoder when native encoding is unavailable/fails. encodeCapturedPng lives in the PNG module for independent fallback tests. Encoding canvases are released after each tile. Existing processor request/error/disposal handling applies; Clone still checks document lifetime and removes staged assets on failed/stale captures. Native encoding runs in the worker because main-thread native encoding showed severe idle scheduling delays during real interaction.
Host applyPatch/healStroke operations acquire an exclusive retouch processor. The editor retains at most one idle processor after a successful commit, avoiding repeated worker/WASM startup during sequential repairs. Concurrent operations still use separate processors; only one can return to the idle slot. Cancelled, failed and surplus processors are disposed. Editor disposal terminates both the idle processor and tracked active processors and prevents later retention. ScriptRetouch's existing script-scope processor ownership remains unchanged. The retained worker preserves its allocated WASM heap until disposal; this is worker-count bounding, not a new byte-budget guarantee.
The Canvas renderer retains completed composites for immutable, unmasked, full-strength normal patch adjustments without shadows, Blend If or color overlays. Reuse requires exact identity of the patch and every preceding layer, no live-preview affected backdrop, and matching document/assets/render geometry/world/document transforms. Cache hits replace the current composition, preserving backdrop alpha. Final canvases use the existing shared byte/entry budget; proof metadata is capped at 64 entries and cleared with renderer caches. Edits below the patch, layer reordering, partial opacity/styles/masks and live backdrop changes fall back to normal rendering. Group composition remains isolated as before.
Clipboard PNG encoding reuses encodeCapturedPng inside the existing image worker after selection alpha and visible-bounds cropping. Native OffscreenCanvas encoding has the same direct-encoder fallback as Clone capture. Browser tests compare decoded pixels across every alpha value; PNG byte identity and invisible RGB preservation are not claimed. Stale-result checks and clipboard placement remain unchanged.
Feathered selection masks without painted strokes use PixelProcessor.featheredSelection: the image worker generates affine selection coverage, crops to finite blur support, feathers and returns RGBA in one request. The renderer writes only each tile’s interior with putImageData, retaining halo/tile budgets and world-space feather radii. Painted/vector/bitmap masks retain their existing path. This avoids intermediate canvas readback and a second worker round trip without changing mask semantics.
Raw layer surfaces are retained only for immutable layers. Command-preview layers are mutable, transient snapshots: their surfaces can read matching retained cache entries but do not copy their raw output into the shared LRU. This avoids unnecessary pixel copies and displacement of unchanged committed layers during transforms. Mask caches remain independently keyed by exact geometry; committed immutable content keeps existing retention behavior.
Clone capture first rejects native tiles outside stroke support, then crops each retained tile to the union of intersecting segment bounds expanded by full brush radius plus two native pixels. Bounds round outward and remain clipped to the original native tile; capture offsets and dimensions are serialized with each tile. This reduces readback, PNG encoding and asset decoding without downsampling or changing sequential staging/failure cleanup. Sparse long segments retain conservative rectangles.
Raw paint and raster cache writes can retain a cropped surface plus integer output offsets. Paint bounds union all stroke support; raster bounds use native layer placement, transformed into render space and expanded by two output pixels. Reads composite at the original offset. The shared cache uses a 64 MiB/256-entry budget; masks and completed styled surfaces use their working-region dimensions instead of this raw-content cropping option; other layer types and numerical pixel caches retain their existing behavior. This reduces copying/eviction when many small layers occupy a large viewport. Cropping does not change source assets, rasterization space or document bounds.
Cached viewport rendering can isolate eligible raster and unclipped fill-only paint layers into smaller working surfaces. Eligibility requires normal blending, full fill opacity, no active stroke target, and no enabled Blend If. Masks, color overlays and shadows are supported; masks only reduce content coverage. Outward-rounded content bounds plus two output pixels retain the viewport sampling grid; shadowed bounds additionally include conservative blur support and offsets; the path is used below 75% of viewport area. The internal isolated pass applies no layer opacity; the parent applies it once when compositing at the original integer offset. Brushes, clipped/Clone strokes and uncached/export reference paths retain their existing geometry because changing the clipped-brush working region failed exact parity.
Before allocating a bounded layer working surface, the renderer checks the raw/composited signature or immutable finished-style signature for that bounded render space, shadow halo and world transform. Masked/shadowed appearances use the same finished signature as the inner compositor; raw pixels are never substituted for a styled result. A hit draws directly into the parent at the integer viewport offset with layer opacity applied once; a miss follows the isolated preparation path. Cache surfaces remain synchronously owned by the cache and do not escape across awaits.
CanvasCache permits up to 256 mixed surface/pixel entries within the same 64 MiB byte budget, so small bounded layer images can retain several geometry/history states rather than evicting at one 64-layer frame. Each key still retains at most 64 requested versions. Both entry types share eviction and clearing; browser/driver per-canvas overhead remains outside the tracked pixel/signature byte budget. GPU texture, active-stroke, prefix-metadata and filter-tile limits are unchanged.
Raw-content signatures encode affine transform records by numeric value even when frozen. Resize and transform commands may recreate an equivalent small matrix; using its identity would invalidate identical pixels. Larger immutable content subtrees retain identity-based signatures, while placement/render space remain part of cache keys. This applies to shared Canvas/GPU signature generation without changing rendering geometry or command semantics.
The scripting iframe contains only a small CSP-protected bootstrap. On load, the host transfers the trusted runtime source string and separate data/status MessagePorts through postMessage; the iframe accepts initialization only from its parent and creates the Blob worker locally. The roughly 0.6 MB bundle is no longer serialized inside HTML/inline JavaScript on each run. Every run still gets a fresh opaque-origin iframe and worker, and cleanup, CSP, command validation, timeout and host-service permissions are unchanged.
DOM transactions freeze each validated intermediate snapshot with the store’s recursive immutable marker. Subsequent staged commands therefore use targeted copying and shared immutable drawing/selection data. Commands still validate synchronously; the committed store remains unchanged until successful completion, and the final batch remains one undoable operation. Failure discards staging as before. No user code or worker state is reused between script runs.
Vector path bounds scan anchors and both Bezier handles directly without constructing a flattened temporary array; the control-hull and stroke-width extent are unchanged. Raw vector cache lookup is skipped when the path array is not store-immutable: such previews cannot populate the retained raw cache, and serializing their full geometry for a lookup is unnecessary. Immutable committed paths and style-only previews sharing immutable paths retain normal cache behavior.
Viewport preparation carries an internal, nonserialized RenderOptions.isCancelled predicate. The canvas hook uses the same eligibility rules for cancellation and presentation: superseded revisions, documents, assets, views and ended gestures are obsolete, while a prefix of the same live stroke or an ongoing transform remains useful. Source-document and asset changes are checked directly before React queues the next frame. Cold paint checks the predicate at stroke boundaries and after cooperative stamp yields; Canvas checks layer boundaries and final output, and suppresses obsolete cache writes. Nested smart-document reference renders and GPU reference uploads inherit the predicate. Cancellation raises AbortError, unwinds temporary surfaces through existing finally blocks, and is suppressed only for obsolete UI work. Adaptive rendering does not retry canceled work as a GPU failure. Direct/export/reference renders without a predicate retain their independent lifetime. Native canvas calls and already-running worker/GPU operations are not preempted; cancellation is cooperative at the next checked boundary.
Vector path.add and path.remove join the immutable targeted-copy command path: copy the document root and ancestors/target layer, copy the path array for append, and retain untouched immutable siblings and geometry. Full document validation, duplicate IDs, inherited locks and limits remain enforced; arbitrary mutable documents still use defensive full copying. Detached VectorLayer drawing commands build a privately owned immutable snapshot by copying mutable fields and reusing only values recognized by the internal recursive-freeze registry. Successful results are frozen before their fields are assigned to the existing mutable layer shell, preserving references held by detached parent groups and path handles. Rejected commands leave the shell and ownership unchanged. Public snapshots/point getters stay defensive copies, and attachment still goes through the ordinary command/history boundary. REST/sandbox payload complexity and path-count limits are unchanged.
Clipboard shortcut sequencing
The UI retains paste requests arriving during its asynchronous pixel-copy task and runs them serially after a successful copy. All queued work stays under the original busy task; unrelated busy shortcuts remain blocked. The registry's explicit allowWhileBusy opt-in retains editable-field and modal protections. Each paste uses the existing raster mutation/history path, with document identity/revision validation between requests. Copy failure discards pending requests rather than pasting an older clipboard. Escape and window blur discard requests that have not started; an already-started paste keeps its existing lifetime checks. Direct scripting and raster editing API semantics are unchanged.
Clipboard worker crop bounds scan each row inward from its first and last nonzero alpha, rather than updating four bounds for every visible pixel. Dense rows require only two alpha checks. Selection masking still precedes cropping, and empty selections still reject. Full-size crops reuse the worker-owned captured RGBA buffer; cropped regions retain the exact row-copy path. No original asset bytes, document data, encoder behavior or public APIs change.
Contiguous magic-wand coverage uses horizontal-run flood fill in the pixel worker. A byte state buffer distinguishes untested, rejected, pending and selected pixels; the pending stack holds run seeds rather than a preallocated full-image Uint32 queue. Fill runs into the existing output coverage buffer and discover adjacent-row runs using the same four-neighbor connectivity. Seed premultiplied RGB values are computed once; per-channel short-circuit comparisons retain the original floating-point order and inclusive tolerance. Noncontiguous mode retains full-image matching. Original RGBA bytes remain unchanged.
Native retouch/pixel capture preserves the existing 1024×1024 tile grid. A single-tile capture returns the fresh getImageData() RGBA buffer directly after releasing its canvas; multi-tile captures allocate assembly storage and copy full-width tiles in one operation. Returned pixels remain caller-owned and transferable, independent of source assets. Do not change tile shapes merely to reduce readback calls: patterned, partially transparent, transformed raster fixtures exposed antialiasing differences when the grid changed.
Pointer move and keyboard nudge spatial calculations read Document.getSnapshot().document. These pure transform lookups must not call toJSON(), which defensively copies all artwork, including hidden layers and retained point arrays. Preview/commit still use the existing command, revision and gesture boundaries; the spatial helpers do not mutate the immutable snapshot.
Inspector rotation uses the same immutable snapshot for its read-only world transform, artwork center and parent transform queries. Slider previews must not serialize unrelated artwork. Commit still creates the normal layer-update command, and the snapshot is never modified.
LayerMetadata.toJSON() reads its owner's current internal layer data and defensively clones only the metadata subtree. It preserves live/staged reads, mutable returned values and defaults without serializing raster erasures, vector paths or paint strokes. The inspector passes authored-metadata presence from its existing layer snapshot into AssetInfoPanel, so a collapsed asset-information panel does not copy artwork merely to enable its reset button. Presence remains distinct from an explicitly stored empty metadata record.
Recovery saving reuses only document snapshots proven recursively immutable by the internal registry. Mutable caller documents and merely shallow-frozen objects keep the defensive deep-copy path. Validation, early asset-blob capture, checkpoint checksum generation and atomic IndexedDB transactions remain unchanged. A later live edit produces a new revision and cannot alter the captured checkpoint.
Recovery checkpoint checksums use cooperative UTF-8 JSON encoding of stable plain model data. Preserve native JSON property order, primitive formatting, escaping, omitted fields and array nulls. Native batches contain at most 64 shallow records with bounded field/string sizes; larger structures are traversed incrementally. Flush text chunks and yield around a 2 ms budget. The final checksum bytes remain identical to native JSON.stringify plus TextEncoder; no recovery format migration is introduced. This helper does not execute custom toJSON methods or serialize class instances. Recovery inputs are owned or registry-proven immutable before encoding begins.
The task-boundary helper now lives in core, with an engine re-export preserving existing paint imports. Its MessageChannel lifecycle is unchanged. Native individual-string encoding, output allocation, crypto submission and IndexedDB object cloning are not preemptible. Cooperative encoding improves input response at a throughput cost; it does not remove the storage transaction's large-object serialization stall.
Recovery persistence off the UI thread (2026-10-12)
Checkpoint encodings of at least 256 KiB transfer their existing UTF-8 buffer to a dedicated persistence worker. This is a scheduling threshold, not a document-size restriction. The worker reconstructs the checkpoint and runs the same strict, atomic IndexedDB transaction as smaller main-thread saves, retaining the current and two previous revisions and collecting unreferenced assets. Checksum bytes and version-2 storage remain unchanged. Asset blobs accompany the transfer without materializing their bytes again. Each job owns its worker until transaction completion or failure, then terminates it; editor disposal does not abandon an in-flight transaction. Error names survive transport so quota failures remain actionable. There is no automatic replay after an uncertain worker failure.
This removes the measured large checkpoint structured-clone task from the UI thread. It adds worker startup and JSON parsing cost; total save duration can increase. Recovery listing/restoration still reads document objects on the main thread, and mutable external inputs still need an owned snapshot. Neither path is claimed stall-free.
Recovery dialog summaries (2026-10-12)
The per-document Recovery list uses RecoveryRepository.summaries() rather than fetching complete document graphs. A dedicated recovery worker traverses the existing checkpoint store with a readonly cursor and returns only session ID, save time, document name and dimensions, sorted newest first. It does not fetch assets, transfer artwork or prior revisions to the UI, validate restorability, or modify storage. Cursor iteration avoids retaining every full checkpoint simultaneously. Existing full list() remains available for internal inspection; restore still performs full integrity checks. Environments without Worker use the same cursor locally. No storage migration or scripting contract change is required. Recovery refresh/retry/removal all reload summaries. The worker is released after the transaction and response.
This addresses the listing stall described above; full restore and explicit full-document listing still deserialize artwork on the main thread. A summary scan still reads legacy complete checkpoint records inside the worker, so latency and worker memory scale with their size. This is an interactivity improvement, not an indexed metadata store or a claim that the entire Recovery dialog is free of stalls.
Recovery preparation in the worker (2026-10-12)
RecoveryRepository.restore() sends only the checkpoint ID to the recovery worker. The worker executes the existing consistent readonly checkpoint/asset transaction, document validation, checkpoint and asset checksum verification, fallback through older revisions, and project serialization. It returns a Blob, save time, and skipped-checkpoint count. Neither the full document graph nor asset byte arrays are posted to the UI. The worker terminates after the response. project() inherits this preparation path; errors retain their name/message and missing/corrupt storage does not mutate the live document. readRestoration() is the internal shared implementation, also used directly when Worker is unavailable. Tests compare worker and direct prepared project hashes and verify corrupt data fallback.
This supersedes the previous main-thread restoration-preparation limitation. Applying the prepared project through EditorApplication.openProject() remains a separate operation with its existing validation, revision, asset and document-install behavior. This change does not establish that reopening or rendering a large project is stall-free. It also does not remove full-object reads from explicit list() inspection or checkpoint deletion. No persistence-format or scripting API change is introduced.
Avoid copies when opening and accessing attached layers (2026-10-12)
Document.getLayer() constructs an attached handle from the document-owned layer record without cloning its artwork. The handle retains identity/kind and reads live values through its owner, including staged transactions and undo revisions. This does not change detached construction or public toJSON() ownership. A removed handle still rejects value reads until undo restores its layer. Recovery scheduling from EditorApplication.replace() takes the store-owned immutable snapshot, matching ordinary revision scheduling; subsequent edits cannot alter the captured checkpoint. These paths must not defensively serialize all retained strokes just to expose a handle or schedule recovery.
The remaining project-open path still parses, validates, copies into EditorStore and recursively freezes large records synchronously. Eliminating these incidental copies reduces blocking but does not make large project opening responsive by itself.
Cooperative project immutability preparation (2026-10-12)
After loading a project, EditorApplication.openProject() cooperatively freezes its private parsed document before installation. freezeOwnedData() traverses owned plain data iteratively, processes array entries without allocating a parallel values array, and yields at task boundaries around a 2 ms budget. A parent enters the internal immutable registry only after its children finish; cycles and non-plain objects reject. This helper is for exclusively owned parsed model data, not caller objects shared with other writers. Preparation failure disposes the staged assets. Existing I/O generation and revision checks run after preparation, so edits or document switches during the asynchronous operation still reject installation.
EditorStore construction can reuse a document already proven recursively immutable by the internal registry. Schema migration owns a shallow new root before changing the version. Mutable and merely shallow-frozen callers still receive the defensive structured clone, and all documents still pass normal validation before installation. Public Document.fromJSON() continues to preserve external ownership; there is no unchecked project or scripting installation path. This removes the measured duplicate store copy and breaks recursive freezing into smaller tasks, but native JSON parsing and schema validation remain blocking work.
Cooperative shared document validation (2026-10-12)
Document validation is implemented by one traversal generator. The synchronous validateDocument() consumes it without yielding, retaining existing command/API behavior. Internal validateDocumentCooperatively() requires registry-proven immutable input and yields at task boundaries around a 2 ms budget between complete drawing-entry, raster-erasure, and layer checks. Both paths execute the same schemas, version checks, ID checks, selection checks and component checks. Successful immutable drawing checks populate the existing validation cache; no unchecked proof is introduced.
Project reading/loading has an internal opt-in prepareImmutable mode used by EditorApplication.openProject(). Binary project manifests are checksum-verified, their private document data frozen cooperatively, and then validated cooperatively before asset installation. This moves preparation earlier than the previous post-load freeze. Store construction still validates the document, reusing existing immutable drawing proofs. Ordinary readers retain mutable owned data and synchronous validation. Legacy JSON project parsing retains its initial synchronous validation before preparation. Retained-history parsing, individual large schemas, component-registry validation and native JSON parsing can still block; this is not a universally preemptible validator. Existing generation/revision checks continue to protect installation after asynchronous loading.
Custom cursor style scope (2026-10-12)
The custom-cursor activation selector applies to the viewport and interactive transform/crop/guide targets, rather than every descendant. Ordinary canvas descendants inherit the hidden cursor. The pointer-inert drawing SVG has a stable explicit cursor value so activating a custom cursor does not propagate a cursor change through tens of thousands of SVG anchor controls. SVG geometry, hit-testing ownership and visible control shapes remain unchanged. The cursor component changes its activation attribute only when the active state actually changes, avoiding repeated attribute writes on pointer movement. System-cursor preference and restoration on leave/blur remain intact.
Pen gesture reads retain immutable path references (2026-10-12)
Pen hit testing reads existing path records from the attached vector layer's document snapshot. It does not call defensive VectorPath.points getters to examine anchors or serialize the selected path again when beginning a gesture. The existing immutable path becomes the gesture's original value; a shallow points array and a deep copy of the active anchor provide the same mutable gesture boundary as before. Newly created paths retain their owned serialization/freezing path. Public DOM getters, command validation, path ordering/hit priority, transformed coordinates, preview/commit and undo remain unchanged. Unchanged point references can also be reused by preview processing.
First access to restored vector paths (2026-10-12)
PathCollection creates owner-backed VectorPath handles without reparsing or copying the owner's anchor graph. These are normal class instances with a small private identity record; reads resolve the current validated path through the owner. Its private record does not add an obsolete anchor-graph reference; document and layer snapshot ownership is unchanged. Default shape factories without an owner keep their existing constructor validation and defensive copy. Public points and toJSON() still return independent mutable copies. Owned-handle identity, live transaction reads, removal errors, duplication and undo/redo continue through the existing collection and command boundaries.
Cooperative native pixel capture (2026-10-12)
sampleRetouchRegion retains the exact 1024×1024 native tile grid and its existing readback/copy order. After releasing each tile, it yields through the shared task scheduler when approximately 4 ms have elapsed and tiles remain. This prevents a succession of already-resolved renderer promises from keeping all tiles in one UI task. Cancellation is checked before the next render; released surfaces are not retained across the task break. Individual canvas render/readback calls and full-result allocation remain synchronous, so the budget is a scheduling target, not a bound on blocking time. The single-tile path and final-tile completion do not add a task break.
Bounded workspace worker transport (2026-10-12)
ProjectEncoder transports document/history plain-data graphs in batches rather than posting their entire object graph in one synchronous structured clone. The internal graph transport assigns identities once, sends primitive properties and reference records in batches of up to 2048 entries (also checking a 2 ms preparation budget), and yields between batches. The worker reconstructs shared references, then uses the existing freeze, validation and project serializer. Array length/holes, undefined values and own-property semantics survive transport. This protocol is internal, does not change project bytes, and does not replace schema validation.
Before yielding, the encoder captures asset Blob handles and shallow copies history containers/entries. Only registry-proven immutable document snapshots are reused; mutable caller inputs receive a defensive clone before asynchronous transport. Concurrent jobs have independent graph receivers. Disposal terminates the worker and rejects pending jobs; interrupted transfers stop at their next batch and do not install partial projects. Completed jobs retain existing serial worker encoding and atomic workspace persistence. Chunk preparation/transfer adds overhead and increases total save time in current measurements while improving input response. Very large individual strings, mutable caller cloning, asset-reference scans, memory allocation and worker-side serialization remain potential limits; this is not a universal blocking-time bound.
Smart-filter preview cancellation and cache misses (2026-10-12)
Smart-object rendering checks viewport cancellation before each output tile. Once a pending tile completes, obsolete frames stop before starting another tile; epoch and cancellation checks prevent stale filter/composite cache writes. Already-running native/worker operations remain non-preemptible. The completed-filter cache lookup checks for a matching canvas synchronously before allocating and probing a readback surface, avoiding a discarded allocation on common mask-change misses. Filter math, native tile geometry and export pixels are unchanged.
Filter-mix buffer ownership (2026-10-12)
PixelProcessor retains its caller-safe mixFiltered behavior: capture all three inputs synchronously before awaiting worker readiness. Internal mixFilteredOwned consumes exclusively owned original/filtered/mask arrays and transfers their buffers directly. Smart-filter tile rendering uses this consuming path because cache reads return copies, native getImageData returns a fresh buffer, and any cache writes have already copied retained inputs. Worker/WASM mixing math and output bytes remain unchanged. Never pass cache-owned storage or externally retained arrays to the consuming method; its inputs can be detached even if worker validation later rejects the request.
Transient filter-mask painting and retained coverage (2026-10-12)
Filter-mask gestures publish the same renderer-only PaintPreview shape as ordinary mask painting, with an internal filterMask target flag. Pointer updates copy only the active stroke point array; they do not reconstruct and validate the entire retained mask through preview commands. Smart rendering appends that transient stroke to the stored filter mask. Ordinary masks ignore this flag. The target smart layer bypasses its raw content cache during the preview; affected ancestors still recompose and unrelated content remains reusable. Filter-mask previews explicitly use the Canvas reference backend. Release still constructs and validates the final mask through the existing DOM mutation and one undo entry; limits and stale/cancel guards are unchanged.
Native filter-mask coverage now uses the existing PaintedMaskRaster. Finished prefixes and incremental active stamps share the existing bounded cache budgets, keyed separately from ordinary masks by asset store, component, instance and native region/basis. Cache bypass still replays all coverage, and cancellation/epoch changes prevent stale publication. No image downsampling, stamp-order changes or cache budget increase is introduced.
Smart render views and mask cache signatures (2026-10-12)
The renderer opts into resolveSmartDocument's internal immutable-view mode. ComponentRegistry still runs ordinary/smart placement and reference validation, but returns its input only when the entire input is registry-proven immutable. Mutable and shallow-frozen inputs remain defensively cloned; default/public placement validation and expansion retain independent-copy behavior. Expansion constructs new placement records and preserves unchanged immutable nested mask records. This avoids a renderer-only deep copy without treating freezing as proof of schema validity.
Mask cache signatures use compact tagged identities only for registry-proven immutable stroke entries. Mutable active strokes and merely shallow-frozen entries retain value serialization. Raw signatures retain the existing maskGeometry exclusions; completed-filter signatures still include mask settings, placement and regional coverage. Weak identity maps do not retain documents and do not change cache budgets. New identities can cause safe misses, never reuse mutable geometry as an identity-only key. Filter output ImageData wraps private ArrayBuffer-backed pixels directly before putImageData, avoiding another allocation/copy; cache writes still own their retained surfaces.
Finished mask retention during gestures (2026-10-12)
MaskRetention can disable the finished raw-mask surface write while retaining prefix coverage and incremental active stamps. Smart filter-mask previews use this mode; committed masks and ordinary mask callers keep the default finished-surface behavior. Completed filtered tiles remain eligible for reuse, including when they satisfy the subsequent commit without rerasterizing its mask. This removes an intermediate canvas copy per affected active tile without changing pixel blending, cancellation or cache ownership/budgets.
Smart filter-mask retention also requests readback-oriented output canvases on prefix cache hits, since coverage immediately feeds CPU pixel reads for worker blending. This uses the existing willReadFrequently canvas hint and allocation checks; prefix replay misses and uncached coverage retain their existing allocation path. Ordinary mask callers default to drawing-oriented output. Native mask geometry, cache ownership, budgets and blend math remain unchanged.
Direct retained mask-stroke composition (2026-10-12)
When an active mask stroke has no selection clip and its coverage fits ActiveStrokeRaster's existing retention budget, drawMaskStroke composites the retained coverage directly onto mask output using the stroke's opacity and hide/reveal operation. The retained coverage remains unmodified. This removes a temporary full-tile canvas and intermediate drawImage copy. Clipped strokes keep a separate surface for destructive clipping, and oversized strokes keep isolated coverage so opacity is applied once rather than per stamp. The existing 16 MiB limit is centralized in ActiveStrokeRaster.canRetain; it is a working-surface budget, not an image limit.
Compact retained text surfaces (2026-10-12)
Text draws on the original output pixel grid. When retaining immutable text content, drawText measures actual glyph ink bounds with the same canvas font, baseline, alignment, direction and spacing used for drawing. Per-draw repeated lines share metrics. The renderer transforms those local bounds to output pixels and retains only their outward-rounded rectangle plus the existing two-pixel margin. It does not crop drawing geometry or use authored text width/height as a glyph clipping box. Missing/nonfinite ink metrics fall back to full-surface retention. Spaces/empty lines have no ink. Existing font-load invalidation, source ownership, cache bypass, and 64 MiB shared cache budget remain unchanged. This prevents many small text layers from evicting each other merely because they were drawn on large document-sized surfaces.
Compact finished text effects (2026-10-12)
Finished text appearances retain compact geometry too. CanvasCache.bounds returns a copy of retained surface coordinates, allowing a raw text cache hit to carry its ink rectangle into effect retention without exposing the owned canvas. Completed text bounds rebase the padded source into the output grid and conservatively include shadow offset, three-sigma blur support and a two-pixel margin. Masks and color overlays cannot expand source ink; missing raw bounds retain the full surface. For normal-blend, full-fill-opacity text with an enabled shadow, the viewport now also bounds cold effect work using freshly measured native glyph ink. The existing bounded-layer compositor expands that rectangle by the shadow offset, three-sigma blur support and antialiasing margin, clips it to the current region, and rebases onto integer output pixels before rendering masks/styles. Small bounded regions retain finished appearances under their own geometry keys; missing/nonfinite metrics or bounds covering at least 75% of the region use the full surface. A shared one-pixel measurement canvas retains no metric results across calls, so font changes cannot reuse stale bounds. Other blends/fill-opacity cases and cache-disabled exports keep the existing full-region path. This changes transient work allocation, never source resolution, authored geometry or the output grid.
Immutable text color overlays may promote to completed appearance on ordinary edits as well as during gestures. Promotion uses the same bounded cache slot and includes overlay settings in its signature. Other layer kinds retain their existing gesture-only promotion behavior, so ordinary paint commits keep the raw stroke prefixes used by subsequent strokes. Mutable previews, Blend If/backdrop dependencies, cancellation and invalidation retain their previous rules.
Polygonal lasso and shared contour commands
ToolController keeps a revision/generation-guarded polygon draft separate from pointer-down gestures. Pointer releases retain corners; moves publish the rubber-band preview at animation-frame cadence. Beginning another tool, changing lasso/Boolean mode, cancelling, losing window focus or changing document revision discards it. The first corner has a screen-space closure target. Enter/Backspace use the centralized finish/delete actions and retain editable-field protection. Hover, panning and capture release never commit selection edits.
Document.selectPolygon(points, operation) dispatches selection.polygon, validated by the shared polygon request schema in core/lasso.ts. Commands scan-convert the contour using the existing even-odd horizontal-span/RLE implementation, reject empty canvas coverage, combine with the current selection and validate before commit. Root-only command copying retains immutable layer artwork; ordinary command transactions, history, script isolation and REST revision checks apply. No schema change is needed. RecipeRecorder records the resulting selection.set coverage, so replay does not depend on gesture state. Synchronous scan conversion can remain expensive for extremely tall or complex contours; this slice does not claim the full F02/F14 performance gates.
Worker-backed selection modification
core/selection-modification.ts defines the shared strict options/request schema. engine/selection-modification.ts rasterizes the already-combined selection with the actual WASM selection kernel into padded 512-pixel output tiles. Circular grayscale dilation/erosion uses monotonic horizontal queues for each disk row; feather uses the existing WASM three-pass fractional box kernel. Halo support is complete across tile boundaries. Outside-canvas coverage is explicitly zeroed before processing. Output is assembled in horizontal bands into one RLE region, without a full-canvas RGBA/alpha allocation. Sparse serialization can still be large for fragmented coverage; no image import limit is introduced.
Document.modifySelection validates options/results, rejects synchronous transaction use, awaits its host preparation adapter and rechecks revision/cancellation before one ordinary selection command transaction. Application sessions own a dedicated PixelProcessor per operation; progress checks session/revision/asset lifetime and cancellation terminates the worker. The shared processor message protocol supports request-scoped progress without resolving the pending result early. Script preparation replays validated pending commands into a private snapshot, checks current plugin write grants before and after work, limits per-run operations, and aborts workers when the script completes/cancels. Successful runs retain their atomic host undo boundary. No source pixels, credentials or host objects enter isolated scripts.
The loopback REST endpoint uses a dedicated Node worker that imports the same engine and compiled WASM module. Requests stay responsive during processing. Completion uses the same DOM method/revision guard; deletion/disconnect discard work and disconnect terminates its worker. Schema-16 selection storage is unchanged. SelectionModifyDialog owns cancellation on unmount, progress and local error feedback; command-palette actions and the options-bar control open it.
Schema-17 chromatic adjustment families
core/adjustments.ts defines strict Color Balance and Vibrance DTOs, typed defaults and the shared discriminated adjustment schema. Both require schema 17 or later; current model validation accepts schemas 1–25. Constructor/history restoration upgrades valid old roots without changing their content. Container v3 and workspace snapshot v2 remain separate unchanged versions. Attached mutations use the existing AdjustmentLayer/commands/locks/history boundaries, including REST, recorder/recipes and isolated plugins.
assembly/chromatic.ts implements encoded-sRGB color math with unchanged straight alpha. engine/wasm.ts snapshots/validates parameters and pixels, aligns the parameter block, grows memory before acquiring views and copies owned output. PixelProcessor captures nested caller settings before readiness; actual pixel loops execute in the existing worker on at-most-1024-square reference/export tiles. GPU processing adds Color Balance/Vibrance passes using the same ranges/luma/chroma math. Existing mask, opacity, blend, source ownership and fallback decisions remain in their shared composition paths. The JavaScript implementation is a conformance reference, not the production UI pixel path. Formula/precision limits are maintained in SCRIPTING_API.md.
ChromaticAdjustmentControls uses shared paired sliders and a local tonal-range selector. Inspector reset/type changes, command search and context-menu creation use typed neutral defaults and the same constructor API. Range-selector state is local UI state; actual nine-channel parameter records remain document data. Raster interchange exports keep existing capability warnings rather than claiming editable adjustment support in external formats.
Gradient map processing (schema 18)
core/gradient-map.ts owns strict stop validation and a portable gradient DTO; AdjustmentLayer exposes it through existing constructor/setter/command boundaries. Canvas composition processes at most 1024×1024 pixels per worker request with the actual WASM adjustGradientMap export. Stops are packed as float64 position/encoded-RGB tuples. A separate WGSL pipeline uses 32 uniform stop slots, retaining the small existing uniforms for ordinary paint/composite passes. Float32-collapsed stop positions fall back to Canvas/WASM. Alpha, masks, source assets and adjustment composition retain existing invariants. The JS loop in engine/gradient-map.ts is a conformance reference, not the production rendering path. Schema 18 is required for these new records; project/workspace outer versions remain unchanged.
The common isolated-script commit boundary rechecks plugin installation and current document-write grants after worker completion, before asset installation, command dispatch and active-layer selection. Initial permission snapshots alone are insufficient for delayed commands. Removed/revoked plugins cannot commit staged edits; existing in-band host operations have their own lifecycle and are not retroactively undone by this staged-command check.
Rendered PSD boundary — 2026-10-15
core/interchange/psd/export-plan.ts emits ordered pixel, folder-divider and folder-header records with private render documents and separately pinned mask jobs. It recursively retains supported groups and ordinary/pass-through modes; unsupported adjustment/Blend If prefixes merge in the nearest isolated scope. Styled folders render one child. Group fill folds into opacity; non-Normal pixel fill/masks bake, while unstyled Normal pixel fill remains metadata. Plain integer-placed rasters retain placed bounds; other geometry/effects rasterize on the document plane. engine/psd.ts samples native reference-renderer tiles into about 1 MB strips (or one full row), writes planar PackBits scanlines and retains compressed Blob parts. Separate document-bounded native user-mask jobs sample even disabled sources, bake mask controls and write an independently enabled channel. The merged preview uses the original full document. No full-canvas RGBA allocation or import cap is introduced; format and browser allocation limits remain real.
PSD records include a negative layer count to identify merged transparency, Unicode names, supported layer metadata, standard ICC/resolution resources and explicit global-mask information. composite.ts owns white-matte conversion; the parser reverses it for negative-count merged images and recognizes legacy positive-count Canoli ICC identifiers and container layout while treating standard extra alpha channels separately. Trusted import adapters can explicitly opt into straight-alpha legacy decoding for unmarked older files. Native layer channel precision is separate from quantization of the white-matted merged preview. The old low-level asset-only bridge now rejects rich/unrendered/missing/scaled input instead of silently dropping it. This PSD correction does not require a document-schema increment; project container 3, workspace 2 and sandbox/REST boundaries are unchanged.
Host ExportOptions retains psdMode (layers by default or explicit flatten), progress and cancellation. The per-export worker validates four-channel artwork, seven-channel shared artwork/preview or one-channel mask replies. Temporary surfaces release and workers terminate on success/error/cancel. Preflight describes actual folder/mask retention, scoped merges and baked controls. Native Photoshop text/adjustments/effects/smart-filter links remain unsupported. See SCRIPTING_API.md for the normative hierarchy/mask/fill/empty-folder contract. Primary references are Adobe's format specification and group opacity guidance.
White Balance processing (schema 19)
core/white-balance.ts owns strict temperature/tint validation, defaults, the D65-relative Planckian/tint model and the linear-sRGB Bradford matrix. Independent Colour Science fixtures verify whitepoints/matrices using a numerical tangent rather than the production analytic derivative. The WASM ABI packs nine float64 coefficients plus a 256-entry decode table; memory grows before acquiring views. The worker owns input/settings snapshots and the pixel loop preserves straight alpha. Canvas reference/export requests remain at most 1024 square; the supported GPU viewport uses mode 11 with the same matrix, transfer functions and byte boundary. Neutral defaults bypass both transforms exactly. Existing color/precision/mask/fallback gates remain intact; no camera RAW, automatic white estimation or hardware-performance claim is implied.
White Balance uses the existing AdjustmentLayer constructor/setter, command schemas, history, locks, isolated script/plugin commit validation and separate REST surfaces. Schema 19 requires this new kind; older valid roots migrate without changing their content. Outer project/workspace formats and sandbox globals remain unchanged. Inspector sliders preview before one shared commit, with typed defaults for reset/type changes and palette/context-menu discovery.
Portable LUT processing (schema 20)
core/lut.ts owns strict Cube 1.0 parsing, domain validation, red-fastest little-endian float32/base64 serialization, typed defaults and a bounded decoded-table cache. Packed strings avoid creating hundreds of thousands of document/command nodes for standard tables; ordinary command complexity, script and REST body limits still apply. AdjustmentLayer.setLut parses a table and invokes its validated attached setter. UI file work uses a terminable module worker. Imported bytes are independently validated in cancellable main-thread chunks to prime the bounded cache before the synchronous shared command; cancellation and stale/locked-target checks precede commit. Tables persist in document/history/recipes without external URLs or a new image-asset type. Schema 20 requires the new kind; earlier valid roots migrate. Outer project/workspace and plugin formats remain unchanged.
assembly/lookup.ts implements domain clamping, independent linear 1D and tetrahedral/trilinear 3D interpolation with float32 tables/float64 math and unchanged alpha. Native Canvas/export tiles use the existing image worker. A separate WGSL pipeline reads packed float32 values from a storage buffer, with a bounded buffer cache released on clear/device loss/disposal. Precision-unsafe domains/extreme values or excessive GPU storage use the reference fallback with parameters intact. Cache budgets do not limit image/document geometry. The JavaScript pixel implementation is a conformance oracle; independent Colour Science files and outputs validate ordering/domains/interpolation. Hardware/color/HDR/print/performance claims require their own gates.
Native Color Range preparation — 2026-10-15
core/color-range.ts owns strict source/sample/fuzziness options and the independent JS CIELAB coverage oracle. assembly/color-range.ts executes actual straight-sRGB decoding, D65 XYZ/Bradford D50 Lab and CIE1976 falloff with float64 math, exclusion, visible-alpha inversion and repeated-RGB reuse. The image worker owns inputs and returns coverage bytes. core/selection-rows.ts assembles scanline-ordered RLE without retaining a full-image plane; large assembly yields between bounded chunks. Browser final sampling uses dedicated Canvas/worker ownership, at-most-512-square source tiles and a bounded coverage band. The display proxy is used only for preview; point sampling reads a real native pixel and final application never reuses proxy coverage.
Document.selectColorRange delegates preparation to a host, validates results/revision and commits normal selection commands in one transaction. Scripts prepare against their captured revision plus validated staged commands, with current plugin grants enforced before/during preparation and before final staged commit. Scripts retain existing time/command and shared 32-selection-preparation budgets. Source asset reads require apiVersion-2 assets:read, without exposing pixel buffers or adding a permission. Metadata-only selection operations still need no image permission. Existing selection data (current document model 21), project 3 and workspace 2 are unchanged; recipes retain final coverage for offline replay.
The separate REST endpoint requires an explicit asset source. server/png-rows.ts validates and streams a published noninterlaced 8-bit plain-sRGB PNG subset; server/color-range-worker.mjs clips native decoded strips and invokes the same WASM kernel. It retains scanlines/a bounded RGBA strip, never a full decoded image, and terminates on request/session/revision cancellation. Unsupported formats/color declarations reject. This is source-pixel analysis, not a Node scene renderer, browser synchronization or ICC/EXIF orientation support. Both surfaces preserve original assets. Dense RLE, extreme row widths, browser decoding and process memory remain real limits; no arbitrary image resolution cap was introduced.
Saved alpha channels (schema 21)
core/alpha-channels.ts owns strict named-channel/coverage/load schemas. dom/alpha-channels.ts exposes detached AlphaChannel constructors, stable-ID attached handles and AlphaChannelCollection; mutations dispatch alphaChannel.set/remove/reorder. Coverage remains an independent existing SelectionData value, preserving its fractional/affine/RLE semantics. The model validates at most 64 unique IDs and rejects the field under pre-21 labels; recursively immutable validated channels can reuse validation. Current/retained history migrates through the existing document boundary; project 3/workspace 2 are unchanged. Crop translates saved geometry, image resize composes its affine scale, and canvas resize retains geometry.
AlphaChannel.load delegates native preparation through Document._prepareChannelLoad, validates returned coverage/current revision and commits selection.set once. engine/channel-selection.ts rasterizes each complete channel/current expression through real WASM in <=512-square tiles, combines byte alpha/inversion, assembles bounded bands and coalesced RLE. Dedicated workers terminate on cancellation. The browser and Node worker call the same compositor; source assets, rendering backends and image permissions are unnecessary. Script sampling is derived from the validated staged snapshot and current plugin grants, not caller-supplied host dimensions or a live mutable scene. Preparation shares the sequential 32-call script budget and four-worker REST budget. Installation is inert.
The Inspector owns a bounded grayscale preview and local selection controls, not document rendering state. Loaded coverage records as an offline selection recipe; channel management remains explicitly unsupported in recipes. PSD capability reporting identifies omitted saved channels rather than implying interchange support. RGB/CMYK component channels, spot colors and direct grayscale channel painting remain future work; current refinement loads into ordinary selection tools and updates the saved channel.
Crop frame/active changes explicitly invalidate the tools' retained UI snapshot before publishing. Those properties live on CropController rather than ToolState; otherwise cancelling an idle frame could leave its old overlay visible when every compared ToolState field stayed equal. Pointer movement retains the controller's existing frame pacing; paint preview subscription filtering is unchanged.
Native Quick Selection
core/quick-selection.ts owns strict brush/source/operation contracts and clipped, merged native seed spans. assembly/quick-selection.ts computes the seed color model, caches eligibility, grows four-connected horizontal runs through local edge checks and emits resumable bounded frontier batches. It allocates no managed arrays inside WASM. engine/quick-selection.ts orchestrates the run frontier, native byte coverage and RLE retention; an independent pixel-queue oracle checks scanline equivalence. Browser preparation captures owned source pixels through <=512-square Canvas tiles and a dedicated image worker. Source capture yields to queued input/paint tasks between tiles after approximately eight milliseconds of work, rechecking cancellation and ownership on resumption; awaiting tile-render promises alone can keep draining microtasks and starve input. Individual tile/render/allocation tasks can still exceed that interval. The native connectivity source/state plane is not tiled: it needs roughly five bytes per source pixel in WASM, plus actual spans/frontier/output/capture/decoding/RLE allocations. The existing 256 MiB WASM maximum and actual process memory are real operation limits, not arbitrary document/import caps or destructive downsampling.
Document.selectQuickSelection prepares through a host hook, validates results/revision, and commits ordinary fractional selection commands once. ToolController captures frame-paced seed drafts and owns progress/cancellation on release. Sources reuse Color Range's validated visible composite/isolated branch/original-asset semantics. Isolated scripts prepare from validated staged snapshots with current image-reading and document grants; no raw RGB enters sandbox code. Final staged commit rechecks asset-read permission. The method shares existing sequential script and REST concurrency budgets. Node uses a private PNG decoder/WASM worker on explicit session assets, with no browser scene renderer or synchronization. Existing schema 25/project 3/workspace 2 selection storage and offline recipe output are reused.
The former T19 Select Subject mask-loss/white-source/central-fallback failures are corrected by the source-native path below. Quick Selection is independent. Broader semantic and matting quality gates remain unfinished.
Source-native subject preparation
core/subject-selection.ts validates options and resolves raster asset geometry separately from full world placement. Document.selectSubject snapshots the selected target, calls a configured private host, validates native coverage/current revision, rejects empty evidence and commits once. Browser preparation captures original decoded pixels through <=512-square canvases with cooperative task yields; a private worker runs assembly/subject-selection.ts. A visible-border RGB model, source-alpha prior, on-demand Sobel/contrast/spatial score and normalized threshold emit bounded coverage bands into RLE. No white source, central fallback, automatic hole closing or minimum-area pruning is substituted. The worker retains a full native RGBA plane under the existing WASM/process memory limits, not full-image float/label planes. Expand uses shared source-plane disk dilation before applying ancestor/layer/placed-scale geometry.
The isolated bridge prepares against validated staged commands, shares the sequential 32-selection budget, retains source pixels outside the sandbox and enforces current assets-read/document-write grants through final commit. Native image-reading selection flags cover Color Range, Quick Selection and Select Subject. Separate REST sessions resolve their own raster/PNG asset metadata and transforms, use a terminable decoder/WASM worker and share the four-worker capacity. No browser synchronization or new schema/format is implied.
The synchronous subject reference/helpers retain actual byte masks and return empty evidence explicitly; heuristic output is unscored rather than calibrated subject confidence. Refine Edge now uses the separate native preparation boundary below. Semantic and challenging-edge quality remain open.
Native matting preparation and staged assets
core/matting.ts owns strict options, native trimap/stroke validation and the private prepared-plan/asset-lease contract. Attached RasterLayer.refineEdge and Document.removeBackground snapshot revision, await the configured host, validate its plan through ordinary command execution, then transfer staged assets around one atomic command transaction. Mask-only emits mask.setFromMatting; new-layer output adds/places a corrected raster above the source and hides the original. No new public DTO mutation API or schema increment is introduced.
engine/matting-source.ts captures original decoded raster tiles, samples effective existing masks in document-space tiles at native source centers, or rasterizes the inverse-placed selection through actual WASM. Automatic Subject priors are separately prepared and normalized by intrinsic alpha. matting-workflow.ts assembles the default global closed-form Laplacian before streaming postprocessing/output. intelligence/matting/closed-form.ts stores unknown rows only in chunked 5×5 stencils, keeps cross-tile connections, eliminates exact known constraints and solves one float64 system with preconditioned CG and checked residual. Clipped 3×3 visible-pixel windows, epsilon 1e-7, a 192 MiB estimated graph/work-vector budget and 2,000-iteration/1e-7-residual gate are explicit. Unconstrained components preserve real priors or reject; no approximate success or implicit fallback is allowed. matting-tile.ts shares deterministic labels across assembly and output, then applies native fractional feather/RGB decontamination. Explicit Color line retains the former local estimator. matting-output.ts streams relative matte and optional corrected foreground PNG scanlines without a full output plane/canvas. Corrected assets retain intrinsic alpha. Existing mask link state is preserved through bitmap placement; density/inversion/feather are baked into resampled coverage. Finer-than-source mask geometry can change when flattened.
prepare-matting.ts privately decodes/validates actual PNG dimensions before transferring ownership; cancellation, stale revision/session/source or failed validation disposes private bitmaps without public history/assets. Committed assets survive observer exceptions and undo/redo. preview-matting.ts owns a separately scaled <=512 display proxy and borrowed original mask assets, never the final output. The dialog stores frame-paced source-coordinate trimap drafts outside history and forwards real native progress/cancellation.
The isolated retouch host prepares against validated staged commands and owns output assets until final script commit, sharing its 32-owned-asset budget (two for corrected output). Current document/asset read/write grants are checked both during preparation and final commit. No raw RGB or trusted controls enter sandbox globals. Separate REST sessions use private Node PNG-decoder workers and the same tile/output mathematics, shared four-worker capacity, revision/disconnect/deletion cancellation and staged asset commit. Node retains full source and optional bitmap-mask decode planes; browser decoding and automatic Subject still have genuine native memory costs. No import cap, browser scene renderer or server/tab synchronization is added. Exact defaults, format limits, source precedence and resampling caveats are in SCRIPTING_API.md/API.md.
The global worker session has assembly, solve and output phases. Disjoint row-major native cores are validated; covariances use stable Cholesky factors, and final PCG residual is recomputed before certification. Private processor disposal terminates the graph and pending work. Display proxies run their own global solve and never supply final coverage. Node uses the identical global workflow in its existing private PNG worker. Global graph memory is an operation budget proportional to unknown coverage, separate from original geometry, browser decode, automatic Subject and compressed/output allocations. Independent NumPy/SciPy direct solves and global-seam/native browser checks establish the numerical subset; real hair/glass semantic quality is not established.
Photographed-reference evaluation exposed incomplete Jacobi convergence and overstrong low Smooth values. Matting now builds a stencil-preserving IC(0) factor with predecessors sorted by actual unknown insertion order, including capture seams. Geometric stencil intersections avoid dense factors; upper entries cache the factor transpose for triangular applications. Adaptive diagonal shifts affect only this preconditioner. Original Laplacian, constraints and true residual remain authoritative; insufficient factor memory or failed factorization uses global Jacobi rather than a different matte method. Base graph capacity is retained within the same 192 MiB estimate; IC(0) adds up to 200 bytes per reserved row to the former 444-byte base estimate when it fits. Native smoothing blends the bilateral result proportionately, retaining zero identity and hard labels.
After classifying components and factoring, ClosedFormMatting compacts each sparse row in place into ascending unknown-index order. Matrix values, neighbors and factor/transpose entries move together. The no-longer-needed union rank/anchor bytes become total-entry/strict-lower counts; no extra per-row arrays reduce graph capacity. Matrix multiplication ignores absent slots, and triangular solves iterate their actual lower/upper ranges without testing all 25 stencil positions on every iteration. Roots/anchors must never be queried after this phase; attached sample output uses the retained frozen/prior flags instead. Optional factor allocation RangeError also releases factor references and retains the original global Jacobi route. The constrained system, true residual, iteration ceiling and cancellation/commit boundaries remain unchanged. Reduction order can change floating-point roundoff and iteration counts; independent numerical/output gates remain required.
intelligence/matting/coarse.ts optionally augments that base preconditioner for at least 4,096 unknowns. On native 16×16 cells, its columns are P_i=[1,R_i,G_i,B_i] for anchored unknowns only; it assembles the globally coupled Galerkin matrix E=PᵀAP, not independent tile mattes. A band Cholesky factor of E+rho I, rho=max(1e-12,max(diag(E))*1e-10), stabilizes dependent RGB columns. The initial correction and every additive preconditioning step use Q=P(E+rho I)^-1Pᵀ. The native Laplacian, epsilon and hard constraints remain untouched. Success with this correction requires recomputed native relative residual <=1e-9, stricter than the base path's <=1e-7; both retain the 2,000-CG-iteration ceiling. No coarse alpha is substituted into final output.
RGB24 and the genuine initial-alpha byte share one exact 33-bit integer (RGB24*512+alphaByte) in the existing float64 sample vector; the separate prior-presence byte preserves absent versus zero evidence. After component classification, the obsolete union-parent vector holds coarse-cell indices, with frozen components excluded. Rank/anchor bytes retain their earlier role until factorization/packing. Coarse band/RHS/bookkeeping estimates are charged within the same 192 MiB graph budget after reserving the original base and eligible IC(0) capacity. A bounded 200-million n*bandwidth² factor-work estimate prevents pathological optional band factors; this is not an import/document cap. Insufficient optional capacity, failed coarse factorization or coarse allocation RangeError retains the original global route. Private diagnostics report coarse cells, bandwidth, estimated bytes and ridge; the host validates them and enforces the stricter residual when active. Whole-process peak memory and Map overhead remain unmeasured estimates.
External research images stay outside the repository. The pinned local evaluation/preparation/direct-reference/scoring tools and explicit Playwright configuration separate development from a reserved image-ID holdout, record failures, and compare real browser source/output bytes to the same numerical pipeline. Their gradient/connectivity definitions are local metrics; no official hidden-test ranking is claimed. Existing script wall-time and plugin/asset isolation budgets remain unchanged.
Optional WASM sparse matting iterations
After component classification, coarse preparation, IC(0) and row packing, engine/matting-iterations.ts can migrate matrix/neighbor/factor buffers to a private instance of the already compiled pixel module. assembly/matting.ts applies the same packed sparse matrix and forward/back IC(0) substitutions in float64 and the same reduction order. PCG control, true-residual recomputation, global RGB coarse correction and final clipping stay in the existing solver. The worker and separate headless REST matting worker supply this backend; it is not a new public refineEdge option.
The private instance has its own linear memory, so interleaved ordinary pixel requests cannot overwrite a live graph. Matrix storage migrates one chunk at a time, replacing original array references with views into that memory; every growth rebinds all completed views because growth detaches previous buffers. There is no second persistent copy of the entire graph. PCG vectors remain in JavaScript; three reusable WASM vectors hold input, output and the copied diagonal. Only those vector bytes cross the kernel boundary on an iteration; no per-iteration buffers are allocated. Optional allocation failure after partial migration keeps valid rebound views and finishes through the global JavaScript solver.
The optional estimate charges three float64 vectors, three copied metadata bytes per reserved row, 512 bookkeeping bytes per chunk, module prefix, page rounding and a transient source matrix/factor chunk. It fits only in spare capacity after the existing base, eligible IC(0) and coarse stage; no previous graph capacity is reduced. Fewer than 4,096 unknowns or unavailable extra capacity retains JavaScript. Diagnostics report iterationBackend and iterationBytes, included in estimatedGraphBytes and validated before encoding/commit. These remain logical working-set estimates: garbage-collection timing, retired WASM buffers, decoder/source allocations and whole-process peak memory require real device measurements. JS fallback loops cache chunk arrays and use packed entry bounds without changing arithmetic or storage.
The Node worker imports its kernel factory and matting runtime through a single tsx entry module. Separate tsImport calls create distinct module namespaces and private WeakMaps; a kernel created in one namespace cannot be cloned through another cache. A real REST test uses the multi-chunk, 5,355-unknown independent fixture to cover this boundary and native output/undo.
Read-only design checks
core/preflight.ts owns strict inspection policy/report schemas and deterministic geometry/native-source sampling. Document.preflight is the OO entry point; configured hosts prepare reports without emitting commands. The DOM validates returned document/revision/options and rejects stale work. Browser preparation in engine/preflight.ts pins asset identities/lifetime and performs bounded family probes using the existing availability logic, then runs geometry traversal in a private preflight.worker.ts. Worker disposal stops cancellation/late output. Shared family-reference enumeration moved to core/font-references.ts, with existing UI imports re-exported unchanged; browser family probing lives in engine/font-availability.ts.
Root authored non-group bounds use existing paint/vector/raster/text/smart geometry and composed transforms. Raster sampling uses the largest singular value of the source-pixel-to-document matrix; no raster decoding is involved. Reachable embedded placements are traversed separately for sampling/fonts, with scoped component definitions and root-instance selection paths. Internal master bounds are not compared to the root canvas. Work is bounded at 4,096 visited placements and 64 path levels; retained findings stop at 512 with complete counts/truncation. These do not constrain document/source geometry.
Isolated scripts run the same core inspection in their existing worker after reading strict asset metadata through the existing host service. Asset calls recheck current grants. No browser-font evidence enters the sandbox. Node REST uses its own terminable metadata worker, expected revision and the existing shared four-worker budget; it does not synchronize with a browser. Reports and inspection policies are not persisted in the document model. Declared alignment inspection does not change document schema 47, native project container 5 or workspace snapshot 2. UI report download and target navigation are explicit; neither analysis nor report generation mutates history or source assets. Rendered visibility, bleed/print quality, contrast/legibility and inferred design advice remain outside this delivered scope.
core/preflight-view.ts creates private compact worker metadata, excluding document selections/channels, masks, effects/LUT tables, ordinary raster erasures and clone pixels. Active wet-replacement extents retain only geometry and asset-reference metadata. Vector/brush geometry is included when bounds checks are enabled or when a declared alignment needs that target, key or group descendant. This avoids serializing unrelated large editor data on the UI thread and never becomes a render tree or public mutation API.
Hierarchical vector SVG extraction (2026-10-16)
core/svg-path.ts owns the pure, full-precision SVG path formatter and literal-color encoder, re-exported by core/shapes.ts for existing callers. core/svg-export.ts recursively emits the vector/group tree with native local matrices, sibling order, ancestor visibility, isolated layer/group opacity and fill opacity, and CSS mix-blend-mode. Isolation mirrors the native compositor's separate layer surfaces; see the SVG rendering model and compositing/isolation rules. Generated XML-safe group IDs carry escaped authored identifiers in data-layer-id; XML 1.0-invalid characters reject the format operation, without changing the model. Numbers retain round-trip JavaScript precision rather than rounding to hundredths.
The synchronous VectorLayer.toSvg wrapper extracts only that layer in its immediate parent plane. Host export consumes the same generator into Blob parts, yields after at most 16 fragments or an observed eight-ms interval (path-command fragments contain at most 256 commands), checks cancellation at boundaries and reports indeterminate encoding progress. These are cooperative scheduling checks, not hard per-task latency or heap guarantees: individual numeric formatting/Blob construction and UI preview preparation still have costs. SVG host export/reporting pin the existing deeply immutable document snapshot before yielding, avoiding a full structured clone of paths and unrelated raster/effect data; later edits replace model nodes and cannot change the captured output. Other format snapshot paths are unchanged. There is no full-canvas raster allocation, image-resolution cap, document mutation or history entry.
Capability reporting distinguishes editable vector masks from rasterized native mask coverage, native adjustment/Blend If backdrop prefixes and saved-channel omissions. Later supported content remains independently editable; CSS-supporting viewers preserve remaining hierarchy blending. This is a repaired extraction subset, not complete SVG import/export or universal renderer parity. Native Canvas and SVG antialiasing may differ on transformed edges. REST rendering remains separate and is not added by this change.
SVG mask coverage (2026-10-16, F02/F07/F11 partial)
core/svg-masks.ts plans masks only for visible extracted artwork. Unfeathered vector masks without corrective strokes serialize as compound paths with explicit fill rule. Density and inversion operate on alpha independently of color: normal coverage adds a transparent white baseline; inverted coverage uses a bounded feComponentTransfer alpha function. Mask units/content units are explicit user-space coordinates and regions cover the export canvas in each referencing layer's local plane. Full world inverses rebase unlinked coverage without changing the document. See SVG mask coordinate systems and alpha component transfer.
engine/svg-masks.ts prepares all other masks through the existing native renderMaskCoverage service, including sampled/bitmap/painted coverage, correction strokes, linked/unlinked bases and finite-support WASM feathering. engine/masks.ts shares final inversion/density compositing with the native renderer. At most one 1024×1024 coverage tile plus existing feather/stroke working buffers is rendered/encoded at a time; canvases release in finally blocks. Encoded PNG tiles retain only white RGB and coverage alpha. The SVG serializer emits tiled image references under the inverse layer-world matrix, maintaining the vector/group hierarchy and editable artwork. It retains compressed/base64 output; browser image decoding and output size still have memory costs. It does not create a document-size canvas/RGBA plane or change import/source geometry.
Preparation pins bitmap asset identities and repository lifetime, checks them and cancellation around each await/tile, and reports rendering fractions before indeterminate vector encoding. Missing sources, replacement/removal, disposal or cancellation reject without partial download/model mutation. Individual mask jobs/native PNG encoding are cooperative rather than preemptible. The renderer interface optionally exposes its existing mask-coverage service; custom renderers without it reject native-mask SVG requests while pure vector masks remain independent. Standalone VectorLayer.toSvg remains synchronous: it handles pure vector masks, rebases attached unlinked masks into the immediate parent plane, and rejects active masks requiring native preparation. Scripts gain neither asset bytes nor a host download capability. Editable raster-mask geometry, Native-rendered adjustment/backdrop editability, viewer fidelity and wider interchange gates remain open.
SVG overlays and shadows (2026-10-16, F07/F11 partial)
core/svg-styles.ts plans effects for extracted visible vector/raster/text/paint/group artwork and emits editable SVG filter graphs with explicit user-space primitive regions and encoded-sRGB interpolation. The graph colors masked SourceAlpha before Gaussian blur and document-space offset; shadow opacity applies to that result. A color matrix overlays the original masked content, applies fill opacity, then merges content over the shadow. Existing outer layer opacity/blend/isolation apply to the combined result, preserving shadow-only output at zero fill. Native Blend If appearance is retained through reported backdrop-prefix rendering. See the SVG filter model and primitives for the underlying format operations; current code/browser fixtures define this implementation's supported contract.
Nested local matrices remain in the SVG hierarchy. A filter wrapper cancels the full world transform and an inner wrapper restores it for source content, putting effect operations in document-pixel coordinates even under rotation, reflection, nonuniform scale and shear. Transparent support geometry gives parent filter inputs the complete child-effect extent; without it, this Chromium clipped child shadows to bare artwork bounds even with explicit primitive regions. These invisible rectangles can enlarge downstream SVG group selection bounds, but original paths/geometry and model state remain unchanged.
Conservative support sums native shadow halos along each visible ancestor chain (three blur radii plus offsets and the native two-pixel guard). SVG filter regions and mask regions use the expanded root plane. Native PNG mask preparation also covers that region, including negative/out-of-canvas coordinates, in the same bounded per-tile workflow; otherwise masked off-canvas casters could not cast an in-canvas shadow. Output clipping still uses the original document canvas. No full-canvas host rasterization, asset downsampling, geometry cap, public mutation/schema, script privilege or REST renderer is introduced.
Native Canvas and SVG use different intermediate quantization/antialiasing, especially through nested mask/opacity/filter chains. Fixture-specific pixel tolerances and independent geometry/color checks are recorded in the roadmap/evidence; no universal byte identity or large-viewer working-memory claim is made. Viewers can rasterize filters internally and have allocation/precision limits. Raster-mask editability/scaling, editable adjustment/Blend If graphs, general SVG import and wider interchange gates remain incomplete.
SVG raster images (2026-10-16, F07/F11 partial)
core/svg-images.ts plans visible raster placements and emits validated embedded PNG definitions; repeated unmodified sources share a definition. This is a private read-only rendering payload, not a public mutation DTO. engine/svg-images.ts reuses native streamed PNG export over the complete decoded source plane, stripping source-file metadata while preserving source resolution/original Blob bytes. <use> references retain authored size and full affine hierarchy. Complete decoded source pixels, including masked/off-canvas content, remain embedded and are disclosed before delivery.
Tone/erasures execute after native sampling, so modified rasters instead render neutralized raw content in document coordinates over the expanded shadow support. Only tone/erasure operations are baked. An inverse-world wrapper places that PNG back under the existing hierarchy; masks, styles, fill/layer opacity and blending remain separate. Processed images lose off-support pixels and resolution-independent tone/erasure editing; reports identify both. Image generation uses bounded native strips/tiles, without a document-sized host RGBA/canvas allocation. Encoded PNG/base64, original decoded assets and viewer decoding still consume memory.
One dependency capture pins image and bitmap-mask asset objects, bitmaps, original Blobs, native dimensions and repository lifetime before the first progress callback. Guards run around asynchronous preparation, between image/mask phases and after SVG encoding; stale/missing/disposed sources or cancellation reject without partial output. Rendering surfaces release on failure as well as success. Image/native-mask progress aggregates before indeterminate string encoding. No public constructor, shared command, schema, source mutation, isolated-script/plugin privilege or REST render route changes. Editable adjustment/Blend If graphs, general SVG import and wider interchange remain open.
Editable SVG text (2026-10-16, F08/F11 partial)
core/svg-text.ts plans visible nonempty text and emits escaped editable lines with explicit baseline positions, typography, literal color, whitespace, physical alignment and direction. Private SvgTextLayouts are measured read-only export data. Format semantics follow SVG text; baseline observations use native Canvas TextMetrics. engine/svg-text.ts measures native top/alphabetic ascent differences per line using one 1×1 canvas and normalizes accepted browser colors. Invalid font/color assignments are detected using distinct setter sentinels; unsupported baseline measurement rejects rather than guessing. Tabs/CR/form feed normalize to individual spaces like native Canvas text. Existing affine hierarchy, masks, styles, fill/layer/group opacity and CSS blending apply to text without rasterizing glyphs.
Preparation yields between at most sixteen measured lines or an observed eight-ms interval, checks cancellation and releases the measurement canvas in finally. Individual native metrics calls remain non-preemptible. Registered faces belonging to referenced family lists are pinned by identity/status/descriptors through preparation and final SVG encoding; relevant changes or pending required faces reject. Unrelated UI font-family loads do not invalidate output. Font files are not read, uploaded, copied or embedded, so viewers can substitute fonts; transformed glyph hinting also differs between native Canvas and SVG in measured fixtures. Editable text preserves semantic content/placement, not a universal pixel-identity promise. The immutable captured document remains independent of later host edits. No public constructor/mutation/schema, worker privilege, plugin grant or REST render route is introduced.
Smart-object SVG preparation (2026-10-16, F09/F11 partial)
core/svg-smart.ts validates the registry and builds a private export view through the existing resolveSmartDocument, retaining its logical expansion budget and scoped mask/placement rules. An internal SVG option represents generated master-canvas clips as editable rectangular vector masks; normal native renderer callers retain their existing selection clips. Unfiltered masters expand to supported editable layers; filtered instances remain leaves for native image preparation. Shared master identity is intentionally not serialized and is reported as a loss. The shared full-frame raster shortcut now carries source erasures instead of dropping them, fixing native rendering as well as SVG.
The plan collects reachable visible native-filter dependencies (raster sources, clone tiles, patch assets, bitmap ordinary/filter masks and text font settings), excluding unused masters from preparation. engine/svg-images.ts renders filtered raw content through the native master-plane pipeline with neutral outer mask/styles/opacity/blend, then applies the original outer hierarchy in SVG. It retains component definitions only for that native frame, uses a short private render ID and clears irrelevant layer comps. Document-plane rebasing also shifts unlinked filter masks so expanded shadow support cannot move their coverage. Bounded PNG strips/tiles retain compressed output without a document-sized host canvas/RGBA plane.
Native-filter source dependencies are captured together with ordinary SVG sources before progress callbacks, and filtered text fonts share readiness/lifetime checks with editable SVG text. Checks span native rendering, mask preparation and final encoding; cancellation/stale dependencies release current surfaces and publish no partial result. Registered graph validation and existing 4,096-node/64-depth expansion budgets still apply to hidden/filtered logical subgraphs. These are render-work budgets, not import-resolution limits. Source bytes, authored masters, schemas, shared commands/history, plugin isolation and separate REST sessions remain unchanged. Editable adjustment/Blend If graphs, general SVG import, shared SVG symbol/master identity and wider viewer/fidelity/performance gates remain open.
Editable SVG paint (2026-10-16, F06/F11 partial)
core/paint-stamps.ts owns the pure replay grid shared by native Canvas/WGSL preparation and SVG. It clips segment parameter intervals before enumerating the original stamp indices, preserving the existing grid, pressure interpolation, spacing and minimum pressure/flow rules. A visible index beyond safe integer precision rejects explicitly, preventing step++ from ceasing to advance. Geometry/source resolution remains unchanged. GPU stamp uniforms release in finally on replay rejection as well as success, and a later valid frame remains available. engine/drawing.ts retains native Canvas stamping and cooperative replay; the GPU adapter still consumes its visitor.
core/svg-paint.ts plans visible nonempty paint in the captured export view, emitting editable circles/pencil rectangles/fills, radial softness, per-dab flow/pressure and isolated whole-stroke opacity. Reverse-opened eraser groups mask exactly the accumulated paint prefix; later paint remains outside earlier erasers. Alpha-transfer masks invert eraser coverage over conservative output support. This retains editable rendered primitives rather than the original brush command model. Dabs outside inverse-mapped output support are excluded; projects retain complete control points/settings. Dense streams and deeply nested erasers remain subject to viewer complexity/memory limits, and affine/gradient edges can differ from native rasterization.
Clone tiles use collision-free private image keys in core/svg-images.ts, reusing native source-resolution PNG preparation/deduplication/source-lifetime guards while retaining separate editable brush masks and placement. Original compressed bytes/metadata never enter the SVG; complete decoded clone snapshots may contain hidden pixels. Stroke selections similarly use private mask keys. Their native coverage support is the conservative union of transformed selection-region bounds plus two native pixels, intersected with expanded output support; empty clips need no raster tiles. This optimization applies only to noninverted, full-density zero-outside stroke clips. Ordinary layer/group masks retain complete support, including inversion/density/feather/shadow semantics. Native tile progress counts each plan's actual region; cleanup/cancellation/current-source checks span all work.
Paint shares the existing affine hierarchy, layer/group masks, overlay/shadow graphs, fill/layer opacity, CSS blending and unfiltered smart-master expansion. Bounded fragments yield through definitions and artwork encoding. Missing/changed clone dependencies, missing native coverage, invalid literal colors and numeric replay errors return no partial result. No new public mutation/API/schema, history behavior, source-byte change, script/plugin permission or REST renderer is introduced. Editable adjustment/Blend If graphs, general SVG import and complete F06/F11 fidelity/performance gates remain open.
Native SVG backdrop prefixes (2026-10-16, F04/F11 partial)
Pure core/svg-composition.ts runs after validated smart expansion. Each visible isolated sibling list replaces only its prefix through the last visible adjustment/enabled Blend If with an internal raster placeholder keyed by the existing ending-layer ID. Later siblings and parent wrappers remain in the SVG hierarchy. A private read-only map retains original prefix nodes; it is never model/project/command data. The original conservative effect-support rectangle remains shared after baking internal shadow styles. Native-prefix contents lose SVG editability and off-support pixels; the report lists affected stack endings and keeps this distinct from omitted content or editable adjustment filters.
Native image planning marks these placeholders explicitly rather than looking up synthetic asset IDs. Host preparation composes the full parent/output-origin matrix directly into each original sibling root, preserving the isolated backdrop without adding a synthetic layer or consuming an extra logical node/depth budget. Only expanded root-scope unlinked ordinary/filter masks rebase with output support; retained component definitions preserve master coordinates. Prefix frames clear private planning metadata and layer comps, retain the component registry, and reuse streamed native PNG tiles/strips. Remaining SVG images/masks/styles apply independently. Source collection includes visible raster, clone, patch and bitmap-mask dependencies; existing smart native dependency/font capture complements ordinary prefix text capture. Guards span all asynchronous work and encoding, and current surfaces release on failure.
All eleven native adjustment kernels and source/underlying/channel Blend If use native compositor ordering, alpha and precision rules. Hidden/zero-opacity dependencies trigger no prefix. Synchronous standalone VectorLayer.toSvg rejects enabled Blend If rather than claiming native backdrop preparation. Public constructors/commands, source geometry/bytes, history, schemas, isolated privileges and separate REST sessions remain unchanged. Editable adjustment graphs, general SVG import, viewer/device/precision/heap and broader F11 gates remain open.
Native SVG backdrop frame rebasing can quantize transformed source edges differently from the direct PNG working origin; retained SVG master clips and outer mask/filter rasterization add their own edge differences. Pixel residuals remain reported alongside exact interior colors, transformed contour/shadow-support coverage, area and centroid checks. Native PNG remains the flattened reference; editable parent geometry is retained. Source/font guards now also run around each cooperative encoding-progress callback, so a stale callback stops further encoding and returns no file.
Local SVG import (2026-10-16, F07/F11 partial)
core/svg-path-import.ts owns strict contour parsing, quadratic/cubic/arc conversion and SVG affine/viewBox math. The public single-path factory and legacy parseSvgPath helper reuse it, rejecting compound input. core/svg-import.ts is worker-side inert XML admission and OO construction through Document/LayerGroup/VectorLayer/VectorPath/LayerMask/RasterLayer. Its DTOs/Blobs are private worker transport. Pinned xmldom does not enter the main scripting runtime; there is no live SVG markup insertion. XML warnings/errors and executable/dynamic/external content reject before either import mode.
engine/svg-import.worker.ts decodes XML text (including UTF-16 BOMs) and inspects/converts off-thread. engine/svg-import.ts validates the result before asset admission, decodes original embedded image Blobs, resolves intrinsic placement/aspect/crop through normal OO commands and returns a clean baseline. Explicit flatten mode uses only browser image decoding plus the existing native streamed PNG renderer, releasing temporary surfaces/assets before final PNG admission. No source-size cutoff or public DTO mutation path is introduced. Worker termination, abort/progress errors, provisional-store disposal, image/tile cleanup and editor generation/revision/identity/lifetime guards prevent partial publication. EditorApplication.openSvg alone publishes a new tab while retaining prior edited sessions. The imported baseline is revision zero; future edits use existing history. SvgImportDialog owns cancellable preflight and explicit editable/flatten/cancel choices for picker/drop input. Unsupported graphs/styles/type and native editing budgets remain reported limitations, rather than general SVG round-trip claims. Embedded originals retain compressed bytes; original SVG XML/DOM/master identity is not archived.
Native vector stroke styles (2026-10-16, F07/F11 partial)
Pure core/vector-stroke.ts owns five optional stroke-field schemas, typed options, explicit-field copying and legacy resolved defaults. pathSchema, public VectorPath/shape factories, shared path commands, native document validation, scripting and separate REST sessions reuse them. Schema 22 admits the fields; pre-22 labels containing them reject. Root/workspace-history migration changes version labels without injecting defaults or changing source assets. The outer project/workspace formats remain 3/2.
Canvas vector drawing uses native lines for segments whose controls coincide with their endpoints; this preserves authored geometry and avoids cubic path-measure differences for dashed lines. Vector-mask tessellation keeps its existing curve/grid behavior. Every stroked path sets cap/join/miter/dash/offset, resetting prior path state. Shared control-hull bounds include conservative miter and square-cap support; working tile/cache budgets remain independent of source geometry. SVG encoding validates literal style fields, preserves them as stroke attributes, and rejects raw injection. Import resolves inherited SVG butt/miter defaults and absolute-unit dashes separately from native legacy round defaults. Unsupported percentage/calibrated/non-scaling/SVG2-only stroke features retain explicit preflight flatten/cancel.
The existing PathProperties inspector hosts VectorStrokeControls: cap/join selectors, commit-only miter/offset numbers, an independent dash draft with Apply/Enter/Escape and Solid stroke. Each valid change uses one normal command/history entry; invalid drafts do not mutate the document. Scripting examples and runtime verification cover ownership, locks, schema/project/history, affine rendering/culling, SVG round-trip and real software-WebGPU reference upload/cache invalidation. This extends stroke editing without claiming general F07/F11 or cross-device performance completion.
Zero-length explicit segment/close strokes bypass Canvas pruning with one local circle/square cap, evaluated against the dash phase. Move-only contours and butt caps remain empty. Degenerate dash phases use native half-open intervals; positive-pattern closed zero contours remain empty as in the verified browser SVG path. Faint SVG epsilon/edge coverage remains an explicit viewer difference. Actual cubic loops and unused open-end handles are distinguished through segment geometry. Native bounds, affine transforms, masks, layer opacity, SVG output and GPU reference uploads retain the same geometry/settings.
Native vector gradient fills (2026-10-16, F07/F11 partial)
core/vector-gradient.ts owns strict linear/radial paint value schemas and defensive explicit-field copying. Optional nullable fillGradient overrides retained solid fill on closed paths. Shared path schemas/commands, OO constructor/factories/setters, isolated runtime and REST reuse the same contract. Schema 23 admits the field; pre-23 labels reject it outside the frozen validation cache. Valid old roots/history migrate without injecting it; project/workspace containers remain 3/2.
Native Canvas fills the already-traced path while the complete paint transform is active, preserving geometric path placement and local gradient coordinates across tiles. Each path resets its own paint. Existing vector reference uploads/cache signatures retain gradients in GPU composition. core/svg-path.ts emits validated local SVG paint servers with caller-scoped generated IDs, opacity stops and user-space transforms. core/svg-gradient-import.ts converts inert local template references and supported object-box/user-space geometry. Private core/bezier-bounds.ts evaluates actual cubic extrema for object-box coordinates rather than using the conservative render control hull. Unsupported paint graphs remain explicit flatten/cancel preflight.
VectorGradientControls uses native controls for kind, stop color/position/opacity, geometry, affine paint matrix, insertion/removal and reversal; attached edits/undo/locks stay on shared commands. No source-byte mutation, arbitrary import resolution cutoff, new plugin privilege or REST/browser synchronization is introduced.
Native compound paths (schema 24)
core/drawing.ts adds optional fill rule and closed subpath records with unique scoped contour IDs, at most 128 total boundaries and 20,000 total anchors. The refined path schema validates the complete geometry; partial command schemas use its unrefined field shape, and final document validation applies the cross-field invariants. The immutable-anchor validation schema uses safeExtend so refinements remain active. Feature-version gates run outside cached drawing proofs. Migration changes old root/history labels without inserting fields; project 3/workspace 2 and source bytes remain unchanged.
VectorContour and SubpathCollection are owner-backed OO geometry handles. Constructors and getters copy nested values; attached edits replace validated parent subpaths through path.update. Removed handles fail until undo restores their IDs. Duplicates allocate independent contour IDs. The Pen controller previews only the active boundary while retaining parent style/identity; overlays expose all anchors. Renderer culling includes all boundaries, traces once and fills using the shared rule/gradient, then strokes every contour with independent dash starts and degenerate-cap handling. SVG emits one compound d; inert SVG import now builds native contours instead of cover rectangles with masks. Opaque closed fill/stroke paints share the native contour graph; open/translucent paints retain separate layers and a reported geometry-editing limitation so their independent paint alpha composes before element opacity. Mask capture copies all boundaries in the source/target affine planes, preserving a common explicit/compound fill rule and the old implicit even-odd default for legacy simple sources; mixed rules reject. Boolean calculation/worker scheduling and cross-layer operation semantics use the boundary described below.
Asynchronous curve Boolean boundary (F07)
core/vector-boolean.ts owns operation/operand/request/result schemas, capture in the first path's local coordinate plane and final atomic replacement semantics. Trusted capture reads immutable snapshots, validates distinct closed unlocked sources, maps every cubic anchor/handle through complete world transforms, and enforces operation-wide 128-contour/20,000-anchor budgets. Same-layer paths retain their exact local coordinates. External result validation and shared locks/revision checks remain on the host/DOM commit boundary. paths.replace preserves first identity/order/style, removes other operands and only empty operand vector layers. Immutable execution copies affected vector-layer shells and ancestor arrays instead of unrelated document geometry; mutable external inputs retain defensive full copying. Layer selection avoids redundant publication when already on the sole result layer. The Boolean dialog selects the returned native path through trusted ToolController.selectVectorPath, clearing a removed Pen target while retaining ordinary geometry/history boundaries; this prevents Properties from falling back to an unchecked later path.
engine/vector-boolean-kernel.ts is worker-only, pinned Paper.js 0.12.18 core. It centers/uniformly normalizes control-hull coordinates to extent 1024, performs curve Boolean operations without polygon/raster flattening, canonicalizes nonzero contour orientation and restores validated absolute handles. Empty areas produce empty contour lists. Paper.js PathItem operations define the upstream curve operations. Floating point/near-coincident geometry and device precision are actual limits, not symbolic-algebra guarantees. The dependency stays out of the UI and isolated scripting runtime bundles; completed documents contain final native geometry without a live library reference.
A browser module worker or Node worker-thread owns one operation and is terminated on completion/error/cancellation/deadline. The 30-second budget includes worker startup. Progress reports completed pair calculations, not elapsed-time estimates. Browser editor subscriptions abort stale document/session/permission jobs immediately, and tracked controllers abort on editor disposal. Node subscriptions and endpoint disconnect/deletion guards cancel independently. Callback/malformed-message/result errors leave no replacement and release workers/listeners/timers.
Document.combinePaths and VectorLayer.combinePaths await private host preparation outside synchronous transactions and commit validated geometry once after snapshot revision/signal checks. Script calls send staged commands plus operand references, not a live scene or source images; the host validates/replays staged commands then captures geometry from that staged snapshot. Current plugin document-read/write permissions are checked during preparation and final commit. Native preparation remains sequential and shares the existing 32-operation script budget. Separate REST sessions expose a revision-checked endpoint using the existing four-worker native budget. No image-read, network/file privilege or install-time execution is added. Schema 25/project 3/workspace 2, normal history and project persistence retain the final result.
Pen overlay translation and geometry
Long paths divide their React anchor controls into memoized blocks of 64. Editing one anchor recreates controls only in its changed block; unchanged blocks compare their basis, zoom, active anchor and complete point/handle coordinates. Short paths keep the direct rendering path. Each block retains only its own at-most-64 point references, avoiding retention of complete prior path arrays across independent block updates. Blocks introduce no SVG wrappers or geometry reduction: every line, circle and anchor remains in its original drawing order. Length changes, block boundaries, contour selection, affine/zoom changes and the existing translation precision fallback still invalidate the affected controls. This reduces reconciliation work without changing model hit testing, staged previews or the shared final command/undo boundary.
For precision-safe frames, CanvasOverlays applies the selected artwork or mask plane's translation once on the shared SVG Pen-controls group. In that path, memoized controls consume the affine linear basis, geometry, zoom and selection/outline state, with zero absolute offsets. A layer or linked-mask translation therefore updates one SVG transform instead of rewriting every anchor, handle and mask-outline coordinate. Basis changes and point/handle/contour edits still update their complete geometry. Handle radii, anchor dimensions and stroke widths remain screen-sized: only translation is delegated to the group, while the linear basis remains baked into document-plane control coordinates. Mutable preview arrays retain structural comparison; immutable snapshot identity permits the fast comparison. The SVG remains aria-hidden and pointer-transparent, and model-based hit testing/shared preview/history commands remain authoritative. No geometry is culled, clustered or dropped.
scripts/benchmark-vector-input.mjs imports constructor-built native projects and follows a distinct vector point through Canvas copies into the connected viewport. Pen runs additionally require the displayed anchor center at the matching document position. The external harness records all observed task intervals, overlap-filtered long tasks, a real native positive control, per-key/round timings and exact undo. Its optional three rounds revisit cached positions across 60 keyboard edits. It requires the actually displayed Canvas2D backend; hardware WebGPU/display, initial large-handle construction, sustained use and complete F14 acceptance remain separate gates.
Pen translation shares the SVG group only when its conservative float-precision error bound stays below 1/1024 of a CSS pixel (max(abs(e),abs(f)) * zoom * 2^-23). Otherwise controls retain the earlier JavaScript-computed absolute coordinates and a zero group translation. This preserves cancellation between large local coordinates and opposing translation; it neither rejects geometry nor caps document coordinates/zoom. Crossing the precision boundary refreshes geometry and group placement atomically. The native browser test includes 1e10 local coordinates and a zoom-driven boundary transition.
Paragraph text layout
core/text-layout.ts owns pure visual-line layout from authored text, width, paragraph gap, logical first indent and a host measurement callback. The pinned MIT linebreak 1.1.0 supplies Unicode-13 opportunities; native Intl.Segmenter filters positions to complete graphemes. With nonnegative tracking/word spacing, measured legal-token advances locate candidate lines; complete native line measurement verifies each emitted candidate and backtracks through legal opportunities when necessary. Negative spacing keeps the fully measured greedy path. A nearly full-width paragraph first tries one whole shaped line. Point rendering with existing authored bounds does not repeat intrinsic measurement. A bounded invocation-local 32768-character width memo avoids unbounded retained candidate strings; this is working-cache policy, not a source-image limit. The model preserves complete source text and optional paragraph properties; it does not serialize derived visual lines or font files. Model measurement, Canvas glyph/ink bounds and SVG preparation share layout; native drawing remains one call per whole visual line. Point defaults retain existing line-height arithmetic. Native measurement varies with fonts; headless fallback stays approximate and browser Reflow updates logical height. Unbreakable runs remain visible outside the authored frame, with ink-aware rendering/caching. New paragraph fields require schema 26, old roots/history migrate without injected fields, and wrapped bounds retain the exact authored width. All attached mutations remain shared commands/undo; isolated execution and separate REST sessions keep their existing boundaries. SVG preparation retains line text/x/y independently of authored paragraphs, pins fonts and releases its existing hidden boundary probe; export reports lost reflow identity and native/SVG glyph-spacing limits.
Native inter-word paragraph justification
Schema-27 optional paragraphJustify is an authored enum on TextLayer. Shared pure layout keeps base wrapping, measures the whole line response to a one-pixel native word-spacing increment, then verifies/corrects derived spacing for soft lines only. Private visual-line wordSpacing never rewrites public text or authored wordSpacing. The bounded invocation-local measurement memo keys derived spacing too. Canvas drawing/ink caches and GPU native textures use complete per-line native state; SVG preparation carries validated finite per-line spacing and keys boundary probes by line and derived spacing. Fitting prefers a native advance within the exact authored frame, with a documented 1/64-pixel per-response-unit rounding allowance and bounded lower-root probe for plateaus. NativeJustificationError propagates from native measurement instead of silently substituting headless estimates. Final/forced/overflow/no-gap lines keep base state. Point defaults and source/image allocation boundaries remain intact. Missing native wordSpacing rejects nondefault justification; Reset paragraph restores none atomically. See SCRIPTING_API.md for separator and precision policy. Full paragraph/language/interchange/device gates remain open.
Native TIFF export boundary
core/tiff.ts owns pure classic/BigTIFF layout and exact address validation. engine/tiff.ts compresses native RGBA8 tiles into Blob parts, then appends the sorted directory and embedded output sRGB profile. engine/raster-export-grid.ts supplies the same native sampling grid to PNG and TIFF; TIFF crops canonical rendered frames into format-compliant padded tiles only after native rendering. This avoids frame-origin rounding differences without changing source or document geometry. No whole-document export canvas or RGBA array is allocated. Compressed output, tables/directory and resident decoded sources still consume output/source-dependent memory.
raster-export-source.ts captures visible source/clone/patch/bitmap-mask/reachable-master dependencies before callbacks. Shared export-fonts.ts pins referenced registered family identities/status/descriptors for SVG and TIFF. TIFF additionally rejects pending referenced fonts. Immutable document snapshots, source lifetime checks, abort/progress checks and finally-based canvas release span all native rendering/compression/encoding. Later host commands retain normal undo behavior; they cannot alter the captured output. OS font resources outside FontFaceSet cannot be pinned.
The existing trusted export/UI boundary exposes tiffVariant auto/classic/big, with flattening, 72 DPI and compatibility disclosures. Output is single-image, lossless RGBA8 sRGB TIFF, not editable TIFF/CMYK/HDR/multipage or TIFF input. Neither isolated scripts/plugins nor independent headless REST sessions gain a file/export service. Model 27/project 3/workspace 2 and command/history contracts remain unchanged.
PSB output and source-independent Photoshop staging
core/interchange/psd/export-plan.ts shares rendered dependency planning across PSD/PSB, with explicit per-format geometry bounds. length.ts serializes exact four/eight-byte lengths; PSB extends channel, layer-info and layer/mask lengths, while resource/extra lengths stay four bytes. engine/psd.ts writes versioned headers and four-byte PSB RLE row counts for both layer and merged planes. PSB uses PNG's canonical bounded native strip/tile sampling grid; compressed Blob planes and row tables remain output-dependent memory. The existing low-level builder remains PSD v1.
Shared raster dependency capture accepts the actual planned documents before callbacks, so retained hidden/opacity-zero top-level Photoshop planes also pin their sources/fonts. Flattening pins only visible rendered dependencies. The captured immutable document remains read-only even if later host edits occur. Existing callback/cancel/source/font validation and surface release apply throughout.
openPsd validates PSB header/length addressing and uses version-specific RLE tables. Decoded planes are staged through PngRowEncoder chunks into a private AssetStore without a source-sized canvas. I/O generation, owner/revision/session and source lifetime guard asynchronous publication; stale work disposes private bitmaps. The parser still reads complete input and materializes planes synchronously. PNG layer sources persist, not the complete original Photoshop container. No document/project/workspace schema, new dependency, isolated host privilege, REST/browser synchronization or public OO mutation bypass is introduced. The scripting guide defines signatures, defaults, supported RGB8 fidelity and current memory/reader limits.
Private Photoshop encoding worker
PSD/PSB keep native rendering and snapshot/source/font validation on the host. PhotoshopEncoder owns one lazy module worker per export; only a fresh, bounded captured RGBA strip transfers to it. Original asset bitmaps/Blob bytes never transfer. photoshop-strip.ts deinterleaves channels, applies the existing merged-preview white matte and PackBits-encodes rows into reused private scratch. One owned Blob per channel/strip replaces per-row allocations/Blob parts. The host validates request identity, channel count, typed row tables, positive bounded lengths and exact Blob extents before using results, then rechecks captured sources/fonts. Worker replies provide task boundaries without a clamped timer after every strip. Rendering uses the same native sampling grid; output semantics and bytes remain unchanged.
Abort terminates pending private encoding, while native canvas calls remain non-preemptible. Success, worker error/messageerror, invalid results, source/font failure and callback exceptions all terminate the worker and release native surfaces. Use addEventListener for worker messageerror because the Chromium handler property is unavailable in the measured build. No source-sized allocation, public mutation/command/schema, shared pixel-worker queue, dependency, isolated extension privilege or REST/browser synchronization is introduced. Scratch/output/source/reader memory remains data dependent; this is not whole-process peak-memory or complete F14 acceptance.
Photoshop input worker and private publication
core/photoshop-import.ts defines source/control/strict inspection DTO contracts. engine/photoshop-import.worker.ts owns full-file parsing, decoded plane work and PNG row encoding. Inspection returns only header/layer/report metadata, discarding worker planes when terminated; import returns validated document data, PNG Blobs and transferred newly decoded RGBA buffers for the existing ImageData-map result. engine/photoshop-import.ts validates metadata, document schemas, referenced source sets, geometry and pixel/Blob shapes, with abort/error/messageerror cleanup. Source Blob/File bytes remain immutable; legacy buffers are snapshotted rather than detached. This retains whole-input/plane/native decode/output memory, not metadata-only parsing or process peak-memory guarantees.
EditorApplication tracks active Photoshop jobs for disposal and import commits for revision/session/tab guards. Per-owner subscriptions abort stale work. Private AssetStore decoding and exact dimensions precede OO Document publication; failures close staged bitmaps. The publishing operation removes its own cancellation registration before activating the new document. Inspection remains independent of document edits. PhotoshopImportDialog owns file-request cancellation/retry, while the existing preflight view receives metadata only, pages records/messages and keeps Cancel active. Report text identifies current ICC/mask/CMYK/group limitations rather than claiming full fidelity. Public constructors/commands/history, document 27/project 3/workspace 2 and isolated/REST boundaries remain unchanged.
Photoshop Raw/RLE validates 8-bit payload/row extents and complete PackBits output; ByteReader rejects negative/fractional byte addressing. Channel mask geometry determines its row shape. Grayscale composite/layer samples expand to neutral RGB, with mode-specific alpha positions. One internal generator owns binary parsing and yields ZIP channel requests. The synchronous driver resumes without decoded ZIP planes and preserves explicit unsupported-codec fallback; parsePsdAsync awaits native zlib Deflate and reverses 8-bit per-row prediction before resuming the same parser. psdToDocumentAsync shares bridge conversion, and import/inspection workers use these async drivers. ZIP output must exactly match declared channel geometry, including the merged planar channels; corrupt/checksum-invalid/truncated/excess streams reject. A per-operation worker remains terminable during native inflation or prediction. Higher-precision ZIP remains explicitly unsupported, and color management/full per-pixel mask/group reconstruction remain prototype limits. Full input/plane allocations remain data dependent; this is not streamed-file or metadata-only parsing.
Photoshop native raster-mask conversion
The parser retains basic user-mask bounds, coordinate/default/inversion/disabled flags and user density/feather parameters. Mask channels decode using mask geometry, not artwork geometry. Invalid bounds/defaults/truncated fields reject. psdMaskIssue shares supported-mask policy between reports and the bridge: non-raster/non-group masks, nonzero Photoshop feather, rendered/extended/combined semantics and higher precision keep the layered path unavailable unless masks are explicitly omitted. Standalone vmsk/vsms tags also mark vector-mask semantics unsupported, even when no basic user-mask record exists. No rectangular surrogate is created.
Private bridge conversion normalizes owned decoded mask pixels in place into white RGB plus coverage alpha, installs an independent bitmap-mask source and references it in the existing native model. White backgrounds use complemented alpha plus inversion to preserve infinite outside coverage without a padded document-sized bitmap. Coordinate bit 0 maps to the linked local plane; absolute positions map to unlinked document space. Disabled state, inversion effect and density are retained; zero-area masks use constant paint coverage. Existing worker source-set/PNG/host lifetime checks and AssetStore/project/workspace ownership apply to both sources. Pixel mask import uses schema 27/project 3/workspace 2 and shared OO editing/undo; complete Photoshop linkage/vector/feather/color/precision/container retention and memory/device acceptance remain separate gates.
Photoshop hierarchy and native pass-through composition — introduced in schema 28
core/interchange/psd/groups.ts reconstructs bottom-to-top section-divider records with a checked stack, enforces native 64-node/depth-8 editing budgets, and rejects malformed hierarchy. The parser reads group section blend keys, protection and unsupported effects/fill/Blend If/clipping indicators. Capability inspection disables editable import for these unsupported semantics rather than silently normalizing appearance. The bridge recursively constructs native groups/rasters, rebases document-space child origins into parent coordinates and retains independent image/group-mask PNG sources. Partial protection, including the independent transparency-lock flag, becomes a conservative full native lock with a warning. Original Photoshop container/ICC bytes, folder expansion and full Photoshop semantics remain outside this import subset.
Schema 28 adds LayerBlendMode/GROUP_BLEND_MODES; ordinary BLEND_MODES remains unchanged for raster/brush/style algorithms. Native validation admits pass-through only on groups, with full fill opacity and disabled own overlay/shadow/Blend If. Legacy normal groups remain isolated after migration. Shared OO commands and REST validation use this same invariant. CanvasRenderer paints pass-through children against the true target backdrop. Optional opacity/mask coverage mixes before/after surfaces once using premultiplied destination-out/in plus additive composition. All temporary surfaces release in finally and cancellation checks precede publication. Backdrop-dependent tonal/patch prefix caches are disabled in that external-backdrop scope; ordinary isolated scopes retain their caches. WebGPU capability rejects visible pass-through groups and the adaptive renderer uses complete Canvas/WASM fallback.
Photoshop host export retains supported nested folder and separate pixel-mask records, recursively merging only unsupported backdrop dependencies in their true isolation scope; SVG still prepares a native prefix through pass-through groups. Direct helpers without native preparation reject richer content. Exported mask controls/linkage/off-canvas coverage, non-Normal pixel fill and styled-group internals bake; group fill folds into opacity. Document 28/project 3/workspace 2, source ownership, isolated privileges and separate REST sessions remain unchanged. See SCRIPTING_API.md for defaults, signatures, own-style restrictions, source retention and exact hierarchy/mask limits.
Schema-29 authored pressure response
core/pressure-curve.ts validates monotonic normalized knots and evaluates piecewise linear response. Immutable public PressureCurve values feed optional brush metadata through existing constructors/commands; no recorded sample is replaced by its mapped output. Default/absent curves preserve existing size/alpha floors. Explicit curves permit zero, and native/SVG/GPU paths skip empty dabs before pencil rounding or allocation-sensitive stamp work. Bounds and spacing share the same mapping; finite replay grids and subpixel GPU fallback remain required. Model validation enforces field age on paint, masks/filter masks, raster erasures, tonal brushes and embedded masters, including history restoration. Valid legacy roots migrate to 29; project 3/workspace 2 stay unchanged.
Tool settings validate/copy a curve before changing state; a changed curve cancels an active gesture. The custom dialog edits only a local draft until Apply. App modal state preserves shortcut isolation and focus. Explicit curves retain finite zero/low browser pen pressure before existing smoothing; legacy normalization and mouse behavior stay unchanged. The isolated runtime registers only the pure constructor; existing host validation/grants/undo remain authoritative. See SCRIPTING_API.md for exact defaults, aliases, null-versus-DTO behavior, zero/spacing semantics, examples and limits. Physical tablet, richer dynamics and sustained/device F06/F14 acceptance remain open.
Saved brush preference library
brushes/presets.ts owns immutable strict BrushPreset values, curated defaults and data-only portable packs. brushes/library.ts owns local IndexedDB transactions, record revisions, all-or-nothing imports, validated reloads and backup-checked recovery reset. EditorApplication owns/disposes the library; ToolController.applyBrushPreset validates before cancelling and configuring future gestures. The custom dialog selects tools through the normal UI path, preserving per-tool size memory and document paint targets. Preset state is outside document history; authored strokes still capture complete ordinary command data. Broadcast messages are reload hints, never data. No document/project/workspace version or isolated/REST privilege changes. See BRUSH_PRESETS.md for signatures, bounds, conflicts, recovery and limits.
Authored brush tips and spherical pen tilt
core/brush-tip.ts owns strict tip/point schemas, pen sensor projection, inverse-linear orientation mapping and shortest-arc interpolation. core/paint-stamps.ts shares ellipse/rotated-pencil geometry and support/spacing across Canvas, SVG, WGSL and tool previews. Absent tips preserve the legacy native branch. Explicit zero response is skipped before pencil minimum-size rounding. Tiny/precision-sensitive GPU tips use whole-composition Canvas fallback. Cursor axes reuse the active or prospective stroke plane without commands, history or React pointer updates. Healing overlays show shaped endpoint support plus a centerline instead of claiming circular coverage.
Schema 30 admits authored tip and spherical point metadata; every brush-bearing context and embedded master checks field age outside immutable validation proofs. Valid old roots and retained history migrate without inserted tip fields; project 3/workspace 2 remain unchanged. Immutable BrushTip values participate in existing OO constructors, tonal options, script whitelist, strict REST DTOs, locks, transactions and undo. Preset/pack version 2 carries tips while legacy version 1 keeps default shape. No device verification, new script privilege, REST/browser synchronization or source-image cap is implied. See SCRIPTING_API.md for exact geometry, units, defaults, boundaries and errors.
Self-contained affine brush symmetry
core/brush-symmetry.ts validates 1–31 nonidentity distinct invertible affine copies, with implicit original ink and registry-proven immutable matrix caching. Public BrushSymmetry factories create mirror/radial values; conjugation maps document-space tool preferences to layer, mask or smart-master stroke planes without replacing recorded points. Schema 31 checks all brush contexts/embedded masters/history outside cached drawing proofs; project 3/workspace 2 remain. Preset/pack 3 retains symmetry; legacy presets reset it. Runtime constructor whitelisting adds no host privilege.
The shared stamp iterator maps each copy's viewport to the original plane, merges clipped native stamp-index ranges and emits original-first/copy-array order at each dab. Full footprint bases include tip rotation/roundness/tilt and pencil pixel anchoring. Canvas/SVG consume these bases; WGSL instances carry nine floats (center, radii, alpha, full 2x2 basis), with float32 invertibility/minimum-coverage gates and complete Canvas fallback. Bounds, culling and clone source capture include every copy. Captured selection and whole-stroke opacity apply once after accumulated copy flow. Active prefix replay retains identical per-dab order. Clone samples its captured destination-relative source field for each footprint; symmetry does not mirror the source image itself. Healing/tonal coverage uses the same brush metadata and retains existing working-buffer/device limits.
The custom local-draft dialog exposes supported factory modes and preserves arbitrary valid copy data. Guides memoize settings interpretation. Hover cursors read immutable mask/master geometry and update retained SVG copy groups imperatively in a viewport-sized SVG, avoiding a document-sized cursor buffer or React updates per pointer. No source/image cap, paid call, new dependency, plugin permission or REST/browser synchronization is introduced. Full F06/F14 and physical hardware acceptance remain separate gates.
Explicit texture source ownership — internal integration in progress
AssetStore.shareTo is an explicit shared-bitmap lifetime boundary. Each owner has a separate immutable asset record and copied TIFF decode choices while retaining the exact original Blob/bitmap. Per-store lease maps count live references; removing/disposal releases only that store's reference and the final release closes the bitmap. A WeakSet marks shared records so ordinary transfer/adoption cannot accidentally bypass the lease. Default sharing creates a fresh ID; explicit collisions, pending IDs, stale native geometry and disposed stores reject. Source IDs being imported are not yet shareable. Native geometry is independent of these metadata/lifetime constraints, and no worker/resample/thumbnail replaces the source. Existing unshared install adoption remains compatible. Disposed stores are terminal; cleanup still releases image ownership if metadata teardown fails.
brushes/texture-source.ts owns one retained texture source independently of document history. It can capture a ready source synchronously, privately decode a replacement with original TIFF choices, or ensure a collision-safe document lease synchronously. A weak per-target mapping reuses a still-owned record; ID reuse/source replacement invalidates it without overwriting foreign artwork. Invalid captures and failed imports retain current source state. Generation, abort and source-owner disposal guard pending decode publication, with old staging released without clearing a newer source. Clearing/replacing the owner cannot close textures retained by documents. ToolSettings stores only channel/inversion or null, never a portable document asset ID. The draft-based source dialog and pointer tools now use this owner; original-source portable presets are now connected and in verification. No model/project/workspace version or isolated privilege changes.
Read-only image views for isolated script repair and matting previews now take explicit leases rather than adopting borrowed source records. Script preparation shares promoted output into the document before disposing its private view; failures release staged/view references without closing live document sources. Matting preview owns/disposes both original-source leases and its private proxy bitmaps on success and validation/cancellation failure. These changes preserve existing isolated permissions and do not expose source pixels or host asset services. Recapturing an identical original source preserves the preference and existing per-document IDs instead of retaining redundant references.
Texture tool controls and gesture capture — 2026-10-18
The custom BrushTextureDialog owns a private source draft until Apply. Owner-to-owner capture shares originals without inserting an unused document asset; Cancel, failed decode and late completion preserve the active preference. TIFF file selection inspects native pages and requires explicit precision-loss consent before decoding. Document sources retain their original TIFF choices. Coverage previews use the native worker through a private leased view, at 128 by 128 pixels only. Cursor image transforms follow the existing brush plane, tip/tilt and symmetry bases, with no React pointer updates; they show coverage proxies, not pressure/hardness/flow predictions.
ToolController captures a collision-safe document reference at the start of each brush, pencil, eraser, clone, dodge, burn, healing or painted-mask/filter-mask gesture. The captured DTO survives later preference changes. Cancellation/failure releases a newly created lease only if its exact record remains installed and current/past/future document snapshots do not reference it. Healing also releases its transient source after the native repair settles. Existing retained references survive undo/redo and project/workspace persistence. Combined dynamic preferences validate before cancelling a live gesture. Metadata-only BrushPreset capture explicitly rejects enabled texture, and legacy preset application resets texture to null. Source-bearing presets remain the next required slice; this is not complete F06/F14 acceptance.
Texture gesture continuation, queued previews and final commit also validate the captured store/record/bitmap identity. Removing or replacing the asset under the same ID cancels/rejects the stale gesture without document/history edits or deletion of the foreign replacement. This guard supplements document revision checks; asset IDs alone are not an ownership proof.
Source-bearing brush presets — 2026-10-18, in verification
Preset/pack v4 carries image-backed coverage preferences and exact original Blob sources with native dimensions, MIME/name, SHA-256 and TIFF page/precision choices. Source-free JSON versions 1–3 remain readable/exportable. Binary packs use a checksummed 48-byte header, strict manifest and contiguous original-blob slices; readers reject missing/unused references, corrupted extents/checksums and native decode/dimension mismatches before any import commit. Portable source IDs are remapped and cannot bind to document asset IDs. The single existing IndexedDB v1 preset store now atomically stores optional source blobs alongside their preset; no physical schema migration is needed. Older strict readers reject these newer records while preserving bytes.
The library verifies actual stored source contents before writes and retains last-valid snapshots on failures. Read-only keepalive requests maintain the native write lock across asynchronous checks; only active request callbacks queue changes. Recovery v2 preserves raw records and original blobs, including invalid preset metadata, and compares complete content fingerprints under that lock before reset. Same-size byte changes and stale revisions cannot be erased with an old backup. Legacy JSON recovery remains available for source-free records; unsupported raw non-JSON values still fail without deleting data.
The custom preset dialog connects source-aware save/update/rename/duplicate/delete/import/export/download/recovery and shows source name/dimensions/coverage. Applying privately verifies/decodes an original, guards abort/supersession/document/tool/source changes, then uses normal tool selection/configuration; errors retain prior ready preferences and newer human edits. Preferences stay outside document undo; actual strokes still use shared OO commands/history and collision-safe document leases. Original images stay independent of viewport/cursor proxies, library deletion and closed source documents. This adds no isolated script/plugin file privilege, paid provider, upload, REST/browser sync or document schema bump. See BRUSH_PRESETS.md for signatures, binary contract, errors and limits. Complete native/production verification and wider F06/F14/device gates remain open.
Bounded texture batches and partial readback
BrushTextureSampler.prepareAffineBatch validates and owns up to 64 affine samples with at most 1,000,000 total full-projection pixels. It batches actual WASM channel conversion while preserving individual native rasterization. Its optional fifth argument supplies one integer, positive, in-bounds readback rectangle per sample. These rectangles reduce captured/transferred bytes only: each original bitmap still projects onto the unchanged full canvas before readback. A bounded private canvas pool is reused synchronously after each owned ImageData capture and released before worker waits. Cache keys include complete projection settings and the readback rectangle. Caller outputs stay independent; any failed conversion releases every unpublished output. Original image dimensions and bytes are not constrained by these working budgets.
Raw texture replay may omit unchanged pixels only under the proven full-flow, binary-RGB source-over certificate. Accepted full-pressure inputs remain eligible even with pressure opacity enabled; fractional flow, changing pressure and non-binary pigments use full replay. Conservative alpha bounds and non-opaque rectangles remain valid as raw alpha increases. Readback intersects that rectangle with the existing dab support, while exact integer pencil mattes may use the smaller rectangle directly. Prepared alpha ceilings are captured from owned converted bytes. Saturated fast paths still share cooperative cancellation checkpoints and private-prefix publication; the complete accepted sample sequence stays in the model. Arbitrarily extreme native bitmap transforms can still lose visible samples in the browser rasterizer; this known limitation is not a geometry/import cap or a completed fidelity claim.
Canonical integer-native frequency compositions recognized by frequencyIdentitySource may use 512-pixel composition cores. Eligibility includes the inner Gaussian sampling halo in the existing 4 MP/8192-edge working budget. Affine/fractional placements, altered compositions and unsafe halos retain the established 256-pixel grid. Exact-pixel equivalence and responsive export remain distinct verification gates.
Literal native raster frequency-band sampling
nativeFrequencyRasterSource recognizes a single full-frame raster at native bitmap dimensions, with neutral placement/opacity/blending and no source mask, effects or erasures. This is an internal read-only eligibility query. An integer unit-native frequency-band instance over that source, without a filter mask, may use a 1024-pixel sampling core to absorb composition overscan. Both1024 and512 preferences include the actual Gaussian halo plus four overscan pixels in the existing4MP/8192-edge working budget; unsafe halos retain the established512/256 fallbacks. Source appearance, multiple/non-raster children, resampling, affine/fractional instance placement and filter masks retain their current sampling grid. Canonical composition cores remain512. No public model/API/schema, original-source or history/isolation change is introduced. This reduces sampling requests; it does not imply instant full-frame export or complete F14 performance.
Complete native footprints and canonical Canvas cells
engine/native-canvas-grid.ts retains complete projected raster/bitmap-mask/vector footprints when their document-anchored working rectangle, including gutters, fits the existing4MP/8192-edge budget. Larger footprints use full256-pixel native cells with two-pixel gutters. Requests copy their visible portions after rasterization; an export strip does not retessellate a curve or refilter a clipped image quad. Raster drawing preserves its five-argument image geometry. Exact integer native raster/bitmap placement keeps its original fast path, and extreme bitmap coordinates retain the bounded double-precision sampler. Native image smoothing preferences follow the caller. Working vector footprints follow resolved join geometry when it is well-conditioned; otherwise they keep the previous conservative hull. Authored miter limits and public geometry queries are untouched. Only temporary allocation bounds are selected; original geometry, dimensions and blobs remain unchanged.
Resampled smart instances prepare complete document-aligned output cells and project their sampled images through canonical cells as well. Cumulative spatial-filter halos, overscan and rounding remain inside the established4MP native allocation check; unsafe large cells reduce their preferred core before allocation. Native frequency grids retain their existing eligibility and partitions. Private surfaces release in finally, and existing asset identity/lifetime, cancellation, cache publication, OO history and script/plugin isolation rules remain authoritative. No persistent schema or public constructor/API changes. Crop/export consistency is functional correctness, not an input-latency, physical-display or process-memory guarantee.
Resolved vector tangents are memoized separately per contour and direction for one footprint query. Coincident-segment chains share the nearest resolved tangent; empty cycles and uncertain tangents are cached too. Each segment is inspected at most once in each direction, retaining linear coordinate work and temporary storage through the existing20,000-anchor path budget. The same tangent arithmetic, conservative uncertainty fallback and authored geometry remain authoritative. No cache persists across snapshots.
Native spatial-filter transparent support
assembly/spatial-filter.ts trims only zero-alpha leading/trailing samples from each horizontal row and globally empty source rows from the vertical pass. Horizontal filtering cannot move coverage between rows. Every skipped contribution is positive zero; retained taps keep their original order, normalized Float64 weights, premultiplication, Float64 scratch, rounding and output traversal. Hidden transparent RGB does not become visible. Unsharp still preserves source alpha/hidden RGB, while frequency planes retain their opaque low/high/correction rules. Dense inputs keep full support. The function signature, scratch layout, worker ownership/result validation and4MP/8192-edge native job budgets are unchanged; no new allocation, source resize or import limit is introduced. This removes wasted convolution over transparent margins, not the general cost of a large dense Gaussian.
Adjacent native spatial outputs
The scalar spatial kernel processes horizontal and vertical output pixels in pairs. Horizontal neighboring support intervals differ by at most one sample at each edge: the leading tap belongs to the first output, common source RGBA/alpha normalization serves both independent weighted accumulators, and the trailing tap belongs to the second. Each output retains ascending tap order and its original Float64 multiplications/additions. The vertical pass shares weight/address preparation and reads adjacent scratch pixels together. A scalar tail handles every odd final column, including one-pixel rows. The inline pixel writer retains existing Gaussian/unsharp/frequency rounding, alpha, hidden-RGB and threshold rules; returning from an invisible unsharp pixel never skips its neighbor.
The scratch layout remains four Float64 channels per pixel, with no new memory, module feature, worker/ABI, public constructor, format or mutation/history contract. No SIMD variant is shipped: isolated SIMD experiments did not produce a useful dense-kernel gain. Source geometry, all taps and original blobs remain intact; this is exact sample/load reuse, not approximate convolution or source downsampling.
Native pointwise tone sampling
engine/smart-filter-grid.ts may coalesce requests only for an enabled tone-only native filter stack whose complete projected linear transform is identity and whose translation is a safe integer. Disabled non-tone filters are inert; active spatial/native-composition/frequency operations, fractional placement, resampling and affine placement keep their established grids. The planner reuses nativeSamplingGrid with 256-pixel fallback cores, a 1,000,000-pixel preferred job and 8192-pixel edges, including projection overscan and actual mask-feather support. It chooses fewer jobs only without increasing estimated halo work. These are private work partitions, never original-image limits.
The earlier native Canvas correction is a required dependency: changing a request rectangle must not retessellate vectors, refilter transformed rasters/bitmap masks or alter painted/textured coverage. Coalescing retains complete RGBA, source geometry/blobs, per-filter byte equations, mask settings, cache retirement/cancellation, original/filtered ownership and shared OO history/isolation. Cached styled text/vector/raster artwork, irregular crops, direct worker-mask equations and native 50 MP source/project preservation have explicit regression coverage. No public API, schema or UI control changes.
Paragraph-style recipe references
The deterministic compiler keeps style-output bindings separate from layer-output bindings. Ensure steps create fresh style IDs or reuse an identical normalized named definition; conflicting formatting fails before publication. Updates/removal resolve explicit names or preceding style-step outputs, retaining identity across renames and rejecting skipped/removed/non-style outputs. Added linked text/group templates carry a reference map instead of trusting foreign document IDs. Recorder snapshots include this map and represent undefined inherited-field resets as explicit reset actions so JSON cannot drop them. Shared commands enforce follower locks, reflow, undo/revisions and atomic replay. Packages and batch snapshots retain these actions with no provider or sandbox privilege. See RECIPE_PARAGRAPH_STYLES.md for the public recipe contract.
Paragraph-style inheritance invariant
Schema-41 style records retain a complete resolved format plus optional basedOn {id, overrides}. Strict admission validates an acyclic same-document graph and exact derived formats; older labels cannot carry inheritance. Shared paragraphStyle.set resolves all descendants before checking affected text locks/reflow and publishing one atomic history revision. Deleting a base detaches immediate child styles and direct text, preserving appearance and deeper links. OO handles expose basedOn/setBase/overrides/resetOverrides; child capture records all fourteen explicit fields. Copy collects/remaps the complete ancestor closure before child commands. Embedded masters retain independent libraries. Recorder dependencies and recipe references preserve the graph through JSON/packages/batch snapshots; layer/style output namespaces stay separate. Renderer fields remain concrete and SVG reports relationship loss. Original assets, project/workspace/plugin/recipe versions and isolated/REST boundaries remain unchanged.
Connected RAW source ownership and host editing — 2026-10-22, in implementation
The ready ImageAsset remains a real accepted PNG/bitmap. An immutable optional raw record owns its complete original Blob plus original/output hashes, consent and normalized native development settings, accepted report and decoder WASM identity. Sensor bytes never use a dummy bitmap. Original ownership follows every shared/copied accepted asset, including textures. Trusted openRaw stages a clean native-resolution Document/SmartObjectLayer privately. RawDevelopment and attached developRaw prepare native output before one shared master command; all dependent locks, revision/session/lifetime/abort checks remain required. Accepted old/new pixel assets provide ordinary offline undo/redo, preserving instance placement/extent/effects.
RAW-bearing native projects use checksummed container v4 with deduplicated original payloads; no-RAW output stays v3, and v1–3 readers remain. Document schema 41 and workspace schema 2 are unchanged. Recovery fingerprints include complete RAW metadata and both content identities; originals verify before restoration. Workspace workers, source transfer, recipe package v2 and brush pack/preset v6 retain original/accepted bytes and settings. Ordinary saved-project reopening uses accepted PNG without sensor re-development. This is corruption validation, not a source-authentication or camera-fidelity claim.
The custom import/development dialog supports sensor inspection, explicit sRGB8 consent, native previews, WB/custom multipliers, demosaicing, exposure/highlight parameters and cancel/retry; the inspector and command registry expose Develop RAW without a new key binding. Source bytes stay local. The dated implementation roadmap records build/unit/browser evidence and unresolved gates. Isolated Scripts/plugin development, independent native REST operations and semantic receiving-original RAW recipes are connected under the contracts below. Physical camera/color quality, broader RAW formats, merges, high-precision composition and full F12/F14 acceptance remain required. Do not infer full RAW or roadmap completion from this implementation increment.
RAW isolated and headless automation
The pure RawDevelopment constructor and awaited getRawDevelopment/developRaw methods span trusted hosts and the isolated bridge. Private script assets remain behind the host: preceding staged commands define the native input, only checked master definitions/reports return, and original source pins plus current grants/revision/session/locks guard one final outer transaction. Metadata reads require document:read/assets:read; development also requires document:write/assets:write. No new permission, installation execution, file/blob/pixel/worker access, paid provider or network grant is introduced. Current five-second/256-command/32-repair-asset limits stay in force.
Separate REST sessions now inspect/import binary RAW, develop installed masters through OO hooks/shared commands, retrieve accepted/original bytes and download native projects with optional history. Native decoding/PNG validation occurs in a private Node worker, with cancellable serial admission and termination before lease release. Headless encoded assets expose real validated PNG bytes/dimensions and provenance while explicitly rejecting browser bitmap access. They do not fabricate ImageBitmap objects or claim a browser-equivalent renderer. Large binary/base64 asset transport has no arbitrary source-size cap; metadata command budgets and real process/native allocation limits stay separate. REST/browser file exchange preserves v4 RAW originals and accepted PNGs without live synchronization. Current automated acceptance is recorded in the dated implementation roadmap; actual Node checks include a genuine >100 MB, 50 MP source.
Camera/profile/quality and merge/lens work, F10 precision, F14 resource/performance acceptance and every other unfinished roadmap family remain required.
Semantic RAW recipe preparation
Recipes support strict target-relative raw.develop actions with parameterized development settings and explicit literal 8-bit consent. Preflight resolves current RAW smart-object provenance and shared-instance locks without decoding. Awaited host execution prepares real native outputs in a private asset store, validates actual geometry and all ordinary commands, then commits once. Revision, selection, session, source identity/bytes/geometry/bitmap lifetime, cancellation and throwing progress checks prevent late publication. Shared targets develop once per master per step; subsequent RAW steps consume their private prior result. Undo/redo retain accepted pixels independently of the decoder. The recorder records settings/semantic targets rather than capturing source IDs or bytes.
Package imports and native outputs prepare against a detached document; nothing enters the owner's store before final validation. Library/package controls expose progress, cancellation and close/Escape cancellation. Existing synchronous ordinary recipe execution remains compatible and explicitly refuses native actions. Recipe schema remains version 1 with a new strict action; older runtimes reject unsupported actions. Document/project/plugin contracts and separate REST sessions remain unchanged. Broader photographic/profile/color/precision/merge and roadmap gates remain open. Direct RAW batches are described below. See SCRIPTING_API.md for exact trusted-host signatures and the executable example.
Direct RAW batch preparation and recovery
Trusted batch preparation performs actual native inspection/hash review with explicit sRGB8 consent; source review metadata is not an accepted image. Creation validates and captures immutable source/settings/recipe inputs before atomic source/run persistence. Workers build detached OO smart-object documents, run semantic/portable recipes privately and atomically store a checksummed editable native project before any delivery variant. The prepared project retains original RAW bytes, accepted pixels/settings and pre-recipe state. Retry/reload verifies source/project/input/delivery identities and reuses accepted pixels without the RAW decoder; missing/corrupt/mismatched scenes fail rather than silently re-developing accepted work. Cancellation/cleanup preserve ownership and prevent late publication.
Database v2 retains prepared-project references in atomic publication, reclamation and deletion and preserves legacy data; blocked older tabs reject with a recovery instruction. Review downloads verified editable projects. RAW ZIP delivery includes the projects and a version-1 checksummed preparation index alongside unchanged v2 delivery manifests; ordinary archives stay compatible. Native progress events avoid persistence writes. Zero-cost deterministic batches need no spending approval; positive-cost/AI work retains budget and capability gates. No visible editor mutation, arbitrary original-image cap, paid call, cloud upload, new isolated privilege or browser/REST synchronization is added. Exact trusted-host signatures, defaults, errors, memory/format limits and the executable example are in SCRIPTING_API.md. Broader photographic/precision/quality/device/merge and full-roadmap acceptance remain open.
Manual RAW lens correction
Optional version-1 LensCorrection settings flow through immutable RawDevelopment values, import/development/batch review, isolated constructors/current grants, independent REST workers and semantic recipes. Radial mapping, per-channel chromatic scales and vignette attenuation operate on native-developed linear RGB16 before sRGB8 transfer. Exact polynomial extrema reject folds/nonpositive attenuation. Native region copies and an 8 MB source tile cache bound correction scratch independently of original geometry; the existing full native input/processing plane remains. Missing source coverage becomes alpha, with unchanged native dimensions. Neutral/disabled correction preserves previous working pixels and absent settings remain absent in legacy files. All original/accepted ownership, metadata/hash/persistence, locks/history and cancellation/revision/session/grant checks remain.
The custom RAW dialog exposes manual exact controls and rejects invalid geometry before Preview/Apply/Queue. Original sensor bytes/settings and accepted output remain separately preserved through existing project/workspace/recovery/copy/recipe/brush/batch transports; undo/redo and prepared-scene retry do not re-develop pixels. Older strict readers reject unsupported settings. Model equations, defaults/ranges, errors and limitations are in SCRIPTING_API.md. Calibration/profile matching/import, broader lens models and physical camera/color/quality evaluation, merges, F10 precision, F14/device and all other original-roadmap gates remain open. No paid operation, cloud upload, new isolated file privilege or arbitrary original-image cap is added.
Recorded RAW shooting declarations
Native wire protocol 2 adds bounded recorded lens maker/model and positive finite focal length, 35 mm-equivalent focal length, aperture, exposure seconds and ISO to the existing RAW report flow. Missing or invalid native declarations are unknown; public report version 1 keeps the shooting object optional so old accepted files remain unchanged. Reports preserve native float32 precision and deep immutability. Native processing, original pixel geometry, accepted history/assets and all host/script/REST/batch/recovery transport and permission boundaries remain authoritative. No serial/location/time fields are added to the report; originals retain their complete bytes. The custom review disclosure formats declarations without treating them as calibrated measurements or selecting a profile. Precise fields, defaults/unknowns, error behavior and the executable isolated example are in SCRIPTING_API.md. This supplies required source context for the unfinished calibrated lens workflow; it does not implement profile matching/interpolation/databases or complete F12/F10/F14.
Pen overlay presentation bounds (F14, in verification)
The UI derives a document-space view rectangle from current viewport size, pan and zoom, padded by 32 CSS pixels. It is deliberately not clamped to the artboard: off-artboard anchors remain editable when panned into view. JavaScript compares complete control footprints with that region; no SVG clipping effect is introduced into the original affine paint hierarchy. Every anchor, handle and control index stays in the DOM. Artwork, vector-mask and text-baseline controls share this presentation policy; native hit testing, authored geometry, commands, Undo, sources and exported artwork are unchanged. Pan, zoom, resize and document dimensions refresh the private rectangle.
View bounds are admitted only when all coordinates/extents are finite and their float32 rounding uncertainty is at most 1/1024 of a CSS pixel. Unsafe or unavailable view geometry retains complete overlay presentation. This is a precision fallback, not a document/image-size or coordinate limit. Existing large-translation precision handling remains independent.
Each complete control footprint includes the anchor square, both handle circles, the joining line and their stroke support. Only groups wholly outside the padded view suppress paint; all elements, coordinates and indices remain. A visible handle or crossing line keeps a group eligible even when its anchor is outside. Geometry, pan, zoom and resize revive groups through the existing memoization invalidation. Unsafe/nonfinite footprints retain full presentation. Visible marks retain their complete original paint order, including coincident handles. This reduces invisible browser paint chunks, without a compositor-hint dependency. Dated performance, pixel and interaction acceptance belongs in the roadmap; this contract alone does not establish sustained 60fps or full F14/device quality.
Float viewport batching and idle native display ownership (F14)
FloatSceneRenderer batches display windows within the existing 65,536-output-pixel and 2,048-axis working bounds, then uses complete native scene evaluation before frame sampling and native ICC. A private display service retains at most one idle prepared linear-sRGB-to-sRGB session across renderers. It remains counted in the two-owner native queue and retires synchronously when queued source/profile work needs the slot. Queue pumping guards reentrant disposal and preserves FIFO/cancel. Active display leases remain exclusive, keep monotonic worker IDs and strict owned-output validation, and detach their scene abort/progress callbacks before idle retention. Symbols identify renderer ownership without retaining renderer or source objects. Errors, cancellation, pending work, large scratch and closed sessions cannot enter the idle cache; clear/disposal retires owned idle state. IccSession.dispose still terminates immediately. Model, schema, public commands, Undo, source resolution, file contracts and isolated/REST grants are unchanged. See ICC_ENGINE.md and FLOAT_DOCUMENTS.md for scope and remaining F14 gates.
Cooperative byte-compositor layer boundaries (F14)
The existing eight-millisecond native-tile task budget is shared by ordinary byte-compositor layer stacks, recursive groups and bounded layer work too. An expired budget yields through the existing disposable MessageChannel helper and checks cancellation before continuing. Promise-only layer continuations do not admit input tasks. Layer order, complete-frame publication, output grids, native text drawing, source resolution and cache/font invalidation retain their existing contracts. Float scenes keep their separate native pipeline. Individual native Canvas calls, graph/setup work and final copies remain non-preemptible; this is cooperative scheduling, not an eight-millisecond or 60fps guarantee. Dated correctness and performance acceptance is recorded in the roadmap.
Development dependency scanning explicitly includes paper/dist/paper-core.js, which the SVG/Boolean boundary first reaches after startup. A fresh-cache server otherwise discovers this CommonJS entry during the font/plugin/SVG workflow and its optimizer sends full-reload, interrupting the running page. Pre-optimization keeps that development session intact. This changes no runtime geometry kernel, production permission or artifact contract; fresh-cache verification and exact built resource identities are recorded with the F14 evidence.
Committed viewport updates (F14)
The UI keeps one active preparation and a coalesced latest job. Each job now captures its actual Document owner independently of serialized IDs/snapshot identity. A committed content revision may start without another animation-frame wait only on the same already-presented owner and stable queued view, assets, font/backend/color context, with no preview. New owners, document/view geometry changes, view-only updates and previews retain frame cadence and initial fitting. An eligible content revision can wake an older pending frame wait; the drain then consumes the latest captured job rather than the older view. The existing source/view/font/backend/gesture checks and complete-frame publication remain. Cleanup invalidates queued work, wakes pending waits and releases existing leases. This private scheduling state is not document data, history or a new public API. Dated output/cadence/timing verification remains in the roadmap.
Independent Node precision-source ownership
ServerTiffService owns immutable TIFF originals, pinned native ICC preparation, independently verified file-tile batches and a bounded Node reader worker. importServerTiff uses OO RasterLayer/AffineTransform values and one shared precision/layer transaction. Encoded headless assets explicitly reject bitmap access; portable projects retain original bytes. Browser and Node workers share private FloatTileWindowReader validation/cache semantics. No composed headless renderer or browser synchronization is supplied. Ownership, native receipt and lifetime contract.
Private projective geometry and source sampling
core/projective.ts and projective-sampling.ts provide immutable homogeneous geometry and strict exact-corner sampling settings. The actual WASM pixel kernel and existing worker supply premultiplied float32 perspective windows; engine/projective-projection.ts recursively bounds original-source ROIs. This is a dependency for the connected F03 workflow. Schema-50 image placement, shared commands, masks/hit testing, persistence and automation now use this dependency alongside independent affine parent placement; interactive nonlinear tool mapping remains gated. Numeric/ownership contract and remaining work.
core/mask-field.ts bounds finite raw coverage deviations; the trusted renderer's
capturePerspectiveMask adapter captures original-plane mask geometry/assets and
returns owned native document coverage. Linked fields follow the exact target
corners; unlinked fields stay in document coordinates. Existing fractional-box
feathering follows projection with complete halos and float32 intermediates,
then inversion/density. Captured masks, asset identity/geometry, store lifetime,
renderer epoch and cancellation guard publication. This is a read-only renderer
dependency used by schema-50 image rendering. Public numeric authoring and
baked file delivery and direct corner handles are connected; projective brush/
mask tool mapping remains required. No pixel/worker or additional plugin authority is added.
Captured placed erasures (schema 51)
RasterLayer.erase(stroke,{space:"placed"}) captures perspective, dimensions and finite intrinsic support through the ordinary shared layer update. engine/projected-erasure.ts reconstructs complete authored brush coverage on a fixed ceil-sized captured layer-pixel lattice, pulls it through the captured forward homography, and samples the remaining-alpha field through current size/affine placement. Bounds and constant-one background retain finite source support without allocating full images. Captured-grid interpolation neighbors are padded before mask resizing, retaining magnified tails beyond image edges. Native byte replay and float original-window composition apply operations in existing order, including after perspective reset; generic erasure masks use the same capture. Byte alpha quantizes at compositing; float RGB never crosses the coverage canvas and alpha rounds per operation. Request/scene-owned captures pin coverage sources and cancellation; no global stroke cache is introduced. Tools capture the same metadata for preview and final shared-command commit. Default local erase/clear semantics and mask/wet gates remain. Public contract.
Placed clear replay (schema 52)
RasterLayer.clear(selection,{space:"placed"}) captures a clear fill through the existing shared erasure command. Its finite fill plane covers every interpolation neighbor of the placed intrinsic bounds, including subpixel quads. captureProjectedErasure reconstructs unprojected clear coverage through the existing raster-erasure mask rasterizer, then uses the same captured forward/affine scalar transports as erasing. Byte, float and mask replay retain ordered operations and originals. assertRasterErasureVersion gates clear placement at 52 and eraser placement at 51 in raster/mask contexts. Delete converts document selection through the affine inverse and commits once. Default/local clear and unsupported mask/wet tools retain their existing boundaries.
Placed mask fields (schema 53)
Layer.paintMask constructs ordinary/filter-mask refinements through the existing mask update/Undo route. Captured width/height, perspective and mask-to-image affine basis keep complete brush coverage attached to mask coordinates. engine/placed-mask.ts owns per-request raw brush captures and applies strict affine-input/forward scalar sampling; it never inverse-maps only points. Existing mask geometry keeps its established sampling path. mask-field.ts bounds the complete captured field plus interpolation neighbors in a corner-relative inverse frame; a horizon intersection selects unknown support rather than clipping to an image rectangle. projective-field.ts then streams bounded inverse windows, keeping matrix origins independent of each packet. The existing WASM ABI remains. Captures own copied values, source leases and cancellation and are reused across source windows. Preview carries identical placement; mask gestures synchronously retire on revision/ordered-selection changes.
Filter-region uniform-coverage detection and culling use the captured pullback support for placed strokes. Unbounded or unproven support stays in the region; authored point bounds cannot safely decide its native influence.
Large/feathered placed-mask surfaces retain existing canvas budgets while scalar reads split into at most 512-square output windows with one shared input frame. This preserves crop parity without treating the scalar working limit as a mask/image size limit.
Perspective mask path editing
core/mask-path.ts keeps world translation outside native-mask projective arithmetic and supplies positional inverses. core/projective-bezier.ts uses homogeneous rational subdivision, viewport half-space hull culling and exact native parameter hit candidates. ui/ProjectivePenControls.tsx presents bounded rational outlines/handles; legacy affine Pen presentation stays on its existing path. ToolController captures mapping/grab offsets and projected path/draft authority, then commits ordinary native mask updates. No renderer/schema/worker or grant boundary changes.
Mask placement and canvas translation
Schema 54 adds optional mask placedX/Y in the compositing plane. Ordinary linked perspective masks keep raw x/y/basis separate; capturePerspectiveMask translates authoritative output corners through an owned optional postTransform, preserving native field sampling and feather/settings. Byte/float callers pass the actual world transform. translateMaskData supplies shared document-pixel displacement for Layer.translateMask and Move previews; attached commands remain publication authority. Brush capture and Pen mapping include the same outer placement. Affine rebases remove already-folded placement once; neutral wet input clears it and affine float appearance keys include the resolved offset. The native ABI, source budgets, grants and independent REST/session boundaries remain unchanged.
When raster wet pixels extend beyond the original image bounds,
convertToSmartObject() uses the existing containing-master conversion. The
original raster, its mask and appearance remain editable inside editContents();
the containing instance includes the artboard and extended content. This differs
from the compact original-image conversion, which retains an outer mask on the
instance. It prevents trimming off-image paint while preserving source metadata,
independent mask planes and Undo. Native projects retain both forms.
Native linear float wet-paint dependency (F03/F10)
core/float-wet.ts defines private signed/HDR load and premultiplied reservoir
validation. FloatPixelProcessor invokes three new AssemblyScript exports for
linear load, deposit/pre-deposit pickup and final completed-stroke opacity.
The ordinary pixel worker captures private inputs before readiness and returns
strictly validated owned Float32 results. Native scratch remains bounded at
65,536 pixels and worker requests at 262,144; neither limits image geometry.
Exact numerical and ownership contract.
Projected five-channel fields and PNG replacements retain their byte domains. Retained float sessions are implemented below; HDR assets/composed replay, projection, persistence, previews and tool admission still need integration. These private primitives add no document schema, public mutation API, script service, REST route or plugin authority. Float wet-paint authoring remains rejected until those connected boundaries retain actual HDR samples.
Retained native float wet sessions
wet-session.ts shares one typed lifecycle across byte and float formats.
wet-format.ts keeps encoded byte math separate from linear float load/mix and
completed opacity while retaining the existing source/cache/storage authority.
createFloatWetStrokeSession and prepareFloatWetStroke retain Float32 originals,
destinations and signed/HDR spatial reservoirs. Native stored cells/snapshots
never use byte RGB. sampleFloatWetField shares complete bilinear-neighbor
geometry and compact support with the byte sampler, using its own numeric
validation and zero-alpha canonicalization. Result iteration validates its
format and returns fresh arrays. Shared creation now owns source release even
when capture/storage initialization fails.
Exact private lifecycle, coverage precision and limits. Job databases and read-only native source replay are not a public HDR wet edit format. Float tools still require assets/replay/projection, persistence and guarded authoring integration through shared document commands.
Prepared HDR wet asset/field dependency
core/float-wet-tile.ts writes and validates lossless straight Float32 TIFF
working tiles with an exact linear ICC and complete sample validation. The core
codec uses portable TIFF reading/encoding without an engine dependency.
engine/hdr-wet-field.ts captures immutable color/coverage originals, checks
complete pair coverage and derives ordered Float64 premultiplied fields.
core/hdr-wet-projective.ts retains exact affine geometry in the new HDR path;
projective-field.ts shares conservative streaming geometry across scalar,
byte and HDR fields with separate validation/allocation policies. Native worker
sampling keeps Float64 until one final straight Float32 composition.
Contract and limits. No public schema, constructor, command,
script/REST route or plugin authority is added. These files are not yet native
document wet assets; FloatScene replay, versioned transport and guarded
authoring/tools remain required.