eyeprolog 1.6.10 → 1.6.12

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/bin/eyeprolog.js CHANGED
@@ -1,5 +1,22 @@
1
1
  #!/usr/bin/env node
2
- import { main } from '../src/cli.js';
2
+ import module from 'node:module';
3
+
4
+ // Reuse V8's compilation of the engine between runs. Starting the CLI compiles
5
+ // the whole reasoner before it can answer anything, which dominates the cost of
6
+ // a short query -- the shape most command-line use has. The cache makes that
7
+ // compilation a one-off rather than a per-invocation charge.
8
+ //
9
+ // src/cli.js is imported dynamically on purpose: static imports are evaluated
10
+ // before this module's body runs, so a static one would already have been
11
+ // compiled by the time the cache was enabled.
12
+ //
13
+ // enableCompileCache is Node 22.1+, hence the optional call for the supported
14
+ // Node 18 floor. It reports failure through a return value rather than
15
+ // throwing, and Node honours NODE_DISABLE_COMPILE_CACHE, so an unwritable or
16
+ // unwanted cache directory simply leaves startup as it was.
17
+ module.enableCompileCache?.();
18
+
19
+ const { main } = await import('../src/cli.js');
3
20
 
4
21
  await main(process.argv.slice(2)).catch((error) => {
5
22
  console.error(`eyeprolog: ${error && error.message ? error.message : String(error)}`);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.6.10",
6
+ "version": "1.6.12",
7
7
  "description": "EyeProlog turns facts and rules into answers and proofs.",
8
8
  "type": "module",
9
9
  "main": "./index.js",
package/src/platform.js CHANGED
@@ -43,6 +43,12 @@ export function usedHeapSize() {
43
43
  const oldGeneration = oldGenerationUsedSize();
44
44
  if (oldGeneration != null) return oldGeneration;
45
45
  }
46
+ // v8.getHeapStatistics().used_heap_size reports the same quantity as
47
+ // process.memoryUsage().heapUsed, but memoryUsage() additionally computes
48
+ // RSS, which costs a syscall, and allocates a result object. The solver
49
+ // polls this on a fixed inference interval, so the cheaper reading is
50
+ // worth preferring; memoryUsage stays as the fallback.
51
+ if (typeof v8?.getHeapStatistics === 'function') return v8.getHeapStatistics().used_heap_size;
46
52
  return process.memoryUsage().heapUsed;
47
53
  }
48
54
  const memory = globalThis.performance?.memory;
package/test/README.md CHANGED
@@ -13,6 +13,7 @@ node test/run-conformance-all.mjs # conformance layers; accepts --offline
13
13
  node test/run-iso-strict.mjs # strict ISO core
14
14
  node test/run-iso-part2-amendment.mjs
15
15
  node test/run-neumerkel.mjs # live upstream; --cached reproduces last fetch
16
+ # --verify-report fails on a stale tracked report
16
17
  node test/run-neumerkel-tests.mjs # upstream-fetch harness
17
18
  node test/run-examples.mjs
18
19
  node test/run-playground.mjs
@@ -23,8 +24,11 @@ node test/run-http-json.mjs
23
24
  node test/run-interop.mjs # requires the comparison engines
24
25
  ```
25
26
 
26
- These runners retain their existing options; there is no separate npm alias for
27
- each one. Focused checks do not replace the full release gate.
27
+ These runners retain their existing options. The single alias is
28
+ `npm run neumerkel`, for `node test/run-neumerkel.mjs --verify-report`: the
29
+ release gate only warns when the tracked upstream report has gone stale, and
30
+ that alias makes it an error instead. Every other runner is invoked directly.
31
+ Focused checks do not replace the full release gate.
28
32
 
29
33
  `run-properties.mjs` is different in kind from the rest of the suite: instead
30
34
  of hand-picked inputs, it generates many random ground terms from a seeded
@@ -96,6 +96,7 @@ node test/run-conformance-all.mjs --offline # same local layers, no network
96
96
  node test/run-neumerkel.mjs # the eight live upstream suites only
97
97
  node test/run-neumerkel.mjs --cached # exact last fetched bytes; reproduction only
98
98
  node test/run-neumerkel.mjs --cached --verify-report # verify tracked report against last successful live snapshot
99
+ npm run neumerkel # fetch live and fail if the tracked report is stale
99
100
  node test/run-iso-strict.mjs # Part 1 + Corrigenda strict-core processor gate
100
101
  node test/run-iso-part2-amendment.mjs # 2013 Part 2 amendment module requirements
101
102
  ```