Skip to content

Screen page images only for slides and text-less PDFs - #605

Merged
EricNGOntos merged 1 commit into
mainfrom
feat/wuchengke/2026-12-03
Dec 4, 2026
Merged

EricNGOntos merged 1 commit into
mainfrom
feat/wuchengke/2026-12-03

Conversation

@EricNGOntos

Copy link
Copy Markdown
Contributor

Summary

  • The page screen (contact-sheet VLM pass) now runs only for slide decks and PDFs without a text layer (scanned, or no page text after the text scan).
  • Text PDFs take TOC candidates from keyword hits alone, as before the screen existed.
  • The native-text test is a new helper _has_native_text(), shared with the existing stop_after_native_baseline check.
  • Phase 2 design doc notes the change.

Why

On text PDFs the screen only added TOC marker nodes for unnumbered section lists; the section structure was unchanged, while it cost about 40% of the coarse model calls.

Verification (coarse profile, cloud models)

Document Before After
Sydney Streets Code (443p, text) 139 calls, 207s, TOC pages 5,166,202,214,226,284,361,432 79 calls, 117s, TOC pages 5,284,361,432; same 105 section nodes
TAOCP Vol. 1 (665p, scanned) screened, TOC 14-15, 55 nodes still screened (no text layer), TOC 14-15, 55 nodes
Macroeconomics deck (76 slides) screened still screened, slide route unchanged
  • make check passes; tests/contract: 826 passed, 2 skipped. New parametrized test covers text PDF / blank text / scanned / slides.

🤖 Generated with Claude Code

Text PDFs already find TOC candidates by keywords in the page text. The
image screen on them only added TOC nodes for unnumbered section lists and
cost about 40% of the coarse model calls (Sydney: 139 -> 79 calls,
207s -> 117s, same 105 section nodes). Slide decks and PDFs without a text
layer (scanned, or no page text after the text scan) keep the screen, since
keywords cannot find their TOCs (TAOCP still finds pages 14-15).

The native-text test is shared with the stop_after_native_baseline check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@EricNGOntos
EricNGOntos merged commit 361ea06 into main Dec 4, 2026
6 checks passed
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.

1 participant