@scriptc/compiler 0.1.5 → 0.1.7

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 (139) hide show
  1. package/ambient/scriptc-node-fallback.d.ts +0 -1
  2. package/ambient/scriptc.d.ts +13 -5
  3. package/dist/backend/c/c-emitter.d.ts +5 -0
  4. package/dist/backend/c/c-emitter.js +15 -0
  5. package/dist/backend/c/c-emitter.js.map +1 -1
  6. package/dist/backend/c/exprs.js +81 -9
  7. package/dist/backend/c/exprs.js.map +1 -1
  8. package/dist/backend/c/stmts.js +25 -1
  9. package/dist/backend/c/stmts.js.map +1 -1
  10. package/dist/backend/c/walkers.js +2 -3
  11. package/dist/backend/c/walkers.js.map +1 -1
  12. package/dist/backend/debug-symbols.d.ts +8 -0
  13. package/dist/backend/debug-symbols.js +52 -0
  14. package/dist/backend/debug-symbols.js.map +1 -0
  15. package/dist/backend/link-plan.d.ts +1 -0
  16. package/dist/backend/link-plan.js +2 -0
  17. package/dist/backend/link-plan.js.map +1 -1
  18. package/dist/backend/linker.js +8 -0
  19. package/dist/backend/linker.js.map +1 -1
  20. package/dist/backend/llvm/blocks.d.ts +2 -0
  21. package/dist/backend/llvm/blocks.js +18 -2
  22. package/dist/backend/llvm/blocks.js.map +1 -1
  23. package/dist/backend/llvm/debug-info.d.ts +32 -0
  24. package/dist/backend/llvm/debug-info.js +203 -0
  25. package/dist/backend/llvm/debug-info.js.map +1 -0
  26. package/dist/backend/llvm/dyn.js +4 -10
  27. package/dist/backend/llvm/dyn.js.map +1 -1
  28. package/dist/backend/llvm/emitter.d.ts +2 -0
  29. package/dist/backend/llvm/emitter.js +49 -4
  30. package/dist/backend/llvm/emitter.js.map +1 -1
  31. package/dist/backend/llvm/expr-containers.js +28 -2
  32. package/dist/backend/llvm/expr-containers.js.map +1 -1
  33. package/dist/backend/llvm/expr-dynamic.js +10 -0
  34. package/dist/backend/llvm/expr-dynamic.js.map +1 -1
  35. package/dist/backend/llvm/lib-filesystem.js +37 -0
  36. package/dist/backend/llvm/lib-filesystem.js.map +1 -1
  37. package/dist/backend/llvm/lib-process.js +4 -3
  38. package/dist/backend/llvm/lib-process.js.map +1 -1
  39. package/dist/backend/llvm/lib-shared.js +9 -0
  40. package/dist/backend/llvm/lib-shared.js.map +1 -1
  41. package/dist/backend/llvm/split.js +4 -1
  42. package/dist/backend/llvm/split.js.map +1 -1
  43. package/dist/backend/llvm/split.test.js +26 -1
  44. package/dist/backend/llvm/split.test.js.map +1 -1
  45. package/dist/backend/native-toolchain.js +58 -8
  46. package/dist/backend/native-toolchain.js.map +1 -1
  47. package/dist/backend/native-toolchain.test.js +10 -0
  48. package/dist/backend/native-toolchain.test.js.map +1 -1
  49. package/dist/backend/source-locations.d.ts +12 -0
  50. package/dist/backend/source-locations.js +32 -0
  51. package/dist/backend/source-locations.js.map +1 -0
  52. package/dist/backend/source-locations.test.d.ts +1 -0
  53. package/dist/backend/source-locations.test.js +16 -0
  54. package/dist/backend/source-locations.test.js.map +1 -0
  55. package/dist/coverage/surface-manifest.js +6 -1
  56. package/dist/coverage/surface-manifest.js.map +1 -1
  57. package/dist/diagnostics/diagnostic.d.ts +4 -0
  58. package/dist/diagnostics/diagnostic.js +12 -0
  59. package/dist/diagnostics/diagnostic.js.map +1 -1
  60. package/dist/executable/executable-cache.js +28 -4
  61. package/dist/executable/executable-cache.js.map +1 -1
  62. package/dist/executable/executable-cache.test.js +23 -0
  63. package/dist/executable/executable-cache.test.js.map +1 -1
  64. package/dist/frontend/arguments-usage.d.ts +6 -0
  65. package/dist/frontend/arguments-usage.js +40 -0
  66. package/dist/frontend/arguments-usage.js.map +1 -0
  67. package/dist/frontend/binding-source.d.ts +4 -0
  68. package/dist/frontend/binding-source.js +18 -0
  69. package/dist/frontend/binding-source.js.map +1 -0
  70. package/dist/frontend/lowering/array-indexed-mutation.d.ts +8 -0
  71. package/dist/frontend/lowering/array-indexed-mutation.js +176 -0
  72. package/dist/frontend/lowering/array-indexed-mutation.js.map +1 -0
  73. package/dist/frontend/lowering/containers/string-and-regexp.d.ts +7 -0
  74. package/dist/frontend/lowering/containers/string-and-regexp.js +190 -13
  75. package/dist/frontend/lowering/containers/string-and-regexp.js.map +1 -1
  76. package/dist/frontend/lowering/expressions/object-literals.js +13 -8
  77. package/dist/frontend/lowering/expressions/object-literals.js.map +1 -1
  78. package/dist/frontend/lowering/expressions/optional-chains.d.ts +5 -6
  79. package/dist/frontend/lowering/expressions/optional-chains.js +7 -6
  80. package/dist/frontend/lowering/expressions/optional-chains.js.map +1 -1
  81. package/dist/frontend/lowering/indexed-comparison.d.ts +6 -0
  82. package/dist/frontend/lowering/indexed-comparison.js +30 -0
  83. package/dist/frontend/lowering/indexed-comparison.js.map +1 -0
  84. package/dist/frontend/lowering/lower-builtins.d.ts +1 -1
  85. package/dist/frontend/lowering/lower-builtins.js +21 -10
  86. package/dist/frontend/lowering/lower-builtins.js.map +1 -1
  87. package/dist/frontend/lowering/lower-calls.d.ts +2 -9
  88. package/dist/frontend/lowering/lower-calls.js +406 -40
  89. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  90. package/dist/frontend/lowering/lower-classes.js +3 -27
  91. package/dist/frontend/lowering/lower-classes.js.map +1 -1
  92. package/dist/frontend/lowering/lower-containers.d.ts +8 -2
  93. package/dist/frontend/lowering/lower-containers.js +454 -104
  94. package/dist/frontend/lowering/lower-containers.js.map +1 -1
  95. package/dist/frontend/lowering/lower-exprs.js +134 -18
  96. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  97. package/dist/frontend/lowering/lower-island.d.ts +1 -1
  98. package/dist/frontend/lowering/lower-island.js +1 -1
  99. package/dist/frontend/lowering/lower-modules.js +19 -8
  100. package/dist/frontend/lowering/lower-modules.js.map +1 -1
  101. package/dist/frontend/lowering/lower-stmts.js +4 -37
  102. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  103. package/dist/frontend/lowering/lowerer.js +14 -3
  104. package/dist/frontend/lowering/lowerer.js.map +1 -1
  105. package/dist/frontend/lowering/surfaces.d.ts +3 -1
  106. package/dist/frontend/lowering/surfaces.js +50 -7
  107. package/dist/frontend/lowering/surfaces.js.map +1 -1
  108. package/dist/frontend/program.d.ts +5 -0
  109. package/dist/frontend/program.js +216 -32
  110. package/dist/frontend/program.js.map +1 -1
  111. package/dist/frontend/program.test.d.ts +1 -0
  112. package/dist/frontend/program.test.js +117 -0
  113. package/dist/frontend/program.test.js.map +1 -0
  114. package/dist/frontend/type-mapper.d.ts +4 -2
  115. package/dist/frontend/type-mapper.js +249 -186
  116. package/dist/frontend/type-mapper.js.map +1 -1
  117. package/dist/frontend/type-mapper.test.d.ts +1 -0
  118. package/dist/frontend/type-mapper.test.js +86 -0
  119. package/dist/frontend/type-mapper.test.js.map +1 -0
  120. package/dist/index.d.ts +2 -1
  121. package/dist/index.js +7 -2
  122. package/dist/index.js.map +1 -1
  123. package/dist/ir/analysis.js +4 -2
  124. package/dist/ir/analysis.js.map +1 -1
  125. package/dist/ir/ir.d.ts +33 -14
  126. package/dist/ir/ir.js +5 -1
  127. package/dist/ir/ir.js.map +1 -1
  128. package/dist/ir/validate.js +57 -31
  129. package/dist/ir/validate.js.map +1 -1
  130. package/dist/ir/validate.test.js +17 -0
  131. package/dist/ir/validate.test.js.map +1 -1
  132. package/dist/library/compiler-self-identity.d.ts +1 -1
  133. package/dist/library/compiler-self-identity.js +31 -15
  134. package/dist/library/compiler-self-identity.js.map +1 -1
  135. package/dist/library/compiler-self-identity.test.d.ts +1 -0
  136. package/dist/library/compiler-self-identity.test.js +93 -0
  137. package/dist/library/compiler-self-identity.test.js.map +1 -0
  138. package/package.json +17 -17
  139. package/surface-manifest.json +155 -4
@@ -20,6 +20,23 @@ test("numeric array-read intrinsic validates and round-trips", () => {
20
20
  expect(validateModule(mod)).toEqual([]);
21
21
  expect(deserializeModule(serializeModule(mod))).toEqual(mod);
22
22
  });
23
+ test("indexed equality validates primitive kinds, arguments, and result", () => {
24
+ const args = [
25
+ { kind: "numLit", value: 0, type: F64, loc },
26
+ { kind: "arrayLit", elems: [], type: arrayOf(F64), loc },
27
+ { kind: "numLit", value: 1, type: F64, loc },
28
+ ];
29
+ const mod = numericReadModule({ method: "indexEq", args, type: BOOL });
30
+ expect(validateModule(mod)).toEqual([]);
31
+ expect(deserializeModule(serializeModule(mod))).toEqual(mod);
32
+ for (const override of [
33
+ { args: [] }, { type: F64 },
34
+ { args: [args[0], { kind: "arrayLit", elems: [], type: arrayOf(STRING), loc }, args[2]] },
35
+ { receiver: { kind: "arrayLit", elems: [], type: arrayOf(arrayOf(F64)), loc } },
36
+ ]) {
37
+ expect(validateModule(numericReadModule({ method: "indexEq", args, type: BOOL, ...override }))).not.toEqual([]);
38
+ }
39
+ });
23
40
  test.each([
24
41
  [{ receiver: { kind: "arrayLit", elems: [], type: arrayOf(STRING), loc } }, "requires f64 elements"],
25
42
  [{ args: [] }, "0 args, expected 1"],
@@ -1 +1 @@
1
- {"version":3,"file":"validate.test.js","sourceRoot":"","sources":["../../src/ir/validate.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAA8B,MAAM,SAAS,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,GAAG,GAAG,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;AAE1D,SAAS,iBAAiB,CAAC,SAAS,GAA+C,EAAE;IACnF,MAAM,IAAI,GAAW;QACnB,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW;QACzC,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,E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pC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,qBAAqB,CAAC;IACtF,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,aAAa,CAAC;CACiC,CAAC,CAAC,sDAAsD,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE;IACjJ,MAAM,CAAC,cAAc,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACnH,CAAC,CAAC,CAAC"}
@@ -19,5 +19,5 @@ export declare function compilerImplementationRoot(): string;
19
19
  * produced an early frontend artifact. Full compiles hash every byte before
20
20
  * publication; the CLI fast path validates the captured inode/time/size
21
21
  * metadata and loads the large compiler graph only when anything changed. */
22
- export declare function compilerImplementationIdentity(captureDependencies?: boolean): Promise<CompilerImplementationIdentity>;
22
+ export declare function compilerImplementationIdentity(captureDependencies?: boolean, implementationRoot?: string): Promise<CompilerImplementationIdentity>;
23
23
  export declare function compilerImplementationDependenciesStillMatch(dependencies: readonly CompilerImplementationDependency[]): Promise<boolean>;
@@ -27,35 +27,51 @@ function dependency(path, info) {
27
27
  * produced an early frontend artifact. Full compiles hash every byte before
28
28
  * publication; the CLI fast path validates the captured inode/time/size
29
29
  * metadata and loads the large compiler graph only when anything changed. */
30
- export async function compilerImplementationIdentity(captureDependencies = true) {
31
- const implementationRoot = compilerImplementationRoot();
32
- const files = [];
30
+ export async function compilerImplementationIdentity(captureDependencies = true, implementationRoot = compilerImplementationRoot()) {
31
+ const entries = [];
33
32
  const dependencies = [];
34
33
  const walk = async (directory) => {
35
- const directoryInfo = dependency(directory, await lstat(directory));
36
- if (captureDependencies && directoryInfo !== null)
37
- dependencies.push(directoryInfo);
38
- const entries = await readdir(directory, { withFileTypes: true });
39
- entries.sort((a, b) => a.name.localeCompare(b.name));
40
- for (const entry of entries) {
34
+ // Capture directories BEFORE enumeration: a new child arriving during
35
+ // the scan must invalidate this proof, even if readdir did not see it.
36
+ entries.push({
37
+ path: directory,
38
+ directory: captureDependencies ? dependency(directory, await lstat(directory)) : null,
39
+ });
40
+ const children = await readdir(directory, { withFileTypes: true });
41
+ children.sort((a, b) => a.name.localeCompare(b.name));
42
+ for (const entry of children) {
41
43
  const path = join(directory, entry.name);
42
44
  if (entry.isDirectory()) {
43
45
  await walk(path);
44
46
  }
45
47
  else if (entry.isFile()) {
46
- files.push(path);
47
- const fileInfo = dependency(path, await lstat(path));
48
- if (captureDependencies && fileInfo !== null)
49
- dependencies.push(fileInfo);
48
+ entries.push({ path });
50
49
  }
51
50
  }
52
51
  };
53
52
  await walk(implementationRoot);
54
53
  // Keep the v1 digest byte-identical: dependency metadata augments replay
55
54
  // validation without invalidating every existing library/executable entry.
55
+ // Read bounded batches concurrently, then hash in the original sorted DFS
56
+ // order. Serial reads spend hundreds of milliseconds in filesystem round
57
+ // trips on every application edit; reading the entire package at once
58
+ // would retain all its bytes and open an unbounded number of files.
56
59
  const hash = createHash("sha256").update("scriptc-frontend-implementation-v1\0");
57
- for (const file of files) {
58
- hash.update(relative(implementationRoot, file)).update("\0").update(await readFile(file)).update("\0");
60
+ const batchSize = 16;
61
+ for (let start = 0; start < entries.length; start += batchSize) {
62
+ const batch = await Promise.all(entries.slice(start, start + batchSize).map(async (entry) => {
63
+ if (entry.directory !== undefined)
64
+ return { ...entry, info: entry.directory, bytes: null };
65
+ const info = captureDependencies ? dependency(entry.path, await lstat(entry.path)) : null;
66
+ return { ...entry, info, bytes: await readFile(entry.path) };
67
+ }));
68
+ for (const entry of batch) {
69
+ if (entry.info !== null)
70
+ dependencies.push(entry.info);
71
+ if (entry.bytes !== null) {
72
+ hash.update(relative(implementationRoot, entry.path)).update("\0").update(entry.bytes).update("\0");
73
+ }
74
+ }
59
75
  }
60
76
  return { digest: hash.digest("hex"), dependencies };
61
77
  }
@@ -1 +1 @@
1
- {"version":3,"file":"compiler-self-identity.js","sourceRoot":"","sources":["../../src/library/compiler-self-identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAiBzC;;6EAE6E;AAC7E,MAAM,UAAU,0BAA0B;IACxC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1D,OAAO,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACxC,CAAC;AAED,SAAS,UAAU,CACjB,IAAY,EACZ,IAAuC;IAEvC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9E,OAAO,IAAI,KAAK,IAAI;QAClB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC;YACE,IAAI;YACJ,IAAI;YACJ,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;YACrB,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;YACrB,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;YACvB,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;YAC7B,OAAO,EAAE,MAAM,CAAC,IAAI,CAA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Q,CAAC;AACrC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,4CAA4C,CAChE,YAAyD;IAEzD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,eAAe,CAAC;QAAE,OAAO,KAAK,CAAC;IACvF,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QACpE,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QAC1D,IAAI,IAAI,KAAK,IAAI;YAAE,OAAO,KAAK,CAAC;QAChC,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACjD,OAAO,QAAQ,KAAK,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACpF,CAAC,CAAC,CAAC,CAAC;IACJ,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,93 @@
1
+ import { createHash } from "node:crypto";
2
+ import { mkdir, mkdtemp, rename, rm, symlink, utimes, writeFile } from "node:fs/promises";
3
+ import { tmpdir } from "node:os";
4
+ import { join, relative } from "node:path";
5
+ import { afterEach, expect, test } from "vitest";
6
+ import { compilerImplementationDependenciesStillMatch, compilerImplementationIdentity } from "./compiler-self-identity.js";
7
+ const scratch = [];
8
+ afterEach(async () => {
9
+ await Promise.all(scratch.splice(0).map((path) => rm(path, { recursive: true, force: true })));
10
+ });
11
+ async function fixture() {
12
+ const root = await mkdtemp(join(process.platform === "win32" ? tmpdir() : "/tmp", "scriptc-self-identity-"));
13
+ scratch.push(root);
14
+ return root;
15
+ }
16
+ test("parallel fingerprinting preserves the v1 byte stream and dependency order across batches", async () => {
17
+ const root = await fixture();
18
+ await mkdir(join(root, "a"));
19
+ await mkdir(join(root, "z"));
20
+ // Sorted depth-first order is deliberately DIFFERENT from sorting the
21
+ // complete paths (a.ts would precede a/index.ts). More than one batch,
22
+ // empty files, and differently sized reads exercise ordered hashing.
23
+ const files = [
24
+ [join("a", "index.ts"), "export const value = 42;\n"],
25
+ ["a.ts", ""],
26
+ ...Array.from({ length: 40 }, (_, i) => [
27
+ join("z", `file${String(i).padStart(2, "0")}.js`),
28
+ `// ${i}\n${"\u03bb".repeat(i * 1000)}`,
29
+ ]),
30
+ ];
31
+ await Promise.all([...files].reverse().map(([path, text]) => writeFile(join(root, path), text)));
32
+ const expected = createHash("sha256").update("scriptc-frontend-implementation-v1\0");
33
+ for (const [path, text] of files)
34
+ expected.update(path).update("\0").update(text).update("\0");
35
+ const first = await compilerImplementationIdentity(true, root);
36
+ expect(first.digest).toBe(expected.digest("hex"));
37
+ expect(first.dependencies.map((item) => relative(root, item.path))).toEqual([
38
+ "", "a", join("a", "index.ts"), "a.ts", "z", ...files.slice(2).map(([path]) => path),
39
+ ]);
40
+ expect(await compilerImplementationDependenciesStillMatch(first.dependencies)).toBe(true);
41
+ const withoutProof = await compilerImplementationIdentity(false, root);
42
+ expect(withoutProof).toEqual({ digest: first.digest, dependencies: [] });
43
+ });
44
+ test("content edits, including same-size writes, change the fingerprint and invalidate its proof", async () => {
45
+ const root = await fixture();
46
+ const source = join(root, "compiler.js");
47
+ await writeFile(source, "one");
48
+ const before = await compilerImplementationIdentity(true, root);
49
+ await writeFile(source, "two");
50
+ // Avoid depending on a filesystem's timestamp resolution for this test.
51
+ await utimes(source, new Date(1_000), new Date(1_000));
52
+ expect(await compilerImplementationDependenciesStillMatch(before.dependencies)).toBe(false);
53
+ const after = await compilerImplementationIdentity(true, root);
54
+ expect(after.digest).not.toBe(before.digest);
55
+ expect(await compilerImplementationDependenciesStillMatch(after.dependencies)).toBe(true);
56
+ });
57
+ test("added, renamed, and removed compiler files invalidate the captured directory proof", async () => {
58
+ const root = await fixture();
59
+ const directory = join(root, "nested");
60
+ await mkdir(directory);
61
+ await writeFile(join(directory, "first.js"), "unchanged");
62
+ const original = await compilerImplementationIdentity(true, root);
63
+ await writeFile(join(directory, "second.js"), "new");
64
+ await utimes(directory, new Date(1_000), new Date(1_000));
65
+ expect(await compilerImplementationDependenciesStillMatch(original.dependencies)).toBe(false);
66
+ const added = await compilerImplementationIdentity(true, root);
67
+ expect(added.digest).not.toBe(original.digest);
68
+ await rename(join(directory, "second.js"), join(directory, "renamed.js"));
69
+ expect(await compilerImplementationDependenciesStillMatch(added.dependencies)).toBe(false);
70
+ const renamed = await compilerImplementationIdentity(true, root);
71
+ expect(renamed.digest).not.toBe(added.digest);
72
+ await rm(join(directory, "renamed.js"));
73
+ expect(await compilerImplementationDependenciesStillMatch(renamed.dependencies)).toBe(false);
74
+ expect((await compilerImplementationIdentity(true, root)).digest).toBe(original.digest);
75
+ });
76
+ test.skipIf(process.platform === "win32")("symlinked dependencies remain outside the compiler package fingerprint", async () => {
77
+ const root = await fixture();
78
+ const external = await fixture();
79
+ await writeFile(join(root, "index.js"), "compiler");
80
+ await writeFile(join(external, "index.js"), "dependency");
81
+ await symlink(external, join(root, "dependency"));
82
+ await symlink(root, join(root, "cycle"));
83
+ const before = await compilerImplementationIdentity(true, root);
84
+ expect(before.dependencies.map((item) => relative(root, item.path))).toEqual(["", "index.js"]);
85
+ await writeFile(join(external, "index.js"), "changed dependency");
86
+ expect((await compilerImplementationIdentity(true, root)).digest).toBe(before.digest);
87
+ expect(await compilerImplementationDependenciesStillMatch(before.dependencies)).toBe(true);
88
+ });
89
+ test("missing compiler roots fail instead of producing a usable identity", async () => {
90
+ const root = await fixture();
91
+ await expect(compilerImplementationIdentity(true, join(root, "missing"))).rejects.toMatchObject({ code: "ENOENT" });
92
+ });
93
+ //# sourceMappingURL=compiler-self-ident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+ "version": "0.1.7",
4
4
  "description": "The scriptc compiler — TypeScript/JavaScript frontend, typed IR, LLVM and C backends",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://scriptc.dev",
@@ -31,24 +31,24 @@
31
31
  "dependencies": {
32
32
  "typescript": "7.0.2",
33
33
  "typescript5": "npm:typescript@5.9.3",
34
- "@scriptc/runtime": "0.1.5"
34
+ "@scriptc/runtime": "0.1.7"
35
35
  },
36
36
  "optionalDependencies": {
37
- "@scriptc/llvm-darwin-x64": "0.1.5",
38
- "@scriptc/llvm-darwin-arm64": "0.1.5",
39
- "@scriptc/llvm-linux-x64-gnu": "0.1.5",
40
- "@scriptc/llvm-win32-x64-msvc": "0.1.5",
41
- "@scriptc/runtime-linux-x64-gnu": "0.1.5",
42
- "@scriptc/llvm-linux-arm64-gnu": "0.1.5",
43
- "@scriptc/runtime-darwin-x64": "0.1.5",
44
- "@scriptc/llvm-linux-x64-musl": "0.1.5",
45
- "@scriptc/runtime-win32-x64-msvc": "0.1.5",
46
- "@scriptc/runtime-linux-arm64-gnu": "0.1.5",
47
- "@scriptc/runtime-wasm32-wasi": "0.1.5",
48
- "@scriptc/llvm-linux-arm64-musl": "0.1.5",
49
- "@scriptc/runtime-linux-x64-musl": "0.1.5",
50
- "@scriptc/runtime-linux-arm64-musl": "0.1.5",
51
- "@scriptc/runtime-darwin-arm64": "0.1.5"
37
+ "@scriptc/llvm-linux-x64-gnu": "0.1.7",
38
+ "@scriptc/llvm-darwin-x64": "0.1.7",
39
+ "@scriptc/llvm-darwin-arm64": "0.1.7",
40
+ "@scriptc/llvm-linux-arm64-musl": "0.1.7",
41
+ "@scriptc/llvm-linux-x64-musl": "0.1.7",
42
+ "@scriptc/llvm-win32-x64-msvc": "0.1.7",
43
+ "@scriptc/llvm-linux-arm64-gnu": "0.1.7",
44
+ "@scriptc/runtime-linux-x64-gnu": "0.1.7",
45
+ "@scriptc/runtime-linux-x64-musl": "0.1.7",
46
+ "@scriptc/runtime-darwin-x64": "0.1.7",
47
+ "@scriptc/runtime-linux-arm64-musl": "0.1.7",
48
+ "@scriptc/runtime-win32-x64-msvc": "0.1.7",
49
+ "@scriptc/runtime-wasm32-wasi": "0.1.7",
50
+ "@scriptc/runtime-darwin-arm64": "0.1.7",
51
+ "@scriptc/runtime-linux-arm64-gnu": "0.1.7"
52
52
  },
53
53
  "scripts": {
54
54
  "build": "node node_modules/typescript/bin/tsc -p tsconfig.json"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "compilerVersion": "0.1.5",
3
+ "compilerVersion": "0.1.7",
4
4
  "coverage": [
5
5
  "Entries are projected mechanically from the compiler's own decision tables: the diagnostics registry, the unsupported-syntax dispatch tables, the stdlib and node-builtin lowering tables, and the supported-builtin-module list. Nothing is hand-maintained; the manifest regenerates byte-identically from the source tree at this version.",
6
6
  "Absence from this manifest means 'not projected', never 'unsupported'. Surfaces lowered through dedicated code paths rather than tables are not yet projected: console, JSON, Promise/async and the timer surface, the net/http/tls/https/dgram/dns/assert/test/stream/readline module member surfaces, template literals, the regex slice, global functions (parseInt, parseFloat, isNaN, isFinite), and the process surface outside its ambient slice.",
@@ -1621,6 +1621,13 @@
1621
1621
  "status": "static",
1622
1622
  "note": "getrusage's 16 fields — every field read samples live machine state"
1623
1623
  },
1624
+ {
1625
+ "id": "node-builtin.process.rows",
1626
+ "kind": "node-builtin",
1627
+ "name": "process.rows",
1628
+ "status": "static",
1629
+ "note": "the rows read on process.stdout/stderr (terminal geometry)"
1630
+ },
1624
1631
  {
1625
1632
  "id": "node-builtin.process.threadCpuUsage",
1626
1633
  "kind": "node-builtin",
@@ -2116,12 +2123,24 @@
2116
2123
  "name": "Array.prototype.concat",
2117
2124
  "status": "static"
2118
2125
  },
2126
+ {
2127
+ "id": "stdlib.array.copyWithin",
2128
+ "kind": "stdlib",
2129
+ "name": "Array.prototype.copyWithin",
2130
+ "status": "static"
2131
+ },
2119
2132
  {
2120
2133
  "id": "stdlib.array.every",
2121
2134
  "kind": "stdlib",
2122
2135
  "name": "Array.prototype.every",
2123
2136
  "status": "static"
2124
2137
  },
2138
+ {
2139
+ "id": "stdlib.array.fill",
2140
+ "kind": "stdlib",
2141
+ "name": "Array.prototype.fill",
2142
+ "status": "static"
2143
+ },
2125
2144
  {
2126
2145
  "id": "stdlib.array.filter",
2127
2146
  "kind": "stdlib",
@@ -2152,6 +2171,12 @@
2152
2171
  "name": "Array.prototype.findLastIndex",
2153
2172
  "status": "static"
2154
2173
  },
2174
+ {
2175
+ "id": "stdlib.array.flat",
2176
+ "kind": "stdlib",
2177
+ "name": "Array.prototype.flat",
2178
+ "status": "static"
2179
+ },
2155
2180
  {
2156
2181
  "id": "stdlib.array.flatMap",
2157
2182
  "kind": "stdlib",
@@ -2678,6 +2703,34 @@
2678
2703
  "status": "static",
2679
2704
  "note": "the constant read compiles to a numeric literal; no runtime Math read is performed"
2680
2705
  },
2706
+ {
2707
+ "id": "stdlib.math.LN10",
2708
+ "kind": "stdlib",
2709
+ "name": "Math.LN10",
2710
+ "status": "static",
2711
+ "note": "the constant read compiles to a numeric literal; no runtime Math read is performed"
2712
+ },
2713
+ {
2714
+ "id": "stdlib.math.LN2",
2715
+ "kind": "stdlib",
2716
+ "name": "Math.LN2",
2717
+ "status": "static",
2718
+ "note": "the constant read compiles to a numeric literal; no runtime Math read is performed"
2719
+ },
2720
+ {
2721
+ "id": "stdlib.math.LOG10E",
2722
+ "kind": "stdlib",
2723
+ "name": "Math.LOG10E",
2724
+ "status": "static",
2725
+ "note": "the constant read compiles to a numeric literal; no runtime Math read is performed"
2726
+ },
2727
+ {
2728
+ "id": "stdlib.math.LOG2E",
2729
+ "kind": "stdlib",
2730
+ "name": "Math.LOG2E",
2731
+ "status": "static",
2732
+ "note": "the constant read compiles to a numeric literal; no runtime Math read is performed"
2733
+ },
2681
2734
  {
2682
2735
  "id": "stdlib.math.PI",
2683
2736
  "kind": "stdlib",
@@ -2685,6 +2738,20 @@
2685
2738
  "status": "static",
2686
2739
  "note": "the constant read compiles to a numeric literal; no runtime Math read is performed"
2687
2740
  },
2741
+ {
2742
+ "id": "stdlib.math.SQRT1_2",
2743
+ "kind": "stdlib",
2744
+ "name": "Math.SQRT1_2",
2745
+ "status": "static",
2746
+ "note": "the constant read compiles to a numeric literal; no runtime Math read is performed"
2747
+ },
2748
+ {
2749
+ "id": "stdlib.math.SQRT2",
2750
+ "kind": "stdlib",
2751
+ "name": "Math.SQRT2",
2752
+ "status": "static",
2753
+ "note": "the constant read compiles to a numeric literal; no runtime Math read is performed"
2754
+ },
2688
2755
  {
2689
2756
  "id": "stdlib.math.abs",
2690
2757
  "kind": "stdlib",
@@ -2699,6 +2766,13 @@
2699
2766
  "status": "static",
2700
2767
  "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2701
2768
  },
2769
+ {
2770
+ "id": "stdlib.math.acosh",
2771
+ "kind": "stdlib",
2772
+ "name": "Math.acosh",
2773
+ "status": "static",
2774
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2775
+ },
2702
2776
  {
2703
2777
  "id": "stdlib.math.asin",
2704
2778
  "kind": "stdlib",
@@ -2706,6 +2780,13 @@
2706
2780
  "status": "static",
2707
2781
  "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2708
2782
  },
2783
+ {
2784
+ "id": "stdlib.math.asinh",
2785
+ "kind": "stdlib",
2786
+ "name": "Math.asinh",
2787
+ "status": "static",
2788
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2789
+ },
2709
2790
  {
2710
2791
  "id": "stdlib.math.atan",
2711
2792
  "kind": "stdlib",
@@ -2720,6 +2801,13 @@
2720
2801
  "status": "static",
2721
2802
  "note": "compiles statically at arity 2; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2722
2803
  },
2804
+ {
2805
+ "id": "stdlib.math.atanh",
2806
+ "kind": "stdlib",
2807
+ "name": "Math.atanh",
2808
+ "status": "static",
2809
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2810
+ },
2723
2811
  {
2724
2812
  "id": "stdlib.math.cbrt",
2725
2813
  "kind": "stdlib",
@@ -2734,6 +2822,13 @@
2734
2822
  "status": "static",
2735
2823
  "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2736
2824
  },
2825
+ {
2826
+ "id": "stdlib.math.clz32",
2827
+ "kind": "stdlib",
2828
+ "name": "Math.clz32",
2829
+ "status": "static",
2830
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2831
+ },
2737
2832
  {
2738
2833
  "id": "stdlib.math.cos",
2739
2834
  "kind": "stdlib",
@@ -2741,6 +2836,13 @@
2741
2836
  "status": "static",
2742
2837
  "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2743
2838
  },
2839
+ {
2840
+ "id": "stdlib.math.cosh",
2841
+ "kind": "stdlib",
2842
+ "name": "Math.cosh",
2843
+ "status": "static",
2844
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2845
+ },
2744
2846
  {
2745
2847
  "id": "stdlib.math.exp",
2746
2848
  "kind": "stdlib",
@@ -2748,6 +2850,13 @@
2748
2850
  "status": "static",
2749
2851
  "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2750
2852
  },
2853
+ {
2854
+ "id": "stdlib.math.expm1",
2855
+ "kind": "stdlib",
2856
+ "name": "Math.expm1",
2857
+ "status": "static",
2858
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2859
+ },
2751
2860
  {
2752
2861
  "id": "stdlib.math.floor",
2753
2862
  "kind": "stdlib",
@@ -2755,6 +2864,13 @@
2755
2864
  "status": "static",
2756
2865
  "note": "compiles statically at arity 1"
2757
2866
  },
2867
+ {
2868
+ "id": "stdlib.math.fround",
2869
+ "kind": "stdlib",
2870
+ "name": "Math.fround",
2871
+ "status": "static",
2872
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2873
+ },
2758
2874
  {
2759
2875
  "id": "stdlib.math.hypot",
2760
2876
  "kind": "stdlib",
@@ -2762,6 +2878,13 @@
2762
2878
  "status": "static",
2763
2879
  "note": "compiles statically at any arity, including number[] spreads"
2764
2880
  },
2881
+ {
2882
+ "id": "stdlib.math.imul",
2883
+ "kind": "stdlib",
2884
+ "name": "Math.imul",
2885
+ "status": "static",
2886
+ "note": "compiles statically at arity 2; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2887
+ },
2765
2888
  {
2766
2889
  "id": "stdlib.math.log",
2767
2890
  "kind": "stdlib",
@@ -2776,6 +2899,13 @@
2776
2899
  "status": "static",
2777
2900
  "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2778
2901
  },
2902
+ {
2903
+ "id": "stdlib.math.log1p",
2904
+ "kind": "stdlib",
2905
+ "name": "Math.log1p",
2906
+ "status": "static",
2907
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2908
+ },
2779
2909
  {
2780
2910
  "id": "stdlib.math.log2",
2781
2911
  "kind": "stdlib",
@@ -2832,6 +2962,13 @@
2832
2962
  "status": "static",
2833
2963
  "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2834
2964
  },
2965
+ {
2966
+ "id": "stdlib.math.sinh",
2967
+ "kind": "stdlib",
2968
+ "name": "Math.sinh",
2969
+ "status": "static",
2970
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2971
+ },
2835
2972
  {
2836
2973
  "id": "stdlib.math.sqrt",
2837
2974
  "kind": "stdlib",
@@ -2846,6 +2983,13 @@
2846
2983
  "status": "static",
2847
2984
  "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2848
2985
  },
2986
+ {
2987
+ "id": "stdlib.math.tanh",
2988
+ "kind": "stdlib",
2989
+ "name": "Math.tanh",
2990
+ "status": "static",
2991
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2992
+ },
2849
2993
  {
2850
2994
  "id": "stdlib.math.trunc",
2851
2995
  "kind": "stdlib",
@@ -3489,8 +3633,8 @@
3489
3633
  "id": "stdlib.string.at",
3490
3634
  "kind": "stdlib",
3491
3635
  "name": "string.prototype.at",
3492
- "status": "dynamic-only",
3493
- "code": "SC2012"
3636
+ "status": "static",
3637
+ "note": "the lowered call form takes 0 to 1 arguments"
3494
3638
  },
3495
3639
  {
3496
3640
  "id": "stdlib.string.charAt",
@@ -3506,6 +3650,13 @@
3506
3650
  "status": "static",
3507
3651
  "note": "the lowered call form takes 0 to 1 arguments"
3508
3652
  },
3653
+ {
3654
+ "id": "stdlib.string.codePointAt",
3655
+ "kind": "stdlib",
3656
+ "name": "string.prototype.codePointAt",
3657
+ "status": "static",
3658
+ "note": "the lowered call form takes 0 to 1 arguments"
3659
+ },
3509
3660
  {
3510
3661
  "id": "stdlib.string.endsWith",
3511
3662
  "kind": "stdlib",
@@ -3581,7 +3732,7 @@
3581
3732
  "kind": "stdlib",
3582
3733
  "name": "string.prototype.split",
3583
3734
  "status": "static",
3584
- "note": "the lowered call form takes 1 to 2 arguments"
3735
+ "note": "the lowered call form takes 0 to 2 arguments"
3585
3736
  },
3586
3737
  {
3587
3738
  "id": "stdlib.string.startsWith",