Skip to content

build(bench): commit go.sum, add explicit-edge mode, ignore __pycache__ - #22

Merged
hallelx2 merged 1 commit into
mainfrom
halleluyaholudele/bench-gosum-and-explicit-mode
Aug 2, 2026
Merged

build(bench): commit go.sum, add explicit-edge mode, ignore __pycache__#22
hallelx2 merged 1 commit into
mainfrom
halleluyaholudele/bench-gosum-and-explicit-mode

Conversation

@hallelx2

@hallelx2 hallelx2 commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Three small fixes to the benchmark module.

  • bench/go.sum was missing, so the committed module did not resolve in an editor. run.py was unaffected (it copies the extractor to a scratch module and tidies there), but the checked-in module should be self-consistent.
  • -oracle mode in extract.go drives pdftable through StrategyExplicit with caller-supplied row/column boundaries — the exact shape of a layout-model hybrid: the model supplies the grid, pdftable fills the cells and keeps exact coordinates.
  • __pycache__ was committed by accident; now ignored.

On the experiment this was built for

I intended to measure the ceiling of that hybrid by feeding ICDAR ground-truth boundaries. The harness is not trustworthy yet — it scored 0.119 F1 with perfect boundaries, which is near-random and clearly measures the harness rather than the extractor. Two known causes: every cell bbox edge becomes a boundary (producing dozens of spurious columns instead of clustered grid lines), and the ground-truth Y origin is unverified.

Shipping the plumbing, not the number.

Summary by Sourcery

Add explicit-edge oracle mode to the ICDAR 2013 benchmark extractor and make the benchmark module self-contained and clean for Go tooling.

New Features:

  • Add an oracle mode that drives pdftable with caller-supplied explicit row and column boundaries per page in the ICDAR 2013 benchmark extractor.
  • Extend the benchmark extractor strategy flag to support mixed, auto, lines-then-mixed, and fallback strategies with updated defaults.

Enhancements:

  • Adjust default strategy handling in the ICDAR 2013 benchmark extractor to fall back to a lines-only strategy when an unknown strategy is provided.

Build:

  • Add indirect Go module dependencies for the benchmark and commit go.sum so the bench module resolves correctly in Go tooling.

Chores:

  • Ignore Python pycache directories in version control.

Three fixes to the benchmark module.

bench/go.mod shipped without a go.sum, so the module did not resolve in an
editor even though run.py builds fine (it copies the extractor to a
scratch module and tidies there). Committing go.sum makes the checked-in
module self-consistent.

extract.go gains -oracle, which drives pdftable through StrategyExplicit
with caller-supplied row and column boundaries. That is the exact shape a
layout-model hybrid takes: the model supplies the grid, pdftable fills the
cells from the text layer and keeps exact coordinates. Worth having
plumbed even though the experiment that motivated it is not ready --
deriving trustworthy boundaries from ICDAR ground truth needs edge
clustering and a verified Y origin, and without those the harness measures
itself rather than the extractor.

__pycache__ was committed by accident and is now ignored.
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@hallelx2, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 17 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5c94d532-c66a-4fa6-aedd-8e26d0c657db

📥 Commits

Reviewing files that changed from the base of the PR and between 00c4c12 and 3ceff80.

⛔ Files ignored due to path filters (2)
  • bench/go.sum is excluded by !**/*.sum
  • bench/icdar2013/__pycache__/score.cpython-313.pyc is excluded by !**/*.pyc
📒 Files selected for processing (3)
  • .gitignore
  • bench/go.mod
  • bench/icdar2013/extract.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @hallelx2, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@sourcery-ai

sourcery-ai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds an oracle/explicit-edge extraction mode to the ICDAR 2013 bench harness, broadens strategy selection handling, commits Go module sums, and ignores Python bytecode artifacts.

Sequence diagram for oracle explicit-edge extraction mode in ICDAR 2013 bench

sequenceDiagram
  actor Caller
  participant extract_go
  participant pdftable

  Caller->>extract_go: main(strategy, oracle)
  extract_go->>pdftable: OpenFile(path)

  loop pages
    alt oracleEdges for page
      extract_go->>extract_go: mk(StrategyExplicit, StrategyExplicit)
      extract_go->>pdftable: ExtractTables(TableSettings explicit)
      pdftable-->>extract_go: tables
      extract_go->>extract_go: append tableOut
    else
      extract_go->>extract_go: select attempts by strategy
      extract_go->>pdftable: ExtractTables(TableSettings attempt)
      pdftable-->>extract_go: tables
      extract_go->>extract_go: append tableOut
    end
  end
Loading

File-Level Changes

Change Details Files
Support oracle/explicit-edge mode in ICDAR 2013 benchmark extractor and refine strategy selection.
  • Extend -strategy flag help and switch to handle mixed, auto, lines-then-mixed, fallback, and default-to-lines behavior.
  • Introduce edgeSet type and -oracle flag to load per-page explicit row/column boundaries from JSON.
  • Read and unmarshal oracle edge JSON at startup and, when present for a page, configure pdftable.StrategyExplicit with ExplicitVerticalLines and ExplicitHorizontalLines and short-circuit normal strategy attempts.
  • Ensure pages without valid oracle edges fall back to existing strategy-based extraction.
bench/icdar2013/extract.go
Make the bench Go module self-contained by committing dependency checksums.
  • Add indirect dependency requirements used transitively by pdftable to bench/go.mod.
  • Add the corresponding go.sum file for the bench module so editors and tooling can resolve dependencies consistently.
bench/go.mod
bench/go.sum
Prevent accidental commits of Python bytecode caches.
  • Update .gitignore to ignore pycache directories and their contents.
.gitignore

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@hallelx2
hallelx2 merged commit 0b39b95 into main Aug 2, 2026
5 checks passed
@hallelx2
hallelx2 deleted the halleluyaholudele/bench-gosum-and-explicit-mode branch August 2, 2026 22:51
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