Skip to content

Conversation

@HDauven
Copy link
Member

@HDauven HDauven commented Jan 24, 2026

Resolves #862

@HDauven HDauven requested a review from Copilot January 24, 2026 23:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive unit test coverage for several core modules in the codebase, including KZG commitment schemes, evaluations, composer components, runtime, and error handling.

Changes:

  • Added unit tests for runtime event handling and default initialization
  • Added tests for FFT evaluations including serialization, interpolation, and arithmetic operations
  • Added comprehensive error display and conversion tests
  • Added tests for gate, witness, and ECC data structures
  • Added KZG proof aggregation and commitment tests

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/runtime.rs Tests runtime initialization and event handling without panicking
src/fft/evaluations.rs Tests evaluations serialization, interpolation, arithmetic operations, and domain validation
src/error.rs Tests error variant display formatting and conversions
src/composer/gate.rs Tests gate structure traits (Copy, Clone, Eq, PartialEq, Debug)
src/composer/constraint_system/witness.rs Tests witness constants, indexing, and WireData variants
src/composer/constraint_system/ecc.rs Tests WitnessPoint and WnafRound structure accessors
src/commitment_scheme/kzg10/proof.rs Tests aggregate proof flattening and linear combination logic
src/commitment_scheme/kzg10/commitment.rs Tests commitment default initialization and conversion from projective coordinates

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Jan 25, 2026

Codecov Report

❌ Patch coverage is 93.33333% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.82%. Comparing base (16ad7e0) to head (7b842f3).

Files with missing lines Patch % Lines
src/fft/evaluations.rs 91.93% 5 Missing ⚠️
src/composer/constraint_system/witness.rs 77.77% 2 Missing ⚠️
src/error.rs 77.77% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                    Coverage Diff                     @@
##           stable-tool-chain-msrv     #858      +/-   ##
==========================================================
+ Coverage                   85.18%   86.82%   +1.64%     
==========================================================
  Files                          57       57              
  Lines                        3713     3849     +136     
==========================================================
+ Hits                         3163     3342     +179     
+ Misses                        550      507      -43     
Files with missing lines Coverage Δ
src/commitment_scheme/kzg10/commitment.rs 59.25% <100.00%> (+19.25%) ⬆️
src/commitment_scheme/kzg10/proof.rs 67.64% <100.00%> (+34.31%) ⬆️
src/composer/gate.rs 100.00% <100.00%> (+100.00%) ⬆️
src/runtime.rs 50.00% <100.00%> (+40.00%) ⬆️
src/composer/constraint_system/witness.rs 71.42% <77.77%> (+46.42%) ⬆️
src/error.rs 68.96% <77.77%> (+63.70%) ⬆️
src/fft/evaluations.rs 83.18% <91.93%> (+43.97%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 16ad7e0...7b842f3. Read the comment docs.

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

@HDauven HDauven linked an issue Jan 25, 2026 that may be closed by this pull request
@HDauven HDauven force-pushed the increase-test-coverage branch 2 times, most recently from 9b59831 to 07f0ea1 Compare January 25, 2026 00:21
@HDauven HDauven requested review from moCello and xevisalle January 25, 2026 00:24
Copy link
Member

@xevisalle xevisalle left a comment

Choose a reason for hiding this comment

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

Some tests are OK. However, the ones that simply assert that an instantiation or copy is correct, I think they could be removed... It adds LoC and complexity. What do you think?

@HDauven HDauven force-pushed the increase-test-coverage branch from 07f0ea1 to 7b842f3 Compare January 26, 2026 13:15
@HDauven HDauven requested a review from xevisalle January 26, 2026 13:23
@HDauven
Copy link
Member Author

HDauven commented Jan 26, 2026

Some tests are OK. However, the ones that simply assert that an instantiation or copy is correct, I think they could be removed... It adds LoC and complexity. What do you think?

I removed the tests you pointed out. It only dropped coverage by a very tiny amount, as most of the calls are covered by other tests.

@HDauven HDauven changed the title Add unit tests for for kzg, revulations, composer, runtime and errors Add unit tests for kzg, evals, composer, runtime and errors Jan 26, 2026
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.

Increase test coverage for the lowest covered files

2 participants