Skip to content

[CHIA-3932] test arithmetic operators against num-bigint results#716

Merged
arvidn merged 2 commits intomainfrom
arithmetic-test
Mar 2, 2026
Merged

[CHIA-3932] test arithmetic operators against num-bigint results#716
arvidn merged 2 commits intomainfrom
arithmetic-test

Conversation

@arvidn
Copy link
Contributor

@arvidn arvidn commented Feb 27, 2026

This adds fuzzers for the arithmetic CLVM operators, to ensure they agree with the result from num-bigint, including failures.


Note

Medium Risk
Moderate risk: adds new fuzz targets and dependency updates in the fuzzing crate plus relaxes Coveralls failures in CI; no production runtime logic changes, but CI/coverage behavior and fuzz coverage change.

Overview
Adds new fuzz targets (arithmetic, divmod, modpow) that compare CLVM arithmetic operator results (and expected failure cases like invalid shifts/div-by-zero/invalid modpow inputs) against num-bigint/num-integer reference behavior.

Introduces a shared clvm-fuzzing::build_args helper to construct argument lists for these fuzzers, updates the fuzz crate dependencies/lockfile accordingly, and makes the Coveralls upload step in the coverage workflow non-fatal (continue-on-error/fail-on-error: false).

Written by Cursor Bugbot for commit e5c2d54. This will update automatically on new commits. Configure here.

@socket-security
Copy link

socket-security bot commented Feb 27, 2026

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring alerts on:

  • cargo/hashbrown@0.16.1
  • cargo/indexmap@2.13.0

View full report

@arvidn
Copy link
Contributor Author

arvidn commented Feb 27, 2026

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

@arvidn
Copy link
Contributor Author

arvidn commented Feb 28, 2026

@SocketSecurity ignore-all

@arvidn
Copy link
Contributor Author

arvidn commented Feb 28, 2026

it's not obvious why rand has to depend on r-efi, and socket pointed at some files claiming they had shell access, but not to specific lines and it wasn't clear where that would happen.

All of these new dependencies come from quicktest. Perhaps it's not worth including this. These tests could probably be fuzzers instead

@arvidn arvidn force-pushed the arithmetic-test branch 2 times, most recently from aac656d to 890124f Compare March 1, 2026 13:25
@coveralls-official
Copy link

coveralls-official bot commented Mar 1, 2026

Pull Request Test Coverage Report for Build 22552638384

Details

  • 0 of 8 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.09%) to 88.131%

Changes Missing Coverage Covered Lines Changed/Added Lines %
clvm-fuzzing/src/args.rs 0 8 0.0%
Totals Coverage Status
Change from base Build 22547370160: -0.09%
Covered Lines: 6831
Relevant Lines: 7751

💛 - Coveralls

@arvidn arvidn requested a review from Rigidity March 1, 2026 14:34
@arvidn arvidn force-pushed the arithmetic-test branch from 890124f to e5c2d54 Compare March 1, 2026 21:04
@danieljperry danieljperry changed the title test arithmetic operators against num-bigint results [CHIA-3932] test arithmetic operators against num-bigint results Mar 2, 2026
@arvidn
Copy link
Contributor Author

arvidn commented Mar 2, 2026

The original version of this PR used quickcheck, but it had a large number of questionable dependencies. I changed the tests to be fuzz targets instead.

@arvidn arvidn requested a review from AmineKhaldi March 2, 2026 08:37
@arvidn arvidn merged commit 05a3a3f into main Mar 2, 2026
32 checks passed
@arvidn arvidn deleted the arithmetic-test branch March 2, 2026 11:20
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