numbl 0.4.8 → 0.4.9

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.
Files changed (543) hide show
  1. package/dist-browser/browser/index.d.ts +21 -0
  2. package/dist-browser/browser/mip.d.ts +10 -0
  3. package/dist-browser/browser/protocol.d.ts +59 -0
  4. package/dist-browser/browser/session.d.ts +55 -0
  5. package/dist-browser/browser/system-store.d.ts +30 -0
  6. package/dist-browser/browser/worker.d.ts +1 -0
  7. package/dist-browser/browser.js +131 -0
  8. package/dist-browser/db/operations.d.ts +25 -0
  9. package/dist-browser/db/schema.d.ts +26 -0
  10. package/dist-browser/graphics/axisLimits.d.ts +23 -0
  11. package/dist-browser/graphics/figuresReducer.d.ts +86 -0
  12. package/dist-browser/graphics/types.d.ts +423 -0
  13. package/dist-browser/hooks/useProjectFiles.d.ts +45 -0
  14. package/dist-browser/numbl-core/diagnostics/errors.d.ts +8 -0
  15. package/dist-browser/numbl-core/diagnostics/index.d.ts +27 -0
  16. package/dist-browser/numbl-core/executeCode.d.ts +108 -0
  17. package/dist-browser/numbl-core/executors/cache.d.ts +26 -0
  18. package/dist-browser/numbl-core/executors/classification.d.ts +134 -0
  19. package/dist-browser/numbl-core/executors/context.d.ts +76 -0
  20. package/dist-browser/numbl-core/executors/handleInline.d.ts +58 -0
  21. package/dist-browser/numbl-core/executors/index.d.ts +14 -0
  22. package/dist-browser/numbl-core/executors/jit/cJitCallExecutor.d.ts +35 -0
  23. package/dist-browser/numbl-core/executors/jit/cJitLoopExecutor.d.ts +31 -0
  24. package/dist-browser/numbl-core/executors/jit/cJitTopLevelExecutor.d.ts +29 -0
  25. package/dist-browser/numbl-core/executors/jit/callExecutor.d.ts +45 -0
  26. package/dist-browser/numbl-core/executors/jit/compileC.d.ts +51 -0
  27. package/dist-browser/numbl-core/executors/jit/compileC.node.d.ts +25 -0
  28. package/dist-browser/numbl-core/executors/jit/hostHelpers.d.ts +31 -0
  29. package/dist-browser/numbl-core/executors/jit/loopExecutor.d.ts +41 -0
  30. package/dist-browser/numbl-core/executors/jit/session.d.ts +17 -0
  31. package/dist-browser/numbl-core/executors/jit/topLevelExecutor.d.ts +36 -0
  32. package/dist-browser/numbl-core/executors/jit/typeAdapter.d.ts +28 -0
  33. package/dist-browser/numbl-core/executors/jit/typeAdapterC.d.ts +73 -0
  34. package/dist-browser/numbl-core/executors/jit/valueAdapter.d.ts +55 -0
  35. package/dist-browser/numbl-core/executors/jit/valueAdapterC.d.ts +108 -0
  36. package/dist-browser/numbl-core/executors/lowering.d.ts +120 -0
  37. package/dist-browser/numbl-core/executors/plugins.d.ts +41 -0
  38. package/dist-browser/numbl-core/executors/registry.d.ts +148 -0
  39. package/dist-browser/numbl-core/executors/types.d.ts +103 -0
  40. package/dist-browser/numbl-core/externalAccessDirective.d.ts +6 -0
  41. package/dist-browser/numbl-core/fileIOAdapter.d.ts +88 -0
  42. package/dist-browser/numbl-core/functionResolve.d.ts +70 -0
  43. package/dist-browser/numbl-core/helpers/arithmetic.d.ts +47 -0
  44. package/dist-browser/numbl-core/helpers/bessel.d.ts +49 -0
  45. package/dist-browser/numbl-core/helpers/check-helpers.d.ts +49 -0
  46. package/dist-browser/numbl-core/helpers/constants.d.ts +6 -0
  47. package/dist-browser/numbl-core/helpers/dummy.d.ts +5 -0
  48. package/dist-browser/numbl-core/helpers/effectively-real.d.ts +25 -0
  49. package/dist-browser/numbl-core/helpers/eigs-select.d.ts +25 -0
  50. package/dist-browser/numbl-core/helpers/erf.d.ts +5 -0
  51. package/dist-browser/numbl-core/helpers/gmres.d.ts +51 -0
  52. package/dist-browser/numbl-core/helpers/linsolve.d.ts +25 -0
  53. package/dist-browser/numbl-core/helpers/marching-cubes-tables.d.ts +10 -0
  54. package/dist-browser/numbl-core/helpers/marching-cubes.d.ts +46 -0
  55. package/dist-browser/numbl-core/helpers/ode-rk.d.ts +83 -0
  56. package/dist-browser/numbl-core/helpers/prng.d.ts +19 -0
  57. package/dist-browser/numbl-core/helpers/quadgk.d.ts +32 -0
  58. package/dist-browser/numbl-core/helpers/reduction/cumulative.d.ts +8 -0
  59. package/dist-browser/numbl-core/helpers/reduction/min-max.d.ts +5 -0
  60. package/dist-browser/numbl-core/helpers/reduction-helpers.d.ts +66 -0
  61. package/dist-browser/numbl-core/helpers/registry.d.ts +7 -0
  62. package/dist-browser/numbl-core/helpers/scanFormat.d.ts +11 -0
  63. package/dist-browser/numbl-core/helpers/shape-utils.d.ts +7 -0
  64. package/dist-browser/numbl-core/helpers/sparse-arithmetic.d.ts +16 -0
  65. package/dist-browser/numbl-core/helpers/string.d.ts +11 -0
  66. package/dist-browser/numbl-core/interpreter/builtins/arithmetic.d.ts +4 -0
  67. package/dist-browser/numbl-core/interpreter/builtins/array-construction.d.ts +10 -0
  68. package/dist-browser/numbl-core/interpreter/builtins/array-extras.d.ts +5 -0
  69. package/dist-browser/numbl-core/interpreter/builtins/array-manipulation.d.ts +7 -0
  70. package/dist-browser/numbl-core/interpreter/builtins/cell-struct.d.ts +5 -0
  71. package/dist-browser/numbl-core/interpreter/builtins/complex.d.ts +4 -0
  72. package/dist-browser/numbl-core/interpreter/builtins/datetime.d.ts +40 -0
  73. package/dist-browser/numbl-core/interpreter/builtins/dictionary.d.ts +15 -0
  74. package/dist-browser/numbl-core/interpreter/builtins/fft.d.ts +7 -0
  75. package/dist-browser/numbl-core/interpreter/builtins/gallery.d.ts +7 -0
  76. package/dist-browser/numbl-core/interpreter/builtins/geometry.d.ts +10 -0
  77. package/dist-browser/numbl-core/interpreter/builtins/graph.d.ts +29 -0
  78. package/dist-browser/numbl-core/interpreter/builtins/help-text.d.ts +5 -0
  79. package/dist-browser/numbl-core/interpreter/builtins/index.d.ts +39 -0
  80. package/dist-browser/numbl-core/interpreter/builtins/introspection.d.ts +6 -0
  81. package/dist-browser/numbl-core/interpreter/builtins/linear-algebra.d.ts +9 -0
  82. package/dist-browser/numbl-core/interpreter/builtins/logical.d.ts +9 -0
  83. package/dist-browser/numbl-core/interpreter/builtins/math.d.ts +4 -0
  84. package/dist-browser/numbl-core/interpreter/builtins/misc.d.ts +7 -0
  85. package/dist-browser/numbl-core/interpreter/builtins/numerical.d.ts +10 -0
  86. package/dist-browser/numbl-core/interpreter/builtins/predicates.d.ts +4 -0
  87. package/dist-browser/numbl-core/interpreter/builtins/prng.d.ts +4 -0
  88. package/dist-browser/numbl-core/interpreter/builtins/reductions.d.ts +6 -0
  89. package/dist-browser/numbl-core/interpreter/builtins/set-operations.d.ts +4 -0
  90. package/dist-browser/numbl-core/interpreter/builtins/sparse.d.ts +4 -0
  91. package/dist-browser/numbl-core/interpreter/builtins/special-math.d.ts +4 -0
  92. package/dist-browser/numbl-core/interpreter/builtins/string-extras.d.ts +5 -0
  93. package/dist-browser/numbl-core/interpreter/builtins/strings.d.ts +7 -0
  94. package/dist-browser/numbl-core/interpreter/builtins/time-system.d.ts +6 -0
  95. package/dist-browser/numbl-core/interpreter/builtins/type-constructors.d.ts +5 -0
  96. package/dist-browser/numbl-core/interpreter/builtins/types.d.ts +98 -0
  97. package/dist-browser/numbl-core/interpreter/builtins/utility.d.ts +4 -0
  98. package/dist-browser/numbl-core/interpreter/builtins/validation.d.ts +4 -0
  99. package/dist-browser/numbl-core/interpreter/interpreter.d.ts +199 -0
  100. package/dist-browser/numbl-core/interpreter/interpreterExec.d.ts +81 -0
  101. package/dist-browser/numbl-core/interpreter/interpreterFunctions.d.ts +62 -0
  102. package/dist-browser/numbl-core/interpreter/interpreterSpecialBuiltins.d.ts +35 -0
  103. package/dist-browser/numbl-core/interpreter/types.d.ts +114 -0
  104. package/dist-browser/numbl-core/jit/builtins/defs/_shared.d.ts +43 -0
  105. package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/_elemwise.d.ts +123 -0
  106. package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/minus.d.ts +2 -0
  107. package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/mpower.d.ts +12 -0
  108. package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/mrdivide.d.ts +5 -0
  109. package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/mtimes.d.ts +2 -0
  110. package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/plus.d.ts +2 -0
  111. package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/power.d.ts +30 -0
  112. package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/rdivide.d.ts +2 -0
  113. package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/times.d.ts +2 -0
  114. package/dist-browser/numbl-core/jit/builtins/defs/arithmetic/uminus.d.ts +2 -0
  115. package/dist-browser/numbl-core/jit/builtins/defs/compare/_compare.d.ts +12 -0
  116. package/dist-browser/numbl-core/jit/builtins/defs/compare/eq.d.ts +2 -0
  117. package/dist-browser/numbl-core/jit/builtins/defs/compare/ge.d.ts +2 -0
  118. package/dist-browser/numbl-core/jit/builtins/defs/compare/gt.d.ts +2 -0
  119. package/dist-browser/numbl-core/jit/builtins/defs/compare/le.d.ts +2 -0
  120. package/dist-browser/numbl-core/jit/builtins/defs/compare/lt.d.ts +2 -0
  121. package/dist-browser/numbl-core/jit/builtins/defs/compare/ne.d.ts +2 -0
  122. package/dist-browser/numbl-core/jit/builtins/defs/diag/assert.d.ts +6 -0
  123. package/dist-browser/numbl-core/jit/builtins/defs/io/_format_args.d.ts +17 -0
  124. package/dist-browser/numbl-core/jit/builtins/defs/io/disp.d.ts +2 -0
  125. package/dist-browser/numbl-core/jit/builtins/defs/io/error.d.ts +2 -0
  126. package/dist-browser/numbl-core/jit/builtins/defs/io/fprintf.d.ts +2 -0
  127. package/dist-browser/numbl-core/jit/builtins/defs/io/sprintf.d.ts +2 -0
  128. package/dist-browser/numbl-core/jit/builtins/defs/io/warning.d.ts +15 -0
  129. package/dist-browser/numbl-core/jit/builtins/defs/logical/_shortcircuit.d.ts +30 -0
  130. package/dist-browser/numbl-core/jit/builtins/defs/logical/_unary_pred.d.ts +30 -0
  131. package/dist-browser/numbl-core/jit/builtins/defs/logical/and.d.ts +5 -0
  132. package/dist-browser/numbl-core/jit/builtins/defs/logical/andand.d.ts +1 -0
  133. package/dist-browser/numbl-core/jit/builtins/defs/logical/boolconst.d.ts +3 -0
  134. package/dist-browser/numbl-core/jit/builtins/defs/logical/classBuiltin.d.ts +21 -0
  135. package/dist-browser/numbl-core/jit/builtins/defs/logical/fieldnames.d.ts +15 -0
  136. package/dist-browser/numbl-core/jit/builtins/defs/logical/isa.d.ts +13 -0
  137. package/dist-browser/numbl-core/jit/builtins/defs/logical/iscell.d.ts +8 -0
  138. package/dist-browser/numbl-core/jit/builtins/defs/logical/isempty.d.ts +2 -0
  139. package/dist-browser/numbl-core/jit/builtins/defs/logical/isequal.d.ts +2 -0
  140. package/dist-browser/numbl-core/jit/builtins/defs/logical/isfield.d.ts +20 -0
  141. package/dist-browser/numbl-core/jit/builtins/defs/logical/isinf.d.ts +2 -0
  142. package/dist-browser/numbl-core/jit/builtins/defs/logical/isnan.d.ts +1 -0
  143. package/dist-browser/numbl-core/jit/builtins/defs/logical/isnumeric.d.ts +7 -0
  144. package/dist-browser/numbl-core/jit/builtins/defs/logical/isreal.d.ts +2 -0
  145. package/dist-browser/numbl-core/jit/builtins/defs/logical/isscalar.d.ts +20 -0
  146. package/dist-browser/numbl-core/jit/builtins/defs/logical/isstruct.d.ts +7 -0
  147. package/dist-browser/numbl-core/jit/builtins/defs/logical/logical.d.ts +1 -0
  148. package/dist-browser/numbl-core/jit/builtins/defs/logical/not.d.ts +15 -0
  149. package/dist-browser/numbl-core/jit/builtins/defs/logical/or.d.ts +11 -0
  150. package/dist-browser/numbl-core/jit/builtins/defs/logical/oror.d.ts +1 -0
  151. package/dist-browser/numbl-core/jit/builtins/defs/logical/strcmp.d.ts +21 -0
  152. package/dist-browser/numbl-core/jit/builtins/defs/logical/typequery.d.ts +10 -0
  153. package/dist-browser/numbl-core/jit/builtins/defs/logical/xor.d.ts +12 -0
  154. package/dist-browser/numbl-core/jit/builtins/defs/math/_complex_fold.d.ts +34 -0
  155. package/dist-browser/numbl-core/jit/builtins/defs/math/_unary_real.d.ts +51 -0
  156. package/dist-browser/numbl-core/jit/builtins/defs/math/abs.d.ts +7 -0
  157. package/dist-browser/numbl-core/jit/builtins/defs/math/angle.d.ts +7 -0
  158. package/dist-browser/numbl-core/jit/builtins/defs/math/asinh.d.ts +1 -0
  159. package/dist-browser/numbl-core/jit/builtins/defs/math/atan.d.ts +1 -0
  160. package/dist-browser/numbl-core/jit/builtins/defs/math/atan2.d.ts +3 -0
  161. package/dist-browser/numbl-core/jit/builtins/defs/math/besselh.d.ts +2 -0
  162. package/dist-browser/numbl-core/jit/builtins/defs/math/ceil.d.ts +4 -0
  163. package/dist-browser/numbl-core/jit/builtins/defs/math/conj.d.ts +7 -0
  164. package/dist-browser/numbl-core/jit/builtins/defs/math/constants.d.ts +7 -0
  165. package/dist-browser/numbl-core/jit/builtins/defs/math/cos.d.ts +1 -0
  166. package/dist-browser/numbl-core/jit/builtins/defs/math/cosh.d.ts +1 -0
  167. package/dist-browser/numbl-core/jit/builtins/defs/math/dot.d.ts +20 -0
  168. package/dist-browser/numbl-core/jit/builtins/defs/math/double.d.ts +28 -0
  169. package/dist-browser/numbl-core/jit/builtins/defs/math/exp.d.ts +1 -0
  170. package/dist-browser/numbl-core/jit/builtins/defs/math/fix.d.ts +4 -0
  171. package/dist-browser/numbl-core/jit/builtins/defs/math/floor.d.ts +4 -0
  172. package/dist-browser/numbl-core/jit/builtins/defs/math/hypot.d.ts +3 -0
  173. package/dist-browser/numbl-core/jit/builtins/defs/math/imag.d.ts +7 -0
  174. package/dist-browser/numbl-core/jit/builtins/defs/math/linspace.d.ts +6 -0
  175. package/dist-browser/numbl-core/jit/builtins/defs/math/log.d.ts +4 -0
  176. package/dist-browser/numbl-core/jit/builtins/defs/math/log10.d.ts +3 -0
  177. package/dist-browser/numbl-core/jit/builtins/defs/math/log2.d.ts +5 -0
  178. package/dist-browser/numbl-core/jit/builtins/defs/math/logspace.d.ts +8 -0
  179. package/dist-browser/numbl-core/jit/builtins/defs/math/mod.d.ts +1 -0
  180. package/dist-browser/numbl-core/jit/builtins/defs/math/norm.d.ts +2 -0
  181. package/dist-browser/numbl-core/jit/builtins/defs/math/rand.d.ts +2 -0
  182. package/dist-browser/numbl-core/jit/builtins/defs/math/real.d.ts +7 -0
  183. package/dist-browser/numbl-core/jit/builtins/defs/math/rem.d.ts +3 -0
  184. package/dist-browser/numbl-core/jit/builtins/defs/math/round.d.ts +1 -0
  185. package/dist-browser/numbl-core/jit/builtins/defs/math/sign.d.ts +5 -0
  186. package/dist-browser/numbl-core/jit/builtins/defs/math/sin.d.ts +1 -0
  187. package/dist-browser/numbl-core/jit/builtins/defs/math/sinh.d.ts +1 -0
  188. package/dist-browser/numbl-core/jit/builtins/defs/math/sqrt.d.ts +11 -0
  189. package/dist-browser/numbl-core/jit/builtins/defs/math/tan.d.ts +1 -0
  190. package/dist-browser/numbl-core/jit/builtins/defs/math/tanh.d.ts +1 -0
  191. package/dist-browser/numbl-core/jit/builtins/defs/math/uniquetol.d.ts +22 -0
  192. package/dist-browser/numbl-core/jit/builtins/defs/plot/dispatch.d.ts +6 -0
  193. package/dist-browser/numbl-core/jit/builtins/defs/reduction/_cumulative.d.ts +49 -0
  194. package/dist-browser/numbl-core/jit/builtins/defs/reduction/_shape.d.ts +126 -0
  195. package/dist-browser/numbl-core/jit/builtins/defs/reduction/_variance.d.ts +17 -0
  196. package/dist-browser/numbl-core/jit/builtins/defs/reduction/all.d.ts +1 -0
  197. package/dist-browser/numbl-core/jit/builtins/defs/reduction/any.d.ts +1 -0
  198. package/dist-browser/numbl-core/jit/builtins/defs/reduction/cummax.d.ts +1 -0
  199. package/dist-browser/numbl-core/jit/builtins/defs/reduction/cummin.d.ts +1 -0
  200. package/dist-browser/numbl-core/jit/builtins/defs/reduction/cumprod.d.ts +1 -0
  201. package/dist-browser/numbl-core/jit/builtins/defs/reduction/cumsum.d.ts +1 -0
  202. package/dist-browser/numbl-core/jit/builtins/defs/reduction/diff.d.ts +16 -0
  203. package/dist-browser/numbl-core/jit/builtins/defs/reduction/length.d.ts +2 -0
  204. package/dist-browser/numbl-core/jit/builtins/defs/reduction/max.d.ts +1 -0
  205. package/dist-browser/numbl-core/jit/builtins/defs/reduction/mean.d.ts +1 -0
  206. package/dist-browser/numbl-core/jit/builtins/defs/reduction/min.d.ts +1 -0
  207. package/dist-browser/numbl-core/jit/builtins/defs/reduction/numel.d.ts +2 -0
  208. package/dist-browser/numbl-core/jit/builtins/defs/reduction/prod.d.ts +1 -0
  209. package/dist-browser/numbl-core/jit/builtins/defs/reduction/std.d.ts +1 -0
  210. package/dist-browser/numbl-core/jit/builtins/defs/reduction/sum.d.ts +1 -0
  211. package/dist-browser/numbl-core/jit/builtins/defs/reduction/var.d.ts +1 -0
  212. package/dist-browser/numbl-core/jit/builtins/defs/shape/_construct.d.ts +67 -0
  213. package/dist-browser/numbl-core/jit/builtins/defs/shape/_triangular.d.ts +34 -0
  214. package/dist-browser/numbl-core/jit/builtins/defs/shape/cat.d.ts +33 -0
  215. package/dist-browser/numbl-core/jit/builtins/defs/shape/diag.d.ts +29 -0
  216. package/dist-browser/numbl-core/jit/builtins/defs/shape/eye.d.ts +5 -0
  217. package/dist-browser/numbl-core/jit/builtins/defs/shape/flip.d.ts +7 -0
  218. package/dist-browser/numbl-core/jit/builtins/defs/shape/meshgrid.d.ts +12 -0
  219. package/dist-browser/numbl-core/jit/builtins/defs/shape/ones.d.ts +1 -0
  220. package/dist-browser/numbl-core/jit/builtins/defs/shape/repmat.d.ts +37 -0
  221. package/dist-browser/numbl-core/jit/builtins/defs/shape/reshape.d.ts +39 -0
  222. package/dist-browser/numbl-core/jit/builtins/defs/shape/size.d.ts +20 -0
  223. package/dist-browser/numbl-core/jit/builtins/defs/shape/sort.d.ts +19 -0
  224. package/dist-browser/numbl-core/jit/builtins/defs/shape/transpose.d.ts +6 -0
  225. package/dist-browser/numbl-core/jit/builtins/defs/shape/tril.d.ts +16 -0
  226. package/dist-browser/numbl-core/jit/builtins/defs/shape/triu.d.ts +16 -0
  227. package/dist-browser/numbl-core/jit/builtins/defs/shape/zeros.d.ts +1 -0
  228. package/dist-browser/numbl-core/jit/builtins/defs/system/deal.d.ts +20 -0
  229. package/dist-browser/numbl-core/jit/builtins/defs/system/feval.d.ts +36 -0
  230. package/dist-browser/numbl-core/jit/builtins/defs/system/pathBuiltins.d.ts +4 -0
  231. package/dist-browser/numbl-core/jit/builtins/defs/system/tic.d.ts +8 -0
  232. package/dist-browser/numbl-core/jit/builtins/defs/system/toc.d.ts +5 -0
  233. package/dist-browser/numbl-core/jit/builtins/index.d.ts +16 -0
  234. package/dist-browser/numbl-core/jit/builtins/registry.d.ts +138 -0
  235. package/dist-browser/numbl-core/jit/builtins/runtime/cell/cell.d.ts +24 -0
  236. package/dist-browser/numbl-core/jit/builtins/runtime/indexing/loop_count.d.ts +1 -0
  237. package/dist-browser/numbl-core/jit/builtins/runtime/indexing/range_value.d.ts +1 -0
  238. package/dist-browser/numbl-core/jit/builtins/runtime/indexing/scalar_index.d.ts +11 -0
  239. package/dist-browser/numbl-core/jit/builtins/runtime/indexing/tensor_make_range.d.ts +5 -0
  240. package/dist-browser/numbl-core/jit/builtins/runtime/io/assert_fmt.d.ts +1 -0
  241. package/dist-browser/numbl-core/jit/builtins/runtime/io/disp_complex.d.ts +1 -0
  242. package/dist-browser/numbl-core/jit/builtins/runtime/io/disp_double.d.ts +1 -0
  243. package/dist-browser/numbl-core/jit/builtins/runtime/io/disp_struct.d.ts +1 -0
  244. package/dist-browser/numbl-core/jit/builtins/runtime/io/disp_tensor.d.ts +1 -0
  245. package/dist-browser/numbl-core/jit/builtins/runtime/io/disp_tensor_complex.d.ts +1 -0
  246. package/dist-browser/numbl-core/jit/builtins/runtime/io/error_fmt.d.ts +2 -0
  247. package/dist-browser/numbl-core/jit/builtins/runtime/io/format_complex.d.ts +1 -0
  248. package/dist-browser/numbl-core/jit/builtins/runtime/io/format_double.d.ts +1 -0
  249. package/dist-browser/numbl-core/jit/builtins/runtime/io/format_engine.d.ts +1 -0
  250. package/dist-browser/numbl-core/jit/builtins/runtime/io/fprintf.d.ts +1 -0
  251. package/dist-browser/numbl-core/jit/builtins/runtime/io/sprintf.d.ts +5 -0
  252. package/dist-browser/numbl-core/jit/builtins/runtime/io/warning_fmt.d.ts +2 -0
  253. package/dist-browser/numbl-core/jit/builtins/runtime/plot/plot_dispatch.d.ts +1 -0
  254. package/dist-browser/numbl-core/jit/builtins/runtime/snippets.c.gen.d.ts +4 -0
  255. package/dist-browser/numbl-core/jit/builtins/runtime/snippets.gen.d.ts +85 -0
  256. package/dist-browser/numbl-core/jit/builtins/runtime/system/cdiv.d.ts +4 -0
  257. package/dist-browser/numbl-core/jit/builtins/runtime/system/cscalar.d.ts +103 -0
  258. package/dist-browser/numbl-core/jit/builtins/runtime/system/deep_clone.d.ts +1 -0
  259. package/dist-browser/numbl-core/jit/builtins/runtime/system/isequal.d.ts +2 -0
  260. package/dist-browser/numbl-core/jit/builtins/runtime/system/tictoc.d.ts +5 -0
  261. package/dist-browser/numbl-core/jit/builtins/runtime/tensor/tensor.d.ts +6 -0
  262. package/dist-browser/numbl-core/jit/builtins/runtime/tensor/tensor_alloc.d.ts +5 -0
  263. package/dist-browser/numbl-core/jit/builtins/runtime/tensor/tensor_alloc_complex.d.ts +6 -0
  264. package/dist-browser/numbl-core/jit/builtins/runtime/tensor/tensor_alloc_nd.d.ts +5 -0
  265. package/dist-browser/numbl-core/jit/builtins/runtime/tensor/tensor_alloc_nd_complex.d.ts +6 -0
  266. package/dist-browser/numbl-core/jit/builtins/runtime/tensor/tensor_copy_complex.d.ts +6 -0
  267. package/dist-browser/numbl-core/jit/builtins/runtime/tensor/tensor_from_matrix.d.ts +5 -0
  268. package/dist-browser/numbl-core/jit/builtins/runtime/tensor/tensor_from_matrix_complex.d.ts +6 -0
  269. package/dist-browser/numbl-core/jit/builtins/runtime/tensor/tensor_from_row.d.ts +5 -0
  270. package/dist-browser/numbl-core/jit/builtins/runtime/tensor/tensor_from_row_complex.d.ts +6 -0
  271. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_cat.d.ts +11 -0
  272. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_cumulative.d.ts +32 -0
  273. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_diag.d.ts +33 -0
  274. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_diff.d.ts +5 -0
  275. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_dot.d.ts +16 -0
  276. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_complex.d.ts +90 -0
  277. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_real.d.ts +75 -0
  278. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_elemwise_real_fn.d.ts +95 -0
  279. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_eye.d.ts +10 -0
  280. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_fill_nd.d.ts +11 -0
  281. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_fill_square.d.ts +5 -0
  282. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_flip.d.ts +11 -0
  283. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_imag_all_zero.d.ts +1 -0
  284. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_linspace.d.ts +5 -0
  285. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_logical_real.d.ts +10 -0
  286. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_logspace.d.ts +5 -0
  287. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_meshgrid.d.ts +29 -0
  288. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_mtimes_complex.d.ts +10 -0
  289. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_mtimes_real.d.ts +6 -0
  290. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_norm.d.ts +4 -0
  291. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_ones_nd.d.ts +5 -0
  292. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_ones_square.d.ts +5 -0
  293. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_predicate.d.ts +42 -0
  294. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reduce_complex.d.ts +53 -0
  295. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reduce_real.d.ts +42 -0
  296. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_repmat.d.ts +11 -0
  297. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reshape_nd.d.ts +5 -0
  298. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_reshape_nd_complex.d.ts +6 -0
  299. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_size.d.ts +5 -0
  300. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_sort_real.d.ts +36 -0
  301. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_transpose.d.ts +5 -0
  302. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_transpose_complex.d.ts +6 -0
  303. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_triangular.d.ts +22 -0
  304. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_unary_complex_math.d.ts +128 -0
  305. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_unary_real_math.d.ts +95 -0
  306. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_uniquetol.d.ts +5 -0
  307. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_var.d.ts +12 -0
  308. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_zeros_nd.d.ts +5 -0
  309. package/dist-browser/numbl-core/jit/builtins/runtime/tensor_ops/tensor_zeros_square.d.ts +5 -0
  310. package/dist-browser/numbl-core/jit/builtins/runtime/text/strcmp.d.ts +2 -0
  311. package/dist-browser/numbl-core/jit/codegen/cFormat.d.ts +36 -0
  312. package/dist-browser/numbl-core/jit/codegen/cHelpers.d.ts +48 -0
  313. package/dist-browser/numbl-core/jit/codegen/emit.d.ts +55 -0
  314. package/dist-browser/numbl-core/jit/codegen/emitCellTypedef.d.ts +23 -0
  315. package/dist-browser/numbl-core/jit/codegen/emitExpr.d.ts +33 -0
  316. package/dist-browser/numbl-core/jit/codegen/emitIndex.d.ts +56 -0
  317. package/dist-browser/numbl-core/jit/codegen/emitJs.d.ts +64 -0
  318. package/dist-browser/numbl-core/jit/codegen/emitNamedTypedef.d.ts +58 -0
  319. package/dist-browser/numbl-core/jit/codegen/emitStmt.d.ts +76 -0
  320. package/dist-browser/numbl-core/jit/codegen/emitTensorConcat.d.ts +23 -0
  321. package/dist-browser/numbl-core/jit/codegen/emitTensorConcatJs.d.ts +16 -0
  322. package/dist-browser/numbl-core/jit/codegen/emitTensorFused.d.ts +77 -0
  323. package/dist-browser/numbl-core/jit/codegen/inlinePass.d.ts +66 -0
  324. package/dist-browser/numbl-core/jit/codegen/liveness.d.ts +58 -0
  325. package/dist-browser/numbl-core/jit/codegen/prettyIR.d.ts +24 -0
  326. package/dist-browser/numbl-core/jit/codegen/runtime.d.ts +152 -0
  327. package/dist-browser/numbl-core/jit/compileSpec.d.ts +84 -0
  328. package/dist-browser/numbl-core/jit/compileSpecC.d.ts +100 -0
  329. package/dist-browser/numbl-core/jit/index.d.ts +15 -0
  330. package/dist-browser/numbl-core/jit/lowering/classDefs.d.ts +109 -0
  331. package/dist-browser/numbl-core/jit/lowering/definiteAssign.d.ts +42 -0
  332. package/dist-browser/numbl-core/jit/lowering/errors.d.ts +35 -0
  333. package/dist-browser/numbl-core/jit/lowering/indexFold.d.ts +31 -0
  334. package/dist-browser/numbl-core/jit/lowering/indexResolve.d.ts +100 -0
  335. package/dist-browser/numbl-core/jit/lowering/ir.d.ts +584 -0
  336. package/dist-browser/numbl-core/jit/lowering/lower.d.ts +271 -0
  337. package/dist-browser/numbl-core/jit/lowering/lowerCellIndex.d.ts +41 -0
  338. package/dist-browser/numbl-core/jit/lowering/lowerCellLit.d.ts +19 -0
  339. package/dist-browser/numbl-core/jit/lowering/lowerClassConstructor.d.ts +55 -0
  340. package/dist-browser/numbl-core/jit/lowering/lowerFuncCall.d.ts +34 -0
  341. package/dist-browser/numbl-core/jit/lowering/lowerHandle.d.ts +57 -0
  342. package/dist-browser/numbl-core/jit/lowering/lowerIndexLoad.d.ts +16 -0
  343. package/dist-browser/numbl-core/jit/lowering/lowerIndexSlice.d.ts +29 -0
  344. package/dist-browser/numbl-core/jit/lowering/lowerIndexSliceStore.d.ts +19 -0
  345. package/dist-browser/numbl-core/jit/lowering/lowerIndexStore.d.ts +14 -0
  346. package/dist-browser/numbl-core/jit/lowering/lowerMethodCall.d.ts +45 -0
  347. package/dist-browser/numbl-core/jit/lowering/lowerMultiAssign.d.ts +36 -0
  348. package/dist-browser/numbl-core/jit/lowering/lowerTensorLit.d.ts +25 -0
  349. package/dist-browser/numbl-core/jit/lowering/rangeCount.d.ts +19 -0
  350. package/dist-browser/numbl-core/jit/lowering/specialize.d.ts +93 -0
  351. package/dist-browser/numbl-core/jit/lowering/types.d.ts +503 -0
  352. package/dist-browser/numbl-core/jit/lowering/walk.d.ts +17 -0
  353. package/dist-browser/numbl-core/jit/numbl/index.d.ts +30 -0
  354. package/dist-browser/numbl-core/jit/parser/astUtils.d.ts +43 -0
  355. package/dist-browser/numbl-core/jit/parser/index.d.ts +12 -0
  356. package/dist-browser/numbl-core/jit/parser/sourceLoc.d.ts +12 -0
  357. package/dist-browser/numbl-core/jit/runtime/context.d.ts +23 -0
  358. package/dist-browser/numbl-core/jit/runtime/inferType.d.ts +10 -0
  359. package/dist-browser/numbl-core/jit/runtime/value.d.ts +101 -0
  360. package/dist-browser/numbl-core/jit/workspace/driverPrologue.d.ts +59 -0
  361. package/dist-browser/numbl-core/jit/workspace/mtoc2UserFunctionLoader.d.ts +62 -0
  362. package/dist-browser/numbl-core/jit/workspace/workspace.d.ts +243 -0
  363. package/dist-browser/numbl-core/jitDeclineDiagnostics.d.ts +32 -0
  364. package/dist-browser/numbl-core/jitTypes.d.ts +94 -0
  365. package/dist-browser/numbl-core/jsUserFunctions.d.ts +61 -0
  366. package/dist-browser/numbl-core/lexer/helpers.d.ts +15 -0
  367. package/dist-browser/numbl-core/lexer/index.d.ts +4 -0
  368. package/dist-browser/numbl-core/lexer/keywords.d.ts +3 -0
  369. package/dist-browser/numbl-core/lexer/token-config.d.ts +94 -0
  370. package/dist-browser/numbl-core/lexer/tokenizer.d.ts +9 -0
  371. package/dist-browser/numbl-core/lexer/types.d.ts +80 -0
  372. package/dist-browser/numbl-core/lowering/classInfo.d.ts +53 -0
  373. package/dist-browser/numbl-core/lowering/constants.d.ts +4 -0
  374. package/dist-browser/numbl-core/lowering/errors.d.ts +17 -0
  375. package/dist-browser/numbl-core/lowering/index.d.ts +3 -0
  376. package/dist-browser/numbl-core/lowering/itemTypes.d.ts +87 -0
  377. package/dist-browser/numbl-core/lowering/loweringContext.d.ts +241 -0
  378. package/dist-browser/numbl-core/native/bridge-resolve.d.ts +14 -0
  379. package/dist-browser/numbl-core/native/geometry-bridge.d.ts +39 -0
  380. package/dist-browser/numbl-core/native/lapack-bridge.d.ts +482 -0
  381. package/dist-browser/numbl-core/native/qhull-browser.d.ts +15 -0
  382. package/dist-browser/numbl-core/native/qhull-node.d.ts +13 -0
  383. package/dist-browser/numbl-core/native/ts-lapack-bridge.d.ts +9 -0
  384. package/dist-browser/numbl-core/native/ts-lapack-eig-complex.d.ts +32 -0
  385. package/dist-browser/numbl-core/ops/bessel.d.ts +18 -0
  386. package/dist-browser/numbl-core/ops/comparison.d.ts +11 -0
  387. package/dist-browser/numbl-core/ops/complexBinaryElemwise.d.ts +10 -0
  388. package/dist-browser/numbl-core/ops/complexUnaryElemwise.d.ts +8 -0
  389. package/dist-browser/numbl-core/ops/dispatch.d.ts +26 -0
  390. package/dist-browser/numbl-core/ops/index.d.ts +8 -0
  391. package/dist-browser/numbl-core/ops/opCodes.d.ts +70 -0
  392. package/dist-browser/numbl-core/ops/realBinaryElemwise.d.ts +8 -0
  393. package/dist-browser/numbl-core/ops/realUnaryElemwise.d.ts +5 -0
  394. package/dist-browser/numbl-core/ops/reduce.d.ts +6 -0
  395. package/dist-browser/numbl-core/parser/ArgumentsParser.d.ts +33 -0
  396. package/dist-browser/numbl-core/parser/ClassParser.d.ts +21 -0
  397. package/dist-browser/numbl-core/parser/CommandParser.d.ts +31 -0
  398. package/dist-browser/numbl-core/parser/ControlFlowParser.d.ts +16 -0
  399. package/dist-browser/numbl-core/parser/ExpressionParser.d.ts +32 -0
  400. package/dist-browser/numbl-core/parser/FunctionParser.d.ts +10 -0
  401. package/dist-browser/numbl-core/parser/Parser.d.ts +17 -0
  402. package/dist-browser/numbl-core/parser/ParserBase.d.ts +35 -0
  403. package/dist-browser/numbl-core/parser/StatementParser.d.ts +13 -0
  404. package/dist-browser/numbl-core/parser/errors.d.ts +15 -0
  405. package/dist-browser/numbl-core/parser/index.d.ts +7 -0
  406. package/dist-browser/numbl-core/parser/types.d.ts +342 -0
  407. package/dist-browser/numbl-core/runtime/alloc.d.ts +12 -0
  408. package/dist-browser/numbl-core/runtime/axisCommand.d.ts +34 -0
  409. package/dist-browser/numbl-core/runtime/compare.d.ts +5 -0
  410. package/dist-browser/numbl-core/runtime/constructors.d.ts +39 -0
  411. package/dist-browser/numbl-core/runtime/convert.d.ts +10 -0
  412. package/dist-browser/numbl-core/runtime/cow.d.ts +33 -0
  413. package/dist-browser/numbl-core/runtime/display.d.ts +6 -0
  414. package/dist-browser/numbl-core/runtime/error.d.ts +78 -0
  415. package/dist-browser/numbl-core/runtime/index.d.ts +13 -0
  416. package/dist-browser/numbl-core/runtime/indexing.d.ts +28 -0
  417. package/dist-browser/numbl-core/runtime/plotBuiltinDispatch.d.ts +92 -0
  418. package/dist-browser/numbl-core/runtime/plotUtils.d.ts +336 -0
  419. package/dist-browser/numbl-core/runtime/refcount.d.ts +85 -0
  420. package/dist-browser/numbl-core/runtime/runtime.d.ts +354 -0
  421. package/dist-browser/numbl-core/runtime/runtimeDispatch.d.ts +27 -0
  422. package/dist-browser/numbl-core/runtime/runtimeHelpers.d.ts +31 -0
  423. package/dist-browser/numbl-core/runtime/runtimeIndexing.d.ts +28 -0
  424. package/dist-browser/numbl-core/runtime/runtimeMemberAccess.d.ts +26 -0
  425. package/dist-browser/numbl-core/runtime/runtimeOperators.d.ts +24 -0
  426. package/dist-browser/numbl-core/runtime/runtimePlot.d.ts +129 -0
  427. package/dist-browser/numbl-core/runtime/sentinels.d.ts +4 -0
  428. package/dist-browser/numbl-core/runtime/specialBuiltinNames.d.ts +2 -0
  429. package/dist-browser/numbl-core/runtime/specialBuiltins.d.ts +13 -0
  430. package/dist-browser/numbl-core/runtime/struct-access.d.ts +11 -0
  431. package/dist-browser/numbl-core/runtime/syncChannel.d.ts +1 -0
  432. package/dist-browser/numbl-core/runtime/tensor-construction.d.ts +10 -0
  433. package/dist-browser/numbl-core/runtime/types.d.ts +197 -0
  434. package/dist-browser/numbl-core/runtime/uihtmlSession.d.ts +40 -0
  435. package/dist-browser/numbl-core/runtime/utils.d.ts +19 -0
  436. package/dist-browser/numbl-core/stdlib-bundle.d.ts +3 -0
  437. package/dist-browser/numbl-core/systemAdapter.d.ts +23 -0
  438. package/dist-browser/numbl-core/version.d.ts +2 -0
  439. package/dist-browser/numbl-core/workspace/index.d.ts +4 -0
  440. package/dist-browser/numbl-core/workspace/types.d.ts +24 -0
  441. package/dist-browser/ts-lapack/src/BLAS/daxpy.d.ts +1 -0
  442. package/dist-browser/ts-lapack/src/BLAS/dcopy.d.ts +1 -0
  443. package/dist-browser/ts-lapack/src/BLAS/ddot.d.ts +1 -0
  444. package/dist-browser/ts-lapack/src/BLAS/dgemm.d.ts +1 -0
  445. package/dist-browser/ts-lapack/src/BLAS/dgemm_optimized.d.ts +1 -0
  446. package/dist-browser/ts-lapack/src/BLAS/dgemv.d.ts +1 -0
  447. package/dist-browser/ts-lapack/src/BLAS/dger.d.ts +1 -0
  448. package/dist-browser/ts-lapack/src/BLAS/dnrm2.d.ts +1 -0
  449. package/dist-browser/ts-lapack/src/BLAS/drot.d.ts +1 -0
  450. package/dist-browser/ts-lapack/src/BLAS/dscal.d.ts +1 -0
  451. package/dist-browser/ts-lapack/src/BLAS/dswap.d.ts +1 -0
  452. package/dist-browser/ts-lapack/src/BLAS/dtrmm.d.ts +1 -0
  453. package/dist-browser/ts-lapack/src/BLAS/dtrmv.d.ts +1 -0
  454. package/dist-browser/ts-lapack/src/BLAS/dtrsm.d.ts +1 -0
  455. package/dist-browser/ts-lapack/src/BLAS/idamax.d.ts +1 -0
  456. package/dist-browser/ts-lapack/src/SRC/dbdsqr.d.ts +10 -0
  457. package/dist-browser/ts-lapack/src/SRC/dgebak.d.ts +1 -0
  458. package/dist-browser/ts-lapack/src/SRC/dgebal.d.ts +5 -0
  459. package/dist-browser/ts-lapack/src/SRC/dgebd2.d.ts +1 -0
  460. package/dist-browser/ts-lapack/src/SRC/dgebrd.d.ts +1 -0
  461. package/dist-browser/ts-lapack/src/SRC/dgeev.d.ts +3 -0
  462. package/dist-browser/ts-lapack/src/SRC/dgehd2.d.ts +1 -0
  463. package/dist-browser/ts-lapack/src/SRC/dgehrd.d.ts +1 -0
  464. package/dist-browser/ts-lapack/src/SRC/dgelq2.d.ts +1 -0
  465. package/dist-browser/ts-lapack/src/SRC/dgelqf.d.ts +1 -0
  466. package/dist-browser/ts-lapack/src/SRC/dgeqr2.d.ts +1 -0
  467. package/dist-browser/ts-lapack/src/SRC/dgeqrf.d.ts +1 -0
  468. package/dist-browser/ts-lapack/src/SRC/dgeqrf_optimized.d.ts +1 -0
  469. package/dist-browser/ts-lapack/src/SRC/dgesvd.d.ts +28 -0
  470. package/dist-browser/ts-lapack/src/SRC/dgetrf.d.ts +1 -0
  471. package/dist-browser/ts-lapack/src/SRC/dgetrf2.d.ts +1 -0
  472. package/dist-browser/ts-lapack/src/SRC/dgetri.d.ts +1 -0
  473. package/dist-browser/ts-lapack/src/SRC/dhseqr.d.ts +32 -0
  474. package/dist-browser/ts-lapack/src/SRC/dlabrd.d.ts +1 -0
  475. package/dist-browser/ts-lapack/src/SRC/dlacpy.d.ts +18 -0
  476. package/dist-browser/ts-lapack/src/SRC/dladiv.d.ts +9 -0
  477. package/dist-browser/ts-lapack/src/SRC/dlaexc.d.ts +21 -0
  478. package/dist-browser/ts-lapack/src/SRC/dlahqr.d.ts +24 -0
  479. package/dist-browser/ts-lapack/src/SRC/dlahr2.d.ts +1 -0
  480. package/dist-browser/ts-lapack/src/SRC/dlaln2.d.ts +5 -0
  481. package/dist-browser/ts-lapack/src/SRC/dlamch.d.ts +1 -0
  482. package/dist-browser/ts-lapack/src/SRC/dlange.d.ts +1 -0
  483. package/dist-browser/ts-lapack/src/SRC/dlanv2.d.ts +12 -0
  484. package/dist-browser/ts-lapack/src/SRC/dlapy2.d.ts +1 -0
  485. package/dist-browser/ts-lapack/src/SRC/dlaqr1.d.ts +1 -0
  486. package/dist-browser/ts-lapack/src/SRC/dlaqr30.d.ts +81 -0
  487. package/dist-browser/ts-lapack/src/SRC/dlaqr5.d.ts +38 -0
  488. package/dist-browser/ts-lapack/src/SRC/dlarf.d.ts +18 -0
  489. package/dist-browser/ts-lapack/src/SRC/dlarf1f.d.ts +1 -0
  490. package/dist-browser/ts-lapack/src/SRC/dlarfb.d.ts +25 -0
  491. package/dist-browser/ts-lapack/src/SRC/dlarfg.d.ts +4 -0
  492. package/dist-browser/ts-lapack/src/SRC/dlarft.d.ts +20 -0
  493. package/dist-browser/ts-lapack/src/SRC/dlarfx.d.ts +17 -0
  494. package/dist-browser/ts-lapack/src/SRC/dlartg.d.ts +5 -0
  495. package/dist-browser/ts-lapack/src/SRC/dlas2.d.ts +4 -0
  496. package/dist-browser/ts-lapack/src/SRC/dlascl.d.ts +1 -0
  497. package/dist-browser/ts-lapack/src/SRC/dlaset.d.ts +19 -0
  498. package/dist-browser/ts-lapack/src/SRC/dlasr.d.ts +1 -0
  499. package/dist-browser/ts-lapack/src/SRC/dlassq.d.ts +18 -0
  500. package/dist-browser/ts-lapack/src/SRC/dlasv2.d.ts +8 -0
  501. package/dist-browser/ts-lapack/src/SRC/dlaswp.d.ts +1 -0
  502. package/dist-browser/ts-lapack/src/SRC/dlasy2.d.ts +5 -0
  503. package/dist-browser/ts-lapack/src/SRC/dorg2r.d.ts +1 -0
  504. package/dist-browser/ts-lapack/src/SRC/dorgbr.d.ts +1 -0
  505. package/dist-browser/ts-lapack/src/SRC/dorghr.d.ts +1 -0
  506. package/dist-browser/ts-lapack/src/SRC/dorgl2.d.ts +1 -0
  507. package/dist-browser/ts-lapack/src/SRC/dorglq.d.ts +1 -0
  508. package/dist-browser/ts-lapack/src/SRC/dorgqr.d.ts +1 -0
  509. package/dist-browser/ts-lapack/src/SRC/dorgqr_optimized.d.ts +1 -0
  510. package/dist-browser/ts-lapack/src/SRC/dorm2r.d.ts +1 -0
  511. package/dist-browser/ts-lapack/src/SRC/dormhr.d.ts +1 -0
  512. package/dist-browser/ts-lapack/src/SRC/dormqr.d.ts +1 -0
  513. package/dist-browser/ts-lapack/src/SRC/dpotf2.d.ts +1 -0
  514. package/dist-browser/ts-lapack/src/SRC/dtrevc3.d.ts +27 -0
  515. package/dist-browser/ts-lapack/src/SRC/dtrexc.d.ts +24 -0
  516. package/dist-browser/ts-lapack/src/SRC/dtrti2.d.ts +1 -0
  517. package/dist-browser/ts-lapack/src/SRC/dtrtri.d.ts +1 -0
  518. package/dist-browser/ts-lapack/src/utils/constants.d.ts +28 -0
  519. package/dist-browser/ts-lapack/src/utils/iladlc.d.ts +1 -0
  520. package/dist-browser/ts-lapack/src/utils/iladlr.d.ts +1 -0
  521. package/dist-browser/ts-lapack/src/utils/ilaenv.d.ts +1 -0
  522. package/dist-browser/ts-lapack/src/utils/xerbla.d.ts +1 -0
  523. package/dist-browser/vfs/BrowserFileIOAdapter.d.ts +60 -0
  524. package/dist-browser/vfs/BrowserSystemAdapter.d.ts +27 -0
  525. package/dist-browser/vfs/VirtualFileSystem.d.ts +66 -0
  526. package/dist-browser/vfs/syncVfsChanges.d.ts +23 -0
  527. package/dist-browser/vfs/unzipToFiles.d.ts +7 -0
  528. package/dist-cli/cli.js +1290 -197
  529. package/dist-lib/lib.js +1284 -197
  530. package/dist-lib/numbl-core/helpers/scanFormat.d.ts +11 -0
  531. package/dist-lib/numbl-core/jit/builtins/defs/logical/fieldnames.d.ts +2 -2
  532. package/dist-lib/numbl-core/runtime/constructors.d.ts +3 -1
  533. package/dist-lib/numbl-core/runtime/indexing.d.ts +3 -0
  534. package/dist-lib/numbl-core/runtime/runtime.d.ts +1 -0
  535. package/dist-lib/numbl-core/runtime/types.d.ts +15 -1
  536. package/dist-lib/numbl-core/runtime/utils.d.ts +3 -0
  537. package/dist-lib/numbl-core/version.d.ts +1 -1
  538. package/dist-lib/vfs/BrowserFileIOAdapter.d.ts +6 -0
  539. package/dist-site-viewer/assets/{index-C-wfkZK0.js → index-CT9HA1Pn.js} +318 -316
  540. package/dist-site-viewer/assets/numbl-worker-CYPflGmm.js +5246 -0
  541. package/dist-site-viewer/index.html +1 -1
  542. package/package.json +9 -3
  543. package/dist-site-viewer/assets/numbl-worker-Bnbz2rMQ.js +0 -5228
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Build the `$h` helpers object that mtoc2's emitted spec receives
3
+ * when invoked via the numbl JIT bridge.
4
+ *
5
+ * - `write(s)` — output sink. Routed to `rt.output(...)` so `disp` /
6
+ * `fprintf` / `warning` etc. land in numbl's output stream.
7
+ * - `plotDispatch(name, args)` — host hook for plot builtins.
8
+ * mtoc2's emitted `mtoc2_plot_dispatch(...)` calls this in
9
+ * preference to the standalone-mode JSON-on-stdout wire format.
10
+ * We translate args from mtoc2's emit shape into `RuntimeValue`
11
+ * via `jitToNumbl` and call numbl's `dispatchPlotBuiltin`,
12
+ * pushing the resulting instruction onto `rt.plotInstructions` —
13
+ * so `colorbar('off')` / `pcolor(...)` / etc. produce the same
14
+ * plot-instruction stream as the interpreter would.
15
+ *
16
+ * The unknown-name fallthrough (when `dispatchPlotBuiltin` returns
17
+ * false) is a programmer error: every name mtoc2's plot builtin
18
+ * registration covers is in `PLOT_ALL_NAMES`, which is sourced from
19
+ * the same list `dispatchPlotBuiltin` switches on. Throw so the
20
+ * mismatch is loud rather than silently dropping a side effect.
21
+ */
22
+ import type { Runtime } from "../../runtime/runtime.js";
23
+ export interface JitHostHelpers {
24
+ write: (s: string) => void;
25
+ plotDispatch: (name: string, args: unknown[]) => void;
26
+ /** One uniform double in [0, 1). Backed by numbl's process-global PRNG
27
+ * (the same `rngRandom` the interpreter uses), so JIT'd and interpreted
28
+ * `rand` draw from one shared, `rng(seed)`-controllable stream. */
29
+ rand: () => number;
30
+ }
31
+ export declare function buildHostHelpers(rt: Runtime): JitHostHelpers;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * jit-loop — compiles a single For/While stmt via mtoc2's
3
+ * `compileSpec` with the loop wrapped as a synthetic user function
4
+ * whose params are the variables the loop reads (env inputs) and
5
+ * whose outputs are the variables it assigns that are live after the
6
+ * loop (filtered in classification).
7
+ *
8
+ * Mirrors `topLevelExecutor.ts` — the only structural difference is
9
+ * that the synthetic body is a single-element `[loopStmt]` instead of
10
+ * a whole script body.
11
+ *
12
+ * Loop-depth gate: only fires when `interp.loopDepth === 0`. A loop
13
+ * dispatched while the interpreter is iterating an enclosing
14
+ * loop-body would pay per-iter propose/cache overhead with no
15
+ * speedup, because the *outer* loop is the natural JIT entry point
16
+ * (it captures the inner loop's body and runs it natively in mtoc2-
17
+ * emitted code). When the outer loop fires its own JIT, the inner
18
+ * loop never reaches the interpreter dispatcher at all.
19
+ */
20
+ import type { Executor } from "../types.js";
21
+ import { type JitType } from "../../jitTypes.js";
22
+ import type { Stmt } from "../../parser/index.js";
23
+ import { type Type as CompilerType } from "../../jit/index.js";
24
+ import type { ConstHandle } from "../classification.js";
25
+ interface JitLoopData {
26
+ readonly loopStmt: Stmt & {
27
+ type: "For" | "While";
28
+ };
29
+ readonly inputs: readonly string[];
30
+ readonly outputs: readonly string[];
31
+ readonly inputTypes: readonly JitType[];
32
+ readonly compilerInputTypes: readonly CompilerType[];
33
+ readonly constHandles: readonly ConstHandle[];
34
+ readonly currentFile: string;
35
+ readonly cacheKey: string;
36
+ }
37
+ interface CompiledArtifact {
38
+ readonly specFn: (...args: unknown[]) => unknown;
39
+ }
40
+ export declare const jitLoopExecutor: Executor<JitLoopData, CompiledArtifact | null>;
41
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Per-LoweringContext mtoc2 session state shared between
3
+ * `jitCallExecutor` and `jitTopLevelExecutor`. One `Workspace`
4
+ * (built from numbl's existing `LoweringContext`) and one `Lowerer`
5
+ * per execution session, so the `Lowerer.specializations` cache
6
+ * persists across whole-scope + per-call dispatches.
7
+ *
8
+ * The session is keyed on the LoweringContext object — WeakMap-cleared
9
+ * automatically when the context goes out of scope.
10
+ */
11
+ import type { Interpreter } from "../../interpreter/interpreter.js";
12
+ import { Workspace, Lowerer } from "../../jit/index.js";
13
+ export interface SessionState {
14
+ workspace: Workspace;
15
+ lowerer: Lowerer;
16
+ }
17
+ export declare function getOrCreateSession(interp: Interpreter): SessionState;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * jit-top-level — compiles a script body via mtoc2's `compileSpec`
3
+ * with the body wrapped as a synthetic user function whose params are
4
+ * the variables the body reads (env inputs) and whose outputs are the
5
+ * variables it assigns (env outputs).
6
+ *
7
+ * The interpreter calls `Registry.tryRunWholeScope` once at script
8
+ * start; we register this via `registerWholeScope`. On compile
9
+ * success the entire script runs in mtoc2-emitted JS; on
10
+ * `UnsupportedConstruct` / `TypeError` we decline and the dispatcher
11
+ * falls through to per-stmt dispatch (where jit-call still handles
12
+ * individual user-function calls).
13
+ *
14
+ * Top-level loops *inside* the script execute as part of the
15
+ * compiled artifact, so `loopDepth` only gates dispatch-level calls,
16
+ * not this whole-scope attempt.
17
+ */
18
+ import type { Executor } from "../types.js";
19
+ import { type JitType } from "../../jitTypes.js";
20
+ import type { Stmt } from "../../parser/index.js";
21
+ import { type Type as CompilerType } from "../../jit/index.js";
22
+ interface JitTopLevelData {
23
+ readonly stmts: readonly Stmt[];
24
+ readonly inputs: readonly string[];
25
+ readonly outputs: readonly string[];
26
+ readonly inputTypes: readonly JitType[];
27
+ readonly compilerInputTypes: readonly CompilerType[];
28
+ readonly currentFile: string;
29
+ readonly cacheKey: string;
30
+ }
31
+ interface CompiledArtifact {
32
+ readonly specFn: (...args: unknown[]) => unknown;
33
+ readonly nargout: number;
34
+ }
35
+ export declare const jitTopLevelExecutor: Executor<JitTopLevelData, CompiledArtifact | null>;
36
+ export {};
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Adapter: numbl `JitType` → mtoc2 `Type`.
3
+ *
4
+ * Called by the mtoc2 JIT executor at `propose()` time. Numbl observes
5
+ * each argument's `JitType` from the live runtime value (via
6
+ * `inferJitType`); the adapter translates it into the matching mtoc2
7
+ * Type so `compileSpec` can specialize on the same shape information.
8
+ *
9
+ * Two design rules:
10
+ *
11
+ * 1. **Always strip exact.** Runtime-observed scalars must NOT shard
12
+ * mtoc2's spec cache by value. We never propagate `exact` through
13
+ * the adapter — `compileSpec` calls `withoutExact` again
14
+ * defensively, but doing it here makes the spec key wider one step
15
+ * earlier.
16
+ * 2. **Reject unsupported kinds via `null`.** The executor's
17
+ * `propose()` treats `null` from this adapter as "decline this
18
+ * JIT proposal" — the dispatcher falls through to the next
19
+ * executor (eventually the interpreter). First-cut coverage is
20
+ * scalars + dense real/complex tensors + strings + chars. Structs,
21
+ * cells, class instances, struct arrays, sparse, dictionaries, and
22
+ * function handles return `null`; they can be added later.
23
+ */
24
+ import type { JitType } from "../../jitTypes.js";
25
+ import { type Type } from "../../jit/index.js";
26
+ /** Translate a numbl `JitType` to the matching mtoc2 `Type`.
27
+ * Returns `null` for kinds the mtoc2 JIT path doesn't accept (yet). */
28
+ export declare function jitTypeToCompilerType(jt: JitType): Type | null;
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Type adapter for the mtoc2 C-JIT path.
3
+ *
4
+ * - `compilerTypeToCDecl(ty)` returns the C type string that goes in the
5
+ * koffi prototype for a value of that type, or `null` when the
6
+ * type isn't supported across the FFI today.
7
+ * - `registerTensorStruct(koffi)` registers `mtoc2_tensor_t`
8
+ * with koffi (idempotent across calls — koffi's `struct` returns
9
+ * the existing definition on re-registration of the same name).
10
+ * - `buildCDeclaration(signature)` assembles the full koffi prototype
11
+ * string from a `SpecCSignature`.
12
+ *
13
+ * Supported today:
14
+ * - Scalar real numeric → `double`
15
+ * - Scalar complex → `mtoc2_cscalar_t` (a `{double re; double im;}`
16
+ * koffi struct). The emitted C signature uses `double _Complex` by
17
+ * value, but on the SysV-x86-64 / AAPCS64 ABIs a 2-double struct
18
+ * and `double _Complex` share the same by-value calling convention
19
+ * (two SSE / SIMD registers, returned in xmm0:xmm1), so koffi
20
+ * marshals the struct against the real `_Complex` function — koffi's
21
+ * own prototype parser doesn't accept the `double _Complex` token.
22
+ * - Scalar logical → `double` (shares the `double` ABI)
23
+ * - Tensor (real or complex) → `mtoc2_tensor_t` (koffi struct)
24
+ * - Void return → `void`
25
+ *
26
+ * Everything else (Struct / Class / Handle / String / Char / Cell)
27
+ * returns null so the C-JIT executor declines and JS-JIT picks up.
28
+ */
29
+ import type { SpecCSignature, Type } from "../../jit/index.js";
30
+ /** koffi's runtime-shaped api object. Loose typing because koffi
31
+ * doesn't ship TS types for its declaration-string API. */
32
+ interface Koffi {
33
+ struct(name: string, fields: Record<string, unknown>): any;
34
+ array(elemType: string, count: number, encoding?: string): any;
35
+ resolve(name: string): any | undefined;
36
+ }
37
+ /** Register the `mtoc2_tensor_t` struct with koffi. Idempotent — safe
38
+ * to call from each compile() invocation; the second call short-
39
+ * circuits.
40
+ *
41
+ * Layout MUST match `mtoc2/src/builtins/runtime/tensor/tensor.h`:
42
+ * ```
43
+ * typedef struct {
44
+ * double *real;
45
+ * double *imag;
46
+ * int ndim;
47
+ * long dims[JIT_MAX_NDIM]; // JIT_MAX_NDIM == 8
48
+ * } mtoc2_tensor_t;
49
+ * ```
50
+ * Field order and padding match the C struct's natural alignment;
51
+ * koffi handles the platform-specific alignment automatically when
52
+ * asked for the same field types.
53
+ */
54
+ export declare const JIT_MAX_NDIM = 8;
55
+ export declare function registerTensorStruct(koffi: Koffi): void;
56
+ /** Register the `mtoc2_cscalar_t` struct — `{double re; double im;}` —
57
+ * used as the koffi stand-in for `double _Complex` scalar params and
58
+ * returns (ABI-compatible by-value; see header). Idempotent. */
59
+ export declare function registerCScalarStruct(koffi: Koffi): void;
60
+ /** Map an mtoc2 `Type` to the C-type token used in the koffi
61
+ * declaration string. Returns `null` for unsupported shapes. */
62
+ export declare function compilerTypeToCDecl(ty: Type): string | null;
63
+ /** Assemble the koffi prototype string for a `SpecCSignature`.
64
+ *
65
+ * Convention (mirrors mtoc2's `fnRetType` + `fnParamList`):
66
+ * - 0 outputs ⇒ `void <cName>(<params>)`
67
+ * - 1 output ⇒ `<retType> <cName>(<params>)`
68
+ * - ≥2 outputs ⇒ `void <cName>(<params>, <outTy> *_mtoc2_o<i>...)`
69
+ *
70
+ * Returns `null` if any param or output type fails the C-FFI
71
+ * feasibility check — the executor must decline. */
72
+ export declare function buildCDeclaration(signature: SpecCSignature): string | null;
73
+ export {};
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Adapter: numbl `RuntimeValue` ↔ mtoc2 emit-JS value shape.
3
+ *
4
+ * Numbl wraps tensors / chars / complex / structs in Refcounted
5
+ * classes (`RuntimeTensor`, `RuntimeChar`, `RuntimeComplexNumber`)
6
+ * keyed by a `kind:` discriminator. mtoc2's emitted JS uses plain
7
+ * objects keyed by `mtoc2Tag:` (no class wrapper, no refcount).
8
+ *
9
+ * **Pass-by-value at the boundary.** MATLAB function calls are
10
+ * pass-by-value; a JIT'd function that mutates its argument must
11
+ * not leak the mutation to the caller. mtoc2's whole-program
12
+ * codegen handles this by wrapping every call-site argument in
13
+ * `mtoc2_deep_clone(...)` — but the JIT executor is a *new* call
14
+ * site that mtoc2 doesn't know about, so we have to clone the
15
+ * tensor data buffer ourselves on the way in. On the way out, we
16
+ * take ownership of the returned buffer directly (mtoc2's spec
17
+ * always returns a freshly-owned tensor).
18
+ *
19
+ * The executor only invokes these adapters on values whose JitType
20
+ * was accepted by `jitTypeToCompilerType`. Unsupported value kinds
21
+ * arriving here are a programmer error — the type adapter should
22
+ * have caused `propose()` to decline earlier.
23
+ */
24
+ import { type RuntimeValue } from "../../runtime/types.js";
25
+ import type { Type } from "../../jit/index.js";
26
+ /** numbl RuntimeValue → mtoc2 emit-JS value shape. Owned-typed
27
+ * values (tensors) get their data buffer cloned so mtoc2's spec
28
+ * body can mutate freely without leaking the change back through
29
+ * numbl's caller-side env.
30
+ *
31
+ * `paramType` is the compiler `Type` the spec was COMPILED for at this
32
+ * parameter. It reconciles two value/type mismatches at the boundary,
33
+ * both mirroring the C adapter (valueAdapterC):
34
+ *
35
+ * 1. **1×1 tensor → scalar param.** The compiler collapses a [1,1]
36
+ * tensor type to a scalar `double`/`complex` (`!isMultiElement`),
37
+ * so scalar codegen reads a bare number / `{re, im}`. A 1×1
38
+ * `RuntimeTensor` value must therefore be unwrapped to its element;
39
+ * otherwise the tensor OBJECT leaks into scalar arithmetic and
40
+ * `a.data[i] + b` becomes `number + object = NaN`.
41
+ * 2. **real → complex-scalar param.** Type-widening can reuse a complex
42
+ * specialization for a later real/boolean scalar call; the
43
+ * complex-typed body reads `.re`/`.im`, so a bare number must be
44
+ * boxed into `{re, im:0}`. */
45
+ export declare function numblToJit(v: RuntimeValue, paramType?: Type): unknown;
46
+ /** mtoc2 emit-JS return value → numbl RuntimeValue. */
47
+ export declare function jitToNumbl(v: unknown): RuntimeValue;
48
+ /** True if `e` is the grow-bail sentinel thrown by the emitted JS
49
+ * store helpers (`mtoc2_idx_*_grow_js` in `scalar_index.js`) — an
50
+ * indexed store whose index exceeds the runtime extent, which would
51
+ * grow the array (unsupported in the JIT). The JS executors recognize
52
+ * it to surface a one-time warning; they bail on it (and on any other
53
+ * runtime error) so the interpreter re-runs the scope with full
54
+ * MATLAB grow semantics. */
55
+ export declare function isGrowBail(e: unknown): boolean;
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Value adapter for the mtoc2 C-JIT path.
3
+ *
4
+ * Mirrors `valueAdapter.ts` (JS path) but converts numbl
5
+ * `RuntimeValue` to / from the C ABI mtoc2 expects across the koffi
6
+ * FFI boundary.
7
+ *
8
+ * **Copy budget** (see CLAUDE memo `feedback-no-silent-bails.md`
9
+ * and the user's "no extra copies" guideline):
10
+ * - Scalars: zero copies; passed by value in koffi's args array.
11
+ * - Tensors: one copy in, one copy out. mtoc2's call convention
12
+ * requires the callee own its tensor params (it frees them at
13
+ * scope exit), so the input data must be copied into a
14
+ * `koffi.alloc`'d malloc-backed buffer that mtoc2 can free.
15
+ * Reused / shared buffer would either (a) get freed under
16
+ * numbl's still-live Float64Array, or (b) require extending
17
+ * mtoc2 with borrowed-param semantics — deferred.
18
+ *
19
+ * - Output tensors arrive as `mtoc2_tensor_t` with mtoc2_alloc'd
20
+ * `real`/`imag` pointers. Caller (this adapter) copies the data
21
+ * into a fresh `Float64Array`, then calls `free()` on the
22
+ * pointers (`koffi`-bound `free` from libc) to release mtoc2's
23
+ * buffers.
24
+ */
25
+ import { RuntimeTensor, type RuntimeValue } from "../../runtime/types.js";
26
+ import type { Type, NumericType } from "../../jit/index.js";
27
+ import type { KoffiLib } from "./compileC.js";
28
+ /** Loose koffi typing — same shape as in typeAdapterC.ts. */
29
+ type KoffiAny = any;
30
+ interface Koffi {
31
+ alloc(type: string, count: number): any;
32
+ decode(ptr: unknown, type: string, count: number): any;
33
+ encode(buf: any, type: string, value: any): void;
34
+ address(buf: any): any;
35
+ }
36
+ /** A function that frees the `mtoc2_alloc`'d buffer at the given
37
+ * pointer. Resolved via koffi against libc's `free`. The .so we
38
+ * dlopen pulls in libc anyway, so binding through the same lib is
39
+ * zero-cost. */
40
+ type FreeFn = (ptr: unknown) => void;
41
+ interface MarshalCtx {
42
+ readonly koffi: Koffi;
43
+ readonly free: FreeFn;
44
+ }
45
+ /** Bind numbl's output sink into an emitted C `.so` so program output
46
+ * (disp / fprintf / …) routes through `write` instead of libc stdout
47
+ * — see `runtime/io/host_output.h`. Returns a `dispose()` the caller
48
+ * MUST invoke after the C call returns (success or throw) to unbind
49
+ * and free the koffi callback.
50
+ *
51
+ * When the spec emitted no output, `mtoc2_set_host_write` is absent
52
+ * from the `.so`; binding then no-ops (the C code never writes). */
53
+ export declare function bindHostWrite(koffi: KoffiAny, lib: KoffiLib, write: (s: string) => void): {
54
+ dispose(): void;
55
+ };
56
+ /** Bind the emitted `.so`'s grow-bail flag accessors. A runtime
57
+ * indexed-store grow (`v(k) = x`, k past the runtime extent) sets a
58
+ * flag in the `.so` and `longjmp`s back to the host-entry function's
59
+ * guard (see `grow_bail.h`), which returns normally. The host calls
60
+ * `reset()` before each invocation and `bailed()` after; when
61
+ * `bailed()` is true it discards the outputs and bails to the
62
+ * interpreter (which has full MATLAB grow semantics).
63
+ *
64
+ * When the spec emitted no scalar indexed store, `mtoc2_grow_bail_*`
65
+ * are absent from the `.so`; binding then no-ops (`bailed()` is always
66
+ * false — the code can't grow). */
67
+ export declare function bindGrowBail(lib: KoffiLib): {
68
+ reset(): void;
69
+ bailed(): boolean;
70
+ };
71
+ /** Build a marshaling context from a koffi lib handle. The host
72
+ * passes the lib it got from `compileAndLoadC`; we resolve `free`
73
+ * against that same lib (libc symbols are reachable through any
74
+ * dlopen'd .so). */
75
+ export declare function makeCMarshalCtx(koffi: Koffi, lib: KoffiLib): MarshalCtx;
76
+ /** Marshaled-input bookkeeping returned by `marshalInputs`. The
77
+ * caller is responsible for invoking `release()` once the C call
78
+ * has returned (success or throw). `release` does nothing for
79
+ * scalar inputs (no allocation); for tensor inputs it's also a
80
+ * no-op: mtoc2's spec body frees the buffers at its scope exit.
81
+ * Kept as an explicit handle so a future change to lifetime
82
+ * semantics has a single place to update. */
83
+ export interface MarshaledInputs {
84
+ /** The values to splat into the koffi call, in order. */
85
+ readonly args: unknown[];
86
+ release(): void;
87
+ }
88
+ /** Convert a numbl `RuntimeValue` to the matching koffi-callable
89
+ * arg for a parameter of mtoc2 `Type`. */
90
+ export declare function marshalInputs(ctx: MarshalCtx, paramTypes: ReadonlyArray<Type>, values: ReadonlyArray<RuntimeValue | undefined>): MarshaledInputs | null;
91
+ /** Convert a returned C tensor struct (decoded by koffi into a JS
92
+ * object with `{real, imag, ndim, dims}`) to a numbl RuntimeTensor.
93
+ * Reads `n = product(dims[0..ndim])` doubles from each lane, then
94
+ * frees mtoc2's buffers.
95
+ *
96
+ * For `Numeric` outputs that aren't multi-element (scalars), the
97
+ * caller passes the bare value through `unmarshalScalarOutput`
98
+ * instead — koffi unboxes them automatically.
99
+ */
100
+ export declare function unmarshalTensorOutput(ctx: MarshalCtx, ret: KoffiAny, ty: NumericType): RuntimeTensor;
101
+ /** Convert a bare scalar return value to a numbl RuntimeValue.
102
+ *
103
+ * Real / logical scalars ride the `double` ABI, so koffi hands us a
104
+ * JS number (logical coerces to `Boolean`). Complex scalars ride the
105
+ * `mtoc2_cscalar_t` struct, so koffi hands us a `{re, im}` object,
106
+ * which becomes a `RuntimeComplexNumber`. */
107
+ export declare function unmarshalScalarOutput(v: unknown, ty: NumericType): RuntimeValue;
108
+ export {};
@@ -0,0 +1,120 @@
1
+ /**
2
+ * Shared lowering pipeline.
3
+ *
4
+ * The dispatcher calls `tryLower` once per stmt-dispatch and
5
+ * `tryLowerCall` per function-call dispatch, before any executor is
6
+ * asked to propose. The result — a `LoweredStmt` — is passed to every
7
+ * executor's `propose()` as the first argument. `tryLower` returns
8
+ * `null` for stmts with no specialized lowering shape; the dispatcher
9
+ * falls through to its hardcoded `interp.execStmt` path in that case.
10
+ *
11
+ * Lowering here is *classification only*: it analyses inputs/outputs,
12
+ * infers types, and synthesizes a cacheKey. It does NOT make
13
+ * codegen-feasibility decisions — those live in the codegen executor's
14
+ * `propose`. This keeps the dispatcher free of dependencies on the
15
+ * JIT backend's internals (the in-tree compiler under
16
+ * `src/numbl-core/jit`).
17
+ *
18
+ * Shapes today:
19
+ * - `top-level` — script body (top-level scope). Whole script
20
+ * analysed as a synthetic FunctionDef.
21
+ * - `call` — user-function call. Produced by `tryLowerCall`
22
+ * from `dispatchCall`.
23
+ * - `synth` — a `Synth` AST stmt produced by a registered AST
24
+ * transformer (no further analysis here).
25
+ *
26
+ * Lowerings are cached by (head Stmt or FunctionDef, classification
27
+ * cacheKey).
28
+ */
29
+ import type { Stmt } from "../parser/types.js";
30
+ import type { FunctionDef } from "../interpreter/types.js";
31
+ import type { Interpreter } from "../interpreter/interpreter.js";
32
+ import { type TopLevelClassification, type CallClassification, type LoopClassification } from "./classification.js";
33
+ /** What `propose()` receives — a discriminated union of the
34
+ * specialized shapes the dispatcher knows how to lower. Stmts with
35
+ * no specialized shape don't reach `propose()` at all; the dispatcher
36
+ * falls through to its hardcoded interpreter path. */
37
+ export type LoweredStmt = TopLevelLoweredStmt | LoopLoweredStmt | CallLoweredStmt | SynthLoweredStmt;
38
+ /** Top-level shape: script body analysed for whole-scope codegen. */
39
+ export interface TopLevelLoweredStmt {
40
+ readonly kind: "top-level";
41
+ readonly classification: TopLevelClassification;
42
+ }
43
+ /** Loop shape: a single For/While stmt analysed for loop codegen.
44
+ * Produced by `tryLower` when the head stmt is a For/While. */
45
+ export interface LoopLoweredStmt {
46
+ readonly kind: "loop";
47
+ readonly classification: LoopClassification;
48
+ }
49
+ /** Call shape: a user-function call analysed for call codegen.
50
+ * Produced by `tryLowerCall`, not `tryLower` — function calls fire
51
+ * from expression evaluation, not from the stmt loop. */
52
+ export interface CallLoweredStmt {
53
+ readonly kind: "call";
54
+ readonly classification: CallClassification;
55
+ /** Runtime arg values. Carried alongside the classification
56
+ * because the executor needs them at runCall time; unlike
57
+ * stmt-shape executors, the call executor can't re-fetch them
58
+ * from env. */
59
+ readonly args: readonly unknown[];
60
+ }
61
+ /** Synth shape: a `Synth` AST stmt produced by a registered AST
62
+ * transformer. The matching executor reads `data` (analysis the
63
+ * transformer pre-computed) and the `tag` discriminates among
64
+ * multiple registered transformers. */
65
+ export interface SynthLoweredStmt {
66
+ readonly kind: "synth";
67
+ readonly tag: string;
68
+ readonly data: unknown;
69
+ }
70
+ declare const BAILED: unique symbol;
71
+ type Bailed = typeof BAILED;
72
+ /** Per-owner lowering cache. Owner is either the head Stmt
73
+ * (stmt-shape lowerings) or the FunctionDef (call-shape lowerings).
74
+ * WeakMap-scoped so entries are reclaimed when the AST is dropped.
75
+ *
76
+ * Also tracks per-owner type-widening state: the most recent input
77
+ * type signature seen for a given (owner, slot). Classify phases
78
+ * consult this so a callee invoked with shifting input types
79
+ * converges to a single specialization rather than thrashing the
80
+ * cache. The slot string lets one owner host multiple widening
81
+ * trackers (e.g. one per nargout for call-shape). */
82
+ export declare class LoweringCache {
83
+ private readonly slots;
84
+ private readonly widening;
85
+ get(owner: object, cacheKey: string): LoweredStmt | Bailed | undefined;
86
+ set(owner: object, cacheKey: string, value: LoweredStmt): void;
87
+ markBailed(owner: object, cacheKey: string): void;
88
+ isBailed(value: unknown): value is Bailed;
89
+ /** Most recent input-type signature recorded for (owner, slot), or
90
+ * undefined when nothing has been recorded yet. */
91
+ getLastInputTypes(owner: object, slot: string): import("../jitTypes.js").JitType[] | undefined;
92
+ /** Record the latest unified input-type signature for (owner, slot). */
93
+ setLastInputTypes(owner: object, slot: string, types: readonly import("../jitTypes.js").JitType[]): void;
94
+ }
95
+ /**
96
+ * Try to lower the stmt at `siblings[i]`. Returns a `LoweredStmt` for
97
+ * stmts that match a specialized shape, or `null` for stmts with no
98
+ * shape — the dispatcher falls through to its hardcoded interpreter
99
+ * path in that case.
100
+ *
101
+ * Whole-scope shapes (`top-level`) are NOT produced here — they're
102
+ * lowered separately via `tryLowerTopLevel` and dispatched through
103
+ * `Registry.tryRunWholeScope` before the per-stmt loop runs.
104
+ */
105
+ export declare function tryLower(siblings: readonly Stmt[], i: number, interp: Interpreter, cache: LoweringCache): LoweredStmt | null;
106
+ /**
107
+ * Lower a script body as a whole-scope unit. Called by the registry
108
+ * before the per-stmt dispatch loop runs; returns a TopLevelLoweredStmt
109
+ * for whole-scope executors to consider, or null when the classification
110
+ * declines.
111
+ */
112
+ export declare function tryLowerTopLevel(interp: Interpreter, siblings: readonly Stmt[], cache: LoweringCache): TopLevelLoweredStmt | null;
113
+ /**
114
+ * Try to lower a user-function call. Always returns a
115
+ * `CallLoweredStmt` when classification succeeds; null when the
116
+ * classify declines (`~` params, type-unknown args, varargin
117
+ * arity mismatch).
118
+ */
119
+ export declare function tryLowerCall(fn: FunctionDef, args: unknown[], nargout: number, cache: LoweringCache): CallLoweredStmt | null;
120
+ export {};
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Mode-driven executor registration.
3
+ *
4
+ * `registerExecutorsForOpt(registry, opt)` is the single switch from
5
+ * an `--opt` value to a set of registered executors. Adding a new
6
+ * mode means extending the switch here — no other call-site changes.
7
+ *
8
+ * The AST interpreter is the dispatcher's hardcoded last-resort
9
+ * fallback (see `Registry.dispatch`); it doesn't need to be a
10
+ * registered executor.
11
+ */
12
+ import type { Registry } from "./registry.js";
13
+ import type { Executor } from "./types.js";
14
+ /** The three C-JIT executors, registered at Node bootstrap. */
15
+ export interface CJitExecutors {
16
+ topLevel: Executor;
17
+ loop: Executor;
18
+ call: Executor;
19
+ }
20
+ /** Register the C-JIT executors. Called once at Node bootstrap. */
21
+ export declare function registerCJitExecutors(execs: CJitExecutors): void;
22
+ /** Optimization mode label.
23
+ *
24
+ * - `"0"` — pure AST interpreter, no executors registered.
25
+ * - `"1"` — JS-JIT: all three shapes (top-level, loop,
26
+ * call) emit JS via `compileSpec`. JIT declines
27
+ * (`UnsupportedConstruct` / `JitTypeError`) fall back to the
28
+ * interpreter cleanly.
29
+ * - `"2"` — C-JIT-first with JS-JIT fallback. Both backends
30
+ * register their executors; the dispatcher picks based on cost,
31
+ * so the C path wins where it applies (scalar / tensor numeric
32
+ * types with a wired `nativeBridge`) and the JS path picks up
33
+ * the slack (struct / class / handle / no-cc-available).
34
+ * Requires `cc` on the PATH and `koffi` installed; without
35
+ * either, the C executors decline and `"2"` collapses to the
36
+ * same behaviour as `"1"`. */
37
+ export type OptLevel = "0" | "1" | "2";
38
+ export declare const OPT_LEVELS: readonly OptLevel[];
39
+ export declare function isOptLevel(s: string): s is OptLevel;
40
+ /** Register the executors for a given optimization mode. */
41
+ export declare function registerExecutorsForOpt(registry: Registry, opt: OptLevel): void;