napi: add probe-doc.mjs for single-region detect_vector_grid checks#80
Open
abimaelmartell wants to merge 1 commit into
Open
napi: add probe-doc.mjs for single-region detect_vector_grid checks#80abimaelmartell wants to merge 1 commit into
abimaelmartell wants to merge 1 commit into
Conversation
Generalized one-shot probe — calls detectVectorGridInRegion against a single PDF + region without spinning up the api or running the bench. Useful for fast pdf-inspector dev loops: cargo build --release && cd napi && bun run build:debug node probe-doc.mjs <pdf-path> [page] [bbox] [dpi] Output: cells/rows/cols and timing, or null when the region has no vector grid. ~5s round-trip vs ~30s for the full bench harness. Generalizes the existing probe-indent.mjs pattern so it works on arbitrary PDFs, not just the multi-line indent fixture.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Generalizes the existing `probe-indent.mjs` pattern into `probe-doc.mjs` — a one-shot probe that calls `detectVectorGridInRegion` against a single PDF + region, useful for fast dev loops without the full bench harness or api round-trip.
Usage
Output: `cells=N rows=R cols=C (Xms)` or `null`, plus echoed page/bbox/dpi for paste-friendly logs.
~5s round-trip vs ~30s for the full bench. Useful when iterating on `detect_rects.rs` and you want to confirm the binding behavior on a specific failing PDF before running the broader corpus.