Conversation
…n` build
`mod fusion` was gated on `vision`, but it imports
`complete_table_markdown_from_items`, which is gated on `ocr`. As a result
neither `--features render-pdfium` nor `--features vision` has compiled:
error[E0432]: unresolved import `crate::tables::complete_table_markdown_from_items`
Every public item in `fusion` is OCR-shaped (`fuse_ocr_pages`,
`ocr_page_to_markdown`, `OcrFusionError`, `OcrFusionOptions`) and its
internals are driven only by the `ocr`-gated pipeline, so gating it behind
`ocr` — matching `pipeline` and `image_analysis` — is the minimal fix.
Because `vision` alone never built, nothing could depend on `fusion`
without `ocr`, so this removes no reachable API.
The same applies to the OCR-only native-text probe in `vision::pdfium`
(`PdfiumTextPage` / `extract_text_pages` / `text_chars_to_items`), which is
only called from the OCR pipeline; it is gated on `ocr` here so a
renderer-only build carries no dead code.
This restores the split the module doc comment describes: "so browser
WASM, text-only consumers, and renderer-only users take on no
model-management or inference dependencies". CI only ever built `default`
and `ocr`, which is why this broke silently — clippy jobs for `vision` and
`render-pdfium` are added as the regression guard.
Verified with `-D warnings` clippy and `cargo test` for `default`,
`vision`, `render-pdfium` and `ocr`, plus an end-to-end render under
`render-pdfium` alone.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
No issues found across 3 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Shadow auto-approve: would auto-approve. Gates fusion and OCR-only helpers behind ocr instead of vision to fix the broken vision- and render-pdfium-only builds; adds CI coverage for those feature sets.
Re-trigger cubic
This branch has not been deployed
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.
Problem
Neither
--features render-pdfiumnor--features visioncompiles onmain:mod fusionis gated onvision, but it importscomplete_table_markdown_from_items, which is gated onocr. So any feature set that turns onvisionwithout also turning onocrfails to build — including the renderer-only set.This matters because
src/vision/mod.rs's own doc comment describes exactly that split as intentional:Renderer-only is a real use case: rasterising a couple of pages to hand to a vision model, without pulling in ONNX Runtime and the OCR model stack.
Fix
Gate
fusiononocrinstead ofvision, matchingpipelineandimage_analysis.Every public item in
fusionis OCR-shaped (fuse_ocr_pages,ocr_page_to_markdown,FusedPageMarkdown,FusedPages,OcrFusionError,OcrFusionOptions) and its internals are driven only by theocr-gated pipeline. And sincevisionalone never built, nothing could have depended onfusionwithoutocr— so this removes no reachable API.The same reasoning applies to the OCR-only native-text probe in
vision::pdfium(PdfiumTextPage,extract_text_pages,text_chars_to_items), which is only called from the OCR pipeline. Gating it onocrkeeps a renderer-only build free of dead code — without it,cargo clippy --features render-pdfium -- -D warningsfails on unused items.I first tried the other direction (widening the complete-tables chain to
vision). It compiled, but clippy then reported ~6 dead-code errors underrender-pdfium, which is the signal that the dependency was pointing the wrong way. Happy to switch to that shape instead if you'd rather keepfusionavailable withoutocr— it's a larger diff.Why CI didn't catch it
The workflow only built
defaultandocr. Both happen to satisfy the import, so avision-gated module depending on anocr-gated item broke the intermediate feature sets silently. This PR addsvisionandrender-pdfiumclippy jobs as the regression guard.Verification
cargo clippy -- -D warningspasses fordefault,vision,render-pdfium,ocr,ocr-oar,model-cachecargo testpasses fordefault,vision,render-pdfium,ocrrender-pdfiumalone (noocr), withPDFIUM_LIB_PATHset:rendered 1 page(s); page 2 is 992x14003 files changed, 23 insertions(+), 3 deletions(-).
🤖 Generated with Claude Code
Summary by cubic
Fixes the
render-pdfiumandvisionfeature builds by gating thefusionmodule onocrinstead ofvision.fusionmodule importscomplete_table_markdown_from_items, which is gated onocr, sovisionwithoutocrnever compiled.vision::pdfiumare gated onocrto keep renderer-only builds free of dead code.visionandrender-pdfiumto catch this regression.Written for commit 185c753. Summary will update on new commits.