@remix_labs/machine-starter 2.3185.0-dev → 2.3189.0-dev

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/common.js CHANGED
@@ -11,13 +11,13 @@ let blobs = {};
11
11
  let blobsLoops = {};
12
12
 
13
13
  function terminateAll() {
14
- console.log("[groovebox-starter] terminate all VMs");
14
+ console.log("[machine-starter] terminate all VMs");
15
15
  for (let [vmID, worker] of Object.entries(workers)) {
16
16
  worker.terminate();
17
17
  };
18
18
  for (let [vmID, blist] of Object.entries(blobs)) {
19
19
  for (let blob_url of blist) {
20
- console.log("[groovebox-starter] revoke ", blob_url);
20
+ console.log("[machine-starter] revoke ", blob_url);
21
21
  URL.revokeObjectURL(blob_url);
22
22
  }
23
23
  };
@@ -35,7 +35,7 @@ function terminateAll() {
35
35
  }
36
36
 
37
37
  function terminateVM(vmID) {
38
- console.log("[groovebox-starter] terminate VM", vmID);
38
+ console.log("[machine-starter] terminate VM", vmID);
39
39
  let worker = workers[vmID];
40
40
  if (worker) {
41
41
  let vmChildren = children[vmID];
@@ -52,7 +52,7 @@ function terminateVM(vmID) {
52
52
  blobsLoop.terminate();
53
53
  }
54
54
  for (let blob_url of blobList) {
55
- console.log("[groovebox-starter] revoke ", blob_url);
55
+ console.log("[machine-starter] revoke ", blob_url);
56
56
  URL.revokeObjectURL(blob_url);
57
57
  };
58
58
  if (vmChildren) {
@@ -65,7 +65,6 @@ function terminateVM(vmID) {
65
65
 
66
66
  if (globalThis.Process) {
67
67
  Process.on("exit", () => {
68
- console.log("terminating machine workers");
69
68
  terminateAll()
70
69
  })
71
70
  };
@@ -73,6 +72,23 @@ if (globalThis.Process) {
73
72
  let initialMask = 0;
74
73
  const logMaskTopic = "/logMask";
75
74
 
75
+ globalThis.MixExplain = (_ => {
76
+ console.debug("Debug levels (call MixSetMask to change, or set the _rmx_mask URL parameter):");
77
+ console.debug("DEBUG_MEMORY 1");
78
+ console.debug("DEBUG_SCHEDULER 2");
79
+ console.debug("DEBUG_STATE 4");
80
+ console.debug("DEBUG_STACK 8");
81
+ console.debug("DEBUG_LOOP 16");
82
+ console.debug("DEBUG_MEMORY_OG 32");
83
+ console.debug("DEBUG_GC 64");
84
+ console.debug("DEBUG_INTERPRETER 128");
85
+ console.debug("DEBUG_MIXERROR 256");
86
+ console.debug("DEBUG_MESSAGES 1024");
87
+ console.debug("DEBUG_QUEUES 2048");
88
+ console.debug("DEBUG_OUTPUT 4096");
89
+ console.debug("DEBUG_COMPILER 8192");
90
+ });
91
+
76
92
  globalThis.MixSetMask = (m => {
77
93
  initialMask = m;
78
94
  if (last_hub) {
@@ -95,21 +111,10 @@ function StartWASM(hub, baseURL, org, workspace, vmID, user, token, noOutputViaM
95
111
  }
96
112
 
97
113
  async function StartWASM2(hub, config) {
98
- console.log("[groovebox-starter] start VM", GROOVEBOX_BUILD, config.vmID, config.mixcore);
99
- console.debug("Debug levels (call MixSetMask to change, or set the _rmx_mask URL parameter):");
100
- console.debug("DEBUG_MEMORY 1");
101
- console.debug("DEBUG_SCHEDULER 2");
102
- console.debug("DEBUG_STATE 4");
103
- console.debug("DEBUG_STACK 8");
104
- console.debug("DEBUG_LOOP 16");
105
- console.debug("DEBUG_MEMORY_OG 32");
106
- console.debug("DEBUG_GC 64");
107
- console.debug("DEBUG_INTERPRETER 128");
108
- console.debug("DEBUG_MIXERROR 256");
109
- console.debug("DEBUG_MESSAGES 1024");
110
- console.debug("DEBUG_QUEUES 2048");
111
- console.debug("DEBUG_OUTPUT 4096");
112
- console.debug("DEBUG_COMPILER 8192");
114
+ if (!last_hub) {
115
+ console.log("[machine-starter] Call MixExplain() for explaining debug levels, and MixSetMask(m) for changing these")
116
+ };
117
+ console.log("[machine-starter] start VM", config.vmID, config.mixcore);
113
118
  last_hub = hub;
114
119
  let channel = await hub.newChannel();
115
120
  // injected by either index.js or node.js
@@ -120,7 +125,7 @@ async function StartWASM2(hub, config) {
120
125
  let localFFIs = config.localFFIs || {};
121
126
  let mixcoreFFIs = await getMixcoreFFIs(config.mixcore);
122
127
  if (mixcoreFFIs) {
123
- console.log("[groovebox-starter] mixcore FFIs", Object.keys(mixcoreFFIs));
128
+ console.log("[machine-starter] mixcore FFIs", Object.keys(mixcoreFFIs));
124
129
  // merge the ffis and store them back into the config so sub vms also get them
125
130
  config.localFFIs = Object.assign(localFFIs, mixcoreFFIs);
126
131
  // delete the mixcore config to avoid being handled further by the worker
@@ -147,11 +152,11 @@ async function StartWASM2(hub, config) {
147
152
  // for the desktop only: precompile the mixrt module to get faster
148
153
  // startup times
149
154
  if (globalThis.mixrtCodeModule && globalThis.mixrtCodeURL == mixrtCode) {
150
- console.log("[groovebox-starter] reusing mixrt");
155
+ console.log("[machine-starter] reusing mixrt");
151
156
  mixrtCode = globalThis.mixrtCodeModule;
152
157
  } else {
153
158
  let url = mixrtCode;
154
- console.log("[groovebox-starter] pre-compiling mixrt");
159
+ console.log("[machine-starter] pre-compiling mixrt");
155
160
  mixrtCode = await WebAssembly.compileStreaming(fetch(url));
156
161
  globalThis.mixrtCodeURL = url;
157
162
  globalThis.mixrtCodeModule = mixrtCode;
@@ -186,6 +191,7 @@ async function StartWASM2(hub, config) {
186
191
 
187
192
  async function ffi_vm_start(conn, args) {
188
193
  let vm_id = "embedded." + nanoid();
194
+ console.log("[machine-starter] starting VM: ", vm_id);
189
195
  let config = {};
190
196
  for (const [k, v] of Object.entries(conn.config)) {
191
197
  config[k] = v;
@@ -348,14 +354,14 @@ async function localFFIsMessageLoop(hub, config, localFFIs, terminate) {
348
354
  terminate.then(() => ({terminated: true})),
349
355
  ]);
350
356
  if (terminated) {
351
- console.log("[groovebox-starter] terminate FFI loop", vmID);
357
+ // console.log("[machine-starter] terminate FFI loop", vmID);
352
358
  return;
353
359
  }
354
360
  let name = msg.payload.name;
355
361
  let call_id = msg.payload.call_id;
356
362
  let args = decode(msg.payload.args);
357
363
  let fun = localFFIs[name];
358
- console.log("[groovebox-starter] local FFI call", vmID, call_id, name);
364
+ // console.log("[machine-starter] local FFI call", vmID, call_id, name);
359
365
  try {
360
366
  if (!fun) throw new Error("No such local FFI in groovebox starter: " + name);
361
367
  let connector =
@@ -397,7 +403,7 @@ async function blobsMessageLoop(hub, config, terminate) {
397
403
  terminate.then(() => ({terminated: true})),
398
404
  ]);
399
405
  if (terminated) {
400
- console.log("[groovebox-starter] terminate blobs loop", vmID);
406
+ // console.log("[machine-starter] terminate blobs loop", vmID);
401
407
  return;
402
408
  }
403
409
  let name = msg.payload.name;
@@ -1,2 +1,2 @@
1
- var GROOVEBOX_BUILD = "3546";
1
+ var GROOVEBOX_BUILD = "3189";
2
2
  export { GROOVEBOX_BUILD }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remix_labs/machine-starter",
3
- "version": "2.3185.0-dev",
3
+ "version": "2.3189.0-dev",
4
4
  "description": "start the groove",
5
5
  "main": "node.js",
6
6
  "browser": "index.js",
@@ -11,7 +11,7 @@
11
11
  "author": "Remixlabs staff",
12
12
  "license": "ISC",
13
13
  "dependencies": {
14
- "@remix_labs/hub-client": "2.3185.0-dev",
14
+ "@remix_labs/hub-client": "2.3189.0-dev",
15
15
  "nanoid": "^5.0.2",
16
16
  "web-worker": "^1.2.0"
17
17
  },