* simplify(simplify(x)): assert termination within the time budget, a stable * (idempotent) endpoint, and return the result + elapsed time.
(expr: ReturnType<ComputeEngine['box']>)
| 116 | * (idempotent) endpoint, and return the result + elapsed time. |
| 117 | */ |
| 118 | function 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) |
no test coverage detected