Skip to content

PDF: reuse table grids and lane evidence - #31

Merged
myhloli merged 2 commits into
mainfrom
codex/rust-pdf-stage22-table-candidate-batching
Sep 29, 2026
Merged

myhloli merged 2 commits into
mainfrom
codex/rust-pdf-stage22-table-candidate-batching

Conversation

@myhloli

@myhloli myhloli commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Reuse frozen rule-grid components across deferred rule candidates, closed-grid detection, and owned merging.
  • Reduce repeated marker-context scanning, lane coverage sorting, single-lane short-tail validation, and per-cell glyph sorting.
  • Add an exact-type fast path for owned Bbox normalization with unchanged fallback semantics.
  • Preserve protocol 28, public SDK/API, output schema, and explicit compute/render backend selection.

Correctness

  • Public replay: 32 PDFs / 299 pages, two candidate runs per document; ModelJson, MiddleJson, assets, and diagnostics matched Stage 21 exactly.
  • MinerU dev@f504cff: 31 eligible Flash text outputs and 32 actual medium shared outputs all matched the main baseline.
  • Rust/session full tests: 5472 passed, 14 skipped.
  • Python/legacy full tests: 4762 passed, 724 skipped.
  • Cargo workspace tests, Clippy -D warnings, rustfmt, and Ruff check passed. Changed-file formatting passed; 20 pre-existing unrelated files still fail full-repository ruff format and were not modified.
  • ABI3 wheel verified in an independent CPython 3.14.4 environment. Source and wheel extension SHA-256 both bc42f1546006c340cb7175b5bbfa6698641a59057758c046a8f5f4c0bf5a222e; DocVortex core and MinerU Flash smoke outputs matched for auto and rust.

Measured performance

One warmup plus five hot runs per document, alternating baseline/candidate execution order by document, with isolated process-tree RSS sampling. First-pass ratios above 5% were reverse-order retested; none persisted above 5%.

Chain main Stage 22 Reduction Max time Max RSS
DocVortex public parse, 32 PDFs 16.535675 s 16.049855 s 2.94% 1.19798 1.00948
MinerU Flash text, 31 PDFs 16.379259 s 15.990359 s 2.37% 1.10413 1.05150
MinerU medium shared, 32 PDFs 19.056479 s 18.956444 s 0.52% 1.26994 1.04256

Reverse retests:

  • Public: demo4.pdf 0.94217; mixed_text_layout_sample.pdf.xor 1.04183; quarterly_report_financial_tables.pdf 0.98873.
  • Flash: demo4.pdf 0.96987; annual_report_research_projects_table.pdf 0.93490; fund_asset_and_transaction_tables.pdf 1.01703.
  • Shared: mixed_elements_pages_03_06.pdf 1.00299; small_ocr.pdf 0.98000; pollutant_discharge_tables.pdf 0.95873.

One-pass 32-PDF profile reductions include _detect_table_candidates 6.821288 → 4.258895 s, _materialize_table_blocks 5.383532 → 3.768801 s, _infer_text_lanes 3.251807 → 2.474491 s, and _merge_owned_table_candidates 2.223635 → 1.366970 s.

The original 2× objective remains incomplete; this PR reports only measured gains.

Not done

  • No merge, release, version bump, PyPI publication, or downstream dependency synchronization.
  • MinerU remains integration-only and its untracked examples/ directory is preserved.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-09-29T18:22:42.038222Z f3b53e6 PR opened
ℹ️ 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.

@myhloli
myhloli merged commit f09da63 into main Sep 29, 2026
22 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