Skip to content

graph: Round BigInt cache weight up to full bytes#6493

Open
cuiweixie wants to merge 1 commit intographprotocol:masterfrom
cuiweixie:graph/bigint-cache-weight-byte-rounding
Open

graph: Round BigInt cache weight up to full bytes#6493
cuiweixie wants to merge 1 commit intographprotocol:masterfrom
cuiweixie:graph/bigint-cache-weight-byte-rounding

Conversation

@cuiweixie
Copy link
Copy Markdown

Summary

Fix CacheWeight::indirect_weight for BigInt to use ceiling division when converting the bit length to a byte count ((bits + 7) / 8). Integer division by eight previously undercounted values whose bit width is not a multiple of eight.

Commit convention

Matches project style: {crate-name}: {description} (see CLAUDE.md and recent history on master).

Testing

  • just lint / just check --release (recommended before merge; not run in this environment due to crates.io SSL issues)

Use ceiling division when converting bit length to bytes so values whose bit width is not a multiple of eight are not undercounted for cache accounting.
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