Skip to content

fix(manifest): reject oversized partition fractions - #801

Merged
kstonekuan merged 2 commits into
Hebbian-Robotics:mainfrom
harsh21234i:fix/800-manifest-fraction-overflow
Nov 20, 2026
Merged

kstonekuan merged 2 commits into
Hebbian-Robotics:mainfrom
harsh21234i:fix/800-manifest-fraction-overflow

Conversation

@harsh21234i

@harsh21234i harsh21234i commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

ManifestPartition leaked OverflowError when given an integer fraction too large for float conversion.

Reproduction

from hflow.manifest_splits import ManifestPartition

ManifestPartition("train", 10**400)

Actual result:

OverflowError: int too large to convert to float

Expected result: a clear ValueError consistent with other invalid partition fractions.

Changes

• Reused require_finite_float() for consistent numeric validation.
• Added a regression test for oversized integer fractions.

Validation

• Ruff checks passed.
• Ruff formatting check passed.
• Python compilation passed.

Closes #800

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@greptile-apps

greptile-apps Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; the previous test failure is fixed.

Summary

ManifestPartition now uses require_finite_float to reject oversized integer fractions with ValueError instead of leaking OverflowError.

  • Oversized partition fractions now raise a clear ValueError.

Reviews (2) · Last reviewed commit: "test: align bool fraction validation mes..." · Reviewed by Greptile

Comment thread src/hflow/manifest_splits.py Resolved

@kstonekuan kstonekuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, Harsh. Ruff, ty, and the full suite passed (2,639 tests).

@kstonekuan
kstonekuan merged commit 9577b13 into Hebbian-Robotics:main Nov 20, 2026
3 checks passed
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.

2 participants