Skip to content

[Fix] Fix commit adaptive batch size#30

Merged
wangxingjun778 merged 2 commits into
mainfrom
fix/v9_reviews
Jun 30, 2026
Merged

[Fix] Fix commit adaptive batch size#30
wangxingjun778 merged 2 commits into
mainfrom
fix/v9_reviews

Conversation

@wangxingjun778

Copy link
Copy Markdown
Member

No description provided.

@wangxingjun778 wangxingjun778 merged commit d93c022 into main Jun 30, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request simplifies the adaptive batch size calculation in _upload.py by removing the check for files under 10 and returning total_files for up to 100 files, alongside bumping the package version to 0.1.5+main. The reviewer identified logical inconsistencies and discontinuities in the batch size calculation logic, particularly around boundary values (e.g., dropping from 100 to 64 when moving from 100 to 101 files), and suggested a cleaner, step-based approach to make the batch sizes more predictable.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines 140 to 143
if total_files <= 100:
return max(1, total_files // 10)
return total_files
if total_files <= 10_000:
return max(64, min(256, total_files // 80))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There are a few logical inconsistencies and redundancies in the current adaptive batch size calculation:\n\n1. Redundancy: min(256, total_files // 80) is redundant because when total_files <= 10_000, total_files // 80 can never exceed 125.\n2. Discontinuity/Non-monotonicity:\n - For total_files = 100, the batch size is 100. But for total_files = 101, it drops to 64.\n - For total_files = 10,000, the batch size is 125. But for total_files = 10,001, it suddenly jumps to 512.\n\nUsing a simple step-based approach avoids redundant calculations, removes the dead code, and provides clean, predictable batch sizes.

    if total_files <= 100:\n        return total_files\n    if total_files <= 1000:\n        return 64\n    if total_files <= 10000:\n        return 256

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