Scan your whole stack
Are you using deblais?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.1.0
deblais was last scanned on 28 Nov 2026 at version 0.1.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.1.0 LATEST | 28 Nov 2026 | No rules fired |
Findings for v0.1.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.1.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
deblais computes exact optimal transport between point clouds: the optimal plan, its cost (the squared Wasserstein-2 distance) and the Kantorovich potentials, for the squared Euclidean cost. It is a header-only C++17 library with no dependency, and a Python package on top of it that takes NumPy arrays and PyTorch tensors.
The solver is a network simplex that never stores the cost matrix, started by a multiscale scheme and by parallel sweeps of a domain decomposition. It solves a million points against a million in the plane in 13 to 31 seconds on 8 threads depending on the masses, in linear memory, and returns a certificate of optimality.
deblais is the twin of remblais, which computes geometric losses (Sinkhorn divergences, kernel norms, Hausdorff divergences): which one do I need?
import deblais
plan = deblais.solve(x, y) # x: (n, d), y: (m, d), NumPy or PyTorch
plan.cost # W2^2, exact
plan.source, plan.target, plan.mass # sparse optimal plan
plan.f, plan.g # dual potentials
#include <deblais/deblais.hpp>
const deblais::Plan plan = deblais::solve(2, x, y); // std::vector<double>, point after point
deblais::certify checks
them independently of the solver.method="auto" picks the algorithm and its parameters from
the dimension, the sizes and the masses: closed form on the line, plain
simplex on small problems, multiscale domain decomposition on large ones,
auction on assignment problems. deblais.tune times a few solves of your
clouds and returns the fastest options on your machine. See
Automatic mode.deblais::deblais, or just -I include.Python, on x86-64 Linux (Python 3.10 or later):
pip install deblais
C++, with CMake:
include(FetchContent)
FetchContent_Declare(deblais GIT_REPOSITORY https://github.com/keckj/deblais.git GIT_TAG v0.1.0)
FetchContent_MakeAvailable(deblais)
target_link_libraries(my_program PRIVATE deblais::deblais)
or without it: copy include/ and compile with
g++ -std=c++17 -O3 -march=native -fopenmp -I include. The details, and the
build from source, are in Getting started.
import numpy as np
import deblais
rng = np.random.default_rng(0)
x, y = rng.random((100_000, 3)), rng.random((80_000, 3))
a, b = rng.random(100_000), rng.random(80_000)
plan = deblais.solve(x, y, a / a.sum(), b / b.sum())
print(plan.cost, plan.status, plan.method) # exact cost, 'optimal', 'decomposition'
T = plan.map() # barycentric map, shape (100000, 3)
P = plan.sparse() # scipy.sparse matrix, at most n + m - 1 entries
With PyTorch, as a loss:
import torch
x = torch.rand(20_000, 2, device="cuda", requires_grad=True)
y = torch.rand(20_000, 2, device="cuda")
loss = deblais.wasserstein2(x, y)
loss.backward()
#include <deblais/deblais.hpp>
#include <cstdio>
#include <vector>
// n source points and m target points in dimension 3, stored point after
// point (x0 y0 z0 x1 y1 z1 ...), with one mass per point
std::vector<double> x(3 * n), a(n), y(3 * m), b(m);
deblais::Cloud source(x.data(), n, a.data()); // views, nothing is copied
deblais::Cloud target(y.data(), m, b.data());
deblais::Options options; // method, threads, ...: all automatic by default
const deblais::Plan plan = deblais::solve<3>(source, target, options);
// The plan is a list of arcs: arc k moves plan.mass[k] from the source point
// plan.source[k] to the target point plan.target[k]
std::printf("cost %g, %zu arcs\n", plan.cost, plan.size());
for (std::size_t k = 0; k < plan.size(); ++k)
std::printf("%g from source %d to target %d\n", plan.mass[k], plan.source[k], plan.target[k]);
const deblais::Certificate proof = deblais::certify<3>(source, target, plan);
assert(proof.optimal());
Against network_simplex, the
implementation deblais started from (the one behind POT's ot.emd), on its
own test case (dimension 2, random masses, two AMD EPYC 9655).
network_simplex grows like $n^{2.5}$ and stores the cost matrix (80 GB at 100 000 points); deblais grows like $n$ in linear memory, and on a single thread it is 450 times faster at 100 000 points.
| Points per cloud | network_simplex, 1 thread | network_simplex, 16 threads | deblais, 1 thread | deblais, 16 threads |
|---|---|---|---|---|
| 10 000 | 4.4 s | 3.4 s | 0.21 s | 0.092 s |
| 100 000 | 1 385 s | 658 s | 3.1 s | 0.72 s |
| 1 000 000 | 47 s | 8.4 s |
Larger problems, in every dimension: wall time of a complete solve in the automatic mode, optimality certificate included, for a million points against a million drawn uniformly in the unit cube, two AMD EPYC 9654 (192 threads, pinned), GCC 14.
| Masses | Dimension 1 | Dimension 2 | Dimension 3 | Dimension 4 |
|---|---|---|---|---|
| uniform (assignment) | 0.19 s | 14 s | 11 s | 21 s |
| random integers | 0.33 s | 25 s | 33 s | 92 s |
| random reals | 0.36 s | 7.5 s | 15 s | 49 s |
The time grows like $n^\alpha$ with the number $n$ of points per cloud, with $\alpha$ between 1.0 and 1.3 in every dimension, up to thirty million points (a hundred million on the line).
The protocol, the fitted exponents, the three families of masses, the scaling with the number of threads and the command lines that reproduce these numbers are on the Performance page.
deblais and remblais are twin projects: two solvers for the two ways of computing discrete-discrete optimal transport.
| deblais | remblais | |
|---|---|---|
| Problem | exact optimal transport | entropic transport: Sinkhorn divergences, kernel norms (MMD), Hausdorff |
| Algorithm | network simplex, domain decomposition | Sinkhorn iterations |
| Result | optimal sparse plan, exact cost, certificate | a smooth loss, with a blur that trades accuracy for speed |
| Runs on | CPUs | NVIDIA, AMD and Intel GPUs, several GPUs or nodes, CPUs |
| Interface | C++17 headers, NumPy, PyTorch | PyTorch, drop-in replacement of GeomLoss |
Take deblais for a plan, an assignment or a reference value; take remblais for a loss to minimize, for other costs, unbalanced measures, images and volumes. The page deblais and remblais compares them in detail and shows how to use them together.
In 1781, Gaspard Monge asked how to move a pile of earth, the déblais, into a hole of the same volume, the remblais, at the lowest cost: the founding problem of optimal transport. deblais is where the mass comes from, and remblais is where it ends up.
At your option, MIT or Apache-2.0. deblais
contains no third-party code; the algorithms it implements are credited in
THIRD_PARTY.md.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.