Decidora
DemoGuardPagesDocsAbout

Reference · every runtime · one bundle format

One model.
Seven runtimes.
Different trade-offs.

The same stage18 int8 bundle is read by PyTorch, NumPy, PHP in three modes, JavaScript and Rust. The heads agree; the latency does not. This page collects the published numbers and the local demo measurement in one place.

7 runtime paths 5.4 ms fastest p50 1.2 s pure-PHP p50

Matrix

Runtimes

engine path heads needs noul int8 p50
PyTorch src/decidora/inference.py all 4 torch 6.8 ms
NumPy src/decidora/numpy_runtime.py all 4 on stage18 numpy 8.5 ms
PHP + C kernel ports/php/Decidora.php + Kernel.php all 4 PHP 8.1+, mbstring, ext-ffi, OpenBLAS 5.4 ms
PHP + OpenBLAS ports/php/Decidora.php + Blas.php all 4 PHP 8.1+, mbstring, ext-ffi, OpenBLAS 0.2-0.31 s
PHP pure - this demo ports/php/Decidora.php all 4 PHP 8.1+, mbstring 0.5-0.9 s
JavaScript ports/js/decidora.mjs all 4 Node or a browser 219 ms, Node
Rust ports/rust/ noul only int8 bundle, GNU/MinGW on Windows 28.3 ms
Guard separate model src/decidora/guard.py, ports/js/guard.mjs, api/lib/Guard.php noul spam/ham Python, browser JS or PHP 8.1+ with intl ~7 ms PHP, ~0.4 ms Python SMS

Published p50 rows use the stage17b int8 bundle and noul, one question, from docs/RESULTS.md. PHP ranges come from docs/SPEC.md and ports/php/README.md. Guard is a 2.1M linear model, not a Decidora head; its numbers are SMS and a 4,000-character email. The Rust port is int8-only and does not implement choice, score or span.

PHP port

Three modes, one source file

mode what runs in C one question four questions, one pass bundle load
C kernel + OpenBLAS whole encoder, matmul in OpenBLAS 5-11 ms ~15-20 ms ~28 ms
PHP + OpenBLAS matmul only 0.2-0.31 s - ~28 ms
C kernel without BLAS encoder, scalar matmul 0.18-0.34 s - ~28 ms
Pure PHP - this demo nothing 0.44-0.76 s 1.21 s ~10 ms

Mode selection is automatic: Decidora::load finds OpenBLAS and a compiled kernel when they exist. This deployment forces the last row with DECIDORA_BLAS=none and DECIDORA_KERNEL=none. span_joint always takes the pure-PHP path in the PHP port.

Measured here

This demo's backend

workload p50 min max
choice, 8 options764 ms764 ms806 ms
noul516 ms515 ms525 ms
score, 4 levels626 ms625 ms636 ms
span, 32-token window440 ms435 ms448 ms
all four questions, one state, one pass1 215 ms1 201 ms1 229 ms
Guard, Russian spam, 89 chars6.9 ms--
Guard, long payload, 4 842 chars / 6 windows16.9 ms--
demo sample, precomputed cache0.4-0.6 ms--
bundle load10.3 ms--

AMD Ryzen 5 7500F, Windows, PHP 8.5.4, JIT 1255, 512 MB memory limit, stage18 int8, no C kernel, no BLAS. Three runs per workload, median. Excludes the HTTP round trip; the demo shows server inference time and browser round trip separately. Guard rows are one warm call each, same machine and PHP build. The live VDS has OPcache JIT disabled, so demo samples are served from public/api/precomputed.json; custom text still pays the full first run.

Correctness

Conformance against PyTorch

engine stage18 max gap stage17b max gap coverage
NumPy7.83e-63.3e-6all 4 heads
PHP1.24e-51.5e-5all 4 heads, 87 examples
JavaScript2.70e-63.0e-6all 4 heads, 87 examples
Rust-1.2e-7noul only
Guard JS35/35 decisions-noul spam/ham
Guard PHPmax p 1.3e-5-35/35 feature lists, 0 decision flips

Ports are independent reimplementations; numpy_runtime.py is their reference. Thresholds are 1e-4. Re-run conformance after changing forward math or the bundle format: scripts/conformance_numpy.py, ports/php/conformance.py, ports/js/conformance.mjs. Guard PHP was checked against the Python golden on 35 multilingual, long and obfuscated texts.

Deployment

Why this demo pays for pure PHP