@ai-ecoverse/slicc-kernel 1.124.1 → 1.124.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.
- package/README.md +5 -2
- package/dist/kernel-worker.js +45 -10
- package/dist/kernel-worker.js.map +2 -2
- package/dist/node-process-worker.js +4 -2
- package/dist/node-process-worker.js.map +2 -2
- package/dist/node.js +45 -10
- package/dist/node.js.map +2 -2
- package/dist/process-worker.js +4 -2
- package/dist/process-worker.js.map +2 -2
- package/dist/types/kernel/proc-info.d.ts +2 -0
- package/dist/types/kernel/wasm-memories.d.ts +8 -2
- package/package.json +2 -2
package/dist/node.js
CHANGED
|
@@ -6944,7 +6944,7 @@ function satisfies(version, range2) {
|
|
|
6944
6944
|
}
|
|
6945
6945
|
|
|
6946
6946
|
// src/version.ts
|
|
6947
|
-
var KERNEL_VERSION = true ? "1.124.
|
|
6947
|
+
var KERNEL_VERSION = true ? "1.124.2" : "0.0.0-dev";
|
|
6948
6948
|
var OS_RELEASE = "6.0.0-slicc";
|
|
6949
6949
|
function procVersion() {
|
|
6950
6950
|
return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
|
|
@@ -12816,7 +12816,9 @@ var SYS_TREE = {
|
|
|
12816
12816
|
osrelease: `${OS_RELEASE}
|
|
12817
12817
|
`,
|
|
12818
12818
|
ostype: "Linux\n",
|
|
12819
|
-
slicc_wasm_memories: (listing) => `${listing.wasm?.live ?? 0} ${listing.wasm?.ceiling ?? 0}
|
|
12819
|
+
slicc_wasm_memories: (listing) => `${listing.wasm?.live ?? 0} ${listing.wasm?.ceiling ?? 0} ${listing.wasm?.source ?? "none"}
|
|
12820
|
+
`,
|
|
12821
|
+
slicc_shared_root: (listing) => `${listing.peers ?? 0}
|
|
12820
12822
|
`
|
|
12821
12823
|
}
|
|
12822
12824
|
};
|
|
@@ -21863,37 +21865,65 @@ var SettlingChildren = class {
|
|
|
21863
21865
|
|
|
21864
21866
|
// src/kernel/wasm-memories.ts
|
|
21865
21867
|
var DEFAULT_CEILING = 112;
|
|
21868
|
+
var CEILING_FLOOR = 16;
|
|
21866
21869
|
var IDLE_MS = 1e4;
|
|
21867
21870
|
var MARGIN = 16;
|
|
21871
|
+
var DECAY_MS = 6e4;
|
|
21872
|
+
var DECAY_STEP = 8;
|
|
21868
21873
|
var WasmMemories = class {
|
|
21869
21874
|
live = 0;
|
|
21870
|
-
|
|
21875
|
+
learned;
|
|
21871
21876
|
waiters = /* @__PURE__ */ new Set();
|
|
21877
|
+
base;
|
|
21872
21878
|
idleMs;
|
|
21873
|
-
|
|
21874
|
-
|
|
21879
|
+
now;
|
|
21880
|
+
constructor(ceiling, idleMs = IDLE_MS, now = Date.now) {
|
|
21881
|
+
this.base = ceiling;
|
|
21875
21882
|
this.idleMs = idleMs;
|
|
21883
|
+
this.now = now;
|
|
21884
|
+
}
|
|
21885
|
+
ceiling() {
|
|
21886
|
+
const learned = this.learned;
|
|
21887
|
+
if (!learned) return this.base;
|
|
21888
|
+
const steps = Math.floor((this.now() - learned.at) / DECAY_MS);
|
|
21889
|
+
const raised = learned.ceiling + steps * DECAY_STEP;
|
|
21890
|
+
if (raised < (this.base ?? DEFAULT_CEILING)) return raised;
|
|
21891
|
+
this.learned = void 0;
|
|
21892
|
+
return this.base;
|
|
21876
21893
|
}
|
|
21877
21894
|
count() {
|
|
21878
|
-
|
|
21895
|
+
const ceiling = this.ceiling();
|
|
21896
|
+
const source = this.learned ? "learned" : ceiling === void 0 ? "none" : "default";
|
|
21897
|
+
return { live: this.live, ceiling: ceiling ?? 0, source };
|
|
21879
21898
|
}
|
|
21880
21899
|
ended() {
|
|
21881
21900
|
this.live = Math.max(0, this.live - 1);
|
|
21882
21901
|
this.progress();
|
|
21883
21902
|
}
|
|
21884
21903
|
learn() {
|
|
21885
|
-
|
|
21904
|
+
const top = this.base ?? DEFAULT_CEILING;
|
|
21905
|
+
this.learned = {
|
|
21906
|
+
ceiling: Math.min(top, Math.max(CEILING_FLOOR, this.live - 1)),
|
|
21907
|
+
at: this.now()
|
|
21908
|
+
};
|
|
21886
21909
|
}
|
|
21887
21910
|
near() {
|
|
21888
|
-
|
|
21911
|
+
const ceiling = this.ceiling();
|
|
21912
|
+
return ceiling !== void 0 && this.live + MARGIN >= ceiling;
|
|
21889
21913
|
}
|
|
21890
21914
|
async admit() {
|
|
21891
|
-
|
|
21915
|
+
for (let ceiling = this.ceiling(); ceiling !== void 0 && this.live >= ceiling; ) {
|
|
21892
21916
|
if (!await this.changed()) throw new SpawnError("EAGAIN");
|
|
21917
|
+
ceiling = this.ceiling();
|
|
21893
21918
|
}
|
|
21894
21919
|
this.live += 1;
|
|
21895
21920
|
this.progress();
|
|
21896
21921
|
}
|
|
21922
|
+
async refused() {
|
|
21923
|
+
const ceiling = this.ceiling();
|
|
21924
|
+
if (ceiling === void 0 || this.live >= ceiling) return;
|
|
21925
|
+
if (!await this.changed()) throw new SpawnError("EAGAIN");
|
|
21926
|
+
}
|
|
21897
21927
|
progress() {
|
|
21898
21928
|
const waiters = [...this.waiters];
|
|
21899
21929
|
this.waiters.clear();
|
|
@@ -25222,6 +25252,10 @@ var Launcher = class {
|
|
|
25222
25252
|
return handle;
|
|
25223
25253
|
}
|
|
25224
25254
|
await handle.exited;
|
|
25255
|
+
await this.memories.refused().catch(async (err) => {
|
|
25256
|
+
await fds.closeAll();
|
|
25257
|
+
throw err;
|
|
25258
|
+
});
|
|
25225
25259
|
}
|
|
25226
25260
|
}
|
|
25227
25261
|
start(req) {
|
|
@@ -25287,7 +25321,8 @@ var Launcher = class {
|
|
|
25287
25321
|
processes: this.list(this.credOf(pid)),
|
|
25288
25322
|
load: this.loadAverage(),
|
|
25289
25323
|
cpu: this.cpuTotal(),
|
|
25290
|
-
wasm: this.memories.count()
|
|
25324
|
+
wasm: this.memories.count(),
|
|
25325
|
+
peers: Number(this.locks.shared?.() === true)
|
|
25291
25326
|
}),
|
|
25292
25327
|
sudo: (call, signal) => this.sudo(pid, call, signal),
|
|
25293
25328
|
crontab: (call) => this.crontab(pid, call),
|