Skip to content

Accelerate field-grounding rectangle coverage with Rust - #72

Closed
xujustinj wants to merge 2 commits into
mainfrom
codex/native-grounding-geometry
Closed

xujustinj wants to merge 2 commits into
mainfrom
codex/native-grounding-geometry

Conversation

@xujustinj

@xujustinj xujustinj commented Oct 5, 2026 •

Copy link
Copy Markdown

Rectangle union coverage spends most of its time in Python cell scans during field-grounding scoring. Move those scans into a binding-free Rust core with thin PyO3 bindings and batches bounded to one page/group. Python retains boundary ordering, text comparison, candidate decisions, thresholds, and all metric metadata.

The mixed package builds with Maturin and CPython 3.12+ ABI3 wheels. Add wheel builds/install checks for Linux and macOS on x86_64/arm64 and Windows x86_64, source-distribution rebuild coverage, and source-aware uv cache keys. Package versioning remains single-source through Cargo and installed distribution metadata.

Validation:

  • 1,030 library tests on Python 3.12 with all runner extras.
  • Rust unit/doc tests, strict Clippy, formatting, Python lint and targeted type checking.
  • Frozen Python geometry parity: seeded rectangle batches, page/group scopes, nonfinite coordinates, signed zero, overlaps, duplicates, degenerate boxes, and localization threshold neighbors. These tests catch numerical or ordering changes at the binding boundary.
  • Wheel and source-distribution builds; clean Python 3.12 wheel install, CLI execution, native parity tests, typing and report assets.
  • Alternating cached-document replay retained every metric and metadata field; representative Parse grounding median 37.53s → 15.23s across three repetitions. These timings cover a grounding pass, not the full workflow.
  • Cross-platform wheel installation checks in CI.
  • Full 27-document cached replay: 24 stragglers plus three controls, both grounding paths, exact metric and metadata equality. 6 documents have numeric Parse rules; 21 retain their baseline empty Parse field-metric list. All compressed replay artifacts were checked against their recorded hashes.
  • Python 3.14 core suite (889 passed, 28 optional skips) and native parity. Full runner extras were validated on Python 3.12 after the existing Pillow 11.1 source build on Python 3.14 required unavailable JPEG headers.

Source installs now require Rust 1.83+ and a C linker.

@xujustinj xujustinj closed this Oct 6, 2026
@xujustinj
xujustinj deleted the codex/native-grounding-geometry branch October 6, 2026 01:10
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