@ai-ecoverse/slicc-kernel 1.124.2 → 1.124.3

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.
@@ -5434,7 +5434,7 @@ var KERNEL_VERSION, OS_RELEASE;
5434
5434
  var init_version = __esm({
5435
5435
  "src/version.ts"() {
5436
5436
  "use strict";
5437
- KERNEL_VERSION = true ? "1.124.2" : "0.0.0-dev";
5437
+ KERNEL_VERSION = true ? "1.124.3" : "0.0.0-dev";
5438
5438
  OS_RELEASE = "6.0.0-slicc";
5439
5439
  }
5440
5440
  });
@@ -7303,6 +7303,12 @@ var init_changes = __esm({
7303
7303
  function syncCallCount() {
7304
7304
  return calls;
7305
7305
  }
7306
+ function lookedOutside() {
7307
+ looks++;
7308
+ }
7309
+ function syncEpoch() {
7310
+ return calls + looks;
7311
+ }
7306
7312
  function createSyncSabTransport(sab, port3, deps = {}) {
7307
7313
  const views = sabViews(sab);
7308
7314
  const { header, window } = views;
@@ -7541,7 +7547,7 @@ function createSyncFsSabBridge(transport, opts = {}) {
7541
7547
  statfs: (path = "/") => parseSyncFsUsage(json2({ op: "statfs", path }, path))
7542
7548
  };
7543
7549
  }
7544
- var PATH_OPS, calls, SPIN_MS, SPIN_STRIDE, SPIN_STRIDES, SPIN_CORES, spinning, SPIN_CAP_MS;
7550
+ var PATH_OPS, calls, looks, SPIN_MS, SPIN_STRIDE, SPIN_STRIDES, SPIN_CORES, spinning, SPIN_CAP_MS;
7545
7551
  var init_sync_sab_bridge = __esm({
7546
7552
  "src/realm/sync-sab-bridge.ts"() {
7547
7553
  "use strict";
@@ -7551,6 +7557,7 @@ var init_sync_sab_bridge = __esm({
7551
7557
  init_sync_sab_wire();
7552
7558
  PATH_OPS = new Set(SYNC_FS_OPS);
7553
7559
  calls = 0;
7560
+ looks = 0;
7554
7561
  SPIN_MS = 0.06;
7555
7562
  SPIN_STRIDE = 128;
7556
7563
  SPIN_STRIDES = 256;
@@ -7706,6 +7713,10 @@ function linkedStates(bridgeOf) {
7706
7713
  const holder = (node) => opens.get(node.live) ?? node;
7707
7714
  return { opening: opening2, sharedWith, know, idOf: idOf4, holder };
7708
7715
  }
7716
+ function freshState(stat) {
7717
+ const base = { len: 0, loaded: false, dirty: false, openCount: 0 };
7718
+ return stat ? { stat, statAt: syncCallCount(), seenAt: syncEpoch(), ...base } : base;
7719
+ }
7709
7720
  function createHelpers(Fs, ops) {
7710
7721
  const bridgeOf = (node) => node.mount.opts.bridge;
7711
7722
  const fileIo = (node) => pinnedIo2(bridgeOf(node), node.live.handle);
@@ -7745,10 +7756,6 @@ function createHelpers(Fs, ops) {
7745
7756
  if (err.errno !== wasiErrno("ENOSYS")) throw err;
7746
7757
  }
7747
7758
  }
7748
- function freshState(stat) {
7749
- const statAt = syncCallCount();
7750
- return { ...stat ? { stat, statAt } : {}, len: 0, loaded: false, dirty: false, openCount: 0 };
7751
- }
7752
7759
  function makeNode(parent, name2, st) {
7753
7760
  const node = Fs.createNode(parent, name2, modeFromStat(st, exactIn(parent)), 0);
7754
7761
  node.node_ops = ops.node;
@@ -7763,7 +7770,7 @@ function createHelpers(Fs, ops) {
7763
7770
  }
7764
7771
  if (!cachedStat(node.live, Fs.isDir(node.mode), bridgeOf(node).changes)) {
7765
7772
  const st = call2(() => bridgeOf(node).lstat(liveNodePath(linked.holder(node))));
7766
- Object.assign(node.live, { stat: st, statAt: syncCallCount() });
7773
+ Object.assign(node.live, { stat: st, statAt: syncCallCount(), seenAt: syncEpoch() });
7767
7774
  node.mode = modeFromStat(st, exactIn(node));
7768
7775
  }
7769
7776
  return node.live.stat;
@@ -8488,7 +8495,7 @@ function guardKeptNodes(Fs, handled) {
8488
8495
  }
8489
8496
  function outdated(node, view, before) {
8490
8497
  const s = node.live;
8491
- if (view.foreign() && s.openCount === 0 && !s.dirty && node !== node.mount.root && !node.mounted)
8498
+ if (view.foreign() && s.seenAt !== syncEpoch() && s.openCount === 0 && !s.dirty && node !== node.mount.root && !node.mounted)
8492
8499
  return true;
8493
8500
  if (s.named === void 0) {
8494
8501
  s.named = before;
@@ -10174,6 +10181,8 @@ var init_procfs = __esm({
10174
10181
  slicc_wasm_memories: (listing) => `${listing.wasm?.live ?? 0} ${listing.wasm?.ceiling ?? 0} ${listing.wasm?.source ?? "none"}
10175
10182
  `,
10176
10183
  slicc_shared_root: (listing) => `${listing.peers ?? 0}
10184
+ `,
10185
+ slicc_fs_calls: (listing) => `${listing.fsCalls ?? 0}
10177
10186
  `
10178
10187
  }
10179
10188
  };
@@ -14049,7 +14058,7 @@ async function runWasmProcess(init, port3, deps = {}) {
14049
14058
  ppid: () => identify(transport, init).ppid,
14050
14059
  poll: () => void signals.interrupt()
14051
14060
  });
14052
- return WebAssembly.instantiate(init.program.module, imports);
14061
+ return WebAssembly.instantiate(init.program.module, watchOutside(imports));
14053
14062
  }).then((instance) => {
14054
14063
  memory = wasmMemory(instance, imports);
14055
14064
  port3.postMessage({ type: WASM_PROCESS_READY });
@@ -14218,7 +14227,20 @@ function runMain(running, init) {
14218
14227
  return status2;
14219
14228
  }
14220
14229
  }
14221
- var FS_OPS, O_RDONLY2, O_WRONLY6, O_RDWR6, O_ACCMODE5, O_DIRECTORY2, accessMode, PLACED, GLUE_TRAILER, evaluateGlue, EVAL_BLOCKED;
14230
+ function watchOutside(imports) {
14231
+ for (const space of Object.values(imports)) {
14232
+ for (const [name2, value2] of Object.entries(space)) {
14233
+ if (!OUTSIDE.has(name2) || typeof value2 !== "function") continue;
14234
+ const look = value2;
14235
+ space[name2] = (...args) => {
14236
+ lookedOutside();
14237
+ return look(...args);
14238
+ };
14239
+ }
14240
+ }
14241
+ return imports;
14242
+ }
14243
+ var FS_OPS, O_RDONLY2, O_WRONLY6, O_RDWR6, O_ACCMODE5, O_DIRECTORY2, accessMode, PLACED, GLUE_TRAILER, evaluateGlue, EVAL_BLOCKED, OUTSIDE;
14222
14244
  var init_process_runtime = __esm({
14223
14245
  "src/process/process-runtime.ts"() {
14224
14246
  "use strict";
@@ -14325,6 +14347,13 @@ var init_process_runtime = __esm({
14325
14347
  run(module);
14326
14348
  };
14327
14349
  EVAL_BLOCKED = "the wasm realm evaluates the program's Emscripten glue, and this page's CSP forbids eval (no 'unsafe-eval')";
14350
+ OUTSIDE = /* @__PURE__ */ new Set([
14351
+ "clock_time_get",
14352
+ "emscripten_date_now",
14353
+ "emscripten_get_now",
14354
+ "random_get",
14355
+ "getentropy"
14356
+ ]);
14328
14357
  }
14329
14358
  });
14330
14359