DOM ENGINEV0.27.0FIZLET
Start

0.24.0 RELEASE NOTES

Fizlet 0.24.0

By Chris Cooley ↗ · · CHANGELOG.md ↗

  • @fzlt/core/drive: long-travel suspension, and zero allocation with several races in one process. New options: stiffness (the spring rate behind hz: sag = gravity / stiffness), progressive (the rate grows with the stroke: soft over small bumps, firm on a big landing), rebound (damping while a spring extends; damping is now compression), bump (the bump stop's rate past travel, default 10, as before), inertia (body pitch and roll inertia, one number or [pitch, roll]) and droop (how fast a wheel off the ground drops, for drawing). Each wheel already sampled the ground on its own; with long travel ({ travel: 0.6, stiffness: 70, progressive: 1.2, damping: 0.4, rebound: 0.85, inertia: 1.5 }) a 3-unit drop pushes the springs to a stroke of 1.17 (the default's 1.37), rebounds and settles in about a second without a crash. New read-outs: per wheel press (compression 0..1 of the travel), stroke (the most any spring is in; 1 is the bump stop), bodyPitch and bodyRoll (the body's lean on its springs against the ground under the wheels). The defaults ride exactly as 0.23.0 did (a fixed run hashes the same, bit for bit), and 0.22.0's drift is three options away, bit for bit: { swing: 0.5, slide: 9, recover: 0 }. The fix: a game's test file that runs race after race (each with its own terrain and cars) allocated with the 0.23.0 handbrake model (Dune Hop's race test: 10 to 13 young GCs over 200,000 steps of 4 cars, bar 8; its Freestyle drift test failed on the new handbrake). The model was a set of closures per car: the shared optimised code deoptimised on "wrong call target" whenever another car's closure came round, and ran boxed until it reoptimised. The model is now one class with its functions at module level (one call target for every car): the same test measures 1 young GC; with the three options above its Freestyle drift test passes again. Behaviour change: a parked car (no pedals, under 0.05 u/s) with one or two wheels off the ground (over a dip, on a rim, teetering on a diagonal) now has its rocking damped out and comes to rest, where it used to creep or rock on and never settle (Dune Hop's Freestyle settle test with the long-travel buggy parked on a table's rim: never settled in 1,200 steps; now 809, then asleep); otherwise none with the defaults; drive() returns a class instance (step, reset, spinOut on its prototype, the same fields as before). Size 4,478 → 5,118 B gz (budget 5,152). Tests: tests/drive.test.mjs (the 0.23.0 and 0.22.0 paths by hash, a drop with default and long travel, one-sided bumps, stiffness, inertia, droop, zero allocation across many races with long travel), tests/drive-suspension.mjs in Chromium (a buggy through whoops and off a kicker with a big drop: wheels out of step, droop in the air, a deep landing, rebound, settle; in test:browser).

Every release