numbl 0.4.21 → 0.4.22
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/binding.gyp +12 -6
- package/dist-browser/browser/index.d.ts +1 -1
- package/dist-browser/browser/mip.d.ts +7 -0
- package/dist-browser/browser/protocol.d.ts +1 -1
- package/dist-browser/browser.js +1 -1
- package/dist-browser/db/operations.d.ts +0 -1
- package/dist-browser/gpuHelper.d.ts +29 -0
- package/dist-browser/hooks/projectFilesState.d.ts +37 -0
- package/dist-browser/numbl-core/execSession.d.ts +39 -0
- package/dist-browser/numbl-core/executeCode.d.ts +10 -1
- package/dist-browser/numbl-core/executors/classification.d.ts +2 -10
- package/dist-browser/numbl-core/executors/jit/backend.d.ts +65 -0
- package/dist-browser/numbl-core/executors/jit/cBackend.d.ts +22 -0
- package/dist-browser/numbl-core/executors/jit/callExecutor.d.ts +13 -44
- package/dist-browser/numbl-core/executors/jit/hostHelpers.d.ts +24 -0
- package/dist-browser/numbl-core/executors/jit/jsBackend.d.ts +15 -0
- package/dist-browser/numbl-core/executors/jit/loopExecutor.d.ts +13 -40
- package/dist-browser/numbl-core/executors/jit/session.d.ts +1 -1
- package/dist-browser/numbl-core/executors/jit/topLevelExecutor.d.ts +13 -33
- package/dist-browser/numbl-core/executors/jit/valueAdapterC.d.ts +32 -48
- package/dist-browser/numbl-core/executors/lowering.d.ts +38 -96
- package/dist-browser/numbl-core/executors/plugins.d.ts +14 -28
- package/dist-browser/numbl-core/executors/registry.d.ts +32 -133
- package/dist-browser/numbl-core/executors/types.d.ts +30 -92
- package/dist-browser/numbl-core/functionResolve.d.ts +3 -13
- package/dist-browser/numbl-core/helpers/check-helpers.d.ts +0 -5
- package/dist-browser/numbl-core/helpers/glob.d.ts +14 -0
- package/dist-browser/numbl-core/helpers/linsolve.d.ts +3 -13
- package/dist-browser/numbl-core/helpers/reduction-helpers.d.ts +2 -4
- package/dist-browser/numbl-core/helpers/shape-utils.d.ts +10 -0
- package/dist-browser/numbl-core/interpreter/builtins/index.d.ts +3 -1
- package/dist-browser/numbl-core/interpreter/builtins/time-system.d.ts +0 -1
- package/dist-browser/numbl-core/interpreter/builtins/types.d.ts +7 -7
- package/dist-browser/numbl-core/interpreter/interpreter.d.ts +6 -6
- package/dist-browser/numbl-core/interpreter/interpreterFunctions.d.ts +9 -1
- package/dist-browser/numbl-core/interpreter/interpreterSpecialBuiltins.d.ts +6 -3
- package/dist-browser/numbl-core/jit/builtins/defs/_shared.d.ts +1 -5
- package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/_elemwise.d.ts +1 -2
- package/dist-browser/numbl-core/jit/builtins/defs/logical/_unary_pred.d.ts +3 -3
- package/dist-browser/numbl-core/jit/builtins/defs/logical/fieldnames.d.ts +1 -1
- package/dist-browser/numbl-core/jit/builtins/defs/logical/strcmp.d.ts +1 -1
- package/dist-browser/numbl-core/jit/builtins/defs/math/_unary_real.d.ts +5 -2
- package/dist-browser/numbl-core/jit/builtins/defs/math/realsqrt.d.ts +6 -0
- package/dist-browser/numbl-core/jit/builtins/defs/reduction/_shape.d.ts +0 -5
- package/dist-browser/numbl-core/jit/builtins/defs/shape/_construct.d.ts +0 -4
- package/dist-browser/numbl-core/jit/builtins/defs/shape/_triangular.d.ts +2 -8
- package/dist-browser/numbl-core/jit/builtins/defs/system/deal.d.ts +4 -5
- package/dist-browser/numbl-core/jit/builtins/defs/system/feval.d.ts +7 -29
- package/dist-browser/numbl-core/jit/builtins/registry.d.ts +15 -30
- package/dist-browser/numbl-core/jit/builtins/runtime/system/cdiv.d.ts +4 -0
- package/dist-browser/numbl-core/jit/builtins/runtime/system/cscalar.d.ts +4 -0
- package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_real_fn.d.ts +45 -15
- package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reduce_real.d.ts +5 -5
- package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_unary_real_math.d.ts +6 -0
- package/dist-browser/numbl-core/jit/codegen/emit.d.ts +9 -30
- package/dist-browser/numbl-core/jit/codegen/emitJs.d.ts +9 -27
- package/dist-browser/numbl-core/jit/codegen/emitStmt.d.ts +8 -31
- package/dist-browser/numbl-core/jit/codegen/emitTensorFused.d.ts +10 -9
- package/dist-browser/numbl-core/jit/codegen/inlinePass.d.ts +39 -48
- package/dist-browser/numbl-core/jit/codegen/prettyIR.d.ts +1 -6
- package/dist-browser/numbl-core/jit/codegen/runtime.d.ts +7 -28
- package/dist-browser/numbl-core/jit/compileSpec.d.ts +3 -6
- package/dist-browser/numbl-core/jit/compileSpecC.d.ts +5 -0
- package/dist-browser/numbl-core/jit/lowering/assignedFlags.d.ts +24 -0
- package/dist-browser/numbl-core/jit/lowering/definiteAssign.d.ts +3 -1
- package/dist-browser/numbl-core/jit/lowering/errors.d.ts +3 -15
- package/dist-browser/numbl-core/jit/lowering/ir.d.ts +0 -2
- package/dist-browser/numbl-core/jit/lowering/lower.d.ts +4 -12
- package/dist-browser/numbl-core/jit/lowering/types.d.ts +2 -7
- package/dist-browser/numbl-core/jit/numbl/index.d.ts +5 -14
- package/dist-browser/numbl-core/jit/parser/index.d.ts +4 -9
- package/dist-browser/numbl-core/jit/workspace/workspace.d.ts +32 -136
- package/dist-browser/numbl-core/jitDeclineDiagnostics.d.ts +1 -1
- package/dist-browser/numbl-core/jsUserFunctions.d.ts +10 -12
- package/dist-browser/numbl-core/lowering/classInfo.d.ts +4 -1
- package/dist-browser/numbl-core/lowering/loweringContext.d.ts +15 -23
- package/dist-browser/numbl-core/native/lapack-bridge.d.ts +111 -130
- package/dist-browser/numbl-core/native/ts-lapack-bridge.d.ts +4 -5
- package/dist-browser/numbl-core/native/ts-lapack-complex.d.ts +23 -0
- package/dist-browser/numbl-core/native/ts-lapack-qr-lu.d.ts +37 -0
- package/dist-browser/numbl-core/native/wasm-lapack-bridge.d.ts +4 -5
- package/dist-browser/numbl-core/ops/dispatch.d.ts +4 -5
- package/dist-browser/numbl-core/parser/types.d.ts +1 -21
- package/{dist-lib/numbl-core/runtime → dist-browser/numbl-core/plotting}/axisCommand.d.ts +2 -2
- package/dist-browser/{graphics → numbl-core/plotting}/axisLimits.d.ts +14 -2
- package/dist-browser/numbl-core/plotting/builtins.d.ts +8 -0
- package/dist-browser/numbl-core/plotting/colormaps.d.ts +10 -0
- package/dist-browser/numbl-core/{runtime/plotBuiltinDispatch.d.ts → plotting/dispatch.d.ts} +14 -25
- package/dist-browser/numbl-core/plotting/imagescExtent.d.ts +19 -0
- package/dist-browser/numbl-core/{runtime/runtimePlot.d.ts → plotting/instructions.d.ts} +5 -17
- package/dist-browser/numbl-core/plotting/parseArgsChart.d.ts +94 -0
- package/dist-browser/numbl-core/plotting/parseArgsCommon.d.ts +64 -0
- package/dist-browser/numbl-core/plotting/parseArgsLine.d.ts +103 -0
- package/dist-browser/numbl-core/plotting/parseArgsPatch.d.ts +38 -0
- package/dist-browser/numbl-core/plotting/parseArgsQuiver.d.ts +32 -0
- package/dist-browser/numbl-core/plotting/parseArgsSurface.d.ts +75 -0
- package/dist-browser/numbl-core/plotting/streamline.d.ts +16 -0
- package/{dist-graphics/graphics → dist-browser/numbl-core/plotting}/types.d.ts +9 -7
- package/dist-browser/numbl-core/runtime/cow.d.ts +0 -8
- package/dist-browser/numbl-core/runtime/refcount.d.ts +0 -3
- package/dist-browser/numbl-core/runtime/registerSpecial.d.ts +15 -0
- package/dist-browser/numbl-core/runtime/runtime.d.ts +11 -35
- package/dist-browser/numbl-core/runtime/runtimeDispatch.d.ts +6 -0
- package/dist-browser/numbl-core/runtime/specialBuiltins.d.ts +3 -9
- package/dist-browser/numbl-core/runtime/uihtmlSession.d.ts +5 -13
- package/dist-browser/numbl-core/runtime/utils.d.ts +4 -1
- package/dist-browser/numbl-core/version.d.ts +1 -1
- package/dist-browser/numbl-core/workspace/workspace.d.ts +64 -0
- package/dist-browser/vfs/syncVfsChanges.d.ts +2 -2
- package/dist-cli/cli.js +74244 -80566
- package/dist-graphics/graphics/FigureView.d.ts +1 -1
- package/dist-graphics/graphics/SurfView.d.ts +3 -2
- package/dist-graphics/graphics/drawPlot.d.ts +1 -1
- package/dist-graphics/graphics/exportFigureHdf5.d.ts +1 -1
- package/dist-graphics/graphics/figureHashTransport.d.ts +1 -1
- package/dist-graphics/graphics/figureUpload.d.ts +1 -1
- package/dist-graphics/graphics/importFigureHdf5.d.ts +1 -1
- package/dist-graphics/graphics/openInFigureViewer.d.ts +1 -1
- package/dist-graphics/graphics/plotHelpers.d.ts +1 -1
- package/dist-graphics/graphics/plotLegend.d.ts +1 -1
- package/dist-graphics/graphics/plotMarkers.d.ts +1 -1
- package/dist-graphics/graphics/restoreNaNs.d.ts +1 -1
- package/dist-graphics/graphics/uihtmlRelay.d.ts +16 -0
- package/dist-graphics/graphics-lib.d.ts +3 -3
- package/dist-graphics/index.js +294 -328
- package/{dist-lib/graphics → dist-graphics/numbl-core/plotting}/axisLimits.d.ts +14 -2
- package/dist-graphics/numbl-core/plotting/colormaps.d.ts +10 -0
- package/dist-graphics/numbl-core/plotting/imagescExtent.d.ts +19 -0
- package/{dist-browser/graphics → dist-graphics/numbl-core/plotting}/types.d.ts +9 -7
- package/dist-lib/browser/mip.d.ts +17 -0
- package/dist-lib/cli-scan.d.ts +8 -1
- package/dist-lib/lib.d.ts +1 -1
- package/dist-lib/lib.js +29201 -35301
- package/dist-lib/node.js +22 -14
- package/dist-lib/numbl-core/execSession.d.ts +39 -0
- package/dist-lib/numbl-core/executeCode.d.ts +10 -1
- package/dist-lib/numbl-core/executors/classification.d.ts +2 -10
- package/dist-lib/numbl-core/executors/jit/backend.d.ts +65 -0
- package/dist-lib/numbl-core/executors/jit/cBackend.d.ts +22 -0
- package/dist-lib/numbl-core/executors/jit/callExecutor.d.ts +13 -44
- package/dist-lib/numbl-core/executors/jit/hostHelpers.d.ts +24 -0
- package/dist-lib/numbl-core/executors/jit/jsBackend.d.ts +15 -0
- package/dist-lib/numbl-core/executors/jit/loopExecutor.d.ts +13 -40
- package/dist-lib/numbl-core/executors/jit/session.d.ts +1 -1
- package/dist-lib/numbl-core/executors/jit/topLevelExecutor.d.ts +13 -33
- package/dist-lib/numbl-core/executors/jit/valueAdapterC.d.ts +32 -48
- package/dist-lib/numbl-core/executors/lowering.d.ts +38 -96
- package/dist-lib/numbl-core/executors/plugins.d.ts +14 -28
- package/dist-lib/numbl-core/executors/registry.d.ts +32 -133
- package/dist-lib/numbl-core/executors/types.d.ts +30 -92
- package/dist-lib/numbl-core/functionResolve.d.ts +3 -13
- package/dist-lib/numbl-core/helpers/check-helpers.d.ts +0 -5
- package/dist-lib/numbl-core/helpers/glob.d.ts +14 -0
- package/dist-lib/numbl-core/helpers/linsolve.d.ts +3 -13
- package/dist-lib/numbl-core/helpers/reduction-helpers.d.ts +2 -4
- package/dist-lib/numbl-core/helpers/shape-utils.d.ts +10 -0
- package/dist-lib/numbl-core/interpreter/builtins/index.d.ts +3 -1
- package/dist-lib/numbl-core/interpreter/builtins/time-system.d.ts +0 -1
- package/dist-lib/numbl-core/interpreter/builtins/types.d.ts +7 -7
- package/dist-lib/numbl-core/interpreter/interpreter.d.ts +6 -6
- package/dist-lib/numbl-core/interpreter/interpreterFunctions.d.ts +9 -1
- package/dist-lib/numbl-core/interpreter/interpreterSpecialBuiltins.d.ts +6 -3
- package/dist-lib/numbl-core/jit/builtins/defs/_shared.d.ts +1 -5
- package/dist-lib/numbl-core/jit/builtins/defs/arithmetic/_elemwise.d.ts +1 -2
- package/dist-lib/numbl-core/jit/builtins/defs/logical/_unary_pred.d.ts +3 -3
- package/dist-lib/numbl-core/jit/builtins/defs/logical/fieldnames.d.ts +1 -1
- package/dist-lib/numbl-core/jit/builtins/defs/logical/strcmp.d.ts +1 -1
- package/dist-lib/numbl-core/jit/builtins/defs/math/_unary_real.d.ts +5 -2
- package/dist-lib/numbl-core/jit/builtins/defs/math/realsqrt.d.ts +6 -0
- package/dist-lib/numbl-core/jit/builtins/defs/reduction/_shape.d.ts +0 -5
- package/dist-lib/numbl-core/jit/builtins/defs/shape/_construct.d.ts +0 -4
- package/dist-lib/numbl-core/jit/builtins/defs/shape/_triangular.d.ts +2 -8
- package/dist-lib/numbl-core/jit/builtins/defs/system/deal.d.ts +4 -5
- package/dist-lib/numbl-core/jit/builtins/defs/system/feval.d.ts +7 -29
- package/dist-lib/numbl-core/jit/builtins/registry.d.ts +15 -30
- package/dist-lib/numbl-core/jit/builtins/runtime/system/cdiv.d.ts +4 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/system/cscalar.d.ts +4 -0
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_real_fn.d.ts +45 -15
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reduce_real.d.ts +5 -5
- package/dist-lib/numbl-core/jit/builtins/runtime/tensor_ops/tensor_unary_real_math.d.ts +6 -0
- package/dist-lib/numbl-core/jit/codegen/emit.d.ts +9 -30
- package/dist-lib/numbl-core/jit/codegen/emitJs.d.ts +9 -27
- package/dist-lib/numbl-core/jit/codegen/emitStmt.d.ts +8 -31
- package/dist-lib/numbl-core/jit/codegen/emitTensorFused.d.ts +10 -9
- package/dist-lib/numbl-core/jit/codegen/inlinePass.d.ts +39 -48
- package/dist-lib/numbl-core/jit/codegen/prettyIR.d.ts +1 -6
- package/dist-lib/numbl-core/jit/codegen/runtime.d.ts +7 -28
- package/dist-lib/numbl-core/jit/compileSpec.d.ts +3 -6
- package/dist-lib/numbl-core/jit/compileSpecC.d.ts +5 -0
- package/dist-lib/numbl-core/jit/lowering/assignedFlags.d.ts +24 -0
- package/dist-lib/numbl-core/jit/lowering/definiteAssign.d.ts +3 -1
- package/dist-lib/numbl-core/jit/lowering/errors.d.ts +3 -15
- package/dist-lib/numbl-core/jit/lowering/ir.d.ts +0 -2
- package/dist-lib/numbl-core/jit/lowering/lower.d.ts +4 -12
- package/dist-lib/numbl-core/jit/lowering/types.d.ts +2 -7
- package/dist-lib/numbl-core/jit/numbl/index.d.ts +5 -14
- package/dist-lib/numbl-core/jit/parser/index.d.ts +4 -9
- package/dist-lib/numbl-core/jit/workspace/workspace.d.ts +32 -136
- package/dist-lib/numbl-core/jitDeclineDiagnostics.d.ts +1 -1
- package/dist-lib/numbl-core/jsUserFunctions.d.ts +10 -12
- package/dist-lib/numbl-core/lowering/classInfo.d.ts +4 -1
- package/dist-lib/numbl-core/lowering/loweringContext.d.ts +15 -23
- package/dist-lib/numbl-core/native/lapack-bridge.d.ts +111 -130
- package/dist-lib/numbl-core/native/ts-lapack-bridge.d.ts +4 -5
- package/dist-lib/numbl-core/native/ts-lapack-complex.d.ts +23 -0
- package/dist-lib/numbl-core/native/ts-lapack-qr-lu.d.ts +37 -0
- package/dist-lib/numbl-core/native/wasm-lapack-bridge.d.ts +4 -5
- package/dist-lib/numbl-core/ops/dispatch.d.ts +4 -5
- package/dist-lib/numbl-core/parser/types.d.ts +1 -21
- package/{dist-browser/numbl-core/runtime → dist-lib/numbl-core/plotting}/axisCommand.d.ts +2 -2
- package/{dist-graphics/graphics → dist-lib/numbl-core/plotting}/axisLimits.d.ts +14 -2
- package/dist-lib/numbl-core/plotting/builtins.d.ts +8 -0
- package/dist-lib/numbl-core/plotting/colormaps.d.ts +10 -0
- package/dist-lib/numbl-core/{runtime/plotBuiltinDispatch.d.ts → plotting/dispatch.d.ts} +14 -25
- package/dist-lib/numbl-core/plotting/imagescExtent.d.ts +19 -0
- package/dist-lib/numbl-core/{runtime/runtimePlot.d.ts → plotting/instructions.d.ts} +5 -17
- package/dist-lib/numbl-core/plotting/parseArgsChart.d.ts +94 -0
- package/dist-lib/numbl-core/plotting/parseArgsCommon.d.ts +64 -0
- package/dist-lib/numbl-core/plotting/parseArgsLine.d.ts +103 -0
- package/dist-lib/numbl-core/plotting/parseArgsPatch.d.ts +38 -0
- package/dist-lib/numbl-core/plotting/parseArgsQuiver.d.ts +32 -0
- package/dist-lib/numbl-core/plotting/parseArgsSurface.d.ts +75 -0
- package/dist-lib/numbl-core/plotting/streamline.d.ts +16 -0
- package/dist-lib/{graphics → numbl-core/plotting}/types.d.ts +9 -7
- package/dist-lib/numbl-core/runtime/cow.d.ts +0 -8
- package/dist-lib/numbl-core/runtime/refcount.d.ts +0 -3
- package/dist-lib/numbl-core/runtime/registerSpecial.d.ts +15 -0
- package/dist-lib/numbl-core/runtime/runtime.d.ts +11 -35
- package/dist-lib/numbl-core/runtime/runtimeDispatch.d.ts +6 -0
- package/dist-lib/numbl-core/runtime/specialBuiltins.d.ts +3 -9
- package/dist-lib/numbl-core/runtime/uihtmlSession.d.ts +5 -13
- package/dist-lib/numbl-core/runtime/utils.d.ts +4 -1
- package/dist-lib/numbl-core/version.d.ts +1 -1
- package/dist-lib/numbl-core/workspace/workspace.d.ts +64 -0
- package/dist-lib/vfs/unzipToFiles.d.ts +7 -0
- package/dist-plot-viewer/assets/index-C0fIevlp.js +4504 -0
- package/dist-plot-viewer/index.html +1 -1
- package/dist-site-viewer/assets/index-BDaviCH6.js +4832 -0
- package/dist-site-viewer/assets/numbl-worker-D6m4K2PP.js +5691 -0
- package/dist-site-viewer/index.html +2 -2
- package/native/numbl_addon.cpp +2 -12
- package/native/numbl_addon_common.h +0 -5
- package/package.json +6 -5
- package/dist-browser/hooks/useProjectFiles.d.ts +0 -45
- package/dist-browser/numbl-core/executors/context.d.ts +0 -76
- package/dist-browser/numbl-core/executors/index.d.ts +0 -14
- package/dist-browser/numbl-core/executors/jit/cJitCallExecutor.d.ts +0 -35
- package/dist-browser/numbl-core/executors/jit/cJitLoopExecutor.d.ts +0 -31
- package/dist-browser/numbl-core/executors/jit/cJitTopLevelExecutor.d.ts +0 -29
- package/dist-browser/numbl-core/helpers/dummy.d.ts +0 -5
- package/dist-browser/numbl-core/jit/runtime/context.d.ts +0 -23
- package/dist-browser/numbl-core/jit/runtime/inferType.d.ts +0 -10
- package/dist-browser/numbl-core/jit/runtime/value.d.ts +0 -101
- package/dist-browser/numbl-core/jit/workspace/driverPrologue.d.ts +0 -59
- package/dist-browser/numbl-core/jit/workspace/mtoc2UserFunctionLoader.d.ts +0 -62
- package/dist-browser/numbl-core/native/bridge-resolve.d.ts +0 -14
- package/dist-browser/numbl-core/runtime/plotUtils.d.ts +0 -336
- package/dist-browser/numbl-core/runtime/specialBuiltinNames.d.ts +0 -2
- package/dist-graphics/graphics/surfColormap.d.ts +0 -2
- package/dist-lib/numbl-core/executors/context.d.ts +0 -76
- package/dist-lib/numbl-core/executors/index.d.ts +0 -14
- package/dist-lib/numbl-core/executors/jit/cJitCallExecutor.d.ts +0 -35
- package/dist-lib/numbl-core/executors/jit/cJitLoopExecutor.d.ts +0 -31
- package/dist-lib/numbl-core/executors/jit/cJitTopLevelExecutor.d.ts +0 -29
- package/dist-lib/numbl-core/helpers/dummy.d.ts +0 -5
- package/dist-lib/numbl-core/jit/runtime/context.d.ts +0 -23
- package/dist-lib/numbl-core/jit/runtime/inferType.d.ts +0 -10
- package/dist-lib/numbl-core/jit/runtime/value.d.ts +0 -101
- package/dist-lib/numbl-core/jit/workspace/driverPrologue.d.ts +0 -59
- package/dist-lib/numbl-core/jit/workspace/mtoc2UserFunctionLoader.d.ts +0 -62
- package/dist-lib/numbl-core/native/bridge-resolve.d.ts +0 -14
- package/dist-lib/numbl-core/runtime/plotUtils.d.ts +0 -336
- package/dist-lib/numbl-core/runtime/specialBuiltinNames.d.ts +0 -2
- package/dist-plot-viewer/assets/index-YeXWXIxH.js +0 -4504
- package/dist-site-viewer/assets/index-DrtkDG_M.js +0 -4832
- package/dist-site-viewer/assets/numbl-worker-Dz_Z8B9u.js +0 -5327
- package/native/elemwise.cpp +0 -360
- package/native/unary_elemwise.cpp +0 -67
- /package/dist-browser/{graphics → numbl-core/plotting}/figuresReducer.d.ts +0 -0
- /package/dist-graphics/{graphics → numbl-core/plotting}/figuresReducer.d.ts +0 -0
- /package/dist-lib/{graphics → numbl-core/plotting}/figuresReducer.d.ts +0 -0
|
@@ -1,336 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utilities for parsing plot() arguments at runtime.
|
|
3
|
-
*
|
|
4
|
-
* Handles: plot(Y), plot(X,Y), plot(X1,Y1,...,Xn,Yn),
|
|
5
|
-
* plot(X1,Y1,LineSpec1,...), and Name-Value pairs like 'Color','r','LineWidth',2.
|
|
6
|
-
*/
|
|
7
|
-
import { type RuntimeValue } from "./types.js";
|
|
8
|
-
export type { PlotTrace, Plot3Trace, PatchTrace, SurfTrace, ImagescTrace, PcolorTrace, ContourTrace, BarTrace, Bar3Trace, ErrorBarTrace, BoxTrace, PieTrace, HeatmapTrace, QuiverTrace, Quiver3Trace, } from "../../graphics/types.js";
|
|
9
|
-
import type { PlotTrace, Plot3Trace, PatchTrace, SurfTrace, ImagescTrace, PcolorTrace, ContourTrace, BarTrace, Bar3Trace, ErrorBarTrace, BoxTrace, PieTrace, HeatmapTrace, QuiverTrace, Quiver3Trace } from "../../graphics/types.js";
|
|
10
|
-
export declare function resolveColor(v: RuntimeValue | string): [number, number, number] | undefined;
|
|
11
|
-
export interface ParsedLineSpec {
|
|
12
|
-
color?: string;
|
|
13
|
-
lineStyle?: string;
|
|
14
|
-
marker?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare function parsePlotArgs(args: RuntimeValue[]): PlotTrace[];
|
|
17
|
-
/**
|
|
18
|
-
* Parse plot3() arguments.
|
|
19
|
-
*
|
|
20
|
-
* Supported forms:
|
|
21
|
-
* plot3(X, Y, Z)
|
|
22
|
-
* plot3(X, Y, Z, LineSpec)
|
|
23
|
-
* plot3(X1,Y1,Z1,...,Xn,Yn,Zn)
|
|
24
|
-
* plot3(X1,Y1,Z1,LineSpec1,...,Xn,Yn,Zn,LineSpecn)
|
|
25
|
-
* plot3(..., Name, Value)
|
|
26
|
-
*/
|
|
27
|
-
export declare function parsePlot3Args(args: RuntimeValue[]): Plot3Trace[];
|
|
28
|
-
/** Result of parsing line() arguments: a set of 2-D or 3-D traces. */
|
|
29
|
-
export type ParsedLine = {
|
|
30
|
-
kind: "2d";
|
|
31
|
-
traces: PlotTrace[];
|
|
32
|
-
} | {
|
|
33
|
-
kind: "3d";
|
|
34
|
-
traces: Plot3Trace[];
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Parse line() arguments.
|
|
38
|
-
*
|
|
39
|
-
* Supported forms:
|
|
40
|
-
* line — line from (0,0) to (1,1)
|
|
41
|
-
* line(x, y) — 2-D line(s)
|
|
42
|
-
* line(x, y, z) — 3-D line(s)
|
|
43
|
-
* line(___, Name, Value) — Color/LineStyle/LineWidth/Marker/...
|
|
44
|
-
* line('XData', x, 'YData', y, ...) — low-level form (black line)
|
|
45
|
-
* line(ax, ___) — leading axes handle (ignored)
|
|
46
|
-
*
|
|
47
|
-
* Like plot/plot3, vector inputs make a single line and matrix inputs make one
|
|
48
|
-
* line per column.
|
|
49
|
-
*/
|
|
50
|
-
export declare function parseLineArgs(args: RuntimeValue[]): ParsedLine;
|
|
51
|
-
/** Apply a single patch property (lower-cased key) to the trace. Shared by the
|
|
52
|
-
* Name-Value, struct, and `set`/handle paths. */
|
|
53
|
-
export declare function applyPatchProp(trace: PatchTrace, key: string, val: RuntimeValue): void;
|
|
54
|
-
/**
|
|
55
|
-
* Parse patch() arguments into a canonical PatchTrace.
|
|
56
|
-
*
|
|
57
|
-
* Supported forms:
|
|
58
|
-
* patch(X, Y, C) — 2-D polygons, color C
|
|
59
|
-
* patch(X, Y, Z, C) — 3-D polygons
|
|
60
|
-
* patch('XData', X, 'YData', Y[, 'ZData', Z]) — coords as name-value
|
|
61
|
-
* patch('Faces', F, 'Vertices', V) — faces/vertices model
|
|
62
|
-
* patch(S) — struct of patch properties
|
|
63
|
-
* patch(___, Name, Value) — patch properties
|
|
64
|
-
* patch(ax, ___) — leading axes handle (ignored)
|
|
65
|
-
*/
|
|
66
|
-
export declare function parsePatchArgs(args: RuntimeValue[]): PatchTrace;
|
|
67
|
-
/**
|
|
68
|
-
* Parse fill() arguments into one patch trace per (X,Y,C) group. fill is the
|
|
69
|
-
* 2-D coordinate form of patch repeated over groups, so it reuses the patch
|
|
70
|
-
* vertex/color/property helpers — the only fill-specific logic is splitting
|
|
71
|
-
* the argument list into X,Y,C triplets.
|
|
72
|
-
*
|
|
73
|
-
* Supported forms:
|
|
74
|
-
* fill(X, Y, C)
|
|
75
|
-
* fill(X1, Y1, C1, ..., Xn, Yn, Cn)
|
|
76
|
-
* fill(___, Name, Value)
|
|
77
|
-
* fill(ax, ___)
|
|
78
|
-
*/
|
|
79
|
-
export declare function parseFillArgs(args: RuntimeValue[]): PatchTrace[];
|
|
80
|
-
/**
|
|
81
|
-
* Parse trimesh() arguments into a canonical PatchTrace.
|
|
82
|
-
*
|
|
83
|
-
* trimesh draws a triangular mesh and (per the MATLAB docs) returns a patch
|
|
84
|
-
* object, so it maps onto the PatchTrace model: the connectivity matrix T
|
|
85
|
-
* supplies the faces (one triangle per row, 1-based vertex indices) and the
|
|
86
|
-
* x/y[/z] vectors supply the vertices.
|
|
87
|
-
*
|
|
88
|
-
* Supported forms:
|
|
89
|
-
* trimesh(T, x, y) — 2-D triangular mesh
|
|
90
|
-
* trimesh(T, x, y, z) — 3-D triangular mesh
|
|
91
|
-
* trimesh(T, x, y, z, c) — c is per-vertex color data
|
|
92
|
-
* trimesh(TO) — triangulation object (struct exposing
|
|
93
|
-
* ConnectivityList + Points)
|
|
94
|
-
* trimesh(___, Name, Value) — patch properties
|
|
95
|
-
* trimesh(ax, ___) — leading axes handle (ignored)
|
|
96
|
-
*/
|
|
97
|
-
export declare function parseTriMeshArgs(args: RuntimeValue[]): PatchTrace;
|
|
98
|
-
/**
|
|
99
|
-
* Parse surf() arguments.
|
|
100
|
-
*
|
|
101
|
-
* Supported forms:
|
|
102
|
-
* surf(Z) — Z is m×n, X = 1:n, Y = 1:m
|
|
103
|
-
* surf(Z, C) — Z is m×n, C is m×n color data
|
|
104
|
-
* surf(X, Y, Z) — X, Y, Z are m×n matrices (or X is 1×n / Y is m×1)
|
|
105
|
-
* surf(X, Y, Z, C) — with explicit color data
|
|
106
|
-
* surf(..., Name, Value) — name-value pairs
|
|
107
|
-
*/
|
|
108
|
-
export declare function parseSurfArgs(args: RuntimeValue[]): SurfTrace;
|
|
109
|
-
/**
|
|
110
|
-
* Parse pcolor() arguments.
|
|
111
|
-
*
|
|
112
|
-
* Supported forms:
|
|
113
|
-
* pcolor(C) — C is m×n, X = 1:n, Y = 1:m
|
|
114
|
-
* pcolor(X, Y, C) — X, Y, C are m×n matrices (or X is 1×n / Y is m×1)
|
|
115
|
-
* pcolor(..., Name, Value) — name-value pairs (EdgeColor, FaceAlpha)
|
|
116
|
-
*/
|
|
117
|
-
export declare function parsePcolorArgs(args: RuntimeValue[]): PcolorTrace;
|
|
118
|
-
/**
|
|
119
|
-
* Parse scatter() arguments.
|
|
120
|
-
*
|
|
121
|
-
* Supported forms:
|
|
122
|
-
* scatter(X, Y)
|
|
123
|
-
* scatter(X, Y, sz)
|
|
124
|
-
* scatter(X, Y, sz, c)
|
|
125
|
-
* scatter(X, Y, ..., 'filled')
|
|
126
|
-
* scatter(X, Y, ..., mkr)
|
|
127
|
-
* scatter(X, Y, ..., Name, Value)
|
|
128
|
-
*/
|
|
129
|
-
export declare function parseScatterArgs(args: RuntimeValue[]): PlotTrace[];
|
|
130
|
-
/**
|
|
131
|
-
* Parse imagesc() arguments.
|
|
132
|
-
*
|
|
133
|
-
* Supported forms:
|
|
134
|
-
* imagesc(C) — C is m×n matrix
|
|
135
|
-
* imagesc(x, y, C) — x and y are vectors defining axis limits
|
|
136
|
-
*/
|
|
137
|
-
export declare function parseImagescArgs(args: RuntimeValue[]): ImagescTrace;
|
|
138
|
-
/**
|
|
139
|
-
* Parse contour()/contourf() arguments.
|
|
140
|
-
*
|
|
141
|
-
* Supported forms:
|
|
142
|
-
* contour(Z)
|
|
143
|
-
* contour(Z, N)
|
|
144
|
-
* contour(X, Y, Z)
|
|
145
|
-
* contour(X, Y, Z, N)
|
|
146
|
-
* contour(..., Name, Value)
|
|
147
|
-
*/
|
|
148
|
-
export declare function parseContourArgs(args: RuntimeValue[], filled: boolean): ContourTrace;
|
|
149
|
-
/** Result of computing contour geometry: the MATLAB contour matrix `C`
|
|
150
|
-
* (column-major `2 × n` data) plus the level list actually used. */
|
|
151
|
-
export interface ContourMatrix {
|
|
152
|
-
/** Column-major `2 × n` data for a `RTV.tensor(data, [2, n])`. */
|
|
153
|
-
data: number[];
|
|
154
|
-
n: number;
|
|
155
|
-
levelList: number[];
|
|
156
|
-
}
|
|
157
|
-
/** Compute the MATLAB contour matrix for a parsed contour trace via marching
|
|
158
|
-
* squares. Each marching-squares segment is emitted as its own two-vertex
|
|
159
|
-
* contour line (header `[level; 2]` followed by the two `[x; y]` vertices) —
|
|
160
|
-
* a valid contour matrix whose geometry matches MATLAB's connected polylines
|
|
161
|
-
* segment-for-segment. */
|
|
162
|
-
export declare function computeContourMatrix(trace: ContourTrace): ContourMatrix;
|
|
163
|
-
/**
|
|
164
|
-
* Parse mesh() arguments — same as surf but with different default rendering.
|
|
165
|
-
*/
|
|
166
|
-
export declare function parseMeshArgs(args: RuntimeValue[]): SurfTrace;
|
|
167
|
-
/**
|
|
168
|
-
* Parse bar() arguments.
|
|
169
|
-
*
|
|
170
|
-
* Supported forms:
|
|
171
|
-
* bar(Y) — Y values with x = 1:length(Y)
|
|
172
|
-
* bar(X, Y) — explicit X positions
|
|
173
|
-
* bar(..., width) — relative bar width (scalar 0–1)
|
|
174
|
-
* bar(..., color) — single-char color spec
|
|
175
|
-
*/
|
|
176
|
-
export declare function parseBarArgs(args: RuntimeValue[]): BarTrace[];
|
|
177
|
-
/**
|
|
178
|
-
* Parse barh() arguments — same forms as bar() but rendered horizontally.
|
|
179
|
-
*
|
|
180
|
-
* Supported forms:
|
|
181
|
-
* barh(Y) — Y values (bar lengths) with positions = 1:length(Y)
|
|
182
|
-
* barh(X, Y) — explicit positions X, bar lengths Y
|
|
183
|
-
* barh(..., width) — relative bar thickness (scalar 0–1)
|
|
184
|
-
* barh(..., color) — single-char color spec
|
|
185
|
-
*/
|
|
186
|
-
export declare function parseBarHArgs(args: RuntimeValue[]): BarTrace[];
|
|
187
|
-
/**
|
|
188
|
-
* Parse bar3() / bar3h() arguments.
|
|
189
|
-
*
|
|
190
|
-
* Supported forms:
|
|
191
|
-
* bar3(Z) — Z values with y = 1:m, x = 1:n
|
|
192
|
-
* bar3(Y, Z) — explicit Y positions
|
|
193
|
-
* bar3(..., width) — relative bar width (scalar 0–1)
|
|
194
|
-
* bar3(..., color) — single-char color spec
|
|
195
|
-
*/
|
|
196
|
-
export declare function parseBar3Args(args: RuntimeValue[]): Bar3Trace;
|
|
197
|
-
/**
|
|
198
|
-
* Parse stairs() arguments — same forms as plot() but with staircase-transformed coordinates.
|
|
199
|
-
*
|
|
200
|
-
* Supported forms:
|
|
201
|
-
* stairs(Y)
|
|
202
|
-
* stairs(X, Y)
|
|
203
|
-
* stairs(..., LineSpec)
|
|
204
|
-
* stairs(..., Name, Value)
|
|
205
|
-
*/
|
|
206
|
-
export declare function parseStairsArgs(args: RuntimeValue[]): PlotTrace[];
|
|
207
|
-
/**
|
|
208
|
-
* Parse errorbar() arguments.
|
|
209
|
-
*
|
|
210
|
-
* Supported forms:
|
|
211
|
-
* errorbar(y, err) — symmetric vertical
|
|
212
|
-
* errorbar(x, y, err) — symmetric vertical with explicit x
|
|
213
|
-
* errorbar(x, y, neg, pos) — asymmetric vertical
|
|
214
|
-
* errorbar(x, y, yneg, ypos, xneg, xpos) — both axes
|
|
215
|
-
* errorbar(..., LineSpec)
|
|
216
|
-
*/
|
|
217
|
-
export declare function parseErrorBarArgs(args: RuntimeValue[]): ErrorBarTrace[];
|
|
218
|
-
/**
|
|
219
|
-
* Parse area() arguments.
|
|
220
|
-
*
|
|
221
|
-
* Supported forms:
|
|
222
|
-
* area(Y) — fill under Y with x = 1:length(Y)
|
|
223
|
-
* area(X, Y) — explicit X
|
|
224
|
-
* area(..., basevalue) — scalar baseline (default 0)
|
|
225
|
-
* area(..., Name, Value)
|
|
226
|
-
*
|
|
227
|
-
* Returns { traces, baseValue }.
|
|
228
|
-
*/
|
|
229
|
-
export declare function parseAreaArgs(args: RuntimeValue[]): {
|
|
230
|
-
traces: PlotTrace[];
|
|
231
|
-
baseValue: number;
|
|
232
|
-
};
|
|
233
|
-
/**
|
|
234
|
-
* Parse scatter3() arguments.
|
|
235
|
-
*
|
|
236
|
-
* Supported forms:
|
|
237
|
-
* scatter3(X, Y, Z)
|
|
238
|
-
* scatter3(X, Y, Z, S)
|
|
239
|
-
* scatter3(X, Y, Z, S, C)
|
|
240
|
-
* scatter3(..., 'filled')
|
|
241
|
-
* scatter3(..., markertype)
|
|
242
|
-
*/
|
|
243
|
-
export declare function parseScatter3Args(args: RuntimeValue[]): Plot3Trace[];
|
|
244
|
-
/**
|
|
245
|
-
* Parse histogram() arguments.
|
|
246
|
-
*
|
|
247
|
-
* Supported forms:
|
|
248
|
-
* histogram(X)
|
|
249
|
-
* histogram(X, nbins)
|
|
250
|
-
* histogram(X, edges)
|
|
251
|
-
*/
|
|
252
|
-
export declare function parseHistogramArgs(args: RuntimeValue[]): BarTrace[];
|
|
253
|
-
/**
|
|
254
|
-
* Parse histogram2() arguments.
|
|
255
|
-
*
|
|
256
|
-
* Supported forms:
|
|
257
|
-
* histogram2(X, Y)
|
|
258
|
-
* histogram2(X, Y, nbins) — nbins is scalar or [nx, ny]
|
|
259
|
-
* histogram2(X, Y, Xedges, Yedges)
|
|
260
|
-
*/
|
|
261
|
-
export declare function parseHistogram2Args(args: RuntimeValue[]): Bar3Trace;
|
|
262
|
-
/**
|
|
263
|
-
* Parse boxchart() arguments.
|
|
264
|
-
*
|
|
265
|
-
* Supported forms:
|
|
266
|
-
* boxchart(ydata) — one box per column of ydata
|
|
267
|
-
* boxchart(xgroupdata, ydata) — group ydata by unique values in xgroupdata
|
|
268
|
-
*/
|
|
269
|
-
export declare function parseBoxchartArgs(args: RuntimeValue[]): BoxTrace[];
|
|
270
|
-
/**
|
|
271
|
-
* Parse swarmchart() arguments.
|
|
272
|
-
*
|
|
273
|
-
* Supported forms:
|
|
274
|
-
* swarmchart(x, y)
|
|
275
|
-
* swarmchart(x, y, sz)
|
|
276
|
-
* swarmchart(x, y, sz, c)
|
|
277
|
-
* swarmchart(..., 'filled')
|
|
278
|
-
* swarmchart(..., markertype)
|
|
279
|
-
*/
|
|
280
|
-
export declare function parseSwarmchartArgs(args: RuntimeValue[]): PlotTrace[];
|
|
281
|
-
/**
|
|
282
|
-
* Parse swarmchart3() arguments.
|
|
283
|
-
*
|
|
284
|
-
* Supported forms:
|
|
285
|
-
* swarmchart3(x, y, z)
|
|
286
|
-
* swarmchart3(x, y, z, sz)
|
|
287
|
-
* swarmchart3(x, y, z, sz, c)
|
|
288
|
-
* swarmchart3(..., 'filled')
|
|
289
|
-
* swarmchart3(..., markertype)
|
|
290
|
-
*/
|
|
291
|
-
export declare function parseSwarmchart3Args(args: RuntimeValue[]): Plot3Trace[];
|
|
292
|
-
/**
|
|
293
|
-
* Parse piechart() / donutchart() arguments.
|
|
294
|
-
*
|
|
295
|
-
* Supported forms:
|
|
296
|
-
* piechart(data)
|
|
297
|
-
* piechart(data, names)
|
|
298
|
-
*
|
|
299
|
-
* @param innerRadius 0 for pie, >0 for donut
|
|
300
|
-
*/
|
|
301
|
-
export declare function parsePiechartArgs(args: RuntimeValue[], innerRadius: number): PieTrace;
|
|
302
|
-
/**
|
|
303
|
-
* Parse heatmap() arguments.
|
|
304
|
-
*
|
|
305
|
-
* Supported forms:
|
|
306
|
-
* heatmap(cdata) — matrix of values
|
|
307
|
-
* heatmap(xvalues, yvalues, cdata) — with axis labels
|
|
308
|
-
*/
|
|
309
|
-
export declare function parseHeatmapArgs(args: RuntimeValue[]): HeatmapTrace;
|
|
310
|
-
/**
|
|
311
|
-
* Parse quiver() arguments.
|
|
312
|
-
*
|
|
313
|
-
* Supported forms:
|
|
314
|
-
* quiver(U, V)
|
|
315
|
-
* quiver(X, Y, U, V)
|
|
316
|
-
* quiver(..., scale) — scale: nonnegative number or 'off'
|
|
317
|
-
* quiver(..., LineSpec)
|
|
318
|
-
* quiver(..., LineSpec, 'filled')
|
|
319
|
-
* quiver(..., Name, Value) — Color, LineStyle, LineWidth, ShowArrowHead, etc.
|
|
320
|
-
*
|
|
321
|
-
* X, Y, U, V can be vectors or matrices. If U,V are matrices and X,Y are
|
|
322
|
-
* vectors, X and Y are expanded to a meshgrid.
|
|
323
|
-
*/
|
|
324
|
-
export declare function parseQuiverArgs(args: RuntimeValue[]): QuiverTrace[];
|
|
325
|
-
/**
|
|
326
|
-
* Parse quiver3() arguments.
|
|
327
|
-
*
|
|
328
|
-
* Supported forms:
|
|
329
|
-
* quiver3(Z, U, V, W)
|
|
330
|
-
* quiver3(X, Y, Z, U, V, W)
|
|
331
|
-
* quiver3(..., scale) — scale: nonnegative number or 'off'
|
|
332
|
-
* quiver3(..., LineSpec)
|
|
333
|
-
* quiver3(..., LineSpec, 'filled')
|
|
334
|
-
* quiver3(..., Name, Value) — Color, LineStyle, LineWidth, ShowArrowHead, …
|
|
335
|
-
*/
|
|
336
|
-
export declare function parseQuiver3Args(args: RuntimeValue[]): Quiver3Trace;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Dispatch context — passed to every executor call.
|
|
3
|
-
*
|
|
4
|
-
* Provides env access, type-info queries, sub-dispatch into the
|
|
5
|
-
* registry, and runtime callbacks. Memoizes type-info lookups for the
|
|
6
|
-
* lifetime of a single dispatch so repeated `typeOf(name)` calls from
|
|
7
|
-
* different executors don't re-infer.
|
|
8
|
-
*/
|
|
9
|
-
import type { Interpreter } from "../interpreter/interpreter.js";
|
|
10
|
-
import type { Stmt } from "../parser/types.js";
|
|
11
|
-
import type { ControlSignal } from "../interpreter/types.js";
|
|
12
|
-
import type { Registry } from "./registry.js";
|
|
13
|
-
import { type JitType } from "../jitTypes.js";
|
|
14
|
-
export declare class DispatchContext {
|
|
15
|
-
readonly interp: Interpreter;
|
|
16
|
-
readonly registry: Registry;
|
|
17
|
-
/** When true, only no-bail executors are eligible. Set when the
|
|
18
|
-
* caller's compiled artifact has emitted observable side effects
|
|
19
|
-
* that mustn't repeat. */
|
|
20
|
-
readonly requireNoBail: boolean;
|
|
21
|
-
/** Per-dispatch memoization of typeOf(name) lookups. */
|
|
22
|
-
private readonly typeCache;
|
|
23
|
-
/** Re-entrancy guard: which executors are currently running on
|
|
24
|
-
* which head stmts. Prevents an executor sub-dispatching back into
|
|
25
|
-
* itself on the same stmt. */
|
|
26
|
-
private readonly active;
|
|
27
|
-
/** Sibling list and head index for the current dispatch. Set by
|
|
28
|
-
* Registry.dispatch before calling executors; read by peekSibling.
|
|
29
|
-
* Most executors don't read these directly. */
|
|
30
|
-
private _siblings;
|
|
31
|
-
private _i;
|
|
32
|
-
constructor(interp: Interpreter, registry: Registry, requireNoBail: boolean, active?: Set<string>);
|
|
33
|
-
/** Look up a name's JitType from the interpreter env, memoized. */
|
|
34
|
-
typeOf(name: string): JitType;
|
|
35
|
-
/** Read a value from env (no inference). Returns undefined if unbound. */
|
|
36
|
-
envValue(name: string): unknown;
|
|
37
|
-
/** Peek at a sibling stmt at `offset` from the current head.
|
|
38
|
-
* offset=0 is the current stmt; positive values look ahead.
|
|
39
|
-
* Returns null if the offset is past the end of the scope. Used by
|
|
40
|
-
* chain-style executors that may consume multiple consecutive
|
|
41
|
-
* stmts. */
|
|
42
|
-
peekSibling(offset: number): Stmt | null;
|
|
43
|
-
/** Sibling list of the current scope. The head stmt is at
|
|
44
|
-
* `siblings[headIndex]`. Most executors don't need this directly —
|
|
45
|
-
* use `peekSibling(offset)` for lookahead. The rare cases that
|
|
46
|
-
* forward the raw list to a legacy adapter (the chain executor) or
|
|
47
|
-
* claim the whole scope (the top-level executor) read these. */
|
|
48
|
-
get siblings(): readonly Stmt[];
|
|
49
|
-
get headIndex(): number;
|
|
50
|
-
/** @internal Set the position state for an upcoming dispatch. Only
|
|
51
|
-
* the registry calls this. */
|
|
52
|
-
_setPosition(siblings: readonly Stmt[], i: number): void;
|
|
53
|
-
/** Reset per-dispatch state so this context can be reused for the
|
|
54
|
-
* next stmt in a sibling loop. The reentrancy guard is expected to
|
|
55
|
-
* already be empty (every pushActive is paired with a popActive in
|
|
56
|
-
* Registry.runCandidate's finally). */
|
|
57
|
-
resetForNextDispatch(): void;
|
|
58
|
-
/** Construct a child context for sub-dispatch. `requireNoBail` is
|
|
59
|
-
* the OR of the parent flag and the parent executor's
|
|
60
|
-
* `requireNoBailInChildren` declaration. */
|
|
61
|
-
childContext(requireNoBail: boolean): DispatchContext;
|
|
62
|
-
/** @internal Whether the reentrancy guard has any entries. The
|
|
63
|
-
* registry uses this to skip the guard check on the hot path —
|
|
64
|
-
* when nothing is active there's nothing to detect. */
|
|
65
|
-
get hasActive(): boolean;
|
|
66
|
-
/** @internal Used by the registry's reentrancy guard. Pre-checked
|
|
67
|
-
* with hasActive on the hot path, so the actual `has` only fires
|
|
68
|
-
* during sub-dispatch. */
|
|
69
|
-
isActive(executorName: string, stmt: Stmt): boolean;
|
|
70
|
-
/** @internal */
|
|
71
|
-
pushActive(executorName: string, stmt: Stmt): void;
|
|
72
|
-
/** @internal */
|
|
73
|
-
popActive(executorName: string, stmt: Stmt): void;
|
|
74
|
-
}
|
|
75
|
-
/** Re-export for the runner's signal type. */
|
|
76
|
-
export type { ControlSignal };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Executor registry — public surface.
|
|
3
|
-
*
|
|
4
|
-
* See docs/developer_reference/executors.md for the design.
|
|
5
|
-
*/
|
|
6
|
-
export type { Executor, CostEstimate, BailReason, RunResult, Proposal, } from "./types.js";
|
|
7
|
-
export { Registry, makeRootContext } from "./registry.js";
|
|
8
|
-
export type { DispatchResult, CallDispatchResult, WholeScopeResult, } from "./registry.js";
|
|
9
|
-
export { DispatchContext } from "./context.js";
|
|
10
|
-
export { ExecutorCache } from "./cache.js";
|
|
11
|
-
export type { JitType, SignCategory } from "../jitTypes.js";
|
|
12
|
-
export { jitTypeKey, unifyJitTypes, isScalarType, isTensorType, isComplexType, isKnownInteger, } from "../jitTypes.js";
|
|
13
|
-
export { inferJitType } from "../interpreter/builtins/types.js";
|
|
14
|
-
export { registerExecutorsForOpt } from "./plugins.js";
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* cjit-call — C-backed JIT executor for user-function calls.
|
|
3
|
-
*
|
|
4
|
-
* Mirrors `callExecutor.ts` (the JS-emit sibling) but routes the
|
|
5
|
-
* specialization's emitted code through `compileSpecC` →
|
|
6
|
-
* `cc -shared -fPIC -O3` → `dlopen` via koffi instead of
|
|
7
|
-
* `new Function(source)`. The dispatch, gating, and caching
|
|
8
|
-
* conventions are otherwise identical, so a sibling executor can
|
|
9
|
-
* register alongside the JS path at the same opt level without any
|
|
10
|
-
* arbitration in the dispatcher beyond cost-based selection.
|
|
11
|
-
*
|
|
12
|
-
* Declines when:
|
|
13
|
-
* - `nativeBridge` / `koffi` are not available (browser).
|
|
14
|
-
* - Any param or output type fails the C-FFI feasibility check
|
|
15
|
-
* (`compilerTypeToCDecl` returns null).
|
|
16
|
-
* - mtoc2 throws `UnsupportedConstruct` / `JitTypeError` at lowering.
|
|
17
|
-
*/
|
|
18
|
-
import type { Executor } from "../types.js";
|
|
19
|
-
import { type JitType } from "../../jitTypes.js";
|
|
20
|
-
import type { FunctionDef } from "../../interpreter/types.js";
|
|
21
|
-
import { type Type as CompilerType, type SpecCSignature } from "../../jit/index.js";
|
|
22
|
-
import { type CompiledC } from "./compileC.js";
|
|
23
|
-
interface CJitCallData {
|
|
24
|
-
readonly fn: FunctionDef;
|
|
25
|
-
readonly nargout: number;
|
|
26
|
-
readonly argTypes: readonly JitType[];
|
|
27
|
-
readonly compilerArgTypes: readonly CompilerType[];
|
|
28
|
-
readonly args: readonly unknown[];
|
|
29
|
-
}
|
|
30
|
-
interface CompiledArtifact {
|
|
31
|
-
readonly compiled: CompiledC;
|
|
32
|
-
readonly signature: SpecCSignature;
|
|
33
|
-
}
|
|
34
|
-
export declare const cJitCallExecutor: Executor<CJitCallData, CompiledArtifact | null>;
|
|
35
|
-
export {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* cjit-loop — C-backed JIT executor for outermost For/While
|
|
3
|
-
* loops. Mirrors `loopExecutor.ts` (JS-emit sibling) but routes
|
|
4
|
-
* through `compileSpecC` → `cc -shared` → `koffi`. See
|
|
5
|
-
* `cJitCallExecutor.ts` for the marshaling protocol; this file just
|
|
6
|
-
* adapts the loop-shape `data` to the same C-side pipeline.
|
|
7
|
-
*/
|
|
8
|
-
import type { Executor } from "../types.js";
|
|
9
|
-
import { type JitType } from "../../jitTypes.js";
|
|
10
|
-
import type { Stmt } from "../../parser/index.js";
|
|
11
|
-
import type { ConstHandle } from "../classification.js";
|
|
12
|
-
import { type Type as CompilerType, type SpecCSignature } from "../../jit/index.js";
|
|
13
|
-
import { type CompiledC } from "./compileC.js";
|
|
14
|
-
interface CJitLoopData {
|
|
15
|
-
readonly loopStmt: Stmt & {
|
|
16
|
-
type: "For" | "While";
|
|
17
|
-
};
|
|
18
|
-
readonly inputs: readonly string[];
|
|
19
|
-
readonly outputs: readonly string[];
|
|
20
|
-
readonly inputTypes: readonly JitType[];
|
|
21
|
-
readonly compilerInputTypes: readonly CompilerType[];
|
|
22
|
-
readonly constHandles: readonly ConstHandle[];
|
|
23
|
-
readonly currentFile: string;
|
|
24
|
-
readonly cacheKey: string;
|
|
25
|
-
}
|
|
26
|
-
interface CompiledArtifact {
|
|
27
|
-
readonly compiled: CompiledC;
|
|
28
|
-
readonly signature: SpecCSignature;
|
|
29
|
-
}
|
|
30
|
-
export declare const cJitLoopExecutor: Executor<CJitLoopData, CompiledArtifact | null>;
|
|
31
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* cjit-top-level — C-backed JIT executor for whole-script bodies.
|
|
3
|
-
*
|
|
4
|
-
* Mirrors `topLevelExecutor.ts` (JS-emit sibling) but routes through
|
|
5
|
-
* `compileSpecC` → `cc -shared` → `koffi`. See `cJitCallExecutor.ts`
|
|
6
|
-
* for the marshaling protocol. Same `isAllSuppressed` gate as the JS
|
|
7
|
-
* sibling so `displayAssign`/`displayResult` semantics stay on the
|
|
8
|
-
* interpreter path.
|
|
9
|
-
*/
|
|
10
|
-
import type { Executor } from "../types.js";
|
|
11
|
-
import { type JitType } from "../../jitTypes.js";
|
|
12
|
-
import type { Stmt } from "../../parser/index.js";
|
|
13
|
-
import { type Type as CompilerType, type SpecCSignature } from "../../jit/index.js";
|
|
14
|
-
import { type CompiledC } from "./compileC.js";
|
|
15
|
-
interface CJitTopLevelData {
|
|
16
|
-
readonly stmts: readonly Stmt[];
|
|
17
|
-
readonly inputs: readonly string[];
|
|
18
|
-
readonly outputs: readonly string[];
|
|
19
|
-
readonly inputTypes: readonly JitType[];
|
|
20
|
-
readonly compilerInputTypes: readonly CompilerType[];
|
|
21
|
-
readonly currentFile: string;
|
|
22
|
-
readonly cacheKey: string;
|
|
23
|
-
}
|
|
24
|
-
interface CompiledArtifact {
|
|
25
|
-
readonly compiled: CompiledC;
|
|
26
|
-
readonly signature: SpecCSignature;
|
|
27
|
-
}
|
|
28
|
-
export declare const cJitTopLevelExecutor: Executor<CJitTopLevelData, CompiledArtifact | null>;
|
|
29
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Host bag passed to `Builtin.call` for the interpreter backend.
|
|
3
|
-
*
|
|
4
|
-
* Mirrors nexl's `RuntimeContext`. Side-effecty builtins (`disp`,
|
|
5
|
-
* `fprintf`, `error`, plot dispatch, …) consult `helpers.write` to
|
|
6
|
-
* emit text. Pure builtins ignore the bag.
|
|
7
|
-
*
|
|
8
|
-
* `write` is the JS analogue of C's `printf`. The CLI provides one
|
|
9
|
-
* backed by `process.stdout.write`; the browser provides one that
|
|
10
|
-
* pushes lines to the console panel; future test runners provide
|
|
11
|
-
* one that captures into a buffer for byte-for-byte comparison.
|
|
12
|
-
*
|
|
13
|
-
* As the interpreter grows, additional hooks (`time`, `plot`,
|
|
14
|
-
* `error`, …) will join this bag. Adding a hook here is the
|
|
15
|
-
* single source of truth — every host supplies it.
|
|
16
|
-
*/
|
|
17
|
-
export interface RuntimeHelpers {
|
|
18
|
-
/** Append text to stdout. No implicit newline. */
|
|
19
|
-
write(s: string): void;
|
|
20
|
-
}
|
|
21
|
-
export interface RuntimeContext {
|
|
22
|
-
helpers: RuntimeHelpers;
|
|
23
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Map a runtime value back into a Type. Used by the interpreter to
|
|
3
|
-
* feed `argTypes` into a builtin's `transfer` (for validation) and
|
|
4
|
-
* `call` (for type-dispatched implementations) — so that the three
|
|
5
|
-
* hooks (`emitC`, `emitJs`, `call`) all branch on the same `argTypes`
|
|
6
|
-
* shape rather than reinventing dispatch per-backend.
|
|
7
|
-
*/
|
|
8
|
-
import { type Type } from "../lowering/types.js";
|
|
9
|
-
import { type RuntimeValue } from "./value.js";
|
|
10
|
-
export declare function inferTypeFromValue(v: RuntimeValue): Type;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Runtime value carrier for the interpreter backend. Mirrors nexl's
|
|
3
|
-
* `RuntimeValue` design: a discriminated-via-typeof union for the
|
|
4
|
-
* common cases plus tagged-object wrappers for the kinds JS can't
|
|
5
|
-
* distinguish natively.
|
|
6
|
-
*
|
|
7
|
-
* MVP scope (Phase 3): real-double scalars, booleans (logical),
|
|
8
|
-
* strings (double-quoted), chars (single-quoted), real-double tensors.
|
|
9
|
-
* Complex / structs / classes / handles / void / cells follow as the
|
|
10
|
-
* type lattice and interpreter coverage expand.
|
|
11
|
-
*
|
|
12
|
-
* Builtin `call` implementations narrow via `typeof` / `isTensor` /
|
|
13
|
-
* `isChar` and dispatch through the same `argTypes` shape that
|
|
14
|
-
* `emitC` / `emitJs` consume — keeping the three backends parallel.
|
|
15
|
-
*/
|
|
16
|
-
export type RuntimeValue = number | boolean | string | RuntimeTensor | RuntimeChar | RuntimeComplex | RuntimeStruct | RuntimeHandle;
|
|
17
|
-
/** Function handle. Named handles (`@foo`) keep the source name and
|
|
18
|
-
* dispatch via the interpreter's normal call-site resolution at the
|
|
19
|
-
* call point. Anonymous handles (`@(p1, ...) body`) capture every
|
|
20
|
-
* visible binding by value at the @-site and run `body` in a fresh
|
|
21
|
-
* env when invoked. */
|
|
22
|
-
export type RuntimeHandle = {
|
|
23
|
-
readonly mtoc2Handle: true;
|
|
24
|
-
readonly kind: "named";
|
|
25
|
-
readonly name: string;
|
|
26
|
-
} | {
|
|
27
|
-
readonly mtoc2Handle: true;
|
|
28
|
-
readonly kind: "anon";
|
|
29
|
-
readonly params: ReadonlyArray<string>;
|
|
30
|
-
readonly body: unknown;
|
|
31
|
-
readonly captures: Readonly<Record<string, RuntimeValue>>;
|
|
32
|
-
};
|
|
33
|
-
/** Narrow a RuntimeValue to a function handle. */
|
|
34
|
-
export declare function isHandleValue(v: RuntimeValue): v is RuntimeHandle;
|
|
35
|
-
/** Struct/object — plain JS object whose keys are field names. The
|
|
36
|
-
* c-aot path emits a typedef'd C struct; the JS path just uses a
|
|
37
|
-
* bare object. Recurses through field values that may themselves be
|
|
38
|
-
* any RuntimeValue (including nested structs). */
|
|
39
|
-
export type RuntimeStruct = {
|
|
40
|
-
readonly [field: string]: RuntimeValue;
|
|
41
|
-
};
|
|
42
|
-
/** Real or complex double tensor. `data` is the real lane,
|
|
43
|
-
* column-major to match numbl's `RuntimeTensor.data`. `imag` is the
|
|
44
|
-
* imaginary lane (same length and orientation as `data`); absent for
|
|
45
|
-
* real-only tensors. Mirrors the C representation's split-buffer
|
|
46
|
-
* layout — codegen / interpreter dispatch on `imag !== undefined`
|
|
47
|
-
* the way the C side dispatches on `imag != NULL`. The shape array
|
|
48
|
-
* is owned by the value; do not mutate.
|
|
49
|
-
*
|
|
50
|
-
* `isLogical` flags this tensor as the result of a logical operation
|
|
51
|
-
* (`~`, `<`, `==`, `&&`, …) so downstream index-slot resolution can
|
|
52
|
-
* treat it as a mask instead of an IndexVec — same role as numbl's
|
|
53
|
-
* `_isLogical` on its RuntimeTensor. The flag is one-way (once set,
|
|
54
|
-
* stays set across copies via the helper) and absent on numeric
|
|
55
|
-
* tensors; helper sites that don't care leave it undefined. */
|
|
56
|
-
export interface RuntimeTensor {
|
|
57
|
-
readonly mtoc2Tag: "tensor";
|
|
58
|
-
readonly shape: number[];
|
|
59
|
-
readonly data: Float64Array;
|
|
60
|
-
readonly imag?: Float64Array;
|
|
61
|
-
readonly isLogical?: boolean;
|
|
62
|
-
}
|
|
63
|
-
/** Single-quoted char-array (`'foo'`). Distinct from `"foo"` strings
|
|
64
|
-
* because numbl treats them differently: `length('foo') === 3` but
|
|
65
|
-
* `length("foo") === 1`. */
|
|
66
|
-
export interface RuntimeChar {
|
|
67
|
-
readonly mtoc2Tag: "char";
|
|
68
|
-
readonly value: string;
|
|
69
|
-
}
|
|
70
|
-
/** Scalar complex value — JS-side analogue of the `mtoc2_complex_t`
|
|
71
|
-
* struct in `cscalar.h`. The cscalar runtime helpers
|
|
72
|
-
* (`mtoc2_cmake`, `mtoc2_creal`, etc.) consume and produce this
|
|
73
|
-
* shape. We DON'T tag it the way tensor / char are tagged because
|
|
74
|
-
* emitJs literals (`{re: 0, im: 1}`) and runtime calls produce the
|
|
75
|
-
* bare object form — adding a tag would force every helper to
|
|
76
|
-
* re-wrap. Use `isComplexValue` for narrowing. */
|
|
77
|
-
export interface RuntimeComplex {
|
|
78
|
-
readonly re: number;
|
|
79
|
-
readonly im: number;
|
|
80
|
-
}
|
|
81
|
-
/** Narrow a RuntimeValue to a complex scalar. Matches the cscalar
|
|
82
|
-
* helpers' `{re, im}` shape. */
|
|
83
|
-
export declare function isComplexValue(v: RuntimeValue): v is RuntimeComplex;
|
|
84
|
-
export declare function makeTensor(shape: number[], data: Float64Array): RuntimeTensor;
|
|
85
|
-
/** Complex tensor with both lanes. `data` is the real lane, `imag`
|
|
86
|
-
* the imaginary lane; both must have the same length and match the
|
|
87
|
-
* product of `shape`. */
|
|
88
|
-
export declare function makeComplexTensor(shape: number[], data: Float64Array, imag: Float64Array): RuntimeTensor;
|
|
89
|
-
/** True iff this tensor carries an imaginary lane. */
|
|
90
|
-
export declare function isComplexTensor(v: RuntimeTensor): boolean;
|
|
91
|
-
export declare function makeChar(value: string): RuntimeChar;
|
|
92
|
-
export declare function isTensor(v: RuntimeValue): v is RuntimeTensor;
|
|
93
|
-
export declare function isChar(v: RuntimeValue): v is RuntimeChar;
|
|
94
|
-
/** Materialize a scalar value as a plain JS number. Used by builtins
|
|
95
|
-
* that need to treat scalar tensors and scalar numbers uniformly. */
|
|
96
|
-
export declare function toScalarNumber(v: RuntimeValue): number;
|
|
97
|
-
/** MATLAB-style truthiness — for `if` / `while` / `&&` / `||`.
|
|
98
|
-
* Scalar non-zero, all-elements-non-zero for tensors, nonempty
|
|
99
|
-
* text. The interpreter uses this; codegen relies on the matching
|
|
100
|
-
* C-side `__nonzero` helpers. */
|
|
101
|
-
export declare function isTruthy(v: RuntimeValue): boolean;
|