Skip to content

[#86] Detail-aware input cap: relax 1280→2048 for fine-mark-dense inputs#89

Merged
realproject7 merged 1 commit into
mainfrom
task/86-detail-aware-cap
Jul 8, 2026
Merged

[#86] Detail-aware input cap: relax 1280→2048 for fine-mark-dense inputs#89
realproject7 merged 1 commit into
mainfrom
task/86-detail-aware-cap

Conversation

@realproject7

Copy link
Copy Markdown
Owner

Closes #86. T1 of the detail-parity-v2 track. Rollback anchor: tag detail-parity-baseline (== v0.8.0).

What

Makes the input long-edge cap (#82, default 1280) detail-aware: at the default cap only, an over-cap input's original fine-mark density is measured; if ≥ 8.0 the effective cap relaxes to 2048 (_TRACE_RESOLUTION, still bounded). Any explicit --max-input-edge-px (incl. 0) bypasses the heuristic verbatim.

Ported _fine_mark_density (+ constants) from the shelved P2 detector (#84/#85) — the shelved asset, reused as a router.

Why it is safe (structurally non-regressing)

Evidence

Calibration sweep (fmd reproduces the proposal exactly): cat 4.58 / popgirl 10.39 / moon 13.60. Full pv-corpus + new-test sweep in [z-design/.../analysis-2026-07-07/T1-cap-calibration.csv]. Finding: an fmd floor cannot perfectly separate flat-from-detail (04-flatcartoon 12.99 > popgirl 10.39) — so I verified the boundary visually.

Visual gate (T1-cap-1280-vs-2048-montage.png): relaxing the four >1280 high-fmd flatcartoons to 2048 is harmless (01/04/06 near-identical, 05 marginally crisper); popgirl clearly benefits. Path cost modest (0.93–1.20×).

Functional: popgirl 1648×2944 → relax 2048 (fmd 10.4, 1668 paths, note emitted); 03-flatcartoon (6.93) stays 1280.

Tests: detector separation, flat-stays + explicit-override, dense-relaxes. ruff + full suite (130) green.

⚠️ Gate before merge

This is default-ON (no flag), so per the quality-loop protocol it needs the operator visual eye-gate on the montage before merge / any engine release. Production is protected meanwhile (svgsmith-x402 API pinned <0.9.0). Paired with #87 (op-point routing) for the full popgirl face recovery.

🤖 Generated with Claude Code

…puts

The long-edge cap (#82, default 1280) is the primary detail-killer for
high-res detail-rich art: a 1648x2944 illustration is LANCZOS-downscaled to
717x1280 before tracing, shredding face features nothing downstream can
recover. Make the cap detail-aware.

- Port _fine_mark_density (+ constants) from the shelved P2 detector (#84/#85).
- In convert()'s downscale block: at the DEFAULT cap only, measure the
  original's fine-mark density; if >= 8.0, relax the effective cap to
  _DETAIL_CAP_EDGE_PX (2048, == _TRACE_RESOLUTION). Any explicit
  --max-input-edge-px (incl. 0) bypasses the heuristic verbatim.
- Report note records the relax (fmd + 1280->2048).

Structurally non-regressing: inputs <= 1280 never enter the branch
(byte-identical; golden corpus green), low-density inputs keep 1280.
Calibrated on the pv-corpus + new-test sweep; relaxing the few dense "flat"
cartoons that cross the floor is visually harmless (verified montage).

Verified: popgirl 1648x2944 -> relax 2048 (fmd 10.4, 1668 paths); 03-flatcartoon
(fmd 6.93) stays 1280. Tests: detector separation, flat-stays + explicit
override, dense-relaxes. ruff + full suite green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@realproject7
realproject7 merged commit 8c1fee2 into main Jul 8, 2026
4 checks passed
@realproject7
realproject7 deleted the task/86-detail-aware-cap branch July 8, 2026 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detail-aware adaptive input cap: relax 1280 to 2048 for fine-mark-dense inputs

1 participant