@cavelang/solver-z3 0.29.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/Authors.md ADDED
@@ -0,0 +1,5 @@
1
+ # Authors
2
+
3
+ By adding their name to this file, all listed authors confirm they have copyright over their contributions to this project and are waiving these rights, placing their work in the public domain in accordance with the CC0 1.0 Universal Public Domain Dedication.
4
+
5
+ - Mirek Rusin (Switzerland)
package/BENCHMARK.md ADDED
@@ -0,0 +1,44 @@
1
+ # Z3 feasibility benchmark
2
+
3
+ Measured on 2026-07-15 on Linux x64 with `z3-solver` 4.16.0, both at
4
+ the project's minimum Node.js 22.18 runtime and the available Node.js 24.14
5
+ runtime. CI runs the full adapter and lifecycle suite on Node.js 22.
6
+
7
+ The fixture optimizes an exact architecture-choice model with a finite enum,
8
+ bounded integer, exact-real cost, conditional constraint, and lexicographic
9
+ objective. Warm latency is 25 sequential solves through one initialized
10
+ runtime.
11
+
12
+ | Measurement | Node 22.18.0 | Node 24.14.0 |
13
+ |---|---:|---:|
14
+ | Installed `z3-solver` files | 34,533,499 bytes | 34,533,499 bytes |
15
+ | Shipped Wasm | 33,704,614 bytes | 33,704,614 bytes |
16
+ | Sum of individually gzip-compressed package files | 7,762,833 bytes | 7,762,833 bytes |
17
+ | Cold Wasm initialization | 394 ms | 414 ms |
18
+ | First optimized check after initialization | 282.75 ms | 337.89 ms |
19
+ | Warm mean | 7.62 ms | 8.79 ms |
20
+ | Warm p50 | 7.32 ms | 7.45 ms |
21
+ | Warm p95 | 10.83 ms | 14.17 ms |
22
+ | RSS before initialization | 147,804,160 bytes | 138,227,712 bytes |
23
+ | RSS after 26 checks | 250,896,384 bytes | 225,439,744 bytes |
24
+ | Peak process RSS | 256,487,424 bytes | 227,479,552 bytes |
25
+
26
+ The installed-size measurement covers the 23 files shipped by `z3-solver`.
27
+ Its npm tarball is about 7.8 MB, consistent with the gzip measurement. The
28
+ adapter package was packed with compiled declarations/runtime files, installed
29
+ with its published dependencies in a clean consumer, solved a model, called
30
+ `close()`, and exited without a worker hang. `scripts/benchmark.ts` reproduces
31
+ the local measurements.
32
+
33
+ ## Decision
34
+
35
+ Accept Z3 as an optional Node.js backend. It produces satisfying assignments,
36
+ lexicographic optima, weighted-soft optima, and tracked unsatisfiable cores;
37
+ exact decimals round-trip as rationals; actual deadlines return `unknown`;
38
+ simultaneous calls are queued; and explicit shutdown terminates workers.
39
+
40
+ Do not add it to `@cavelang/solver`, the CLI, MCP, or website dependency graph
41
+ by default. Cold start, roughly 34.5 MB installed size, and process-wide
42
+ threaded-Wasm state are material costs. A consumer should opt into
43
+ `@cavelang/solver-z3`, initialize once, reuse it, and close it only during
44
+ process shutdown. Browser shipping remains a separate decision gate.
package/License.md ADDED
@@ -0,0 +1,6 @@
1
+ # CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
2
+
3
+ To the extent possible under law, the authors listed in [Authors.md](./Authors.md) have waived all copyright and related or neighboring rights to this software and associated documentation files (the "Software").
4
+
5
+ For more information, please see:
6
+ https://creativecommons.org/publicdomain/zero/1.0/
package/README.md ADDED
@@ -0,0 +1,105 @@
1
+ # `@cavelang/solver-z3`
2
+
3
+ Optional Node.js adapter from CAVE's solver-neutral model to the official
4
+ `z3-solver` WebAssembly package. Importing this package is cheap: Z3's 34 MB
5
+ Wasm module is dynamically imported and initialized only when `create()` is
6
+ called.
7
+
8
+ ```ts
9
+ import { Model, Solve } from '@cavelang/solver'
10
+ import { create } from '@cavelang/solver-z3'
11
+
12
+ const model: Model.t = {
13
+ schema: Model.schema,
14
+ variables: [{ id: 'replicas', sort: 'int', min: 1, max: 20 }],
15
+ constraints: [{
16
+ id: 'capacity',
17
+ expression: {
18
+ kind: 'gte',
19
+ left: { kind: 'variable', id: 'replicas' },
20
+ right: { kind: 'literal', sort: 'int', value: 3 }
21
+ }
22
+ }],
23
+ objectives: [{
24
+ id: 'fewest-replicas',
25
+ direction: 'minimize',
26
+ expression: { kind: 'variable', id: 'replicas' }
27
+ }]
28
+ }
29
+
30
+ const z3 = await create()
31
+ const result = await Solve.run(z3, model, {
32
+ limits: { timeoutMs: 2_000 }
33
+ })
34
+ await z3.close()
35
+ ```
36
+
37
+ ## Runtime contract
38
+
39
+ - `create()` initializes once and returns the same process runtime until it is
40
+ closed. Long-lived CLI and MCP processes should retain that runtime.
41
+ - Solve requests enter an explicit FIFO queue. Z3's TypeScript/Wasm binding is
42
+ not thread-safe, so simultaneous requests never run checks concurrently or
43
+ share solver state accidentally.
44
+ - `close()` waits for queued checks, terminates all Emscripten workers, and is
45
+ idempotent. Short-lived commands must call it before exit.
46
+ - Every check receives Z3's internal timeout plus an independent wall-clock
47
+ interrupt. The portable memory limit is applied through Z3's process-wide
48
+ `memory_max_size` parameter while requests are serialized.
49
+ - Preflight declaration and expression limits remain in `@cavelang/solver`.
50
+ This adapter additionally enforces `maxOutputBytes` on the serialized result.
51
+ - A timeout, memory limit, interrupt, non-rational model value, or backend
52
+ failure returns `unknown`; none can be reported as proof of infeasibility or
53
+ optimality.
54
+
55
+ ## Compilation semantics
56
+
57
+ Booleans, bounded integers, exact rationals, conditionals, arithmetic, and
58
+ hard constraints compile directly. Decimal strings are reduced by
59
+ `@cavelang/solver` and passed to Z3 as `bigint` numerator/denominator pairs,
60
+ never as JavaScript floating point. Finite enums use bounded integer codes and
61
+ are decoded through the domain's canonical lexical order, so declaration
62
+ reordering cannot change an unconstrained assignment.
63
+
64
+ Named hard constraints use tracked Boolean literals, so an unsatisfiable core
65
+ maps back to portable constraint IDs. Objective declaration order is Z3's
66
+ lexicographic order. Explicit weighted soft constraints form the final,
67
+ lowest-priority objective; their weights are never inferred from CAVE belief
68
+ confidence.
69
+
70
+ See [BENCHMARK.md](BENCHMARK.md) for artifact, initialization, solve, memory,
71
+ packaging, and lifecycle measurements. The spike accepts Z3 for optional
72
+ Node.js use. Browser delivery remains deferred because threaded Wasm requires
73
+ `SharedArrayBuffer`, cross-origin isolation headers, and separate worker asset
74
+ handling.
75
+
76
+ ## Browser delivery decision
77
+
78
+ The supported browser profile is deliberately **no in-browser solver**. The
79
+ GitHub Pages playground remains query-only and never imports this package,
80
+ fetches Z3 Wasm, or exposes a solver control that could fail after startup.
81
+ CI scans the built website for Z3 modules and assets, while packed-artifact
82
+ smoke tests execute the optional Node workflow and verify its backend version
83
+ and clean process exit. Browser support may be reconsidered only with explicit
84
+ cross-origin-isolation deployment, capability detection, worker cancellation,
85
+ asset URL, license, and failure-state tests; it will not silently fall back to
86
+ a remote solver.
87
+
88
+ ## Named workflow CLI fixture
89
+
90
+ The optional package also ships one allowlisted architecture-decision fixture
91
+ that exercises all four workflow operations without accepting model files,
92
+ raw expressions, or SMT-LIB:
93
+
94
+ ```sh
95
+ cave-solver-workflow architecture feasibility --team-size 10 --deployment-frequency 6
96
+ cave-solver-workflow architecture optimization --team-size 10 --deployment-frequency 6
97
+ cave-solver-workflow architecture counterexample
98
+ cave-solver-workflow architecture sensitivity --team-size 10 --from 1 --to 12
99
+ ```
100
+
101
+ Inputs and sample ranges are typed and bounded before Z3 loads. Every command
102
+ uses the workflow API, so model validation, capability negotiation, limits,
103
+ deterministic tie-breaking, and `unknown` semantics cannot be bypassed. The
104
+ JSON output is a versioned workflow/explanation report. The fixture's relative
105
+ cost formula is deliberately illustrative and does not use belief confidence.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=benchmark.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"benchmark.d.ts","sourceRoot":"","sources":["../../scripts/benchmark.ts"],"names":[],"mappings":""}
@@ -0,0 +1,96 @@
1
+ import { readFile, readdir, stat } from 'node:fs/promises';
2
+ import { dirname, join } from 'node:path';
3
+ import { createRequire } from 'node:module';
4
+ import { gzipSync } from 'node:zlib';
5
+ import { performance } from 'node:perf_hooks';
6
+ import { Model, Solve } from '@cavelang/solver';
7
+ import { create } from '@cavelang/solver-z3';
8
+ const require = createRequire(import.meta.url);
9
+ const packageRoot = dirname(require.resolve('z3-solver/package.json'));
10
+ const files = async (directory) => {
11
+ const entries = await readdir(directory, { withFileTypes: true });
12
+ return (await Promise.all(entries.map(async (entry) => {
13
+ const path = join(directory, entry.name);
14
+ return entry.isDirectory() ? files(path) : [path];
15
+ }))).flat();
16
+ };
17
+ const paths = await files(packageRoot);
18
+ let installedBytes = 0;
19
+ let gzipBytes = 0;
20
+ for (const path of paths) {
21
+ installedBytes += (await stat(path)).size;
22
+ gzipBytes += gzipSync(await readFile(path), { level: 9 }).byteLength;
23
+ }
24
+ const ref = (id) => ({ kind: 'variable', id });
25
+ const architecture = {
26
+ schema: Model.schema,
27
+ enums: [{ id: 'architecture', values: ['monolith', 'microservices'] }],
28
+ variables: [
29
+ { id: 'choice', sort: 'enum', domain: 'architecture' },
30
+ { id: 'team-size', sort: 'int', min: 12, max: 12 },
31
+ { id: 'monthly-cost', sort: 'real', min: '0', max: '1000' }
32
+ ],
33
+ constraints: [{
34
+ id: 'architecture-cost',
35
+ expression: {
36
+ kind: 'eq',
37
+ left: ref('monthly-cost'),
38
+ right: {
39
+ kind: 'if',
40
+ condition: {
41
+ kind: 'eq',
42
+ left: ref('choice'),
43
+ right: { kind: 'literal', sort: 'enum', domain: 'architecture', value: 'monolith' }
44
+ },
45
+ then: { kind: 'literal', sort: 'real', value: '80.25' },
46
+ else: { kind: 'literal', sort: 'real', value: '120.50' }
47
+ }
48
+ }
49
+ }],
50
+ objectives: [{ id: 'min-monthly-cost', direction: 'minimize', expression: ref('monthly-cost') }]
51
+ };
52
+ const beforeRssBytes = process.memoryUsage().rss;
53
+ const runtime = await create();
54
+ const firstStarted = performance.now();
55
+ const first = await Solve.run(runtime, architecture);
56
+ const firstCheckMs = performance.now() - firstStarted;
57
+ if (first.status !== 'optimal')
58
+ throw new Error(`benchmark fixture returned ${first.status}`);
59
+ const warmRuns = 25;
60
+ const warm = [];
61
+ for (let index = 0; index < warmRuns; index += 1) {
62
+ const started = performance.now();
63
+ const result = await Solve.run(runtime, architecture);
64
+ if (result.status !== 'optimal')
65
+ throw new Error(`warm fixture returned ${result.status}`);
66
+ warm.push(performance.now() - started);
67
+ }
68
+ await runtime.close();
69
+ warm.sort((left, right) => left - right);
70
+ const mean = warm.reduce((sum, value) => sum + value, 0) / warm.length;
71
+ console.log(JSON.stringify({
72
+ generatedAt: new Date().toISOString(),
73
+ platform: `${process.platform}-${process.arch}`,
74
+ node: process.version,
75
+ backend: runtime.backend,
76
+ artifacts: {
77
+ files: paths.length,
78
+ installedBytes,
79
+ gzipBytes,
80
+ wasmBytes: (await stat(join(packageRoot, 'build/z3-built.wasm'))).size
81
+ },
82
+ latencyMs: {
83
+ coldInitialization: runtime.initializationMs,
84
+ firstCheck: Number(firstCheckMs.toFixed(2)),
85
+ warmMean: Number(mean.toFixed(2)),
86
+ warmP50: Number(warm[Math.floor(warm.length * 0.5)].toFixed(2)),
87
+ warmP95: Number(warm[Math.floor(warm.length * 0.95)].toFixed(2)),
88
+ warmRuns
89
+ },
90
+ memoryBytes: {
91
+ rssBeforeInitialization: beforeRssBytes,
92
+ rssAfterRuns: process.memoryUsage().rss,
93
+ peakRss: process.resourceUsage().maxRSS * 1024
94
+ }
95
+ }, null, 2));
96
+ //# sourceMappingURL=benchmark.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"benchmark.js","sourceRoot":"","sources":["../../scripts/benchmark.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAA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adapter for CAVE's portable solver model.
3
+ *
4
+ * `z3-solver` is loaded only when `create()` is called. Importing this module
5
+ * does not initialize WebAssembly or spawn Emscripten workers.
6
+ */
7
+ export { create, type Runtime } from './runtime.ts';
8
+ export { architectureModel, runWorkflowFixture } from './workflow-fixture.ts';
9
+ export type { ArchitectureInputs, Output as WorkflowFixtureOutput } from './workflow-fixture.ts';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC7E,YAAY,EAAE,kBAAkB,EAAE,MAAM,IAAI,qBAAqB,EAAE,MAAM,uBAAuB,CAAA"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Optional Node.js Z3 adapter for CAVE's portable solver model.
3
+ *
4
+ * `z3-solver` is loaded only when `create()` is called. Importing this module
5
+ * does not initialize WebAssembly or spawn Emscripten workers.
6
+ */
7
+ export { create } from "./runtime.js";
8
+ export { architectureModel, runWorkflowFixture } from "./workflow-fixture.js";
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAgB,MAAM,cAAc,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { Adapter } from '@cavelang/solver';
2
+ export type Runtime = Adapter.t & {
3
+ /** Time spent loading and initializing the Z3 Wasm module. */
4
+ readonly initializationMs: number;
5
+ /** Wait for queued checks and terminate Z3's Emscripten workers. Idempotent. */
6
+ readonly close: () => Promise<void>;
7
+ };
8
+ /** Lazily initialize and reuse one process-wide Z3 runtime. */
9
+ export declare const create: () => Promise<Runtime>;
10
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAgB,MAAM,kBAAkB,CAAA;AA+BxD,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,GAAG;IAChC,8DAA8D;IAC9D,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,gFAAgF;IAChF,QAAQ,CAAC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CACpC,CAAA;AAqbD,+DAA+D;AAC/D,eAAO,MAAM,MAAM,QAAO,OAAO,CAAC,OAAO,CAGvC,CAAA"}