You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: close issue #249 — Emscripten OOM in CKKS unit tests
PR #1179 added ClearBootstrapPrecom and ClearSchemeSwitchPrecom helpers
but did not wire them into ReleaseAllContexts. This change completes
that work, then re-enables the EVAL_FAST_ROTATION and CONTEXT_WITH_SERTYPE
tests that PR #985 had to guard under !defined(__EMSCRIPTEN__) for the
original std::bad_alloc failure.
Library changes (no hot-path touched):
- ReleaseAllContexts now walks every live context and calls
ClearAllCKKSCaches before clearing the static maps.
- Add ReleaseAllContextsAndTrim and TrimAllocator (malloc_trim on glibc,
malloc_zone_pressure_relief on Apple, _heapmin on MSVC, no-op else).
- Add ClearAllCKKSCaches convenience on CryptoContextImpl.
- ClearBootstrapPrecom and ClearSchemeSwitchPrecom bodies made
noexcept-safe so the walk does not throw on contexts that have not
Enable(FHE)'d or Enable(SCHEMESWITCH)'d.
Test changes:
- TearDown in UTCKKSrns and UTCKKSrnsSerialize now calls
ReleaseAllContextsAndTrim.
- Mid-test ClearAllCKKSCaches between JSON and BINARY rounds in
UnitTestCKKSrnsSerialize.
- UTCKKSCacheClear extends its WITH_TCM skip to __EMSCRIPTEN__ (the
heap-probe helper has no emmalloc backend).
- Remove the !defined(__EMSCRIPTEN__) guards around the affected rows.
CI:
- Add .github/workflows/emscripten.yml: builds with emsdk 3.1.59 and
runs pke_tests/core_tests under node in two slices.
Validated on macOS + WASM:
- Native: pke_tests 1892/1892 pass, core_tests 158/158 pass.
- WASM: CKKS slice 939/941 pass (2 heap-probe tests skipped),
BFV+BGV+binfhe slice 324/324 pass, peak 1.6 GB.
Closes#249.
0 commit comments