@almadar/std 17.0.3 → 17.1.0

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 (313) hide show
  1. package/behaviors/lolo/auth/atoms/std-dev-personas.lolo +27 -2
  2. package/behaviors/lolo/cli/atoms/std-orb-goldens.lolo +6 -3
  3. package/behaviors/lolo/cli/atoms/std-orb-lint-mem-handles.lolo +54 -34
  4. package/behaviors/lolo/cli/atoms/std-orb-lint-os-grants.lolo +4 -4
  5. package/behaviors/lolo/cli/atoms/std-orb-mcp.lolo +16 -21
  6. package/behaviors/lolo/cli/atoms/std-orb-serve.lolo +24 -4
  7. package/behaviors/lolo/codec/atoms/std-lolo-kotlin.lolo +26 -3
  8. package/behaviors/lolo/codec/atoms/std-lolo-python.lolo +15 -2
  9. package/behaviors/lolo/codec/atoms/std-lolo-rust.lolo +27 -2
  10. package/behaviors/lolo/codec/atoms/std-lolo-source.lolo +251 -60
  11. package/behaviors/lolo/codec/atoms/std-lolo-swift.lolo +24 -1
  12. package/behaviors/lolo/codec/atoms/std-lolo-typescript.lolo +24 -3
  13. package/behaviors/lolo/connect/atoms/std-meta-ads.lolo +4 -4
  14. package/behaviors/lolo/connect/atoms/std-stdio-lines.lolo +7 -4
  15. package/behaviors/lolo/connect/atoms/std-youtube.lolo +9 -9
  16. package/behaviors/lolo/dev/atoms/std-guest-session.lolo +122 -10
  17. package/behaviors/lolo/dev/atoms/std-mock-seed-marks.lolo +66 -0
  18. package/behaviors/lolo/dev/organisms/std-behavior-playground.lolo +5 -2
  19. package/behaviors/lolo/dev/organisms/std-launchpad.lolo +4 -3
  20. package/behaviors/lolo/gpu/atoms/std-gpu-compute.lolo +329 -0
  21. package/behaviors/lolo/net/atoms/std-http-client.lolo +4 -4
  22. package/behaviors/lolo/net/atoms/std-http-fetch.lolo +6 -6
  23. package/behaviors/lolo/net/atoms/std-npm-lookup.lolo +1 -1
  24. package/behaviors/lolo/net/atoms/std-npm-registry.lolo +2 -2
  25. package/behaviors/lolo/spec/auth/dev-personas.replay.goldens.json +263 -2
  26. package/behaviors/lolo/spec/cli/lint-all.lolo +1 -0
  27. package/behaviors/lolo/spec/cli/lint-item-action-event.replay.goldens.json +9 -9
  28. package/behaviors/lolo/spec/cli/lint-mem-handles.replay.goldens.json +3021 -1
  29. package/behaviors/lolo/spec/cli/lint-os-grants.replay.goldens.json +284 -12
  30. package/behaviors/lolo/spec/cli/mcp-server.replay.goldens.json +51 -55
  31. package/behaviors/lolo/spec/cli/orb-compile.replay.goldens.json +10 -4
  32. package/behaviors/lolo/spec/codec/lolo-kotlin.replay.goldens.json +7496 -7497
  33. package/behaviors/lolo/spec/codec/lolo-python.replay.goldens.json +341 -3
  34. package/behaviors/lolo/spec/codec/lolo-rust.replay.goldens.json +18931 -6142
  35. package/behaviors/lolo/spec/codec/lolo-source.fixtures/compose-pair.lolo +44 -0
  36. package/behaviors/lolo/spec/codec/lolo-source.fixtures/config-read.lolo +2 -1
  37. package/behaviors/lolo/spec/codec/lolo-source.fixtures/divide-default.lolo +2 -1
  38. package/behaviors/lolo/spec/codec/lolo-source.fixtures/divide-plain.lolo +2 -1
  39. package/behaviors/lolo/spec/codec/lolo-source.fixtures/get-past-end.lolo +2 -1
  40. package/behaviors/lolo/spec/codec/lolo-source.fixtures/list-call.lolo +2 -1
  41. package/behaviors/lolo/spec/codec/lolo-source.fixtures/list-plain.lolo +2 -1
  42. package/behaviors/lolo/spec/codec/lolo-source.fixtures/minus-binary.lolo +2 -1
  43. package/behaviors/lolo/spec/codec/lolo-source.fixtures/minus-unary.lolo +2 -1
  44. package/behaviors/lolo/spec/codec/lolo-source.fixtures/nested-let.lolo +2 -1
  45. package/behaviors/lolo/spec/codec/lolo-source.fixtures/no-machine.lolo +2 -1
  46. package/behaviors/lolo/spec/codec/lolo-source.fixtures/no-template.lolo +2 -1
  47. package/behaviors/lolo/spec/codec/lolo-source.fixtures/nth-past-end.lolo +2 -1
  48. package/behaviors/lolo/spec/codec/lolo-source.fixtures/nth-raw.lolo +2 -1
  49. package/behaviors/lolo/spec/codec/lolo-source.fixtures/ports-call.lolo +2 -1
  50. package/behaviors/lolo/spec/codec/lolo-source.fixtures/range-one.lolo +2 -1
  51. package/behaviors/lolo/spec/codec/lolo-source.fixtures/range-two.lolo +2 -1
  52. package/behaviors/lolo/spec/codec/lolo-source.fixtures/router-trio.lolo +88 -0
  53. package/behaviors/lolo/spec/codec/lolo-source.fixtures/store-pair.lolo +62 -0
  54. package/behaviors/lolo/spec/codec/lolo-source.fixtures/string-literal.lolo +2 -1
  55. package/behaviors/lolo/spec/codec/lolo-source.gen/knobs.py +27 -1
  56. package/behaviors/lolo/spec/codec/lolo-source.gen/src_assemble.in +54 -2
  57. package/behaviors/lolo/spec/codec/lolo-source.gen/src_finish.in +1 -1
  58. package/behaviors/lolo/spec/codec/lolo-source.gen/src_fold.in +24 -4
  59. package/behaviors/lolo/spec/codec/lolo-source.gen/src_head.in +8 -3
  60. package/behaviors/lolo/spec/codec/lolo-source.gen/src_prepare.in +6 -2
  61. package/behaviors/lolo/spec/codec/lolo-source.gen/src_trait.in +12 -2
  62. package/behaviors/lolo/spec/codec/lolo-source.parity/agent-step.lolo +2 -1
  63. package/behaviors/lolo/spec/codec/lolo-source.parity/agent-step.server.lolo +1 -0
  64. package/behaviors/lolo/spec/codec/lolo-source.parity/chunk.lolo +2 -1
  65. package/behaviors/lolo/spec/codec/lolo-source.parity/chunk.server.lolo +1 -0
  66. package/behaviors/lolo/spec/codec/lolo-source.parity/compose-pair.events.json +36 -0
  67. package/behaviors/lolo/spec/codec/lolo-source.parity/compose-pair.replay.goldens.json +91 -0
  68. package/behaviors/lolo/spec/codec/lolo-source.parity/cosine.lolo +2 -1
  69. package/behaviors/lolo/spec/codec/lolo-source.parity/cosine.server.lolo +1 -0
  70. package/behaviors/lolo/spec/codec/lolo-source.parity/drivers/kotlin/compose-pair.kt +31 -0
  71. package/behaviors/lolo/spec/codec/lolo-source.parity/drivers/kotlin/router-trio.kt +31 -0
  72. package/behaviors/lolo/spec/codec/lolo-source.parity/drivers/kotlin/store-pair.kt +31 -0
  73. package/behaviors/lolo/spec/codec/lolo-source.parity/drivers/python/compose-pair.py +18 -0
  74. package/behaviors/lolo/spec/codec/lolo-source.parity/drivers/python/router-trio.py +18 -0
  75. package/behaviors/lolo/spec/codec/lolo-source.parity/drivers/python/store-pair.py +17 -0
  76. package/behaviors/lolo/spec/codec/lolo-source.parity/drivers/rust/compose-pair.rs +37 -0
  77. package/behaviors/lolo/spec/codec/lolo-source.parity/drivers/rust/router-trio.rs +37 -0
  78. package/behaviors/lolo/spec/codec/lolo-source.parity/drivers/rust/store-pair.rs +36 -0
  79. package/behaviors/lolo/spec/codec/lolo-source.parity/drivers/swift/compose-pair.swift +24 -0
  80. package/behaviors/lolo/spec/codec/lolo-source.parity/drivers/swift/router-trio.swift +24 -0
  81. package/behaviors/lolo/spec/codec/lolo-source.parity/drivers/swift/store-pair.swift +23 -0
  82. package/behaviors/lolo/spec/codec/lolo-source.parity/drivers/typescript/compose-pair.mts +24 -0
  83. package/behaviors/lolo/spec/codec/lolo-source.parity/drivers/typescript/router-trio.mts +24 -0
  84. package/behaviors/lolo/spec/codec/lolo-source.parity/drivers/typescript/store-pair.mts +22 -0
  85. package/behaviors/lolo/spec/codec/lolo-source.parity/recall-at-k.lolo +2 -1
  86. package/behaviors/lolo/spec/codec/lolo-source.parity/recall-at-k.server.lolo +1 -0
  87. package/behaviors/lolo/spec/codec/lolo-source.parity/router-trio.events.json +18 -0
  88. package/behaviors/lolo/spec/codec/lolo-source.parity/router-trio.replay.goldens.json +87 -0
  89. package/behaviors/lolo/spec/codec/lolo-source.parity/store-pair.events.json +58 -0
  90. package/behaviors/lolo/spec/codec/lolo-source.parity/store-pair.replay.goldens.json +238 -0
  91. package/behaviors/lolo/spec/codec/lolo-swift.replay.goldens.json +15599 -2204
  92. package/behaviors/lolo/spec/codec/lolo-typescript.replay.goldens.json +28930 -28929
  93. package/behaviors/lolo/spec/connect/bearer-api.replay.goldens.json +1 -1
  94. package/behaviors/lolo/spec/connect/esign.replay.goldens.json +3 -3
  95. package/behaviors/lolo/spec/connect/github.replay.goldens.json +13 -13
  96. package/behaviors/lolo/spec/connect/google-calendar.replay.goldens.json +2 -2
  97. package/behaviors/lolo/spec/connect/image.replay.goldens.json +1 -1
  98. package/behaviors/lolo/spec/connect/meta-ads.replay.goldens.json +2 -2
  99. package/behaviors/lolo/spec/connect/stdio-lines.replay.goldens.json +90 -0
  100. package/behaviors/lolo/spec/connect/twilio.replay.goldens.json +2 -2
  101. package/behaviors/lolo/spec/connect/youtube.replay.goldens.json +1 -1
  102. package/behaviors/lolo/spec/dev/guest-session.replay.goldens.json +824 -0
  103. package/behaviors/lolo/spec/dev/mock-seed-marks.replay.goldens.json +365 -0
  104. package/behaviors/lolo/spec/dev/verify-walk.replay.goldens.json +2 -1
  105. package/behaviors/lolo/spec/gpu/gpu-compute.replay.goldens.json +784 -0
  106. package/behaviors/lolo/spec/mem/mem-buffer.replay.goldens.json +97 -1
  107. package/behaviors/lolo/spec/ml/vector-write.goldens.json +1 -1
  108. package/behaviors/lolo/spec/ml/vector-write.replay.goldens.json +2 -2
  109. package/behaviors/lolo/spec/net/http-client-call-host.replay.goldens.json +3 -3
  110. package/behaviors/lolo/spec/net/http-client-env-host.replay.goldens.json +3 -3
  111. package/behaviors/lolo/spec/net/http-client.replay.goldens.json +56 -56
  112. package/behaviors/lolo/spec/net/http-fetch.replay.goldens.json +2 -2
  113. package/behaviors/lolo/spec/net/npm-lookup.replay.goldens.json +1 -1
  114. package/behaviors/lolo/spec/net/npm-registry.replay.goldens.json +2 -2
  115. package/behaviors/lolo/spec/net/server-declared-traits.replay.goldens.json +6 -3
  116. package/behaviors/lolo/spec/net/server-external-inputs.replay.goldens.json +16 -8
  117. package/behaviors/lolo/spec/net/server-retargeted-leg.replay.goldens.json +4 -2
  118. package/behaviors/lolo/spec/net/server-untargeted-discovery.replay.goldens.json +50 -45
  119. package/behaviors/lolo/spec/ops/llm-spend-board.replay.goldens.json +112 -16
  120. package/behaviors/lolo/spec/store/firestore-twin.replay.goldens.json +1 -1
  121. package/behaviors/lolo/spec/store/row-store-postgres.gen/record_real_sql.py +1 -1
  122. package/behaviors/lolo/spec/ui/game/fx-particles.replay.goldens.json +37 -0
  123. package/behaviors/lolo/ui/avl/atoms/std-avl-cosmic-zoom.lolo +2 -2
  124. package/behaviors/lolo/ui/game/atoms/std-fx-particles.lolo +10 -1
  125. package/behaviors/lolo/ui/game/atoms/ui-draw-fx-layer.lolo +4 -4
  126. package/behaviors/lolo/ui/game/organisms/std-arcade-board-3d.lolo +9 -9
  127. package/behaviors/lolo/ui/game/organisms/std-crew-board-2d.lolo +4 -4
  128. package/behaviors/lolo/ui/game/organisms/std-dungeon-board-2d.lolo +5 -5
  129. package/behaviors/lolo/ui/game/organisms/std-market-board-3d.lolo +9 -9
  130. package/behaviors/lolo/ui/game/organisms/std-objective-board-3d.lolo +9 -9
  131. package/behaviors/lolo/ui/game/organisms/std-platformer-board-2d.lolo +5 -5
  132. package/behaviors/lolo/ui/game/organisms/std-platformer-puzzle.lolo +4 -4
  133. package/behaviors/lolo/ui/game/organisms/std-survival-board-3d.lolo +9 -9
  134. package/behaviors/lolo/ui/game/organisms/std-tactics-board-2d.lolo +5 -5
  135. package/behaviors/lolo/ui/game/organisms/std-tactics-board-3d.lolo +9 -9
  136. package/behaviors/registry/auth/atoms/std-dev-personas.orb +1 -1
  137. package/behaviors/registry/cli/atoms/std-orb-goldens.orb +1 -1
  138. package/behaviors/registry/cli/atoms/std-orb-lint-mem-handles.orb +1 -1
  139. package/behaviors/registry/cli/atoms/std-orb-lint-os-grants.orb +1 -1
  140. package/behaviors/registry/cli/atoms/std-orb-mcp.orb +1 -1
  141. package/behaviors/registry/cli/atoms/std-orb-serve.orb +1 -1
  142. package/behaviors/registry/codec/atoms/std-lolo-kotlin.orb +1 -1
  143. package/behaviors/registry/codec/atoms/std-lolo-python.orb +1 -1
  144. package/behaviors/registry/codec/atoms/std-lolo-rust.orb +1 -1
  145. package/behaviors/registry/codec/atoms/std-lolo-source.orb +1 -1
  146. package/behaviors/registry/codec/atoms/std-lolo-swift.orb +1 -1
  147. package/behaviors/registry/codec/atoms/std-lolo-typescript.orb +1 -1
  148. package/behaviors/registry/connect/atoms/std-meta-ads.orb +1 -1
  149. package/behaviors/registry/connect/atoms/std-stdio-lines.orb +1 -1
  150. package/behaviors/registry/connect/atoms/std-youtube.orb +1 -1
  151. package/behaviors/registry/dev/atoms/std-guest-session.orb +1 -1
  152. package/behaviors/registry/dev/atoms/std-mock-seed-marks.orb +1 -0
  153. package/behaviors/registry/dev/organisms/std-behavior-playground.orb +37 -0
  154. package/behaviors/registry/dev/organisms/std-launchpad.orb +25 -0
  155. package/behaviors/registry/gpu/atoms/std-gpu-compute.orb +1 -0
  156. package/behaviors/registry/net/atoms/std-http-client.orb +1 -1
  157. package/behaviors/registry/net/atoms/std-http-fetch.orb +1 -1
  158. package/behaviors/registry/net/atoms/std-npm-lookup.orb +1 -1
  159. package/behaviors/registry/net/atoms/std-npm-registry.orb +1 -1
  160. package/behaviors/registry/spec/cli/lint-all.orb +1 -1
  161. package/behaviors/registry/spec/codec/lolo-source.fixtures/compose-pair.orb +1 -0
  162. package/behaviors/registry/spec/codec/lolo-source.fixtures/config-read.orb +1 -1
  163. package/behaviors/registry/spec/codec/lolo-source.fixtures/divide-default.orb +1 -1
  164. package/behaviors/registry/spec/codec/lolo-source.fixtures/divide-plain.orb +1 -1
  165. package/behaviors/registry/spec/codec/lolo-source.fixtures/get-past-end.orb +1 -1
  166. package/behaviors/registry/spec/codec/lolo-source.fixtures/list-call.orb +1 -1
  167. package/behaviors/registry/spec/codec/lolo-source.fixtures/list-plain.orb +1 -1
  168. package/behaviors/registry/spec/codec/lolo-source.fixtures/minus-binary.orb +1 -1
  169. package/behaviors/registry/spec/codec/lolo-source.fixtures/minus-unary.orb +1 -1
  170. package/behaviors/registry/spec/codec/lolo-source.fixtures/nested-let.orb +1 -1
  171. package/behaviors/registry/spec/codec/lolo-source.fixtures/no-machine.orb +1 -1
  172. package/behaviors/registry/spec/codec/lolo-source.fixtures/no-template.orb +1 -1
  173. package/behaviors/registry/spec/codec/lolo-source.fixtures/nth-past-end.orb +1 -1
  174. package/behaviors/registry/spec/codec/lolo-source.fixtures/nth-raw.orb +1 -1
  175. package/behaviors/registry/spec/codec/lolo-source.fixtures/ports-call.orb +1 -1
  176. package/behaviors/registry/spec/codec/lolo-source.fixtures/range-one.orb +1 -1
  177. package/behaviors/registry/spec/codec/lolo-source.fixtures/range-two.orb +1 -1
  178. package/behaviors/registry/spec/codec/lolo-source.fixtures/router-trio.orb +1 -0
  179. package/behaviors/registry/spec/codec/lolo-source.fixtures/store-pair.orb +1 -0
  180. package/behaviors/registry/spec/codec/lolo-source.fixtures/string-literal.orb +1 -1
  181. package/behaviors/registry/spec/codec/lolo-source.parity/agent-step.orb +1 -1
  182. package/behaviors/registry/spec/codec/lolo-source.parity/agent-step.server.orb +1 -1
  183. package/behaviors/registry/spec/codec/lolo-source.parity/chunk.orb +1 -1
  184. package/behaviors/registry/spec/codec/lolo-source.parity/chunk.server.orb +1 -1
  185. package/behaviors/registry/spec/codec/lolo-source.parity/cosine.orb +1 -1
  186. package/behaviors/registry/spec/codec/lolo-source.parity/cosine.server.orb +1 -1
  187. package/behaviors/registry/spec/codec/lolo-source.parity/recall-at-k.orb +1 -1
  188. package/behaviors/registry/spec/codec/lolo-source.parity/recall-at-k.server.orb +1 -1
  189. package/behaviors/registry/ui/avl/atoms/std-avl-cosmic-zoom.orb +1 -1
  190. package/behaviors/registry/ui/game/atoms/std-fx-particles.orb +1 -1
  191. package/behaviors/registry/ui/game/atoms/ui-draw-fx-layer.orb +1 -1
  192. package/behaviors/registry/ui/game/organisms/std-arcade-board-3d.orb +20 -13
  193. package/behaviors/registry/ui/game/organisms/std-crew-board-2d.orb +9 -5
  194. package/behaviors/registry/ui/game/organisms/std-dungeon-board-2d.orb +17 -7
  195. package/behaviors/registry/ui/game/organisms/std-market-board-3d.orb +19 -15
  196. package/behaviors/registry/ui/game/organisms/std-objective-board-3d.orb +15 -12
  197. package/behaviors/registry/ui/game/organisms/std-platformer-board-2d.orb +17 -7
  198. package/behaviors/registry/ui/game/organisms/std-platformer-puzzle.orb +4 -0
  199. package/behaviors/registry/ui/game/organisms/std-survival-board-3d.orb +15 -12
  200. package/behaviors/registry/ui/game/organisms/std-tactics-board-2d.orb +13 -6
  201. package/behaviors/registry/ui/game/organisms/std-tactics-board-3d.orb +14 -12
  202. package/canonical-operators.json +1426 -103
  203. package/dist/{chunk-EK22WRB6.js → chunk-2UGHBVU2.js} +2 -2
  204. package/dist/{chunk-GDMH5T4J.js → chunk-3DK7GI2C.js} +2 -2
  205. package/dist/chunk-3MDASC5C.js +26 -0
  206. package/dist/{chunk-K5ZI27PB.js → chunk-3PHO4RRF.js} +1 -1
  207. package/dist/{chunk-7IEMMYM6.js → chunk-4MJCLAZW.js} +1 -1
  208. package/dist/{chunk-W4IEV4BY.js → chunk-55JPIL7A.js} +2 -2
  209. package/dist/{chunk-RUGBZTV3.js → chunk-66BLZLFI.js} +1 -1
  210. package/dist/{chunk-YWFISV7L.js → chunk-66RAJFOD.js} +1 -1
  211. package/dist/{chunk-JWOWWGNZ.js → chunk-6ED4SUC6.js} +1 -1
  212. package/dist/{chunk-LL7P6EII.js → chunk-6KFCHNE2.js} +2 -2
  213. package/dist/{chunk-GFBL2TW6.js → chunk-A4QB3Y6L.js} +1 -1
  214. package/dist/chunk-BVWMLS32.js +123 -0
  215. package/dist/{chunk-5KQCGSNC.js → chunk-CRKVDCY7.js} +1 -1
  216. package/dist/{chunk-WHQDLLC3.js → chunk-EKWEY4OJ.js} +1 -1
  217. package/dist/{chunk-Y3BRVNYK.js → chunk-EU22GCGV.js} +2 -2
  218. package/dist/{chunk-XQPYTDZ4.js → chunk-FB6PKNRS.js} +1 -1
  219. package/dist/{chunk-UX3MDFX6.js → chunk-FSVOJQLP.js} +1 -1
  220. package/dist/{chunk-LDBD2FBQ.js → chunk-GAKLBWBR.js} +1 -1
  221. package/dist/{chunk-C3IEMPRZ.js → chunk-GO3FKBV2.js} +2 -2
  222. package/dist/{chunk-LZSPEHSM.js → chunk-GPDTJHYY.js} +1 -1
  223. package/dist/{chunk-W5ABMOXU.js → chunk-JQBWLH5V.js} +1 -1
  224. package/dist/{chunk-63X6RNY6.js → chunk-KKW3JHTC.js} +1 -1
  225. package/dist/{chunk-5PLJE42Q.js → chunk-LF2EZVAM.js} +1 -1
  226. package/dist/{chunk-RXWBYWQB.js → chunk-LGCKOZP3.js} +2 -2
  227. package/dist/{chunk-JJEADYP7.js → chunk-LMZ6XJFB.js} +2 -2
  228. package/dist/{chunk-CWYSQZJU.js → chunk-M2YQNSAZ.js} +2 -2
  229. package/dist/{chunk-GNCKJV3P.js → chunk-MKWHYBIS.js} +1 -1
  230. package/dist/{chunk-ZB2CLGEG.js → chunk-MXBGYTYF.js} +1 -1
  231. package/dist/{chunk-UN76TRSK.js → chunk-NH6MXHZR.js} +41 -41
  232. package/dist/{chunk-II2VW7T6.js → chunk-ODBIX4DB.js} +1 -1
  233. package/dist/{chunk-3F3CNWOG.js → chunk-OYDQR6DT.js} +2 -2
  234. package/dist/{chunk-FVL6BT6L.js → chunk-PD6POR44.js} +1 -1
  235. package/dist/{chunk-U6USXZ5M.js → chunk-PHFT3QNS.js} +2 -2
  236. package/dist/{chunk-RJYKIZMS.js → chunk-PQZ6PVKG.js} +2 -2
  237. package/dist/{chunk-TQPQXCSZ.js → chunk-Q6NHXIOZ.js} +2 -2
  238. package/dist/{chunk-KYGWVCTM.js → chunk-QMDVYTB7.js} +1 -1
  239. package/dist/{chunk-XKTATY45.js → chunk-RW2KMSG5.js} +4 -4
  240. package/dist/{chunk-UHNSPTFT.js → chunk-SA2ZS24W.js} +1 -1
  241. package/dist/{chunk-6YPUQK36.js → chunk-SFWP4UMK.js} +2 -2
  242. package/dist/{chunk-ZZYLFHBU.js → chunk-TLNEQA4D.js} +1 -1
  243. package/dist/{chunk-RGTBRWWA.js → chunk-TOODE5AD.js} +2 -2
  244. package/dist/{chunk-QGWAHOFR.js → chunk-U57GY7SM.js} +2 -2
  245. package/dist/{chunk-FDJZKB7J.js → chunk-UIDQQJSX.js} +1 -1
  246. package/dist/{chunk-LLH3WXM3.js → chunk-UVFP2B7I.js} +1 -1
  247. package/dist/{chunk-4OF7727E.js → chunk-VEGZPCTZ.js} +2 -2
  248. package/dist/{chunk-73YUPNIT.js → chunk-VXN4V7LC.js} +1 -1
  249. package/dist/{chunk-4D3W6AAE.js → chunk-YHQVZWPG.js} +1 -1
  250. package/dist/{chunk-XXYBHYLM.js → chunk-YQO3TO66.js} +2 -2
  251. package/dist/{chunk-YZAYFR5A.js → chunk-ZSJ3GEOJ.js} +1 -1
  252. package/dist/index.d.ts +3 -3
  253. package/dist/index.js +50 -50
  254. package/dist/modules/anim.js +2 -2
  255. package/dist/modules/array.js +2 -2
  256. package/dist/modules/auth.js +3 -3
  257. package/dist/modules/behavior.js +2 -2
  258. package/dist/modules/bit.js +2 -2
  259. package/dist/modules/browser.js +2 -2
  260. package/dist/modules/bytes.js +2 -2
  261. package/dist/modules/codec.js +3 -3
  262. package/dist/modules/composition.js +2 -2
  263. package/dist/modules/core.js +2 -2
  264. package/dist/modules/csv.js +2 -2
  265. package/dist/modules/ffi.js +3 -3
  266. package/dist/modules/format.js +2 -2
  267. package/dist/modules/geo.js +2 -2
  268. package/dist/modules/gpu.d.ts +12 -0
  269. package/dist/modules/gpu.js +3 -0
  270. package/dist/modules/grid.js +2 -2
  271. package/dist/modules/i18n.js +2 -2
  272. package/dist/modules/index.d.ts +1 -2
  273. package/dist/modules/index.js +45 -46
  274. package/dist/modules/json.js +2 -2
  275. package/dist/modules/kernel.js +3 -3
  276. package/dist/modules/kv.js +3 -3
  277. package/dist/modules/llm.js +2 -2
  278. package/dist/modules/math.js +2 -2
  279. package/dist/modules/mem.js +3 -3
  280. package/dist/modules/object.js +2 -2
  281. package/dist/modules/os-common.d.ts +1 -1
  282. package/dist/modules/os-common.js +2 -2
  283. package/dist/modules/os-desktop.js +3 -3
  284. package/dist/modules/os-dev.js +3 -3
  285. package/dist/modules/os-dir.js +3 -3
  286. package/dist/modules/os-env-stdio.js +3 -3
  287. package/dist/modules/os-fs.js +3 -3
  288. package/dist/modules/os-net.js +3 -3
  289. package/dist/modules/os-path.js +3 -3
  290. package/dist/modules/os-process.js +3 -3
  291. package/dist/modules/os-sys.js +3 -3
  292. package/dist/modules/os-time-users.js +3 -3
  293. package/dist/modules/os.js +13 -13
  294. package/dist/modules/path.js +2 -2
  295. package/dist/modules/prob.js +2 -2
  296. package/dist/modules/program.js +2 -2
  297. package/dist/modules/session.js +2 -2
  298. package/dist/modules/str.js +2 -2
  299. package/dist/modules/time.js +2 -2
  300. package/dist/modules/validate.js +2 -2
  301. package/dist/modules/vector.js +2 -2
  302. package/dist/modules/workspace.js +2 -2
  303. package/dist/modules/xml.js +2 -2
  304. package/dist/modules/yaml.js +2 -2
  305. package/dist/registry.d.ts +2 -2
  306. package/dist/registry.js +49 -49
  307. package/dist/{types-BA4LkhNJ.d.ts → types-CgiGhK6t.d.ts} +17 -3
  308. package/package.json +5 -5
  309. package/dist/chunk-F5TP25JA.js +0 -26
  310. package/dist/chunk-NE4WSTN7.js +0 -26
  311. package/dist/modules/trace.d.ts +0 -15
  312. package/dist/modules/trace.js +0 -2
  313. /package/dist/{chunk-SHSBTDDX.js → chunk-QUQ33UXH.js} +0 -0
@@ -3687,6 +3687,3026 @@
3687
3687
  }
3688
3688
  }
3689
3689
  ]
3690
- }
3690
+ },
3691
+ {
3692
+ "id": "gpu-clean-lifecycle-write-submit-read-release-close-is-clean",
3693
+ "steps": [
3694
+ {
3695
+ "event": "SITES_HEARD",
3696
+ "from": "ready",
3697
+ "payload": {
3698
+ "scope": "",
3699
+ "guardHeads": {},
3700
+ "guardRoots": {
3701
+ "0-0-0": [],
3702
+ "0-0-1": [],
3703
+ "0-0-2": [],
3704
+ "0-0-3": [],
3705
+ "0-0-4": [],
3706
+ "0-0-5": [],
3707
+ "0-0-6": [],
3708
+ "0-0-7": [],
3709
+ "0-0-8": [],
3710
+ "0-0-9": [],
3711
+ "0-0-10": [],
3712
+ "0-0-11": [],
3713
+ "0-0-12": [],
3714
+ "0-0-13": [],
3715
+ "0-0-14": [],
3716
+ "0-0-15": [],
3717
+ "0-0-16": [],
3718
+ "0-0-17": [],
3719
+ "0-0-18": [],
3720
+ "0-0-19": []
3721
+ },
3722
+ "calls": {
3723
+ "gpu/device-open": [
3724
+ {
3725
+ "path": "orbitals[0].traits[0].stateMachine.transitions[1].effects[0]",
3726
+ "node": [
3727
+ "gpu/device-open",
3728
+ "high-performance",
3729
+ {
3730
+ "emit": {
3731
+ "success": "DEV_OK",
3732
+ "failure": "FAILED"
3733
+ }
3734
+ }
3735
+ ],
3736
+ "at": 0
3737
+ }
3738
+ ],
3739
+ "gpu/buffer-create": [
3740
+ {
3741
+ "path": "orbitals[0].traits[0].stateMachine.transitions[3].effects[1]",
3742
+ "node": [
3743
+ "gpu/buffer-create",
3744
+ "@entity.device",
3745
+ "storage",
3746
+ {
3747
+ "emit": {
3748
+ "success": "BUF_OK",
3749
+ "failure": "FAILED"
3750
+ }
3751
+ }
3752
+ ],
3753
+ "at": 0
3754
+ }
3755
+ ],
3756
+ "gpu/device-close": [
3757
+ {
3758
+ "path": "orbitals[0].traits[0].stateMachine.transitions[4].effects[0]",
3759
+ "node": [
3760
+ "gpu/device-close",
3761
+ "@entity.device",
3762
+ {
3763
+ "emit": {
3764
+ "success": "CLOSED",
3765
+ "failure": "FAILED"
3766
+ }
3767
+ }
3768
+ ],
3769
+ "at": 0
3770
+ },
3771
+ {
3772
+ "path": "orbitals[0].traits[0].stateMachine.transitions[6].effects[0]",
3773
+ "node": [
3774
+ "gpu/device-close",
3775
+ "@entity.device",
3776
+ {
3777
+ "emit": {
3778
+ "success": "CLOSED",
3779
+ "failure": "FAILED"
3780
+ }
3781
+ }
3782
+ ],
3783
+ "at": 0
3784
+ },
3785
+ {
3786
+ "path": "orbitals[0].traits[0].stateMachine.transitions[8].effects[0]",
3787
+ "node": [
3788
+ "gpu/device-close",
3789
+ "@entity.device",
3790
+ {
3791
+ "emit": {
3792
+ "success": "CLOSED",
3793
+ "failure": "FAILED"
3794
+ }
3795
+ }
3796
+ ],
3797
+ "at": 0
3798
+ },
3799
+ {
3800
+ "path": "orbitals[0].traits[0].stateMachine.transitions[10].effects[0]",
3801
+ "node": [
3802
+ "gpu/device-close",
3803
+ "@entity.device",
3804
+ {
3805
+ "emit": {
3806
+ "success": "CLOSED",
3807
+ "failure": "FAILED"
3808
+ }
3809
+ }
3810
+ ],
3811
+ "at": 0
3812
+ },
3813
+ {
3814
+ "path": "orbitals[0].traits[0].stateMachine.transitions[12].effects[0]",
3815
+ "node": [
3816
+ "gpu/device-close",
3817
+ "@entity.device",
3818
+ {
3819
+ "emit": {
3820
+ "success": "CLOSED",
3821
+ "failure": "FAILED"
3822
+ }
3823
+ }
3824
+ ],
3825
+ "at": 0
3826
+ },
3827
+ {
3828
+ "path": "orbitals[0].traits[0].stateMachine.transitions[13].effects[0]",
3829
+ "node": [
3830
+ "gpu/device-close",
3831
+ "@entity.device",
3832
+ {
3833
+ "emit": {
3834
+ "success": "CLOSED",
3835
+ "failure": "FAILED"
3836
+ }
3837
+ }
3838
+ ],
3839
+ "at": 0
3840
+ }
3841
+ ],
3842
+ "gpu/submit": [
3843
+ {
3844
+ "path": "orbitals[0].traits[0].stateMachine.transitions[5].effects[1]",
3845
+ "node": [
3846
+ "gpu/submit",
3847
+ "@entity.device",
3848
+ [
3849
+ {
3850
+ "write": {
3851
+ "buffer": "@entity.buf",
3852
+ "data": "x"
3853
+ }
3854
+ }
3855
+ ],
3856
+ {
3857
+ "emit": {
3858
+ "success": "WROTE",
3859
+ "failure": "FAILED"
3860
+ }
3861
+ }
3862
+ ],
3863
+ "at": 0
3864
+ },
3865
+ {
3866
+ "path": "orbitals[0].traits[0].stateMachine.transitions[7].effects[0]",
3867
+ "node": [
3868
+ "gpu/submit",
3869
+ "@entity.device",
3870
+ "cmds",
3871
+ {
3872
+ "emit": {
3873
+ "success": "SUBMITTED",
3874
+ "failure": "FAILED"
3875
+ }
3876
+ }
3877
+ ],
3878
+ "at": 0
3879
+ },
3880
+ {
3881
+ "path": "orbitals[0].traits[0].stateMachine.transitions[9].effects[0]",
3882
+ "node": [
3883
+ "gpu/submit",
3884
+ "@entity.device",
3885
+ [
3886
+ {
3887
+ "read": {
3888
+ "buffer": "@entity.buf"
3889
+ }
3890
+ }
3891
+ ],
3892
+ {
3893
+ "emit": {
3894
+ "success": "READ_OK",
3895
+ "failure": "FAILED"
3896
+ }
3897
+ }
3898
+ ],
3899
+ "at": 0
3900
+ }
3901
+ ],
3902
+ "gpu/release": [
3903
+ {
3904
+ "path": "orbitals[0].traits[0].stateMachine.transitions[11].effects[0]",
3905
+ "node": [
3906
+ "gpu/release",
3907
+ "@entity.buf",
3908
+ {
3909
+ "emit": {
3910
+ "success": "RELEASED",
3911
+ "failure": "FAILED"
3912
+ }
3913
+ }
3914
+ ],
3915
+ "at": 0
3916
+ }
3917
+ ]
3918
+ },
3919
+ "trait": [],
3920
+ "entity": []
3921
+ },
3922
+ "expect": {
3923
+ "fired": true
3924
+ }
3925
+ },
3926
+ {
3927
+ "event": "LINT_INPUT",
3928
+ "from": "ready",
3929
+ "payload": {
3930
+ "file": "a.lolo",
3931
+ "raw": "",
3932
+ "latin": true,
3933
+ "program": {
3934
+ "name": "gpu",
3935
+ "orbitals": [
3936
+ {
3937
+ "name": "GpuOrbital",
3938
+ "traits": [
3939
+ {
3940
+ "name": "GpuUser",
3941
+ "stateMachine": {
3942
+ "states": [
3943
+ {
3944
+ "name": "idle",
3945
+ "isInitial": true
3946
+ },
3947
+ {
3948
+ "name": "opening"
3949
+ },
3950
+ {
3951
+ "name": "creating"
3952
+ },
3953
+ {
3954
+ "name": "writing"
3955
+ },
3956
+ {
3957
+ "name": "submitting"
3958
+ },
3959
+ {
3960
+ "name": "reading"
3961
+ },
3962
+ {
3963
+ "name": "releasing"
3964
+ }
3965
+ ],
3966
+ "transitions": [
3967
+ {
3968
+ "from": "idle",
3969
+ "to": "idle",
3970
+ "event": "INIT"
3971
+ },
3972
+ {
3973
+ "from": "idle",
3974
+ "to": "opening",
3975
+ "event": "GO",
3976
+ "effects": [
3977
+ [
3978
+ "gpu/device-open",
3979
+ "high-performance",
3980
+ {
3981
+ "emit": {
3982
+ "success": "DEV_OK",
3983
+ "failure": "FAILED"
3984
+ }
3985
+ }
3986
+ ]
3987
+ ]
3988
+ },
3989
+ {
3990
+ "from": "opening",
3991
+ "to": "idle",
3992
+ "event": "FAILED"
3993
+ },
3994
+ {
3995
+ "from": "opening",
3996
+ "to": "creating",
3997
+ "event": "DEV_OK",
3998
+ "effects": [
3999
+ [
4000
+ "set",
4001
+ "@entity.device",
4002
+ "@payload.device"
4003
+ ],
4004
+ [
4005
+ "gpu/buffer-create",
4006
+ "@entity.device",
4007
+ "storage",
4008
+ {
4009
+ "emit": {
4010
+ "success": "BUF_OK",
4011
+ "failure": "FAILED"
4012
+ }
4013
+ }
4014
+ ]
4015
+ ]
4016
+ },
4017
+ {
4018
+ "from": "creating",
4019
+ "to": "idle",
4020
+ "event": "FAILED",
4021
+ "effects": [
4022
+ [
4023
+ "gpu/device-close",
4024
+ "@entity.device",
4025
+ {
4026
+ "emit": {
4027
+ "success": "CLOSED",
4028
+ "failure": "FAILED"
4029
+ }
4030
+ }
4031
+ ]
4032
+ ]
4033
+ },
4034
+ {
4035
+ "from": "creating",
4036
+ "to": "writing",
4037
+ "event": "BUF_OK",
4038
+ "effects": [
4039
+ [
4040
+ "set",
4041
+ "@entity.buf",
4042
+ "@payload.buffer"
4043
+ ],
4044
+ [
4045
+ "gpu/submit",
4046
+ "@entity.device",
4047
+ [
4048
+ {
4049
+ "write": {
4050
+ "buffer": "@entity.buf",
4051
+ "data": "x"
4052
+ }
4053
+ }
4054
+ ],
4055
+ {
4056
+ "emit": {
4057
+ "success": "WROTE",
4058
+ "failure": "FAILED"
4059
+ }
4060
+ }
4061
+ ]
4062
+ ]
4063
+ },
4064
+ {
4065
+ "from": "writing",
4066
+ "to": "idle",
4067
+ "event": "FAILED",
4068
+ "effects": [
4069
+ [
4070
+ "gpu/device-close",
4071
+ "@entity.device",
4072
+ {
4073
+ "emit": {
4074
+ "success": "CLOSED",
4075
+ "failure": "FAILED"
4076
+ }
4077
+ }
4078
+ ]
4079
+ ]
4080
+ },
4081
+ {
4082
+ "from": "writing",
4083
+ "to": "submitting",
4084
+ "event": "WROTE",
4085
+ "effects": [
4086
+ [
4087
+ "gpu/submit",
4088
+ "@entity.device",
4089
+ "cmds",
4090
+ {
4091
+ "emit": {
4092
+ "success": "SUBMITTED",
4093
+ "failure": "FAILED"
4094
+ }
4095
+ }
4096
+ ]
4097
+ ]
4098
+ },
4099
+ {
4100
+ "from": "submitting",
4101
+ "to": "idle",
4102
+ "event": "FAILED",
4103
+ "effects": [
4104
+ [
4105
+ "gpu/device-close",
4106
+ "@entity.device",
4107
+ {
4108
+ "emit": {
4109
+ "success": "CLOSED",
4110
+ "failure": "FAILED"
4111
+ }
4112
+ }
4113
+ ]
4114
+ ]
4115
+ },
4116
+ {
4117
+ "from": "submitting",
4118
+ "to": "reading",
4119
+ "event": "SUBMITTED",
4120
+ "effects": [
4121
+ [
4122
+ "gpu/submit",
4123
+ "@entity.device",
4124
+ [
4125
+ {
4126
+ "read": {
4127
+ "buffer": "@entity.buf"
4128
+ }
4129
+ }
4130
+ ],
4131
+ {
4132
+ "emit": {
4133
+ "success": "READ_OK",
4134
+ "failure": "FAILED"
4135
+ }
4136
+ }
4137
+ ]
4138
+ ]
4139
+ },
4140
+ {
4141
+ "from": "reading",
4142
+ "to": "idle",
4143
+ "event": "FAILED",
4144
+ "effects": [
4145
+ [
4146
+ "gpu/device-close",
4147
+ "@entity.device",
4148
+ {
4149
+ "emit": {
4150
+ "success": "CLOSED",
4151
+ "failure": "FAILED"
4152
+ }
4153
+ }
4154
+ ]
4155
+ ]
4156
+ },
4157
+ {
4158
+ "from": "reading",
4159
+ "to": "releasing",
4160
+ "event": "READ_OK",
4161
+ "effects": [
4162
+ [
4163
+ "gpu/release",
4164
+ "@entity.buf",
4165
+ {
4166
+ "emit": {
4167
+ "success": "RELEASED",
4168
+ "failure": "FAILED"
4169
+ }
4170
+ }
4171
+ ]
4172
+ ]
4173
+ },
4174
+ {
4175
+ "from": "releasing",
4176
+ "to": "idle",
4177
+ "event": "FAILED",
4178
+ "effects": [
4179
+ [
4180
+ "gpu/device-close",
4181
+ "@entity.device",
4182
+ {
4183
+ "emit": {
4184
+ "success": "CLOSED",
4185
+ "failure": "FAILED"
4186
+ }
4187
+ }
4188
+ ]
4189
+ ]
4190
+ },
4191
+ {
4192
+ "from": "releasing",
4193
+ "to": "idle",
4194
+ "event": "RELEASED",
4195
+ "effects": [
4196
+ [
4197
+ "gpu/device-close",
4198
+ "@entity.device",
4199
+ {
4200
+ "emit": {
4201
+ "success": "CLOSED",
4202
+ "failure": "FAILED"
4203
+ }
4204
+ }
4205
+ ]
4206
+ ]
4207
+ }
4208
+ ]
4209
+ }
4210
+ }
4211
+ ]
4212
+ }
4213
+ ]
4214
+ },
4215
+ "scope": ""
4216
+ },
4217
+ "expect": {
4218
+ "fired": true,
4219
+ "state": "ready",
4220
+ "emits": [
4221
+ {
4222
+ "event": "LINT_FINISH",
4223
+ "payload": {}
4224
+ }
4225
+ ]
4226
+ }
4227
+ },
4228
+ {
4229
+ "event": "LINT_FINISH",
4230
+ "payload": {},
4231
+ "expect": {
4232
+ "emits": [
4233
+ {
4234
+ "event": "LINT_FOUND",
4235
+ "payload": {
4236
+ "rule": "mem-handles",
4237
+ "scope": "",
4238
+ "findings": []
4239
+ }
4240
+ }
4241
+ ]
4242
+ }
4243
+ }
4244
+ ]
4245
+ },
4246
+ {
4247
+ "id": "gpu-a-submit-after-the-device-closed-is-a-use-after-release",
4248
+ "steps": [
4249
+ {
4250
+ "event": "SITES_HEARD",
4251
+ "from": "ready",
4252
+ "payload": {
4253
+ "scope": "",
4254
+ "guardHeads": {},
4255
+ "guardRoots": {
4256
+ "0-0-0": [],
4257
+ "0-0-1": [],
4258
+ "0-0-2": [],
4259
+ "0-0-3": [],
4260
+ "0-0-4": [],
4261
+ "0-0-5": [],
4262
+ "0-0-6": [],
4263
+ "0-0-7": [],
4264
+ "0-0-8": [],
4265
+ "0-0-9": [],
4266
+ "0-0-10": [],
4267
+ "0-0-11": [],
4268
+ "0-0-12": [],
4269
+ "0-0-13": [],
4270
+ "0-0-14": [],
4271
+ "0-0-15": [],
4272
+ "0-0-16": [],
4273
+ "0-0-17": [],
4274
+ "0-0-18": [],
4275
+ "0-0-19": []
4276
+ },
4277
+ "calls": {
4278
+ "gpu/device-open": [
4279
+ {
4280
+ "path": "orbitals[0].traits[0].stateMachine.transitions[1].effects[0]",
4281
+ "node": [
4282
+ "gpu/device-open",
4283
+ "high-performance",
4284
+ {
4285
+ "emit": {
4286
+ "success": "DEV_OK",
4287
+ "failure": "FAILED"
4288
+ }
4289
+ }
4290
+ ],
4291
+ "at": 0
4292
+ }
4293
+ ],
4294
+ "gpu/buffer-create": [
4295
+ {
4296
+ "path": "orbitals[0].traits[0].stateMachine.transitions[3].effects[1]",
4297
+ "node": [
4298
+ "gpu/buffer-create",
4299
+ "@entity.device",
4300
+ "storage",
4301
+ {
4302
+ "emit": {
4303
+ "success": "BUF_OK",
4304
+ "failure": "FAILED"
4305
+ }
4306
+ }
4307
+ ],
4308
+ "at": 0
4309
+ }
4310
+ ],
4311
+ "gpu/device-close": [
4312
+ {
4313
+ "path": "orbitals[0].traits[0].stateMachine.transitions[4].effects[0]",
4314
+ "node": [
4315
+ "gpu/device-close",
4316
+ "@entity.device",
4317
+ {
4318
+ "emit": {
4319
+ "success": "CLOSED",
4320
+ "failure": "FAILED"
4321
+ }
4322
+ }
4323
+ ],
4324
+ "at": 0
4325
+ },
4326
+ {
4327
+ "path": "orbitals[0].traits[0].stateMachine.transitions[6].effects[0]",
4328
+ "node": [
4329
+ "gpu/device-close",
4330
+ "@entity.device",
4331
+ {
4332
+ "emit": {
4333
+ "success": "CLOSED",
4334
+ "failure": "FAILED"
4335
+ }
4336
+ }
4337
+ ],
4338
+ "at": 0
4339
+ },
4340
+ {
4341
+ "path": "orbitals[0].traits[0].stateMachine.transitions[8].effects[0]",
4342
+ "node": [
4343
+ "gpu/device-close",
4344
+ "@entity.device",
4345
+ {
4346
+ "emit": {
4347
+ "success": "CLOSED",
4348
+ "failure": "FAILED"
4349
+ }
4350
+ }
4351
+ ],
4352
+ "at": 0
4353
+ },
4354
+ {
4355
+ "path": "orbitals[0].traits[0].stateMachine.transitions[10].effects[0]",
4356
+ "node": [
4357
+ "gpu/device-close",
4358
+ "@entity.device",
4359
+ {
4360
+ "emit": {
4361
+ "success": "CLOSED",
4362
+ "failure": "FAILED"
4363
+ }
4364
+ }
4365
+ ],
4366
+ "at": 0
4367
+ },
4368
+ {
4369
+ "path": "orbitals[0].traits[0].stateMachine.transitions[12].effects[0]",
4370
+ "node": [
4371
+ "gpu/device-close",
4372
+ "@entity.device",
4373
+ {
4374
+ "emit": {
4375
+ "success": "CLOSED",
4376
+ "failure": "FAILED"
4377
+ }
4378
+ }
4379
+ ],
4380
+ "at": 0
4381
+ },
4382
+ {
4383
+ "path": "orbitals[0].traits[0].stateMachine.transitions[13].effects[0]",
4384
+ "node": [
4385
+ "gpu/device-close",
4386
+ "@entity.device",
4387
+ {
4388
+ "emit": {
4389
+ "success": "CLOSED",
4390
+ "failure": "FAILED"
4391
+ }
4392
+ }
4393
+ ],
4394
+ "at": 0
4395
+ }
4396
+ ],
4397
+ "gpu/submit": [
4398
+ {
4399
+ "path": "orbitals[0].traits[0].stateMachine.transitions[5].effects[1]",
4400
+ "node": [
4401
+ "gpu/submit",
4402
+ "@entity.device",
4403
+ [
4404
+ {
4405
+ "write": {
4406
+ "buffer": "@entity.buf",
4407
+ "data": "x"
4408
+ }
4409
+ }
4410
+ ],
4411
+ {
4412
+ "emit": {
4413
+ "success": "WROTE",
4414
+ "failure": "FAILED"
4415
+ }
4416
+ }
4417
+ ],
4418
+ "at": 0
4419
+ },
4420
+ {
4421
+ "path": "orbitals[0].traits[0].stateMachine.transitions[7].effects[0]",
4422
+ "node": [
4423
+ "gpu/submit",
4424
+ "@entity.device",
4425
+ "cmds",
4426
+ {
4427
+ "emit": {
4428
+ "success": "SUBMITTED",
4429
+ "failure": "FAILED"
4430
+ }
4431
+ }
4432
+ ],
4433
+ "at": 0
4434
+ },
4435
+ {
4436
+ "path": "orbitals[0].traits[0].stateMachine.transitions[9].effects[0]",
4437
+ "node": [
4438
+ "gpu/submit",
4439
+ "@entity.device",
4440
+ [
4441
+ {
4442
+ "read": {
4443
+ "buffer": "@entity.buf"
4444
+ }
4445
+ }
4446
+ ],
4447
+ {
4448
+ "emit": {
4449
+ "success": "READ_OK",
4450
+ "failure": "FAILED"
4451
+ }
4452
+ }
4453
+ ],
4454
+ "at": 0
4455
+ },
4456
+ {
4457
+ "path": "orbitals[0].traits[0].stateMachine.transitions[13].effects[1]",
4458
+ "node": [
4459
+ "gpu/submit",
4460
+ "@entity.device",
4461
+ [
4462
+ {
4463
+ "write": {
4464
+ "buffer": "@entity.buf",
4465
+ "data": "y"
4466
+ }
4467
+ }
4468
+ ],
4469
+ {
4470
+ "emit": {
4471
+ "success": "WROTE2",
4472
+ "failure": "FAILED"
4473
+ }
4474
+ }
4475
+ ],
4476
+ "at": 0
4477
+ }
4478
+ ],
4479
+ "gpu/release": [
4480
+ {
4481
+ "path": "orbitals[0].traits[0].stateMachine.transitions[11].effects[0]",
4482
+ "node": [
4483
+ "gpu/release",
4484
+ "@entity.buf",
4485
+ {
4486
+ "emit": {
4487
+ "success": "RELEASED",
4488
+ "failure": "FAILED"
4489
+ }
4490
+ }
4491
+ ],
4492
+ "at": 0
4493
+ }
4494
+ ]
4495
+ },
4496
+ "trait": [],
4497
+ "entity": []
4498
+ },
4499
+ "expect": {
4500
+ "fired": true
4501
+ }
4502
+ },
4503
+ {
4504
+ "event": "LINT_INPUT",
4505
+ "from": "ready",
4506
+ "payload": {
4507
+ "file": "a.lolo",
4508
+ "raw": "",
4509
+ "latin": true,
4510
+ "program": {
4511
+ "name": "gpu",
4512
+ "orbitals": [
4513
+ {
4514
+ "name": "GpuOrbital",
4515
+ "traits": [
4516
+ {
4517
+ "name": "GpuUser",
4518
+ "stateMachine": {
4519
+ "states": [
4520
+ {
4521
+ "name": "idle",
4522
+ "isInitial": true
4523
+ },
4524
+ {
4525
+ "name": "opening"
4526
+ },
4527
+ {
4528
+ "name": "creating"
4529
+ },
4530
+ {
4531
+ "name": "writing"
4532
+ },
4533
+ {
4534
+ "name": "submitting"
4535
+ },
4536
+ {
4537
+ "name": "reading"
4538
+ },
4539
+ {
4540
+ "name": "releasing"
4541
+ }
4542
+ ],
4543
+ "transitions": [
4544
+ {
4545
+ "from": "idle",
4546
+ "to": "idle",
4547
+ "event": "INIT"
4548
+ },
4549
+ {
4550
+ "from": "idle",
4551
+ "to": "opening",
4552
+ "event": "GO",
4553
+ "effects": [
4554
+ [
4555
+ "gpu/device-open",
4556
+ "high-performance",
4557
+ {
4558
+ "emit": {
4559
+ "success": "DEV_OK",
4560
+ "failure": "FAILED"
4561
+ }
4562
+ }
4563
+ ]
4564
+ ]
4565
+ },
4566
+ {
4567
+ "from": "opening",
4568
+ "to": "idle",
4569
+ "event": "FAILED"
4570
+ },
4571
+ {
4572
+ "from": "opening",
4573
+ "to": "creating",
4574
+ "event": "DEV_OK",
4575
+ "effects": [
4576
+ [
4577
+ "set",
4578
+ "@entity.device",
4579
+ "@payload.device"
4580
+ ],
4581
+ [
4582
+ "gpu/buffer-create",
4583
+ "@entity.device",
4584
+ "storage",
4585
+ {
4586
+ "emit": {
4587
+ "success": "BUF_OK",
4588
+ "failure": "FAILED"
4589
+ }
4590
+ }
4591
+ ]
4592
+ ]
4593
+ },
4594
+ {
4595
+ "from": "creating",
4596
+ "to": "idle",
4597
+ "event": "FAILED",
4598
+ "effects": [
4599
+ [
4600
+ "gpu/device-close",
4601
+ "@entity.device",
4602
+ {
4603
+ "emit": {
4604
+ "success": "CLOSED",
4605
+ "failure": "FAILED"
4606
+ }
4607
+ }
4608
+ ]
4609
+ ]
4610
+ },
4611
+ {
4612
+ "from": "creating",
4613
+ "to": "writing",
4614
+ "event": "BUF_OK",
4615
+ "effects": [
4616
+ [
4617
+ "set",
4618
+ "@entity.buf",
4619
+ "@payload.buffer"
4620
+ ],
4621
+ [
4622
+ "gpu/submit",
4623
+ "@entity.device",
4624
+ [
4625
+ {
4626
+ "write": {
4627
+ "buffer": "@entity.buf",
4628
+ "data": "x"
4629
+ }
4630
+ }
4631
+ ],
4632
+ {
4633
+ "emit": {
4634
+ "success": "WROTE",
4635
+ "failure": "FAILED"
4636
+ }
4637
+ }
4638
+ ]
4639
+ ]
4640
+ },
4641
+ {
4642
+ "from": "writing",
4643
+ "to": "idle",
4644
+ "event": "FAILED",
4645
+ "effects": [
4646
+ [
4647
+ "gpu/device-close",
4648
+ "@entity.device",
4649
+ {
4650
+ "emit": {
4651
+ "success": "CLOSED",
4652
+ "failure": "FAILED"
4653
+ }
4654
+ }
4655
+ ]
4656
+ ]
4657
+ },
4658
+ {
4659
+ "from": "writing",
4660
+ "to": "submitting",
4661
+ "event": "WROTE",
4662
+ "effects": [
4663
+ [
4664
+ "gpu/submit",
4665
+ "@entity.device",
4666
+ "cmds",
4667
+ {
4668
+ "emit": {
4669
+ "success": "SUBMITTED",
4670
+ "failure": "FAILED"
4671
+ }
4672
+ }
4673
+ ]
4674
+ ]
4675
+ },
4676
+ {
4677
+ "from": "submitting",
4678
+ "to": "idle",
4679
+ "event": "FAILED",
4680
+ "effects": [
4681
+ [
4682
+ "gpu/device-close",
4683
+ "@entity.device",
4684
+ {
4685
+ "emit": {
4686
+ "success": "CLOSED",
4687
+ "failure": "FAILED"
4688
+ }
4689
+ }
4690
+ ]
4691
+ ]
4692
+ },
4693
+ {
4694
+ "from": "submitting",
4695
+ "to": "reading",
4696
+ "event": "SUBMITTED",
4697
+ "effects": [
4698
+ [
4699
+ "gpu/submit",
4700
+ "@entity.device",
4701
+ [
4702
+ {
4703
+ "read": {
4704
+ "buffer": "@entity.buf"
4705
+ }
4706
+ }
4707
+ ],
4708
+ {
4709
+ "emit": {
4710
+ "success": "READ_OK",
4711
+ "failure": "FAILED"
4712
+ }
4713
+ }
4714
+ ]
4715
+ ]
4716
+ },
4717
+ {
4718
+ "from": "reading",
4719
+ "to": "idle",
4720
+ "event": "FAILED",
4721
+ "effects": [
4722
+ [
4723
+ "gpu/device-close",
4724
+ "@entity.device",
4725
+ {
4726
+ "emit": {
4727
+ "success": "CLOSED",
4728
+ "failure": "FAILED"
4729
+ }
4730
+ }
4731
+ ]
4732
+ ]
4733
+ },
4734
+ {
4735
+ "from": "reading",
4736
+ "to": "releasing",
4737
+ "event": "READ_OK",
4738
+ "effects": [
4739
+ [
4740
+ "gpu/release",
4741
+ "@entity.buf",
4742
+ {
4743
+ "emit": {
4744
+ "success": "RELEASED",
4745
+ "failure": "FAILED"
4746
+ }
4747
+ }
4748
+ ]
4749
+ ]
4750
+ },
4751
+ {
4752
+ "from": "releasing",
4753
+ "to": "idle",
4754
+ "event": "FAILED",
4755
+ "effects": [
4756
+ [
4757
+ "gpu/device-close",
4758
+ "@entity.device",
4759
+ {
4760
+ "emit": {
4761
+ "success": "CLOSED",
4762
+ "failure": "FAILED"
4763
+ }
4764
+ }
4765
+ ]
4766
+ ]
4767
+ },
4768
+ {
4769
+ "from": "releasing",
4770
+ "to": "idle",
4771
+ "event": "RELEASED",
4772
+ "effects": [
4773
+ [
4774
+ "gpu/device-close",
4775
+ "@entity.device",
4776
+ {
4777
+ "emit": {
4778
+ "success": "CLOSED",
4779
+ "failure": "FAILED"
4780
+ }
4781
+ }
4782
+ ],
4783
+ [
4784
+ "gpu/submit",
4785
+ "@entity.device",
4786
+ [
4787
+ {
4788
+ "write": {
4789
+ "buffer": "@entity.buf",
4790
+ "data": "y"
4791
+ }
4792
+ }
4793
+ ],
4794
+ {
4795
+ "emit": {
4796
+ "success": "WROTE2",
4797
+ "failure": "FAILED"
4798
+ }
4799
+ }
4800
+ ]
4801
+ ]
4802
+ }
4803
+ ]
4804
+ }
4805
+ }
4806
+ ]
4807
+ }
4808
+ ]
4809
+ },
4810
+ "scope": ""
4811
+ },
4812
+ "expect": {
4813
+ "fired": true,
4814
+ "state": "ready",
4815
+ "emits": [
4816
+ {
4817
+ "event": "LINT_FINISH",
4818
+ "payload": {}
4819
+ }
4820
+ ]
4821
+ }
4822
+ },
4823
+ {
4824
+ "event": "LINT_FINISH",
4825
+ "payload": {},
4826
+ "expect": {
4827
+ "emits": [
4828
+ {
4829
+ "event": "LINT_FOUND",
4830
+ "payload": {
4831
+ "rule": "mem-handles",
4832
+ "scope": "",
4833
+ "findings": [
4834
+ {
4835
+ "code": "ORB_GPU_USE_AFTER_RELEASE",
4836
+ "path": "orbitals[0 (GpuOrbital)].traits[0 (GpuUser)].stateMachine.transitions[13]",
4837
+ "message": "`(gpu/submit @entity.device ...)` uses a handle that `gpu/release` or `gpu/device-close` already ended on some path to this transition",
4838
+ "suggestion": "Stop using the handle after it is released or closed, or rebind the field from a fresh creation first",
4839
+ "severity": "error"
4840
+ },
4841
+ {
4842
+ "code": "ORB_GPU_USE_AFTER_RELEASE",
4843
+ "path": "orbitals[0 (GpuOrbital)].traits[0 (GpuUser)].stateMachine.transitions[13]",
4844
+ "message": "`(gpu/submit ...)` command `write.buffer` names `@entity.buf`, a handle that `gpu/release` or `gpu/device-close` already ended on some path to this transition",
4845
+ "suggestion": "Stop using the handle after it is released or closed, or rebind the field from a fresh creation first",
4846
+ "severity": "error"
4847
+ }
4848
+ ]
4849
+ }
4850
+ }
4851
+ ]
4852
+ }
4853
+ }
4854
+ ]
4855
+ },
4856
+ {
4857
+ "id": "gpu-a-second-release-of-the-same-buffer-is-a-use-after-release",
4858
+ "steps": [
4859
+ {
4860
+ "event": "SITES_HEARD",
4861
+ "from": "ready",
4862
+ "payload": {
4863
+ "scope": "",
4864
+ "guardHeads": {},
4865
+ "guardRoots": {
4866
+ "0-0-0": [],
4867
+ "0-0-1": [],
4868
+ "0-0-2": [],
4869
+ "0-0-3": [],
4870
+ "0-0-4": [],
4871
+ "0-0-5": [],
4872
+ "0-0-6": [],
4873
+ "0-0-7": [],
4874
+ "0-0-8": [],
4875
+ "0-0-9": [],
4876
+ "0-0-10": [],
4877
+ "0-0-11": [],
4878
+ "0-0-12": [],
4879
+ "0-0-13": [],
4880
+ "0-0-14": [],
4881
+ "0-0-15": [],
4882
+ "0-0-16": [],
4883
+ "0-0-17": [],
4884
+ "0-0-18": [],
4885
+ "0-0-19": []
4886
+ },
4887
+ "calls": {
4888
+ "gpu/device-open": [
4889
+ {
4890
+ "path": "orbitals[0].traits[0].stateMachine.transitions[1].effects[0]",
4891
+ "node": [
4892
+ "gpu/device-open",
4893
+ "high-performance",
4894
+ {
4895
+ "emit": {
4896
+ "success": "DEV_OK",
4897
+ "failure": "FAILED"
4898
+ }
4899
+ }
4900
+ ],
4901
+ "at": 0
4902
+ }
4903
+ ],
4904
+ "gpu/buffer-create": [
4905
+ {
4906
+ "path": "orbitals[0].traits[0].stateMachine.transitions[3].effects[1]",
4907
+ "node": [
4908
+ "gpu/buffer-create",
4909
+ "@entity.device",
4910
+ "storage",
4911
+ {
4912
+ "emit": {
4913
+ "success": "BUF_OK",
4914
+ "failure": "FAILED"
4915
+ }
4916
+ }
4917
+ ],
4918
+ "at": 0
4919
+ }
4920
+ ],
4921
+ "gpu/device-close": [
4922
+ {
4923
+ "path": "orbitals[0].traits[0].stateMachine.transitions[4].effects[0]",
4924
+ "node": [
4925
+ "gpu/device-close",
4926
+ "@entity.device",
4927
+ {
4928
+ "emit": {
4929
+ "success": "CLOSED",
4930
+ "failure": "FAILED"
4931
+ }
4932
+ }
4933
+ ],
4934
+ "at": 0
4935
+ },
4936
+ {
4937
+ "path": "orbitals[0].traits[0].stateMachine.transitions[6].effects[0]",
4938
+ "node": [
4939
+ "gpu/device-close",
4940
+ "@entity.device",
4941
+ {
4942
+ "emit": {
4943
+ "success": "CLOSED",
4944
+ "failure": "FAILED"
4945
+ }
4946
+ }
4947
+ ],
4948
+ "at": 0
4949
+ },
4950
+ {
4951
+ "path": "orbitals[0].traits[0].stateMachine.transitions[8].effects[0]",
4952
+ "node": [
4953
+ "gpu/device-close",
4954
+ "@entity.device",
4955
+ {
4956
+ "emit": {
4957
+ "success": "CLOSED",
4958
+ "failure": "FAILED"
4959
+ }
4960
+ }
4961
+ ],
4962
+ "at": 0
4963
+ },
4964
+ {
4965
+ "path": "orbitals[0].traits[0].stateMachine.transitions[10].effects[0]",
4966
+ "node": [
4967
+ "gpu/device-close",
4968
+ "@entity.device",
4969
+ {
4970
+ "emit": {
4971
+ "success": "CLOSED",
4972
+ "failure": "FAILED"
4973
+ }
4974
+ }
4975
+ ],
4976
+ "at": 0
4977
+ },
4978
+ {
4979
+ "path": "orbitals[0].traits[0].stateMachine.transitions[12].effects[0]",
4980
+ "node": [
4981
+ "gpu/device-close",
4982
+ "@entity.device",
4983
+ {
4984
+ "emit": {
4985
+ "success": "CLOSED",
4986
+ "failure": "FAILED"
4987
+ }
4988
+ }
4989
+ ],
4990
+ "at": 0
4991
+ },
4992
+ {
4993
+ "path": "orbitals[0].traits[0].stateMachine.transitions[13].effects[1]",
4994
+ "node": [
4995
+ "gpu/device-close",
4996
+ "@entity.device",
4997
+ {
4998
+ "emit": {
4999
+ "success": "CLOSED",
5000
+ "failure": "FAILED"
5001
+ }
5002
+ }
5003
+ ],
5004
+ "at": 0
5005
+ }
5006
+ ],
5007
+ "gpu/submit": [
5008
+ {
5009
+ "path": "orbitals[0].traits[0].stateMachine.transitions[5].effects[1]",
5010
+ "node": [
5011
+ "gpu/submit",
5012
+ "@entity.device",
5013
+ [
5014
+ {
5015
+ "write": {
5016
+ "buffer": "@entity.buf",
5017
+ "data": "x"
5018
+ }
5019
+ }
5020
+ ],
5021
+ {
5022
+ "emit": {
5023
+ "success": "WROTE",
5024
+ "failure": "FAILED"
5025
+ }
5026
+ }
5027
+ ],
5028
+ "at": 0
5029
+ },
5030
+ {
5031
+ "path": "orbitals[0].traits[0].stateMachine.transitions[7].effects[0]",
5032
+ "node": [
5033
+ "gpu/submit",
5034
+ "@entity.device",
5035
+ "cmds",
5036
+ {
5037
+ "emit": {
5038
+ "success": "SUBMITTED",
5039
+ "failure": "FAILED"
5040
+ }
5041
+ }
5042
+ ],
5043
+ "at": 0
5044
+ },
5045
+ {
5046
+ "path": "orbitals[0].traits[0].stateMachine.transitions[9].effects[0]",
5047
+ "node": [
5048
+ "gpu/submit",
5049
+ "@entity.device",
5050
+ [
5051
+ {
5052
+ "read": {
5053
+ "buffer": "@entity.buf"
5054
+ }
5055
+ }
5056
+ ],
5057
+ {
5058
+ "emit": {
5059
+ "success": "READ_OK",
5060
+ "failure": "FAILED"
5061
+ }
5062
+ }
5063
+ ],
5064
+ "at": 0
5065
+ }
5066
+ ],
5067
+ "gpu/release": [
5068
+ {
5069
+ "path": "orbitals[0].traits[0].stateMachine.transitions[11].effects[0]",
5070
+ "node": [
5071
+ "gpu/release",
5072
+ "@entity.buf",
5073
+ {
5074
+ "emit": {
5075
+ "success": "RELEASED",
5076
+ "failure": "FAILED"
5077
+ }
5078
+ }
5079
+ ],
5080
+ "at": 0
5081
+ },
5082
+ {
5083
+ "path": "orbitals[0].traits[0].stateMachine.transitions[13].effects[0]",
5084
+ "node": [
5085
+ "gpu/release",
5086
+ "@entity.buf",
5087
+ {
5088
+ "emit": {
5089
+ "success": "RELEASED2",
5090
+ "failure": "FAILED"
5091
+ }
5092
+ }
5093
+ ],
5094
+ "at": 0
5095
+ }
5096
+ ]
5097
+ },
5098
+ "trait": [],
5099
+ "entity": []
5100
+ },
5101
+ "expect": {
5102
+ "fired": true
5103
+ }
5104
+ },
5105
+ {
5106
+ "event": "LINT_INPUT",
5107
+ "from": "ready",
5108
+ "payload": {
5109
+ "file": "a.lolo",
5110
+ "raw": "",
5111
+ "latin": true,
5112
+ "program": {
5113
+ "name": "gpu",
5114
+ "orbitals": [
5115
+ {
5116
+ "name": "GpuOrbital",
5117
+ "traits": [
5118
+ {
5119
+ "name": "GpuUser",
5120
+ "stateMachine": {
5121
+ "states": [
5122
+ {
5123
+ "name": "idle",
5124
+ "isInitial": true
5125
+ },
5126
+ {
5127
+ "name": "opening"
5128
+ },
5129
+ {
5130
+ "name": "creating"
5131
+ },
5132
+ {
5133
+ "name": "writing"
5134
+ },
5135
+ {
5136
+ "name": "submitting"
5137
+ },
5138
+ {
5139
+ "name": "reading"
5140
+ },
5141
+ {
5142
+ "name": "releasing"
5143
+ }
5144
+ ],
5145
+ "transitions": [
5146
+ {
5147
+ "from": "idle",
5148
+ "to": "idle",
5149
+ "event": "INIT"
5150
+ },
5151
+ {
5152
+ "from": "idle",
5153
+ "to": "opening",
5154
+ "event": "GO",
5155
+ "effects": [
5156
+ [
5157
+ "gpu/device-open",
5158
+ "high-performance",
5159
+ {
5160
+ "emit": {
5161
+ "success": "DEV_OK",
5162
+ "failure": "FAILED"
5163
+ }
5164
+ }
5165
+ ]
5166
+ ]
5167
+ },
5168
+ {
5169
+ "from": "opening",
5170
+ "to": "idle",
5171
+ "event": "FAILED"
5172
+ },
5173
+ {
5174
+ "from": "opening",
5175
+ "to": "creating",
5176
+ "event": "DEV_OK",
5177
+ "effects": [
5178
+ [
5179
+ "set",
5180
+ "@entity.device",
5181
+ "@payload.device"
5182
+ ],
5183
+ [
5184
+ "gpu/buffer-create",
5185
+ "@entity.device",
5186
+ "storage",
5187
+ {
5188
+ "emit": {
5189
+ "success": "BUF_OK",
5190
+ "failure": "FAILED"
5191
+ }
5192
+ }
5193
+ ]
5194
+ ]
5195
+ },
5196
+ {
5197
+ "from": "creating",
5198
+ "to": "idle",
5199
+ "event": "FAILED",
5200
+ "effects": [
5201
+ [
5202
+ "gpu/device-close",
5203
+ "@entity.device",
5204
+ {
5205
+ "emit": {
5206
+ "success": "CLOSED",
5207
+ "failure": "FAILED"
5208
+ }
5209
+ }
5210
+ ]
5211
+ ]
5212
+ },
5213
+ {
5214
+ "from": "creating",
5215
+ "to": "writing",
5216
+ "event": "BUF_OK",
5217
+ "effects": [
5218
+ [
5219
+ "set",
5220
+ "@entity.buf",
5221
+ "@payload.buffer"
5222
+ ],
5223
+ [
5224
+ "gpu/submit",
5225
+ "@entity.device",
5226
+ [
5227
+ {
5228
+ "write": {
5229
+ "buffer": "@entity.buf",
5230
+ "data": "x"
5231
+ }
5232
+ }
5233
+ ],
5234
+ {
5235
+ "emit": {
5236
+ "success": "WROTE",
5237
+ "failure": "FAILED"
5238
+ }
5239
+ }
5240
+ ]
5241
+ ]
5242
+ },
5243
+ {
5244
+ "from": "writing",
5245
+ "to": "idle",
5246
+ "event": "FAILED",
5247
+ "effects": [
5248
+ [
5249
+ "gpu/device-close",
5250
+ "@entity.device",
5251
+ {
5252
+ "emit": {
5253
+ "success": "CLOSED",
5254
+ "failure": "FAILED"
5255
+ }
5256
+ }
5257
+ ]
5258
+ ]
5259
+ },
5260
+ {
5261
+ "from": "writing",
5262
+ "to": "submitting",
5263
+ "event": "WROTE",
5264
+ "effects": [
5265
+ [
5266
+ "gpu/submit",
5267
+ "@entity.device",
5268
+ "cmds",
5269
+ {
5270
+ "emit": {
5271
+ "success": "SUBMITTED",
5272
+ "failure": "FAILED"
5273
+ }
5274
+ }
5275
+ ]
5276
+ ]
5277
+ },
5278
+ {
5279
+ "from": "submitting",
5280
+ "to": "idle",
5281
+ "event": "FAILED",
5282
+ "effects": [
5283
+ [
5284
+ "gpu/device-close",
5285
+ "@entity.device",
5286
+ {
5287
+ "emit": {
5288
+ "success": "CLOSED",
5289
+ "failure": "FAILED"
5290
+ }
5291
+ }
5292
+ ]
5293
+ ]
5294
+ },
5295
+ {
5296
+ "from": "submitting",
5297
+ "to": "reading",
5298
+ "event": "SUBMITTED",
5299
+ "effects": [
5300
+ [
5301
+ "gpu/submit",
5302
+ "@entity.device",
5303
+ [
5304
+ {
5305
+ "read": {
5306
+ "buffer": "@entity.buf"
5307
+ }
5308
+ }
5309
+ ],
5310
+ {
5311
+ "emit": {
5312
+ "success": "READ_OK",
5313
+ "failure": "FAILED"
5314
+ }
5315
+ }
5316
+ ]
5317
+ ]
5318
+ },
5319
+ {
5320
+ "from": "reading",
5321
+ "to": "idle",
5322
+ "event": "FAILED",
5323
+ "effects": [
5324
+ [
5325
+ "gpu/device-close",
5326
+ "@entity.device",
5327
+ {
5328
+ "emit": {
5329
+ "success": "CLOSED",
5330
+ "failure": "FAILED"
5331
+ }
5332
+ }
5333
+ ]
5334
+ ]
5335
+ },
5336
+ {
5337
+ "from": "reading",
5338
+ "to": "releasing",
5339
+ "event": "READ_OK",
5340
+ "effects": [
5341
+ [
5342
+ "gpu/release",
5343
+ "@entity.buf",
5344
+ {
5345
+ "emit": {
5346
+ "success": "RELEASED",
5347
+ "failure": "FAILED"
5348
+ }
5349
+ }
5350
+ ]
5351
+ ]
5352
+ },
5353
+ {
5354
+ "from": "releasing",
5355
+ "to": "idle",
5356
+ "event": "FAILED",
5357
+ "effects": [
5358
+ [
5359
+ "gpu/device-close",
5360
+ "@entity.device",
5361
+ {
5362
+ "emit": {
5363
+ "success": "CLOSED",
5364
+ "failure": "FAILED"
5365
+ }
5366
+ }
5367
+ ]
5368
+ ]
5369
+ },
5370
+ {
5371
+ "from": "releasing",
5372
+ "to": "idle",
5373
+ "event": "RELEASED",
5374
+ "effects": [
5375
+ [
5376
+ "gpu/release",
5377
+ "@entity.buf",
5378
+ {
5379
+ "emit": {
5380
+ "success": "RELEASED2",
5381
+ "failure": "FAILED"
5382
+ }
5383
+ }
5384
+ ],
5385
+ [
5386
+ "gpu/device-close",
5387
+ "@entity.device",
5388
+ {
5389
+ "emit": {
5390
+ "success": "CLOSED",
5391
+ "failure": "FAILED"
5392
+ }
5393
+ }
5394
+ ]
5395
+ ]
5396
+ }
5397
+ ]
5398
+ }
5399
+ }
5400
+ ]
5401
+ }
5402
+ ]
5403
+ },
5404
+ "scope": ""
5405
+ },
5406
+ "expect": {
5407
+ "fired": true,
5408
+ "state": "ready",
5409
+ "emits": [
5410
+ {
5411
+ "event": "LINT_FINISH",
5412
+ "payload": {}
5413
+ }
5414
+ ]
5415
+ }
5416
+ },
5417
+ {
5418
+ "event": "LINT_FINISH",
5419
+ "payload": {},
5420
+ "expect": {
5421
+ "emits": [
5422
+ {
5423
+ "event": "LINT_FOUND",
5424
+ "payload": {
5425
+ "rule": "mem-handles",
5426
+ "scope": "",
5427
+ "findings": [
5428
+ {
5429
+ "code": "ORB_GPU_USE_AFTER_RELEASE",
5430
+ "path": "orbitals[0 (GpuOrbital)].traits[0 (GpuUser)].stateMachine.transitions[13]",
5431
+ "message": "`(gpu/release @entity.buf)` ends a handle that `gpu/release` or `gpu/device-close` already ended on some path to this transition",
5432
+ "suggestion": "End each handle once on every path, or set the field to a new handle between the two",
5433
+ "severity": "error"
5434
+ }
5435
+ ]
5436
+ }
5437
+ }
5438
+ ]
5439
+ }
5440
+ }
5441
+ ]
5442
+ },
5443
+ {
5444
+ "id": "gpu-a-failure-route-to-a-resting-state-without-device-close-is-a-leak",
5445
+ "steps": [
5446
+ {
5447
+ "event": "SITES_HEARD",
5448
+ "from": "ready",
5449
+ "payload": {
5450
+ "scope": "",
5451
+ "guardHeads": {},
5452
+ "guardRoots": {
5453
+ "0-0-0": [],
5454
+ "0-0-1": [],
5455
+ "0-0-2": [],
5456
+ "0-0-3": [],
5457
+ "0-0-4": [],
5458
+ "0-0-5": [],
5459
+ "0-0-6": [],
5460
+ "0-0-7": [],
5461
+ "0-0-8": [],
5462
+ "0-0-9": [],
5463
+ "0-0-10": [],
5464
+ "0-0-11": [],
5465
+ "0-0-12": [],
5466
+ "0-0-13": [],
5467
+ "0-0-14": [],
5468
+ "0-0-15": [],
5469
+ "0-0-16": [],
5470
+ "0-0-17": [],
5471
+ "0-0-18": [],
5472
+ "0-0-19": []
5473
+ },
5474
+ "calls": {
5475
+ "gpu/device-open": [
5476
+ {
5477
+ "path": "orbitals[0].traits[0].stateMachine.transitions[1].effects[0]",
5478
+ "node": [
5479
+ "gpu/device-open",
5480
+ "high-performance",
5481
+ {
5482
+ "emit": {
5483
+ "success": "DEV_OK",
5484
+ "failure": "FAILED"
5485
+ }
5486
+ }
5487
+ ],
5488
+ "at": 0
5489
+ }
5490
+ ],
5491
+ "gpu/buffer-create": [
5492
+ {
5493
+ "path": "orbitals[0].traits[0].stateMachine.transitions[3].effects[1]",
5494
+ "node": [
5495
+ "gpu/buffer-create",
5496
+ "@entity.device",
5497
+ "storage",
5498
+ {
5499
+ "emit": {
5500
+ "success": "BUF_OK",
5501
+ "failure": "FAILED"
5502
+ }
5503
+ }
5504
+ ],
5505
+ "at": 0
5506
+ }
5507
+ ],
5508
+ "gpu/device-close": [
5509
+ {
5510
+ "path": "orbitals[0].traits[0].stateMachine.transitions[4].effects[0]",
5511
+ "node": [
5512
+ "gpu/device-close",
5513
+ "@entity.device",
5514
+ {
5515
+ "emit": {
5516
+ "success": "CLOSED",
5517
+ "failure": "FAILED"
5518
+ }
5519
+ }
5520
+ ],
5521
+ "at": 0
5522
+ },
5523
+ {
5524
+ "path": "orbitals[0].traits[0].stateMachine.transitions[8].effects[0]",
5525
+ "node": [
5526
+ "gpu/device-close",
5527
+ "@entity.device",
5528
+ {
5529
+ "emit": {
5530
+ "success": "CLOSED",
5531
+ "failure": "FAILED"
5532
+ }
5533
+ }
5534
+ ],
5535
+ "at": 0
5536
+ },
5537
+ {
5538
+ "path": "orbitals[0].traits[0].stateMachine.transitions[10].effects[0]",
5539
+ "node": [
5540
+ "gpu/device-close",
5541
+ "@entity.device",
5542
+ {
5543
+ "emit": {
5544
+ "success": "CLOSED",
5545
+ "failure": "FAILED"
5546
+ }
5547
+ }
5548
+ ],
5549
+ "at": 0
5550
+ },
5551
+ {
5552
+ "path": "orbitals[0].traits[0].stateMachine.transitions[12].effects[0]",
5553
+ "node": [
5554
+ "gpu/device-close",
5555
+ "@entity.device",
5556
+ {
5557
+ "emit": {
5558
+ "success": "CLOSED",
5559
+ "failure": "FAILED"
5560
+ }
5561
+ }
5562
+ ],
5563
+ "at": 0
5564
+ },
5565
+ {
5566
+ "path": "orbitals[0].traits[0].stateMachine.transitions[13].effects[0]",
5567
+ "node": [
5568
+ "gpu/device-close",
5569
+ "@entity.device",
5570
+ {
5571
+ "emit": {
5572
+ "success": "CLOSED",
5573
+ "failure": "FAILED"
5574
+ }
5575
+ }
5576
+ ],
5577
+ "at": 0
5578
+ }
5579
+ ],
5580
+ "gpu/submit": [
5581
+ {
5582
+ "path": "orbitals[0].traits[0].stateMachine.transitions[5].effects[1]",
5583
+ "node": [
5584
+ "gpu/submit",
5585
+ "@entity.device",
5586
+ [
5587
+ {
5588
+ "write": {
5589
+ "buffer": "@entity.buf",
5590
+ "data": "x"
5591
+ }
5592
+ }
5593
+ ],
5594
+ {
5595
+ "emit": {
5596
+ "success": "WROTE",
5597
+ "failure": "FAILED"
5598
+ }
5599
+ }
5600
+ ],
5601
+ "at": 0
5602
+ },
5603
+ {
5604
+ "path": "orbitals[0].traits[0].stateMachine.transitions[7].effects[0]",
5605
+ "node": [
5606
+ "gpu/submit",
5607
+ "@entity.device",
5608
+ "cmds",
5609
+ {
5610
+ "emit": {
5611
+ "success": "SUBMITTED",
5612
+ "failure": "FAILED"
5613
+ }
5614
+ }
5615
+ ],
5616
+ "at": 0
5617
+ },
5618
+ {
5619
+ "path": "orbitals[0].traits[0].stateMachine.transitions[9].effects[0]",
5620
+ "node": [
5621
+ "gpu/submit",
5622
+ "@entity.device",
5623
+ [
5624
+ {
5625
+ "read": {
5626
+ "buffer": "@entity.buf"
5627
+ }
5628
+ }
5629
+ ],
5630
+ {
5631
+ "emit": {
5632
+ "success": "READ_OK",
5633
+ "failure": "FAILED"
5634
+ }
5635
+ }
5636
+ ],
5637
+ "at": 0
5638
+ }
5639
+ ],
5640
+ "gpu/release": [
5641
+ {
5642
+ "path": "orbitals[0].traits[0].stateMachine.transitions[11].effects[0]",
5643
+ "node": [
5644
+ "gpu/release",
5645
+ "@entity.buf",
5646
+ {
5647
+ "emit": {
5648
+ "success": "RELEASED",
5649
+ "failure": "FAILED"
5650
+ }
5651
+ }
5652
+ ],
5653
+ "at": 0
5654
+ }
5655
+ ]
5656
+ },
5657
+ "trait": [],
5658
+ "entity": []
5659
+ },
5660
+ "expect": {
5661
+ "fired": true
5662
+ }
5663
+ },
5664
+ {
5665
+ "event": "LINT_INPUT",
5666
+ "from": "ready",
5667
+ "payload": {
5668
+ "file": "a.lolo",
5669
+ "raw": "",
5670
+ "latin": true,
5671
+ "program": {
5672
+ "name": "gpu",
5673
+ "orbitals": [
5674
+ {
5675
+ "name": "GpuOrbital",
5676
+ "traits": [
5677
+ {
5678
+ "name": "GpuUser",
5679
+ "stateMachine": {
5680
+ "states": [
5681
+ {
5682
+ "name": "idle",
5683
+ "isInitial": true
5684
+ },
5685
+ {
5686
+ "name": "opening"
5687
+ },
5688
+ {
5689
+ "name": "creating"
5690
+ },
5691
+ {
5692
+ "name": "writing"
5693
+ },
5694
+ {
5695
+ "name": "submitting"
5696
+ },
5697
+ {
5698
+ "name": "reading"
5699
+ },
5700
+ {
5701
+ "name": "releasing"
5702
+ }
5703
+ ],
5704
+ "transitions": [
5705
+ {
5706
+ "from": "idle",
5707
+ "to": "idle",
5708
+ "event": "INIT"
5709
+ },
5710
+ {
5711
+ "from": "idle",
5712
+ "to": "opening",
5713
+ "event": "GO",
5714
+ "effects": [
5715
+ [
5716
+ "gpu/device-open",
5717
+ "high-performance",
5718
+ {
5719
+ "emit": {
5720
+ "success": "DEV_OK",
5721
+ "failure": "FAILED"
5722
+ }
5723
+ }
5724
+ ]
5725
+ ]
5726
+ },
5727
+ {
5728
+ "from": "opening",
5729
+ "to": "idle",
5730
+ "event": "FAILED"
5731
+ },
5732
+ {
5733
+ "from": "opening",
5734
+ "to": "creating",
5735
+ "event": "DEV_OK",
5736
+ "effects": [
5737
+ [
5738
+ "set",
5739
+ "@entity.device",
5740
+ "@payload.device"
5741
+ ],
5742
+ [
5743
+ "gpu/buffer-create",
5744
+ "@entity.device",
5745
+ "storage",
5746
+ {
5747
+ "emit": {
5748
+ "success": "BUF_OK",
5749
+ "failure": "FAILED"
5750
+ }
5751
+ }
5752
+ ]
5753
+ ]
5754
+ },
5755
+ {
5756
+ "from": "creating",
5757
+ "to": "idle",
5758
+ "event": "FAILED",
5759
+ "effects": [
5760
+ [
5761
+ "gpu/device-close",
5762
+ "@entity.device",
5763
+ {
5764
+ "emit": {
5765
+ "success": "CLOSED",
5766
+ "failure": "FAILED"
5767
+ }
5768
+ }
5769
+ ]
5770
+ ]
5771
+ },
5772
+ {
5773
+ "from": "creating",
5774
+ "to": "writing",
5775
+ "event": "BUF_OK",
5776
+ "effects": [
5777
+ [
5778
+ "set",
5779
+ "@entity.buf",
5780
+ "@payload.buffer"
5781
+ ],
5782
+ [
5783
+ "gpu/submit",
5784
+ "@entity.device",
5785
+ [
5786
+ {
5787
+ "write": {
5788
+ "buffer": "@entity.buf",
5789
+ "data": "x"
5790
+ }
5791
+ }
5792
+ ],
5793
+ {
5794
+ "emit": {
5795
+ "success": "WROTE",
5796
+ "failure": "FAILED"
5797
+ }
5798
+ }
5799
+ ]
5800
+ ]
5801
+ },
5802
+ {
5803
+ "from": "writing",
5804
+ "to": "idle",
5805
+ "event": "FAILED",
5806
+ "effects": [
5807
+ [
5808
+ "set",
5809
+ "@entity.n",
5810
+ 0
5811
+ ]
5812
+ ]
5813
+ },
5814
+ {
5815
+ "from": "writing",
5816
+ "to": "submitting",
5817
+ "event": "WROTE",
5818
+ "effects": [
5819
+ [
5820
+ "gpu/submit",
5821
+ "@entity.device",
5822
+ "cmds",
5823
+ {
5824
+ "emit": {
5825
+ "success": "SUBMITTED",
5826
+ "failure": "FAILED"
5827
+ }
5828
+ }
5829
+ ]
5830
+ ]
5831
+ },
5832
+ {
5833
+ "from": "submitting",
5834
+ "to": "idle",
5835
+ "event": "FAILED",
5836
+ "effects": [
5837
+ [
5838
+ "gpu/device-close",
5839
+ "@entity.device",
5840
+ {
5841
+ "emit": {
5842
+ "success": "CLOSED",
5843
+ "failure": "FAILED"
5844
+ }
5845
+ }
5846
+ ]
5847
+ ]
5848
+ },
5849
+ {
5850
+ "from": "submitting",
5851
+ "to": "reading",
5852
+ "event": "SUBMITTED",
5853
+ "effects": [
5854
+ [
5855
+ "gpu/submit",
5856
+ "@entity.device",
5857
+ [
5858
+ {
5859
+ "read": {
5860
+ "buffer": "@entity.buf"
5861
+ }
5862
+ }
5863
+ ],
5864
+ {
5865
+ "emit": {
5866
+ "success": "READ_OK",
5867
+ "failure": "FAILED"
5868
+ }
5869
+ }
5870
+ ]
5871
+ ]
5872
+ },
5873
+ {
5874
+ "from": "reading",
5875
+ "to": "idle",
5876
+ "event": "FAILED",
5877
+ "effects": [
5878
+ [
5879
+ "gpu/device-close",
5880
+ "@entity.device",
5881
+ {
5882
+ "emit": {
5883
+ "success": "CLOSED",
5884
+ "failure": "FAILED"
5885
+ }
5886
+ }
5887
+ ]
5888
+ ]
5889
+ },
5890
+ {
5891
+ "from": "reading",
5892
+ "to": "releasing",
5893
+ "event": "READ_OK",
5894
+ "effects": [
5895
+ [
5896
+ "gpu/release",
5897
+ "@entity.buf",
5898
+ {
5899
+ "emit": {
5900
+ "success": "RELEASED",
5901
+ "failure": "FAILED"
5902
+ }
5903
+ }
5904
+ ]
5905
+ ]
5906
+ },
5907
+ {
5908
+ "from": "releasing",
5909
+ "to": "idle",
5910
+ "event": "FAILED",
5911
+ "effects": [
5912
+ [
5913
+ "gpu/device-close",
5914
+ "@entity.device",
5915
+ {
5916
+ "emit": {
5917
+ "success": "CLOSED",
5918
+ "failure": "FAILED"
5919
+ }
5920
+ }
5921
+ ]
5922
+ ]
5923
+ },
5924
+ {
5925
+ "from": "releasing",
5926
+ "to": "idle",
5927
+ "event": "RELEASED",
5928
+ "effects": [
5929
+ [
5930
+ "gpu/device-close",
5931
+ "@entity.device",
5932
+ {
5933
+ "emit": {
5934
+ "success": "CLOSED",
5935
+ "failure": "FAILED"
5936
+ }
5937
+ }
5938
+ ]
5939
+ ]
5940
+ }
5941
+ ]
5942
+ }
5943
+ }
5944
+ ]
5945
+ }
5946
+ ]
5947
+ },
5948
+ "scope": ""
5949
+ },
5950
+ "expect": {
5951
+ "fired": true,
5952
+ "state": "ready",
5953
+ "emits": [
5954
+ {
5955
+ "event": "LINT_FINISH",
5956
+ "payload": {}
5957
+ }
5958
+ ]
5959
+ }
5960
+ },
5961
+ {
5962
+ "event": "LINT_FINISH",
5963
+ "payload": {},
5964
+ "expect": {
5965
+ "emits": [
5966
+ {
5967
+ "event": "LINT_FOUND",
5968
+ "payload": {
5969
+ "rule": "mem-handles",
5970
+ "scope": "",
5971
+ "findings": [
5972
+ {
5973
+ "code": "ORB_GPU_LEAK",
5974
+ "path": "orbitals[0 (GpuOrbital)].traits[0 (GpuUser)].stateMachine.transitions[3]",
5975
+ "message": "The device stored in '@entity.device' can reach the resting state(s) 'idle' without `gpu/device-close`",
5976
+ "suggestion": "Close the device on every path to a resting state, including the failure routes",
5977
+ "severity": "error"
5978
+ }
5979
+ ]
5980
+ }
5981
+ }
5982
+ ]
5983
+ }
5984
+ }
5985
+ ]
5986
+ },
5987
+ {
5988
+ "id": "gpu-a-submit-read-of-a-released-buffer-is-a-use-after-release",
5989
+ "steps": [
5990
+ {
5991
+ "event": "SITES_HEARD",
5992
+ "from": "ready",
5993
+ "payload": {
5994
+ "scope": "",
5995
+ "guardHeads": {},
5996
+ "guardRoots": {},
5997
+ "calls": {
5998
+ "gpu/buffer-create": [
5999
+ {
6000
+ "path": "orbitals[0].traits[0].stateMachine.transitions[1].effects[0]",
6001
+ "node": [
6002
+ "gpu/buffer-create",
6003
+ "@entity.device",
6004
+ "storage",
6005
+ {
6006
+ "emit": {
6007
+ "success": "BUF_OK",
6008
+ "failure": "FAILED"
6009
+ }
6010
+ }
6011
+ ],
6012
+ "at": 0
6013
+ }
6014
+ ],
6015
+ "gpu/release": [
6016
+ {
6017
+ "path": "orbitals[0].traits[0].stateMachine.transitions[3].effects[1]",
6018
+ "node": [
6019
+ "gpu/release",
6020
+ "@entity.buf",
6021
+ {
6022
+ "emit": {
6023
+ "success": "RELEASED",
6024
+ "failure": "FAILED"
6025
+ }
6026
+ }
6027
+ ],
6028
+ "at": 0
6029
+ }
6030
+ ],
6031
+ "gpu/submit": [
6032
+ {
6033
+ "path": "orbitals[0].traits[0].stateMachine.transitions[5].effects[0]",
6034
+ "node": [
6035
+ "gpu/submit",
6036
+ "@entity.device",
6037
+ [
6038
+ {
6039
+ "read": {
6040
+ "buffer": "@entity.buf"
6041
+ }
6042
+ }
6043
+ ],
6044
+ {
6045
+ "emit": {
6046
+ "success": "READ_OK",
6047
+ "failure": "FAILED"
6048
+ }
6049
+ }
6050
+ ],
6051
+ "at": 0
6052
+ }
6053
+ ]
6054
+ },
6055
+ "trait": [],
6056
+ "entity": []
6057
+ },
6058
+ "expect": {
6059
+ "fired": true
6060
+ }
6061
+ },
6062
+ {
6063
+ "event": "LINT_INPUT",
6064
+ "from": "ready",
6065
+ "payload": {
6066
+ "file": "a.lolo",
6067
+ "raw": "",
6068
+ "latin": true,
6069
+ "program": {
6070
+ "name": "gpu",
6071
+ "orbitals": [
6072
+ {
6073
+ "name": "GpuOrbital",
6074
+ "traits": [
6075
+ {
6076
+ "name": "GpuUser",
6077
+ "stateMachine": {
6078
+ "states": [
6079
+ {
6080
+ "name": "idle",
6081
+ "isInitial": true
6082
+ },
6083
+ {
6084
+ "name": "creating"
6085
+ },
6086
+ {
6087
+ "name": "releasing"
6088
+ },
6089
+ {
6090
+ "name": "using"
6091
+ }
6092
+ ],
6093
+ "transitions": [
6094
+ {
6095
+ "from": "idle",
6096
+ "to": "idle",
6097
+ "event": "INIT"
6098
+ },
6099
+ {
6100
+ "from": "idle",
6101
+ "to": "creating",
6102
+ "event": "GO",
6103
+ "effects": [
6104
+ [
6105
+ "gpu/buffer-create",
6106
+ "@entity.device",
6107
+ "storage",
6108
+ {
6109
+ "emit": {
6110
+ "success": "BUF_OK",
6111
+ "failure": "FAILED"
6112
+ }
6113
+ }
6114
+ ]
6115
+ ]
6116
+ },
6117
+ {
6118
+ "from": "creating",
6119
+ "to": "idle",
6120
+ "event": "FAILED"
6121
+ },
6122
+ {
6123
+ "from": "creating",
6124
+ "to": "releasing",
6125
+ "event": "BUF_OK",
6126
+ "effects": [
6127
+ [
6128
+ "set",
6129
+ "@entity.buf",
6130
+ "@payload.buffer"
6131
+ ],
6132
+ [
6133
+ "gpu/release",
6134
+ "@entity.buf",
6135
+ {
6136
+ "emit": {
6137
+ "success": "RELEASED",
6138
+ "failure": "FAILED"
6139
+ }
6140
+ }
6141
+ ]
6142
+ ]
6143
+ },
6144
+ {
6145
+ "from": "releasing",
6146
+ "to": "idle",
6147
+ "event": "FAILED"
6148
+ },
6149
+ {
6150
+ "from": "releasing",
6151
+ "to": "using",
6152
+ "event": "RELEASED",
6153
+ "effects": [
6154
+ [
6155
+ "gpu/submit",
6156
+ "@entity.device",
6157
+ [
6158
+ {
6159
+ "read": {
6160
+ "buffer": "@entity.buf"
6161
+ }
6162
+ }
6163
+ ],
6164
+ {
6165
+ "emit": {
6166
+ "success": "READ_OK",
6167
+ "failure": "FAILED"
6168
+ }
6169
+ }
6170
+ ]
6171
+ ]
6172
+ },
6173
+ {
6174
+ "from": "using",
6175
+ "to": "idle",
6176
+ "event": "READ_OK"
6177
+ }
6178
+ ]
6179
+ }
6180
+ }
6181
+ ]
6182
+ }
6183
+ ]
6184
+ },
6185
+ "scope": ""
6186
+ },
6187
+ "expect": {
6188
+ "fired": true,
6189
+ "state": "ready",
6190
+ "emits": [
6191
+ {
6192
+ "event": "LINT_FINISH",
6193
+ "payload": {}
6194
+ }
6195
+ ]
6196
+ }
6197
+ },
6198
+ {
6199
+ "event": "LINT_FINISH",
6200
+ "payload": {},
6201
+ "expect": {
6202
+ "emits": [
6203
+ {
6204
+ "event": "LINT_FOUND",
6205
+ "payload": {
6206
+ "rule": "mem-handles",
6207
+ "scope": "",
6208
+ "findings": [
6209
+ {
6210
+ "code": "ORB_GPU_USE_AFTER_RELEASE",
6211
+ "path": "orbitals[0 (GpuOrbital)].traits[0 (GpuUser)].stateMachine.transitions[5]",
6212
+ "message": "`(gpu/submit ...)` command `read.buffer` names `@entity.buf`, a handle that `gpu/release` or `gpu/device-close` already ended on some path to this transition",
6213
+ "suggestion": "Stop using the handle after it is released or closed, or rebind the field from a fresh creation first",
6214
+ "severity": "error"
6215
+ }
6216
+ ]
6217
+ }
6218
+ }
6219
+ ]
6220
+ }
6221
+ }
6222
+ ]
6223
+ },
6224
+ {
6225
+ "id": "gpu-a-submit-compute-bind-group-that-was-released-is-a-use-after-release",
6226
+ "steps": [
6227
+ {
6228
+ "event": "SITES_HEARD",
6229
+ "from": "ready",
6230
+ "payload": {
6231
+ "scope": "",
6232
+ "guardHeads": {},
6233
+ "guardRoots": {},
6234
+ "calls": {
6235
+ "gpu/buffer-create": [
6236
+ {
6237
+ "path": "orbitals[0].traits[0].stateMachine.transitions[1].effects[0]",
6238
+ "node": [
6239
+ "gpu/buffer-create",
6240
+ "@entity.device",
6241
+ "storage",
6242
+ {
6243
+ "emit": {
6244
+ "success": "BUF_OK",
6245
+ "failure": "FAILED"
6246
+ }
6247
+ }
6248
+ ],
6249
+ "at": 0
6250
+ }
6251
+ ],
6252
+ "gpu/release": [
6253
+ {
6254
+ "path": "orbitals[0].traits[0].stateMachine.transitions[3].effects[1]",
6255
+ "node": [
6256
+ "gpu/release",
6257
+ "@entity.bg",
6258
+ {
6259
+ "emit": {
6260
+ "success": "RELEASED",
6261
+ "failure": "FAILED"
6262
+ }
6263
+ }
6264
+ ],
6265
+ "at": 0
6266
+ }
6267
+ ],
6268
+ "gpu/submit": [
6269
+ {
6270
+ "path": "orbitals[0].traits[0].stateMachine.transitions[5].effects[0]",
6271
+ "node": [
6272
+ "gpu/submit",
6273
+ "@entity.device",
6274
+ [
6275
+ {
6276
+ "compute": {
6277
+ "pipeline": "p",
6278
+ "bindGroups": [
6279
+ "@entity.bg"
6280
+ ],
6281
+ "dispatch": [
6282
+ 1,
6283
+ 1,
6284
+ 1
6285
+ ]
6286
+ }
6287
+ }
6288
+ ],
6289
+ {
6290
+ "emit": {
6291
+ "success": "READ_OK",
6292
+ "failure": "FAILED"
6293
+ }
6294
+ }
6295
+ ],
6296
+ "at": 0
6297
+ }
6298
+ ]
6299
+ },
6300
+ "trait": [],
6301
+ "entity": []
6302
+ },
6303
+ "expect": {
6304
+ "fired": true
6305
+ }
6306
+ },
6307
+ {
6308
+ "event": "LINT_INPUT",
6309
+ "from": "ready",
6310
+ "payload": {
6311
+ "file": "a.lolo",
6312
+ "raw": "",
6313
+ "latin": true,
6314
+ "program": {
6315
+ "name": "gpu",
6316
+ "orbitals": [
6317
+ {
6318
+ "name": "GpuOrbital",
6319
+ "traits": [
6320
+ {
6321
+ "name": "GpuUser",
6322
+ "stateMachine": {
6323
+ "states": [
6324
+ {
6325
+ "name": "idle",
6326
+ "isInitial": true
6327
+ },
6328
+ {
6329
+ "name": "creating"
6330
+ },
6331
+ {
6332
+ "name": "releasing"
6333
+ },
6334
+ {
6335
+ "name": "using"
6336
+ }
6337
+ ],
6338
+ "transitions": [
6339
+ {
6340
+ "from": "idle",
6341
+ "to": "idle",
6342
+ "event": "INIT"
6343
+ },
6344
+ {
6345
+ "from": "idle",
6346
+ "to": "creating",
6347
+ "event": "GO",
6348
+ "effects": [
6349
+ [
6350
+ "gpu/buffer-create",
6351
+ "@entity.device",
6352
+ "storage",
6353
+ {
6354
+ "emit": {
6355
+ "success": "BUF_OK",
6356
+ "failure": "FAILED"
6357
+ }
6358
+ }
6359
+ ]
6360
+ ]
6361
+ },
6362
+ {
6363
+ "from": "creating",
6364
+ "to": "idle",
6365
+ "event": "FAILED"
6366
+ },
6367
+ {
6368
+ "from": "creating",
6369
+ "to": "releasing",
6370
+ "event": "BUF_OK",
6371
+ "effects": [
6372
+ [
6373
+ "set",
6374
+ "@entity.buf",
6375
+ "@payload.buffer"
6376
+ ],
6377
+ [
6378
+ "set",
6379
+ "@entity.bg",
6380
+ "@payload.bindGroup"
6381
+ ],
6382
+ [
6383
+ "gpu/release",
6384
+ "@entity.bg",
6385
+ {
6386
+ "emit": {
6387
+ "success": "RELEASED",
6388
+ "failure": "FAILED"
6389
+ }
6390
+ }
6391
+ ]
6392
+ ]
6393
+ },
6394
+ {
6395
+ "from": "releasing",
6396
+ "to": "idle",
6397
+ "event": "FAILED"
6398
+ },
6399
+ {
6400
+ "from": "releasing",
6401
+ "to": "using",
6402
+ "event": "RELEASED",
6403
+ "effects": [
6404
+ [
6405
+ "gpu/submit",
6406
+ "@entity.device",
6407
+ [
6408
+ {
6409
+ "compute": {
6410
+ "pipeline": "p",
6411
+ "bindGroups": [
6412
+ "@entity.bg"
6413
+ ],
6414
+ "dispatch": [
6415
+ 1,
6416
+ 1,
6417
+ 1
6418
+ ]
6419
+ }
6420
+ }
6421
+ ],
6422
+ {
6423
+ "emit": {
6424
+ "success": "READ_OK",
6425
+ "failure": "FAILED"
6426
+ }
6427
+ }
6428
+ ]
6429
+ ]
6430
+ },
6431
+ {
6432
+ "from": "using",
6433
+ "to": "idle",
6434
+ "event": "READ_OK"
6435
+ }
6436
+ ]
6437
+ }
6438
+ }
6439
+ ]
6440
+ }
6441
+ ]
6442
+ },
6443
+ "scope": ""
6444
+ },
6445
+ "expect": {
6446
+ "fired": true,
6447
+ "state": "ready",
6448
+ "emits": [
6449
+ {
6450
+ "event": "LINT_FINISH",
6451
+ "payload": {}
6452
+ }
6453
+ ]
6454
+ }
6455
+ },
6456
+ {
6457
+ "event": "LINT_FINISH",
6458
+ "payload": {},
6459
+ "expect": {
6460
+ "emits": [
6461
+ {
6462
+ "event": "LINT_FOUND",
6463
+ "payload": {
6464
+ "rule": "mem-handles",
6465
+ "scope": "",
6466
+ "findings": [
6467
+ {
6468
+ "code": "ORB_GPU_USE_AFTER_RELEASE",
6469
+ "path": "orbitals[0 (GpuOrbital)].traits[0 (GpuUser)].stateMachine.transitions[5]",
6470
+ "message": "`(gpu/submit ...)` command `compute.bindGroups` names `@entity.bg`, a handle that `gpu/release` or `gpu/device-close` already ended on some path to this transition",
6471
+ "suggestion": "Stop using the handle after it is released or closed, or rebind the field from a fresh creation first",
6472
+ "severity": "error"
6473
+ }
6474
+ ]
6475
+ }
6476
+ }
6477
+ ]
6478
+ }
6479
+ }
6480
+ ]
6481
+ },
6482
+ {
6483
+ "id": "control-gpu-a-submit-before-the-release-is-clean",
6484
+ "steps": [
6485
+ {
6486
+ "event": "SITES_HEARD",
6487
+ "from": "ready",
6488
+ "payload": {
6489
+ "scope": "",
6490
+ "guardHeads": {},
6491
+ "guardRoots": {},
6492
+ "calls": {
6493
+ "gpu/buffer-create": [
6494
+ {
6495
+ "path": "orbitals[0].traits[0].stateMachine.transitions[1].effects[0]",
6496
+ "node": [
6497
+ "gpu/buffer-create",
6498
+ "@entity.device",
6499
+ "storage",
6500
+ {
6501
+ "emit": {
6502
+ "success": "BUF_OK",
6503
+ "failure": "FAILED"
6504
+ }
6505
+ }
6506
+ ],
6507
+ "at": 0
6508
+ }
6509
+ ],
6510
+ "gpu/submit": [
6511
+ {
6512
+ "path": "orbitals[0].traits[0].stateMachine.transitions[3].effects[1]",
6513
+ "node": [
6514
+ "gpu/submit",
6515
+ "@entity.device",
6516
+ [
6517
+ {
6518
+ "read": {
6519
+ "buffer": "@entity.buf"
6520
+ }
6521
+ }
6522
+ ],
6523
+ {
6524
+ "emit": {
6525
+ "success": "READ_OK",
6526
+ "failure": "FAILED"
6527
+ }
6528
+ }
6529
+ ],
6530
+ "at": 0
6531
+ }
6532
+ ],
6533
+ "gpu/release": [
6534
+ {
6535
+ "path": "orbitals[0].traits[0].stateMachine.transitions[5].effects[0]",
6536
+ "node": [
6537
+ "gpu/release",
6538
+ "@entity.buf",
6539
+ {
6540
+ "emit": {
6541
+ "success": "RELEASED",
6542
+ "failure": "FAILED"
6543
+ }
6544
+ }
6545
+ ],
6546
+ "at": 0
6547
+ }
6548
+ ]
6549
+ },
6550
+ "trait": [],
6551
+ "entity": []
6552
+ },
6553
+ "expect": {
6554
+ "fired": true
6555
+ }
6556
+ },
6557
+ {
6558
+ "event": "LINT_INPUT",
6559
+ "from": "ready",
6560
+ "payload": {
6561
+ "file": "a.lolo",
6562
+ "raw": "",
6563
+ "latin": true,
6564
+ "program": {
6565
+ "name": "gpu",
6566
+ "orbitals": [
6567
+ {
6568
+ "name": "GpuOrbital",
6569
+ "traits": [
6570
+ {
6571
+ "name": "GpuUser",
6572
+ "stateMachine": {
6573
+ "states": [
6574
+ {
6575
+ "name": "idle",
6576
+ "isInitial": true
6577
+ },
6578
+ {
6579
+ "name": "creating"
6580
+ },
6581
+ {
6582
+ "name": "reading"
6583
+ },
6584
+ {
6585
+ "name": "releasing"
6586
+ }
6587
+ ],
6588
+ "transitions": [
6589
+ {
6590
+ "from": "idle",
6591
+ "to": "idle",
6592
+ "event": "INIT"
6593
+ },
6594
+ {
6595
+ "from": "idle",
6596
+ "to": "creating",
6597
+ "event": "GO",
6598
+ "effects": [
6599
+ [
6600
+ "gpu/buffer-create",
6601
+ "@entity.device",
6602
+ "storage",
6603
+ {
6604
+ "emit": {
6605
+ "success": "BUF_OK",
6606
+ "failure": "FAILED"
6607
+ }
6608
+ }
6609
+ ]
6610
+ ]
6611
+ },
6612
+ {
6613
+ "from": "creating",
6614
+ "to": "idle",
6615
+ "event": "FAILED"
6616
+ },
6617
+ {
6618
+ "from": "creating",
6619
+ "to": "reading",
6620
+ "event": "BUF_OK",
6621
+ "effects": [
6622
+ [
6623
+ "set",
6624
+ "@entity.buf",
6625
+ "@payload.buffer"
6626
+ ],
6627
+ [
6628
+ "gpu/submit",
6629
+ "@entity.device",
6630
+ [
6631
+ {
6632
+ "read": {
6633
+ "buffer": "@entity.buf"
6634
+ }
6635
+ }
6636
+ ],
6637
+ {
6638
+ "emit": {
6639
+ "success": "READ_OK",
6640
+ "failure": "FAILED"
6641
+ }
6642
+ }
6643
+ ]
6644
+ ]
6645
+ },
6646
+ {
6647
+ "from": "reading",
6648
+ "to": "idle",
6649
+ "event": "FAILED"
6650
+ },
6651
+ {
6652
+ "from": "reading",
6653
+ "to": "releasing",
6654
+ "event": "READ_OK",
6655
+ "effects": [
6656
+ [
6657
+ "gpu/release",
6658
+ "@entity.buf",
6659
+ {
6660
+ "emit": {
6661
+ "success": "RELEASED",
6662
+ "failure": "FAILED"
6663
+ }
6664
+ }
6665
+ ]
6666
+ ]
6667
+ },
6668
+ {
6669
+ "from": "releasing",
6670
+ "to": "idle",
6671
+ "event": "RELEASED"
6672
+ }
6673
+ ]
6674
+ }
6675
+ }
6676
+ ]
6677
+ }
6678
+ ]
6679
+ },
6680
+ "scope": ""
6681
+ },
6682
+ "expect": {
6683
+ "fired": true,
6684
+ "state": "ready",
6685
+ "emits": [
6686
+ {
6687
+ "event": "LINT_FINISH",
6688
+ "payload": {}
6689
+ }
6690
+ ]
6691
+ }
6692
+ },
6693
+ {
6694
+ "event": "LINT_FINISH",
6695
+ "payload": {},
6696
+ "expect": {
6697
+ "emits": [
6698
+ {
6699
+ "event": "LINT_FOUND",
6700
+ "payload": {
6701
+ "rule": "mem-handles",
6702
+ "scope": "",
6703
+ "findings": []
6704
+ }
6705
+ }
6706
+ ]
6707
+ }
6708
+ }
6709
+ ]
6710
+ }
3691
6711
  ]
3692
6712
  }