Skip to content

Complete Guava P1 compatibility - #27

Merged
OldPanda merged 1 commit into
masterfrom
fix/guava-p1-compatibility
Oct 8, 2026
Merged

OldPanda merged 1 commit into
masterfrom
fix/guava-p1-compatibility

Conversation

@OldPanda

@OldPanda OldPanda commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Summary

This PR completes the P1 compatibility fixes for Guava BloomFilter serialization and behavior.

Changes

  • Match Guava 33.7.2’s false-positive-rate-based hash-function calculation.
  • Use Java-compatible rounding instead of Python’s banker’s rounding.
  • Add a configurable maximum bit-size limit when loading serialized filters.
  • Preserve the effective size limit when re-serializing trusted large filters.
  • Propagate the loading limit through the byte, hexadecimal, and Base64 loading APIs.
  • Document supported Java charset funnels and custom-funnel requirements.
  • Add cross-language sizing and serialization checks against Guava 33.7.2.
  • Add coverage for configurable loading limits and rounding edge cases.

Compatibility

The tests verify that Python and Guava agree on:

  • Number of hash functions
  • BloomFilter word count
  • Serialized length and header values
  • Serialized-data loading
  • Membership behavior after loading the same filter data

Security

Serialized filters retain a conservative default size limit to prevent excessive memory allocation. Applications can explicitly raise this limit when loading trusted data.

Testing

  • Python test suite: 25 passed, 4 skipped, 45 subtests
  • Guava integration suite: 4 passed, 20 subtests
  • Package coverage: 100% — 291 statements, 0 missed
  • Black formatting check passed
  • Mypy strict check passed
  • Bandit security scan passed

@OldPanda

OldPanda commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@codecov

codecov Bot commented Oct 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (985a856) to head (77d5186).

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #27   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          279       291   +12     
=========================================
+ Hits           279       291   +12     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T06:52:01.737697Z 77d5186 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 77d5186225

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@OldPanda
OldPanda merged commit e504de4 into master Oct 8, 2026
21 checks passed
@OldPanda
OldPanda deleted the fix/guava-p1-compatibility branch October 8, 2026 06:58
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