|
1 | | -# MeTTa TS 1.1.3 |
2 | | - |
3 | | -MeTTa TS 1.1.3 improves nondeterministic evaluation and bounds every automatic |
4 | | -table allocation. The default evaluator is faster than PeTTa on the four |
5 | | -reported nondeterministic workloads while preserving Hyperon semantics. There |
6 | | -is no benchmark mode, PeTTa mode, curry mode, or manually selected fast path. |
7 | | - |
8 | | -## Tested on Linux |
9 | | - |
10 | | -This release is prepared on Linux with Node 22 and pnpm 11. The release gate |
11 | | -builds every package, typechecks the workspace, runs the full Vitest suite, |
12 | | -builds the GitHub Pages documentation, runs the Hyperon oracle, runs the scale |
13 | | -proof, and runs the benchmark suite before tagging. |
14 | | - |
15 | | -The final suite passed 109 test files and 1,063 tests, with 38 optional live |
16 | | -integration tests skipped. The checked 270-assertion oracle passed all 23 |
17 | | -corpus files. |
18 | | - |
19 | | -The external Core/ST conformance result is unchanged from the untouched 1.1.2 |
20 | | -baseline: 431 passed, 77 failed, 60 manifest expected failures, and 0 skipped. |
21 | | -The remaining failures are existing parser, directive, kernel, typing, and |
22 | | -stdlib contract differences. This release does not claim full specification |
23 | | -conformance. |
24 | | - |
25 | | -## Nondeterministic execution |
26 | | - |
27 | | -The new checked benchmark keeps four query shapes reported by Patrick Hammer |
28 | | -as ordinary `.metta` files. Five-run subprocess medians include startup: |
29 | | - |
30 | | -| Program | PeTTa | MeTTa TS | Speedup | |
31 | | -| -------------------------------- | --------: | --------: | ------: | |
32 | | -| filtered `matespacefast` matches | 5738.1 ms | 3344.2 ms | 1.72x | |
33 | | -| 22^4 `superpose` cross product | 388.7 ms | 148.5 ms | 2.62x | |
34 | | -| nondeterministic tabled `fib(7)` | 180.1 ms | 99.6 ms | 1.81x | |
35 | | -| duplicate-heavy `TupleConcat` | 178.8 ms | 101.1 ms | 1.77x | |
36 | | - |
37 | | -The harness validates 234,256 cross-product results, 196 distinct Fibonacci |
38 | | -answers, the exact `TupleConcat` sequence, and the embedded matespace |
39 | | -assertion. Run it with `pnpm bench:nondeterminism`. |
40 | | - |
41 | | -A slot-based choice evaluator handles closed pure `let`, `let*`, `superpose`, |
42 | | -integer arithmetic, comparisons, `if`, and constructor tuples. Unsupported, |
43 | | -redefined, ill-typed, async, or executable-grounded forms stay on the normal |
44 | | -interpreter path. Result order and multiplicity are unchanged. |
45 | | - |
46 | | -`unique-atom(collapse(call))` can evaluate a supported static pure integer |
47 | | -recurrence as a first-seen answer set. Closed pure choice products also retain |
48 | | -first-seen answers as they emit instead of materializing a duplicate bag first. |
49 | | -An ordinary `collapse(call)` still returns its exact ordered bag with duplicate |
50 | | -derivations. Ground answer deduplication uses structural hashes with equality |
51 | | -checks instead of a quadratic scan. |
52 | | - |
53 | | -## Bounded automatic tabling |
54 | | - |
55 | | -Automatic table admission remains conservative. The whole rule dependency |
56 | | -graph must be pure, the call key must be safe, and the recursive component must |
57 | | -branch back into itself at least twice. Linear recursion stays on the normal |
58 | | -compiled path. |
59 | | - |
60 | | -The policy does not assume that every recursive program is safe to memoize and |
61 | | -does not let admitted tables grow until the process runs out of memory. It |
62 | | -combines the static overlap test with one global runtime budget. Exceeding the |
63 | | -active-state budget returns `TableResourceLimit`; it does not continue toward |
64 | | -an out-of-memory failure. |
65 | | - |
66 | | -Completed and active tables now share these default ceilings: |
67 | | - |
68 | | -- 50,000 entries |
69 | | -- 1,000,000 answers |
70 | | -- 1,000,000 retained atom cells |
71 | | -- 100,000 cells in one entry |
72 | | -- 250,000 interned leaves |
73 | | - |
74 | | -Completed tables are removed in least-recently-used order. Active tables are |
75 | | -not evicted while their producer runs, so they return `TableResourceLimit` when |
76 | | -the shared budget cannot fit more state. The consumer-directed recurrence memo |
77 | | -uses the same entry, answer, cell, and per-entry limits. Interner generations |
78 | | -prevent stale tail-call keys from writing after a reset. |
79 | | - |
80 | | -Direct active variant recursion still uses local-linear fixed-point completion. |
81 | | -Non-cyclic calls preserve exact ordered bags. The evaluator does not infer |
82 | | -Picat-style `min` or `max` answer subsumption. |
83 | | - |
84 | | -## Matching and scale |
85 | | - |
86 | | -Ground runtime facts now have a nested argument-functor index. A pattern such |
87 | | -as `(num (M $x))` selects the `M` bucket instead of scanning every `num` fact. |
88 | | -The matcher falls back to complete candidates when a non-ground fact could |
89 | | -unify. |
90 | | - |
91 | | -A finite in-memory match whose result is discarded by a standard |
92 | | -`let ... (empty)` is removed before enumeration. The optimization declines for |
93 | | -custom grounded matchers, mutable state handles, changed standard forms, and |
94 | | -non-memory spaces. |
95 | | - |
96 | | -The 30,000-fact scale gate also runs larger actual MeTTa workloads: |
97 | | - |
98 | | -| Program | Checked result | Time | |
99 | | -| -------------------------- | ------------------------------: | -------: | |
100 | | -| 24^4 pure choice product | 331,776 answers | 81.2 ms | |
101 | | -| duplicate tuple product | 50 values from 500,000 branches | 30.8 ms | |
102 | | -| nondeterministic `fib(10)` | 2,817 distinct answers | 73.4 ms | |
103 | | -| nested runtime match | 30,000 answers | 647.3 ms | |
104 | | - |
105 | | -## Correctness fixes |
106 | | - |
107 | | -- `superpose` in the choice evaluator now strips a collapsed bag's leading |
108 | | - comma marker. The recursive `supercollapse` corpus case remains empty as |
109 | | - Hyperon requires. |
110 | | -- Choice planning now respects application type errors, expression-headed |
111 | | - rewrite rules, and replaced sync or async grounded operations. |
112 | | -- Nested indexing no longer changes candidate enumeration when a pattern has |
113 | | - no nested-head constraint. |
114 | | -- Active table entries and answers count against the same global resource |
115 | | - budget as completed entries. |
116 | | -- The purity firewall now treats custom sync and async grounded operations as |
117 | | - effectful unless they are the unchanged implementation of a known-pure |
118 | | - built-in. File, catalog, random, time, output, fresh-identity, and host calls |
119 | | - cannot enter automatic tables transitively. |
120 | | -- File handles can be closed immediately with `file-close!` and are also closed |
121 | | - when their grounded atom is collected. Dictionary spaces and file records use |
122 | | - weak-key storage instead of lifetime-unbounded global maps. Grounded behavior |
123 | | - and non-default grounded types remain on the lossless atomspace path. |
124 | | -- Grounded-operation registration invalidates evaluated terms, table analyses, |
125 | | - and compiled closures that may encode the previous dispatch behavior. |
126 | | -- DAS gateway binding responses must contain exactly one MeTTa atom per value. |
127 | | - Malformed or multi-atom wire values now fail at the decode boundary. |
128 | | -- Git imports pass an end-of-options marker before the repository path. |
129 | | -- The unused `streamEmit`, `tableBackchain`, and `trieSpace` experimental |
130 | | - options have been removed. They never selected an implementation. |
| 1 | +# MeTTa TS 1.1.4 |
| 2 | + |
| 3 | +MeTTa TS 1.1.4 adds selective nested-head indexing for immutable static facts. |
| 4 | +Queries such as `(num (M $x))` can select the matching `M` bucket while the |
| 5 | +normal unifier preserves MeTTa result order, multiplicity, and fallback |
| 6 | +semantics. |
| 7 | + |
| 8 | +## Static nested matching |
| 9 | + |
| 10 | +Static `&self` facts now have a nested argument-functor candidate index. A |
| 11 | +pattern such as `(num (M $x))` selects the `M` bucket instead of scanning every |
| 12 | +static `num` fact. The path applies to one match pattern over an immutable |
| 13 | +ground fact bucket. Static removals, state cells, runtime additions, |
| 14 | +variable-headed facts, non-ground facts, and conjunctions disable the new |
| 15 | +static nested path. Runtime additions retain their separate compact-store |
| 16 | +index. Static candidate selection then follows the existing complete or |
| 17 | +leaf-indexed paths. Existing leaf-key selection retains precedence. The full |
| 18 | +unifier remains authoritative. |
| 19 | + |
| 20 | +Indexed and custom-grounded residual candidates merge by source occurrence, |
| 21 | +so the nested path retains insertion order and duplicate multiplicity. Skipped |
| 22 | +ground candidate attempts are restored to the evaluator counter. Leaf index |
| 23 | +keys now retain custom grounded matchers as residual candidates and use one |
| 24 | +numeric key for integer and float values, matching ground equality. |
| 25 | + |
| 26 | +The selective static nested scale case passed at the 30,000-fact default and |
| 27 | +with `node packages/node/bench/scale-proof.mjs --size=100000`. |
| 28 | +`pnpm bench:nested-index` validates complete ordered result sequences and |
| 29 | +counters while measuring selective and dense cases up to 1,000,000 facts. |
| 30 | +Detailed measurements are in |
| 31 | +[`packages/node/bench/RESULTS.md`](packages/node/bench/RESULTS.md). |
| 32 | + |
| 33 | +## Verification |
| 34 | + |
| 35 | +The workspace build, typecheck, lint, formatting check, documentation build, |
| 36 | +benchmark suite, and 270-assertion oracle pass. The full suite passes 109 test |
| 37 | +files and 1,079 tests, with 38 optional live integration tests skipped. |
| 38 | + |
| 39 | +The concurrency benchmark status now states both parts of its regression gate: |
| 40 | +the median must exceed 1.5 times the baseline and add more than 1 millisecond. |
| 41 | + |
| 42 | +## Repository links |
| 43 | + |
| 44 | +Package metadata, documentation links, and the GitHub Pages base path now use |
| 45 | +the canonical [`MesTTo/MeTTa-TS`](https://github.com/MesTTo/MeTTa-TS) |
| 46 | +repository name. |
| 47 | + |
| 48 | +`@metta-ts/grapher` now ships a package README. Its examples distinguish |
| 49 | +starting a reduction trace from scheduling later trace steps, and its GIF |
| 50 | +example contains a reducible expression. |
131 | 51 |
|
132 | 52 | ## Install |
133 | 53 |
|
134 | 54 | ```bash |
135 | | -npm install @metta-ts/core@1.1.3 |
136 | | -npm install -g @metta-ts/node@1.1.3 |
| 55 | +npm install @metta-ts/core@1.1.4 |
| 56 | +npm install -g @metta-ts/node@1.1.4 |
137 | 57 | ``` |
138 | 58 |
|
139 | 59 | Optional host packages use the same version: |
140 | 60 |
|
141 | 61 | ```bash |
142 | | -npm install @metta-ts/py@1.1.3 pythonia |
143 | | -npm install @metta-ts/prolog@1.1.3 |
| 62 | +npm install @metta-ts/py@1.1.4 pythonia |
| 63 | +npm install @metta-ts/prolog@1.1.4 |
144 | 64 | ``` |
145 | 65 |
|
146 | 66 | ## Provenance |
147 | 67 |
|
148 | 68 | - Semantics: [hyperon-experimental](https://github.com/trueagi-io/hyperon-experimental). |
149 | 69 | - Verified differential semantics: [LeaTTa](https://github.com/MesTTo/LeaTTa). |
150 | | -- Host compatibility: PeTTa-compatible Python and Prolog bridge forms where |
151 | | - they do not depend on PeTTa's evaluator. |
152 | 70 | - License: [MIT](LICENSE). |
0 commit comments