Fast input combination tests¶
Run the built Reader and Solver packages with a Memory64-capable Node.js runtime:
node wasm/test/run.mjs
OOS_SOLVER_DIST=build/wasm-threads/dist node wasm/test/run.mjs
On PowerShell, set $env:OOS_SOLVER_DIST before the second command. OOR_READER_DIST selects a different Reader
package; its default is ../O_o_Reader/build/wasm/dist. The ordinary node --test --test-concurrency=1 wasm/test/*.test.mjs entry point
also runs the complete suite.
One second per case¶
Reader, Solver and the optional threading probe initialize once in a reusable worker, before tests start. Each input combination has a 900 ms watchdog in its parent process, plus the test runner’s 1,000 ms timeout. The watchdog terminates the worker even when synchronous WASM blocks its event loop. Focused tests have a 1,000 ms timeout, and the full-suite command runs test files sequentially to avoid resource contention. Separate regression tests deliberately block workers in JavaScript and in an infinite WASM loop, and check that both are interrupted.
The budget includes parsing the tiny model, exporting its tables, support checks, calculation, assertions, cleanup and the message round trip. Initial module loading is setup, reported as part of the suite’s total elapsed time rather than charged to the first case. A timeout fails the suite; later cases fail immediately if their worker has been terminated. A slow case is never silently skipped or accepted as a numerical refusal.
The command writes build/test-results/wasm.json or build/test-results/wasm-threads.json: every test name, status
and duration, the ten slowest tests, maximum duration, failures and any duration reaching one second. It exits with
a nonzero status for a numerical failure or an exceeded limit. OOS_TEST_RESULTS changes the report directory.
The separate worker-pool tests create their pools during module setup and give each test a 1,000 ms timeout.
These limits are those of a developer’s machine. A slower or shared machine sets OOS_TEST_TIME_FACTOR (a number of
at least 1): the watchdog, the ceiling of each test and the limit of the report are multiplied by it, so that a case
that hangs is still interrupted.
To investigate one input without running the entire matrix:
node wasm/test/run.mjs --test-name-pattern="line matrix element=Tube2 load=gravity"
Derivative checks¶
The derivative coverage guide describes which paths these suites exercise. Each case compares small, independently perturbed analyses or gradients with the native derivative; product checks also compare direct/adjoint results, symmetry and Jacobian/Hessian actions where applicable.
Suite |
Main checks |
|---|---|
Section/material first and mixed rates, release maps, lumped/coupled mass, thermal sources, span loads, loaded end results and mixed loaded/unloaded batches |
|
Mode-selected fields, normalization, bordered derivatives and root/field Hessian products |
|
Mechanical preload tangents, load sharing, simple-root curvature and shell geometric stiffness |
|
Structural/trim fields, stability coefficients, support accelerations and mass-dependent loads |
For example, run the bar/beam cases with the same watchdog as the full suite:
node wasm/test/run.mjs --test-name-pattern="analytic (bar sizing|beam)"
The timing report records the tested revision’s local execution. Use representative models to assess larger optimization workloads; the small derivative fixtures verify formulas and interactions.
Validation of the mixed hybrid formulation¶
The structural benchmark comparison reports both formulations on the same meshes, the closest results observed under refinement, and commercial solver values with their sources. The input files and replay are included.
The thin-plate solid benchmark reports measured deflection and surface stress errors for tetrahedra and hexahedra, with model files for replaying the degree and mesh refinements.
The benchmarks of MixedHybridFormulation against closed forms and classical values
(specification, sections 13.3 and 13.6) are a separate suite without a time
limit, in wasm/test/validation:
node --test wasm/test/validation/*.test.mjs
File |
Main checks |
|---|---|
|
Plates, the Scordelis-Lo roof, the pinched cylinder and hemisphere, the twisted beam, folded sections, laminates, offsets, pressure vessels, thermal loads, patch tests and invariance |
|
Frequencies of plates, cylinders and rings, buckling of plates and cylinders, inertia relief, stiffened panels, masses, springs and moments at grid points of shells |
|
Frames, trusses, shear deformation, tapered beams, offsets, pin flags, distributed and thermal loads, frequencies and buckling of beams |
|
Patch tests, beams, thick cylinders and spheres, every load, anisotropy, near incompressibility, frequencies and buckling, for the four shapes with and without mid-side nodes |
|
Shells on faces of solids, fins, lines along edges of solids and of shells; a plate continued by solids in bending and in tension, on meshes of the solids refined along and through the thickness (the ties of the shell over its thickness) |
|
Three assemblies through every path (full, condensed, streamed), equilibrium of the tables, invariance, determinism, robustness of the input |
|
The |
|
The |
|
The glued contact of shells in both formulations, on synthetic joints: two plates glued with a gap between their mid-surfaces follow a rigid motion; a strip in two parts glued end to end by its rotations is the strip in one piece and a web glued on a skin is the web meshed with it, in both formulations (the edges between glued grid points tied along their length in the MixedHybridFormulation); what the glue says of the rotations it cannot tie (the face of a solid); small joints against their closed forms (a cantilever and a simply supported beam of two glued layers, a lap splice in bending and in tension, a web glued on a rigid skin, a plate glued on a solid under a uniform strain, two blocks of solids glued end to end) |
|
The |
The static bracket comparison uses three classical meshes with 2, 4 and 8 subdivisions per solid-cell edge. Under pressure with three point supports, the plate-corner displacement is 0.25768, 0.25362 and 0.28996 mm, respectively. The coarse mixed mesh gives 0.21756 mm. The first two classical results agree within 2%, but the third breaks that apparent convergence. The 5% accuracy check applies when every successive reference pair agrees within 2%. The factor-of-1.5 check still applies when the final reference pair agrees within 20%.
The cases that do not meet their criterion are listed with their reason in known-limits.mjs and reported as “todo”:
no criterion is loosened. The model files of the suite carry the declarations of their geometry as a preprocessor
writes them (SurfaceEdge, SurfaceFacet, SurfaceLine records, or Parameter;GeometryDeclarations;Given: the
helpers surfaceRecords and prepared of support.mjs); the program only chooses the formulation.
node wasm/test/helpers/untimed.mjs [suite ...] [--match text] runs the cases of the fast
suite without its watchdog, for a machine busy with something else.
Continuous integration¶
Two workflows run on a push to main and on a pull request that change the sources.
WebAssembly builds the package, then runs on it:
the fast suite (
node wasm/test/run.mjs, then the numerical derivative and worker pool tests), withOOS_TEST_TIME_FACTORat 10 for the shared runners; its timing report is kept as theO_o_Solver-test-timingsartifact;the validation suite, its files dealt to four runners by their rank in
wasm/test/validation.
Both load the O_o_Reader package of the wasm-latest release of the O_o_Reader repository
(.github/scripts/fetch-reader-package.sh), so a change that needs a change of the reader passes once the reader’s
own change is on its main branch. The releases of the package are published only when both suites pass.
Native builds the libraries with GCC 12, the oldest compiler the sources are written for, with the warnings as
errors, and runs the native checks (checks/).
Coverage domains¶
Numerical values and model sizes are unbounded, so no finite suite can enumerate every possible input. The suite exhaustively enumerates the declared finite Cartesian domains below, and preserves the existing focused tests of optimization, modes, formulations and worker lifetime. Inputs are generated deterministically from original small models; no random sample replaces a declared combination.
The external study cases additionally exercise SOL 101/103/105/144, full-analysis
and native gradients, auxiliary shape directions, coupled material constants, named Reader result queries and
accepted-point archives. Numerical derivative tests cover bounds,
discrete variables, output layout changes and memory limits. Worker pool tests
cover independent package memories, parallel points and termination/replacement of a worker blocked in synchronous
JavaScript. Run these standalone tests with node --test --test-concurrency=1 wasm/test/*.test.mjs in addition to node wasm/test/run.mjs.
Matrix |
Domains |
Cases |
|---|---|---|
Line elements |
5 elements × 4 loads × 5 NSM states × 2 mass formulations × 2 unit scales × 2 constraint forms × 2 selection scopes |
1,600 |
Added property mass and load boundaries |
5 elements × 5 NSM states × 2 property masses × 2 inertial loads × 3 signs |
300 |
Point constraints and scaling |
5 elements × 3 loads × 2 signs × 2 moduli × 2 lengths |
120 |
Surface elements |
7 elements × 2 loads × 5 NSM states × 2 mass formulations × 2 unit scales |
280 |
Solid patch tests |
4 topologies × 2 interpolation orders × 2 signs × 2 moduli × 2 mass settings |
64 |
Connectors |
9 families × 2 load signs |
18 |
Concentrated masses |
6 families × 2 masses × 2 unit scales |
24 |
Load combinations |
direct/single/nested × 2 loads × 5 NSM states × 2 scopes |
60 |
Multipoint constraints |
equation/union × 2 loads × 5 NSM states × 2 scopes |
40 |
Combined subcases |
2 scopes × 3 first mass choices × 3 second mass choices × all/selected output |
36 |
Unsupported selections |
5 selections × 2 scopes × 2 loads × 2 mass choices |
40 |
Invalid NSM |
5 elements × 2 loads × 5 invalid inputs |
50 |
Thread counts and NSM |
5 elements × 5 NSM states × available counts among 1/2/4/8 |
25–100 |
The five NSM states are absent, present but unselected, direct selection, target list and union. The four primary loads are point force, gravity, uniform temperature and imposed element deformation. Additional cases cover node-directed force and acceleration. Constraint sets use lists or unions; a separate matrix checks individual point constraints. Selections appear locally or are inherited from global Case Control.
All 31 element card types currently returned by elementFormulations() have an executable fixture. A registry
guard fails when a new family lacks a fixture, and a separate guard checks the primary Cartesian count. Linear and
quadratic solids and higher-order shells are included. Invalid inputs check their specific refusal diagnostics,
including unsupported nonlinear/dynamic requests and undistributed lumped NSM.
The independent oracles are axial extension F L / (E A), thermal expansion, prescribed extension, uniform gravity,
spring extension F/K, scalar frequency squared K/M, and constant-stress patch solutions u = stress*x/E.
Shell NSM under gravity is also compared with an equivalent material density. Existing tests retain direct/adjoint
gradient and Hessian checks. Small models check correctness and interactions; these are not large-model performance
benchmarks or exhaustive tests of every material, contact option, control command or mesh geometry.
The output stations of the bars (Bar2Stations) are checked on a cantilever of
two Bar2: the rows at the ends and at the stations of a bar, listed or equally spaced, against the moment of the
beam; under a distributed load; in a block of load cases; with an output set; a station beyond the end of its bar
(refused) and a card that names no bar (a warning).
Implementations live in wasm/test/cases/; the worker, watchdog and shared runtime are in wasm/test/helpers/.