Auto Redact v2Apple M4 · macOS 27.2.1 · 6 Retina Scenes A/B Tested

From 2 Seconds to 5 ms:
Inside Framecho Auto Redact v2

Making one-click Auto Redact truly fast and dependable doesn’t mean adding a wall of sliders—it means keeping every geometric, visual, and semantic decision inside the local engine. Here is the complete story from v1 bottlenecks and zero-extra-settings discipline to real Apple M4 benchmarks and live-tested polish.

Benchmark Run:Report Updated:Test Rig:Apple M4 · macOS 27.2.1 · Swift 6 (-O)
5K ROI Prewarm Hit399× Faster
5.04 ms
Down from 2011.8 ms full-screen v1 baseline; cold 1080p ROI also drops to 400.6 ms (5.02×).
6-Scene Recall+32.5 pp
92.5%
37 of 40 targets caught (up from 24 / 40 in v1 baseline, 60.0%).
6-Scene Precision0 False Positives
100%
False positives drop from 9 to 0; IDE & terminal precision jumps from 33.3% to 100%.
New Settings AddedZero Bloat
0
Keeps the existing 3 toggles, 2 styles, and Strength slider intact.
01 · Iteration Timeline

How Auto Redact v2 was shaped step by step

Reliable Mac tools rarely come from piling on options—they come from measuring bottlenecks, keeping the engine smart, and refining real-world edge cases.

  1. Stage 01 · Diagnosis

    Dissecting v1’s 2-second wait and 9 false positives

    v1 baseline (git HEAD) audit

    On a 5K Retina display (5120×2880, 5.4 MB PNG), clicking Auto Redact in v1 took over two seconds (2011.8 ms) while still missing targets or clipping normal UI copy:

    • The hidden PNG decode wall: reading from disk forced a ~1.14 s CGImageSource PNG decode on 5K before running two serial OCR passes across 12 tiles.
    • Rough geometry: proportional-font substring offsets estimated by character ratio drifted up to 38.03 px on iiiiiii me@company.io, repeated per-box pixel sampling wasted CPU, and single-line header avatars, table columns, and QR codes were missed.
    • Context blind spots: code attributes like @MainActor, @Observable, @media, browser versions, and timestamps tripped redaction, leaving ide-terminal precision at 33.3%.
  2. Stage 02 · Zero Extra Config

    Keep complexity in the engine, simplicity in the UI

    Ready out of the box with the same 3 toggles

    Every detection upgrade works automatically by default with zero learning curve, keeping the toolbar clean and familiar:

    • Zero new Settings: kept the exact 3 wand toggles (Sensitive Text / Usernames / Avatars), 2 styles (Pixelate / Blur), and the existing Strength slider.
    • Silent capability folding: QR code detection folds naturally under Sensitive Text; avatar mask shape adapts automatically from pixel geometry instead of asking the user.
    • Lightweight review pill: after redacting, one subtle bottom pill summarizes the 3 categories—hover highlights matching boxes, click toggles a category, Undo reverts all, and 8 s of idle fades it out.
  3. Stage 03 · Engine Rebuild

    Concurrent pipeline, exact word spans, and stricter rules

    16 core Swift files upgraded

    Rebuilt the entire detection and layout pipeline around sub-second latency and zero false positives:

    • Fast path: direct in-memory CGImage handoff skips PNG disk round-trips; 200 ms idle selection triggers .utility background prewarming; ROI-intersecting tiles scan first while grayscale variance prunes blank wallpaper; selective second-pass cjkFirst OCR runs only where needed alongside batched Vision faces/bodies/QR and a single 1× raster pass.
    • Exact alignment: replaced length heuristics with Vision’s UTF-16 word-level spans bounding rects.
    • Contextual precision: multi-secret line splitting, 18-digit Chinese ID ISO 7064 Mod 11-2 checksums, credentialed URIs (postgres://), table header propagation, vertical key-value forms, Shannon entropy ≥ 3.5 gating, plus code/version/timestamp exclusions.
  4. Stage 04 · A/B Benchmark

    Head-to-head validation on Apple M4

    3-run median · cold cache discipline

    No guesswork: compiled production Swift 6 code (-O) on Apple M4 / macOS 27.2.1 to pit v1 (git HEAD) directly against v2 across 6 Retina fixtures. Prewarmed 1080p selection hits 5.04 ms (399×), cold selection runs 400.6 ms (5.02×), recall climbs from 60.0% to 92.5%, and false positives drop to zero.

  5. Stage 05 · Dogfooding Fixes

    Two real-world UX details caught before release

    Found in live Framecho Dev testing

    While testing daily builds of Framecho Dev on real WeChat conversations and code editors, two tactile flaws surfaced that automated precision tables never reveal—both were fixed the same day:

    1. Rounded-square avatars without exposed corners

    WeChat and similar messengers use squircle/rounded-square avatars; an elliptical mask left all four corners peeking out. The 1× raster pass now measures cornerClearance: true circles (≥ 0.78) keep .ellipse, while rounded squares automatically switch to .roundedRect.

    2. First-click single box selection after redacting

    Staying on a drawing tool after Auto Redact meant clicking an unwanted redaction box accidentally started drawing a new shape. Framecho now resets immediately to .select with an empty selection—one click selects a box, ⌫ removes it, and ⌘Z still undoes the whole batch.

02 · Speed Benchmarks

5K Screen 2011.8 ms → 5.04 ms: Breaking the PNG Decode Wall

Measured on Apple M4 · macOS 27.2.1 with -O optimization, 3-run median per entry and fresh cache keys on cold runs.

5K Desktop Entry Points (5k-desktop.png · 5120×2880 · 5.4 MB)

Switch to Log scale to inspect the gap between 5.04 ms and 400.6 ms.

v1 Baseline · Disk URL Full-Screen ColdDecodes 5.4 MB PNG from disk + 12 tiles serial dual-pass OCR
2011.8 ms1.0× Base
v2 Parity · Disk URL Full-Screen ColdCGImageSource decode of 5.4 MB PNG alone takes ~1.14 s
1936.6 ms1.04×
v2 In-Memory · 5K Full-Screen ColdSkips PNG decode + empty-tile pruning + concurrent Vision/OCR
796.3 ms2.53×
v2 In-Memory · Sensitive Text Only (Full-Screen)Automatically skips second cjkFirst OCR pass
651.4 ms3.09×
v2 Area Selection · 1080p ROI ColdIn-memory CGImage + intersecting tiles only, well under 600 ms target
400.6 ms5.02×
v2 Area Selection · 1080p ROI Prewarm Hit200 ms idle triggers .utility background prewarm before click
5.04 ms399×
Key finding: Even with faster OCR, decoding a 5.4 MB 5K PNG from disk consumed ~1.14 seconds inside CGImageSource. Moving area capture and the editor to in-memory CGImage handoff + ROI-first tiling + 200 ms speculative prewarm turned a 2-second stall into an imperceptible click.

Mid-Size Screenshots (v1 Disk URL vs v2 In-Memory Cold)

chat-mixed

1600×1000
v1 640.7
v2 344.1
Cold speedup1.86×

admin-table

1800×1000
v1 699.3
v2 309.8
Cold speedup2.26×

ide-terminal

1800×1100
v1 1459.5
v2 253.7
Cold speedup5.75×

qr-and-form

1400×900
v1 699.5
v2 274
Cold speedup2.55×

clean-toolbar

1600×900
v1 743.4
v2 130.7
Cold speedup5.69×
03 · Detection Quality

6 Retina Scenes Side by Side: Higher Recall, Zero False Positives

Select a fixture chip below to inspect its sensitive targets, decoys, and v1 vs v2 detection counts.

All 6 Retina Scenes Summary (40 Sensitive Targets + Decoys)

Covers 5K dual-window desktop, mixed CJK group chat, multi-column admin table, IDE & terminal logs, QR + vertical form cards, and a clean toolbar control scene.

Recall: 60.0% → 92.5% (+32.5 pp)Precision: 72.7% → 100.0% (9 → 0 FP)
v1 TP / FN / FP24 / 16 / 9
v2 TP / FN / FP37 / 3 / 0
Targets40
v2 Precision100.0%
SceneTargetsv1 TPv1 FNv1 FPv2 TPv2 FNv2 FPKey Change
5k-desktop9630810Recovered QR code + right-window name
chat-mixed10552820Left header avatar + CJK propagation, 0 FP
admin-table128411200100% Recall / 100% Precision
ide-terminal5326500Precision 33.3% → 100% (6 → 0 FP)
qr-and-form4220400TOTP QR + vertical key-value fields
clean-toolbar00000000 FP in just 130.7 ms
Total (6 Scenes)40241693730Recall 92.5% · Precision 100%
04 · Interaction Craft

What makes a tool feel sharp sits in the last few pixels

Accuracy isn’t only recall percentages—it is tight glyph bounds, sealed avatar corners, and effortless one-click cleanup.

Craft 01 · Word-Level Bounds

4.2× tighter substring left-edge accuracy

In proportional fonts (such as iiiiiii me@company.io), narrow i characters skew ratio estimates—causing 38.03 px left-edge drift in v1. v2 queries Vision’s exact UTF-16 word spans rects, cutting error to 9.07 px (mostly intentional safety padding).

v1 · Character-ratio estimate (38.03 px left drift)iiiiiii me@company.io38.03 px driftv2 · Vision word spans bounds (9.07 px)iiiiiii me@company.io9.07 px (4.2× tighter)
Craft 02 · Live Fix

WeChat rounded-square avatars fit cleanly

Live testing showed circular ellipses exposed corners on WeChat’s squircle avatars. The 1× raster pass inspects cornerClearance: values ≥ 0.78 keep .ellipse, while lower clearance selects .roundedRect to seal all four corners.

Before · Forced circular maskCorner pixels exposed (.ellipse)v2 Fix · cornerClearance checkAuto switches to .roundedRect
Craft 03 · Zero Bloat + First-Click Delete

No extra settings, effortless per-box cleanup

The toolbar stays untouched with its 3 toggles and 2 styles. Right after Auto Redact finishes, Framecho switches to .select with nothing selected—click any single box and press ⌫ to remove it without starting a drag selection. The subtle AutoRedactionReviewPill supports category toggles and full Undo before fading after 8 s.

Existing:Sensitive TextUsernamesAvatarsAuto switch to .selectPost-redact muscle memory:1. One-click Auto Redact2. First-click isolates box3. ⌫ Delete / ⌘Z Undo batchRedacted 8 itemsText 4Users 2Avatars 2Undo All✕ 8s
05 · Architecture & Privacy

Every pixel stays on your Mac. Offline by design.

Screenshots awaiting redaction hold real secrets—chats, API keys, connection strings, IDs. Every Vision request, raster pass, and heuristic in Framecho v2 runs 100% on-device via Apple Vision and CoreGraphics.

v1 Serial Path (~2011.8 ms on 5K)Disk Write & PNG Decode12-Tile Serial 2-Pass OCRChar Ratio + Repeat Pixelsv2 Concurrent Path (400.6 ms ROI cold / 5.04 ms prewarm)In-Memory CGImage200ms Prewarm + LRU3-Way Concurrent Pipeline• ROI + Prune + Selective CJK• Faces/Bodies/QR + 1× RasterExact Geometryspans + Adaptive Shape

100% On-Device Vision

OCR, faces, QR codes, table inference, and secret entropy checks never touch a server.

Complex inside, simple outside

Multi-secret splitting, code exemptions, and rounded-square detection require zero regex sliders from users.

Backward Compatible

Existing .framecho documents open untouched on macOS 15+; optional RedactionShape defaults safely.

06 · Test Protocol & Limits

Open about the remaining 3 missed targets

Publishing what didn’t hit 100% sets clear engineering targets for the next pass.

2 Remaining Miss Patterns (3 / 40 Missed)

  • Unspaced inline CJK + phone (5k-desktop w1-phone): Strings like "联系电话 138-0013-8888 已更新" occasionally tokenize awkwardly at 5K scale (whereas the same number matches reliably in chat-mixed and qr-and-form). Next step: tighten CJK/digit boundary splitting.
  • Asymmetric two-line right chat bubble (chat-mixed right-avatar / right-name): When an outgoing right-hand bubble has only two lines whose horizontal offset exceeds infoBlocks tolerance, the right-hand slot is skipped. Planned fix: add dedicated single-line right-aligned bubble slots.

Reproducible Environment

  • Hardware & Timestamp: Apple M4 · macOS 27.2.1 · Swift 6 strict concurrency (-strict-concurrency=complete -default-isolation MainActor) · -O; benchmarks recorded 2026-11-28 19:19 (UTC+9).
  • Fixtures: 6 synthetic 144 dpi (2× Retina) scenes totaling 40 sensitive targets plus high-frequency false-positive decoys.
  • Timing: 1 process-level warmup, then 3-run median (ms) per entry with unique invalidated cacheKey per cold run.
  • Verification: check-smart-redaction, check-annotation-engine (359 checks), check-annotation-document (50 checks), check-localizations (42,958 checks), and check-text-fit all pass.
Read nextControlled qwen-plus + 409 ms Apple Offline: Screenshot Translation 1.0.2
Read full report →
Try on your Mac

Download Framecho and test both engines directly

Screenshot capture, markup, local Auto Redaction, and dual-engine Screenshot Translation are built into Framecho—zero image pixels leave your Mac.