@vessel-dsp/runtime 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/reference-runtime.d.ts +26 -0
- package/dist/reference-runtime.d.ts.map +1 -1
- package/dist/reference-runtime.js +215 -24
- package/dist/reference-runtime.js.map +1 -1
- package/dist/v2-wasm-engine.d.ts +2 -1
- package/dist/v2-wasm-engine.d.ts.map +1 -1
- package/dist/v2-wasm-engine.js +2 -1
- package/dist/v2-wasm-engine.js.map +1 -1
- package/dist/wasm/v2_dsp.wasm +0 -0
- package/dist/worklet/v2-audio-worklet.js +99 -15
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Headless real time MNA simulation runtime and solver console for compiled Vessel
|
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
|
-
`@vessel-dsp/runtime` 0.
|
|
7
|
+
`@vessel-dsp/runtime` 0.5.0 is on npm. Use runtime 0.2.1 or later (0.3.0 adds the packaged worklet): 0.2.0 cannot load a program inside an AudioWorklet (`structuredClone` is not defined there).
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
```bash
|
|
@@ -59,7 +59,7 @@ The previous version of this example constructed `new ReferenceRuntime(program,
|
|
|
59
59
|
- `inputSourceOhms` (default 0): series impedance of whatever drives the input jack. A console setting, not a program one. A fuzz face driven from an ideal source renders at constant maximum harshness; a guitar source is several kOhm.
|
|
60
60
|
- `oversample` (default 1): integer sub samples per host sample. A power of two of 2 or more solves the circuit at `sampleRate * oversample` behind a band-limited half-band FIR cascade: one 2x stage per factor of two, interpolating on the way up and decimating on the way down, with a fixed per-stage prototype (41 taps at Kaiser beta 6.0, then 29 at 7.0, then 21 at 6.0; stages past the table reuse the last entry). Coefficients depend on the stage only, never on the circuit. The cascade is linear phase and delays the output by 19.5 / 26.25 / 28.625 host samples at 2x / 4x / 8x (0.41 / 0.55 / 0.60 ms at 48 kHz), read back by `oversampleLatency()` (`null` before `prepare()`); `hostSampleRate()` reports the host rate. Any other factor (3, 5, ...) keeps the held path: the input sample is held flat across the sub samples and the last sub sample is the output, latency 0. Factor 1 executes the same operations in the same order as before.
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
At `oversample` 2 or more, a standard audio-pass Newton solve of a nonlinear block starts from a self-selecting extrapolation (order 0, 1 or 2) of the block's last three converged solutions, chosen after every converged solve by scoring the three candidates against the solution in tolerance units and used only after a solve that took at most two iterations; a non-converged solve breaks the chain, and `prepare()` clears it. **At the default factor 1 the predictor does not run:** nothing seeds and nothing records, and every solve starts from the previous solution, as in runtime 0.3.1 (it ran at every factor in 0.4.0; 0.4.1 gated it because at factor 1 it bought 2.9 % / 10.1 % fewer iterations across the pedal / amp corpus while moving `boss-dm-2` by 6.2 % of its cold-start peak). The factor is fixed by `prepare()`, so there is no switch mid run. There is no knob: it changes which iterate inside the convergence tolerance is accepted, not the tolerance.
|
|
63
63
|
|
|
64
64
|
`process(input: Float64Array): Float64Array` renders one block and returns a new array. Any block length is accepted. `reset()` clears reactive state. `telemetry()` returns per run solver census: samples, non converged, stalled, solved but flagged, per block Newton census, non finite, peak iterations, operating point failures, `operatingPointSupplyAmps`, `renderedSupplyPeakAmps` (null until a sample renders), total iterations, last failure.
|
|
65
65
|
|
|
@@ -100,7 +100,7 @@ What it does not do: no mutation of the caller `Program` (two runtimes from one
|
|
|
100
100
|
|
|
101
101
|
`V2WasmEngine` is the compiled C++/WASM console for the same programs. It ships in this package: `bun run --cwd packages/runtime build:wasm` (needs `em++`) writes `v2_dsp.cjs` plus `v2_dsp.wasm` to the gitignored `src/wasm/`, `build` copies them to `dist/wasm/`, and `prepack` does both, so the published tarball always carries a freshly built console. The 0.2.0 tarball is about 1.0 MB packed (3.1 MB unpacked): 2.1 MB of wasm plus about 15 KB of glue.
|
|
102
102
|
|
|
103
|
-
`V2WasmEngine.create(program?)` loads the glue from the package's own `dist/wasm/` — no path to configure — and optionally loads a program. `prepare({ sampleRate, maxNewtonIterations, inputSourceOhms, oversample })` (rate defaults to 48000, `oversample` to 1, validated as on the reference console and running the same half-band cascade, latency and held-path rules), `hostSampleRate()` / `oversampleLatency()` with the reference console's names and `null`-before-`prepare()` semantics, `processSample` / `processBlock` on `Float32Array`s, `getControl` beside `setControl`, `getSupplies`/`setSupply` with the same validation and `RuntimeError` behaviour as the reference console, schedule telemetry (`getScheduleTelemetry`: solves, fallbacks, kernel solves, repivoted, abandoned, dropped blocks — a healthy packet reads zero fallbacks and zero abandoned blocks), and Newton start predictor telemetry (`getPredictorTelemetry`: `seedsUsed`, `oneIterationSolves`, `totalIterations` since `prepare()`/`reset()`; `getPredictorOrder(blockIdx)`: the order 0/1/2 the block's next solve seeds from, -1 for a bad index). The console runs the same predictor as the reference and makes the same order decision sample for sample.
|
|
103
|
+
`V2WasmEngine.create(program?)` loads the glue from the package's own `dist/wasm/` — no path to configure — and optionally loads a program. `prepare({ sampleRate, maxNewtonIterations, inputSourceOhms, oversample })` (rate defaults to 48000, `oversample` to 1, validated as on the reference console and running the same half-band cascade, latency and held-path rules), `hostSampleRate()` / `oversampleLatency()` with the reference console's names and `null`-before-`prepare()` semantics, `processSample` / `processBlock` on `Float32Array`s, `getControl` beside `setControl`, `getSupplies`/`setSupply` with the same validation and `RuntimeError` behaviour as the reference console, schedule telemetry (`getScheduleTelemetry`: solves, fallbacks, kernel solves, repivoted, abandoned, dropped blocks — a healthy packet reads zero fallbacks and zero abandoned blocks), and Newton start predictor telemetry (`getPredictorTelemetry`: `seedsUsed`, `oneIterationSolves`, `totalIterations` since `prepare()`/`reset()`; `getPredictorOrder(blockIdx)`: the order 0/1/2 the block's next solve seeds from, -1 for a bad index). The console runs the same predictor as the reference, behind the same `oversample > 1` gate, and makes the same order decision sample for sample; at `oversample` 1 `seedsUsed` and `oneIterationSolves` stay 0 and `getPredictorOrder` reads 0.
|
|
104
104
|
|
|
105
105
|
Native exports (the glue's `_v2_engine_*` functions) changed in runtime 0.4.0: `v2_engine_prepare` is now `(handle, sampleRate, maxNewtonIterations, inputSourceOhms, oversample)` — the `oversample` argument was added to the existing export, not shipped beside it, so a host calling the glue directly must pass it (the wrapper does). New exports: `v2_engine_get_host_sample_rate`, `v2_engine_get_oversample_latency` (doubles, -1 before prepare), `v2_engine_get_predictor_seeds`, `v2_engine_get_one_iteration_solves`, `v2_engine_get_total_iterations` (doubles), `v2_engine_get_predictor_order(handle, blockIdx)` (int32), and the test-only `v2_resample_*` / `v2_testonly_resample_*` getters the package's own tests use.
|
|
106
106
|
|
|
@@ -425,6 +425,8 @@ export declare class ReferenceRuntime {
|
|
|
425
425
|
private readonly limiterTrace;
|
|
426
426
|
private limitedIterationCount;
|
|
427
427
|
private limitedIterationPerSample;
|
|
428
|
+
/** Fold reseeds taken so far (diagnostic, read past `private` by the stall study's tracer). */
|
|
429
|
+
private foldReseedCount;
|
|
428
430
|
/** Series ohms of whatever drives the input jack -- see `prepare()`'s option. */
|
|
429
431
|
private inputSourceOhms;
|
|
430
432
|
/**
|
|
@@ -517,6 +519,19 @@ export declare class ReferenceRuntime {
|
|
|
517
519
|
* and the fold reseed (which reads the caller's `start`, the previous solution) are
|
|
518
520
|
* untouched, so what converges is still the circuit's equations at the shipped
|
|
519
521
|
* tolerances -- a different first iterate, the same fixed point.
|
|
522
|
+
*
|
|
523
|
+
* **It runs only when `prepare()` was given `oversample > 1`; at factor 1 (the default)
|
|
524
|
+
* it neither seeds nor records, so the ring stays empty and the solve is the one runtime
|
|
525
|
+
* 0.3.1 ran.** It shipped in 0.4.0 at every factor and was gated here in 0.4.1 because at
|
|
526
|
+
* factor 1 it buys little and moves the output more than that saving is worth: iterations
|
|
527
|
+
* fall 2.9 % across the pedal corpus and 10.1 % across the amps (1 kHz 0.1 V, cap 64),
|
|
528
|
+
* against `boss-dm-2` moving 6.2 % of its cold-start peak (0.5-0.8 % of the settled peak)
|
|
529
|
+
* and `boss-mt-2` stalling the WASM console permanently from 2.752 s of two-tone drive
|
|
530
|
+
* (it does not stall with the predictor off). Above 1 it stays on for every factor, the
|
|
531
|
+
* held path included (iterations on the profile packets: 2x -6..-15 %, 3x 0..-1 %, 4x
|
|
532
|
+
* -39..-47 %, 5x/6x -8..-24 %, 8x -44..-50 %; output movement at most 6e-6 relative RMS).
|
|
533
|
+
* The factor is fixed by `prepare()` (which also clears the ring), so there is no mid-run
|
|
534
|
+
* switch to reason about.
|
|
520
535
|
*/
|
|
521
536
|
private readonly newtonStartHistory;
|
|
522
537
|
private readonly blockNewtonCensus;
|
|
@@ -1057,6 +1072,17 @@ export declare class ReferenceRuntime {
|
|
|
1057
1072
|
* circuit the sample loop does not solve.
|
|
1058
1073
|
*/
|
|
1059
1074
|
private iterate;
|
|
1075
|
+
/**
|
|
1076
|
+
* The factor the Newton update is scaled by so that no railed op-amp's differential moves
|
|
1077
|
+
* further than its step cap and no op-amp output node moves further than one full swing:
|
|
1078
|
+
* the smallest `cap / |requested differential step|` and `2 * halfSwing / |requested output
|
|
1079
|
+
* step|` over the block's railed op-amps, or 1. `current` is the iterate the rows were
|
|
1080
|
+
* stamped at and `next` the undamped solve. The history read here is the one the stamps
|
|
1081
|
+
* wrote this iteration, so `differential` is the point each row's tangent was taken at and
|
|
1082
|
+
* `cap` the step the next evaluation will allow; a request inside both bounds scales nothing.
|
|
1083
|
+
* Mirrored in `Engine.cpp` (`opAmpStepDamping`); the two must agree to the operation.
|
|
1084
|
+
*/
|
|
1085
|
+
private opAmpStepDamping;
|
|
1060
1086
|
/**
|
|
1061
1087
|
* Build-order step 6, vertical slice: the part of a block's matrix that is the same for
|
|
1062
1088
|
* every Newton iteration of this sample -- every stamp `newtonPortRowsOf` calls linear,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reference-runtime.d.ts","sourceRoot":"","sources":["../src/reference-runtime.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAGX,cAAc,EAGd,SAAS,EACT,eAAe,EAEf,OAAO,EACP,cAAc,EAEd,MAAM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xB,OAAO,EAAE,YAAY,EACrB,GAAG,EAAE,MAAM,EAAE,GACX,OAAO,CAuCT"}
|
|
@@ -599,11 +599,25 @@ function opAmpHalfSwing(railHigh, railLow) {
|
|
|
599
599
|
return Math.max((railHigh - railLow) / 2, 1e-9);
|
|
600
600
|
}
|
|
601
601
|
/**
|
|
602
|
-
* The
|
|
603
|
-
*
|
|
604
|
-
*
|
|
602
|
+
* The gain-bandwidth product, in hertz, of an op-amp section whose stamp states none
|
|
603
|
+
* (`gainBandwidthHz: null`). Before the stamp carried the field every op-amp in every program
|
|
604
|
+
* ran this value, so a `null` section renders exactly as it always did; the compiler names the
|
|
605
|
+
* sections left on it (`opamp-gain-bandwidth-default`). With a 1e5 gain the open-loop pole sits at
|
|
606
|
+
* `GBP / gain`, 10 Hz here.
|
|
607
|
+
*
|
|
608
|
+
* A stamp that states a product runs on that product instead. Mirrored in `Engine.cpp`'s
|
|
609
|
+
* `OPAMP_DEFAULT_GAIN_BANDWIDTH_HZ`.
|
|
605
610
|
*/
|
|
606
|
-
const
|
|
611
|
+
const OPAMP_DEFAULT_GAIN_BANDWIDTH_HZ = 1e6;
|
|
612
|
+
/**
|
|
613
|
+
* The gain-bandwidth product an op-amp stamp runs on: its own, else the class default. `??` also
|
|
614
|
+
* catches `undefined`, which is what a program compiled before the field existed carries -- that
|
|
615
|
+
* program was compiled against this same default, so reading it as `null` is its meaning, not a
|
|
616
|
+
* fallback invented for it.
|
|
617
|
+
*/
|
|
618
|
+
function opAmpGainBandwidthHz(stamp) {
|
|
619
|
+
return stamp.gainBandwidthHz ?? OPAMP_DEFAULT_GAIN_BANDWIDTH_HZ;
|
|
620
|
+
}
|
|
607
621
|
/**
|
|
608
622
|
* Anti-windup bound for the op-amp pole's raw state, in units of halfSwing.
|
|
609
623
|
*
|
|
@@ -1354,6 +1368,8 @@ export class ReferenceRuntime {
|
|
|
1354
1368
|
limiterTrace = typeof process !== "undefined" && process.env?.VESSEL_LIMITER_TRACE === "1";
|
|
1355
1369
|
limitedIterationCount = 0;
|
|
1356
1370
|
limitedIterationPerSample = [];
|
|
1371
|
+
/** Fold reseeds taken so far (diagnostic, read past `private` by the stall study's tracer). */
|
|
1372
|
+
foldReseedCount = 0;
|
|
1357
1373
|
/** Series ohms of whatever drives the input jack -- see `prepare()`'s option. */
|
|
1358
1374
|
inputSourceOhms = 0;
|
|
1359
1375
|
/**
|
|
@@ -1446,6 +1462,19 @@ export class ReferenceRuntime {
|
|
|
1446
1462
|
* and the fold reseed (which reads the caller's `start`, the previous solution) are
|
|
1447
1463
|
* untouched, so what converges is still the circuit's equations at the shipped
|
|
1448
1464
|
* tolerances -- a different first iterate, the same fixed point.
|
|
1465
|
+
*
|
|
1466
|
+
* **It runs only when `prepare()` was given `oversample > 1`; at factor 1 (the default)
|
|
1467
|
+
* it neither seeds nor records, so the ring stays empty and the solve is the one runtime
|
|
1468
|
+
* 0.3.1 ran.** It shipped in 0.4.0 at every factor and was gated here in 0.4.1 because at
|
|
1469
|
+
* factor 1 it buys little and moves the output more than that saving is worth: iterations
|
|
1470
|
+
* fall 2.9 % across the pedal corpus and 10.1 % across the amps (1 kHz 0.1 V, cap 64),
|
|
1471
|
+
* against `boss-dm-2` moving 6.2 % of its cold-start peak (0.5-0.8 % of the settled peak)
|
|
1472
|
+
* and `boss-mt-2` stalling the WASM console permanently from 2.752 s of two-tone drive
|
|
1473
|
+
* (it does not stall with the predictor off). Above 1 it stays on for every factor, the
|
|
1474
|
+
* held path included (iterations on the profile packets: 2x -6..-15 %, 3x 0..-1 %, 4x
|
|
1475
|
+
* -39..-47 %, 5x/6x -8..-24 %, 8x -44..-50 %; output movement at most 6e-6 relative RMS).
|
|
1476
|
+
* The factor is fixed by `prepare()` (which also clears the ring), so there is no mid-run
|
|
1477
|
+
* switch to reason about.
|
|
1449
1478
|
*/
|
|
1450
1479
|
newtonStartHistory = new Map();
|
|
1451
1480
|
blockNewtonCensus = new Map();
|
|
@@ -3806,10 +3835,15 @@ export class ReferenceRuntime {
|
|
|
3806
3835
|
// buffer, so a caller that still holds it (`[...guess]` in the continuation methods,
|
|
3807
3836
|
// `previous.slice()` in `processBlock`) sees it unchanged.
|
|
3808
3837
|
//
|
|
3809
|
-
// On a standard audio pass of a nonlinear block
|
|
3810
|
-
// `
|
|
3811
|
-
//
|
|
3812
|
-
|
|
3838
|
+
// On a standard audio pass of a nonlinear block, and only when the runtime was prepared
|
|
3839
|
+
// with `oversample > 1`, the seed is the predicted start (see `newtonStartHistory`),
|
|
3840
|
+
// falling back to `start`. At factor 1 nothing seeds and nothing records. `start`
|
|
3841
|
+
// itself stays the previous solution for the fold reseed below.
|
|
3842
|
+
const predictorPass = this.oversample > 1 &&
|
|
3843
|
+
!dc &&
|
|
3844
|
+
sourceScale === 1 &&
|
|
3845
|
+
gmin === GMIN_SIEMENS &&
|
|
3846
|
+
!block.linear;
|
|
3813
3847
|
const seed = (predictorPass ? this.predictedNewtonStart(block.id, size) : null) ?? start;
|
|
3814
3848
|
for (let index = 0; index < size; index += 1) {
|
|
3815
3849
|
solutionA[index] = seed[index] ?? 0;
|
|
@@ -3837,7 +3871,9 @@ export class ReferenceRuntime {
|
|
|
3837
3871
|
let bestDelta = Number.POSITIVE_INFINITY;
|
|
3838
3872
|
let noImprovement = 0;
|
|
3839
3873
|
let foldStreak = 0;
|
|
3840
|
-
let
|
|
3874
|
+
let foldReseeds = 0;
|
|
3875
|
+
let lastWorstNode = -1;
|
|
3876
|
+
let lastWorstSign = 0;
|
|
3841
3877
|
for (let iteration = 0; iteration < iterations; iteration += 1) {
|
|
3842
3878
|
used = iteration + 1;
|
|
3843
3879
|
this.limitedIterate = false;
|
|
@@ -3986,6 +4022,32 @@ export class ReferenceRuntime {
|
|
|
3986
4022
|
}
|
|
3987
4023
|
}
|
|
3988
4024
|
}
|
|
4025
|
+
// **The op-amp step limiter damps the whole update, not only its own row's
|
|
4026
|
+
// evaluation (2026-10-11).** A railed op-amp's row is a tangent of slope up to
|
|
4027
|
+
// `alpha * A0` (910 at 7 MHz and 48 kHz); where a loop closes around it with net
|
|
4028
|
+
// positive feedback inside one sample, the Jacobian is singular at the point of the
|
|
4029
|
+
// sigmoid where `slope * beta = 1`, and a Newton step taken near it leaves the physical
|
|
4030
|
+
// domain: measured on `mxr-blue-box` at 4 MHz the solved output node went to 910,
|
|
4031
|
+
// -1424 and 10335 V during one rail switch, every junction downstream then walked back
|
|
4032
|
+
// for hundreds of iterations, and on `boss-mt-2` at os4 the same step put -30 V on an
|
|
4033
|
+
// output node at iteration 4 and 1e88 on the block by iteration 26. The limiter alone
|
|
4034
|
+
// only re-evaluates the op-amp at a capped differential; the rest of the iterate keeps
|
|
4035
|
+
// the explosion. Scaling the whole step by the most limited op-amp's own ratio
|
|
4036
|
+
// `cap / |requested|` keeps the iterate where its tangent was taken (the limited
|
|
4037
|
+
// differential is then the iterate's actual differential), and bounding the output
|
|
4038
|
+
// node's move to one full swing per iteration keeps it on the sigmoid the row is a
|
|
4039
|
+
// tangent of. Both are the step limiter's own numbers; an op-amp that is not limited
|
|
4040
|
+
// scales nothing, so a sample that never limits takes exactly the path it always did.
|
|
4041
|
+
// Transient only: at the operating point `alpha` is 1, the linear width is a hundred
|
|
4042
|
+
// thousandth of the swing, and damping to that cap quenched the DC continuation
|
|
4043
|
+
// (`boss-aw-2` came up with a latched envelope stage and a dead output). The DC walk
|
|
4044
|
+
// has gmin and source stepping as its own safety net and is left exactly as it was.
|
|
4045
|
+
const damping = dc ? 1 : this.opAmpStepDamping(block, blockIndex, current, next, dt, dc);
|
|
4046
|
+
if (damping < 1) {
|
|
4047
|
+
for (let i = 0; i < size; i++) {
|
|
4048
|
+
next[i] = current[i] + damping * (next[i] - current[i]);
|
|
4049
|
+
}
|
|
4050
|
+
}
|
|
3989
4051
|
if (relaxing) {
|
|
3990
4052
|
for (let i = 0; i < size; i++) {
|
|
3991
4053
|
next[i] = current[i] + alpha * (next[i] - current[i]);
|
|
@@ -3994,6 +4056,22 @@ export class ReferenceRuntime {
|
|
|
3994
4056
|
const delta = maxAbsDifference(next, current);
|
|
3995
4057
|
worstNode = worstDifferenceIndex(next, current);
|
|
3996
4058
|
worstDelta = delta;
|
|
4059
|
+
// **Non-contracting means circling, not marching (2026-10-11).** The brake was fitted
|
|
4060
|
+
// for an iterate that circles or stalls, and `delta` failing to fall cannot tell that
|
|
4061
|
+
// from a junction walking monotonically to its solution a thermal voltage at a time,
|
|
4062
|
+
// which is SPICE's normal path out of a large step. Measured on `mxr-blue-box` at
|
|
4063
|
+
// 4 MHz after each rail switch: the brake latched on the switch's transient and then
|
|
4064
|
+
// held a downstream NPN base at 0.2 Vt per iteration for 230 iterations of a 305-
|
|
4065
|
+
// iteration solve, five times the un-damped walk. A circling iterate reverses the
|
|
4066
|
+
// sign of its worst node's step; a marching one does not. So the brake engages, and
|
|
4067
|
+
// tightens, only when the worst node's step has reversed since the last iteration.
|
|
4068
|
+
const worstSign = Math.sign((next[worstNode] ?? 0) - (current[worstNode] ?? 0));
|
|
4069
|
+
// At the operating point the brake keeps its old rule (every non-contracting iteration
|
|
4070
|
+
// counts), so the DC walk every packet was validated on is untouched.
|
|
4071
|
+
const reversed = dc ||
|
|
4072
|
+
(worstNode === lastWorstNode && worstSign !== 0 && lastWorstSign !== 0 && worstSign !== lastWorstSign);
|
|
4073
|
+
lastWorstNode = worstNode;
|
|
4074
|
+
lastWorstSign = worstSign;
|
|
3997
4075
|
if (delta < bestDelta * 0.999) {
|
|
3998
4076
|
bestDelta = delta;
|
|
3999
4077
|
noImprovement = 0;
|
|
@@ -4008,7 +4086,7 @@ export class ReferenceRuntime {
|
|
|
4008
4086
|
}
|
|
4009
4087
|
}
|
|
4010
4088
|
else {
|
|
4011
|
-
noImprovement += 1;
|
|
4089
|
+
noImprovement += reversed ? 1 : 0;
|
|
4012
4090
|
if (!relaxing) {
|
|
4013
4091
|
if (noImprovement >= NEWTON_NON_CONTRACTING_LIMIT &&
|
|
4014
4092
|
iteration >= NEWTON_RELAXATION_EARLIEST_ITERATION) {
|
|
@@ -4082,15 +4160,37 @@ export class ReferenceRuntime {
|
|
|
4082
4160
|
// from the reset above, so it is read through its declared type.
|
|
4083
4161
|
const limitedOpamp = this.limitedOpamp;
|
|
4084
4162
|
foldStreak = limitedOpamp?.folded === true ? foldStreak + 1 : 0;
|
|
4085
|
-
|
|
4086
|
-
|
|
4163
|
+
// **Re-armed, not one-shot (2026-10-11).** The reseed used to fire once per solve. On
|
|
4164
|
+
// `boss-mt-2` section `+=37 -=36 out=38` -- whose non-inverting input is fed from its own
|
|
4165
|
+
// output through 1 uF, so the per-sample problem has net positive feedback -- the first
|
|
4166
|
+
// streak is a transient at iteration ~20 that the reseed spends, and the solve then hunts
|
|
4167
|
+
// rail to rail before pinning at a turning point of the residual (`slope * beta = 1`)
|
|
4168
|
+
// from iteration ~660 to the cap: step requests of -4 / +2.8 widths against a floor cap of
|
|
4169
|
+
// 1/64, the Jacobian's sign flipping across one floor step, limited on 1023 of 1024
|
|
4170
|
+
// iterations. That is the canary's os1 stall with the datasheet product, and main's own
|
|
4171
|
+
// os4 stall at 0.666 s is the same pair of sections in the same two-cycle (the trace is in
|
|
4172
|
+
// `docs/spikes/2026-10-11-opamp-gbw-stall.md`). A turning point is exactly what the
|
|
4173
|
+
// halving cap cannot leave and exactly what a reseed exists for, so each fresh streak of
|
|
4174
|
+
// `OPAMP_FOLD_STREAK` floor-limited iterations earns another. **The first reseed goes to
|
|
4175
|
+
// the rail the sample started on, the second to the opposite one**, and so on: the
|
|
4176
|
+
// start's rail is the physical continuation (a bistable stage holds its state), and a
|
|
4177
|
+
// console that reaches that root directly and one that needs a reseed to reach it then
|
|
4178
|
+
// agree. With the opposite rail first they did not: at os4 on `mxr-blue-box` the TS
|
|
4179
|
+
// console reseeded at sample 76 and flipped rails while the WASM console converged in
|
|
4180
|
+
// four iterations without one, and the two drifted apart from sample 89 (r 0.016 over
|
|
4181
|
+
// the parity window). Each reseed needs its own streak, so the budget bounds the
|
|
4182
|
+
// hopping. A sample that never folds takes exactly the path it always did.
|
|
4183
|
+
if (!dc && limitedOpamp !== null && foldStreak >= OPAMP_FOLD_STREAK) {
|
|
4184
|
+
foldReseeds += 1;
|
|
4185
|
+
this.foldReseedCount += 1;
|
|
4087
4186
|
foldStreak = 0;
|
|
4088
4187
|
const wasHigh = (start[limitedOpamp.output] ?? limitedOpamp.centre) >= limitedOpamp.centre;
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4188
|
+
const toHigh = foldReseeds % 2 === 1 ? wasHigh : !wasHigh;
|
|
4189
|
+
current[limitedOpamp.output] = toHigh
|
|
4190
|
+
? limitedOpamp.railHigh
|
|
4191
|
+
: limitedOpamp.railLow;
|
|
4092
4192
|
this.opampHistory.set(limitedOpamp.key, {
|
|
4093
|
-
differential:
|
|
4193
|
+
differential: toHigh ? limitedOpamp.band : -limitedOpamp.band,
|
|
4094
4194
|
step: 0,
|
|
4095
4195
|
cap: limitedOpamp.maxStep,
|
|
4096
4196
|
});
|
|
@@ -4144,6 +4244,50 @@ export class ReferenceRuntime {
|
|
|
4144
4244
|
}
|
|
4145
4245
|
return { solution: current, converged, used, worstNode, worstDelta };
|
|
4146
4246
|
}
|
|
4247
|
+
/**
|
|
4248
|
+
* The factor the Newton update is scaled by so that no railed op-amp's differential moves
|
|
4249
|
+
* further than its step cap and no op-amp output node moves further than one full swing:
|
|
4250
|
+
* the smallest `cap / |requested differential step|` and `2 * halfSwing / |requested output
|
|
4251
|
+
* step|` over the block's railed op-amps, or 1. `current` is the iterate the rows were
|
|
4252
|
+
* stamped at and `next` the undamped solve. The history read here is the one the stamps
|
|
4253
|
+
* wrote this iteration, so `differential` is the point each row's tangent was taken at and
|
|
4254
|
+
* `cap` the step the next evaluation will allow; a request inside both bounds scales nothing.
|
|
4255
|
+
* Mirrored in `Engine.cpp` (`opAmpStepDamping`); the two must agree to the operation.
|
|
4256
|
+
*/
|
|
4257
|
+
opAmpStepDamping(block, blockIndex, current, next, dt, dc) {
|
|
4258
|
+
let damping = 1;
|
|
4259
|
+
for (const stamp of block.stamps) {
|
|
4260
|
+
if (stamp.kind !== "ideal-opamp" || stamp.railHigh === null || stamp.railLow === null) {
|
|
4261
|
+
continue;
|
|
4262
|
+
}
|
|
4263
|
+
const history = this.opampHistory.get(packHistoryKey3(blockIndex, stamp.plus, stamp.minus, stamp.output));
|
|
4264
|
+
if (history === undefined)
|
|
4265
|
+
continue;
|
|
4266
|
+
// The step the next evaluation will see: the band-clamped differential against the
|
|
4267
|
+
// point the row was taken at. The clamp matters: a section whose real differential
|
|
4268
|
+
// sits beyond the band would otherwise "request" the excess on every iteration and
|
|
4269
|
+
// damp a converged solve forever (measured: `boss-od-3` at os4, every sample at the
|
|
4270
|
+
// cap, when the raw differential was used here).
|
|
4271
|
+
const halfSwing = opAmpHalfSwing(stamp.railHigh, stamp.railLow);
|
|
4272
|
+
const alpha = dc
|
|
4273
|
+
? 1
|
|
4274
|
+
: opAmpPoleAlpha(stamp.openLoopGain, opAmpGainBandwidthHz(stamp), dt, this.sampleRate);
|
|
4275
|
+
const effectiveGain = alpha * stamp.openLoopGain;
|
|
4276
|
+
const linearWidth = halfSwing / effectiveGain;
|
|
4277
|
+
const band = OPAMP_DIFFERENTIAL_BAND * linearWidth;
|
|
4278
|
+
const nextDifferential = clamp((next[stamp.plus] ?? 0) - (next[stamp.minus] ?? 0), -band, band);
|
|
4279
|
+
const magnitude = Math.abs(nextDifferential - history.differential);
|
|
4280
|
+
if (magnitude > history.cap) {
|
|
4281
|
+
damping = Math.min(damping, history.cap / magnitude);
|
|
4282
|
+
}
|
|
4283
|
+
const swing = 2 * halfSwing;
|
|
4284
|
+
const outputStep = Math.abs((next[stamp.output] ?? 0) - (current[stamp.output] ?? 0));
|
|
4285
|
+
if (outputStep > swing) {
|
|
4286
|
+
damping = Math.min(damping, swing / outputStep);
|
|
4287
|
+
}
|
|
4288
|
+
}
|
|
4289
|
+
return damping;
|
|
4290
|
+
}
|
|
4147
4291
|
/**
|
|
4148
4292
|
* Build-order step 6, vertical slice: the part of a block's matrix that is the same for
|
|
4149
4293
|
* every Newton iteration of this sample -- every stamp `newtonPortRowsOf` calls linear,
|
|
@@ -4335,8 +4479,13 @@ export class ReferenceRuntime {
|
|
|
4335
4479
|
}
|
|
4336
4480
|
};
|
|
4337
4481
|
// The predicted start (see `newtonStartHistory`), falling back to `start`: the same
|
|
4338
|
-
// rule as `iterate`, applied through the port
|
|
4339
|
-
|
|
4482
|
+
// rule and the same `oversample > 1` gate as `iterate`, applied through the port
|
|
4483
|
+
// unknowns the reduced solve iterates on.
|
|
4484
|
+
const predictorPass = this.oversample > 1 &&
|
|
4485
|
+
!dc &&
|
|
4486
|
+
sourceScale === 1 &&
|
|
4487
|
+
gmin === GMIN_SIEMENS &&
|
|
4488
|
+
!block.linear;
|
|
4340
4489
|
const seed = (predictorPass ? this.predictedNewtonStart(block.id, size) : null) ?? start;
|
|
4341
4490
|
for (let p = 0; p < portCount; p += 1) {
|
|
4342
4491
|
scratch.yCurrent[p] = seed[portRows[p]] ?? 0;
|
|
@@ -5043,7 +5192,7 @@ export class ReferenceRuntime {
|
|
|
5043
5192
|
continue;
|
|
5044
5193
|
}
|
|
5045
5194
|
const key = packHistoryKey3(blockIndex, stamp.plus, stamp.minus, stamp.output);
|
|
5046
|
-
const alpha = opAmpPoleAlpha(stamp.openLoopGain,
|
|
5195
|
+
const alpha = opAmpPoleAlpha(stamp.openLoopGain, opAmpGainBandwidthHz(stamp), dt, this.sampleRate);
|
|
5047
5196
|
// **Bounded at ±8 halfSwings (shipped 2026-09-14, reverted once 2026-08-21).**
|
|
5048
5197
|
// The bound is anti-windup: a real op-amp's compensation node cannot exceed its
|
|
5049
5198
|
// supply, and at ±8 halfSwings `tanh` is `0.99999977` -- indistinguishable from
|
|
@@ -6139,14 +6288,25 @@ export class ReferenceRuntime {
|
|
|
6139
6288
|
// saturation band and step limiter are stated in.
|
|
6140
6289
|
const alpha = dc
|
|
6141
6290
|
? 1
|
|
6142
|
-
: opAmpPoleAlpha(stamp.openLoopGain,
|
|
6291
|
+
: opAmpPoleAlpha(stamp.openLoopGain, opAmpGainBandwidthHz(stamp), dt, this.sampleRate);
|
|
6143
6292
|
const effectiveGain = alpha * stamp.openLoopGain;
|
|
6144
6293
|
const linearWidth = halfSwing / effectiveGain;
|
|
6145
6294
|
const previous = this.opampHistory.get(opampKey);
|
|
6146
|
-
const previousDifferential = previous?.differential ?? 0;
|
|
6147
6295
|
const rawDifferential = (solution[stamp.plus] ?? 0) - (solution[stamp.minus] ?? 0);
|
|
6148
6296
|
const band = OPAMP_DIFFERENTIAL_BAND * linearWidth;
|
|
6149
6297
|
const bounded = clamp(rawDifferential, -band, band);
|
|
6298
|
+
// **The first iteration measures its step against the seed, not against zero
|
|
6299
|
+
// (2026-10-11).** The history is cleared every sample, so the first iterate used to
|
|
6300
|
+
// compare its differential with 0 and be "limited" whenever a section sits more than
|
|
6301
|
+
// four widths from zero -- which every saturated section does, by the width of its
|
|
6302
|
+
// band. The solve then re-walked that differential from zero at four widths per
|
|
6303
|
+
// iteration on every sample: `electro-harmonix-slapback-echo` at 4 MHz needed exactly
|
|
6304
|
+
// four iterations per sub-sample (its sections sit at the 12-width band), `boss-od-3`
|
|
6305
|
+
// and `boss-pq-4` exactly three, where the predictor had been landing one. SPICE's
|
|
6306
|
+
// rule is that the first iterate of a time point is limited against the previous time
|
|
6307
|
+
// point's solution; that is what the seed is, so its own differential is the point
|
|
6308
|
+
// the first step is measured from, and the first step is zero.
|
|
6309
|
+
const previousDifferential = previous?.differential ?? bounded;
|
|
6150
6310
|
const step = bounded - previousDifferential;
|
|
6151
6311
|
const maxStep = OPAMP_MAX_DIFFERENTIAL_STEP * linearWidth;
|
|
6152
6312
|
const reversing = previous !== undefined &&
|
|
@@ -6184,9 +6344,25 @@ export class ReferenceRuntime {
|
|
|
6184
6344
|
? Math.max(previousCap / 2, linearWidth / 64)
|
|
6185
6345
|
: Math.min(maxStep, previousCap * 1.2);
|
|
6186
6346
|
const limited = Math.abs(step) > cap;
|
|
6347
|
+
// A fold is the cap pinned at its floor **with the iterate moving at the floor's
|
|
6348
|
+
// scale**, whether or not this particular step overran the cap: once the update is
|
|
6349
|
+
// damped to the cap (see `opAmpStepDamping`) a trapped iterate's steps equal the cap
|
|
6350
|
+
// rather than exceed it, so a streak counted on `limited` alone never forms (measured
|
|
6351
|
+
// 2026-10-11: `boss-mt-2` sample 4990, 1024 iterations with the cap at the floor on
|
|
6352
|
+
// 1015 of them and the limiter flagged on 372). The step-size test is what keeps an
|
|
6353
|
+
// idle section out of it: a section whose differential merely jitters by 1e-6 widths
|
|
6354
|
+
// reverses sign every iteration too, its cap collapses to the floor the same way, and
|
|
6355
|
+
// without the test it was reseeded onto a rail it had no business on (`boss-aw-2`,
|
|
6356
|
+
// sample 1489: 527 iterations and a latched output where the product tree took 4).
|
|
6357
|
+
// A quarter of the floor cap (`linearWidth / 64`) is the scale: a trapped iterate
|
|
6358
|
+
// moves by the cap, or by less when another section's ratio damped the update (the
|
|
6359
|
+
// mt-2 pair s87/s88 fold together), and jitter is four orders below it.
|
|
6360
|
+
const folded = cap <= linearWidth / 8 && Math.abs(step) >= linearWidth / 256;
|
|
6187
6361
|
if (limited) {
|
|
6188
6362
|
this.limitedIterate = true;
|
|
6189
6363
|
this.limitedBy = `opamp +=${stamp.plus} -=${stamp.minus} out=${stamp.output}`;
|
|
6364
|
+
}
|
|
6365
|
+
if (limited || folded) {
|
|
6190
6366
|
this.limitedOpamp = {
|
|
6191
6367
|
key: opampKey,
|
|
6192
6368
|
output: stamp.output,
|
|
@@ -6195,7 +6371,7 @@ export class ReferenceRuntime {
|
|
|
6195
6371
|
railLow: stamp.railLow,
|
|
6196
6372
|
band,
|
|
6197
6373
|
maxStep,
|
|
6198
|
-
folded
|
|
6374
|
+
folded,
|
|
6199
6375
|
};
|
|
6200
6376
|
}
|
|
6201
6377
|
const differential = limited
|
|
@@ -6231,11 +6407,26 @@ export class ReferenceRuntime {
|
|
|
6231
6407
|
// advance's comment and `docs/troubleshootings/...saturated-opamp-row...md`).
|
|
6232
6408
|
const derivativeShape = Math.tanh(clamp(scaled, -OPAMP_SATURATION_BAND, OPAMP_SATURATION_BAND));
|
|
6233
6409
|
const slope = effectiveGain * (1 - derivativeShape * derivativeShape);
|
|
6234
|
-
// Linearised: Vout - slope * Vdiff = Vout0 - slope * Vdiff0
|
|
6410
|
+
// Linearised: Vout - slope * Vdiff = Vout0 - slope * Vdiff0, with Vdiff0 the point the
|
|
6411
|
+
// tangent is taken at. While the step limiter is active that point is the limited
|
|
6412
|
+
// differential (SPICE's rule: evaluate at the damped step, let the unknown be free).
|
|
6413
|
+
// When it is not, the point is the **actual previous differential**, even when that
|
|
6414
|
+
// lies beyond the band `differential` was clamped to -- the value `output` is still
|
|
6415
|
+
// the band's, which is the model, but the tangent must pass through the iterate or the
|
|
6416
|
+
// fixed point is not the model: with `Vdiff0 = bounded` the row converges to
|
|
6417
|
+
// `f(band) + slope * (Vdiff - band)`, an output off its rail by the leak
|
|
6418
|
+
// `slope * excess`, and `slope` grows with the gain-bandwidth product. Measured
|
|
6419
|
+
// 2026-10-11 on `mxr-blue-box` at 4 MHz: the op-amp's own output 0.003 V against a
|
|
6420
|
+
// 0 V rail while the solved node sat at -0.290 V, and the two NPN stages it drives
|
|
6421
|
+
// spent 300 iterations walking out of the junction state that sub-rail voltage put
|
|
6422
|
+
// them in (`docs/spikes/2026-10-11-opamp-gbw-stall.md`). At the fixed point
|
|
6423
|
+
// `Vdiff == rawDifferential`, so the row reads `Vout = output` exactly, on or beyond
|
|
6424
|
+
// the band; inside the band `rawDifferential == bounded` and nothing changes.
|
|
6425
|
+
const linearisedAt = limited ? differential : rawDifferential;
|
|
6235
6426
|
matrix[row][stamp.output] += 1;
|
|
6236
6427
|
matrix[row][stamp.plus] -= slope;
|
|
6237
6428
|
matrix[row][stamp.minus] += slope;
|
|
6238
|
-
rhs[row] = output - slope *
|
|
6429
|
+
rhs[row] = output - slope * linearisedAt;
|
|
6239
6430
|
break;
|
|
6240
6431
|
}
|
|
6241
6432
|
case "vccs": {
|