Skip to content

blocked-by: rain.math.float.deploy Soldeer publish — strip deploy + Rust/npm surface (library-only) - #263

Draft
thedavidmeister wants to merge 1 commit into
mainfrom
strip/library-only
Draft

blocked-by: rain.math.float.deploy Soldeer publish — strip deploy + Rust/npm surface (library-only)#263
thedavidmeister wants to merge 1 commit into
mainfrom
strip/library-only

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

DRAFT — DO NOT MERGE. Blocked-by: rain.math.float.deploy Soldeer publish.

Strips the deploy surface and the Rust/npm surface from rain.math.float, leaving the pure Solidity math library that publishes only the rain-math-float Soldeer package. Executes the plan ruled in #262 (the migration-plan comment + the Hard Case A ruling). The concrete, deploy pins/snapshot, deploy scripts/tests, and the Rust/WASM/npm bindings now live in rain.math.float.deploy.

🔒 Blocked-by (ordering constraint)

Must not land until rain.math.float.deploy has published its rain-math-float-deploy Soldeer package, so external importers of LibDecimalFloatDeploy / the deployed addresses have somewhere to repoint. Tracker: rainlanguage/rain.math.float.deploy#1 (step 4 — sol-v* tag → Soldeer publish — is still pending). Source ruling + plan: #262.

Repointing other org consumers is out of scope here (2026-08-20 human narrowing).

Removed (77 files)

Deploy Solidity (Tier 1 + Tier 2, un-gated):

  • src/concrete/DecimalFloat.sol, src/generated/LogTables.pointers.sol, src/lib/deploy/LibDecimalFloatDeploy.sol
  • script/Deploy.sol, script/BuildPointers.sol, script/check-published-deploy-constants.sh, script/lib/LibEtchLogTables.sol
  • test/src/concrete/*.t.sol (31), test/src/lib/deploy/*.t.sol (4), test/src/lib/table/LibLogTable.bytes.t.sol

Rust/npm surface + CopyArtifacts bridge:

  • crates/** (15), Cargo.toml, Cargo.lock, package.json, package-lock.json, tsconfig.json, .prettierignore, test_js/**, scripts/*.js
  • script/CopyArtifacts.sol, script/lib/LibCopyArtifacts.sol, test/script/CopyArtifacts.t.sol
  • test/concrete/TestDecimalFloat.sol + its two wrapper tests (TestDecimalFloat.unpack.t.sol, DecimalFloat.packLossless.t.sol) — per Correction 1; direct packLossless/unpack coverage stays in test/src/lib/LibDecimalFloat.pack.t.sol
  • Workflows: copy-artifacts.yaml, manual-sol-artifacts.yaml, rainix-rs-static.yaml, rainix-rs-test.yaml, rainix-rs-wasm.yaml

Kept

  • Pure-math library: src/lib/{LibDecimalFloat, format, parse, implementation, table/LibLogTable} + src/error/*; its full test suite; the slow reference impls (test/lib/*).
  • rain-datacontract dep (the test log-tables helper needs it).
  • Lifecycle: package-release.yaml (now publishes onlyrain-math-float Soldeer), rainix-sol.yaml, pr-assessment.yaml.

Added (Hard Case C — mandatory)

test/abstract/LogTest.sol rewritten self-contained: rebuilds the combined log/anti-log tables purely from LibLogTable source (toBytes of the five tables + LOG_TABLE_DISAMBIGUATOR, byte-identical to the old frozen combinedTables()), deploys them via LibDataContract at a create address, and hands the address to the 8 transcendental tests. No Zoltu deploy pin, no src/generated.

Config edits

  • foundry.toml: drop rain-deploy + rain-sol-codegen deps, [rpc_endpoints], [etherscan], fs_permissions, ffi (no retained test uses vm.ffi). Pragma stays ^, optimizer_runs untouched.
  • flake.nix: drop test-wasm-build + test-js-bindings tasks.
  • remappings.txt / soldeer.lock regenerated (deps: forge-std, @openzeppelin-contracts, rain-solmem, rain-string, rain-datacontract).
  • .gas-snapshot regenerated for the stripped suite; CLAUDE.md / README.md / REUSE.toml / .soldeerignore / .gitignore library-only.

CI (green locally, nix develop -c)

  • forge build → successful
  • forge test444 passed, 0 failed, 0 skipped (48 suites); transcendental tests pass on the new helper
  • slither .0 results (14 contracts)
  • reuse lintcompliant (78/78 files)

QA

  • Discriminating tests: the 8 transcendental tests that consume the new LogTest.logTables() helper — LibDecimalFloat.{log10,pow,pow10,sqrt}.t.sol and LibDecimalFloatImplementation.{internals,log10,lookupLogTableVal,pow10}.t.sol. They fail if the helper deploys the wrong table bytes (transcendental lookups extcodecopy from the tables address; garbage tables give wrong results, and the packed-vs-unpacked and slow-reference cross-checks in these files diverge). Verified: 444 passed / 0 failed / 0 skipped on the stripped tree; before the strip these tests reached the tables via the Zoltu-pinned etch, and they now reach byte-identical tables via the self-contained helper (same 8 tests, same assertions, still green).
  • Mutations applied: n/a — this PR removes the deploy/Rust surface and rewrites a test helper; it introduces no new production logic to mutate. The one behavioral risk it does carry — that the rebuilt-from-source tables differ from the deployed tables — is pinned by structural equivalence (below), not left to chance: change the helper's concatenation order or drop the disambiguator and the 8 transcendental tests fail.
  • Oracle: independent of the new helper. The deleted test/src/lib/table/LibLogTable.bytes.t.sol asserted LibLogTable.toBytes(logTableDec()) == LOG_TABLES (and the same for the other four tables) against the frozen src/generated/LogTables.pointers.sol snapshot — exactly the five toBytes(...) terms the new helper concatenates. So the helper's output is provably byte-identical to the old LibDecimalFloatDeploy.combinedTables() it replaces. Transcendental expected values are additionally cross-checked against the slow reference implementations in test/lib/.
  • Category check:Split rain.math.float into a library half and a new rain.math.float.deploy #262 keep/remove list is the spec. Covered — removed = Tier 1 + Tier 2 (un-gated) Solidity deploy surface + the ruling's Rust/npm addition + TestDecimalFloat (Correction 1); kept = the pure-math surface + tests + rain-datacontract; added = the mandatory Hard Case C helper. No consumer repointing (out of scope per the 2026-08-20 narrowing).

Closes the library-strip step of #262 once unblocked.

Per rain.math.float#262 (Split into library + rain.math.float.deploy) and the
Hard Case A ruling, this repo becomes the pure Solidity math library that
publishes only the `rain-math-float` Soldeer package. The deployed concrete,
deploy pins/snapshot, deploy scripts/tests, and the Rust/WASM/npm bindings move
to rain.math.float.deploy.
Removed (77 files):
- Deploy Solidity: src/concrete/DecimalFloat.sol, src/generated/*,
src/lib/deploy/LibDecimalFloatDeploy.sol, script/{Deploy,BuildPointers,
check-published-deploy-constants.sh}, deploy tests, LibLogTable.bytes.t.sol.
- Rust/npm: crates/**, Cargo.*, package*.json, tsconfig.json, .prettierignore,
test_js/**, scripts/*.js, the CopyArtifacts bridge (script + lib + test),
and TestDecimalFloat harness + its two wrapper tests.
- Workflows: copy-artifacts, manual-sol-artifacts, rainix-rs-{static,test,wasm}.
Added / changed:
- test/abstract/LogTest.sol rewritten self-contained (Hard Case C): rebuilds the
combined log tables from LibLogTable source and deploys them via LibDataContract
at a `create` address, so the transcendental tests (log10/pow/pow10/sqrt) run
with no Zoltu deploy pin and no src/generated snapshot.
- foundry.toml: drop rain-deploy + rain-sol-codegen deps, [rpc_endpoints],
[etherscan], fs_permissions, ffi. Pragma stays `^`.
- package-release.yaml: publish only the rain-math-float Soldeer package
(drop crate + npm-package inputs).
- flake.nix: drop test-wasm-build + test-js-bindings tasks.
- CLAUDE.md/README/REUSE.toml/.soldeerignore/.gitignore/remappings: library-only.
- .gas-snapshot + soldeer.lock regenerated for the stripped tree.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@thedavidmeisterthedavidmeister self-assigned this Aug 20, 2026
@coderabbitai

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f5a9514d-fd5f-4f72-96df-7af517216f26

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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 freeto 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

@thedavidmeister