Skip to content

zero_width_space_split renders a visible .notdef box — the 'visually normal' premise is false #8

Closed

Description

@siddharthsrivastava

Found by the pixels-only modality (#1) on its first day.

The bug

The generator injects U+200B (zero-width space) into the Grand Total string and comments "Visually, it will look perfectly normal." It does not. Helvetica's WinAnsi encoding has no ZWSP glyph, so reportlab renders a visible black tofu box:

Grand Total:  $99■,051.90

What this means for published numbers

The trap was designed to measure "invisible character splits text-layer tokenization while the page looks normal." What it actually measures is "model behavior when the Grand Total contains a visibly corrupted glyph AND the line-item arithmetic supports a different (decoy) number." Falling back to the arithmetic-consistent decoy on a visibly corrupted total is arguably reasonable behavior, not a trap failure.

The published leaderboard rows affected: Opus 4-7 0% and Gemini Flash Lite 0% on zero_width_space_split (mini-v4-sample). Those numbers are real measurements — of the wrong construct. They stay in the historical runs; the README claim needs a footnote until the family is re-measured.

First cross-modality data (2026-06-12, n=10/model, 150 dpi): pixels-only scores are haiku 60% / gpt-4o 40% / opus 30% — nowhere near the ~100% a truly invisible artifact would produce, consistent with the tofu box being visible.

Fix plan

  1. Render the clean number visibly; carry the ZWSP-split string in an invisible text layer (text render mode 3 — the same technique hidden_ocr_mismatch already uses). That makes the trap true to its premise: page looks normal, text layer carries the split.
  2. Add an encodability lint to the validation gates: every visibly-rendered string must be WinAnsi-encodable (generators that draw transforms like mirror_image_glyphs/upside_down_amount are unaffected — verified visually today, both render as designed). The existing five gates are text/code-level and structurally could not have caught a rendering artifact.
  3. Re-run the family on the standard panel, publish corrected numbers with the modality columns.

Generator changes alter the family's PDF bytes, so this ships as a new pdfhell version with a changelog note — same-seed PDFs for this family differ from ≤0.6.0.

Activity

  1. siddharthsrivastava commented on Jun 11, 2026

    @siddharthsrivastava
    ContributorAuthor

    Fixed in 0.6.1 (commit 18b47ee, https://pypi.org/project/pdfhell/0.6.1/) — and the lint caught a second offender the moment it existed.

    • zero_width_space_split: redesigned as two adjacent text runs at the exact pen position. Verified: render is pixel-identical to a single run; pypdf extracts '$99' / ',051.90' as separate fragments. The trap now honestly measures what it always claimed to.
    • unicode_confusable_total: the new glyph_clean gate flagged it immediately — the "visually identical" Cyrillic О rendered as T■TAL: (and the text layer carried the substitute char, never U+041E). Redesigned as a digit-zero confusable (T0TAL: vs TOTAL:), WinAnsi-safe and genuinely subtle in Helvetica-Bold.
    • Validation is now six gates: glyph_clean (no substitution glyphs in extracted text) runs right after parseable, plus a parametrized test pinning the invariant across all 17 families.

    Scoreboard impact: the ≤0.6.0 published rows for these two families (Opus 0% + Flash-Lite 0% on zwsp) are footnoted in the README pending re-measurement on the redesigned families. Same-seed PDFs for the two families differ from ≤0.6.0, as documented in both generators' docstrings.

    Two of seventeen families were structurally mismeasuring their premise, and the original five gates couldn't have caught it — the fix wasn't possible to find without the pixels modality (#1) looking at what the page actually shows.

  2. siddharthsrivastava commented on Jun 12, 2026

    @siddharthsrivastava
    ContributorAuthor

    Re-measurement complete (commit 7d1d5e9) — the final item of this issue's fix plan. 8-model PDF-modality panel on the 0.6.1 rebuilds, n=10 per family per model, zero API errors, raw JSONs in published_runs/2026-06-12-redesigned-families/.

    Model ZWS-split (redesigned) Confusable (redesigned)
    gpt-5 100% 100%
    claude-haiku-4-5 100% 70%
    gemini-flash-lite 100% 100%
    gpt-4o 100% 70%
    claude-opus-4-7 0% 100%
    gemini-2.5-pro 100% 20%
    claude-sonnet-4-6 100% 100%
    gemini-2.5-flash 100% 60%

    The redesign separated a real blind spot from an artifact:

    • Opus 4-7's zero_width_space_split 0/10 survives clean methodology. On the honest trap (visually seamless, text-layer fragmented at a run boundary), Opus alone falls for the arithmetic-consistent decoy 10/10 while every other panel model scores 100%. The published blind spot was real — it just took an honest instrument to prove it.
    • Gemini Flash Lite's 0% is withdrawn — it measured the tofu box. On the redesigned family it scores 100%.
    • New finding: Gemini 2.5 Pro fails the digit-zero confusable (T0TAL: vs TOTAL:) at 20%, the worst on the panel by 40 points.

    README + CORRECTION_NOTICE updated; the main leaderboard's full-suite columns remain labeled pre-redesign until the next full panel. Closing — every item in the fix plan is done: invisible-split redesign, digit-zero redesign, glyph_clean gate, panel re-measurement, corrected claims.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions