Skip to content

Mutation coverage: IMPL-log10Reduce - #465

Merged
thedavidmeister merged 2 commits into
mainfrom
mutation-run2-IMPL-log10Reduce
Oct 12, 2026
Merged

thedavidmeister merged 2 commits into
mainfrom
mutation-run2-IMPL-log10Reduce

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

Adds exact-oracle tests for the first third of LibDecimalFloatImplementation.log10Reduce (range check plus steps 1-4).

testLog10ReduceOneStepExamples holds fixed examples that each take one step i in [1, 4]. Each one sits where a reciprocal off by one, or a dropped borrow in the high-word extraction, moves the floor. The expected quotients are floor(x K / 2^256) from bc. K = 2^256 / 10^(2^-i) is rounded to nearest and derived independently with bc -l at scale 200. testLog10ReduceOneStep fuzzes the same rule over a 1e69-wide window above each threshold, checked against LibExactFloat.mul's schoolbook 512-bit product.

QA

  • Discriminating tests: testLog10ReduceOneStepExamples, testLog10ReduceOneStep. On 886ca07 the suite left 12 mutants surviving (reciprocal -1, reciprocal +1 and borrow dropped, for each of steps 1-4). This PR's tests kill all 12, verified by mutation-probe with --only.
  • Mutations applied: 32 in steps 1-4 (threshold +-1, condition negated, reciprocal +-1, borrow dropped, seed increment +1, quotient discarded). The existing testLog10ReduceAtEachThreshold, testLog10ReduceBelowEachThreshold and testLog10ReduceTop kill the threshold, condition and seed mutants. testLog10ReduceOneStepExamples kills reciprocal +-1 and borrow dropped. testLog10ReduceOutOfRange killed the range check (R01-R04) in an earlier run.
  • Oracle: floor(x K / 2^256), with K = 2^256 / 10^(2^-i) rounded to nearest as the NatSpec documents. K and the expected quotients come from bc, independent of the library, and the fuzz test uses LibExactFloat's schoolbook 512-bit multiply.
  • Category check: test-only mutation coverage for log10Reduce lines 1 of 3, with no issue. Every mutant in scope is now killed, and there is no src change.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 47 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: d734d21f-854c-4bae-a1bd-a09c1f3c6452

📥 Commits

Reviewing files that changed from the base of the PR and between cfa33af and 8a66278.


📒 Files selected for processing (1)
  • test/src/lib/implementation/LibDecimalFloatImplementation.log10Reduce.t.sol

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thedavidmeister
thedavidmeister merged commit 4c71a7d into main Oct 12, 2026
7 of 8 checks passed
@linear

linear Bot commented Oct 12, 2026

Copy link
Copy Markdown

RAI-3241

@github-actions

Copy link
Copy Markdown

@coderabbitai assess this PR size classification for the totality of the PR with the following criterias and report it in your comment:

S/M/L PR Classification Guidelines:

This guide helps classify merged pull requests by effort and complexity rather than just line count. The goal is to assess the difficulty and scope of changes after they have been completed.

Small (S)

Characteristics:

  • Simple bug fixes, typos, or minor refactoring
  • Single-purpose changes affecting 1-2 files
  • Documentation updates
  • Configuration tweaks
  • Changes that require minimal context to review

Review Effort: Would have taken 5-10 minutes

Examples:

  • Fix typo in variable name
  • Update README with new instructions
  • Adjust configuration values
  • Simple one-line bug fixes
  • Import statement cleanup

Medium (M)

Characteristics:

  • Feature additions or enhancements
  • Refactoring that touches multiple files but maintains existing behavior
  • Breaking changes with backward compatibility
  • Changes requiring some domain knowledge to review

Review Effort: Would have taken 15-30 minutes

Examples:

  • Add new feature or component
  • Refactor common utility functions
  • Update dependencies with minor breaking changes
  • Add new component with tests
  • Performance optimizations
  • More complex bug fixes

Large (L)

Characteristics:

  • Major feature implementations
  • Breaking changes or API redesigns
  • Complex refactoring across multiple modules
  • New architectural patterns or significant design changes
  • Changes requiring deep context and multiple review rounds

Review Effort: Would have taken 45+ minutes

Examples:

  • Complete new feature with frontend/backend changes
  • Protocol upgrades or breaking changes
  • Major architectural refactoring
  • Framework or technology upgrades

Additional Factors to Consider

When deciding between sizes, also consider:

  • Test coverage impact: More comprehensive test changes lean toward larger classification
  • Risk level: Changes to critical systems bump up a size category
  • Team familiarity: Novel patterns or technologies increase complexity

Notes:

  • the assessment must be for the totality of the PR, that means comparing the base branch to the last commit of the PR
  • the assessment output must be exactly one of: S, M or L (single-line comment) in format of: SIZE={S/M/L}
  • do not include any additional text, only the size classification
  • your assessment comment must not include tips or additional sections
  • do NOT tag me or anyone else on your comment

thedavidmeister pushed a commit that referenced this pull request Oct 12, 2026
Keeps both #465's and this PR's log10Reduce tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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