refactor: Use a range of 2^63/10+1 to 2^63-1 for large Number mantissas#6275
refactor: Use a range of 2^63/10+1 to 2^63-1 for large Number mantissas#6275ximinez wants to merge 164 commits into
Conversation
3094798 to
c01bfb2
Compare
3934fdb to
b0d8b61
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6275 +/- ##
=========================================
- Coverage 82.3% 82.3% -0.0%
=========================================
Files 1024 1024
Lines 78455 78510 +55
Branches 8978 8981 +3
=========================================
+ Hits 64574 64615 +41
- Misses 13872 13886 +14
Partials 9 9
🚀 New features to boost your workflow:
|
7275749 to
6fcb32e
Compare
- That makes minMantissa 2^63/10+1. - Simplifies many of the existing operations, and removes the need for the accessors (mantissa() & exponent()) to do any math.
…number-maxint-range * commit '5f638f55536def0d88b970d1018a465a238e55f4': chore: Set ColumnLimit to 120 in clang-format (6288)
…axint-range * upstream/develop: chore: Update secp256k1 and openssl (6327) chore: Remove unnecessary script (6326) refactor: Replace include guards by '#pragma once' (6322) chore: Remove unity builds (6300) refactor: Add ServiceRegistry to help modularization (6222) fix: Deletes expired NFToken offers from ledger (5707) chore: Add .zed editor config directory to .gitignore (6317) docs: Update API changelog, add APIv2+APIv3 version documentation (6308) fix: Restore config changes that broke standalone mode (6301) chore: Add upper-case match for ARM64 in CompilationEnv (6315) ci: Update hashes of XRPLF/actions (6316) chore: Format all cmake files without comments (6294) chore: Add cmake-format pre-commit hook (6279) chore: Remove unnecessary `boost::system` requirement from conanfile (6290)
9457b82 to
154bb65
Compare
…nt-range * XRPLF/develop: release: Bump version to 3.2.0-rc2 (7348) refactor: Enable support for `fixCleanup3_2_0` amendment (7347) release: Bump version to 3.2.0-rc1 (7335) fix: Fix a rounding error at the `Number::maxRep` cusp (7051)
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |
- Add missing headers. - Improve code coverage exclusions. - Clean up several variable names. - Improve explanatory comments. - Remove the switch statement from MantissaRange::getMin. Change it to a straight power of ten lookup.
- Demonstrates the incorrect "before" behavior
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- Downward with a negative result, and ToNearest with a remainder slightly larger than 0.5.
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
… into ximinez/number-maxint-range * XRPLF/ximinez/number-division-accuracy: CI feedback: Add test cases covering other rounding modes Apply suggestions from code review Accept AI suggestion Update the testUpwardRoundsDown test to run under all scales Review feedback from Tapanito and AI Skip clang-tidy false positive: misc-include-cleaner ci: Run PR title and description checks on staging and release branches (7331) style: Run shfmt on workflows, actions and markdown bash code (7333) Remove TMax entirely from normalizeToRange; check type matching directly Tweak how the denominator is handled in division Minor fixes: missing include, variable init, typo Test optimization: Number_test::pow10 Significant rewrite Use the local range instead of calling a function Make Number::operator/= significantly more accurate
* commit '1599c1a672': refactor: Revert "perf: Remove unnecessary caches (5439)" (7359) fix: Add zero domainID check for permissionedDomain (7362)
* commit '47365f4220': fix: Improve upward rounding edge cases for Number::operator/= (7328)
…nt-range * XRPLF/develop: ci: Check binaries separately from building them (7355) ci: [DEPENDABOT] bump eps1lon/actions-label-merge-conflict from 3.0.3 to 3.1.0 (7375) refactor: Use `STLedgerEntry` type aliases instead of `std::shared_ptr` (7282) fix: Adjust xrpld systemd service and update timer (7374) release: Bump version to 3.2.0-rc3 (7371) fix: Pin overpayment principal reduction to exact on-grid value (7360)
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
…nt-range * XRPLF/develop: (37 commits) test: Add null check unit test for `Oracle::aggregatePrice` (7306) ci: Patch conan recipe for Nix to be able to use on macOS (7532) ci: Run sanitizers on release builds too (7527) fix: Correct hybrid offer deletion on credential expiry (6843) ci: Make sanitizer flags lists in the profile, not a string (7449) ci: Make configurations launch on certain event types (7447) fix: Add [[maybe_unused]] to fix320Enabled for assert=OFF builds (7446) ci: Add `gh` and `file` to nix packages (7444) fix: Disable transaction invariants (7409) perf: Dispatch "hasInvalidAmount()" on type tag instead of dynamic_cast (7402) refactor: Retire fixUniversalNumber amendment (5962) test: Do not create data directory for memory databases (7323) ci: Launch upload-conan-deps on profile change (7442) fix: Fix Number comparison operator (7406) feat: Use C++ 23 standard (7431) refactor: Introduce XRPL_ASSERT_IF for amendment-gated assertions (7378) refactor: Change config section and key string literals into constants (7095) refactor: Use `std::move` and `std::string_view` where possible (7424) refactor: Use const function arguments where possible (7423) ci: Use XRPLF/actions build-multiarch-image workflow (7428) ...
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |
- Instead of completely removing the code, it is wrapped in an `if constexpr` sign check. That way, it's future proof in case the type of mantissa_ ever changes again. - Ironically, this partially reverts PR 7406.
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
…nt-range * XRPLF/develop: (80 commits) refactor: Retire DisallowIncomingV1 fix (7364) build: Add verify-headers target to cleanup headers (7670) refactor: Retire InnerObjTemplate fix (7368) fix: Disable AMM creation with Vault shares (7666) test: Add tests for TMProofPathResponse and TMReplayDeltaResponse invalid hash/key sizes (7593) ci: [DEPENDABOT] bump actions/setup-python from 6.2.0 to 6.3.0 (7657) build: Don't reuse binaries between different C++ versions (7681) chore: Update pre-commit hooks && actions (7686) feat: Add an invariant to ensure object deletion also deletes its pseudo-account (7445) feat: Add Batch (XLS-56) V1_1 (6446) feat: Introduce lending 1.1 amendment and add `MemoData` field to `VaultDelete` transaction (6324) chore: Use std::ranges where possible (7634) ci: Use macOS 26 Tahoe with apple-clang 21 (7601) build: Mark sec256k1 and mpt-crypto as transitive headers (7658) chore: Add a script to nicely format clang-tidy output (7650) chore: Enable most bugprone checks (7643) feat: Confidential Transfer for MPT (5860) fix: Use trustline balance direction to validate IOU PaymentMint/PaymentBurn (7584) fix: Unify freeze checks for pseudo-account deposit/withdraw (7382) fix: Block delegate tx from being queued (7640) ...
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |
|
This PR has conflicts, please resolve them in order for the PR to be reviewed. |
…nt-range * XRPLF/develop: chore: Enable modernize-use-auto (7707) build: Add protobuf dependencies to Nix (7706) feat: Enable ConfidentialTransfer and BatchV1_1 (7698) chore: Enable modernize-unary-static-assert (7705) chore: Make clang-tidy happy on macOS (7701) chore: Improve pre-commit hooks (7702)
|
All conflicts have been resolved. Assigned reviewers can now start or resume their review. |
High Level Overview of Change
This PR, if merged, will change the large mantissa range from [10^18, 10^19-1] to [2^63/10+1, 2^63-1]. This allows the
Numberclass member variables to change back to a signed int64 mantissa and int exponent as they were before 3.1.0. This removes the boolean sign flag, and will thus reduce the memory footprint of allNumbers.This is a pure refactoring. No amendment is required.
Context of Change
Type of Change