@nimbus-sh/platform 0.8.2 → 0.13.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 (67) hide show
  1. package/dist/composition.d.ts +3 -2
  2. package/dist/composition.d.ts.map +1 -1
  3. package/dist/composition.js +34 -19
  4. package/dist/crc32.d.ts +5 -5
  5. package/dist/crc32.d.ts.map +1 -1
  6. package/dist/crc32.js +8 -12
  7. package/dist/diag-counters.d.ts +18 -10
  8. package/dist/diag-counters.d.ts.map +1 -1
  9. package/dist/diag-counters.js +7 -20
  10. package/dist/heap-estimate.d.ts +5 -20
  11. package/dist/heap-estimate.d.ts.map +1 -1
  12. package/dist/heap-estimate.js +6 -33
  13. package/dist/heavy-alloc-coord.d.ts +131 -11
  14. package/dist/heavy-alloc-coord.d.ts.map +1 -1
  15. package/dist/heavy-alloc-coord.js +241 -22
  16. package/dist/hex.d.ts +20 -0
  17. package/dist/hex.d.ts.map +1 -0
  18. package/dist/hex.js +29 -0
  19. package/dist/install-phase.d.ts +1 -15
  20. package/dist/install-phase.d.ts.map +1 -1
  21. package/dist/lexical-path.d.ts +11 -0
  22. package/dist/lexical-path.d.ts.map +1 -0
  23. package/dist/lexical-path.js +19 -0
  24. package/dist/limits.d.ts +4 -0
  25. package/dist/limits.d.ts.map +1 -1
  26. package/dist/limits.js +25 -0
  27. package/dist/module-source.d.ts.map +1 -1
  28. package/dist/module-source.js +2 -1
  29. package/dist/oom-classify.d.ts +4 -0
  30. package/dist/oom-classify.d.ts.map +1 -1
  31. package/dist/oom-classify.js +6 -0
  32. package/dist/realm-builtin.d.ts +2 -0
  33. package/dist/realm-builtin.d.ts.map +1 -0
  34. package/dist/realm-builtin.js +11 -0
  35. package/dist/utf8.d.ts +13 -1
  36. package/dist/utf8.d.ts.map +1 -1
  37. package/dist/utf8.js +67 -1
  38. package/dist/w7-frame.d.ts +47 -13
  39. package/dist/w7-frame.d.ts.map +1 -1
  40. package/dist/w7-frame.js +42 -24
  41. package/dist/wave-writer.d.ts +11 -6
  42. package/dist/wave-writer.d.ts.map +1 -1
  43. package/dist/wave-writer.js +28 -29
  44. package/dist/weighted-credit-pool.d.ts +43 -0
  45. package/dist/weighted-credit-pool.d.ts.map +1 -1
  46. package/dist/weighted-credit-pool.js +250 -46
  47. package/dist/worker-code.d.ts +48 -0
  48. package/dist/worker-code.d.ts.map +1 -0
  49. package/dist/worker-code.js +10 -0
  50. package/package.json +1 -1
  51. package/src/composition.ts +41 -21
  52. package/src/crc32.ts +9 -12
  53. package/src/diag-counters.ts +23 -22
  54. package/src/heap-estimate.ts +11 -40
  55. package/src/heavy-alloc-coord.ts +275 -20
  56. package/src/hex.ts +29 -0
  57. package/src/install-phase.ts +1 -15
  58. package/src/lexical-path.ts +17 -0
  59. package/src/limits.ts +29 -0
  60. package/src/module-source.ts +3 -1
  61. package/src/oom-classify.ts +8 -0
  62. package/src/realm-builtin.ts +22 -0
  63. package/src/utf8.ts +69 -1
  64. package/src/w7-frame.ts +74 -33
  65. package/src/wave-writer.ts +28 -27
  66. package/src/weighted-credit-pool.ts +256 -51
  67. package/src/worker-code.ts +38 -0
@@ -33,11 +33,12 @@
33
33
  * the Durable Object classes, which is what lets the pool be unit-tested
34
34
  * in a plain Node/Bun process.
35
35
  */
36
+ import type { WorkerCode } from './worker-code.js';
36
37
  export type EntrypointLoopbackFactory = <Stub = unknown>(options: {
37
38
  props: object;
38
39
  }) => Stub;
39
40
  export type CtxExports = Record<string, EntrypointLoopbackFactory | undefined>;
40
- export type StagedBootAssembler = (env: unknown, stage: unknown) => Promise<object>;
41
+ export type StagedBootAssembler = (env: unknown, stage: unknown) => Promise<WorkerCode>;
41
42
  export interface FabricComposition {
42
43
  supervisorEntrypoint: string;
43
44
  stagedBootAssembler?: StagedBootAssembler;
@@ -67,7 +68,7 @@ export declare const DEFAULT_HOST_DISPATCH_METHOD = "supervisorOp";
67
68
  * a second call with different values throws, naming both, so an embedder
68
69
  * whose composition lost to an earlier import learns it at startup rather
69
70
  * than from a facet that reached the wrong host. A host without
70
- * `enhanced_error_serialization` is refused.
71
+ * `enhanced_error_serialization` or `enable_request_signal` is refused.
71
72
  */
72
73
  export declare function composeFabric(value: FabricComposition): void;
73
74
  export declare function adoptCtxExports(value: CtxExports): void;
@@ -1 +1 @@
1
- {"version":3,"file":"composition.d.ts","sourceRoot":"","sources":["../src/composition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,IAAI,GAAG,OAAO,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,KAAK,IAAI,CAAC;AAC7F,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,yBAAyB,GAAG,SAAS,CAAC,CAAC;AAC/E,MAAM,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAEpF,MAAM,WAAW,iBAAiB;IAChC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,gEAAgE;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,SAAS;IACxB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AACvD,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAmC3D;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAoB5D;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,C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AC;IACtB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AACvD,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAqD3D;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAoB5D;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAEvD;AAED,wBAAgB,aAAa,IAAI,UAAU,GAAG,IAAI,CAEjD;AAED,wBAAgB,oBAAoB,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,IAAI,qBAAoC,GAAG,yBAAyB,GAAG,IAAI,CAMrI;AAED,wBAAgB,wBAAwB,IAAI,MAAM,GAAG,IAAI,CAExD;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,IAAI,SAAS,GAAG,IAAI,CAO5C;AAED,wBAAgB,mBAAmB,IAAI,mBAAmB,CASzD"}
@@ -3,11 +3,17 @@ export const DEFAULT_HOST_DISPATCH_METHOD = 'supervisorOp';
3
3
  let composition = null;
4
4
  let ctxExports = null;
5
5
  /**
6
- * A program's filesystem errors reach it across workerd RPC, from the host
7
- * that answers its supervisor binding, and the program branches on the POSIX
8
- * `code` each one carries. workerd carries an error's own properties across
9
- * RPC only when the sending AND the receiving isolate have
10
- * `enhanced_error_serialization`, on by compatibility date from 2026-04-21:
6
+ * The compatibility flags a host composes the fabric under, refused without.
7
+ * Composing refuses wherever it composes (module scope: the Worker fails at
8
+ * startup; NimbusWorkspace.create: that call throws), naming the fix. Off
9
+ * workerd (bun, node) there is no `Cloudflare` global to read, and neither
10
+ * flag has anything to act on.
11
+ *
12
+ * `enhanced_error_serialization`: a program's filesystem errors reach it
13
+ * across workerd RPC, from the host that answers its supervisor binding, and
14
+ * the program branches on the POSIX `code` each one carries. workerd carries
15
+ * an error's own properties across RPC only when the sending AND the
16
+ * receiving isolate have the flag, on by compatibility date from 2026-04-21:
11
17
  * the serializer writes a native error as a host object with its own
12
18
  * properties only under the flag (src/workerd/jsg/ser.c++,
13
19
  * Serializer::IsHostObject), and the receiver reads that detail back only
@@ -15,32 +21,41 @@ let ctxExports = null;
15
21
  * https://developers.cloudflare.com/workers/runtime-apis/rpc/error-handling/.
16
22
  * Programs load at CF_COMPAT_DATE, past it. The host runs at its embedder's
17
23
  * date, and below it every ENOENT would reach every program as a bare message
18
- * it maps to EIO. So composing refuses such a host, wherever it composes
19
- * (module scope: the Worker fails at startup; NimbusWorkspace.create: that
20
- * call throws), and names both fixes: the flag alone keeps
21
- * every other behavior of the embedder's date. Off workerd (bun, node) there
22
- * is no RPC hop and no `Cloudflare` global to read.
24
+ * it maps to EIO. The flag alone keeps every other behavior of that date.
25
+ *
26
+ * `enable_request_signal`, which no compatibility date enables: a process
27
+ * owns work for a response until its client is done with it, and a client
28
+ * that goes away is seen only as the incoming request's `signal` aborting
29
+ * (src/workerd/io/worker-entrypoint.c++, "The client has disconnected").
30
+ * Without it a response whose client left keeps its process's work, and the
31
+ * host that runs it, held until the process writes again, or for good.
23
32
  */
24
- function requireEnhancedErrorSerialization() {
33
+ function requireHostFlags() {
25
34
  // `typeof` of an undeclared global is 'undefined', not a ReferenceError.
26
35
  if (typeof Cloudflare === 'undefined')
27
36
  return;
28
- if (Cloudflare.compatibilityFlags.enhanced_error_serialization === true)
29
- return;
30
- throw new Error('fabric: this Worker runs without the enhanced_error_serialization compatibility flag, so the '
31
- + "code on a program's filesystem error (ENOENT, EEXIST, ...) would not survive the RPC back "
32
- + 'to it. Add "enhanced_error_serialization" to compatibility_flags in your wrangler config, '
33
- + 'or set compatibility_date to 2026-04-21 or later.');
37
+ if (Cloudflare.compatibilityFlags.enhanced_error_serialization !== true) {
38
+ throw new Error('fabric: this Worker runs without the enhanced_error_serialization compatibility flag, so the '
39
+ + "code on a program's filesystem error (ENOENT, EEXIST, ...) would not survive the RPC back "
40
+ + 'to it. Add "enhanced_error_serialization" to compatibility_flags in your wrangler config, '
41
+ + 'or set compatibility_date to 2026-04-21 or later.');
42
+ }
43
+ if (Cloudflare.compatibilityFlags.enable_request_signal !== true) {
44
+ throw new Error('fabric: this Worker runs without the enable_request_signal compatibility flag, so a process '
45
+ + 'cannot see a client leave the response it is serving, and keeps that work held. Add '
46
+ + '"enable_request_signal" to compatibility_flags in your wrangler config; no compatibility '
47
+ + 'date enables it.');
48
+ }
34
49
  }
35
50
  /**
36
51
  * Compose once per isolate. A second call with the same values is a no-op;
37
52
  * a second call with different values throws, naming both, so an embedder
38
53
  * whose composition lost to an earlier import learns it at startup rather
39
54
  * than from a facet that reached the wrong host. A host without
40
- * `enhanced_error_serialization` is refused.
55
+ * `enhanced_error_serialization` or `enable_request_signal` is refused.
41
56
  */
42
57
  export function composeFabric(value) {
43
- requireEnhancedErrorSerialization();
58
+ requireHostFlags();
44
59
  if (!composition) {
45
60
  composition = value;
46
61
  return;
package/dist/crc32.d.ts CHANGED
@@ -9,11 +9,11 @@
9
9
  * Measured 2026-09-24 (5k files x 2 KiB; 64 MiB in 1 MiB buffers):
10
10
  * node:zlib's crc32 is 5-40x faster than any JavaScript loop in bun, node and
11
11
  * workerd (compat 2026-04-01, nodejs_compat), but each call costs ~0.14 us in
12
- * workerd, so below 128 bytes the table loop wins there. It is reached through
13
- * `process.getBuiltinModule`, like core's incremental SHA-256, so this module
14
- * imports nothing and still loads where node:zlib is absent (a browser,
15
- * workerd without nodejs_compat). The JavaScript path is slicing-by-8: 2-3x
16
- * the byte-at-a-time table loop in bun and node, and level with it in workerd.
12
+ * workerd, so below 128 bytes the table loop wins there. It is the realm's
13
+ * own (realmBuiltin), like core's incremental SHA-256's, so this module still
14
+ * loads where node:zlib is absent (a browser, workerd without nodejs_compat).
15
+ * The JavaScript path is slicing-by-8: 2-3x the byte-at-a-time table loop in
16
+ * bun and node, and level with it in workerd.
17
17
  */
18
18
  export declare function crc32(bytes: Uint8Array, previous?: number): number;
19
19
  //# sourceMappingURL=crc32.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"crc32.d.ts","sourceRoot":"","sources":["../src/crc32.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAqCH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,SAAI,GAAG,MAAM,CAiB7D"}
1
+ {"version":3,"file":"crc32.d.ts","sourceRoot":"","sources":["../src/crc32.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAkCH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,SAAI,GAAG,MAAM,CAiB7D"}
package/dist/crc32.js CHANGED
@@ -9,22 +9,18 @@
9
9
  * Measured 2026-09-24 (5k files x 2 KiB; 64 MiB in 1 MiB buffers):
10
10
  * node:zlib's crc32 is 5-40x faster than any JavaScript loop in bun, node and
11
11
  * workerd (compat 2026-04-01, nodejs_compat), but each call costs ~0.14 us in
12
- * workerd, so below 128 bytes the table loop wins there. It is reached through
13
- * `process.getBuiltinModule`, like core's incremental SHA-256, so this module
14
- * imports nothing and still loads where node:zlib is absent (a browser,
15
- * workerd without nodejs_compat). The JavaScript path is slicing-by-8: 2-3x
16
- * the byte-at-a-time table loop in bun and node, and level with it in workerd.
12
+ * workerd, so below 128 bytes the table loop wins there. It is the realm's
13
+ * own (realmBuiltin), like core's incremental SHA-256's, so this module still
14
+ * loads where node:zlib is absent (a browser, workerd without nodejs_compat).
15
+ * The JavaScript path is slicing-by-8: 2-3x the byte-at-a-time table loop in
16
+ * bun and node, and level with it in workerd.
17
17
  */
18
+ import { realmBuiltin } from './realm-builtin.js';
18
19
  /** Below this many bytes the native call's overhead exceeds the JavaScript loop's work (workerd). */
19
20
  const CRC_NATIVE_MIN_BYTES = 128;
20
21
  const nativeCrc32 = (() => {
21
- try {
22
- const crc32 = globalThis.process?.getBuiltinModule?.('node:zlib')?.crc32;
23
- return typeof crc32 === 'function' ? crc32 : null;
24
- }
25
- catch {
26
- return null;
27
- }
22
+ const crc32 = realmBuiltin('node:zlib')?.crc32;
23
+ return typeof crc32 === 'function' ? crc32 : null;
28
24
  })();
29
25
  /** Eight 256-entry tables: table k maps a byte to its CRC after k further zero bytes. */
30
26
  let crcTables = null;
@@ -27,6 +27,7 @@
27
27
  *
28
28
  */
29
29
  import type { InstallPhase } from './install-phase.js';
30
+ import { type AllocationAttribution, type SupervisorAllocationLease } from './heavy-alloc-coord.js';
30
31
  export interface DiagCounters {
31
32
  /** Top-level install phase. */
32
33
  installPhase: InstallPhase;
@@ -55,13 +56,22 @@ export interface DiagCounters {
55
56
  * `buildPrefetchBundle` accumulates raw VFS file contents into an in-heap
56
57
  * bundle object, and used to do so with nothing observing it: the estimator
57
58
  * read 9.4 MiB while those bytes were resetting the DO. Each build now takes
58
- * an `acquireSupervisorAllocation` lease for the budget it may use and bumps
59
- * this alongside it, so the reservation is ATTRIBUTED to the bundle path
60
- * rather than landing in `unattributedReservationBytes`.
59
+ * an `acquireSupervisorAllocation` lease for the budget it may use, counted
60
+ * here while it is held (attributeAllocation), so the reservation is
61
+ * ATTRIBUTED to the bundle path rather than landing in
62
+ * `unattributedReservationBytes`.
61
63
  *
62
64
  * Surfaced as `breakdown.prefetchBundleBytes`. Back to zero between builds.
63
65
  */
64
66
  prefetchBundleBytes: number;
67
+ /**
68
+ * Bytes the slices of pre-bundles in flight hold: each build's lease
69
+ * (browser-prebundle.ts), counted while it is held (attributeAllocation),
70
+ * after it shrinks to the slice it walked.
71
+ *
72
+ * Surfaced as `breakdown.preBundleSliceBytes`. Back to zero between builds.
73
+ */
74
+ preBundleSliceBytes: number;
65
75
  /**
66
76
  * Bytes retained by the FacetManager's prefetch-bundle LRU right now.
67
77
  *
@@ -172,15 +182,13 @@ export declare function rpcPayloadStart(bytes: number): void;
172
182
  * hit is a bug worth investigating.
173
183
  */
174
184
  export declare function rpcPayloadEnd(bytes: number): void;
185
+ /** The counters that name the live allocation leases of one owner. */
186
+ export type AllocationOwner = AllocationAttribution;
175
187
  /**
176
- * Track an in-flight prefetch-bundle build. Call with the byte reservation the
177
- * build took from the supervisor allocation budget, and pair with
178
- * `prefetchBundleEnd` in the matching `finally` so it returns to zero whether
179
- * the build succeeded or threw.
188
+ * Attribution belongs to the budget's actual lease. The public gauges are
189
+ * derived from its holders, never maintained in a second counter registry.
180
190
  */
181
- export declare function prefetchBundleStart(bytes: number): void;
182
- /** Release an in-flight prefetch-bundle reservation. Floors at 0. */
183
- export declare function prefetchBundleEnd(bytes: number): void;
191
+ export declare function attributeAllocation(owner: AllocationOwner, lease: SupervisorAllocationLease): SupervisorAllocationLease;
184
192
  /**
185
193
  * Publish the prefetch-bundle LRU's live retained total. A gauge: the cache
186
194
  * owns the number and reports it whenever it admits or evicts an entry.
@@ -1 +1 @@
1
- {"version":3,"file":"diag-counters.d.ts","sourceRoot":"","sources":["../src/diag-counters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;;;;;GAOG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,WAAW,YAAY;IAC3B,+BAA+B;IAC/B,YAAY,EAAE,YAAY,CAAC;IAC3B;;;;;;;;;;;;;;;;;OAiBG;IACH,uBAAuB,EAAE,MAAM,CAAC;IAChC;;;;;;;;;;;OAWG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;;;;;;;;;OAWG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;qCAGiC;IACjC,YAAY,EAAE;QACZ,wEAAwE;QACxE,iBAAiB,EAAE,MAAM,CAAC;QAC1B,sEAAsE;QACtE,sBAAsB,EAAE,MAAM,CAAC;QAC/B,2EAA2E;QAC3E,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF;yEACqE;IACrE,cAAc,EAAE;QACd,4DAA4D;QAC5D,SAAS,EAAE,MAAM,CAAC;Q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M,eAAe,GAAG,qBAAqB,CAAC;AAEpD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,yBAAyB,GAAG,yBAAyB,CAGvH;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAGzD;AAED;;;qDAGqD;AACrD,wBAAgB,0BAA0B,CAAC,CAAC,EAAE;IAC5C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,IAAI,CAMP;AAED;;;;;aAKa;AACb,wBAAgB,sBAAsB,CAAC,CAAC,EAAE;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC,GAAG,IAAI,CAiBP;AAED;;sCAEsC;AACtC,wBAAgB,oBAAoB,CAAC,CAAC,EAAE;IACtC,wBAAwB,EAAE,MAAM,CAAC;IACjC,0BAA0B,EAAE,MAAM,CAAC;IACnC,0BAA0B,EAAE,MAAM,CAAC;IACnC,4BAA4B,EAAE,MAAM,CAAC;CACtC,GAAG,IAAI,CAKP"}
@@ -18,10 +18,10 @@
18
18
  * reboot — itself a useful signal (counters at 0 immediately after the
19
19
  * banner reprinted = the killed isolate took its state with it).
20
20
  */
21
+ import { readSupervisorAllocationAttribution } from './heavy-alloc-coord.js';
21
22
  const _counters = {
22
23
  installPhase: 'idle',
23
24
  inFlightRpcPayloadBytes: 0,
24
- prefetchBundleBytes: 0,
25
25
  prefetchCacheBytes: 0,
26
26
  supervisorAnsweredBytes: 0,
27
27
  installFacet: {
@@ -46,7 +46,7 @@ const _counters = {
46
46
  };
47
47
  /** Read a snapshot — caller-side mutations don't affect the singleton. */
48
48
  export function readDiagCounters() {
49
- return { ..._counters };
49
+ return { ..._counters, ...readSupervisorAllocationAttribution() };
50
50
  }
51
51
  /** Count `bytes` the session answered a process's supervisor call with. */
52
52
  export function recordSupervisorAnswer(bytes) {
@@ -99,25 +99,12 @@ export function rpcPayloadEnd(bytes) {
99
99
  }
100
100
  }
101
101
  /**
102
- * Track an in-flight prefetch-bundle build. Call with the byte reservation the
103
- * build took from the supervisor allocation budget, and pair with
104
- * `prefetchBundleEnd` in the matching `finally` so it returns to zero whether
105
- * the build succeeded or threw.
102
+ * Attribution belongs to the budget's actual lease. The public gauges are
103
+ * derived from its holders, never maintained in a second counter registry.
106
104
  */
107
- export function prefetchBundleStart(bytes) {
108
- const n = Number(bytes);
109
- if (!Number.isFinite(n) || n <= 0)
110
- return;
111
- _counters.prefetchBundleBytes += n;
112
- }
113
- /** Release an in-flight prefetch-bundle reservation. Floors at 0. */
114
- export function prefetchBundleEnd(bytes) {
115
- const n = Number(bytes);
116
- if (!Number.isFinite(n) || n <= 0)
117
- return;
118
- _counters.prefetchBundleBytes -= n;
119
- if (_counters.prefetchBundleBytes < 0)
120
- _counters.prefetchBundleBytes = 0;
105
+ export function attributeAllocation(owner, lease) {
106
+ lease.attribute(owner);
107
+ return lease;
121
108
  }
122
109
  /**
123
110
  * Publish the prefetch-bundle LRU's live retained total. A gauge: the cache
@@ -149,9 +149,11 @@ export interface HeapBreakdown {
149
149
  vfsLruBytes: number;
150
150
  /** SqliteVFS current logical retained write payload bytes. */
151
151
  vfsInFlightBytes: number;
152
- /** Pre-bundle slice bytes resident in supervisor heap (peak across
153
- * in-flight pool slots × SLICE_CAP_BYTES). Drops to 0 once
154
- * A'.2/A'.3 stream the slice through ReadableStream-over-RPC. */
152
+ /**
153
+ * Bytes the slices of pre-bundles in flight hold (diag-counters
154
+ * `preBundleSliceBytes`): each build's lease, from its worst case down to
155
+ * the slice it walked, released as the build ends, however it ends.
156
+ */
155
157
  preBundleSliceBytes: number;
156
158
  /**
157
159
  * In-flight supervisor RPC payload bytes (Phase 2 A'.2).
@@ -198,23 +200,6 @@ export interface VfsHeapInputs {
198
200
  /** Current sum of in-flight write payloads (or 0 if none). */
199
201
  inFlightWriteBytes: number;
200
202
  }
201
- /**
202
- * Estimate pre-bundle slice bytes resident in the supervisor heap.
203
- *
204
- * Pre A'.2: the supervisor builds the slice in heap (up to
205
- * SLICE_CAP_BYTES = 28 MiB per concurrent slot) before passing to the
206
- * pre-bundle facet. With PRE_BUNDLE_CONCURRENCY = 1 the cap is 28 MiB.
207
- *
208
- * Diag counters track pre-bundle attempts/completions but not
209
- * in-flight slice bytes specifically. Until A'.2 streams the slice,
210
- * we treat the slice as PRESENT in supervisor heap iff the pre-bundle
211
- * phase is active AND a slot is in flight (no completion yet for the
212
- * current attempted count).
213
- *
214
- * After A'.2 lands the slice flows via ReadableStream-over-RPC and
215
- * supervisor never holds the bytes — this contribution drops to 0.
216
- */
217
- export declare function estimatePreBundleSliceBytes(c: DiagCounters): number;
218
203
  /**
219
204
  * Build a heap estimate from runtime counters + VFS inputs.
220
205
  *
@@ -1 +1 @@
1
- {"version":3,"file":"heap-estimate.d.ts","sourceRoot":"","sources":["../src/heap-estimate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AAOH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAEL,KAAK,+BAA+B,EACrC,MAAM,wBAAwB,CAAC;AAEhC;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,sFAM1B,CAAC;AAEX;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC5B,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,+DAA+D;IAC/D,MAAM,E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C;IAC5B;;;;;;;;;;;;OAYG;IACH,qBAAqB,EAAE,MAAM,CAAC;IAC9B;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;;;OAKG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,4BAA4B,EAAE,MAAM,CAAC;CACtC;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,sEAAsE;IACtE,aAAa,EAAE,MAAM,CAAC;IACtB,8DAA8D;IAC9D,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAyBD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,CAAC,EAAE,YAAY,EACf,GAAG,EAAE,aAAa,GACjB,YAAY,CAiDd"}
@@ -57,7 +57,7 @@
57
57
  * The actual count of evictions Nimbus has observed lives in the C'.2
58
58
  * recovery_event ring, separate from this module.
59
59
  */
60
- import { PRE_BUNDLE_CONCURRENCY, PRE_BUNDLE_SLICE_CAP_BYTES, SUPERVISOR_HEAP_CEILING_BYTES, } from './limits.js';
60
+ import { SUPERVISOR_HEAP_CEILING_BYTES } from './limits.js';
61
61
  import { readSupervisorAllocationBudget, } from './heavy-alloc-coord.js';
62
62
  /**
63
63
  * Five labelled workerd eviction reasons. Surfaced as a constant
@@ -110,32 +110,6 @@ export const HEAP_BLIND_SPOTS = [];
110
110
  * would lower this further.
111
111
  */
112
112
  const SUPERVISOR_BASELINE_BYTES = 9 * 1024 * 1024;
113
- /**
114
- * Estimate pre-bundle slice bytes resident in the supervisor heap.
115
- *
116
- * Pre A'.2: the supervisor builds the slice in heap (up to
117
- * SLICE_CAP_BYTES = 28 MiB per concurrent slot) before passing to the
118
- * pre-bundle facet. With PRE_BUNDLE_CONCURRENCY = 1 the cap is 28 MiB.
119
- *
120
- * Diag counters track pre-bundle attempts/completions but not
121
- * in-flight slice bytes specifically. Until A'.2 streams the slice,
122
- * we treat the slice as PRESENT in supervisor heap iff the pre-bundle
123
- * phase is active AND a slot is in flight (no completion yet for the
124
- * current attempted count).
125
- *
126
- * After A'.2 lands the slice flows via ReadableStream-over-RPC and
127
- * supervisor never holds the bytes — this contribution drops to 0.
128
- */
129
- export function estimatePreBundleSliceBytes(c) {
130
- // Conservative: if the most recent batch attempted >0 specs and the
131
- // batch hasn't fully completed, assume one slice's worth of bytes
132
- // are in flight.
133
- const f = c.preBundleFacet;
134
- const inFlight = f.attempted - f.bundlesCompleted - f.errors - f.skipped;
135
- if (inFlight <= 0)
136
- return 0;
137
- return Math.min(inFlight, PRE_BUNDLE_CONCURRENCY) * PRE_BUNDLE_SLICE_CAP_BYTES;
138
- }
139
113
  /**
140
114
  * Build a heap estimate from runtime counters + VFS inputs.
141
115
  *
@@ -144,19 +118,18 @@ export function estimatePreBundleSliceBytes(c) {
144
118
  */
145
119
  export function estimateSupervisorHeap(c, vfs) {
146
120
  const allocationBudget = readSupervisorAllocationBudget();
147
- const preBundleSliceBytes = estimatePreBundleSliceBytes(c);
148
- // The prefetch build holds a lease, so its bytes are already inside
149
- // allocationBudget.current — naming it here moves it out of the
150
- // unattributed remainder rather than adding to the total twice.
121
+ // The prefetch build and the pre-bundle hold leases, so their bytes are
122
+ // already inside allocationBudget.current — naming them here moves them out
123
+ // of the unattributed remainder rather than adding to the total twice.
151
124
  const transientAttributedBytes = vfs.inFlightWriteBytes +
152
- preBundleSliceBytes +
125
+ c.preBundleSliceBytes +
153
126
  c.inFlightRpcPayloadBytes +
154
127
  c.prefetchBundleBytes;
155
128
  const breakdown = {
156
129
  supervisorBaselineBytes: SUPERVISOR_BASELINE_BYTES,
157
130
  vfsLruBytes: vfs.cacheHotBytes,
158
131
  vfsInFlightBytes: vfs.inFlightWriteBytes,
159
- preBundleSliceBytes,
132
+ preBundleSliceBytes: c.preBundleSliceBytes,
160
133
  streamingBuffersBytes: c.inFlightRpcPayloadBytes,
161
134
  prefetchBundleBytes: c.prefetchBundleBytes,
162
135
  prefetchCacheBytes: c.prefetchCacheBytes,
@@ -13,6 +13,40 @@ export interface SupervisorAllocationBudgetStats {
13
13
  readonly current: number;
14
14
  readonly peak: number;
15
15
  readonly queued: number;
16
+ readonly holders: SupervisorAllocationHolder[];
17
+ readonly waiting: SupervisorAllocationHolder[];
18
+ }
19
+ export type AllocationAttribution = 'prefetchBundleBytes' | 'preBundleSliceBytes';
20
+ export interface SupervisorAllocationOwner {
21
+ owner: string;
22
+ pid?: number;
23
+ session?: string;
24
+ attribution?: AllocationAttribution;
25
+ }
26
+ export interface SupervisorAllocationHolder {
27
+ owner: string;
28
+ bytes: number;
29
+ ageMs: number;
30
+ pid?: number;
31
+ session?: string;
32
+ }
33
+ export interface SupervisorAllocationLease extends ResizableCreditLease {
34
+ attribute(attribution: AllocationAttribution): void;
35
+ }
36
+ /**
37
+ * A facet's load the budget did not admit within its bound
38
+ * (SUPERVISOR_LOAD_WAIT_MS): nothing of it was read, and the facet is not
39
+ * started. Resource temporarily unavailable, as the ledger's refusal of a
40
+ * wait no release can satisfy is.
41
+ */
42
+ export declare class SupervisorLoadWaitError extends Error {
43
+ readonly load: string;
44
+ readonly bytes: number;
45
+ readonly waitedMs: number;
46
+ readonly held: SupervisorAllocationBudgetStats;
47
+ readonly code = "EAGAIN";
48
+ readonly errno = -11;
49
+ constructor(load: string, bytes: number, waitedMs: number, held: SupervisorAllocationBudgetStats);
16
50
  }
17
51
  interface AllocationBudgetLifecycle {
18
52
  onActive?: () => void;
@@ -33,14 +67,17 @@ export declare class SupervisorAllocationBudget {
33
67
  * cache it is filling.
34
68
  */
35
69
  private lifecycleHolders;
70
+ private readonly holders;
71
+ private readonly waiting;
36
72
  constructor(capacity: number, lifecycle?: AllocationBudgetLifecycle, reserve?: WeightedCreditPoolOptions);
37
73
  get stats(): SupervisorAllocationBudgetStats;
74
+ get attributed(): Record<AllocationAttribution, number>;
38
75
  /**
39
76
  * Reserve bytes and, while held, mark the budget active so observers can
40
77
  * free heap headroom. For owners whose payload is what the headroom is for:
41
78
  * installs, clones, pre-bundles, boot payloads, streamed writes.
42
79
  */
43
- acquire(bytes: number, signal?: AbortSignal): Promise<ResizableCreditLease>;
80
+ acquire(bytes: number, signal?: AbortSignal, owner?: SupervisorAllocationOwner): Promise<SupervisorAllocationLease>;
44
81
  /**
45
82
  * Reserve bytes WITHOUT driving the cache lifecycle, for owners that are
46
83
  * filling the disposable cache rather than competing with it. Shrinking a
@@ -50,9 +87,45 @@ export declare class SupervisorAllocationBudget {
50
87
  * never warming. The byte credit is still taken — back-pressure is what
51
88
  * stops a large read overlapping a large write.
52
89
  */
53
- acquireWithoutLifecycle(bytes: number, signal?: AbortSignal): Promise<ResizableCreditLease>;
54
- /** Reserve bytes now or not at all, driving the lifecycle as acquire does. */
55
- tryAcquire(bytes: number): ResizableCreditLease | null;
90
+ acquireWithoutLifecycle(bytes: number, signal?: AbortSignal, owner?: SupervisorAllocationOwner): Promise<SupervisorAllocationLease>;
91
+ /**
92
+ * Reserve what a facet's load holds while the loader takes its module map:
93
+ * `bytes`, or for a load larger than the whole budget the whole budget, so
94
+ * that it holds it alone and every owner after it waits. Granted in the
95
+ * budget's one FIFO order, so no owner queued after a load overtakes it,
96
+ * however small, and refused with SupervisorLoadWaitError when not granted
97
+ * within `waitMs`. Like a copy it holds bytes the session already has, for
98
+ * as long as the load takes, so the disposable VFS cache is not shrunk.
99
+ */
100
+ acquireLoad(load: string, bytes: number, options: {
101
+ waitMs: number;
102
+ signal?: AbortSignal;
103
+ owner?: SupervisorAllocationOwner;
104
+ }): Promise<SupervisorAllocationLease>;
105
+ /** Reclaimers of parked launches' retained credit, oldest registered first (reclaimable). */
106
+ private readonly reclaimers;
107
+ /**
108
+ * Register `reclaim`, which gives a parked launch's retained credit back
109
+ * before it returns (its map dropped, its lease released, the launch sent
110
+ * back to prepare), for running work to call when nothing else frees what
111
+ * it needs (acquireRunning). Unregistered just before it is called; the
112
+ * returned function unregisters it.
113
+ */
114
+ reclaimable(reclaim: () => void): () => void;
115
+ /**
116
+ * Running work's credit, the lock order's one exception
117
+ * (acquireSupervisorLoad): granted at once where it fits, ahead of every
118
+ * queued ask; else, queued ahead of them all, it reclaims parked launches'
119
+ * retained credit, the oldest first, until it is granted; else it waits
120
+ * only for credit other running work holds.
121
+ */
122
+ acquireRunning(bytes: number, signal?: AbortSignal, drivesLifecycle?: boolean, owner?: SupervisorAllocationOwner): Promise<SupervisorAllocationLease>;
123
+ /** Reclaim parked launches' credit, the oldest parked first, while a running ask waits: what a reclaim frees goes to running asks first. */
124
+ private reclaimForRunning;
125
+ /** acquireRunning's credit now, ahead of every queued ask, without reclaiming, or null. */
126
+ tryAcquireRunning(bytes: number, owner?: SupervisorAllocationOwner): SupervisorAllocationLease | null;
127
+ /** Reserve bytes now or not at all, driving the lifecycle as acquire does (or not, `drivesLifecycle` false). */
128
+ tryAcquire(bytes: number, drivesLifecycle?: boolean, owner?: SupervisorAllocationOwner): SupervisorAllocationLease | null;
56
129
  private _acquire;
57
130
  private wrap;
58
131
  }
@@ -79,20 +152,67 @@ export declare function registerAllocObserver(o: AllocObserver): () => void;
79
152
  /**
80
153
  * Reserve an exact number of supervisor-resident bytes.
81
154
  */
82
- export declare function acquireSupervisorAllocation(bytes: number, signal?: AbortSignal): Promise<ResizableCreditLease>;
155
+ export declare function acquireSupervisorAllocation(bytes: number, signal?: AbortSignal, owner?: SupervisorAllocationOwner): Promise<SupervisorAllocationLease>;
83
156
  /** Reserve bytes now if they can be granted without waiting, else null. */
84
- export declare function tryAcquireSupervisorAllocation(bytes: number): ResizableCreditLease | null;
157
+ export declare function tryAcquireSupervisorAllocation(bytes: number, owner?: SupervisorAllocationOwner): SupervisorAllocationLease | null;
158
+ /**
159
+ * Reserve bytes for a running process's filesystem READ (its read RPCs):
160
+ * running work (acquireRunning), which does not shrink the disposable VFS
161
+ * cache, which reads are there to fill.
162
+ */
163
+ export declare function acquireSupervisorReadAllocation(bytes: number, signal?: AbortSignal, owner?: SupervisorAllocationOwner): Promise<SupervisorAllocationLease>;
164
+ /**
165
+ * Reserve bytes for a short-lived copy of what the session already holds
166
+ * (a launch's module map made from a staged state), now or not at all, or
167
+ * by waiting (`signal`): the byte credit bounds how many such copies are
168
+ * live at once, but the disposable VFS cache is not shrunk for one, as it
169
+ * is not for a read. Shrinking it for every launch of a program already
170
+ * built cost each one its cache, and the copy is no install.
171
+ */
172
+ export declare function tryAcquireSupervisorCopyAllocation(bytes: number, owner?: SupervisorAllocationOwner): SupervisorAllocationLease | null;
173
+ /** {@link tryAcquireSupervisorCopyAllocation}, waiting for room. */
174
+ export declare function acquireSupervisorCopyAllocation(bytes: number, signal?: AbortSignal, owner?: SupervisorAllocationOwner): Promise<SupervisorAllocationLease>;
175
+ /**
176
+ * `bytes` of this isolate for a facet's load (the wasm images read for it;
177
+ * `name` says whose), admitted on the supervisor budget
178
+ * (SupervisorAllocationBudget.acquireLoad): FIFO, the whole budget for one
179
+ * larger than it, refused by name after SUPERVISOR_LOAD_WAIT_MS. `signal`
180
+ * ends the wait.
181
+ *
182
+ * Lock order: supervisor credit, then a Dynamic Worker. Nothing waits for
183
+ * credit (SupervisorAllocationBudget acquire or acquireLoad, or growing a
184
+ * lease) while it holds a worker's fetch hold (beginLoaderFetch,
185
+ * claimAdmission, readmitRefused). While it holds one, it may give credit
186
+ * back, shrink it, or take credit without waiting (tryAcquire). Running work
187
+ * is the one exception, and comes first. Credit a running process needs (its
188
+ * write waves and the session RPCs it makes, through acquireRunning)
189
+ * overtakes every queued ask. When nothing else frees it, it reclaims parked
190
+ * launches' retained maps, oldest parked first: each is dropped, its launch
191
+ * is sent back to prepare, and the map is rebuilt at that launch's turn.
192
+ * Otherwise it waits only for credit other running work holds. A facet's load
193
+ * is not running work.
194
+ */
195
+ export declare function acquireSupervisorLoad(name: string, bytes: number, signal?: AbortSignal, owner?: SupervisorAllocationOwner): Promise<SupervisorAllocationLease>;
196
+ /** acquireSupervisorLoad's credit now, without waiting, or null: all a load may take while it holds a worker. */
197
+ export declare function tryAcquireSupervisorLoad(bytes: number, owner?: SupervisorAllocationOwner): SupervisorAllocationLease | null;
85
198
  /**
86
- * Reserve bytes for a filesystem READ. Takes the same byte credit as any
87
- * other owner but does not shrink the disposable VFS cache, which reads are
88
- * there to fill.
199
+ * Running work's credit (SupervisorAllocationBudget.acquireRunning): what a
200
+ * running process needs to go on (its write waves, the session RPCs it
201
+ * makes), never held up by a launch that is not running.
89
202
  */
90
- export declare function acquireSupervisorReadAllocation(bytes: number, signal?: AbortSignal): Promise<ResizableCreditLease>;
203
+ export declare function acquireSupervisorRunningAllocation(bytes: number, signal?: AbortSignal, owner?: SupervisorAllocationOwner): Promise<SupervisorAllocationLease>;
204
+ /** acquireSupervisorRunningAllocation's credit now, ahead of every queued ask, without reclaiming, or null. */
205
+ export declare function tryAcquireSupervisorRunningAllocation(bytes: number, owner?: SupervisorAllocationOwner): SupervisorAllocationLease | null;
206
+ /** Register a parked launch's reclaimer on the isolate's budget (SupervisorAllocationBudget.reclaimable). */
207
+ export declare function reclaimableSupervisorAllocation(reclaim: () => void): () => void;
208
+ /** Run `load` holding acquireSupervisorLoad's credit for `bytes`, given back as it settles; for a load no worker hold waits on. */
209
+ export declare function withSupervisorLoadAllocation<T>(name: string, bytes: number, signal: AbortSignal | undefined, load: () => Promise<T>, owner?: SupervisorAllocationOwner): Promise<T>;
91
210
  /**
92
211
  * Reserve the full budget for an allocation whose retained size is not known
93
212
  * accurately enough to overlap safely with other heavy work.
94
213
  */
95
- export declare function acquireHeavyAlloc(signal?: AbortSignal): Promise<() => void>;
214
+ export declare function acquireHeavyAlloc(signal?: AbortSignal, owner?: SupervisorAllocationOwner): Promise<() => void>;
96
215
  export declare function readSupervisorAllocationBudget(): SupervisorAllocationBudgetStats;
216
+ export declare function readSupervisorAllocationAttribution(): Record<AllocationAttribution, number>;
97
217
  export {};
98
218
  //# sourceMappingURL=heavy-alloc-coord.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"heavy-alloc-coord.d.ts","sourceRoot":"","sources":["../src/heavy-alloc-coord.ts"],"names":[],"mappings":"AAAA;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