Skip to content

FFI: FFI_GroupsAccumulator missing size #22335

Closed

Description

@timsaucer

Gap

FFI_GroupsAccumulator in datafusion/ffi/src/udaf/groups_accumulator.rs does not plumb GroupsAccumulator::size. The consumer side cannot ask the producer how much memory the accumulator currently holds.

Missing method

  • size

Why it matters

Severity: minor. Memory accounting on the consumer side (spill / memory-pool tracking) reports whatever the trait default returns rather than the producer's real footprint. Wrong answers may cause unnecessary spills or, worse, OOMs that go uncaught by the pool.

Implementation notes

  • Plumb as unsafe extern \"C\" fn(this: &Self) -> usize; wrapper body calls inner.size().
  • Layout change → api change label, target main only, no back-port to branch-<major>.
  • Add a unit test (forced-foreign via mock_foreign_marker_id) asserting the consumer-side size() matches the producer's response. Integration test under datafusion/ffi/tests/ if the producer side is exercised cross-library.

Generated from datafusion-ffi skill audit. See .ai/skills/datafusion-ffi/SKILL.md §"Method coverage" and §"Known gaps to close" (originated in PR #22327). If a PR addressing this finds the omission to be a false positive, please also propose an update to the datafusion-ffi skill so future audits do not re-flag it.

Activity

  1. added
    enhancementNew feature or request
    functionsChanges to functions implementation
    ffiChanges to the ffi crate
    on May 18, 2026
  2. kumarUjjawal commented on May 21, 2026

    @kumarUjjawal
    Contributor

    Claude:

    size is already plumbed in
    datafusion/ffi/src/udaf/groups_accumulator.rs, has been since the
    original PR #14775 (Dec 2024):

  3. timsaucer commented on May 21, 2026

    @timsaucer
    MemberAuthor

    I've found that the reason this was falsely identified was that the skill would use it's memory/inference instead of validating against the file contents. Thanks for looking into it!

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

    enhancementNew feature or requestffiChanges to the ffi cratefunctionsChanges to functions implementation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions