Skip to content

refactor: batch Flash PDF page extraction - #40

Merged
myhloli merged 2 commits into
nextfrom
codex/flash-pdf-03-extraction
Sep 5, 2026
Merged

refactor: batch Flash PDF page extraction#40
myhloli merged 2 commits into
nextfrom
codex/flash-pdf-03-extraction

Conversation

@myhloli

@myhloli myhloli commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Motivation

Flash opens each page through nine separate accessors and decodes visible paths again for drawing-line and path metadata extraction.

Modification

Add a private Python-only page snapshot collected inside one PDFium page lifecycle. Share decoded subpaths while isolating failures in each derived result. Retain independent accessors and move pdftext list/PageChars conversion into one adapter module.

This is stage 3/6 of the Flash PDF equivalence refactor, based on codex/flash-pdf-02-hotspots. Review and integrate stages in order.

Validation

31 documents / 298 pages remain completely equivalent. All 49 PDFDocument tests pass, including rotation/CropBox, Form, images, signatures, links, single-open cleanup and shared path decoding. Representative medians improve further over the preceding performance stage.

The original test_demo_sparse_table_confidence_manifest bbox expectation failure is documented separately and its expected data is not modified.

Compatibility

The existing PdfModel.predict(), PDFDocument methods, ModelJson/MiddleJson output and renderer contracts remain unchanged. Recognition thresholds, candidate priority and fallback behavior are preserved.

Checklist

  • Relevant Ruff checks and git diff --check pass.
  • Focused regression and complete corpus output comparisons recorded.
  • New functions have Chinese docstrings and explicit type annotations.
  • Documentation or module responsibility docstrings updated.
  • Remote CI and CLA checks completed.

@myhloli
myhloli changed the base branch from codex/flash-pdf-02-hotspots to next September 5, 2026 07:36
@myhloli
myhloli marked this pull request as ready for review September 5, 2026 07:36
@myhloli
myhloli merged commit 0d0df6f into next Sep 5, 2026
1 of 2 checks passed
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-09-05T07:36:42.443366Z 88bfad1 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot locked and limited conversation to collaborators Sep 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant