MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / simplifyStable

Function simplifyStable

test/compute-engine/fungrim-loops.test.ts:118–127  ·  view source on GitHub ↗

* simplify(simplify(x)): assert termination within the time budget, a stable * (idempotent) endpoint, and return the result + elapsed time.

(expr: ReturnType<ComputeEngine['box']>)

Source from the content-addressed store, hash-verified

116 * (idempotent) endpoint, and return the result + elapsed time.
117 */
118function simplifyStable(expr: ReturnType<ComputeEngine['box']>): {
119 result: ReturnType<ComputeEngine['box']>;
120 stable: boolean;
121 elapsedMs: number;
122} {
123 const t0 = Date.now();
124 const s1 = expr.simplify();
125 const s2 = s1.simplify();
126 return { result: s1, stable: s2.isSame(s1), elapsedMs: Date.now() - t0 };
127}
128
129// ---------------------------------------------------------------------------
130// 1. Artifact inverse-pair invariant (standing test, §2.5 layer 1)

Callers 1

Calls 2

simplifyMethod · 0.65
isSameMethod · 0.65

Tested by

no test coverage detected