@ai-ecoverse/slicc-kernel 1.124.10 → 1.124.12

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.
@@ -1120,7 +1120,7 @@ function createSyncSabTransport(sab, port2, deps = {}) {
1120
1120
  return;
1121
1121
  }
1122
1122
  const remaining = deadline - now();
1123
- if (remaining <= 0) throw syncError("ETIMEDOUT", label);
1123
+ if (remaining <= 0) throw syncError("EIO", label);
1124
1124
  wait2(header, SAB_I_PUB, published, remaining);
1125
1125
  }
1126
1126
  }
@@ -1129,7 +1129,6 @@ function createSyncSabTransport(sab, port2, deps = {}) {
1129
1129
  if (deps.memory) publishMemory(sab, deps.memory());
1130
1130
  const id = ++seq;
1131
1131
  calls += Number(!PATH_OPS.has(req.op));
1132
- const deadline = now() + timeoutMs2;
1133
1132
  let out = null;
1134
1133
  let status2 = 0;
1135
1134
  let offset = 0;
@@ -1144,7 +1143,7 @@ function createSyncSabTransport(sab, port2, deps = {}) {
1144
1143
  } catch {
1145
1144
  throw syncError("EIO", label);
1146
1145
  }
1147
- awaitReady(id, deadline, label);
1146
+ awaitReady(id, now() + timeoutMs2, label);
1148
1147
  const total = loadU53(header, SAB_I_TOTAL, SAB_I_TOTAL_HI);
1149
1148
  const chunk = Atomics.load(header, SAB_I_CHUNK);
1150
1149
  const at = loadU53(header, SAB_I_OFFSET, SAB_I_OFFSET_HI);
@@ -1174,10 +1173,12 @@ function errnoError(code2, path) {
1174
1173
  function createSyncFsSabBridge(transport, opts = {}) {
1175
1174
  const timeoutMs2 = opts.timeoutMs ?? SYNC_FS_REQUEST_TIMEOUT_MS;
1176
1175
  let identity = {};
1176
+ let once = false;
1177
1177
  let last = null;
1178
1178
  function run(req, path, transfer) {
1179
1179
  last = null;
1180
- const result = transport.call(req, timeoutMs2, `sync-sab bridge, '${path}'`, transfer);
1180
+ const silence = READ_ONLY.has(req.op) ? timeoutMs2 : Number.POSITIVE_INFINITY;
1181
+ const result = transport.call(req, silence, `sync-sab bridge, '${path}'`, transfer);
1181
1182
  if (!result.ok) throw errnoError(result.errno, path);
1182
1183
  return result;
1183
1184
  }
@@ -1192,7 +1193,9 @@ function createSyncFsSabBridge(transport, opts = {}) {
1192
1193
  throw errnoError("EIO", path);
1193
1194
  }
1194
1195
  const changing = (req, path, transfer) => {
1195
- const r = run({ ...req, ...identity }, path, transfer);
1196
+ const ask = once ? { identity: true } : identity;
1197
+ once = false;
1198
+ const r = run({ ...req, ...ask }, path, transfer);
1196
1199
  if (r.ok && r.kind === "json") last = parseSyncFsStat(r.json);
1197
1200
  };
1198
1201
  const io = (id) => ({
@@ -1289,7 +1292,14 @@ function createSyncFsSabBridge(transport, opts = {}) {
1289
1292
  identify: () => {
1290
1293
  identity = { identity: true };
1291
1294
  },
1292
- identified: () => last,
1295
+ identifyNext: () => {
1296
+ once = true;
1297
+ last = null;
1298
+ },
1299
+ identified: () => {
1300
+ once = false;
1301
+ return last;
1302
+ },
1293
1303
  lutimes: (path, atimeMs, mtimeMs, now) => {
1294
1304
  run({ op: "lutimes", path, atimeMs, mtimeMs, ...now ? { now } : {} }, path);
1295
1305
  },
@@ -1330,7 +1340,7 @@ function createSyncFsSabBridge(transport, opts = {}) {
1330
1340
  statfs: (path = "/") => parseSyncFsUsage(json2({ op: "statfs", path }, path))
1331
1341
  };
1332
1342
  }
1333
- var PATH_OPS, calls, looks, SPIN_MS, SPIN_STRIDE, SPIN_STRIDES, SPIN_CORES, spinning, SPIN_CAP_MS;
1343
+ var PATH_OPS, READ_ONLY, calls, looks, SPIN_MS, SPIN_STRIDE, SPIN_STRIDES, SPIN_CORES, spinning, SPIN_CAP_MS;
1334
1344
  var init_sync_sab_bridge = __esm({
1335
1345
  "src/realm/sync-sab-bridge.ts"() {
1336
1346
  "use strict";
@@ -1339,6 +1349,19 @@ var init_sync_sab_bridge = __esm({
1339
1349
  init_sync_fs_wire();
1340
1350
  init_sync_sab_wire();
1341
1351
  PATH_OPS = new Set(SYNC_FS_OPS);
1352
+ READ_ONLY = /* @__PURE__ */ new Set([
1353
+ "read",
1354
+ "pread",
1355
+ "exists",
1356
+ "stat",
1357
+ "lstat",
1358
+ "readdir",
1359
+ "readdir-stat",
1360
+ "readlink",
1361
+ "statfs",
1362
+ "kept",
1363
+ "access"
1364
+ ]);
1342
1365
  calls = 0;
1343
1366
  looks = 0;
1344
1367
  SPIN_MS = 0.06;
@@ -2624,7 +2647,7 @@ var KERNEL_VERSION, OS_RELEASE;
2624
2647
  var init_version = __esm({
2625
2648
  "src/version.ts"() {
2626
2649
  "use strict";
2627
- KERNEL_VERSION = true ? "1.124.10" : "0.0.0-dev";
2650
+ KERNEL_VERSION = true ? "1.124.12" : "0.0.0-dev";
2628
2651
  OS_RELEASE = "6.0.0-slicc";
2629
2652
  }
2630
2653
  });
@@ -6650,6 +6673,17 @@ function cachingBridge(bridge, now = () => performance.now(), shared) {
6650
6673
  else cache.mutated([]);
6651
6674
  }
6652
6675
  };
6676
+ const relabeling = (p, op) => {
6677
+ if (exact || !bridge.identifyNext) return rewriting(p, op);
6678
+ bridge.identifyNext();
6679
+ try {
6680
+ return op();
6681
+ } finally {
6682
+ const st = bridge.identified?.() ?? null;
6683
+ if (st) cache.mutated([p], st.ino);
6684
+ else cache.mutated([]);
6685
+ }
6686
+ };
6653
6687
  const rewriting = (p, op, ...also) => {
6654
6688
  if (exact) return identified(p, op, also);
6655
6689
  const ino = cache.inoOf(p, () => bridge.stat(p));
@@ -6706,8 +6740,8 @@ function cachingBridge(bridge, now = () => performance.now(), shared) {
6706
6740
  unlink: (p) => mutating(() => bridge.unlink(p)),
6707
6741
  rmdir: (p) => mutating(() => bridge.rmdir(p)),
6708
6742
  symlink: (target, link) => mutating(() => bridge.symlink(target, link), ...entry(link)),
6709
- chmod: (p, mode) => rewriting(p, () => bridge.chmod(p, mode)),
6710
- utimes: (p, a, m, now2) => rewriting(p, () => bridge.utimes(p, a, m, now2)),
6743
+ chmod: (p, mode) => relabeling(p, () => bridge.chmod(p, mode)),
6744
+ utimes: (p, a, m, now2) => relabeling(p, () => bridge.utimes(p, a, m, now2)),
6711
6745
  lutimes: (p, a, m, now2) => mutating(() => bridge.lutimes(p, a, m, now2)),
6712
6746
  ...bridge.hold ? { hold: bridge.hold.bind(bridge) } : {},
6713
6747
  ...bridge.access ? { access: bridge.access.bind(bridge) } : {},
@@ -6721,7 +6755,7 @@ function cachingBridge(bridge, now = () => performance.now(), shared) {
6721
6755
  mkfifo: (p, mode) => mutating(() => bridge.mkfifo?.(p, mode), ...entry(p))
6722
6756
  } : {},
6723
6757
  ...chown ? {
6724
- chown: (p, ...rest2) => rewriting(p, () => chown.call(bridge, p, ...rest2))
6758
+ chown: (p, ...rest2) => relabeling(p, () => chown.call(bridge, p, ...rest2))
6725
6759
  } : {},
6726
6760
  ...bridge.pread && bridge.pwrite && bridge.truncate ? {
6727
6761
  pread: bridge.pread.bind(bridge),