# Minimum-disturbance composition contracts — measured claim

Built and executed on 2026-09-29. Local authored benchmark; not an external benchmark or human study.

**In this 48-request layered-composition test, the controller delivered 31 feasible revisions through Photoshop with pixel-exact assets and chromatic-centroid error below 0.25 px per axis. Every accepted revision has a numerical certificate for the minimum number of collateral layer positions changed. Against a minimum-distance integer optimizer with an explicit minimum-layer tie-break, five of the 31 matched feasible revisions disturb one fewer layer; 26 tie.**

The mechanism is a geometric contract over measured color: lower one artwork's chroma, retain its requested destination, and move the smallest possible number of other layers to keep the composition's declared chromatic centroid. Protected artwork F never changes. This demonstrates joint color/geometry control with delivered-file validation and bounded optimality. It does not establish new optimization mathematics or superiority over every available editor.

## Comparison that survived a stronger baseline

| Same previous state, same request, same feasible set | Our cardinality-first solver | Minimum-distance solver + minimum-cardinality tie-break |
|---|---:|---:|
| Feasible requests delivered | 31 / 48 | 31 / 48 |
| Sum of collateral layer changes over the 31 feasible transitions | 47 | 52 |
| Sum of absolute x/y displacement, including requested moves | 2,491 px | 2,420 px |
| Requests with fewer collateral layers | 5 | 0 |
| Requests with equal collateral layer count | 26 | 26 |

This is **9.6% fewer collateral layer changes for 2.9% more total displacement** in this authored test. The unit is a layer-position change per transition, not unique layers, user actions, cleanup effort or seconds of artist work. The distinction matters: one larger movement can preserve more other decisions than several small movements. Preference between them needs user evaluation. Per-case collateral totals appear in the raw records; all three cases are permutations of the same six artworks, so observations are correlated and narrow.

The comparator is deliberately strong: actual integer optimization, identical constraints, identical previous state, identical delivered variants, and a minimum-cardinality tie-break among all distance-optimal answers. The initial untied distance baseline had 60 changes and 12 apparent wins; strengthening it reduced that to 52 and five wins. **We use the stronger result.** This strengthening was post-hoc and reduced our claimed advantage; both result sets remain available.

## Coverage and failures

| Independent-history method | Accepted requests | Refused / failed gate |
|---|---:|---:|
| Direct native linked-row transforms and color changes | 0 / 48 | 48 centroid violations |
| Upstream Kiwi/Cassowary + exhaustive floor/ceil integer repair | 22 / 48 | 17 continuous infeasible; 9 rounding failures |
| Minimum-disturbance integer optimization | 31 / 48 | 17 infeasible within the declared constraints |

The direct-native row is a simple automated workflow, **not an expert or Photoshop capability ceiling**. Native linking was inspected, then direct placements were rendered through the shared bridge; native users can unlink or apply other scripts. A solver-equipped Photoshop is precisely what we built. Cassowary on our exact previous states accepts 28 / 48, with four fewer-layer wins for our solver among those 28. That paired result separates the objective from history divergence. A sufficiently strong integer baseline equals our feasibility coverage.

The 17 refusals are retained and do not count as successes. Every failed commit retains the prior accepted state. Nine additional fully locked recoloring requests were correctly refused by each informed method. All 31 accepted candidate revisions had HiGHS status optimal, zero reported MIP gap, and a second feasibility check with one fewer collateral layer returned infeasible. These are numerical certificates for the declared six-layer model; not formal proofs about arbitrary imagery.

Post-hoc refusal explanations solve for the least possible maximum centroid error while retaining all other constraints. The 17 minimum required tolerances range from 1.827 to 99.018 px, versus the original 0.25 px gate. Their Photoshop previews are explicitly **uncommitted alternatives**, not successful edits. Primal results and lower bounds are retained.

## Delivery and checks

- Photoshop 26.2.0 on this machine, through its native JSX scripting interface.
- Pilot exported PNG: zero differing pixels versus the full reference raster.
- 211 main/supplement exported PNGs, plus the pilot, all checked against exact expected pixels and native layer bounds. Original assets, changed color variants, protected layer F and every background pixel match exactly.
- Largest accepted candidate centroid error: 0.249337 px per axis.
- 1189 / 1189 main/supplement checks pass. These are invariant checks, not additional independent benchmark examples.
- Fourteen saved PSD composites (including pilot) independently match their corresponding PNGs exactly; all six original source hashes remain unchanged.
- Editable PSDs: three source compositions; available first-sequence end states for methods; and first-sequence recolor outputs for the strongest comparator. All use native groups and separate cached color variants.
- Exported file hashes, bounds, solver outcomes, complete before/after states and all failures retained in `reports/`.

The first implementation used float32 summation of chromatic masses and failed 53 strict moment-identity assertions (maximum discrepancy 0.000058 px). Switching the reductions to float64 fixed the identity without changing the 0.25 px acceptance gate or request set; earlier reports are retained as `pre-float64-*`. The native pilot also caught an ExtendScript reserved-key syntax error before image execution; it was corrected. The earlier rough-cutout project remains separate and its visual failures are not relabeled as passes.

## Setup and cost

Shared preparation: six existing library images, normalized/letterboxed once to 192×192; 24 total cached color variants across four levels. No generative calls, no extraction masks, no reconstructed backgrounds. Each Photoshop composition contains 24 image layers in six groups plus a locked background. Three permutations share all source variants. The bridge constructed three documents for the main run and three more for the supplemental comparison, separately from the pilot.

Extra controller setup: assign six slots, one protected layer, two row alignments, a baseline chromatic centroid, a 0.25 px tolerance, and retained horizontal destination constraints. Twelve position variables plus displacement and cardinality variables; color levels are explicit user requests, not optimized freely. Both informed comparators get the same measurements and restrictions. Engineering and human setup time were not measured.

Main solver/reference study: 2.84 s. Photoshop main batch: 116.18 s including native construction. Supplemental native batch: 46.28 s. Total native transform/visibility writes logged across the two batches: 722 (includes resetting documents between alternatives, so not a human-effort metric). Source preparation: 0.14 s. Application startup and interactive script selection are excluded from these machine batch times. No claim of end-to-end time savings.

## Meaning and scope

Chromatic centroid uses raw OKLab chroma, with pixel-center coordinates, x right/y down. It is not a validated eye-attention, saliency, aesthetic-quality or meaning metric. Source-local chroma variants can have 8-bit rounding/gamut effects; all measurements use their actual cached pixels, not an ideal scalar assumption. No exact luminance/hue preservation claim is made for quantized variants.

The six panels are opaque, nonoverlapping, integer-translated assets on known background. There are no cutout edges, occlusions, brush marks, semantic reconstruction, rotation, resize or arbitrary photo edits. Releasing A's earlier destination leaves the later color and E-position decisions intact; it does not force A back to its initial location. This is declarative constraint release, not general selective bitmap undo.

Constraint maintenance is established prior art: [Cassowary](https://constraints.cs.washington.edu/cassowary/) solves linear requirements/preferences. [Aquamarine](https://www.cs.cmu.edu/~NatProg/aquamarine.html) already explored selective bitmap undo through history replay. Photoshop exposes a [native scripting interface](https://helpx.adobe.com/photoshop/using/scripting.html). Our measured contribution here is the particular measured-color contract, minimum-collateral objective, refusal explanation, and verified Photoshop delivery assembled into one functioning pipeline. No novelty or patentability conclusion follows from this experiment.

## Next decisive test

The next useful claim is whether these preserved positions correspond to artistic decisions people actually want retained. Freeze a held-out set of independently authored compositions, let designers declare their own protected relationships, and compare this integration with an expert workflow that includes native grouping, locks, alignment and scripts. Measure setup plus correction time and preference, not merely solver success. This local study supports doing that test; it does not substitute for it.

## Reproduction

Use a Python environment with the study's pinned dependencies from the `composition-contracts` directory (versions in `reports/summary.json`). `src/prepare.py`, `src/model.py`, `src/run_study.py`, `src/strengthen.py`, `src/repair_frontier.py`, then `src/make_bridge.py` / `--supplement`. Run the resulting native JSX scripts through Photoshop File → Scripts → Browse, then `src/validate.py --native`, `src/validate_supplement.py`, and `src/publish.py`. Before the main study, generate `src/make_bridge.py --pilot`, run that JSX in Photoshop and run `src/validate_pilot.py`. The native pilot gate must pass before main execution. A rerun overwrites this folder's generated results; copy the folder first if preserving the exact run is important.
