Skip to content

Rebase ESM + Vite/Vitest onto CIOS/MSM stack - #76

Merged
OBrezhniev merged 5 commits into
feature/msm-signed-bucketsfrom
feature/esm-tooling
Jul 13, 2026
Merged

Rebase ESM + Vite/Vitest onto CIOS/MSM stack#76
OBrezhniev merged 5 commits into
feature/msm-signed-bucketsfrom
feature/esm-tooling

Conversation

@OBrezhniev

Copy link
Copy Markdown
Member

Rebase ESM migration onto our CIOS/MSM stack (ES modules + Vite/Vitest)

Applies the feat/esm-migration CJS→ESM conversion on top of our
feature/msm-signed-buckets work. Target: feat/esm-migration.

  • CJS → ESM across src/tools/tests/index.js, Rollup-less → Vite
    (build/main.cjs for the require condition), Mocha → Vitest, flat
    eslint.config.js, CI.
  • Keeps our rewritten hot files — ESM-converted in place, not replaced:
    build_f1m.js (CIOS / no-carry), build_multiexp.js (signed-digit),
    the opSub call sites in build_curve_jacobian_a0.js, the
    __reversePermutation export in build_fft.js, isKnownPrime in bigint.js
    — plus our AssemblyScript msm_batch module and its build tool.
  • index.js kept as ours (no bn128_wasm_gzip export — that file isn't built).
  • Interop verified: both require() and import() resolve
    { buildBn128, buildBls12381, buildF1m }.

Note: mnt6753 (legacy curve, unused by the iden3 stack) is excluded from
build:wasm and its Vitest run — its pedersen-table / base64 build tooling
needs a separate ESM pass (the same break exists on feat/esm-migration).

Validation: 87 tests pass; bn128/bls12381/msm_batch wasm regenerated.

@OBrezhniev

Copy link
Copy Markdown
Member Author

ESM-rebase set — the tooling migration re-applied on top of our optimization stack (rather than replaying the branches), so the MSM/CIOS/memory work is preserved. Review together:

Deviations from feat/esm-migration are called out in each PR body (e.g. binfileutils MAX_BUFFER_SIZE, snarkjs IIFE/bfj, mnt6753 excluded, smart_contracts test deferred). All branches keep git+https commit-ref pins; re-pin if a branch moves.

OBrezhniev and others added 4 commits July 13, 2026 13:50
CJS -> ESM across src/tools/tests/index.js (module.exports/require ->
export/import), Rollup-less build -> Vite (build/main.cjs for the require
condition), Mocha -> Vitest, flat eslint.config.js, CI workflow. Ports the
colleague's feat/esm-migration conversion, but keeps OUR rewritten hot files
(build_f1m.js CIOS/no-carry, build_multiexp.js signed-digit, the opSub call
sites in build_curve_jacobian_a0.js, build_fft reverse-permutation export,
bigint isKnownPrime) — ESM-converted in place — plus our AssemblyScript
msm_batch module and its build tool. index.js kept as ours (no broken
bn128_wasm_gzip export). Verified: CJS require() and ESM import() both resolve
{buildBn128, buildBls12381, buildF1m}; 87 tests pass; bn128/bls12381/msm_batch
wasm regenerated.

mnt6753 (legacy curve, unused by the iden3 stack) is excluded from build:wasm
and its test: its pedersen-table/base64 tooling needs a separate ESM pass.
These arrived via rebase onto feature/msm-signed-buckets in mocha/CJS
form (require, this.timeout, before); align them with the migrated
tooling: ESM imports, vitest's beforeAll, timeouts from the global
vitest config.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wo6AVSAwvL9mHTpvnREZPR
@OBrezhniev
OBrezhniev force-pushed the feature/esm-tooling branch from 67ea1a6 to 9de4060 Compare July 13, 2026 12:54
@OBrezhniev
OBrezhniev merged commit ea14742 into feature/msm-signed-buckets Jul 13, 2026
2 checks passed
@OBrezhniev
OBrezhniev deleted the feature/esm-tooling branch July 13, 2026 16:15
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