Skip to content
BTSpanielPublic

About

PhysX PE: NVIDIA PhysX 5.11, Blast and WebGPU Flow for browser WebAssembly, with Rust SIMD batching. Built for Particle Realms Engine.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

25 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PhysX PE

NVIDIA PhysX, Blast and Flow in the browser, with Rust batching and WebGPU integration.

PhysX PE combines NVIDIA PhysX 5.11.0, NVIDIA Blast 5.0.6 and NVIDIA Flow in a browser runtime maintained by Jake Wehmeier (BTSpaniel). It provides a JavaScript module, a matching WebAssembly binary, TypeScript declarations, and the adapters and shaders needed to run Flow on WebGPU. Applications consume browser ES modules directly; no npm or application build step is required.

The latest published runtime prerelease is 5.11.0-alpha.4, published 2026-10-03, from source commit 5dea7b3726ef5cd58115d4832085c96bb03eea26 (1,618 committed files). The downloads below belong to the original tagged CI build.

The release passed its original standalone SDK, browser and package checks. Those results apply to the published files, not every Engine integration or a performance guarantee. A later documentation merge does not change the tagged build identity. See SOURCE_BUILD_KIT.md for the selected changes, exact recipes and verification boundary.

Downloads · Quick start · Flow setup · Build from source

Built for Particle Realms Engine. PhysX PE can also be used independently of the engine.

Unpublished alpha.5 source successor

This source prepares 5.11.0-alpha.5 with reuse of Flow texture views and pipeline layouts. The published alpha.4 downloads remain unchanged. The candidate passed a separate native Flow parity check; its two matched timing pairs showed fewer view/layout creations and lower observed CPU encoding cost, without establishing a robust application speedup. A clean committed full build, original release checks, extracted-package verification and public delivery are still required for alpha.5. No runtime, Engine or realtime admission is inherited from those candidate observations.

Downloads

Start with the complete published alpha.4 runtime ZIP for the examples, Flow adapters and shaders, license notices and verification reports.

Download Contents
Complete runtime ZIP Matched runtime, Flow adapters and shaders, browser examples, local server, licenses and reports.
physx-pe.mjs JavaScript module loader; requires the matching WASM.
physx-pe.wasm Published compiled runtime.
physx-pe.d.ts Declarations for the published runtime.
SHA256SUMS · ZIP checksum · Release manifest Asset integrity and the published source revision.

Always download the loader and WASM from the same release and host them together. The individual files are convenient for embedding; the ZIP contains the full distribution, including notices required for redistribution. GitHub's automatic Source code archives contain build inputs, not prebuilt runtime binaries. A separately compiled development pair can differ from the public CI pair, even at the same source revision. Use the published checksums for these assets.

Historical alpha.3 build sources: Portable source-build kit and SHA256 checksum. This separate source release contains a genuine Git bundle, clone instructions and full licenses; it contains no compiled runtime. No alpha.4 portable source bundle is announced here. The historical alpha.2 release remains available with its original assets and verification scope.

Quick start

  1. Download and extract the Complete runtime ZIP.

  2. Open a terminal in the extracted directory and start the included server:

    python tools/serve.py --port 8765
  3. Open the falling-body example. For the included smoke suite, open runtime validation and select Run validation. The suite runs real PhysX simulations in a Worker, checks the matched runtime files and lets you save its report.

For your application, put physx-pe.mjs and physx-pe.wasm beside each other. Import and await the module factory from a JavaScript module in that directory:

import createPhysX from './physx-pe.mjs';

const PhysX = await createPhysX({
  locateFile: name => new URL(name, import.meta.url).href,
});

Your application creates the scene and owns its simulation loop and native resources. The ZIP keeps the matched files in dist/candidate/; use that path when importing directly from the extracted package. See the quick-start source, simulation suite and published declarations.

Serve ES modules over HTTP on localhost or HTTPS in deployment, never file://. Serve .mjs as JavaScript and .wasm as application/wasm; the included server supplies these types. JavaScript garbage collection does not release PhysX objects. The runtime uses single-threaded WebAssembly with SIMD.

What runs where

Component Execution
PhysX rigid bodies, joints, articulations, cooking and queries CPU, WebAssembly
Blast core, stress and fracture authoring bridge CPU, WebAssembly
Rust pose batching and heap staging CPU, WebAssembly SIMD
Selected experimental wood-thermal kernels CPU, WebAssembly; API choice determines the numerical method
Flow sparse simulation Host graph in WebAssembly; WGSL compute on WebGPU
Native memory to GPU transfers Explicit uploads and readbacks through the shared WASM heap

WebGPU accelerates Flow's compute work. The PhysX rigid-body and Blast solvers remain on the CPU. CUDA and PhysX's native CUDA GPU backend are unavailable in this build. The selected thermal kernels are not GPU thermal solvers.

Flow on WebGPU

Use the complete runtime ZIP. Flow needs addons/flow/flow_host_webgpu.mjs and the entire dist/flow-wgsl/ directory, including its manifests and reflection files. The WASM alone is not enough.

The device must support float32-filterable, at least 1,024 compute invocations per workgroup, and a 1,024-lane X workgroup. Request these capabilities explicitly. WebGPU availability alone does not guarantee support.

Save the following module at the extracted package root and import it from an HTML page served by the included server. It advances two seconds of simulation and releases its resources; it does not include a volume renderer.

import createPhysX from './dist/candidate/physx-pe.mjs';
import { FlowHostWebGpu } from './addons/flow/flow_host_webgpu.mjs';

if (!navigator.gpu) throw new Error('WebGPU is unavailable in this browser');
const adapter = await navigator.gpu.requestAdapter();
if (!adapter) throw new Error('No WebGPU adapter is available');
const device = await adapter.requestDevice({
  requiredFeatures: ['float32-filterable'],
  requiredLimits: {
    maxComputeInvocationsPerWorkgroup: 1024,
    maxComputeWorkgroupSizeX: 1024,
  },
});

let flow;
try {
  const PhysX = await createPhysX();
  const shaders = new URL('./dist/flow-wgsl/', import.meta.url).href;
  flow = await FlowHostWebGpu.create(PhysX, device, shaders);
  flow.setEmitter({ position: [0, 0, 0], radius: 0.45, enabled: true });
  for (let frame = 0; frame < 120; frame++) await flow.step(1 / 60);
  console.log('Completed Flow frames:', flow.stats.frames);
  console.log('Active sparse blocks:', flow.stats.activeBlocks);
} finally {
  try { await flow?.dispose(); } finally { device.destroy(); }
}

A renderer can consume flow.output while the host is alive. Await each step and dispose the host before destroying the device. The host borrows its device, so an application can share a device already owned by its renderer.

Selected alpha.4 changes

These source changes are included in the published alpha.4 build. The SDK checks below retain their stated scope; source changes alone are not a speed claim:

  • The explicit wood-thermal ABI1 kernel rejects a nonfinite intermediate char reaction rate with its existing status 6, before the positive-rate timestep test. Finite equations and their evaluation order remain unchanged. Callers must still stage state and commit only after successful validation.
  • Blast's accurate physical-section processor avoids preparing unused inherited base-processor data. Revision 3 retains its own geometry, physical scaling, factor construction and solve path; legacy processors remain separate. This removes redundant preparation without changing material laws, solver tolerance or iteration budgets. A performance claim requires a matched runtime test.
  • Thermal ABI1 and ABI2/numerical version 9 remain separate interfaces. ABI1 uses the existing explicit adaptive method. The selected stable-depletion compile option evaluates the frozen-temperature loss with log1p/expm1, so numerical compatibility uses declared tolerances rather than a bit-exact JavaScript claim. ABI2/numerical version 9 uses adaptive implicit SDIRK transport and separate controls, workspace and diagnostics; it is not a drop-in ABI1 acceleration or an automatic Engine integrator switch.

Package and source map

Path Purpose
dist/candidate/ Matched loader, WASM, declarations and build manifest inside the runtime ZIP.
dist/flow-wgsl/ Generated Flow shaders, reflection files and manifests.
addons/flow/ Flow host adapter, shared-heap WebGPU bridge and source build tools.
addons/blast/ Blast bridge and source build tools.
addons/thermal/ Selected experimental CPU-WASM thermal sources in the source checkout.
bridge/ · rust/ Native transfer interfaces, JavaScript batching adapters and Rust implementation.
web/ Browser examples, validation page and simulation suite.
types/ Generated PhysX/addon declarations and pinned WebGPU types.
reports/ Verification receipts in the ZIP; generated test output in a source checkout.
LICENSES/ Complete upstream license texts and notices.

The ZIP includes browser adapters, not every source build tool. Clone this repository to rebuild the native integration. Temporary build checkouts stay in work/; publishable files are collected in dist/release/.

Build from source

Use Linux or WSL with Python 3.12, Git, CMake, Make, a host C++ compiler and Rustup. Bootstrap installs the pinned toolchain locally without changing your global Rust default. Software Flow verification also needs Mesa lavapipe (mesa-vulkan-drivers on Ubuntu).

The following checkout selects the published alpha.4 build source. Its expected commit is 5dea7b3726ef5cd58115d4832085c96bb03eea26.

git clone --branch v5.11.0-alpha.4 https://github.com/BTSpaniel/Physx.git
cd Physx
git rev-parse HEAD
python tools/bootstrap.py --install
source work/env.sh
python -m pip install playwright==1.57.0
python -m playwright install --with-deps chromium firefox
python tools/flow_gpu_probe.py --software-vulkan --browser-engine firefox
python release.py build

Select the intended committed source revision before building. The tagged source above is the released build input; a moving branch can contain later docs or code and does not identify the original compiled release. Use SOURCE_BUILD_KIT.md for the existing-toolchain Windows route and selected native source checks.

For an offline alpha.3 source checkout, extract its portable source kit and run:

git clone --branch v5.11.0-alpha.3 physx-pe-source.bundle Physx-PE
cd Physx-PE
git rev-parse HEAD

The published bundle reconstruction reproduced the exact 1,608 committed files and original source/selection guards at 53c0cd99d0695a23b89047bde0f000fdecaaa363. Keep the outer kit documentation and checksum outside the clone. Automatic GitHub source ZIPs omit the history required by the committed-source guard. The bundle supplies sources; building still needs pinned toolchain/upstream downloads and the original local or genuine hosted execution window.

Run build, verify and package separately. Release commands require a clean, committed source tree. Packaging rejects missing, failed or stale verification, checks hashes, and executes the extracted archive. Emscripten 4.0.19, Rust 1.90.0, Slang 2025.6.1 and upstream source revisions are pinned in upstream.lock.json.

For local verification alongside an Engine checkout, provide its shared lock: python release.py verify --software-vulkan --flow-browser-engine firefox --lock-workspace /path/to/particlerealms.engine. The bounded CPU endurance phase uses this lock to serialize heavy tests. Hosted workflows use --ci-isolated, which requires the actual GitHub-hosted Actions environment and cannot bypass local isolation.

Use Actions → Build PhysX PE → Run workflow for a hosted build. Successful runs retain runtime files and reports. Version tags create an alpha prerelease only after the build and verification gates pass. Consumers need no npm setup.

Verification and limits

The original alpha.4 CI run completed its build and publication at tagged source 5dea7b3726ef5cd58115d4832085c96bb03eea26. The published archive retains ten passing SDK phases: native and browser ABI, TypeScript consumer semantics, 37 PhysX browser cases, bounded CPU endurance/replay, unified PhysX/Blast/Flow checks, all 124 WGSL modules with representative compute, and Flow graph ownership. The ABI probe uses its own test module; the runtime phases bind the public PhysX pair. Successful original CI packaging records an extracted-archive smoke receipt in the release manifest. All seven assets were anonymously downloaded; their byte counts, checksums, archive file inventory and inner hashes match the release.

Public runtime SHA-256 identities are:

File SHA-256
physx-pe.mjs cb87ea9ee3e0dc5d67b4c5044d4360dfe58aa8344355c9b13e68107cbd8f5c69
physx-pe.wasm bd31182fff4ba1343d605723c0f0859809525ecdf3aa06aa99da4c31f650d54d

The workflow requested software Vulkan through Firefox on Ubuntu and SwiftShader for Chromium. These bounded functional checks are not a hardware frame-rate benchmark, full upstream SDK certification, Engine thermal qualification or browser/device matrix. A same-source local build with different hashes has its own evidence. The published runtime's smoke report retains engineIntegrationVerified: false and releaseApproved: false within its regression-certification scope; successful prerelease publication does not turn those fields into full certification.

The published alpha.3 release was built at source 53c0cd99d0695a23b89047bde0f000fdecaaa363 in CI run 36867355569. Its published receipts report all ten standalone SDK phases, including native PhysX/Blast, shared-heap checks, all 124 WGSL modules, representative numerical compute and the real Flow host graph with resource cleanup. The extracted ZIP passed 37 browser cases and its falling-body example; all seven published assets were anonymously downloaded and matched the tagged build byte for byte. The run requested Mesa lavapipe through Firefox on Ubuntu; the browser did not report its backend identity. These historical checks do not admit alpha.4, hardware real-time performance, full upstream parity or a device matrix.

The current selected source defines 37 functional CPU-WASM checks and 96 source-derived addon declarations. Its browser suite includes D6 and articulation drives, controller floor/wall collision, convex and triangle mesh cooking, 64-bit serialization IDs, Vehicle2 behavior, native contacts/triggers and same-build replay. TypeScript consumers check actual addon pointer, arity and return types in a browser. Source presence and generated declarations do not replace execution on a fresh matched pair.

Experimental thermal performance and physical fidelity remain limited. A separate standalone ABI1 compatibility probe passed eight bounded cases with mass/energy closure and allocation cleanup. One captured 0.1 s thermal input required 1,095 adaptive substeps; on that Chrome/Windows fixture the median native total cost was approximately 269 ms, including preparation, transfer and commit, versus approximately 593 ms for JavaScript. This is a standalone fixture result, not a unified alpha.4, complete-scene or realtime result. Caller refinement also observed internal temperatures around 9,260–10,060 K. Matching the explicit JavaScript state and ledger does not validate those peaks or establish physical realism or transient peak convergence. ABI2 is a different numerical method and cannot silently replace ABI1 to improve a timing result.

Earlier bounded CPU tests exercised 288 scene lifecycles, 4,608 dynamic actors, 576 bulk contexts and 288 Blast checks, with matching ten-minute physical-time replays on one Windows device. Those historical receipts establish their own fixtures only. They do not certify a future source revision, unlimited-duration leak absence, cross-build replay or a device matrix.

The released source includes physical-section, thermal and transactional Flow extensions and 124 shader kernels. Its original SDK and package receipts are recorded above; Engine integration gates remain separate for each installed pair. Momentum exchange currently covers terminal normal exchange; heat remains an explicit unapplied obligation. Rendered frame rate alone does not measure completed physical time. See source selection, source build guide and provenance for source and admission boundaries.

Credits and license

PhysX PE is an attributed integration and browser port. NVIDIA created PhysX, Blast and Flow; Max Thiele (fabmax) created the binding foundation. This release retains the fabmax v2.7.3 binding lineage and independently pins NVIDIA's 5.11.0 SDK. It does not claim to be the fabmax v2.8.0 package or a clean-room rewrite of either project.

Original PhysX PE additions are MIT licensed. Upstream components retain their own licenses and copyrights, including NVIDIA, fabmax, webidl-util, V-HACD, OpenVDB, Emscripten and Rust contributors. Preserve the distribution's third-party notices, authors, provenance and LICENSES/ when redistributing it.

API references: NVIDIA PhysX documentation, Emscripten module options and the published declarations. Upstream documentation may describe interfaces or backends outside this release's exposed and verified subset.

About

PhysX PE: NVIDIA PhysX 5.11, Blast and WebGPU Flow for browser WebAssembly, with Rust SIMD batching. Built for Particle Realms Engine.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages