Skip to content

v0.2.5

Choose a tag to compare

@jake1104 jake1104 released this 10 Nov 14:12
· 26 commits to main since this release

GrayNFS v0.2.5

0.x carries no compatibility promise.

Highlights

  • WebAssembly target: crates/graynfs-wasm builds the engine for wasm32-unknown-unknown with wasm-bindgen and exposes factorize(decimal, budgetMs) and version() to JavaScript. Every call returns JSON (ok/input/factors/factorConfidence/method/degree/polynomial/root/relations/rank/elapsedMs/stages, or ok/input/error) and never throws; the wasm build runs single-threaded with a 1000-10000 ms budget, a 512 MiB memory budget and a fixed seed.
  • Portability seams in the core: crates/graynfs-core/src/time.rs routes every production Instant through a js_sys::Date backend on wasm and re-exports std::time::Instant on native targets; crates/graynfs-core/src/par.rs reports one worker on wasm, and all nine production thread::scope sites gained a sequential wasm branch with the native block byte-identical.
  • Version-marking release 0.2.4 to 0.2.5; no factorization-logic change on native targets.

Breaking changes

  • None for the native Rust, Python or CLI surface: FactorReport, CLI JSON and the Python dicts are untouched, and every native parallel path is unchanged.
  • Additive: the workspace gains the crates/graynfs-wasm member, a root .cargo/config.toml carrying the getrandom_backend="wasm_js" cfg for wasm32-unknown-unknown, and crates/graynfs-wasm/pkg/ is git-ignored build output.

What's changed

  • Clock seam: time.rs with a native re-export and a wasm Instant (now, elapsed, duration_since, saturating_duration_since, checked_add, checked_sub, total order, Add/Sub); eleven core modules plus prime.rs's for_each_prime now use crate::time::Instant.
  • Single-thread parity: par.rs available_workers(); five worker-count sites routed through it; sequential wasm branches at cascade.rs (ECM then SIQS), ecm.rs (two curve batches), general.rs (dependency scan and b-scan), linear_algebra.rs (candidate chunks), relations.rs (range collection with the same CPU/memory/progress accounting) and siqs.rs (two polynomial rounds).
  • wasm surface: factorize/version, a console_error_panic_hook start hook, serde_json-only payload building, the budget clamp, and scripts/wasm-smoke.mjs (Node ESM, raw-byte init) covering 10403, 600851475143 and a 105-bit budget-limited input.
  • Docs: README ## WebAssembly section with the build command, the JSON contract and the single-thread limits.
  • Known limitation, disclosed: the wasm joint stage runs ECM before SIQS, so ECM may consume the deadline that the native race would have shared.

Benchmarks

  • Native CI smoke gate (release, 16 threads, medians of 5, binary 35C614D2, 2026-11-10): OVERALL PASS 4/4, all 5/5 product-verified - bit100-deg2 siqs 1878/945 med 173.0 (limit 322.5), bit100-default ecm med 95.0 (limit 197.5), hostile105-deg2 siqs 1177/926 med 621.0 (limit 4290.0), deg3skip-deg2 siqs 240/145 med 14.0 (limit 45.0).
  • WASM smoke: 3/3 PASS, artifact 888,130 bytes; 10403 to 101, 103, 600851475143 to 71, 839, 1471, 6857, and the 105-bit corpus input at a 1000 ms budget ends in resource limit exceeded.
  • Full gates on the tagged tree: fmt clean, clippy -D warnings clean, cargo test --workspace 383 passed / 0 failed, pytest 52 passed on the attached wheel, check_version 8/8, check_api_surface 14/14, check_invariants 32/32.
  • Standing pins held exact: 1878/945, 1177/926, 240/145. One pre-existing wall-clock test (ecm_burn_bound_reports_numeric_cap) is load-sensitive; a HEAD control tree reproduces the same intermittent failure and no wasm hunk touches its path.

Full Changelog: v0.2.4...v0.2.5