Skip to content

Budget an embedded-font form fill as one operation #518

Closed

Description

@yhay81

Context

DESIGN.md section 3 (F6) bounds every operation by one budget. #194 (PR #489) made a form fill with Form.font set run as one transaction, but the fill makes several independently budgeted core calls: form_field_fill(draw=False), form_field_draw_face (twice), embedded_font, and add_glyphs. Text shaping is also unbounded until #493.

Goal

A form fill with an embedded Form.font charges one operation budget across all its core calls. When that budget is exceeded, the whole fill rolls back.

Scope

In: sharing one budget across the fill's core calls, and a memory-limit test that checks the rollback of a whole fill.
Out: canvas preparation (#500), and shaping budgets (#493).

Paths

  • crates/pyropdf-python/src/forms.rs
  • crates/pyropdf-engine/src/forms/
  • python/pyropdf/_form.py
  • tests/test_acroform.py

Acceptance

  • One budget covers every core call of an embedded-font fill.
  • A test sets a memory limit that the fill exceeds. It checks that the value, the appearances, and the font's glyphs all roll back, and that the undo history is unchanged.

Notes

Follows the pattern that #500 sets for the canvas. Raised in the review update on #489.

Activity

  1. added
    area:enginecrates/pyropdf-engine: interpretation, rendering, writing, understanding
    area:pythoncrates/pyropdf-python and python/pyropdf: the binding and the Python API
    on Nov 1, 2026
  2. added
    in-progressClaimed; the latest comment names the branch
    on Nov 2, 2026
  3. yhay81 commented on Nov 2, 2026

    @yhay81
    OwnerAuthor

    Claimed on branch claude/518-form-fill-operation.

  4. yhay81 commented on Nov 2, 2026

    @yhay81
    OwnerAuthor

    PR #579 on claude/518-form-fill-operation: the embedded-font fill now runs as one operation (begin_operation, generalizing begin_canvas with every document limit). Tests in tests/test_acroform.py cover one shared budget and a whole-fill rollback under a memory limit; python3 tools/check.py --locked passes locally. Next: current-head CI green, then the owner's merge decision.

  5. removed
    in-progressClaimed; the latest comment names the branch
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:enginecrates/pyropdf-engine: interpretation, rendering, writing, understandingarea:pythoncrates/pyropdf-python and python/pyropdf: the binding and the Python API

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions