Skip to content

Aggregation: make the MAX_KEYS exclusive bound explicit in the public contract #16

Description

@alexanderlhicks

The internal constant documentation correctly says that MAX_KEYS is an exclusive bound. The public contract is inconsistent with that:

Exactly 65,536 slots are therefore rejected even though the public wording says they are allowed. The guest is compiled around the same strict range, so this is an API-contract and availability issue rather than a guest/host soundness disagreement.

The smallest and safest fix is documentation: consistently say "fewer than MAX_KEYS" and "at least MAX_KEYS," or rename the constant to make its exclusivity unambiguous. Accepting exactly 65,536 would instead require increasing the guest and minimum-memory range, not merely changing the host comparisons.

Please add helper-level boundary tests showing that MAX_KEYS - 1 satisfies the capacity check and MAX_KEYS returns the documented error, without constructing an enormous proof.

AI assistance disclosure: this issue was prepared with help from an OpenAI Codex agent during a fresh adversarial review of PR 10. The agent was instructed to reproduce or otherwise evidence each finding, try to falsify it, distinguish PR changes from pre-existing and later mainline changes, and make the proposed resolution pedagogical and actionable. The evidence in this issue was rechecked against merged commit f5d6e5040d666981005371742a6f21640ce865a1.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions