@fraczak/k 8.9.0 → 9.1.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.
Files changed (90) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/DOCS/ARCHITECTURE.md +5 -4
  3. package/DOCS/DICTIONARY.md +2 -2
  4. package/DOCS/FILE_FORMATS.md +11 -9
  5. package/DOCS/KIR_V1.md +5 -1
  6. package/DOCS/KTVM_SPEC.md +907 -0
  7. package/DOCS/KVM_EXECUTION_MODEL.md +3 -2
  8. package/DOCS/KVM_VS_KTVM_COMPARATIVE_STUDY.md +127 -0
  9. package/DOCS/PROFILING_AND_TRACING.md +13 -4
  10. package/DOCS/README.md +3 -2
  11. package/DOCS/REPL.md +16 -12
  12. package/README.md +138 -2
  13. package/backend-api.mjs +31 -16
  14. package/backends/llvm/README.md +4 -5
  15. package/backends/llvm/bin/k-llvm-build.mjs +7 -19
  16. package/backends/llvm/bin/k-llvm-compile.mjs +6 -18
  17. package/backends/llvm/bin/k-llvm.mjs +11 -33
  18. package/backends/llvm/src/cli.mjs +2 -12
  19. package/backends/llvm/src/executable.mjs +7 -95
  20. package/backends/llvm/src/kvm2llvm.mjs +1 -7
  21. package/backends/llvm/src/llvm.mjs +4 -113
  22. package/backends/llvm/tests/k-llvm-run.mjs +1 -6
  23. package/backends/llvm/tests/perf-support.mjs +3 -5
  24. package/backends/llvm/tests/test-llvm.mjs +2 -16
  25. package/backends/wasm/README.md +7 -3
  26. package/backends/wasm/bin/k-wasm-compile.mjs +4 -7
  27. package/backends/wasm/bin/k-wasm.mjs +4 -6
  28. package/backends/wasm/src/cli.mjs +8 -24
  29. package/backends/wasm/src/wasm.mjs +60 -57
  30. package/backends/wasm/tests/test-wasm.mjs +41 -2
  31. package/browser/repl-browser.mjs +9 -8
  32. package/browser/shims/buffer.mjs +31 -2
  33. package/browser/shims/child_process.mjs +26 -0
  34. package/browser/shims/fs.mjs +3 -1
  35. package/codecs/runtime/prefix-codec.mjs +67 -1
  36. package/conformance/run.mjs +17 -2
  37. package/harness/adapters/ktvm-llvm.mjs +118 -0
  38. package/harness/adapters/ktvm-wasm.mjs +104 -0
  39. package/harness/adapters/ktvm.mjs +133 -0
  40. package/harness/registry.mjs +9 -0
  41. package/ktvm/ast.mjs +218 -0
  42. package/ktvm/bit-deque.mjs +497 -0
  43. package/ktvm/fixtures/integer-streaming.k +477 -0
  44. package/ktvm/index.mjs +130 -0
  45. package/ktvm/llvm/index.mjs +202 -0
  46. package/ktvm/llvm/lower-c.mjs +1258 -0
  47. package/ktvm/llvm/runtime.h +3542 -0
  48. package/ktvm/llvm/test-llvm.mjs +476 -0
  49. package/ktvm/lower-kir.mjs +2221 -0
  50. package/ktvm/optimize/fuse-kernel.mjs +2111 -0
  51. package/ktvm/optimize/index.mjs +116 -0
  52. package/ktvm/optimize/mwtr.mjs +283 -0
  53. package/ktvm/optimize/simplify-procs.mjs +5250 -0
  54. package/ktvm/optimize/synthesize-tables.mjs +1105 -0
  55. package/ktvm/parser.mjs +1101 -0
  56. package/ktvm/printer.mjs +281 -0
  57. package/ktvm/schema.mjs +1134 -0
  58. package/ktvm/specialize.mjs +538 -0
  59. package/ktvm/test-conformance.mjs +597 -0
  60. package/ktvm/test-ktvm.mjs +1805 -0
  61. package/ktvm/test-optimize.mjs +598 -0
  62. package/ktvm/validator.mjs +1280 -0
  63. package/ktvm/vm.mjs +2225 -0
  64. package/ktvm/wasm/index.mjs +331 -0
  65. package/ktvm/wasm/lower-wasm.mjs +1272 -0
  66. package/ktvm/wasm/runtime.wat +4404 -0
  67. package/ktvm/wasm/test-wasm.mjs +429 -0
  68. package/ktvm/wire.mjs +679 -0
  69. package/package.json +1 -9
  70. package/paper/Makefile +8 -5
  71. package/paper/k-transducer-compiler.pdf +0 -0
  72. package/paper/k-transducer-compiler.tex +658 -0
  73. package/paper/replay-diagnostic.mjs +63 -0
  74. package/repl.mjs +101 -20
  75. package/scripts/build-repl-html.mjs +40 -18
  76. package/scripts/perf-bigint-compare.mjs +12 -16
  77. package/scripts/perf-ieee.mjs +14 -232
  78. package/scripts/perf-int.mjs +16 -274
  79. package/scripts/perf-multiplication.mjs +116 -121
  80. package/scripts/perf-poly.mjs +9 -263
  81. package/scripts/run-tests.mjs +5 -2
  82. package/scripts/test-package.mjs +15 -3
  83. package/tests/README.md +3 -3
  84. package/tests/test-repl-html.mjs +72 -15
  85. package/tests/test-repl.mjs +24 -17
  86. package/DOCS/POLYMORPHIC_IR.md +0 -86
  87. package/access-table.mjs +0 -343
  88. package/pkir.mjs +0 -772
  89. package/tests/test-access-table.mjs +0 -213
  90. package/tests/test-pkir.mjs +0 -530
@@ -54,7 +54,7 @@ function printHelp() {
54
54
 
55
55
  IEEE 754 Floating-Point Arithmetic Benchmark Harness.
56
56
  Benchmarks add, sub, mul, and div on Examples/ieee-arithmetics.k across
57
- Native JS, kVM interpreter, LLVM, Wasm, and PKIR backends.
57
+ Native JS, kVM interpreter, LLVM, and Wasm backends.
58
58
 
59
59
  Options:
60
60
  --opt=<levels>, --opts=<levels>
@@ -65,20 +65,16 @@ Options:
65
65
  Run full LLVM optimization sweep (-O0, -O1, -O2).
66
66
  --wasm-in-process
67
67
  Run WebAssembly in-process instead of persistent subprocess runner.
68
- --pkir-only
69
- Run only PKIR backend.
70
68
  -h, --help
71
69
  Show this help message and exit.
72
70
 
73
71
  Environment Variables:
74
72
  BACKENDS
75
- Target backend to run: 'llvm', 'wasm', or 'pkir'.
73
+ Target backend to run: 'llvm' or 'wasm'.
76
74
  LLVM_ONLY
77
75
  Run only LLVM backend ('1' to enable).
78
76
  WASM_ONLY
79
77
  Run only WebAssembly backend ('1' to enable).
80
- PKIR_ONLY
81
- Run only PKIR backend ('1' to enable).
82
78
  BACKENDS_ONLY
83
79
  Skip JS and kVM interpreter baselines ('1' to enable).
84
80
  VALUES
@@ -123,49 +119,28 @@ const backendsEnv = process.env.BACKENDS?.toLowerCase();
123
119
  const backendsList = backendsEnv
124
120
  ? backendsEnv.split(",").map(s => s.trim())
125
121
  : null;
126
- const llvmPkirOnly = process.env.LLVM_PKIR_ONLY === "1"
122
+ const llvmOnly = process.env.LLVM_ONLY === "1"
127
123
  || (backendsList && backendsList.length === 1 &&
128
- backendsList[0] === "llvm-pkir")
129
- || process.argv.includes("--llvm-pkir-only");
130
- const pkirOnly = !llvmPkirOnly && (
131
- process.env.PKIR_ONLY === "1"
132
- || (backendsList && backendsList.length === 1 &&
133
- backendsList[0] === "pkir")
134
- || process.argv.includes("--pkir-only")
135
- );
136
- const llvmOnly = !pkirOnly && !llvmPkirOnly && (
137
- process.env.LLVM_ONLY === "1"
138
- || (backendsList && backendsList.length === 1 &&
139
- backendsList[0] === "llvm")
140
- );
141
- const wasmOnly = !pkirOnly && !llvmPkirOnly && !llvmOnly && (
124
+ backendsList[0] === "llvm");
125
+ const wasmOnly = !llvmOnly && (
142
126
  process.env.WASM_ONLY === "1"
143
127
  || (backendsList && backendsList.length === 1 &&
144
128
  backendsList[0] === "wasm")
145
129
  );
146
130
  const runLLVM = backendsList
147
131
  ? backendsList.includes("llvm")
148
- : !wasmOnly && !pkirOnly && !llvmPkirOnly;
149
- const runLLVMPKIR = backendsList
150
- ? backendsList.includes("llvm-pkir")
151
- : !wasmOnly && !pkirOnly && !llvmOnly;
132
+ : !wasmOnly;
152
133
  const runWasm = backendsList
153
134
  ? backendsList.includes("wasm")
154
- : !llvmOnly && !pkirOnly && !llvmPkirOnly;
155
- const runPKIR = backendsList
156
- ? backendsList.includes("pkir")
157
- : !llvmOnly && !wasmOnly && !llvmPkirOnly;
135
+ : !llvmOnly;
158
136
  const runBaselines = !process.env.BACKENDS_ONLY
159
137
  && (backendsList == null || backendsList.includes("kvm") ||
160
138
  backendsList.includes("js"))
161
- && !llvmOnly && !wasmOnly && !pkirOnly && !llvmPkirOnly;
139
+ && !llvmOnly && !wasmOnly;
162
140
 
163
141
  function llvmLaneNameStr() {
164
142
  return llvmLaneName();
165
143
  }
166
- function llvmPkirLaneNameStr() {
167
- return llvmLaneName().replace("LLVM", "LLVM-PKIR");
168
- }
169
144
 
170
145
  const ops = ["add", "sub", "mul", "div"];
171
146
  const values = csvEnv("VALUES", "0.5,-4,0,Infinity,-Infinity,NaN");
@@ -217,9 +192,6 @@ function wasmLaneName() {
217
192
  const mode = wasmPipe ? "persistent" : "in-process";
218
193
  return `WebAssembly (${mode})`;
219
194
  }
220
- function pkirLaneName() {
221
- return "PKIR (Wasm persistent)";
222
- }
223
195
 
224
196
  console.log("==> Initializing IEEE types and arithmetic");
225
197
  const state = createState();
@@ -295,8 +267,7 @@ if (runLLVM) {
295
267
  cacheDir,
296
268
  sourceLabel: "@fraczak/k/Examples/ieee-arithmetics.k#perf_ieee",
297
269
  runtimeMode: llvmRuntimeMode,
298
- clangOpt: opt,
299
- usePKIR: false
270
+ clangOpt: opt
300
271
  });
301
272
  const singleCase = [{
302
273
  op: "perf_ieee",
@@ -313,37 +284,6 @@ if (runLLVM) {
313
284
  codes.load(state.codes);
314
285
  }
315
286
 
316
- // Setup LLVM-PKIR
317
- const llvmPkirCasesByOpt = new Map();
318
- if (runLLVMPKIR) {
319
- for (const opt of llvmOptLevels) {
320
- console.log(`==> Compiling LLVM-PKIR executable (${opt})...`);
321
- const llvm = tryCompileCase({
322
- object: relation.object,
323
- relationName: relation.relationName,
324
- relHash: relation.relHash,
325
- inputPattern,
326
- cacheDir,
327
- sourceLabel: "@fraczak/k/Examples/ieee-arithmetics.k#perf_ieee",
328
- runtimeMode: llvmRuntimeMode,
329
- clangOpt: opt,
330
- usePKIR: true
331
- });
332
- const singleCase = [{
333
- op: "perf_ieee",
334
- label: "params",
335
- inputVal,
336
- inputWire,
337
- inputPattern,
338
- expected,
339
- llvm
340
- }];
341
- llvmPkirCasesByOpt.set(opt, singleCase);
342
- printCompileFailures(singleCase);
343
- }
344
- codes.load(state.codes);
345
- }
346
-
347
287
  // Setup Wasm
348
288
  let wasmExports = null;
349
289
  let wasmPtrIn = null;
@@ -358,14 +298,16 @@ if (runWasm) {
358
298
  console.log("==> Compiling WebAssembly executable (persistent runner)...");
359
299
  try {
360
300
  const wasmPath = path.join(cacheDir, "perf_ieee_wasm.wasm");
361
- wasmExePath = path.join(cacheDir, "perf_ieee_wasm.exe");
301
+ const exePath = path.join(cacheDir, "perf_ieee_wasm.exe");
362
302
  const wasmBuf = await compileWasmArtifactFromObject(relation.object, {
363
- entry: "__main__"
303
+ entry: relation.relHash
364
304
  });
365
305
  fs.writeFileSync(wasmPath, wasmBuf);
366
306
  const runBin = fileURLToPath(import.meta.resolve("../backends/wasm/bin/k-wasm-run.mjs"));
367
- fs.writeFileSync(wasmExePath, `#!/bin/sh\nexec node "${runBin}" "${wasmPath}" "$@"\n`, { mode: 0o755 });
307
+ fs.writeFileSync(exePath, `#!/bin/sh\nexec node "${runBin}" "${wasmPath}" "$@"\n`, { mode: 0o755 });
308
+ wasmExePath = exePath;
368
309
  } catch (error) {
310
+ wasmExePath = null;
369
311
  wasmCompileError = error.stack || error.message || String(error);
370
312
  console.log("WebAssembly compilation failed:");
371
313
  console.log(wasmCompileError.split("\n").slice(0, 8).join("\n"));
@@ -388,28 +330,6 @@ if (runWasm) {
388
330
  }
389
331
  }
390
332
 
391
- // Setup PKIR
392
- let pkirExePath = null;
393
- let pkirCompileError = null;
394
- if (runPKIR) {
395
- console.log("==> Compiling PKIR executable (persistent runner)...");
396
- try {
397
- const pkirPath = path.join(cacheDir, "perf_ieee_pkir.wasm");
398
- pkirExePath = path.join(cacheDir, "perf_ieee_pkir.exe");
399
- const wasmBuf = await compileWasmArtifactFromObject(relation.object, {
400
- entry: "__main__",
401
- usePKIR: true
402
- });
403
- fs.writeFileSync(pkirPath, wasmBuf);
404
- const runBin = fileURLToPath(import.meta.resolve("../backends/wasm/bin/k-wasm-run.mjs"));
405
- fs.writeFileSync(pkirExePath, `#!/bin/sh\nexec node "${runBin}" "${pkirPath}" "$@"\n`, { mode: 0o755 });
406
- } catch (error) {
407
- pkirCompileError = error.stack || error.message || String(error);
408
- console.log("PKIR compilation failed:");
409
- console.log(pkirCompileError.split("\n").slice(0, 8).join("\n"));
410
- }
411
- }
412
-
413
333
  function printBenchmarkDescription() {
414
334
  const lanes = [];
415
335
  if (runBaselines) {
@@ -428,19 +348,7 @@ function printBenchmarkDescription() {
428
348
  );
429
349
  }
430
350
  }
431
- if (runLLVMPKIR) {
432
- for (const opt of llvmOptLevels) {
433
- const mode = llvmLaneName()
434
- .replace(/^LLVM Executable\s*\((.*)\)$/, "$1");
435
- lanes.push(
436
- llvmOptLevels.length > 1
437
- ? `LLVM-PKIR ${opt} (${mode})`
438
- : llvmLaneName().replace("LLVM", "LLVM-PKIR")
439
- );
440
- }
441
- }
442
351
  if (runWasm) lanes.push(wasmLaneName());
443
- if (runPKIR) lanes.push(pkirLaneName());
444
352
 
445
353
  console.log("==> Benchmark description");
446
354
  console.log(" source: @fraczak/k/Examples/ieee-arithmetics.k#perf_ieee (single program)");
@@ -453,11 +361,6 @@ function printBenchmarkDescription() {
453
361
  console.log(` llvm clang opts: ${llvmOptLevels.join(", ")}`);
454
362
  console.log(` llvm cache dir: ${cacheDir}`);
455
363
  }
456
- if (runLLVMPKIR) {
457
- console.log(` llvm-pkir warmup iterations: ${llvmWarmupIterations}`);
458
- console.log(` llvm-pkir runtime mode: ${llvmRuntimeMode}`);
459
- console.log(` llvm-pkir clang opts: ${llvmOptLevels.join(", ")}`);
460
- }
461
364
  if (runWasm) {
462
365
  console.log(` wasm runner mode: ${wasmPipe ? "persistent pipe" : "in-process"}`);
463
366
  console.log(` wasm warmup iterations: ${wasmWarmupIterations}`);
@@ -465,9 +368,6 @@ function printBenchmarkDescription() {
465
368
  console.log(` wasm arena reset: ${wasmReset ? "yes" : "no"}`);
466
369
  }
467
370
  }
468
- if (runPKIR) {
469
- console.log(` pkir warmup iterations: ${wasmWarmupIterations}`);
470
- }
471
371
  console.log(` iterations: ${iterations}`);
472
372
  console.log(` benchmark lanes: ${lanes.join("; ")}`);
473
373
  console.log(" conformance: all outputs are compared to native expected values");
@@ -528,28 +428,6 @@ if (runLLVM) {
528
428
  }
529
429
  }
530
430
 
531
- // 2b. LLVM-PKIR lanes
532
- const llvmPkirResults = new Map();
533
- if (runLLVMPKIR) {
534
- for (const opt of llvmOptLevels) {
535
- const casesForOpt = llvmPkirCasesByOpt.get(opt);
536
- const llvmRunner = createLLVMRunner(casesForOpt);
537
- try {
538
- if (llvmWarmupIterations > 0) {
539
- console.log(`==> Warming LLVM-PKIR (${opt}) executable (${llvmWarmupIterations} iterations)...`);
540
- await llvmRunner.run(llvmWarmupIterations);
541
- }
542
- console.log(`==> Running LLVM-PKIR (${opt}) (${iterations} iterations)...`);
543
- const result = await llvmRunner.run(iterations);
544
- llvmPkirResults.set(opt, result);
545
- } catch (err) {
546
- console.log(`==> LLVM-PKIR (${opt}) execution failed: ${err.message?.split("\n")[0]}`);
547
- } finally {
548
- llvmRunner.close();
549
- }
550
- }
551
- }
552
-
553
431
  // 3. Wasm lane
554
432
  let wasmResult = null;
555
433
  if (runWasm) {
@@ -592,28 +470,6 @@ if (runWasm) {
592
470
  }
593
471
  }
594
472
 
595
- // 4. PKIR lane
596
- let pkirResult = null;
597
- if (runPKIR) {
598
- if (pkirExePath) {
599
- const server = new PersistentExecutable(pkirExePath);
600
- try {
601
- if (wasmWarmupIterations > 0) {
602
- console.log(`==> Warming PKIR (${wasmWarmupIterations} iterations)...`);
603
- for (let i = 0; i < wasmWarmupIterations; i++) {
604
- await server.request(inputWire);
605
- }
606
- }
607
- console.log(`==> Running PKIR (${iterations} iterations)...`);
608
- pkirResult = await runTimedIterationsAsync(iterations, async () => {
609
- await server.request(inputWire);
610
- });
611
- } finally {
612
- server.close();
613
- }
614
- }
615
- }
616
-
617
473
  console.log("\n=================== IEEE BENCHMARK RESULTS ===================");
618
474
  console.log(`Program calls per iteration: 1 (${totalOps} IEEE operations evaluated inside)`);
619
475
  console.log(`Total requested program calls: ${iterations} (${iterations * totalOps} equivalent IEEE operations)`);
@@ -637,27 +493,10 @@ if (runLLVM) {
637
493
  );
638
494
  }
639
495
  }
640
- if (runLLVMPKIR) {
641
- for (const opt of llvmOptLevels) {
642
- const mode = llvmLaneName()
643
- .replace(/^LLVM Executable\s*\((.*)\)$/, "$1");
644
- const title = llvmOptLevels.length > 1
645
- ? `LLVM-PKIR ${opt} (${mode})`
646
- : llvmLaneName().replace("LLVM", "LLVM-PKIR");
647
- console.log(
648
- `${laneIndex++}. ${title.padEnd(29)} ` +
649
- `${formatTiming(llvmPkirResults.get(opt))}`
650
- );
651
- }
652
- }
653
496
  if (runWasm) {
654
497
  const timingStr = wasmResult ? formatTiming(wasmResult) : "compile failed";
655
498
  console.log(`${laneIndex++}. ${wasmLaneName().padEnd(29)} ${timingStr}`);
656
499
  }
657
- if (runPKIR) {
658
- const timingStr = pkirResult ? formatTiming(pkirResult) : "compile failed";
659
- console.log(`${laneIndex++}. ${pkirLaneName().padEnd(29)} ${timingStr}`);
660
- }
661
500
  console.log("==============================================================\n");
662
501
 
663
502
  // Conformance Validation
@@ -695,28 +534,6 @@ if (runLLVM) {
695
534
  }
696
535
  }
697
536
 
698
- if (runLLVMPKIR) {
699
- for (const opt of llvmOptLevels) {
700
- const casesForOpt = llvmPkirCasesByOpt.get(opt);
701
- const tc = casesForOpt[0];
702
- if (tc.llvm.status !== "ok") {
703
- tc.llvmConformance = "compile-failed";
704
- } else {
705
- try {
706
- const outputWire = await runExecutable(tc.llvm.exePath, tc.inputWire);
707
- const actual = decodeWire(outputWire).value;
708
- assert.deepEqual(toPlainObject(actual), toPlainObject(expected));
709
- tc.llvmConformance = "ok";
710
- } catch (error) {
711
- tc.llvmConformance = "failed";
712
- tc.llvm.error = error.stack || error.message || String(error);
713
- console.log(`LLVM-PKIR (${opt}) conformance failure:`);
714
- console.log(tc.llvm.error.split("\n").slice(0, 8).join("\n"));
715
- }
716
- }
717
- }
718
- }
719
-
720
537
  let wasmOk = false;
721
538
  if (runWasm) {
722
539
  if (wasmPipe) {
@@ -753,22 +570,6 @@ if (runWasm) {
753
570
  }
754
571
  }
755
572
 
756
- let pkirOk = false;
757
- if (runPKIR) {
758
- if (!pkirExePath) {
759
- console.log("PKIR conformance failure: executable was not compiled");
760
- } else {
761
- try {
762
- const outputWire = await runExecutable(pkirExePath, inputWire);
763
- const actual = decodeWire(outputWire).value;
764
- assert.deepEqual(toPlainObject(actual), toPlainObject(expected));
765
- pkirOk = true;
766
- } catch (error) {
767
- console.log("PKIR conformance failure:", error.message || error);
768
- }
769
- }
770
- }
771
-
772
573
  const validationSummary = [];
773
574
  if (runBaselines && kvmOk) validationSummary.push(`kVM (all ${totalOps} ops)`);
774
575
  if (runLLVM) {
@@ -778,21 +579,9 @@ if (runLLVM) {
778
579
  validationSummary.push(`LLVM ${opt} (${tc.llvmConformance === "ok" ? `all ${totalOps} ops` : tc.llvmConformance})`);
779
580
  }
780
581
  }
781
- if (runLLVMPKIR) {
782
- for (const opt of llvmOptLevels) {
783
- const casesForOpt = llvmPkirCasesByOpt.get(opt);
784
- const tc = casesForOpt[0];
785
- validationSummary.push(
786
- `LLVM-PKIR ${opt} (${tc.llvmConformance === "ok" ? `all ${totalOps} ops` : tc.llvmConformance})`
787
- );
788
- }
789
- }
790
582
  if (runWasm) {
791
583
  validationSummary.push(`Wasm (${wasmOk ? `all ${totalOps} ops` : "failed"})`);
792
584
  }
793
- if (runPKIR) {
794
- validationSummary.push(`PKIR (${pkirOk ? `all ${totalOps} ops` : "failed"})`);
795
- }
796
585
 
797
586
  console.log(`Conformance validation: ${validationSummary.join(", ")} match expected values.`);
798
587
  if (runLLVM) {
@@ -801,11 +590,4 @@ if (runLLVM) {
801
590
  if (shouldStrictFail(casesForOpt)) process.exitCode = 1;
802
591
  }
803
592
  }
804
- if (runLLVMPKIR) {
805
- for (const opt of llvmOptLevels) {
806
- const casesForOpt = llvmPkirCasesByOpt.get(opt);
807
- if (shouldStrictFail(casesForOpt)) process.exitCode = 1;
808
- }
809
- }
810
593
  if (runWasm && !wasmOk) process.exitCode = 1;
811
- if (runPKIR && !pkirOk) process.exitCode = 1;