Skip to content

[EXPERIMENT] WebAssembly: ProSE bindings, ONNX Runtime and the engine of the ProSE app - #10575

Draft
timosachsenberg wants to merge 93 commits into
claude/emscripten-openms-library-1mutfnfrom
claude/wasm-prose-webapp
Draft

timosachsenberg wants to merge 93 commits into
claude/emscripten-openms-library-1mutfnfrom
claude/wasm-prose-webapp

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

The ProSE app built on these bindings is live at https://timosachsenberg.github.io/prose-web/ (source: timosachsenberg/prose-web, app in app/), and as a desktop application: desktop 0.3.0.

Description

Stacked on #10564 (base branch claude/emscripten-openms-library-1mutfn). Makes the search engine ProSE usable from JavaScript, in browsers and Node.js, with everything the ProSE app needs: multi-file searches pooled into one FDR, results as typed tables, the spectra of the PSMs, fragment annotation, PeptDeep predictions, and inputs larger than the 4 GB WebAssembly heap.

Restructured 2026-10-20.

Bindings (bindings/bind_prose.cpp, bind_prose_tables.cpp, bind_misc.cpp)

  • Single-file search: ProSEAlgorithm.search(spectra, database, proteins, peptides) searches one file as the ProSE tool does, PSM FDR then picked-protein FDR. For open searches it returns the modification analysis. The search parameter rescore runs Percolator in-process.
  • searchFiles(files, database, options) → ProSEResultSet:
    • one search over several mzML files, pooled into one FDR, with per-file progress;
    • options rescore, keepSpectra and removeDecoys;
    • with provideFile/releaseFile, it searches one file at a time, so only the largest file has to fit. 12 × 733 MB (8.8 GB) completes at about 3.1 GB of heap, with the same results as the all-files-present search.
  • ProSEResultSet.tables(): PSM, peptide and protein tables as typed columns, with:
    • OpenMS and ProForma strings and modification arrays;
    • protein coverage positions, q-values and indistinguishable groups;
    • all Percolator .pin features.
  • ProSEResultSet.spectra(): the MS2 peaks of the identified spectra (float32), kept with the results.
  • Annotation and prediction:
    • annotateSpectrum / annotatePeaks(mz, intensity, peptide, charge, options) annotate fragment ions on a spectrum or on stored peaks;
    • predictMS2(peptide, charge, nce, instrument) returns PeptDeep b/y intensities (ONNX builds), with charge 1–6 and NCE 10–60 validated.
  • File I/O and memory:
    • allocateFile(path, size, capacity?), writeFileChunk(), readFileChunk() move files in bounded chunks (several GB/s). Files of 2 GiB or more are rejected before anything is allocated. A capacity lets successive files reuse one block.
    • getMemoryInfo() reports the heap. std::bad_alloc and std::length_error reach JavaScript as OutOfMemory.
    • setProgressCallback(fn) forwards the ProgressLogger reports.

Performance (each measured; see "Measurements")

  • WasmFS (-sWASMFS) instead of the JavaScript file system.
  • Caching: the demo service worker (examples/sw.js) serves the module from the Cache API so Chrome keeps its compiled code (a search takes 3.8 s instead of 6.0 s from the second visit). It also adds the COOP/COEP headers on hosts like GitHub Pages.
  • Threads from a Blob: Chromium does not route a nested Worker's script through the service worker, so threads.js starts the module's thread Workers from a Blob, which inherits isolation.

ONNX Runtime: PeptDeep in the browser (preset wasm32-emscripten-mt-onnx-release)

  • ONNX Runtime 1.23.2 (static, SIMD, threads) through two vcpkg overlay ports in vcpkg-overlays/emscripten/ports. onnx is built with ONNX_DISABLE_STATIC_REGISTRATION.
  • With wasm threads, ONNXEnvironment creates the global thread pools (wasm only).
  • ONNXPredictorBase reports a model that fails to load as ParseError instead of FileNotFound; this applies natively as well.
  • Memory: PeptDeep kept about 1 GB of heap per rescored file. The memory pattern is now off, the NCE selection predicts each sampled peptide once, and peptdeep:batch_size defaults to 128 in WebAssembly. Results are bit-identical.
  • Cost: openms.wasm is 42.6 MB instead of 29.1 MB.

Fixes

  • threads.js: the worker pool now includes the team of ProSE's spectrum-reading thread. Before, a 16-thread search hung in "Building fragment index".
  • ProSEAlgorithm: the spectrum-reading thread is joined, not detached. Under Emscripten pthreads a detached thread returns its Worker only when the main loop runs, so searchFiles of 7 or more files hung. Nothing changes natively; develop has no WebAssembly, so the fix stays here.
  • wasmfs_node.js: works around emscripten#27825. A failed host open used the errno as a descriptor, and a later close closed a Node worker's epoll descriptor, aborting about 1 in 4 threaded test runs.
  • FS.writeFile / FS.write / FS.read throw ENOMEM instead of overwriting memory from address 0.
  • Demo service worker (examples/sw.js, sw-client.mjs):
    • it deleted every cache store on the origin it did not own, including other apps' stores; it now deletes only its own;
    • the client resolved the scope against the page, which registered examples/prose/ instead of examples/;
    • it sometimes skipped the isolating reload; it now reloads unless the page is crossOriginIsolated.

Library changes in this PR (outside src/openms_wasm)

Measurements

60-minute Orbitrap TMT run (6,103 MS2 spectra, 78 MB mzML), Node.js 24, threaded build. Native is the ProSE tool of June 2026 in the OpenMS tools container, which adds about a second of startup and is four months older.

Database, search Threads WebAssembly time WebAssembly memory Native time Native memory
Erwinia (4,499 proteins), tryptic 1 3.2 s 0.5 GB 4.5 s 0.25 GB
Erwinia, tryptic 16 2.9 s 0.9 GB 2.5 s 0.25 GB
Erwinia, open search ±500 Da 16 3.9 s 0.9 GB 5.7 s 0.46 GB
human (20,652 proteins), tryptic 16 8.6 s 2.0 GB 6.2 s 1.6 GB
human, semi-tryptic 16 fails above 4 GB 47 s 28 GB
human, semi-tryptic, database:chunk_size=2000 16 24 s 2.4 GB
  • In Chromium, in a Web Worker on an isolated page, the Erwinia search took 2.2 to 2.7 s on 1 to 16 threads, the same as in Node.js.
  • From 4 to 32 threads, neither build got much faster: decoy generation, parts of the index build and reading the spectra are serial.
  • Mounting the input with WORKERFS made the 16-thread search take 29 s instead of 2 s. The helper thread's file reads are proxied to the busy calling thread. The app therefore copies the input into memory, and the README warns about this.

PeptDeep, on the data of TOPP_ProSE_11_rescore (2,789 MS2 spectra, 16 threads). Native is develop built with ONNX.

Native ProSE Node.js Chromium
search with Percolator 9.4 s 10.6 s 11.2 s
with PeptDeep features 12.2 s 13.9 s 12.7 s (14.5 s the first time, while the models load)

The 896 PSMs are the same with and without PeptDeep. This test set is saturated, and all its retention times are −1; the gains in #9975 come from its 20-file benchmark.

Notes and open questions

  • wasm64 for larger searches: measured, not worth it for ProSE. I built a Memory64 variant of the threaded build locally (triplet with -sMEMORY64=1, 16 GB limit; not part of this PR). In Node.js and Chromium, on the searches below, it was 10 to 20 % slower and used 1.5 to 3 times the memory of wasm32, probably because the allocator reserves larger segments per thread with 64-bit pointers. The semi-tryptic human search failed in wasm64 as well, as it needs more than 16 GB (native: 28 GB). With database:chunk_size=2000 wasm32 ran it in 24 s and 3.8 GB, wasm64 in 27.5 s and 12 GB. Larger chunks (8,000) need wasm64 and were slower (35.5 s, 10.5 GB). A wasm64 build also changes the JavaScript API: Embind passes size_t as BigInt, so every binding with a Size index or count would need adapting (14 of 42 JS tests fail on that).

    Search (16 threads unless noted) wasm32 wasm64
    Erwinia, tryptic, 1 thread 2.6 s, 0.5 GB 3.0 s, 0.7 GB
    Erwinia, tryptic 2.2 s, 0.9 GB 2.5 s, 1.9 GB
    Erwinia, open search ±500 Da 3.4 s, 0.9 GB 3.9 s, 1.9 GB
    human, tryptic 7.5 s, 1.9 GB 9.2 s, 2.9 GB
    human, semi-tryptic, chunks of 2,000 proteins 23.2 s, 3.8 GB 25.8 s, 12 GB
    Chromium, Erwinia, tryptic, 1 / 16 threads 2.65 / 2.4 s 3.05 / 2.7 s
  • Safari's thread count is unclear. The app and threads.js size the thread team and the worker pool from navigator.hardwareConcurrency. It is not clear whether Safari reports the actual number of cores there; it may cap or round the value. Safari, and Firefox, are not tested.

  • ProSE: FDR:PSM = 0 does not report q-values natively. The parameter description says "set to 0 to disable filtering and report all PSMs with q-values". With 0, the hits keep their ln(hyperscore) scores and carry no q-values. The bindings annotate them (with FDR:PSM 0 and no Percolator); the library's description or behaviour should change, separately from this PR.

  • PeptDeep: the automatic NCE can pick a different grid point on different platforms. With peptdeep:nce at -1, PeptDeepRescoring picks the NCE with the best median cosine. On the data above the grid is nearly flat: natively 26 (0.55504), in WebAssembly 36 (0.55503), and the feature values differ accordingly (median 0.04). With the NCE fixed, the five features of all 896 PSMs agree within 3.3e-7. Picking the centre of the grid on near-ties would make the choice stable, separately from this PR.

  • ONNX Runtime in the single-threaded build, and a build of ONNX Runtime with only the operators the PeptDeep models need (smaller module), are not tried yet.

  • Linking the module needs tsc for --emit-tsd. The emsdk does not ship it; the GitHub runner has it. Locally, install it, for example npm install typescript@7, and put it on PATH.

  • Heap growth: for many small files, heap use grows per file and with the thread count (the ProSE app measured about 0.2 GB per further file at 4 threads). The README documents it; the app caps threads for many-file searches.

  • Library bug found on the way: since d49ba5f, PeakFileOptions::setSkipChromatograms(true) makes MzMLHandler return every spectrum empty (MzMLHandler.cpp:160). It is not used here.

Tests

After merging develop (Node 24.19, Emscripten 6.0.12):

Build Node tests Pass Fail Skipped Chromium (tests/browser/run.mjs)
wasm32-emscripten-mt-onnx 91 86 0 5 7/7
wasm32-emscripten-release 91 76 0 15 6/6
  • The skips are the loader-package tests, plus the ONNX-only and thread-only tests in builds without those features.
  • The multi-file results match the TOPP test ProSE_13_merged.
  • The new browser scenario for the demo service worker fails on the old sw.js (store check) and on the old sw-client.mjs (isolation and scope checks).
  • ProSEAlgorithm_test compiled to WebAssembly passes.
  • Native, Release with ONNX: ctest -R "ProSE|PeptDeep|OpenSearchModificationAnalysis|Percolator_test" passes 83/83 after the merge.
  • The ProSE app's own suites (prose-web: 516 unit and 91 end-to-end tests) pass against the module of 7abcb28, the branch state before the develop merge.

Checklist

  • Make sure that you are listed in the AUTHORS file
  • Add relevant changes and new features to the CHANGELOG file
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes
  • Updated or added python bindings for changed or new classes (Tick if no updates were necessary.)

🤖 Generated with Claude Code

timosachsenberg and others added 7 commits October 14, 2026 18:10
…read

In browsers the Web Workers of the threads are started with the module, as a thread that
finds the pool empty waits for a new Worker, which cannot start while its creator blocks.
ProSE reads the spectra on a helper thread with a quarter of the threads (at least 2, at
most 16) while the calling thread's team builds the fragment index. With 16 threads that
needed 19 workers of a pool of 18: the search hung in "Building fragment index". The pool
now also holds that helper team (21 workers for 16 threads).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- ProSEAlgorithm.search(spectra, database, proteins, peptides): one spectrum file as the
  ProSE tool searches it (PSM FDR, then picked-protein FDR if FDR:protein is set; no
  Percolator), returning the run and index statistics and, for open searches, the
  modification analysis (delta masses, mapped PTMs).
- setProgressCallback(fn): progress reports from the ProgressLogger, on the calling thread
  (in a Web Worker, forward them with postMessage()).
- annotatePsmQValues(peptides): q-values by target-decoy competition without filtering (with
  FDR:PSM = 0, ProSE reports its scores only).
- annotateSpectrum(spectrum, peptide, charge, options): the fragment ions of a peptide matched
  to the peaks of a measured spectrum, for spectrum viewers; PeptideHit.getPeakAnnotations().
- getMemoryInfo(): heap size (the high-water mark after a computation) and limit.
- C++ memory errors (std::bad_alloc, std::length_error) reach JavaScript as OutOfMemory errors.
- Tests: TOPP_ProSE_1 reproduced (same PSMs and scores), progress, q-values, open search,
  annotation; the Chromium tests run ProSE on the page and in Workers, with and without threads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
examples/prose: a web application around ProSE that runs OpenMS in a Web Worker. Settings
generated from ProSE's parameters, progress bar, summary, score and precursor-error
distributions, delta masses and PTMs of open searches, PSM and protein tables, and for each
PSM the sequence with its fragment coverage, the spectrum annotated and mirrored against the
theoretical one, the fragment mass errors and all PSM features; idXML and TSV downloads.
All cores (at most 16) on cross-origin isolated pages. The input files are copied into the
module's memory: from WORKERFS, the reads of ProSE's helper thread made a search 13x slower.
A search beyond the 4 GB of the module is reported with what to change, and OpenMS restarted.

examples/node/prose.mjs: a search from the command line with time and memory.

README: ProSE, measured time and memory against native ProSE, the WORKERFS caveat.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…operly

The display rules of the progress bar and the section headings overrode the hidden
attribute and the advanced-parameter toggle.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Percolator is part of the OpenMS library (OpenMS::Percolator, vendored), so it runs in the
WebAssembly module as well. search(spectra, database, proteins, peptides, { rescore: true })
rescores the PSMs as the ProSE tool's -rescore does (src/topp/ProSE.cpp, rescoreWithPercolator_):
the search runs with the FDR filters deferred, Percolator replaces the scores by q-values
(PIN feature set with the search engine's extra features, train_best_positive,
post_processing_tdc), then the PSM and protein FDR apply. The summary reports whether it was
applied, why not (fewer than 100 PSMs, no decoys) and how long it took. Percolator uses OpenMP,
so it also runs in the single-threaded build.

The web application has a "Rescore with Percolator" option, shows the outcome, and plots
Percolator's scores. Test: the data and settings of TOPP_ProSE_11_rescore.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…from the ProSE tool

Move the in-process Percolator rescoring of ProSE -rescore (rescoreWithPercolator_ and
pinEnzymeName_ of the tool) into ProSEAlgorithm::rescoreWithPercolator, and the PSM-level FDR
that the tool applies after it into ProSEAlgorithm::applyDeferredPsmFDR, so that the tool and
other callers, such as the WebAssembly bindings, share one implementation instead of copies.

rescoreWithPercolator returns whether the PSMs were rescored and, if not, why (fewer than
100 PSMs, no run, no decoy PSMs, Percolator failed) as a sentence for the caller to report;
the tool logs it with the input file name as before. The Percolator settings, the best-hit
filter, the run metadata and the deferred FDR are unchanged: the outputs of all TOPP_ProSE
tests are identical before and after, apart from dates and timings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
timosachsenberg and others added 12 commits October 14, 2026 20:53
ProSEAlgorithm.search() rescores with Percolator unless { rescore: false } (it is skipped, with
the reason, without decoys or with fewer than 100 PSMs). The web application has the option
checked, the Node.js example takes --no-rescore.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… 'rescore')

ProSEAlgorithm gets the parameter 'rescore' (default true; -Search:rescore in the ProSE tool).
Every search path (search(), searchWithModificationAnalysis(), single and multi-file) then
rescores each run with rescoreWithPercolator at the point where it applied FDR:PSM, and applies
the PSM FDR with applyDeferredPsmFDR on the rescored PSMs; the file-based search() applies
FDR:protein afterwards, as before. SearchResult::percolator reports the outcome per run (also in
pyOpenMS). Runs of which only some were rescored report different search engines and are not
pooled into the multi-file aggregate (IDMergerAlgorithm would throw).

The tool drops its -rescore flag, its FDR deferral and its own rescoring and PSM FDR steps; it
warns with the input file name from the reported outcome and always consumes the aggregate for
-out_merged. -Search:rescore false restores the previous output.

The TOPP tests of the search itself run with -Search:rescore false and keep their references;
the TOPP_ProSE_11_rescore* tests use the default. ProSE_6_fdr.ini loses the stale tool-level
'rescore' item, which the INI update otherwise carries over to Search:rescore.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflict in ProSEAlgorithm.cpp: the FDR:PSM description of #10577 merged
with 'rescore' (default true): the threshold applies to the Percolator
q-values; the 0-computes-no-q-values rule holds for runs that are not
rescored.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01M3YnimeP8fbge5gAJvbB88
…warning

- ProSE: with -out_merged, input files of which Percolator rescored only
  some are rejected with a clear error and exit code
  INCOMPATIBLE_INPUT_DATA, after the per-file outputs and the report are
  written. Before, the merger's exception was only logged and ProSE
  exited successfully without the merged idXML, which with rescoring on
  by default hits any batch with one small run. A merged idXML that
  cannot be written for another reason now also fails the run
  (CANNOT_WRITE_OUTPUT_FILE), like the merged Parquet files, and is no
  longer listed among the written outputs.
- ProSEAlgorithm: when the PSM FDR after a skipped rescoring cannot be
  applied, the warning names the cause: no decoys (decoys=ignore), or no
  PSM matched a decoy protein; a run without PSMs warns nothing, as
  without rescoring.
- CHANGELOG: drop the truncated duplicate of the Percolator PEP fix
  (merge artifact) and name the rescoring without the removed -rescore.
- Test TOPP_ProSE_11_rescore_mixed: one file rescored, one too small.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01M3YnimeP8fbge5gAJvbB88
With rescoring, the summary reported the statistics the search collected before Percolator and
the deferred FDR (all PSMs, fdrApplied false): a search of a bacterial run against the human
proteome reported 1,341 target PSMs although none passed the FDR. The binding now recounts them
from the final PSMs with ProSEAlgorithm::updateFinalStats, as the ProSE tool does. The test checks
the counts against the PSMs returned.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…he learned model

Percolator's sanity check replaces the learned SVM weights by the default
direction (the best single feature) when they find no target at
q < test_fdr on the held-out folds, or fewer targets than that feature.
This happens for blank runs, and for small runs: q-values count the
decoys + 1, so a fold needs about 1 / test_fdr targets above its first
decoy. Until now only the raw "Resetting score vector ... Use --override
flag" line on stderr told, and ProSE counted such a run as rescored
without comment.

- Percolator::usedDefaultDirection(): whether the last rescore()/train()
  used the default direction. The wrapper's SanityCheck is a subclass
  that records the outcome of validateDirection(); the vendored sources
  are unchanged.
- ProSEAlgorithm::PercolatorRescoring::warning (also in pyOpenMS) names
  such a rescoring; the ProSE tool warns per file.
- The "No decoy PSMs" skip reason no longer tells a search with decoys to
  use decoys 'auto' or 'generate': it names both causes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01M3YnimeP8fbge5gAJvbB88
…d outputs

- ProSEAlgorithm_test: the check that a search too small for Percolator
  gives exactly the PSMs of 'rescore' false compared the run identifiers,
  which hold the time of each search ("ProSE_" + DateTime::now()). It
  failed whenever the two searches ran in different seconds (seen in CI
  with clang++; reproduced with a 1 s pause between them). Clear them
  first, as the other identity checks of this test do.
- TOPP_ProSE_11_rescore_mixed: remove the outputs of an earlier run first,
  so stale files cannot pass the FileInfo checks, and check that no merged
  output is written.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01M3YnimeP8fbge5gAJvbB88
The module's file system is WasmFS (-sWASMFS), implemented in C++ inside the module, instead
of Emscripten's JavaScript file system. The JavaScript one lives on the main thread, and every
file read of another thread waits for it. ProSE reads the spectra on a helper thread while the
main thread's team builds the fragment index, and so got them too late to restrict the index:
a search against the human proteome indexed 4.0 M instead of 1.5 M peptides and took 8.7 s
instead of 5.8 s (16 threads, Chromium). With WasmFS, threads read directly.

WasmFS has no NODEFS or WORKERFS to mount from JavaScript: Node.js mounts a host directory with
the new mountHostDirectory(mountPoint, hostDirectory) and removes it with unmount(); browsers
write files into the file system (FS.writeFile), which is in memory and read by every thread.
The tests and the Node.js examples mount through the new functions.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
… isolates the page; threads from a Blob

Chrome keeps the compiled code of a WebAssembly module it could cache, and V8's optimized
code with it: a ProSE search against the human proteome took 5.9 s on the first visit and
3.7 s on later ones. That needs openms.wasm to come from the HTTP cache or from a service
worker's Cache API store, not from a server that says no-store, and the response must be
the stored one, untouched. Threads need a cross-origin isolated page, i.e. the COOP/COEP
headers, which static hosts such as GitHub Pages do not send.

examples/sw.js (registered by both demos through examples/sw-client.mjs) does both: it
adds the isolation headers to the page and to every response but openms.wasm, and serves the
module files from the Cache API, answering even the first request from the store so that
Chrome keeps the compiled code from the first visit on. The application's files are fetched
from the network and fall back to the store offline. Stores are named after the package
version. On the first visit a page that is not isolated reloads once.

Chrome fetches the script of a Worker created inside a Worker directly from the server, past
the service worker: the module's thread Workers, created inside the page's Worker, were
blocked for the missing header. In browsers, threads.js now starts them from a Blob that
imports the module (Module.mainScriptUrlOrBlob, enabled with INCOMING_MODULE_JS_API): a Worker
started from a Blob inherits the isolation of its creator.

Measured on a server with Cache-Control: no-store and no isolation headers (the ProSE app,
Chromium, 16 threads, human proteome): visit 1 ready after 1.1 s, search 6.0 s; visits 2
and 3 ready after 0.5 s, search 3.8 s. The browser tests load the app on the server without
isolation headers and check that the worker serves it, that it is isolated, and that the
threaded build has its threads.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Conflict in CHANGELOG: develop's consolidated entries (#10584) and this
PR's entries were added at the same place; both are kept. The new entry
of #10474 names ProSE's Percolator rescoring instead of the removed
-rescore, like the other Percolator entries of this PR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01M3YnimeP8fbge5gAJvbB88
Conflicts with #10492 (FDR:protein in single-file
searchWithModificationAnalysis(); -out_pin before any FDR filter):

- ProSEAlgorithm: both bridges reset per search (last_percolator_,
  pre_fdr_peptide_ids_). The pre-FDR PSM copy of setKeepPreFdrPsms() is
  taken in applyPsmFDR_, after the Percolator rescoring and right before
  FDR:PSM (new optional parameter), in search(spectra, ctx) and in the
  chunked multi-file loop. So with 'rescore' the copy holds the rescored
  PSMs, as both sides document for -out_pin.
- ProSE tool: the rescoring report of this PR, then #10492's -out_pin
  block (before the protein FDR); the tool-side rescoring and deferred
  PSM FDR of develop stay removed. The pre-FDR copy is requested whenever
  FDR:PSM > 0, since FDR:PSM now follows the rescoring in the search.
  -out_pin description merged.
- Tests of #10492: the two new class-test sections and Test 12 (open
  search, and the variant without rescoring) set 'rescore' false, as the
  other tests of ProSE's own FDR; the rescoring variant of Test 12 uses
  the default instead of the removed -rescore. CHANGELOG entry of #10492
  names Search:rescore.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01M3YnimeP8fbge5gAJvbB88
@timosachsenberg timosachsenberg changed the title [FEATURE] WebAssembly: ProSE search engine bindings and a ProSE web application [EXPERIMENT] WebAssembly: ProSE search engine bindings and a ProSE web application Oct 15, 2026
claude and others added 9 commits October 15, 2026 16:07
TOPP_ProSE_12_pin_rescore_idXML_out diffed the idXML of two -rescore runs
at 1% tolerance. Percolator cannot train properly on this data (1 decoy
among 896 PSMs, so it skips rescaling the SVM scores; all scores lie in
[-1, -0.945]), and on Windows the percolator_score of the two runs differs
by about 1%, which failed the Windows CI of every PR.

With -rescore, compare the FileInfo hit counts after PSM and protein FDR
of the two runs instead (proteins, matched spectra, peptide hits, search
engine). The test without -rescore keeps the full idXML diff, and the
.pin comparison is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012GBvJZN8neGpv9RoUshwFL
… in browsers and Node.js

The CMake preset wasm32-emscripten-mt-onnx-release builds the threaded module with WITH_ONNX:
- vcpkg builds ONNX Runtime 1.23.2 for wasm32-emscripten-mt with overlay ports
  (vcpkg-overlays/emscripten/ports): onnxruntime as static libraries with WebAssembly SIMD and
  threads, without LTO, onnxruntime-web's JavaScript module or cpuinfo; onnx without static schema
  registration (ONNX Runtime registers the schemas itself: twice, every schema was reported).
- The CMake config of a static ONNX Runtime imports nlohmann_json: OpenMS then uses that target
  instead of its vendored copy, as it does for Arrow's.
- With WebAssembly threads, ONNX Runtime's sessions use the environment's global thread pools:
  ONNXEnvironment creates them there (one intra-op pool of omp_get_max_threads() threads), and
  threads.js starts their Web Workers with the module (onnx.js).
- A model that exists but does not load now reports ONNX Runtime's message (ParseError) instead of
  FileNotFound, which hid the cause.
- hasONNXRuntime(); the PeptDeep models are copied to models/ of the package; the ProSE web
  application has a PeptDeep option next to Percolator and loads the models on first use (cached by
  the service worker); examples/node/prose.mjs --peptdeep; a ProSE test with PeptDeep features.

Verified: the PeptDeep class tests compiled to WebAssembly pass (largest difference from Python's
ONNX Runtime 1.2e-7 for retention times, 1.1e-6 for MS2 intensities); with the same NCE, the five
features of 896 PSMs differ from native ProSE's (develop with ONNX) by at most 3.3e-7; the binding
tests pass with both threaded modules; the ProSE application searches with PeptDeep in Chromium on
16 threads (12.7 s; native ProSE 12.2 s).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
On GitHub Pages (Cache-Control: max-age=600), the worker filled the store of a new package version
with the module of the previous one from the browser's HTTP cache, and kept serving it (cache-first)
until the next version; the application files were stale for the same ten minutes. The worker now
revalidates its requests with the server (cache: "no-cache"; a 304 where nothing changed). Found
when updating https://timosachsenberg.github.io/prose-web/ to the module with ONNX Runtime.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
CHANGELOG conflict with #10594: both entries are kept, with this branch's
wording of the Percolator PEP fix (ProSE's -rescore flag is removed here).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012GBvJZN8neGpv9RoUshwFL
With Search:rescore on (the default since this PR), -out_pin was written from
the PSMs Percolator had rescored: the score column held Percolator q-values
instead of ProSE's own scores, and with report:top_hits > 1 the .pin lost
the non-best hits, mostly decoys (Test 12 data, top_hits 3: 896 rows/1 decoy
instead of 912/14). A .pin is the input of a later rescoring, as the .pin of
PercolatorAdapter is, so the search now keeps its copy for the .pin before the
rescoring as well as before FDR:PSM, and ProSE requests that copy whenever
rescoring is on. With rescoring on, the .pin is now identical to the one
without rescoring; the other outputs do not change.

Tests: TOPP_ProSE_12_pin_rescore_vs_norescore_out compares the .pin with and
without rescoring, and the rescore section of ProSEAlgorithm_test checks that
the copy equals a search without rescoring and FDR:PSM. Both fail without the
fix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UXTNzqFdQLpo9frG4dFizB
…-out_merged)

Pins the pooled output of two inputs with the default Percolator rescoring
(cross-file protein inference, then the picked-protein FDR at 5 % with the
decoys removed), generated with the unchanged tool, so that moving the
pooling into the library cannot change it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
timosachsenberg and others added 14 commits October 19, 2026 13:54
…collision energy" (MS:1000045)

spectra() read Precursor::getActivationEnergy(), which MzMLHandler sets only
from MS:1000509 "activation energy". msconvert, ThermoRawFileParser and
Bruker's converter write MS:1000045 "collision energy" instead, which
MzMLHandler keeps as the precursor's meta value "collision energy" (what
PeptDeepRescoring reads), so collisionEnergy was NaN for typical mzML files.
It now takes the meta value first, then the activation energy, and is NaN if
there is neither.

The test stores a file with MS:1000045 only, with MS:1000045 and MS:1000509,
and with MS:1000509 only; it fails on the module before the change.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
ProSEAlgorithm.search() reported only whether Percolator was applied and why it
was skipped; the caveat of an applied rescoring (its sanity check replaced the
learned model by the best single feature), which searchFiles() already passes
as percolator.warning, was dropped. search() sets it now (null if none), and
the d.ts says so.

The test searches the spectra against shuffled proteins (an open search, so
that there are PSMs for Percolator to train on), where Percolator warns, with
search() and searchFiles(); it fails on the module before the change.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
ProSEMultiSummary now has what search() reports of the search as a whole, under
the same names: summary().search (database, enzyme, decoyMode, the size of the
fragment index, secondsIndexBuild, secondsTotal, ...), and each file's
precursorError and fragmentError ({ median, mad, recommended }: the tolerances
ProSE recommends), which the library computes per file.

The library does not set seconds_total for a multi-file search (its caller does),
so searchFiles() measures its whole call. A search without provideFile builds
the index once, which holds all of the digest; with provideFile each file's
search builds its own from the spectra of the file, so secondsIndexBuild adds
them up and the size is that of the first file's index (the README says so).
The database file is the path given, where the library has none for a search
from memory.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…without filtering

With FDR:PSM 0 (no filter) and no Percolator, psms.qValue was NaN for every
PSM, although the search had decoys. searchFiles() now gives the PSMs of each
file that Percolator did not rescore the q-values that FDR:PSM would compute
(ProSEAlgorithm::annotatePsmQValues(), the old demo's annotatePsmQValues),
without filtering anything. They are added as the meta value "q-value" of the
best hits, computed on a copy: the scores stay ProSE's, which the protein
inference of the pooled results ranks by, so nothing else changes. A file
without a decoy PSM keeps NaN, as does a search without decoys. The d.ts no
longer says "NaN: no FDR (no decoys)" only.

The test (an open search against shuffled proteins, with PSMs of all q-values)
requires the q-values to equal those of FDR:PSM 1, which filters nothing
either, with the same scores, and checks the cases with Percolator and
without decoys.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…60, else InvalidValue

predictMS2() accepted any positive charge and any finite energy, and the model
answers for them: charge 12 gave the ions of charge 8 (all charges from 8 on
are the same to it), an energy of 200 none. It now throws InvalidValue for a
charge outside 1 to 6 and an energy outside 10 to 60.

Neither the library nor peptdeep states a range (ML:: has only the
instruments), so this is the binding's choice, documented as such in the
source, the README and the error message. Measured on the model: the ions
become few from charge 6 on and an energy above 60 degrades them. A search can
use an energy outside the range (peptdeep:nce takes any value), which the
README mentions for the app.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… PeptDeep classes and ProSEAlgorithm

The number of peptides per ONNX Runtime run was written out in five places: 500
in the constructors of PeptDeepMS2Inference, PeptDeepRTInference and
PeptDeepCCSInference, in PeptDeepRescoring's 'batch_size', and (128 under
__EMSCRIPTEN__, since 888678e) in ProSEAlgorithm's 'peptdeep:batch_size'.
ML::PEPTDEEP_DEFAULT_BATCH_SIZE (PeptDeepUtils.h) is now the one definition:
500, and 128 in WebAssembly, where ONNX Runtime has no memory arena and the
memory of large tensors is not reused. Natively nothing changes. In
WebAssembly, PeptDeepRescoring and the inference classes default to 128 too
(the bindings' predictMS2() uses the inference class's default; its comment
said the batch size was that of the parameter, which was only true natively).

The PeptDeepLibraryPredictor config keeps its own 500: it is not part of ProSE's
rescoring.

Tests: the default of both parameters and the value of the constant. The
develop PR #10641 carries two of the PeptDeep memory commits but not
888678e, so the constant lives only in this branch.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…modification analysis, public

searchFiles() with provideFile (the WebAssembly bindings) searches the files one
at a time and analyses the modifications of the pooled PSMs of an open search
itself; it took the tolerance for that from the private
ProSEAlgorithm::computeModMatchTolerance_() by copying its rule. The rule is now
the public static ProSEAlgorithm::modMatchTolerance(lower, upper), which
computeModMatchTolerance_() and the bindings both use. No change of behaviour.

Test: the rule itself (the tighter side; a side of zero is a one-sided window)
and that computeModMatchTolerance_() follows it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…efaults, write within the size, provideFile capacity

- peptides.proteinOffsets: documented in the d.ts and the README that
  proteinOffsets[k] === proteinOffsets[k + 1] means all proteins of the peptide
  failed the protein FDR; its PSMs stay (the app shows them as "below protein
  FDR").
- annotatePeaks() defaults maxCharge to the precursor charge - 1, while
  predictMS2() returns doubly charged ions for a precursor of charge 2 or more:
  documented in both README subsections (pass maxCharge to make them agree).
- allocateFile() with a capacity: the README now says that a write past a
  file's capacity can abort the module, and that writes have to stay within
  the size.
- provideFile in the d.ts mentions allocateFile(path, size, capacity).
- README: FS.writeFile() of WasmFS appends to a file that exists (found while
  writing a test); unlink it first.
- CHANGELOG: the changes of the bindings of this round.
- The title of the PeptDeep heap test no longer says "do not grow the heap per
  file", which the test does not show (the search's own growth remains): "take
  no memory per file beyond the search's own".

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… and the index size of the summary

The summary of searchFiles() has the search statistics now, whose times differ
between two searches and whose index differs between a search with all files
there and one file by file (the latter builds it for each file from its spectra).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…mall files, allocateFile replacing

From the scoped final review of the ProSE app bindings:
- the index of a one-file search holds only the reachable peptides only on one thread;
- the heap growth of many small files depends on the thread count and on PeptDeep (measured
  12 x 75 MB file by file at 4, 8 and 16 threads); fewer threads for searches of many files;
- only allocateFile(path, size, capacity) creates a file anew; the two-argument form resizes in place.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…o the cluster mass, not the lowest within the tolerance

mapDeltaMassesToModifications() took the entry of lowest mass within +-tolerance of a
cluster (lower_bound) and the entry of highest mass (the last one <= cluster + tolerance),
and named the cluster "A//B" after both, or after the one if they were the same. The entry
nearest to the cluster mass was never named when it lay between others. With the Unimod
table, +15.9949 Da (oxidation) was "thiocarboxylic acid//Oxidation or Hydroxylation":
thiocarboxylic acid (+15.9772 Da) is the lowest mass within 0.02 Da. histogram_found
recorded the same two extremes, and the later lookups took the lowest entry of their window:

- the PTM meta value of the PSMs of the oxidation cluster was "thiocarboxylic acid"
  (first entry of histogram_found within the tolerance),
- DeltaMassEntry::mapped_modification of generateDeltaMassStatistics() was "thiocarboxylic
  acid" (the lowest mass still wins),
- a cluster at +16.9949 Da was "thiocarboxylic acid+1Da" (first entry in the window around
  cluster - 1 Da) instead of "Oxidation or Hydroxylation+1Da".

Now a cluster is named after the entry nearest to its mass if that is within the tolerance
(still capped at 0.02 Da). "A//B" is kept for genuine ambiguity: entries whose distance to
the cluster exceeds that of the nearest by at most 0.0005 Da, the width of the delta mass
histogram bins, are named as well (in order of mass), as a cluster mass is not known better
than that. Only the entries that name the cluster go into histogram_found. The nearest entry
is also used wherever histogram_found is searched (the +1 Da variant, a modification found
before, the PTM annotation of the hits), by generateDeltaMassStatistics() (same naming), and
for the combination of two modifications, which was looked up at or above the cluster mass
only (lower_bound(cluster)), so that a combination below it, within the tolerance, was missed
(a cluster of -114.043 Da was "Unknown" with a combination 0.011 Da below it).

The ModificationsDB lookups by mass (searchModificationsByDiffMonoMass*, getBest...) do not
fit: the table here is the Unimod search modifications, one name per mass, and is also the
basis of the combinations and the +1 Da logic; the sorted-map lookup is O(log n) per cluster
for histograms of 1e4-1e5 bins.

Tests: OpenSearchModificationAnalysis_test maps clusters at oxidation, thiocarboxylic acid
and between them, with the tolerance, in ppm mode, with PSM annotation, the +1 Da variant,
the combination (against a brute force over the Unimod table) and generateDeltaMassStatistics.
No reference file changes; the ModificationAnalysis tables of TOPP_ProSE_12_open_* gain one
combination name for a cluster that was "Unknown" (-114.043 Da).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
(cherry picked from commit 42fe579)
…sm-prose-webapp

Brings in develop (with #10578 + #10602 as squash 2ef8693 and #10644 as
8528cf2) through the updated #10564 branch. This branch had carried a
pre-squash version of #10578/#10602 (claude/prose-merged-in-library) and a
cherry-pick of #10644.

Resolution: every library path is develop's version plus only the library
commits of this branch that develop does not have (ProSEAlgorithm::
pinEnzymeName() and modMatchTolerance() public, ML::PEPTDEEP_DEFAULT_BATCH_SIZE,
the joined reader thread, peptdeep:batch_size 128 in WebAssembly, the
PeptDeepRescoring NCE fix, ONNXPredictorBase without the memory pattern, the
ONNX environment changes for WebAssembly threads).
- ProSEAlgorithm.h, ProSEAlgorithm_test.cpp, src/tests/topp/CMakeLists.txt
  (conflicts) and ProSEAlgorithm.cpp (auto-merged, but with
  rescoreWithPercolator(), applyDeferredPsmFDR() and applyPsmFDR_() twice,
  since the squash moved them): develop's version with those commits on top.
- src/tests/topp/ProSE_13_prepare.cmake: removed; develop's Test 13 copies
  its inputs with add_test(... -E copy) instead.
- CHANGELOG: develop's text with this branch's entries.
- #10644 (7abcb28): identical to develop's, no difference left.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… app

The ProSE app (https://timosachsenberg.github.io/prose-web/, source
https://github.com/timosachsenberg/prose-web, the application in app/)
replaces the demo web application in src/openms_wasm/examples/prose/.

- examples/prose/ removed. examples/browser/, examples/node/, sw.js and
  sw-client.mjs stay.
- sw.js: the PeptDeep models (models/*.onnx) are no longer stored as
  module files. Only the ProSE demo fetched them.
- README and CHANGELOG point to the ProSE app instead of the demo.
- tests/browser/run.mjs: the service worker scenario loads
  examples/browser/ instead of examples/prose/.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…les/, reload unless isolated

Two bugs of examples/sw.js and examples/sw-client.mjs, found with the
ProSE app's site (https://timosachsenberg.github.io/prose-web/), whose
copy of the demo patched them:

- Store cleanup (sw.js): when the package version changed, the worker
  deleted every Cache API store of the origin not named after its
  version. That included the stores of other applications on the same
  site (the ProSE app's openms-module-<id> and prose-app-<id>). It now
  deletes only its own stores of another version:
  openms-module-<version> and openms-app-<version>, where the version is
  a package version or "0".
- Scope (sw-client.mjs): scope "./" was resolved against the page, so
  each page directory got a registration of its own (examples/prose/,
  examples/browser/). The scope is now the worker's directory
  (examples/), resolved against sw-client.mjs as the worker's URL is.
- Isolating reload (sw-client.mjs): the client did not reload when
  navigator.serviceWorker.controller was set. But the worker claims the
  open pages on activation (clients.claim()), which can happen before
  `ready` resolves. A claimed page has a controller, but the worker did
  not serve it and so did not add the isolation headers: the first visit
  sometimes stayed on one thread. The client now reloads (once per tab)
  unless the page is crossOriginIsolated.

tests/browser/run.mjs: the service worker scenario forces the claim to
come before `ready` on the first visit, and checks that the worker has
one registration with scope examples/, that it keeps three foreign
stores and that it drops its own store of another version. With the
previous sw.js the stores check fails; with the previous sw-client.mjs
the isolation and scope checks fail.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@timosachsenberg timosachsenberg changed the title [EXPERIMENT] WebAssembly: ProSE search engine bindings and a ProSE web application [EXPERIMENT] WebAssembly: ProSE bindings, ONNX Runtime and the engine of the ProSE app Oct 20, 2026
@lazear

lazear commented Oct 21, 2026

Copy link
Copy Markdown

👀

@timosachsenberg

Copy link
Copy Markdown
Contributor Author

Hi @lazear. I saw your sage in the browser and found it really interesting. Cool stuff! I can say it works also in C++ but there are definitely some rough edges with safari, threading etc.

@timosachsenberg timosachsenberg left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the updated ProSE bindings, pooled result tables, spectrum retention, file I/O, and worker lifetimes at 3cab983. One new substantive finding below: a large read from a mounted host file silently truncates its length in wasm32. The previous service-worker cleanup no longer deletes unrelated cache names. I checked the narrowing arithmetic separately; no fresh Wasm build or browser search was run, and no workflow run was available for this exact head.

Comment thread src/openms_wasm/bindings/bind_misc.cpp Resolved
…asm-prose-webapp

Adaptations to develop:
- ProSE was split into ANALYSIS/ID/PROSE/. The join of the background
  reader thread (libc++'s std::async detaches its thread; in WebAssembly
  its Web Worker went back to the pool only when the main thread's event
  loop ran) moves to develop's BackgroundSpectra in ProSEImpl.h, which
  now starts a std::thread with a packaged_task and joins it. The lookup
  of the first file's activation is deferred in WebAssembly (std::async).
- develop took over the ONNX Runtime and PeptDeep changes of this branch
  (no memory pattern, the ParseError of a model that does not load, NCE
  selection that predicts each sampled peptide once) and made 64 the
  default of 'batch_size' of ProSE and PeptDeepRescoring. That is below
  the 128 of ML::PEPTDEEP_DEFAULT_BATCH_SIZE in WebAssembly, so the
  constant goes; the JavaScript test expects 64.
- pinEnzymeName() is public in develop already; modMatchTolerance() stays.
- The bindings pass the inference-only PSMs to applyCompleteSetProteinFDR(),
  whose signature changed in develop.
- CHANGELOG: develop's (entries are generated from merged PRs).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmXLttDcVnqdHzuucnY
…aches the caller unchanged

A WebAssembly.RuntimeError (an abort, e.g. of a write into WasmFS that
the memory cannot hold) or a raw WebAssembly.Exception thrown by
provideFile or releaseFile was wrapped as an ordinary
"SearchFilesError: ... threw: <message>", and the search went on to
call releaseFile, i.e. into a module whose state is undefined. The
caller could not tell that the module had to be replaced.

Such an error is now carried through the C++ frames of the search as
JSFatalError (so that they unwind as for any C++ exception); the search
calls no releaseFile, and Guard<> rethrows the original JavaScript value.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmXLttDcVnqdHzuucnY
…nstead of cutting them short

A mounted host file can be larger than a size_t of wasm32 holds. The
length of the read was narrowed to size_t, so readFileChunk(path, 0,
2 ** 32) returned no bytes and 2 ** 32 + 4096 returned 4096: a caller
could take that for the end of the file and truncate a copy. Such a
read now throws InvalidValue. Test with a sparse host file of 4 GiB.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmXLttDcVnqdHzuucnY
…orrectly, 4 GiB or more refused

CI of the merge with develop (wasm64 run of claude/wasm64):

- mergeFileResults() reports a progress step of its own ("Pooled protein
  inference[ and protein FDR]"); the tests of the progress steps of
  searchFiles() expect it after the steps of the files.
- develop pools files that Percolator could not all rescore on their own
  (a transferred model, or ProSE's score for the pooled inference) instead
  of throwing InvalidValue: the bindings' error for that case is gone, the
  test checks that such a search is pooled, the README describes it.
- The trap test throws a RuntimeError only: a WebAssembly.Exception with a
  tag of its own (not the module's C++ tag) cannot be rethrown by Embind.

Mounted host files (WasmFS' Node.js backend, Emscripten 6.0.12): sizes and
offsets are 32-bit there, and the offset of a read or write reached
JavaScript as a signed number. A read at 2 GiB or beyond returned no bytes,
as at the end of the file, so a mounted mzML file of 3 GB was read as one
of 2 GiB; a file of 4 GiB or more was taken for one of its size modulo
4 GiB. wasmfs_node.js now reads and writes with unsigned offsets (up to
4 GiB) and refuses to open a host file of 4 GiB or more (EOVERFLOW), which
readFileChunk() reports. Checked with a test program on a sparse host file
(wasm32 and wasm64): reads at 2 GiB, 3 GiB and the end, a write at 3 GiB,
and the refusal; the test in io.test.mjs does the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmXLttDcVnqdHzuucnY
…es of the file keep PSMs

Since the merge with develop (FDR changes), one half of the file kept no PSM at
FDR:PSM 0.0005 (in both the file-by-file search and the search with all files
there, which gave the same results), and the check that the search keeps the
files apart had nothing to compare.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0149aXmXLttDcVnqdHzuucnY

This branch has not been deployed

No deployments
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.

3 participants