Context
PR #56 vendored datalab-to/surya#493 (Apple Silicon MPS `.max()` kernel crash fix) into `scripts/patches/` because no `surya-ocr` release shipped with the fix. As of writing, we're on `surya-ocr==0.17.1` and the latest published release is also 0.17.1. The fix sits unreleased upstream.
When upstream cuts a release that includes PR #493, our vendored patch becomes redundant tech debt.
Proposal
Quarterly check (or watch the PR for merge):
- Check the latest released `surya-ocr` version on PyPI.
- Diff against the patched function in our installed surya — if upstream now includes `safe_max_item` (or equivalent), the fix has shipped.
- If shipped:
- Bump `surya-ocr` pin in `pyproject.toml`.
- `uv sync`.
- Remove `scripts/patches/surya-mps-fix.patch`.
- Remove `scripts/surya_mps_patch.py`.
- Remove `patch-surya` justfile target.
- Remove the documentation reference in CLAUDE.md / runbooks.
- Open PR.
Acceptance criteria
🤖 Generated with Claude Code
Context
PR #56 vendored datalab-to/surya#493 (Apple Silicon MPS `.max()` kernel crash fix) into `scripts/patches/` because no `surya-ocr` release shipped with the fix. As of writing, we're on `surya-ocr==0.17.1` and the latest published release is also 0.17.1. The fix sits unreleased upstream.
When upstream cuts a release that includes PR #493, our vendored patch becomes redundant tech debt.
Proposal
Quarterly check (or watch the PR for merge):
Acceptance criteria
🤖 Generated with Claude Code