@ai-ecoverse/slicc-kernel 1.120.1 → 1.120.2

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.
@@ -1032,7 +1032,7 @@ function normal(path) {
1032
1032
  }
1033
1033
  return `/${parts.join("/")}`;
1034
1034
  }
1035
- var GEN, RING, RING_SIZE, SLOT, DIRTY, CHANGES_BYTES, ChangeView;
1035
+ var GEN, RING, RING_SIZE, SLOT, DIRTY, FOREIGN, CHANGES_BYTES, ChangeView;
1036
1036
  var init_changes = __esm({
1037
1037
  "src/fs/changes.ts"() {
1038
1038
  "use strict";
@@ -1041,7 +1041,8 @@ var init_changes = __esm({
1041
1041
  RING_SIZE = 4096;
1042
1042
  SLOT = 2;
1043
1043
  DIRTY = RING + RING_SIZE * SLOT;
1044
- CHANGES_BYTES = (DIRTY + 1) * 4;
1044
+ FOREIGN = DIRTY + 1;
1045
+ CHANGES_BYTES = (FOREIGN + 1) * 4;
1045
1046
  ChangeView = class {
1046
1047
  view;
1047
1048
  constructor(sab) {
@@ -1053,6 +1054,9 @@ var init_changes = __esm({
1053
1054
  clean() {
1054
1055
  return this.view.length > DIRTY && Atomics.load(this.view, DIRTY) === 0;
1055
1056
  }
1057
+ foreign() {
1058
+ return this.view.length > FOREIGN && Atomics.load(this.view, FOREIGN) === 1;
1059
+ }
1056
1060
  changedSince(seen, path) {
1057
1061
  const now = Atomics.load(this.view, GEN);
1058
1062
  const distance = now - seen >>> 0;
@@ -1413,7 +1417,8 @@ function refusal(err) {
1413
1417
  const code2 = err?.code;
1414
1418
  return code2 === "EACCES" || code2 === "EPERM";
1415
1419
  }
1416
- function cachedStat(s, dir) {
1420
+ function cachedStat(s, dir, view) {
1421
+ if (view?.foreign() && !s.dirty) return false;
1417
1422
  return s.stat !== void 0 && (!dir || s.statAt === syncCallCount());
1418
1423
  }
1419
1424
  function searchParents(Fs, node, bridge, call2) {
@@ -1534,7 +1539,7 @@ function createHelpers(Fs, ops) {
1534
1539
  const size = node.live.ranged?.size() ?? node.live.len;
1535
1540
  return { ...node.live.stat, size };
1536
1541
  }
1537
- if (!cachedStat(node.live, Fs.isDir(node.mode))) {
1542
+ if (!cachedStat(node.live, Fs.isDir(node.mode), bridgeOf(node).changes)) {
1538
1543
  const st = call2(() => bridgeOf(node).lstat(liveNodePath(linked.holder(node))));
1539
1544
  Object.assign(node.live, { stat: st, statAt: syncCallCount() });
1540
1545
  node.mode = modeFromStat(st, exactIn(node));
@@ -1698,7 +1703,7 @@ function createNodeOps(h) {
1698
1703
  const owned = bridgeOf(node).owners === true;
1699
1704
  if (owned && Fs.isLink(node.mode) && statOf(node).uid === void 0)
1700
1705
  node.live.stat = void 0;
1701
- const cached = owned && cachedStat(node.live, Fs.isDir(node.mode));
1706
+ const cached = owned && cachedStat(node.live, Fs.isDir(node.mode), bridgeOf(node).changes);
1702
1707
  const st = statOf(node);
1703
1708
  if (cached) searchParents(Fs, node, bridgeOf(node), call2);
1704
1709
  const s = node.live;
@@ -2260,6 +2265,8 @@ function guardKeptNodes(Fs, handled) {
2260
2265
  }
2261
2266
  function outdated(node, view, before) {
2262
2267
  const s = node.live;
2268
+ if (view.foreign() && s.openCount === 0 && !s.dirty && node !== node.mount.root && !node.mounted)
2269
+ return true;
2263
2270
  if (s.named === void 0) {
2264
2271
  s.named = before;
2265
2272
  return false;
@@ -2546,7 +2553,7 @@ var KERNEL_VERSION, OS_RELEASE;
2546
2553
  var init_version = __esm({
2547
2554
  "src/version.ts"() {
2548
2555
  "use strict";
2549
- KERNEL_VERSION = true ? "1.120.1" : "0.0.0-dev";
2556
+ KERNEL_VERSION = true ? "1.120.2" : "0.0.0-dev";
2550
2557
  OS_RELEASE = "6.0.0-slicc";
2551
2558
  }
2552
2559
  });
@@ -6416,7 +6423,7 @@ function cachingBridge(bridge, now = () => performance.now(), shared) {
6416
6423
  return void 0;
6417
6424
  };
6418
6425
  const cached = (map, path, get) => {
6419
- if (blind) return get();
6426
+ if (blind || view?.foreign()) return get();
6420
6427
  cache.fresh();
6421
6428
  let hit = map.get(path);
6422
6429
  if (hit === void 0 || "until" in hit && !live(hit, path)) {