feat: add debug node
This commit is contained in:
8
Cargo.lock
generated
8
Cargo.lock
generated
@@ -24,6 +24,14 @@ dependencies = [
|
||||
"nodarium_utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "debug"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"nodarium_macros",
|
||||
"nodarium_utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "float"
|
||||
version = "0.1.0"
|
||||
|
||||
@@ -16,17 +16,28 @@ import {
|
||||
import type { RuntimeNode } from './types';
|
||||
|
||||
const log = createLogger('runtime-executor');
|
||||
log.mute();
|
||||
// log.mute(); // Keep logging enabled for debug info
|
||||
|
||||
const remoteRegistry = new RemoteNodeRegistry('');
|
||||
|
||||
function getValue(input: NodeInput, value?: unknown) {
|
||||
type WasmExecute = (outputPos: number, args: number[]) => number;
|
||||
|
||||
function getValue(input: NodeInput, value?: unknown): number | number[] | Int32Array {
|
||||
if (value === undefined && 'value' in input) {
|
||||
value = input.value;
|
||||
}
|
||||
|
||||
if (input.type === 'float') {
|
||||
return encodeFloat(value as number);
|
||||
switch (input.type) {
|
||||
case 'float':
|
||||
return encodeFloat(value as number);
|
||||
|
||||
case 'select':
|
||||
return (value as number) ?? 0;
|
||||
|
||||
case 'vec3': {
|
||||
const arr = Array.isArray(value) ? value : [];
|
||||
return [0, arr.length + 1, ...arr.map(v => encodeFloat(v)), 1, 1];
|
||||
}
|
||||
}
|
||||
|
||||
if (Array.isArray(value)) {
|
||||
@@ -42,22 +53,14 @@ function getValue(input: NodeInput, value?: unknown) {
|
||||
return [0, value.length + 1, ...value, 1, 1] as number[];
|
||||
}
|
||||
|
||||
if (typeof value === 'boolean') {
|
||||
return value ? 1 : 0;
|
||||
}
|
||||
if (typeof value === 'boolean') return value ? 1 : 0;
|
||||
if (typeof value === 'number') return value;
|
||||
if (value instanceof Int32Array) return value;
|
||||
|
||||
if (typeof value === 'number') {
|
||||
return value;
|
||||
}
|
||||
|
||||
if (value instanceof Int32Array) {
|
||||
return value;
|
||||
}
|
||||
|
||||
throw new Error(`Unknown input type ${input.type}`);
|
||||
throw new Error(`Unsupported input type: ${input.type}`);
|
||||
}
|
||||
|
||||
function compareInt32(a: Int32Array, b: Int32Array) {
|
||||
function compareInt32(a: Int32Array, b: Int32Array): boolean {
|
||||
if (a.length !== b.length) return false;
|
||||
for (let i = 0; i < a.length; i++) {
|
||||
if (a[i] !== b[i]) return false;
|
||||
@@ -76,47 +79,56 @@ export type Pointer = {
|
||||
|
||||
perf?: PerformanceStore;
|
||||
|
||||
public getMemory() {
|
||||
return new Int32Array(this.memory.buffer);
|
||||
}
|
||||
|
||||
constructor(
|
||||
private registry: NodeRegistry,
|
||||
private readonly registry: NodeRegistry,
|
||||
public cache?: SyncCache<Int32Array>
|
||||
) {
|
||||
this.cache = undefined;
|
||||
this.refreshView();
|
||||
log.info('MemoryRuntimeExecutor initialized');
|
||||
}
|
||||
|
||||
private refreshView(): void {
|
||||
this.memoryView = new Int32Array(this.memory.buffer);
|
||||
log.info(`Memory view refreshed, length: ${this.memoryView.length}`);
|
||||
}
|
||||
|
||||
public getMemory(): Int32Array {
|
||||
return new Int32Array(this.memory.buffer);
|
||||
}
|
||||
|
||||
private map = new Map<string, { definition: NodeDefinition; execute: WasmExecute }>();
|
||||
private async getNodeDefinitions(graph: Graph) {
|
||||
if (this.registry.status !== 'ready') {
|
||||
throw new Error('Node registry is not ready');
|
||||
}
|
||||
|
||||
await this.registry.load(graph.nodes.map((node) => node.type));
|
||||
await this.registry.load(graph.nodes.map(n => n.type));
|
||||
log.info(`Loaded ${graph.nodes.length} node types from registry`);
|
||||
|
||||
const typeMap = new Map<string, {
|
||||
definition: NodeDefinition;
|
||||
execute: (outputPos: number, args: number[]) => number;
|
||||
}>();
|
||||
for (const node of graph.nodes) {
|
||||
if (!typeMap.has(node.type)) {
|
||||
const type = this.registry.getNode(node.type);
|
||||
const buffer = await remoteRegistry.fetchArrayBuffer('nodes/' + node.type + '.wasm');
|
||||
const wrapper = createWasmWrapper(buffer, this.memory);
|
||||
if (type) {
|
||||
typeMap.set(node.type, {
|
||||
definition: type,
|
||||
execute: wrapper.execute
|
||||
});
|
||||
}
|
||||
}
|
||||
for (const { type } of graph.nodes) {
|
||||
if (this.map.has(type)) continue;
|
||||
|
||||
const def = this.registry.getNode(type);
|
||||
if (!def) continue;
|
||||
|
||||
log.info(`Fetching WASM for node type: ${type}`);
|
||||
const buffer = await remoteRegistry.fetchArrayBuffer(`nodes/${type}.wasm`);
|
||||
const wrapper = createWasmWrapper(buffer, this.memory);
|
||||
|
||||
this.map.set(type, {
|
||||
definition: def,
|
||||
execute: wrapper.execute
|
||||
});
|
||||
log.info(`Node type ${type} loaded and wrapped`);
|
||||
}
|
||||
return typeMap;
|
||||
|
||||
return this.map;
|
||||
}
|
||||
|
||||
private async addMetaData(graph: Graph) {
|
||||
// First, lets check if all nodes have a definition
|
||||
this.nodes = await this.getNodeDefinitions(graph);
|
||||
log.info(`Metadata added for ${this.nodes.size} nodes`);
|
||||
|
||||
const graphNodes = graph.nodes.map(node => {
|
||||
const n = node as RuntimeNode;
|
||||
@@ -129,26 +141,21 @@ export type Pointer = {
|
||||
return n;
|
||||
});
|
||||
|
||||
const outputNode = graphNodes.find((node) => node.type.endsWith('/output'));
|
||||
if (!outputNode) {
|
||||
// throw new Error('No output node found');
|
||||
console.log('No output node found');
|
||||
}
|
||||
const outputNode = graphNodes.find(n => n.type.endsWith('/output') || n.type.endsWith('/debug'))
|
||||
?? graphNodes[0];
|
||||
|
||||
const nodeMap = new Map(
|
||||
graphNodes.map((node) => [node.id, node])
|
||||
);
|
||||
const nodeMap = new Map(graphNodes.map(n => [n.id, n]));
|
||||
|
||||
// loop through all edges and assign the parent and child nodes to each node
|
||||
for (const edge of graph.edges) {
|
||||
const [parentId, /*_parentOutput*/, childId, childInput] = edge;
|
||||
const parent = nodeMap.get(parentId);
|
||||
const child = nodeMap.get(childId);
|
||||
if (parent && child) {
|
||||
parent.state.children.push(child);
|
||||
child.state.parents.push(parent);
|
||||
child.state.inputNodes[childInput] = parent;
|
||||
}
|
||||
if (!parent || !child) continue;
|
||||
|
||||
parent.state.children.push(child);
|
||||
child.state.parents.push(parent);
|
||||
child.state.inputNodes[childInput] = parent;
|
||||
}
|
||||
|
||||
const nodes = new Map<number, RuntimeNode>();
|
||||
@@ -156,10 +163,8 @@ export type Pointer = {
|
||||
// loop through all the nodes and assign each nodes its depth
|
||||
const stack = [outputNode, ...graphNodes.filter(n => n.type.endsWith('/debug'))];
|
||||
while (stack.length) {
|
||||
const node = stack.pop();
|
||||
if (!node) continue;
|
||||
const node = stack.pop()!;
|
||||
for (const parent of node.state.parents) {
|
||||
parent.state = parent.state || {};
|
||||
parent.state.depth = node.state.depth + 1;
|
||||
stack.push(parent);
|
||||
}
|
||||
@@ -183,16 +188,14 @@ export type Pointer = {
|
||||
return [outputNode, _nodes] as const;
|
||||
}
|
||||
|
||||
private writeToMemory(v: number | number[] | Int32Array, title?: string) {
|
||||
let length = 1;
|
||||
private writeToMemory(value: number | number[] | Int32Array, title?: string): Pointer {
|
||||
const start = this.offset;
|
||||
|
||||
if (typeof v === 'number') {
|
||||
this.memoryView[this.offset] = v;
|
||||
console.log('MEM: writing number', v, ' to', this.offset);
|
||||
length = 1;
|
||||
if (typeof value === 'number') {
|
||||
this.memoryView[this.offset++] = value;
|
||||
} else {
|
||||
this.memoryView.set(v, this.offset);
|
||||
length = v.length;
|
||||
this.memoryView.set(value, this.offset);
|
||||
this.offset += value.length;
|
||||
}
|
||||
|
||||
let a = performance.now();
|
||||
@@ -338,16 +341,122 @@ export type Pointer = {
|
||||
}
|
||||
}
|
||||
|
||||
// const mem = new Int32Array(this.memory.buffer);
|
||||
// console.log('OUT', mem.slice(0, 10));
|
||||
this.isRunning = true;
|
||||
log.info('Execution started');
|
||||
|
||||
// return the result of the parent of the output node
|
||||
// const res = this.results[outputNode.id];
|
||||
try {
|
||||
this.offset = 0;
|
||||
this.results = {};
|
||||
this.inputPtrs = {};
|
||||
this.allPtrs = [];
|
||||
this.seed += 2;
|
||||
|
||||
this.perf?.endPoint('runtime');
|
||||
this.refreshView();
|
||||
|
||||
this.isRunning = false;
|
||||
return undefined as unknown as Int32Array;
|
||||
const [outputNode, nodes] = await this.addMetaData(graph);
|
||||
|
||||
const sortedNodes = [...nodes].sort(
|
||||
(a, b) => (b.state.depth ?? 0) - (a.state.depth ?? 0)
|
||||
);
|
||||
|
||||
const seedPtr = this.writeToMemory(this.seed, 'seed');
|
||||
|
||||
const settingPtrs = new Map<string, Pointer>();
|
||||
for (const [key, value] of Object.entries(settings)) {
|
||||
const ptr = this.writeToMemory(value as number, `setting.${key}`);
|
||||
settingPtrs.set(key, ptr);
|
||||
}
|
||||
|
||||
let lastNodePtr: Pointer | undefined = undefined;
|
||||
|
||||
for (const node of sortedNodes) {
|
||||
const nodeType = this.nodes.get(node.type);
|
||||
if (!nodeType) continue;
|
||||
|
||||
log.info(`Executing node: ${node.id} (type: ${node.type})`);
|
||||
|
||||
const inputs = Object.entries(nodeType.definition.inputs || {}).map(
|
||||
([key, input]) => {
|
||||
if (input.type === 'seed') return seedPtr;
|
||||
|
||||
if (input.setting) {
|
||||
const ptr = settingPtrs.get(input.setting);
|
||||
if (!ptr) throw new Error(`Missing setting: ${input.setting}`);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
const src = node.state.inputNodes[key];
|
||||
if (src) {
|
||||
const res = this.results[src.id];
|
||||
if (!res) {
|
||||
throw new Error(`Missing input from ${src.type}/${src.id}`);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
if (node.props?.[key] !== undefined) {
|
||||
return this.writeToMemory(
|
||||
getValue(input, node.props[key]),
|
||||
`${node.id}.${key}`
|
||||
);
|
||||
}
|
||||
|
||||
return this.writeToMemory(getValue(input), `${node.id}.${key}`);
|
||||
}
|
||||
);
|
||||
|
||||
this.inputPtrs[node.id] = inputs;
|
||||
const args = inputs.flatMap(p => [p.start * 4, p.end * 4]);
|
||||
|
||||
log.info(`Executing node ${node.type}/${node.id}`);
|
||||
const bytesWritten = nodeType.execute(this.offset * 4, args);
|
||||
if (bytesWritten === -1) {
|
||||
throw new Error(`Failed to execute node`);
|
||||
}
|
||||
this.refreshView();
|
||||
|
||||
const outLen = bytesWritten >> 2;
|
||||
const outputStart = this.offset;
|
||||
|
||||
if (
|
||||
args.length === 2
|
||||
&& inputs[0].end - inputs[0].start === outLen
|
||||
&& compareInt32(
|
||||
this.memoryView.slice(inputs[0].start, inputs[0].end),
|
||||
this.memoryView.slice(outputStart, outputStart + outLen)
|
||||
)
|
||||
) {
|
||||
this.results[node.id] = inputs[0];
|
||||
log.info(`Node ${node.id} result reused input memory`);
|
||||
} else {
|
||||
this.results[node.id] = {
|
||||
start: outputStart,
|
||||
end: outputStart + outLen,
|
||||
_title: `${node.id} ->`
|
||||
};
|
||||
this.offset += outLen;
|
||||
lastNodePtr = this.results[node.id];
|
||||
log.info(
|
||||
`Node ${node.id} wrote result to memory: start=${outputStart}, end=${outputStart + outLen
|
||||
}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const res = this.results[outputNode.id] ?? lastNodePtr;
|
||||
if (!res) throw new Error('Output node produced no result');
|
||||
|
||||
log.info(`Execution finished, output pointer: start=${res.start}, end=${res.end}`);
|
||||
this.refreshView();
|
||||
return this.memoryView.slice(res.start, res.end);
|
||||
} catch (e) {
|
||||
log.info('Execution error:', e);
|
||||
console.error(e);
|
||||
} finally {
|
||||
this.isRunning = false;
|
||||
this.perf?.endPoint('runtime');
|
||||
log.info('Executor state reset');
|
||||
}
|
||||
}
|
||||
|
||||
getDebugData() {
|
||||
|
||||
@@ -100,12 +100,13 @@
|
||||
<tr class="h-[40px] odd:bg-[var(--layer-1)]">
|
||||
<td class="px-4 border-b border-[var(--outline)] w-8">{index}</td>
|
||||
<td
|
||||
class="w-[50px] border-b border-[var(--outline)]
|
||||
class="border-b border-[var(--outline)] overflow-hidden text-ellipsis pl-2
|
||||
{ptr?._title?.includes('->')
|
||||
? 'bg-red-500'
|
||||
: 'bg-blue-500'}"
|
||||
style="width: 100px; min-width: 100px; max-width: 100px;"
|
||||
>
|
||||
<span>{ptr?._title}</span>
|
||||
{ptr?._title}
|
||||
</td>
|
||||
<td
|
||||
class="px-4 border-b border-[var(--outline)] cursor-pointer text-blue-600 hover:text-blue-800"
|
||||
|
||||
6
nodes/max/plantarium/debug/.gitignore
vendored
Normal file
6
nodes/max/plantarium/debug/.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/target
|
||||
**/*.rs.bk
|
||||
Cargo.lock
|
||||
bin/
|
||||
pkg/
|
||||
wasm-pack.log
|
||||
12
nodes/max/plantarium/debug/Cargo.toml
Normal file
12
nodes/max/plantarium/debug/Cargo.toml
Normal file
@@ -0,0 +1,12 @@
|
||||
[package]
|
||||
name = "debug"
|
||||
version = "0.1.0"
|
||||
authors = ["Max Richter <jim-x@web.de>"]
|
||||
edition = "2018"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "rlib"]
|
||||
|
||||
[dependencies]
|
||||
nodarium_macros = { version = "0.1.0", path = "../../../../packages/macros" }
|
||||
nodarium_utils = { version = "0.1.0", path = "../../../../packages/utils" }
|
||||
22
nodes/max/plantarium/debug/src/input.json
Normal file
22
nodes/max/plantarium/debug/src/input.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"id": "max/plantarium/debug",
|
||||
"outputs": [],
|
||||
"inputs": {
|
||||
"input": {
|
||||
"type": "float",
|
||||
"accepts": [
|
||||
"*"
|
||||
],
|
||||
"external": true
|
||||
},
|
||||
"type": {
|
||||
"type": "select",
|
||||
"options": [
|
||||
"float",
|
||||
"vec3",
|
||||
"geometry"
|
||||
],
|
||||
"internal": true
|
||||
}
|
||||
}
|
||||
}
|
||||
25
nodes/max/plantarium/debug/src/lib.rs
Normal file
25
nodes/max/plantarium/debug/src/lib.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
use nodarium_macros::nodarium_definition_file;
|
||||
use nodarium_macros::nodarium_execute;
|
||||
use nodarium_utils::encode_float;
|
||||
use nodarium_utils::evaluate_float;
|
||||
use nodarium_utils::evaluate_vec3;
|
||||
use nodarium_utils::read_i32;
|
||||
use nodarium_utils::read_i32_slice;
|
||||
|
||||
nodarium_definition_file!("src/input.json");
|
||||
|
||||
#[nodarium_execute]
|
||||
pub fn execute(input: (i32, i32), input_type: (i32, i32)) -> Vec<i32> {
|
||||
let inp = read_i32_slice(input);
|
||||
let t = read_i32(input_type.0);
|
||||
if t == 0 {
|
||||
let f = evaluate_float(inp.as_slice());
|
||||
return vec![encode_float(f)];
|
||||
}
|
||||
if t == 1 {
|
||||
let f = evaluate_vec3(inp.as_slice());
|
||||
return vec![encode_float(f[0]), encode_float(f[1]), encode_float(f[2])];
|
||||
}
|
||||
|
||||
return inp;
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
use nodarium_macros::nodarium_definition_file;
|
||||
use nodarium_macros::nodarium_execute;
|
||||
use nodarium_utils::log;
|
||||
use nodarium_utils::{concat_arg_vecs, read_i32_slice};
|
||||
|
||||
nodarium_definition_file!("src/input.json");
|
||||
|
||||
#[nodarium_execute]
|
||||
pub fn execute(op_type: (i32, i32), a: (i32, i32), b: (i32, i32)) -> Vec<i32> {
|
||||
log!("math.op {:?}", op_type);
|
||||
let op = read_i32_slice(op_type);
|
||||
let a_val = read_i32_slice(a);
|
||||
let b_val = read_i32_slice(b);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"input": {
|
||||
"type": "path",
|
||||
"accepts": [
|
||||
"geometry"
|
||||
"*"
|
||||
],
|
||||
"external": true
|
||||
},
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
use nodarium_macros::nodarium_definition_file;
|
||||
use nodarium_macros::nodarium_execute;
|
||||
use nodarium_utils::encode_float;
|
||||
use nodarium_utils::evaluate_float;
|
||||
use nodarium_utils::evaluate_vec3;
|
||||
use nodarium_utils::log;
|
||||
use nodarium_utils::read_i32_slice;
|
||||
|
||||
nodarium_definition_file!("src/input.json");
|
||||
@@ -11,17 +7,5 @@ nodarium_definition_file!("src/input.json");
|
||||
#[nodarium_execute]
|
||||
pub fn execute(input: (i32, i32), _res: (i32, i32)) -> Vec<i32> {
|
||||
let inp = read_i32_slice(input);
|
||||
let length = inp.len();
|
||||
if length == 1 {
|
||||
let f = evaluate_float(inp.as_slice());
|
||||
log!("out.float f={:?}", f);
|
||||
return vec![encode_float(f)];
|
||||
}
|
||||
if length == 3 {
|
||||
let f = evaluate_vec3(inp.as_slice());
|
||||
log!("out.vec3 x={:?} y={:?} z={:?}", f[0], f[1], f[2]);
|
||||
return vec![encode_float(f[0]), encode_float(f[1]), encode_float(f[2])];
|
||||
}
|
||||
|
||||
return inp;
|
||||
}
|
||||
|
||||
@@ -99,22 +99,20 @@ pub fn nodarium_execute(_attr: TokenStream, item: TokenStream) -> TokenStream {
|
||||
#[no_mangle]
|
||||
#fn_vis extern "C" fn execute(output_pos: i32, #( #arg_names: i32 ),*) -> i32 {
|
||||
|
||||
// log!("before_fn");
|
||||
nodarium_utils::log!("before_fn");
|
||||
let result = #inner_fn_name(
|
||||
#( #tuple_args ),*
|
||||
);
|
||||
// log!("after_fn");
|
||||
nodarium_utils::log!("after_fn");
|
||||
|
||||
let len_bytes = result.len() * 4;
|
||||
unsafe {
|
||||
let src = result.as_ptr() as *const u8;
|
||||
let dst = output_pos as *mut u8;
|
||||
// log!("writing output_pos={:?} src={:?} len_bytes={:?}", output_pos, src, len_bytes);
|
||||
// nodarium_utils::log!("writing output_pos={:?} src={:?} len_bytes={:?}", output_pos, src, len_bytes);
|
||||
dst.copy_from_nonoverlapping(src, len_bytes);
|
||||
}
|
||||
|
||||
core::mem::forget(result);
|
||||
|
||||
len_bytes as i32
|
||||
}
|
||||
};
|
||||
|
||||
@@ -9,6 +9,7 @@ const DefaultOptionsSchema = z.object({
|
||||
accepts: z
|
||||
.array(
|
||||
z.union([
|
||||
z.literal('*'),
|
||||
z.literal('float'),
|
||||
z.literal('integer'),
|
||||
z.literal('boolean'),
|
||||
|
||||
@@ -12,7 +12,7 @@ pub fn decode_float(bits: i32) -> f32 {
|
||||
|
||||
#[inline]
|
||||
pub fn read_i32(ptr: i32) -> i32 {
|
||||
unsafe {
|
||||
unsafe {
|
||||
let _ptr = ptr as *const i32;
|
||||
*_ptr
|
||||
}
|
||||
@@ -27,22 +27,30 @@ pub fn read_f32(ptr: i32) -> f32 {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn read_i32_slice(tuple: (i32, i32)) -> Vec<i32> {
|
||||
pub fn read_i32_slice(range: (i32, i32)) -> Vec<i32> {
|
||||
let (start, end) = range;
|
||||
assert!(end >= start);
|
||||
let byte_len = (end - start) as usize;
|
||||
assert!(byte_len % 4 == 0);
|
||||
|
||||
unsafe {
|
||||
let start = tuple.0 as *const i32;
|
||||
let end = tuple.1 as *const i32;
|
||||
let len = (end as usize - start as usize) / 4;
|
||||
std::slice::from_raw_parts(start, len).to_vec()
|
||||
let ptr = start as *const i32;
|
||||
let len = byte_len / 4;
|
||||
std::slice::from_raw_parts(ptr, len).to_vec()
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn read_f32_slice(tuple: (i32, i32)) -> Vec<f32> {
|
||||
pub fn read_f32_slice(range: (i32, i32)) -> Vec<f32> {
|
||||
let (start, end) = range;
|
||||
assert!(end >= start);
|
||||
let byte_len = (end - start) as usize;
|
||||
assert!(byte_len % 4 == 0);
|
||||
|
||||
unsafe {
|
||||
let start = tuple.0 as *const f32;
|
||||
let end = tuple.1 as *const f32;
|
||||
let len = (end as usize - start as usize) / 4;
|
||||
std::slice::from_raw_parts(start, len).to_vec()
|
||||
let ptr = start as *const f32;
|
||||
let len = byte_len / 4;
|
||||
std::slice::from_raw_parts(ptr, len).to_vec()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,12 @@ export function createWasmWrapper(buffer: ArrayBuffer, memory: WebAssembly.Memor
|
||||
exports = instance.exports as NodariumExports;
|
||||
|
||||
function execute(outputPos: number, args: number[]): number {
|
||||
return exports.execute(outputPos, ...args);
|
||||
try {
|
||||
return exports.execute(outputPos, ...args);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
function get_definition() {
|
||||
|
||||
Reference in New Issue
Block a user