Skip to content

Mutation coverage: FMT-nonScientific - #463

Open
thedavidmeister wants to merge 1 commit into
mainfrom
mutation-run2-FMT-nonScientific
Open

thedavidmeister wants to merge 1 commit into
mainfrom
mutation-run2-FMT-nonScientific

Conversation

@thedavidmeister

@thedavidmeister thedavidmeister commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Mutation run on _toNonScientific (src/lib/format/LibFormatDecimalFloat.sol) at 886ca07, mutants M14-M35 (M01-M13 killed in an earlier run). The existing suite killed 21 of 22. The survivor was M34, which drops the mstore(cursor, 0) that clears the bytes after the string in its last word. The existing memory checks only hit branches whose copies leave those bytes zero. The new case -15e2 goes through the trailing-zero fill, which writes a whole word of ASCII 0 past the end, so the padding check fails under M34.

QA

  • Discriminating tests: testFormatMemoryNonScientificTrailingZeros - fails under M34 (mutation-probe --only M34: KILLED by this test alone, after the existing suite let M34 survive), passes on base
  • Mutations applied: M14-M35 via mutation-probe, scoped with --mc to LibFormatDecimalFloatToDecimalStringTest, LibFormatDecimalFloatMemoryTest, LibDecimalFloatFormatParsePr321EquivalenceTest and LibDecimalFloatExoticFloatTest, excluding testMainEquivalenceDivFloorExamples, testMulRevertsOnlyExponentOverflowEdges, testLog10GridMonotone and testPow10Grid0-3 (out of gas on 886ca07, being fixed separately). 21 killed by existing tests; mstore(cursor, 0) removed -> padding check -> testFormatMemoryNonScientificTrailingZeros
  • Oracle: exact maths, -15 × 10^2 = -1500, plus the memory contract stated in the test contract's NatSpec (the string's last word is zero past its length)
  • Category check: n/a, no issue; test-only change pinning the uncovered padding-clear behaviour of the non-scientific formatter

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Added a regression test for formatting a negative whole number with trailing zeros.

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

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 56cda0e8-0105-4773-a605-ec67a97ba472

📥 Commits

Reviewing files that changed from the base of the PR and between 886ca07 and 5d507a2.


📒 Files selected for processing (1)
  • test/src/lib/format/LibFormatDecimalFloat.memory.t.sol

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.



Walkthrough

Adds a memory-formatting regression test. The test formats -15 at exponent 2 without scientific notation and expects -1500.

Changes

Decimal float formatting

Layer / File(s) Summary
Memory-format regression test
test/src/lib/format/LibFormatDecimalFloat.memory.t.sol
Adds a test that checks the output -1500 and documents the zero-fill padding case.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 5d507

This adds a regression check for -1500 formatting and cleared string padding; no merge-blocking risk is evident.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the change as mutation-coverage work for the non-scientific formatting path. This matches the added regression test for _toNonScientific and mutation M34.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • 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.

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