letify 2.10.8__tar.gz → 2.10.10__tar.gz

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 (216) hide show
  1. {letify-2.10.8 → letify-2.10.10}/PKG-INFO +2 -2
  2. {letify-2.10.8 → letify-2.10.10}/README.md +1 -1
  3. {letify-2.10.8 → letify-2.10.10}/docs/SPEC.md +15 -3
  4. {letify-2.10.8 → letify-2.10.10}/docs/guide/04-environments-and-data.md +4 -0
  5. {letify-2.10.8 → letify-2.10.10}/docs/guide/ko/04-/355/231/230/352/262/275/352/263/274-/353/215/260/354/235/264/355/204/260.md +4 -0
  6. {letify-2.10.8 → letify-2.10.10}/docs/locales/README_ko.md +1 -1
  7. {letify-2.10.8 → letify-2.10.10}/letify/__init__.py +1 -1
  8. {letify-2.10.8 → letify-2.10.10}/letify/launcher.py +9 -4
  9. {letify-2.10.8 → letify-2.10.10}/letify/providers/base.py +5 -0
  10. {letify-2.10.8 → letify-2.10.10}/letify/providers/local.py +4 -0
  11. {letify-2.10.8 → letify-2.10.10}/letify/runtime/control.py +58 -5
  12. {letify-2.10.8 → letify-2.10.10}/letify/runtime/session.py +1 -1
  13. {letify-2.10.8 → letify-2.10.10}/letify/runtime/telemetry.py +16 -0
  14. {letify-2.10.8 → letify-2.10.10}/letify/store/pathdata.py +6 -1
  15. {letify-2.10.8 → letify-2.10.10}/letify-core/Cargo.lock +2 -2
  16. {letify-2.10.8 → letify-2.10.10}/letify-core/Cargo.toml +1 -1
  17. {letify-2.10.8 → letify-2.10.10}/letify-ext/package-lock.json +2 -2
  18. {letify-2.10.8 → letify-2.10.10}/letify-ext/package.json +1 -1
  19. {letify-2.10.8 → letify-2.10.10}/pyproject.toml +1 -1
  20. {letify-2.10.8 → letify-2.10.10}/tests/conftest.py +12 -0
  21. {letify-2.10.8 → letify-2.10.10}/tests/test_data.py +3 -0
  22. letify-2.10.10/tests/test_data_in_place.py +173 -0
  23. {letify-2.10.8 → letify-2.10.10}/tests/test_data_streaming.py +3 -0
  24. {letify-2.10.8 → letify-2.10.10}/tests/test_parallel_placement.py +3 -0
  25. {letify-2.10.8 → letify-2.10.10}/tests/test_run_control.py +117 -0
  26. {letify-2.10.8 → letify-2.10.10}/.github/workflows/ci.yml +0 -0
  27. {letify-2.10.8 → letify-2.10.10}/.github/workflows/docs.yml +0 -0
  28. {letify-2.10.8 → letify-2.10.10}/.github/workflows/publish-crates.yml +0 -0
  29. {letify-2.10.8 → letify-2.10.10}/.github/workflows/publish.yml +0 -0
  30. {letify-2.10.8 → letify-2.10.10}/.github/workflows/reserve-crates.yml +0 -0
  31. {letify-2.10.8 → letify-2.10.10}/.gitignore +0 -0
  32. {letify-2.10.8 → letify-2.10.10}/.researchtree +0 -0
  33. {letify-2.10.8 → letify-2.10.10}/CLAUDE.md +0 -0
  34. {letify-2.10.8 → letify-2.10.10}/LICENSE +0 -0
  35. {letify-2.10.8 → letify-2.10.10}/PROJECT.md +0 -0
  36. {letify-2.10.8 → letify-2.10.10}/docs/COMPONENT.md +0 -0
  37. {letify-2.10.8 → letify-2.10.10}/docs/INTENT.md +0 -0
  38. {letify-2.10.8 → letify-2.10.10}/docs/NETWORK.md +0 -0
  39. {letify-2.10.8 → letify-2.10.10}/docs/guide/01-getting-started.md +0 -0
  40. {letify-2.10.8 → letify-2.10.10}/docs/guide/02-providers.md +0 -0
  41. {letify-2.10.8 → letify-2.10.10}/docs/guide/03-execution-modes.md +0 -0
  42. {letify-2.10.8 → letify-2.10.10}/docs/guide/05-concurrency.md +0 -0
  43. {letify-2.10.8 → letify-2.10.10}/docs/guide/06-cost.md +0 -0
  44. {letify-2.10.8 → letify-2.10.10}/docs/guide/07-troubleshooting.md +0 -0
  45. {letify-2.10.8 → letify-2.10.10}/docs/guide/08-releasing.md +0 -0
  46. {letify-2.10.8 → letify-2.10.10}/docs/guide/README.md +0 -0
  47. {letify-2.10.8 → letify-2.10.10}/docs/guide/ko/01-/354/213/234/354/236/221/355/225/230/352/270/260.md" +0 -0
  48. {letify-2.10.8 → letify-2.10.10}/docs/guide/ko/02-/355/224/204/353/241/234/353/260/224/354/235/264/353/215/224.md" +0 -0
  49. {letify-2.10.8 → letify-2.10.10}/docs/guide/ko/03-/354/213/244/355/226/211-/353/260/251/354/213/235.md" +0 -0
  50. {letify-2.10.8 → letify-2.10.10}/docs/guide/ko/05-/353/217/231/354/213/234-/354/213/244/355/226/211.md" +0 -0
  51. {letify-2.10.8 → letify-2.10.10}/docs/guide/ko/06-/353/271/204/354/232/251.md" +0 -0
  52. {letify-2.10.8 → letify-2.10.10}/docs/guide/ko/07-/353/254/270/354/240/234-/355/225/264/352/262/260.md" +0 -0
  53. {letify-2.10.8 → letify-2.10.10}/docs/guide/ko/08-/353/246/264/353/246/254/354/212/244.md" +0 -0
  54. {letify-2.10.8 → letify-2.10.10}/docs/guide/ko/README.md +0 -0
  55. {letify-2.10.8 → letify-2.10.10}/docs/mkdocs.yml +0 -0
  56. {letify-2.10.8 → letify-2.10.10}/examples/README.md +0 -0
  57. {letify-2.10.8 → letify-2.10.10}/examples/nvfp4-lora/.letify.example +0 -0
  58. {letify-2.10.8 → letify-2.10.10}/examples/nvfp4-lora/00_smoke.py +0 -0
  59. {letify-2.10.8 → letify-2.10.10}/examples/nvfp4-lora/01_sweep.py +0 -0
  60. {letify-2.10.8 → letify-2.10.10}/examples/nvfp4-lora/02_resume.py +0 -0
  61. {letify-2.10.8 → letify-2.10.10}/examples/nvfp4-lora/03_watch.py +0 -0
  62. {letify-2.10.8 → letify-2.10.10}/examples/nvfp4-lora/README.md +0 -0
  63. {letify-2.10.8 → letify-2.10.10}/examples/nvfp4-lora/README_ko.md +0 -0
  64. {letify-2.10.8 → letify-2.10.10}/examples/nvfp4-lora/common.py +0 -0
  65. {letify-2.10.8 → letify-2.10.10}/examples/nvfp4-lora/recipe.py +0 -0
  66. {letify-2.10.8 → letify-2.10.10}/letify/cli.py +0 -0
  67. {letify-2.10.8 → letify-2.10.10}/letify/config/__init__.py +0 -0
  68. {letify-2.10.8 → letify-2.10.10}/letify/config/inventory.py +0 -0
  69. {letify-2.10.8 → letify-2.10.10}/letify/config/login.py +0 -0
  70. {letify-2.10.8 → letify-2.10.10}/letify/config/schema.py +0 -0
  71. {letify-2.10.8 → letify-2.10.10}/letify/config/secrets.py +0 -0
  72. {letify-2.10.8 → letify-2.10.10}/letify/config/writer.py +0 -0
  73. {letify-2.10.8 → letify-2.10.10}/letify/declare/__init__.py +0 -0
  74. {letify-2.10.8 → letify-2.10.10}/letify/declare/cache.py +0 -0
  75. {letify-2.10.8 → letify-2.10.10}/letify/declare/env.py +0 -0
  76. {letify-2.10.8 → letify-2.10.10}/letify/declare/exit.py +0 -0
  77. {letify-2.10.8 → letify-2.10.10}/letify/declare/function.py +0 -0
  78. {letify-2.10.8 → letify-2.10.10}/letify/declare/instance.py +0 -0
  79. {letify-2.10.8 → letify-2.10.10}/letify/declare/reduce.py +0 -0
  80. {letify-2.10.8 → letify-2.10.10}/letify/declare/replicas.py +0 -0
  81. {letify-2.10.8 → letify-2.10.10}/letify/errors.py +0 -0
  82. {letify-2.10.8 → letify-2.10.10}/letify/install.py +0 -0
  83. {letify-2.10.8 → letify-2.10.10}/letify/paths.py +0 -0
  84. {letify-2.10.8 → letify-2.10.10}/letify/protocol/__init__.py +0 -0
  85. {letify-2.10.8 → letify-2.10.10}/letify/protocol/codec.py +0 -0
  86. {letify-2.10.8 → letify-2.10.10}/letify/protocol/driver.py +0 -0
  87. {letify-2.10.8 → letify-2.10.10}/letify/protocol/handle.py +0 -0
  88. {letify-2.10.8 → letify-2.10.10}/letify/protocol/wire.py +0 -0
  89. {letify-2.10.8 → letify-2.10.10}/letify/protocol/worker.py +0 -0
  90. {letify-2.10.8 → letify-2.10.10}/letify/providers/__init__.py +0 -0
  91. {letify-2.10.8 → letify-2.10.10}/letify/providers/colab.py +0 -0
  92. {letify-2.10.8 → letify-2.10.10}/letify/providers/colab_files.py +0 -0
  93. {letify-2.10.8 → letify-2.10.10}/letify/providers/colab_keepalive.py +0 -0
  94. {letify-2.10.8 → letify-2.10.10}/letify/providers/elice.py +0 -0
  95. {letify-2.10.8 → letify-2.10.10}/letify/providers/kaggle.py +0 -0
  96. {letify-2.10.8 → letify-2.10.10}/letify/providers/kaggle_adapter.py +0 -0
  97. {letify-2.10.8 → letify-2.10.10}/letify/providers/modal.py +0 -0
  98. {letify-2.10.8 → letify-2.10.10}/letify/providers/modal_adapter.py +0 -0
  99. {letify-2.10.8 → letify-2.10.10}/letify/providers/naming.py +0 -0
  100. {letify-2.10.8 → letify-2.10.10}/letify/providers/shell.py +0 -0
  101. {letify-2.10.8 → letify-2.10.10}/letify/providers/tunnel.py +0 -0
  102. {letify-2.10.8 → letify-2.10.10}/letify/providers/usage.py +0 -0
  103. {letify-2.10.8 → letify-2.10.10}/letify/remoting/__init__.py +0 -0
  104. {letify-2.10.8 → letify-2.10.10}/letify/remoting/device/__init__.py +0 -0
  105. {letify-2.10.8 → letify-2.10.10}/letify/remoting/device/client.py +0 -0
  106. {letify-2.10.8 → letify-2.10.10}/letify/remoting/device/cuda.py +0 -0
  107. {letify-2.10.8 → letify-2.10.10}/letify/remoting/device/executor.py +0 -0
  108. {letify-2.10.8 → letify-2.10.10}/letify/remoting/device/frames.py +0 -0
  109. {letify-2.10.8 → letify-2.10.10}/letify/remoting/device/guard.py +0 -0
  110. {letify-2.10.8 → letify-2.10.10}/letify/remoting/device/tensor.py +0 -0
  111. {letify-2.10.8 → letify-2.10.10}/letify/remoting/device/trace.py +0 -0
  112. {letify-2.10.8 → letify-2.10.10}/letify/remoting/device/value.py +0 -0
  113. {letify-2.10.8 → letify-2.10.10}/letify/render.py +0 -0
  114. {letify-2.10.8 → letify-2.10.10}/letify/runtime/__init__.py +0 -0
  115. {letify-2.10.8 → letify-2.10.10}/letify/runtime/bootstrap.py +0 -0
  116. {letify-2.10.8 → letify-2.10.10}/letify/runtime/broker.py +0 -0
  117. {letify-2.10.8 → letify-2.10.10}/letify/runtime/channel.py +0 -0
  118. {letify-2.10.8 → letify-2.10.10}/letify/runtime/lease.py +0 -0
  119. {letify-2.10.8 → letify-2.10.10}/letify/runtime/pool.py +0 -0
  120. {letify-2.10.8 → letify-2.10.10}/letify/runtime/reattach.py +0 -0
  121. {letify-2.10.8 → letify-2.10.10}/letify/runtime/takeover.py +0 -0
  122. {letify-2.10.8 → letify-2.10.10}/letify/runtime/workers.py +0 -0
  123. {letify-2.10.8 → letify-2.10.10}/letify/store/__init__.py +0 -0
  124. {letify-2.10.8 → letify-2.10.10}/letify/store/backends/__init__.py +0 -0
  125. {letify-2.10.8 → letify-2.10.10}/letify/store/backends/drive.py +0 -0
  126. {letify-2.10.8 → letify-2.10.10}/letify/store/backends/filesystem.py +0 -0
  127. {letify-2.10.8 → letify-2.10.10}/letify/store/backends/google_auth.py +0 -0
  128. {letify-2.10.8 → letify-2.10.10}/letify/store/backends/layout.py +0 -0
  129. {letify-2.10.8 → letify-2.10.10}/letify/store/backends/objects.py +0 -0
  130. {letify-2.10.8 → letify-2.10.10}/letify/store/cas.py +0 -0
  131. {letify-2.10.8 → letify-2.10.10}/letify/store/handoff.py +0 -0
  132. {letify-2.10.8 → letify-2.10.10}/letify/store/sendorder.py +0 -0
  133. {letify-2.10.8 → letify-2.10.10}/letify/store/volume.py +0 -0
  134. {letify-2.10.8 → letify-2.10.10}/letify/stubs.py +0 -0
  135. {letify-2.10.8 → letify-2.10.10}/letify/tools.py +0 -0
  136. {letify-2.10.8 → letify-2.10.10}/letify/transport/__init__.py +0 -0
  137. {letify-2.10.8 → letify-2.10.10}/letify/transport/agent.py +0 -0
  138. {letify-2.10.8 → letify-2.10.10}/letify/transport/announce.py +0 -0
  139. {letify-2.10.8 → letify-2.10.10}/letify/transport/link.py +0 -0
  140. {letify-2.10.8 → letify-2.10.10}/letify/transport/nat.py +0 -0
  141. {letify-2.10.8 → letify-2.10.10}/letify/transport/pipeline.py +0 -0
  142. {letify-2.10.8 → letify-2.10.10}/letify/transport/portmap.py +0 -0
  143. {letify-2.10.8 → letify-2.10.10}/letify/transport/probe.py +0 -0
  144. {letify-2.10.8 → letify-2.10.10}/letify/transport/quic.py +0 -0
  145. {letify-2.10.8 → letify-2.10.10}/letify/transport/rendezvous.py +0 -0
  146. {letify-2.10.8 → letify-2.10.10}/letify/transport/setup.py +0 -0
  147. {letify-2.10.8 → letify-2.10.10}/letify/transport/sshopts.py +0 -0
  148. {letify-2.10.8 → letify-2.10.10}/letify/transport/strategies.py +0 -0
  149. {letify-2.10.8 → letify-2.10.10}/letify-core/.gitignore +0 -0
  150. {letify-2.10.8 → letify-2.10.10}/letify-core/build.py +0 -0
  151. {letify-2.10.8 → letify-2.10.10}/letify-core/letify/Cargo.toml +0 -0
  152. {letify-2.10.8 → letify-2.10.10}/letify-core/letify/LICENSE +0 -0
  153. {letify-2.10.8 → letify-2.10.10}/letify-core/letify/README.md +0 -0
  154. {letify-2.10.8 → letify-2.10.10}/letify-core/letify/src/lib.rs +0 -0
  155. {letify-2.10.8 → letify-2.10.10}/letify-core/letify-quic/Cargo.toml +0 -0
  156. {letify-2.10.8 → letify-2.10.10}/letify-core/letify-quic/src/main.rs +0 -0
  157. {letify-2.10.8 → letify-2.10.10}/letify-core/rust-toolchain.toml +0 -0
  158. {letify-2.10.8 → letify-2.10.10}/letify-ext/.vscodeignore +0 -0
  159. {letify-2.10.8 → letify-2.10.10}/letify-ext/LICENSE +0 -0
  160. {letify-2.10.8 → letify-2.10.10}/letify-ext/README.md +0 -0
  161. {letify-2.10.8 → letify-2.10.10}/letify-ext/media/icon.svg +0 -0
  162. {letify-2.10.8 → letify-2.10.10}/letify-ext/src/cli.ts +0 -0
  163. {letify-2.10.8 → letify-2.10.10}/letify-ext/src/extension.ts +0 -0
  164. {letify-2.10.8 → letify-2.10.10}/letify-ext/src/history.ts +0 -0
  165. {letify-2.10.8 → letify-2.10.10}/letify-ext/src/model.ts +0 -0
  166. {letify-2.10.8 → letify-2.10.10}/letify-ext/src/poll.ts +0 -0
  167. {letify-2.10.8 → letify-2.10.10}/letify-ext/src/render.ts +0 -0
  168. {letify-2.10.8 → letify-2.10.10}/letify-ext/test/cli.test.ts +0 -0
  169. {letify-2.10.8 → letify-2.10.10}/letify-ext/test/manifest.test.ts +0 -0
  170. {letify-2.10.8 → letify-2.10.10}/letify-ext/test/model.test.ts +0 -0
  171. {letify-2.10.8 → letify-2.10.10}/letify-ext/test/regressions.test.ts +0 -0
  172. {letify-2.10.8 → letify-2.10.10}/letify-ext/tsconfig.json +0 -0
  173. {letify-2.10.8 → letify-2.10.10}/letify_providers.py +0 -0
  174. {letify-2.10.8 → letify-2.10.10}/scripts/sync-main.sh +0 -0
  175. {letify-2.10.8 → letify-2.10.10}/scripts/version.py +0 -0
  176. {letify-2.10.8 → letify-2.10.10}/tests/fake_kaggle_adapter.py +0 -0
  177. {letify-2.10.8 → letify-2.10.10}/tests/fake_modal_adapter.py +0 -0
  178. {letify-2.10.8 → letify-2.10.10}/tests/test_cli.py +0 -0
  179. {letify-2.10.8 → letify-2.10.10}/tests/test_cli_output.py +0 -0
  180. {letify-2.10.8 → letify-2.10.10}/tests/test_colab_keepalive.py +0 -0
  181. {letify-2.10.8 → letify-2.10.10}/tests/test_config.py +0 -0
  182. {letify-2.10.8 → letify-2.10.10}/tests/test_core.py +0 -0
  183. {letify-2.10.8 → letify-2.10.10}/tests/test_declare.py +0 -0
  184. {letify-2.10.8 → letify-2.10.10}/tests/test_device.py +0 -0
  185. {letify-2.10.8 → letify-2.10.10}/tests/test_device_compile.py +0 -0
  186. {letify-2.10.8 → letify-2.10.10}/tests/test_distributed.py +0 -0
  187. {letify-2.10.8 → letify-2.10.10}/tests/test_drive_handoff.py +0 -0
  188. {letify-2.10.8 → letify-2.10.10}/tests/test_drive_store.py +0 -0
  189. {letify-2.10.8 → letify-2.10.10}/tests/test_editor_sessions.py +0 -0
  190. {letify-2.10.8 → letify-2.10.10}/tests/test_elice.py +0 -0
  191. {letify-2.10.8 → letify-2.10.10}/tests/test_frames.py +0 -0
  192. {letify-2.10.8 → letify-2.10.10}/tests/test_install.py +0 -0
  193. {letify-2.10.8 → letify-2.10.10}/tests/test_kaggle.py +0 -0
  194. {letify-2.10.8 → letify-2.10.10}/tests/test_kaggle_cookie.py +0 -0
  195. {letify-2.10.8 → letify-2.10.10}/tests/test_kaggle_link.py +0 -0
  196. {letify-2.10.8 → letify-2.10.10}/tests/test_link_log.py +0 -0
  197. {letify-2.10.8 → letify-2.10.10}/tests/test_notebook.py +0 -0
  198. {letify-2.10.8 → letify-2.10.10}/tests/test_paths.py +0 -0
  199. {letify-2.10.8 → letify-2.10.10}/tests/test_portmap.py +0 -0
  200. {letify-2.10.8 → letify-2.10.10}/tests/test_protocol.py +0 -0
  201. {letify-2.10.8 → letify-2.10.10}/tests/test_providers.py +0 -0
  202. {letify-2.10.8 → letify-2.10.10}/tests/test_punch_sockets.py +0 -0
  203. {letify-2.10.8 → letify-2.10.10}/tests/test_quic.py +0 -0
  204. {letify-2.10.8 → letify-2.10.10}/tests/test_remoting.py +0 -0
  205. {letify-2.10.8 → letify-2.10.10}/tests/test_render.py +0 -0
  206. {letify-2.10.8 → letify-2.10.10}/tests/test_run_reattach.py +0 -0
  207. {letify-2.10.8 → letify-2.10.10}/tests/test_run_takeover.py +0 -0
  208. {letify-2.10.8 → letify-2.10.10}/tests/test_runtime.py +0 -0
  209. {letify-2.10.8 → letify-2.10.10}/tests/test_shell_workers.py +0 -0
  210. {letify-2.10.8 → letify-2.10.10}/tests/test_ship.py +0 -0
  211. {letify-2.10.8 → letify-2.10.10}/tests/test_store.py +0 -0
  212. {letify-2.10.8 → letify-2.10.10}/tests/test_strategies.py +0 -0
  213. {letify-2.10.8 → letify-2.10.10}/tests/test_stubs.py +0 -0
  214. {letify-2.10.8 → letify-2.10.10}/tests/test_transport.py +0 -0
  215. {letify-2.10.8 → letify-2.10.10}/tests/test_tunnel_setup.py +0 -0
  216. {letify-2.10.8 → letify-2.10.10}/tests/test_version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: letify
3
- Version: 2.10.8
3
+ Version: 2.10.10
4
4
  Summary: Declarations that become infrastructure.
5
5
  Project-URL: Homepage, https://github.com/DarkPyonix/letify
6
6
  Project-URL: Documentation, https://github.com/DarkPyonix/letify/tree/main/docs
@@ -393,7 +393,7 @@ The runtime pulls the volume straight from the bucket, not through your machine.
393
393
 
394
394
  Training data needs no declaration at all. Pass a `pathlib.Path`, or read one from a global, and letify sends the files it names as content addressed blobs. The body receives a path on the runtime with the same layout. A persistent machine keeps the blobs on its own disk, so the second session uploads 0 bytes. An ephemeral account with `bucket = "<name>"` uploads each file to the bucket once, and every later runtime downloads it from there. The runtime's copy is kept within a budget, 50 GiB by default or `data_cache_gib` on the account, and `letify cache` shows or clears it. The call does not wait for the dataset: letify derives the read order from the call itself, sends only the first wave of that order before the call, and keeps sending the rest while the call runs, reordered by what the runtime observes the body reading. Listings and file sizes are answered from the manifest from the first step, so only reading a file that has not arrived waits.
395
395
 
396
- Results come back the same way. A `Path` that does not exist yet, or a directory, is also an output location: what the body creates or changes there is copied to the local path when the call returns, and a file the local copy already matches is not sent. So checkpoints and logs saved under `Path("runs/exp1")` are in your project after the call.
396
+ Results come back the same way. A `Path` that does not exist yet, or a directory, is also an output location: what the body creates or changes there is copied to the local path when the call returns, and a file the local copy already matches is not sent. So checkpoints and logs saved under `Path("runs/exp1")` are in your project after the call. On the `Local` provider nothing is copied at all: the runtime is this machine, so the body gets your real paths and writes into your project as it goes, and a call that fails or is stopped keeps what it had already written.
397
397
 
398
398
  ```python
399
399
  DATA = Path("data/imagenet-subset")
@@ -368,7 +368,7 @@ The runtime pulls the volume straight from the bucket, not through your machine.
368
368
 
369
369
  Training data needs no declaration at all. Pass a `pathlib.Path`, or read one from a global, and letify sends the files it names as content addressed blobs. The body receives a path on the runtime with the same layout. A persistent machine keeps the blobs on its own disk, so the second session uploads 0 bytes. An ephemeral account with `bucket = "<name>"` uploads each file to the bucket once, and every later runtime downloads it from there. The runtime's copy is kept within a budget, 50 GiB by default or `data_cache_gib` on the account, and `letify cache` shows or clears it. The call does not wait for the dataset: letify derives the read order from the call itself, sends only the first wave of that order before the call, and keeps sending the rest while the call runs, reordered by what the runtime observes the body reading. Listings and file sizes are answered from the manifest from the first step, so only reading a file that has not arrived waits.
370
370
 
371
- Results come back the same way. A `Path` that does not exist yet, or a directory, is also an output location: what the body creates or changes there is copied to the local path when the call returns, and a file the local copy already matches is not sent. So checkpoints and logs saved under `Path("runs/exp1")` are in your project after the call.
371
+ Results come back the same way. A `Path` that does not exist yet, or a directory, is also an output location: what the body creates or changes there is copied to the local path when the call returns, and a file the local copy already matches is not sent. So checkpoints and logs saved under `Path("runs/exp1")` are in your project after the call. On the `Local` provider nothing is copied at all: the runtime is this machine, so the body gets your real paths and writes into your project as it goes, and a call that fails or is stopped keeps what it had already written.
372
372
 
373
373
  ```python
374
374
  DATA = Path("data/imagenet-subset")
@@ -246,6 +246,8 @@ A provider is built from one entry in the configuration file and reached by attr
246
246
 
247
247
  `needs_lease` says whether a session can outlive this process and keep billing.
248
248
 
249
+ `shares_filesystem` says whether the runtime sees this machine's file system, which only `Local` does. A call to such a provider keeps its paths as they are, as Data in place describes.
250
+
249
251
  | Provider | Persistence | Fast path | Channel | Store backend |
250
252
  |---|---|---|---|---|
251
253
  | `Local` | persistent | yes | persistent | `filesystem` |
@@ -605,7 +607,9 @@ Where the reading comes from depends on whether the machine outlives a session.
605
607
  | Provider | Scope | Read from |
606
608
  |---|---|---|
607
609
  | `Local`, `Shell`, `Tunnel` | `machine` | The machine itself, with no session: `nvidia-smi` here for `Local`, and over the provider's link for `Shell` and `Tunnel`. One row per provider |
608
- | `Colab`, `Elice`, `Modal`, `Kaggle` | `session` | Inside the instance's live session, by shipping the same reader function through the ordinary call protocol. One row per instance |
610
+ | `Colab`, `Elice`, `Modal`, `Kaggle` | `session` | Inside the instance's live session, by shipping the same reader function through the ordinary call protocol. A session owned by another process on this machine is read through its running call's control socket instead, as below. A session with no running call anywhere is not measured. One row per instance |
611
+
612
+ A `session` instance is looked up in this process's pool first. When the pool holds no session for the alias and accelerator, the run registry of [Controlling a running call](#run-control) is searched for a live run whose `provider` and `accelerator` match, and the first one is read. The read is the `exec` command of that section with a source that runs the same `nvidia-smi` query and prints its output, sent to the run's control socket with a 10 s limit. It opens no channel and starts no session, and the source runs on a thread of its own in the worker, so the body keeps running. When the run does not answer in time, the row's `reason` is the error text. When neither the pool nor the registry has a match, `reason` is `no live session, so nothing to measure`.
609
613
 
610
614
  A `machine` reading is read-only. It runs the three `nvidia-smi` queries the busy check runs, starts no process on a card and reserves nothing. Each device in it also carries who holds the card:
611
615
 
@@ -1061,9 +1065,9 @@ A call on a remote runtime is a program running somewhere else. On a laptop the
1061
1065
 
1062
1066
  ### Run ids and the registry
1063
1067
 
1064
- Every call on a runtime gets a run id, 12 lowercase hex characters, when it is sent. The owning process writes `~/.letify/runs/<run id>.json` before the call is sent and removes it when the call returns or raises. The record holds `run`, `function` (the qualified name), `runtime`, `provider` (the account alias), `started_at` (Unix seconds), `pid` (the owning process) and `socket`, the owner's control socket. The directory is created with mode 0700 and each file with mode 0600.
1068
+ Every call on a runtime gets a run id, 12 lowercase hex characters, when it is sent. The owning process writes `~/.letify/runs/<run id>.json` before the call is sent and removes it when the call returns or raises. The record holds `run`, `function` (the qualified name), `runtime`, `provider` (the account alias), `accelerator` (the instance's accelerator name, or null), `started_at` (Unix seconds), `pid` (the owning process) and `socket`, the owner's control socket. The directory is created with mode 0700 and each file with mode 0600.
1065
1069
 
1066
- Each owning process listens on one Unix socket, `~/.letify/runs/<pid>.sock`, created on the first call and removed at exit. A command reaches a run by reading its record and connecting to that socket; the owner forwards the request to the runtime over the call's own channel. When `~/.letify/runs/<pid>.sock` would exceed 100 bytes, below the limit of a Unix socket path (107 bytes on Linux, 103 on macOS), the socket is created as `run-<pid>.sock` in the SSH control directory of [Declared filesystem paths](#declared-paths) instead. When that path also exceeds 100 bytes, which happens with a deep `LETIFY_HOME` and no `XDG_RUNTIME_DIR`, the socket is created as `run-<h>-<pid>.sock` in `letify-<uid>` below the system temporary directory, where `<h>` is the first 12 hex characters of the SHA-256 of the preferred path. That directory is mode 0700, owned by the user, and not a symbolic link; it is refused otherwise. In every case `socket` in the record names the path actually bound, and the socket is removed at exit. A record whose `pid` no longer exists is stale: it is removed when read and the run is reported as not found. On Windows there is no control socket, and the commands below say so.
1070
+ Each owning process listens on one Unix socket, `~/.letify/runs/<pid>.sock`, created on the first call and removed at exit. A command reaches a run by reading its record and connecting to that socket; the owner forwards the request to the runtime over the call's own channel. When `~/.letify/runs/<pid>.sock` would exceed 100 bytes, below the limit of a Unix socket path (107 bytes on Linux, 103 on macOS), the socket is created as `run-<pid>.sock` in the SSH control directory of [Declared filesystem paths](#declared-paths) instead. When that path also exceeds 100 bytes, which happens with a deep `LETIFY_HOME` and no `XDG_RUNTIME_DIR`, the socket is created as `run-<h>-<pid>.sock` in `letify-<uid>` below the system temporary directory, where `<h>` is the first 12 hex characters of the SHA-256 of the preferred path. That directory is mode 0700, owned by the user, and not a symbolic link; it is refused otherwise. It is created only when it is the path chosen: when that path also exceeds 100 bytes, which happens with a deep system temporary directory, nothing is created there and the socket is instead created as `~/.letify/runs/<pid>.sock` and reached through `/proc/self/fd/<n>`, a descriptor of its directory, the way the worker's door is in [Taking over a running call](#run-takeover). The owner and every command connect the same way. Where `/proc` is missing, the owner reports that runs cannot be controlled. In every case `socket` in the record names the path actually bound, and the socket is removed at exit. A record whose `pid` no longer exists is stale: it is removed when read and the run is reported as not found. On Windows there is no control socket, and the commands below say so.
1067
1071
 
1068
1072
  The request travels as one JSON object per line on the socket and the answer as one JSON object per line, so a tool that is not letify can drive it.
1069
1073
 
@@ -1292,6 +1296,8 @@ Nothing hands a session to the caller. There is no call that returns one, no arg
1292
1296
 
1293
1297
  The declared function is sent with cloudpickle, which serializes its closure variables, the globals it references, its default arguments and the call's arguments. letify's pickler intercepts every `os.PathLike` among them through `reducer_override`. Nothing is declared: the function's own references are the declaration.
1294
1298
 
1299
+ A provider whose runtime is this machine, which is `Local`, does not stage data. Data in place describes it, and the rest of this section describes every other provider.
1300
+
1295
1301
  Detection runs on a persistent channel only. A one-shot channel has no worker to hold a cache, so its paths travel as plain paths. A Kaggle account with a registered session has a persistent channel, so a call to one carries its project data like any other provider's does.
1296
1302
 
1297
1303
  #### Which paths are data <!-- id: project-data-detection -->
@@ -1317,6 +1323,12 @@ A path that exists here and is inside a root is data; a path that does not exist
1317
1323
 
1318
1324
  A directory is walked without following symbolic links to directories. Regular files and symbolic links to regular files are included. Entries named `.git`, `.venv` and `__pycache__` are skipped.
1319
1325
 
1326
+ #### Data in place <!-- id: project-data-in-place -->
1327
+
1328
+ A provider whose runtime shares this machine's file system passes a call's paths through unchanged: the body reads and writes the user's own files, exactly as a local run does. The class attribute `Provider.shares_filesystem` is `False` by default and `True` on `Local`, whose worker is a subprocess of this process and so sees the same disk and the same working directory.
1329
+
1330
+ For such a provider a call has no call directory, no placement from the runtime blob cache, no upload, no background write-back and no final write-back, and nothing is removed afterwards. Every `os.PathLike` is pickled as it was passed, so an absolute path stays that path and a relative path resolves against the working directory the worker inherited, which is the one a local run would use. The refusal of a path outside the allowed roots does not apply, because nothing is sent. The body's writes land at the real path as they happen, so a file is there while the body is still running, and a call that raises or is stopped by a signal keeps what it had written. The call prints no `letify: data` line, because no transfer took place. The sections below, Digests and the digest cache through Writing back, describe the staging that every provider with `shares_filesystem` false performs.
1331
+
1320
1332
  #### Digests and the digest cache <!-- id: project-data-digests -->
1321
1333
 
1322
1334
  Each file is one blob, named by the blake3 digest of its contents with 16 byte output, the digest of Argument addressing. A file of 64 MiB or more is hashed through a memory map with blake3's multithreaded update. A directory is a manifest: a list of relative POSIX path, digest and size per file, sorted by path.
@@ -181,6 +181,10 @@ def train(epochs):
181
181
 
182
182
  Each such call prints one more line, for example `letify: data wrote back 3 files 512.1 MiB in 2.4 s (213.4 MiB/s), 0 files 0.0 MiB already on the client`.
183
183
 
184
+ ### The Local provider uses your files in place
185
+
186
+ The `Local` provider runs on this machine, so it stages nothing. The body receives the paths you passed, reads your files directly and writes into your project as it goes. There is no call directory, no upload, no write-back and no `letify: data` line. A call that raises or is stopped by a signal keeps every file it had written, as a local run would. Everything above describes the other providers.
187
+
184
188
  ## Data that is too big to move
185
189
 
186
190
  Three options, in the order worth trying.
@@ -181,6 +181,10 @@ def train(epochs):
181
181
 
182
182
  호출마다 한 줄이 더 찍힙니다. 예: `letify: data wrote back 3 files 512.1 MiB in 2.4 s (213.4 MiB/s), 0 files 0.0 MiB already on the client`.
183
183
 
184
+ ### Local 프로바이더는 파일을 제자리에서 씁니다
185
+
186
+ `Local` 프로바이더는 이 머신에서 실행되므로 아무것도 따로 옮겨 두지 않습니다. 함수 본문은 넘긴 경로를 그대로 받고, 파일을 직접 읽고, 프로젝트에 곧바로 씁니다. 호출 디렉터리도, 업로드도, 되쓰기도, `letify: data` 줄도 없습니다. 호출이 예외로 끝나거나 시그널로 중단되어도 로컬 실행처럼 이미 쓴 파일은 모두 남습니다. 위의 설명은 다른 프로바이더에 해당합니다.
187
+
184
188
  ## 옮기기에 너무 큰 데이터
185
189
 
186
190
  세 가지 방법을 시도할 순서대로 적습니다.
@@ -362,7 +362,7 @@ def train(lr): ...
362
362
 
363
363
  학습 데이터는 선언할 필요가 없습니다. `pathlib.Path`를 인자로 넘기거나 전역 변수에서 읽으면, letify가 그 경로의 파일을 내용 주소 블롭으로 보냅니다. 함수 본문은 같은 구조를 가진 런타임 쪽 경로를 받습니다. persistent 머신은 블롭을 자기 디스크에 두므로 두 번째 세션의 업로드는 0바이트입니다. `bucket = "<이름>"`을 설정한 ephemeral 계정은 파일마다 버킷에 한 번만 올리고, 이후 런타임은 모두 버킷에서 받습니다. 런타임에 둔 사본은 예산 안에서 보관하며(기본 50 GiB, 계정의 `data_cache_gib`로 변경), `letify cache`로 보거나 비울 수 있습니다. 호출은 데이터셋 전체를 기다리지 않습니다. letify가 호출 자체에서 읽기 순서를 뽑아내 그 순서의 첫 번째 물결만 보내고 호출을 시작한 뒤, 나머지는 호출이 도는 동안 계속 보내며 런타임이 관찰한 실제 읽기 순서로 다시 정렬합니다. 목록과 파일 크기는 첫 스텝부터 매니페스트로 답하므로, 아직 도착하지 않은 파일을 읽을 때만 기다립니다.
364
364
 
365
- 결과도 같은 방식으로 돌아옵니다. 아직 없는 `Path`나 디렉터리는 출력 위치이기도 합니다. 함수 본문이 그곳에 만들거나 바꾼 파일은 호출이 끝나면 로컬 경로로 복사되고, 로컬에 이미 같은 내용이 있는 파일은 보내지 않습니다. 그래서 `Path("runs/exp1")` 아래에 저장한 체크포인트와 로그는 호출이 끝나면 프로젝트에 들어와 있습니다.
365
+ 결과도 같은 방식으로 돌아옵니다. 아직 없는 `Path`나 디렉터리는 출력 위치이기도 합니다. 함수 본문이 그곳에 만들거나 바꾼 파일은 호출이 끝나면 로컬 경로로 복사되고, 로컬에 이미 같은 내용이 있는 파일은 보내지 않습니다. 그래서 `Path("runs/exp1")` 아래에 저장한 체크포인트와 로그는 호출이 끝나면 프로젝트에 들어와 있습니다. `Local` 프로바이더에서는 복사 자체가 없습니다. 런타임이 이 머신이므로 함수 본문은 실제 경로를 받아 프로젝트에 곧바로 쓰고, 호출이 실패하거나 중단되어도 이미 쓴 파일이 남습니다.
366
366
 
367
367
  ```python
368
368
  DATA = Path("data/imagenet-subset")
@@ -70,7 +70,7 @@ distributed: Final = Host.distributed
70
70
  # The enum class stays importable from letify.declare.instance for letify's own use.
71
71
  del Host
72
72
 
73
- __version__ = "2.10.8"
73
+ __version__ = "2.10.10"
74
74
 
75
75
 
76
76
  def fetch(tensor): # type: ignore[no-untyped-def]
@@ -41,7 +41,7 @@ from .config import Config, load
41
41
  from .declare.env import Env
42
42
  from .declare.function import Function
43
43
  from .declare.instance import AnyInstance, Host, Instance, RemoteOnlyInstance
44
- from .errors import LetifyError, UnknownInstance, UnknownProvider
44
+ from .errors import LetifyError, RunNotFound, UnknownInstance, UnknownProvider
45
45
  from .paths import config_label
46
46
  from .runtime.pool import RuntimePool
47
47
 
@@ -379,6 +379,7 @@ class Launcher:
379
379
  """
380
380
  from concurrent.futures import ThreadPoolExecutor
381
381
 
382
+ from .runtime import control
382
383
  from .runtime.telemetry import parse_smi, read_smi
383
384
 
384
385
  wanted = [alias] if alias else list(self.config.order)
@@ -435,11 +436,15 @@ class Launcher:
435
436
  }
436
437
  rows.append(row)
437
438
  runtime = live.get((provider.alias, accelerator))
438
- if runtime is None:
439
+ try:
440
+ if runtime is not None:
441
+ output, _logs = runtime.call(read_smi, (), {})
442
+ else:
443
+ # A session another process owns, reached through its running call.
444
+ output = control.read_session_smi(provider.alias, accelerator)
445
+ except RunNotFound:
439
446
  row["reason"] = "no live session, so nothing to measure"
440
447
  continue
441
- try:
442
- output, _logs = runtime.call(read_smi, (), {})
443
448
  except LetifyError as exc:
444
449
  row["reason"] = str(exc)
445
450
  continue
@@ -87,6 +87,11 @@ class Provider(abc.ABC):
87
87
  #: Whether a session can outlive this process and keep billing.
88
88
  needs_lease: bool = True
89
89
 
90
+ #: Whether the runtime sees this machine's file system. True only for the local
91
+ #: provider. A call to such a provider keeps its paths as they are, with no staging
92
+ #: and no write-back. Spec "Data in place".
93
+ shares_filesystem: bool = False
94
+
90
95
  def __init__(self, config: ProviderConfig):
91
96
  self.config = config
92
97
  self.alias = config.alias
@@ -51,6 +51,10 @@ class Local(Provider):
51
51
  #: A local subprocess ends with this process and costs nothing.
52
52
  needs_lease = False
53
53
 
54
+ #: The worker is a subprocess of this machine, so a call reads and writes the user's
55
+ #: own files and nothing is staged or written back.
56
+ shares_filesystem = True
57
+
54
58
  #: The worker keeps the working directory of the process that started it.
55
59
  prepares_workspace = False
56
60
 
@@ -32,7 +32,8 @@ from pathlib import Path
32
32
  from typing import Any
33
33
 
34
34
  from .. import paths
35
- from ..errors import LetifyError, RunNotFound, UnsupportedMode
35
+ from ..errors import LetifyError, RunNotFound, RuntimeFailure, UnsupportedMode
36
+ from ..protocol import wire
36
37
  from .channel import INTERRUPT_HOOK
37
38
 
38
39
  #: Characters of a run id: 12 lowercase hexadecimal digits.
@@ -51,6 +52,10 @@ INTERRUPT_WAIT_S = 10.0
51
52
  #: Seconds ``exec`` waits for the answer when the command names none.
52
53
  EXEC_WAIT_S = 60.0
53
54
 
55
+ #: How long ``letify utilization`` waits for a run to print its card readings, so that an
56
+ #: editor polling every 10 s never hangs behind a run that does not answer.
57
+ UTILIZATION_WAIT_S = 10.0
58
+
54
59
  #: Seconds a takeover waits for the owning process to let go of a run. Spec "Taking over a
55
60
  #: running call": an owner that does not answer in this time is treated as gone.
56
61
  RELEASE_WAIT_S = 5.0
@@ -72,7 +77,8 @@ def socket_path(pid: int) -> Path:
72
77
  Spec "Controlling a running call": ``runs/<pid>.sock`` when that fits, else
73
78
  ``run-<pid>.sock`` in the SSH control directory, else ``run-<h>-<pid>.sock`` in a
74
79
  private per-user directory below the system temporary directory, where ``<h>`` hashes
75
- the preferred path so two state roots never share a name.
80
+ the preferred path so two state roots never share a name. When that path is also too long
81
+ the preferred path is returned, and the caller reaches it through ``wire.unix_address``.
76
82
  """
77
83
  preferred = runs_directory() / f"{pid}.sock"
78
84
  if len(os.fsencode(preferred)) <= SOCKET_LIMIT:
@@ -82,7 +88,8 @@ def socket_path(pid: int) -> Path:
82
88
  return shared
83
89
  digest = hashlib.sha256(os.fsencode(preferred)).hexdigest()[:12]
84
90
  name = f"run-{digest}-{pid}.sock"
85
- return Path(tempfile.gettempdir()) / f"letify-{os.getuid()}" / name
91
+ private = Path(tempfile.gettempdir()) / f"letify-{os.getuid()}" / name
92
+ return private if len(os.fsencode(private)) <= SOCKET_LIMIT else preferred
86
93
 
87
94
 
88
95
  def _private_directory(directory: Path) -> None:
@@ -151,6 +158,7 @@ class Run:
151
158
  "function": self.function,
152
159
  "runtime": str(getattr(self.runtime, "name", "")),
153
160
  "provider": self.provider,
161
+ "accelerator": getattr(getattr(self.runtime, "instance", None), "accelerator", None),
154
162
  "started_at": self.started_at,
155
163
  "pid": os.getpid(),
156
164
  "socket": str(socket_file) if socket_file is not None else None,
@@ -334,13 +342,18 @@ class _Server:
334
342
  with contextlib.suppress(FileNotFoundError):
335
343
  self.path.unlink()
336
344
  self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
345
+ descriptor = None
337
346
  try:
338
- self.socket.bind(str(self.path))
347
+ address, descriptor = wire.unix_address(str(self.path))
348
+ self.socket.bind(address)
339
349
  self.path.chmod(0o600)
340
350
  self.socket.listen(8)
341
351
  except OSError:
342
352
  self.socket.close()
343
353
  raise
354
+ finally:
355
+ if descriptor is not None:
356
+ os.close(descriptor)
344
357
  threading.Thread(target=self._accept, name="letify-control", daemon=True).start()
345
358
  atexit.register(self.close)
346
359
 
@@ -537,14 +550,54 @@ def ask(run: str, command: dict[str, Any], *, wait: float = EXEC_WAIT_S + 30) ->
537
550
  return {"ok": False, "type": "RuntimeFailure", "error": f"run {run} has no control socket"}
538
551
  client = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
539
552
  client.settimeout(wait)
553
+ descriptor = None
540
554
  try:
541
- client.connect(row["socket"])
555
+ address, descriptor = wire.unix_address(row["socket"])
556
+ client.connect(address)
542
557
  client.sendall(json.dumps({**command, "run": run}).encode("utf-8") + b"\n")
543
558
  answer = json.loads(_read_line(client))
544
559
  except (OSError, ValueError) as exc:
545
560
  return {"ok": False, "type": "RuntimeFailure", "error": f"run {run}: {exc}"}
546
561
  finally:
547
562
  client.close()
563
+ if descriptor is not None:
564
+ os.close(descriptor)
548
565
  if answer.get("type") == "RunNotFound":
549
566
  raise RunNotFound(f"no run {run} is live on this machine")
550
567
  return answer # type: ignore[no-any-return]
568
+
569
+
570
+ def read_session_smi(alias: str, accelerator: str) -> str:
571
+ """The nvidia-smi text of the session a live run of another process holds.
572
+
573
+ Picks the first live run whose ``provider`` and ``accelerator`` match, since runs of
574
+ one session share its cards, and runs the reader through that run's control socket with
575
+ the ``exec`` command. Opens no channel and starts no session. Raises ``RunNotFound``
576
+ when no live run matches, and ``RuntimeFailure`` with the reason when the run does not
577
+ answer within ``UTILIZATION_WAIT_S`` or the source fails there.
578
+ """
579
+ from .telemetry import smi_source
580
+
581
+ run = next(
582
+ (
583
+ row["run"]
584
+ for row in list_runs()
585
+ if row.get("provider") == alias and row.get("accelerator") == accelerator
586
+ ),
587
+ None,
588
+ )
589
+ if run is None:
590
+ raise RunNotFound(f"no live run holds a session of {alias} on {accelerator}")
591
+ wait = UTILIZATION_WAIT_S
592
+ try:
593
+ answer = ask(
594
+ run,
595
+ {"cmd": "exec", "source": smi_source(wait * 0.8), "timeout": wait},
596
+ wait=wait + 2,
597
+ )
598
+ except LetifyError as exc:
599
+ raise RuntimeFailure(str(exc)) from exc
600
+ if not answer.get("ok") or answer.get("error"):
601
+ reason = answer.get("error") or answer.get("reason") or "the run did not answer"
602
+ raise RuntimeFailure(str(reason).strip().splitlines()[-1] if reason else "failed")
603
+ return str(answer.get("stdout") or "")
@@ -504,7 +504,7 @@ class Runtime:
504
504
  root = (self.workspace or self.provider.workspace_root).rstrip("/")
505
505
  call_dir = f"{root}/data/calls/{secrets.token_hex(8)}"
506
506
  modules_root = f"{root}/modules"
507
- collector = pathdata.Collector(call_dir)
507
+ collector = pathdata.Collector(call_dir, in_place=self.provider.shares_filesystem)
508
508
  ship_digests: set[str] = set()
509
509
  if self.env.ship_modules:
510
510
  for name in self.env.ship_modules:
@@ -341,3 +341,19 @@ __all__ = [
341
341
  "read_machine",
342
342
  "read_smi",
343
343
  ]
344
+
345
+
346
+ def smi_source(timeout: float) -> str:
347
+ """Source that prints the same nvidia-smi query ``read_smi`` makes, for ``exec``.
348
+
349
+ A run of another process is reached through its control socket, which takes source and
350
+ returns what it printed. ``timeout`` bounds the query so it ends before the caller gives
351
+ up.
352
+ """
353
+ return (
354
+ "import shutil, subprocess\n"
355
+ "if shutil.which('nvidia-smi'):\n"
356
+ f" r = subprocess.run({list(SMI_COMMAND)!r}, capture_output=True, text=True, "
357
+ f"timeout={timeout!r})\n"
358
+ " print(r.stdout if r.returncode == 0 else '', end='')\n"
359
+ )
@@ -318,8 +318,11 @@ def collect_module(
318
318
  class Collector:
319
319
  """Replaces local data paths in a pickled call with their runtime paths."""
320
320
 
321
- def __init__(self, call_dir: str) -> None:
321
+ def __init__(self, call_dir: str, in_place: bool = False) -> None:
322
322
  self.call_dir = call_dir
323
+ #: True when the runtime shares this file system: no path is data, each one is
324
+ #: pickled as it was passed. Spec "Data in place".
325
+ self.in_place = in_place
323
326
  self.placed: dict[str, Placed] = {}
324
327
  self._rejected: set[str] = set()
325
328
  self._roots: tuple[Path, list[Path]] | None = None
@@ -346,6 +349,8 @@ class Collector:
346
349
  return pathlib.Path, (placed.runtime,)
347
350
 
348
351
  def _place(self, text: str) -> Placed | None:
352
+ if self.in_place:
353
+ return None
349
354
  try:
350
355
  resolved = Path(text).resolve()
351
356
  except (OSError, RuntimeError, ValueError):
@@ -138,11 +138,11 @@ dependencies = [
138
138
 
139
139
  [[package]]
140
140
  name = "letify"
141
- version = "2.10.8"
141
+ version = "2.10.10"
142
142
 
143
143
  [[package]]
144
144
  name = "letify-quic"
145
- version = "2.10.8"
145
+ version = "2.10.10"
146
146
  dependencies = [
147
147
  "quinn",
148
148
  "rcgen",
@@ -8,7 +8,7 @@ resolver = "3"
8
8
  members = ["letify", "letify-quic"]
9
9
 
10
10
  [workspace.package]
11
- version = "2.10.8"
11
+ version = "2.10.10"
12
12
  edition = "2024"
13
13
  license = "MIT"
14
14
  repository = "https://github.com/DarkPyonix/letify"
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "letify-status",
3
- "version": "2.10.8",
3
+ "version": "2.10.10",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "letify-status",
9
- "version": "2.10.8",
9
+ "version": "2.10.10",
10
10
  "license": "SEE LICENSE IN LICENSE",
11
11
  "devDependencies": {
12
12
  "@types/node": "^18.19.0",
@@ -2,7 +2,7 @@
2
2
  "name": "letify-status",
3
3
  "displayName": "letify Status",
4
4
  "description": "letify quota and GPU activity in the status bar, read from the letify CLI.",
5
- "version": "2.10.8",
5
+ "version": "2.10.10",
6
6
  "publisher": "darkpyonix",
7
7
  "license": "SEE LICENSE IN LICENSE",
8
8
  "repository": {
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "letify"
3
- version = "2.10.8"
3
+ version = "2.10.10"
4
4
  description = "Declarations that become infrastructure."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -102,6 +102,18 @@ def provider_of(cls, alias: str = "p", **options: Any):
102
102
  return cls(ProviderConfig(alias, cls.kind, dict(options), 0))
103
103
 
104
104
 
105
+ @pytest.fixture
106
+ def staging_local(monkeypatch) -> None:
107
+ """Make Local stage a call's data the way every remote provider does.
108
+
109
+ The real Local shares this machine's file system and passes paths through, spec "Data
110
+ in place". The staging path (call directory, blob cache placement, upload, write-back)
111
+ is what a remote runtime runs, and the Local worker is the cheapest real runtime to
112
+ exercise it on, so the tests of that path ask for this fixture.
113
+ """
114
+ monkeypatch.setattr(Local, "shares_filesystem", False)
115
+
116
+
105
117
  class LeasingLocal(Local):
106
118
  """A local provider whose session is treated as able to outlive this process.
107
119
 
@@ -21,6 +21,9 @@ import pytest
21
21
  import letify
22
22
  from letify.store import pathdata
23
23
 
24
+ #: Every test here pins the staging a remote runtime performs, so Local must stage.
25
+ pytestmark = pytest.mark.usefixtures("staging_local")
26
+
24
27
  #: A module global a declared body reads, set per test.
25
28
  DATASET: Path | None = None
26
29
 
@@ -0,0 +1,173 @@
1
+ """A provider that shares this machine's file system leaves a call's data in place.
2
+
3
+ Spec section pinned here: "Data in place" of "Project data".
4
+
5
+ Everything runs through the Local provider and the real framed worker, whose runtime is this
6
+ machine. The staging that other providers perform is pinned in test_data.py and
7
+ test_data_streaming.py, which run it through the staging_local fixture.
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ import os
13
+ import signal
14
+ import subprocess
15
+ import sys
16
+ import textwrap
17
+ import threading
18
+ import time
19
+ from pathlib import Path
20
+
21
+ import pytest
22
+
23
+ import letify
24
+
25
+
26
+ @pytest.fixture
27
+ def project(tmp_path: Path, monkeypatch) -> Path:
28
+ home = tmp_path / "home"
29
+ home.mkdir()
30
+ monkeypatch.setenv("HOME", str(home))
31
+ monkeypatch.setattr(Path, "home", classmethod(lambda cls: home))
32
+ root = tmp_path / "study"
33
+ root.mkdir()
34
+ (root / "pyproject.toml").write_text("[project]\nname = 'study'\n", encoding="utf-8")
35
+ monkeypatch.chdir(root)
36
+ return root
37
+
38
+
39
+ def call_directories(home: Path) -> list[Path]:
40
+ calls = home / ".letify" / "runtime" / "data" / "calls"
41
+ return sorted(calls.iterdir()) if calls.is_dir() else []
42
+
43
+
44
+ def wait_for(path: Path, seconds: float = 30.0) -> None:
45
+ deadline = time.monotonic() + seconds
46
+ while not path.exists():
47
+ assert time.monotonic() < deadline, f"{path} never appeared"
48
+ time.sleep(0.02)
49
+
50
+
51
+ def test_a_local_call_writes_its_output_straight_into_the_project_path(
52
+ let, cpu, project
53
+ ) -> None:
54
+ out = project / "runs" / "exp1"
55
+ release = project / "release"
56
+
57
+ @let.function(device=cpu, host=letify.remote)
58
+ def train(target: Path, gate: str) -> str:
59
+ target.mkdir(parents=True, exist_ok=True)
60
+ (target / "model.pt").write_bytes(b"checkpoint")
61
+ import os
62
+ import time
63
+
64
+ while not os.path.exists(gate):
65
+ time.sleep(0.02)
66
+ return str(target)
67
+
68
+ result: list[str] = []
69
+ caller = threading.Thread(target=lambda: result.append(train(out, str(release))))
70
+ caller.start()
71
+ try:
72
+ # The call has not returned, so no final write-back could have put this here.
73
+ wait_for(out / "model.pt")
74
+ assert (out / "model.pt").read_bytes() == b"checkpoint"
75
+ assert caller.is_alive()
76
+ finally:
77
+ release.write_text("go", encoding="utf-8")
78
+ caller.join(30)
79
+ assert result == [str(out)]
80
+
81
+
82
+ def test_a_local_body_sees_the_path_the_caller_passed(let, cpu, project) -> None:
83
+ data = project / "data.txt"
84
+ data.write_text("hello", encoding="utf-8")
85
+
86
+ @let.function(device=cpu, host=letify.remote)
87
+ def where(path: Path) -> tuple[str, str]:
88
+ return str(path), path.read_text(encoding="utf-8")
89
+
90
+ assert where(data) == (str(data), "hello")
91
+
92
+
93
+ def test_a_local_call_creates_no_call_directory_and_sends_no_data(
94
+ let, cpu, project, capsys, tmp_path
95
+ ) -> None:
96
+ data = project / "data.txt"
97
+ data.write_text("hello", encoding="utf-8")
98
+ out = project / "out"
99
+
100
+ @let.function(device=cpu, host=letify.remote)
101
+ def work(src: Path, dst: Path) -> None:
102
+ dst.mkdir()
103
+ (dst / "copy.txt").write_text(src.read_text(encoding="utf-8"), encoding="utf-8")
104
+
105
+ work(data, out)
106
+ assert (out / "copy.txt").read_text(encoding="utf-8") == "hello"
107
+ assert call_directories(tmp_path / "home") == []
108
+ assert "letify: data" not in capsys.readouterr().err
109
+
110
+
111
+ def test_a_local_call_that_raises_keeps_what_it_wrote(let, cpu, project) -> None:
112
+ out = project / "partial.txt"
113
+
114
+ @let.function(device=cpu, host=letify.remote, retries=0)
115
+ def fail(target: Path) -> None:
116
+ target.write_text("half done", encoding="utf-8")
117
+ raise RuntimeError("boom")
118
+
119
+ with pytest.raises(Exception, match="boom"):
120
+ fail(out)
121
+ assert out.read_text(encoding="utf-8") == "half done"
122
+
123
+
124
+ def test_a_local_call_stopped_by_a_signal_keeps_what_it_wrote(project, tmp_path) -> None:
125
+ out = project / "ckpt.txt"
126
+ ready = project / "ready"
127
+ script = tmp_path / "driver.py"
128
+ script.write_text(
129
+ textwrap.dedent(
130
+ """
131
+ import sys
132
+ from pathlib import Path
133
+ import letify
134
+
135
+ let = letify.Launcher(Path(sys.argv[1]) / ".letify", home=False, announce=False)
136
+ cpu = let.providers.local.CPU
137
+
138
+ @let.function(device=cpu, host=letify.remote)
139
+ def train(target: Path, ready: Path) -> None:
140
+ import time
141
+ target.write_text("saved", encoding="utf-8")
142
+ ready.write_text("go", encoding="utf-8")
143
+ time.sleep(120)
144
+
145
+ train(Path(sys.argv[2]), Path(sys.argv[3]))
146
+ """
147
+ ),
148
+ encoding="utf-8",
149
+ )
150
+ env = dict(os.environ, HOME=os.environ["HOME"])
151
+ proc = subprocess.Popen(
152
+ [sys.executable, "-I", str(script), str(project), str(out), str(ready)],
153
+ cwd=project, env=env,
154
+ )
155
+ try:
156
+ wait_for(ready)
157
+ proc.send_signal(signal.SIGTERM)
158
+ proc.wait(30)
159
+ finally:
160
+ if proc.poll() is None:
161
+ proc.kill()
162
+ assert out.read_text(encoding="utf-8") == "saved"
163
+
164
+
165
+ def test_a_local_call_does_not_apply_the_data_root_refusal(let, cpu, project, tmp_path) -> None:
166
+ outside = tmp_path / "elsewhere.txt"
167
+ outside.write_text("still readable", encoding="utf-8")
168
+
169
+ @let.function(device=cpu, host=letify.remote)
170
+ def read(path: Path) -> str:
171
+ return path.read_text(encoding="utf-8")
172
+
173
+ assert read(outside) == "still readable"