lcode-cli 0.56.0__tar.gz → 0.58.0__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 (234) hide show
  1. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/CHANGELOG.md +34 -1
  2. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/PKG-INFO +1 -1
  3. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/bench.md +96 -43
  4. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/quickstart.md +1 -1
  5. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/search.md +1 -1
  6. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/__init__.py +1 -1
  7. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/bench.py +154 -50
  8. lcode_cli-0.58.0/src/lcode/bench_budgets.py +442 -0
  9. lcode_cli-0.58.0/src/lcode/bench_dedupe.py +285 -0
  10. lcode_cli-0.58.0/src/lcode/bench_flaky.py +291 -0
  11. lcode_cli-0.58.0/src/lcode/bench_logsum.py +317 -0
  12. lcode_cli-0.58.0/src/lcode/bench_quotes.py +760 -0
  13. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/cli.py +30 -7
  14. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_bench.py +198 -1
  15. lcode_cli-0.58.0/tests/test_bench_work.py +424 -0
  16. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/.editorconfig +0 -0
  17. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/.github/CODEOWNERS +0 -0
  18. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  19. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  20. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  21. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/.github/ISSUE_TEMPLATE/model_request.yml +0 -0
  22. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  23. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/.github/dependabot.yml +0 -0
  24. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/.github/workflows/ci.yml +0 -0
  25. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/.github/workflows/docs.yml +0 -0
  26. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/.github/workflows/release.yml +0 -0
  27. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/.gitignore +0 -0
  28. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/.pre-commit-config.yaml +0 -0
  29. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/AGENTS.md +0 -0
  30. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/CODE_OF_CONDUCT.md +0 -0
  31. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/CONTRIBUTING.md +0 -0
  32. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/LICENSE +0 -0
  33. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/README.md +0 -0
  34. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/SECURITY.md +0 -0
  35. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/action.yml +0 -0
  36. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/agents.md +0 -0
  37. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/assets/demo.svg +0 -0
  38. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/assets/extra.css +0 -0
  39. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/assets/film-fox-and-kitten.jpg +0 -0
  40. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/assets/long-clip-tulip.jpg +0 -0
  41. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/automation.md +0 -0
  42. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/changelog.md +0 -0
  43. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/commands.md +0 -0
  44. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/configuration.md +0 -0
  45. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/contributing.md +0 -0
  46. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/editors.md +0 -0
  47. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/git.md +0 -0
  48. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/hooks.md +0 -0
  49. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/how-it-works.md +0 -0
  50. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/index.md +0 -0
  51. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/installation.md +0 -0
  52. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/lsp.md +0 -0
  53. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/mcp.md +0 -0
  54. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/memory.md +0 -0
  55. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/models.md +0 -0
  56. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/modes.md +0 -0
  57. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/public-benchmarks.md +0 -0
  58. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/sandbox.md +0 -0
  59. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/servers.md +0 -0
  60. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/traces.md +0 -0
  61. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/troubleshooting.md +0 -0
  62. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/docs/usage.md +0 -0
  63. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/examples/README.md +0 -0
  64. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/examples/api/fix_tests.py +0 -0
  65. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/examples/commands/review.md +0 -0
  66. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/examples/skills/commit-message/SKILL.md +0 -0
  67. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/examples/skills/commit-message/scripts/staged.sh +0 -0
  68. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/install.sh +0 -0
  69. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/mkdocs.yml +0 -0
  70. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/overrides/main.html +0 -0
  71. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/pyproject.toml +0 -0
  72. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/scripts/make_logos.py +0 -0
  73. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/scripts/record_demo.py +0 -0
  74. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/scripts/social-preview.html +0 -0
  75. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/__main__.py +0 -0
  76. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/acp.py +0 -0
  77. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/action.py +0 -0
  78. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/agent.py +0 -0
  79. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/api.py +0 -0
  80. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/assistant.py +0 -0
  81. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/backends.py +0 -0
  82. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/bench_backend.py +0 -0
  83. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/bench_runtime.py +0 -0
  84. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/catalog.py +0 -0
  85. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/checkpoints.py +0 -0
  86. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/checks.py +0 -0
  87. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/clipboard.py +0 -0
  88. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/cloud.py +0 -0
  89. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/codesearch.py +0 -0
  90. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/comfy.py +0 -0
  91. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/config.py +0 -0
  92. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/context.py +0 -0
  93. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/edits.py +0 -0
  94. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/escalate.py +0 -0
  95. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/extensions.py +0 -0
  96. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/film.py +0 -0
  97. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/frontmatter.py +0 -0
  98. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/gitflow.py +0 -0
  99. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/harbor.py +0 -0
  100. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/harbor_bench.py +0 -0
  101. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/hardware.py +0 -0
  102. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/hooks.py +0 -0
  103. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/imageopts.py +0 -0
  104. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/jobs.py +0 -0
  105. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/limits.py +0 -0
  106. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/lsp.py +0 -0
  107. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/manual.py +0 -0
  108. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/matching.py +0 -0
  109. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/mcp/__init__.py +0 -0
  110. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/mcp/auth.py +0 -0
  111. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/mcp/catalog.py +0 -0
  112. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/mcp/catalog.toml +0 -0
  113. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/mcp/client.py +0 -0
  114. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/mcp/commands.py +0 -0
  115. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/mcp/config.py +0 -0
  116. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/mcp/http.py +0 -0
  117. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/mcp/manager.py +0 -0
  118. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/mcp/protocol.py +0 -0
  119. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/mcp/server.py +0 -0
  120. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/mcp/stdio.py +0 -0
  121. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/media.py +0 -0
  122. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/media.toml +0 -0
  123. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/media_catalog.py +0 -0
  124. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/media_cloud.py +0 -0
  125. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/memory.py +0 -0
  126. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/models.toml +0 -0
  127. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/modes.py +0 -0
  128. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/notify.py +0 -0
  129. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/ollama.py +0 -0
  130. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/permissions.py +0 -0
  131. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/planning.py +0 -0
  132. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/preview.py +0 -0
  133. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/render.py +0 -0
  134. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/repeats.py +0 -0
  135. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/repl.py +0 -0
  136. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/replay.py +0 -0
  137. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/repoid.py +0 -0
  138. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/repomap.py +0 -0
  139. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/residency.py +0 -0
  140. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/review.py +0 -0
  141. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/sandbox.py +0 -0
  142. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/screenshots.py +0 -0
  143. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/secretscan.py +0 -0
  144. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/servers/__init__.py +0 -0
  145. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/servers/encord.py +0 -0
  146. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/servers/valohai.py +0 -0
  147. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/servers/xai.py +0 -0
  148. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/sessions.py +0 -0
  149. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/steer.py +0 -0
  150. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/subagents.py +0 -0
  151. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/tools.py +0 -0
  152. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/traces.py +0 -0
  153. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/unreachable.py +0 -0
  154. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/update.py +0 -0
  155. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/vision.py +0 -0
  156. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/web.py +0 -0
  157. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/workflows/__init__.py +0 -0
  158. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/workflows/flux2-klein-4b-t2i.json +0 -0
  159. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/workflows/remove-background.json +0 -0
  160. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/workflows/smooth-film.json +0 -0
  161. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/workflows/sound-stable-audio.json +0 -0
  162. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/workflows/upscale-esrgan.json +0 -0
  163. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/workflows/upscale-video-esrgan.json +0 -0
  164. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/workflows/wan21-fun-camera.json +0 -0
  165. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/workflows/wan21-vace.json +0 -0
  166. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/workflows/wan22-fun-inp-5b.json +0 -0
  167. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/workflows/wan22-ti2v-5b.json +0 -0
  168. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/src/lcode/workflows/z-image-turbo-t2i.json +0 -0
  169. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/comfy_standin.py +0 -0
  170. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/conftest.py +0 -0
  171. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/fake_lsp_server.py +0 -0
  172. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/fake_mcp_server.py +0 -0
  173. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_acp.py +0 -0
  174. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_action.py +0 -0
  175. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_agent.py +0 -0
  176. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_api.py +0 -0
  177. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_assistant.py +0 -0
  178. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_backends.py +0 -0
  179. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_catalog.py +0 -0
  180. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_checkpoints.py +0 -0
  181. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_checks.py +0 -0
  182. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_cli.py +0 -0
  183. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_clipboard.py +0 -0
  184. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_cloud.py +0 -0
  185. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_codesearch.py +0 -0
  186. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_comfy.py +0 -0
  187. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_config.py +0 -0
  188. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_context.py +0 -0
  189. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_context_picker.py +0 -0
  190. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_conversations.py +0 -0
  191. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_escalate.py +0 -0
  192. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_extensions.py +0 -0
  193. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_film.py +0 -0
  194. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_gitflow.py +0 -0
  195. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_gpu_handover.py +0 -0
  196. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_harbor_bench.py +0 -0
  197. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_hooks.py +0 -0
  198. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_image_edit.py +0 -0
  199. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_image_generate.py +0 -0
  200. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_jobs.py +0 -0
  201. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_long_clips.py +0 -0
  202. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_look.py +0 -0
  203. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_lsp.py +0 -0
  204. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_manual.py +0 -0
  205. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_matching.py +0 -0
  206. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_mcp.py +0 -0
  207. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_media_catalog.py +0 -0
  208. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_media_cloud.py +0 -0
  209. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_memory.py +0 -0
  210. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_model_picker.py +0 -0
  211. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_modes.py +0 -0
  212. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_permissions.py +0 -0
  213. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_plan_mode.py +0 -0
  214. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_repeats.py +0 -0
  215. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_repomap.py +0 -0
  216. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_residency.py +0 -0
  217. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_review.py +0 -0
  218. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_robustness.py +0 -0
  219. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_sandbox.py +0 -0
  220. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_screenshots.py +0 -0
  221. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_secretscan.py +0 -0
  222. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_servers.py +0 -0
  223. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_sessions.py +0 -0
  224. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_steer.py +0 -0
  225. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_stuck.py +0 -0
  226. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_subagents.py +0 -0
  227. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_tools.py +0 -0
  228. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_traces.py +0 -0
  229. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_update.py +0 -0
  230. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_video.py +0 -0
  231. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_vision.py +0 -0
  232. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_web.py +0 -0
  233. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/tests/test_xai.py +0 -0
  234. {lcode_cli-0.56.0 → lcode_cli-0.58.0}/uv.lock +0 -0
@@ -6,6 +6,37 @@ All notable changes to lcode are documented here. The format follows
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.58.0] - 2026-11-02
10
+
11
+ ### Added
12
+
13
+ - **Six longer tasks in `lcode bench`** (#199), closer to real work, after the eight quick ones:
14
+ a command-line tool built from a spec (`cli-tool`), a test that fails now and then (`flaky-test`),
15
+ a bug reported only by its symptom in a 47-file repository (`repo-bug`), a feature across modules
16
+ with older data files still working (`wide-feature`), a slow job made fast with the same output
17
+ (`fast-dedupe`), and a bug that shows only when the code runs (`runtime-bug`, until now only with
18
+ `--tasks`). Each check runs on data or tests the model never saw. With
19
+ qwen3.6-35b at 32K on a 12 GB laptop GPU, 14 of 18 attempts passed: none at `runtime-bug`, and 2
20
+ of 3 at `fast-dedupe`, where after lcode made room in the context the model lost track and
21
+ repeated itself until the loop breaker stopped it.
22
+ - `lcode bench --quick` runs only the eight quick tasks, once each, as `lcode bench` did before 0.57.
23
+
24
+ ### Changed
25
+
26
+ - In `lcode bench`, the longer tasks stop after 10 minutes and the quick ones after 5. `--timeout`
27
+ sets one limit for all.
28
+
29
+ ## [0.57.0] - 2026-11-02
30
+
31
+ ### Changed
32
+
33
+ - **`lcode bench` makes three attempts at each task** (#199), each in a new folder and conversation,
34
+ and reports pass@1, pass^3 and how many tasks passed in each attempt, counted as in the public
35
+ benchmarks. One run of each task was within the noise between runs. `--attempts 1` runs each task
36
+ once, as before, in a third of the time. In the summary, a task's time is per attempt, on average.
37
+ The JSON adds `attempts`, `summary` and each task's `attempt`. Without `--session`, `--rounds` is
38
+ another name for `--attempts`.
39
+
9
40
  ## [0.56.0] - 2026-11-02
10
41
 
11
42
  ### Added
@@ -1211,7 +1242,9 @@ First public release.
1211
1242
  - `AGENTS.md` project instructions and `/init` to generate them.
1212
1243
  - One-line installer for Linux and macOS.
1213
1244
 
1214
- [Unreleased]: https://github.com/nasser1941/lcode/compare/v0.56.0...HEAD
1245
+ [Unreleased]: https://github.com/nasser1941/lcode/compare/v0.58.0...HEAD
1246
+ [0.58.0]: https://github.com/nasser1941/lcode/compare/v0.57.0...v0.58.0
1247
+ [0.57.0]: https://github.com/nasser1941/lcode/compare/v0.56.0...v0.57.0
1215
1248
  [0.56.0]: https://github.com/nasser1941/lcode/compare/v0.55.0...v0.56.0
1216
1249
  [0.55.0]: https://github.com/nasser1941/lcode/compare/v0.54.0...v0.55.0
1217
1250
  [0.54.0]: https://github.com/nasser1941/lcode/compare/v0.53.0...v0.54.0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: lcode-cli
3
- Version: 0.56.0
3
+ Version: 0.58.0
4
4
  Summary: A local-first terminal coding agent powered by open-weight models on your own GPU or Mac, via Ollama.
5
5
  Project-URL: Homepage, https://nasser1941.github.io/lcode/
6
6
  Project-URL: Documentation, https://nasser1941.github.io/lcode/
@@ -1,8 +1,8 @@
1
1
  # Benchmarking models
2
2
 
3
3
  `lcode bench` answers the most common question about local models: *which one works best for
4
- coding on my machine?* It runs a fixed set of small coding tasks against one or more models and
5
- reports how many they solved, how fast they ran and how much memory they used.
4
+ coding on my machine?* It runs a fixed set of coding tasks against one or more models, three times
5
+ each, and reports how many they solved, how fast they ran and how much memory they used.
6
6
 
7
7
  To compare with other agents on public benchmarks (Terminal-Bench 2.0 and SWE-bench Verified),
8
8
  see [Public benchmarks](public-benchmarks.md).
@@ -11,6 +11,8 @@ see [Public benchmarks](public-benchmarks.md).
11
11
  lcode bench # the configured model
12
12
  lcode bench qwen3.6-35b qwen3.5-9b # compare models
13
13
  lcode bench --tasks fix-bug,rename # run some of the tasks
14
+ lcode bench --quick # only the eight quick tasks, once each
15
+ lcode bench --attempts 1 # each task once: quicker, but within the noise
14
16
  lcode bench --json results.json # also save machine-readable results
15
17
  lcode bench --markdown # also print a table to paste into a test report
16
18
  ```
@@ -20,33 +22,52 @@ Studio: `LCODE_BACKEND=llama.cpp lcode bench`. The server keeps the model loaded
20
22
  its memory use, so those columns stay empty.
21
23
 
22
24
  ```text
23
- lcode bench · NVIDIA GeForce RTX 4080 Laptop GPU (12 GB VRAM), 31 GB RAM · Ollama 0.32.15
25
+ lcode bench · NVIDIA GeForce RTX 4080 Laptop GPU (12 GB VRAM), 31 GB RAM · Ollama 0.40.13
24
26
 
25
- lcode-qwen3.6-35b · 32K context · reasoning on · 8 tasks
26
- Loaded in 16s · 22.3 GB, 45% on the GPU · reads prompts at 855 tok/s
27
+ lcode-qwen3.6-35b · 32K context · reasoning on · 8 tasks · 3 attempts each
28
+ Loaded in 18s · 10.4 GB, 98% on the GPU · reads prompts at 905 tok/s
29
+ Attempt 1 of 3
27
30
  ✓ fix-bug Fix a bug so the tests pass 22s the tests pass
28
- ✓ find-code Answer with file:line 9s next_wait at backoff.py:13
29
- ✓ write-script Write a script from a spec 13s correct output, also on data it hadn't seen
30
- ✓ rename Rename a function across files 26s its tests and extra checks pass
31
+ ✓ find-code Answer with file:line 8s next_wait at backoff.py:13
32
+ ✓ write-script Write a script from a spec 12s correct output, also on data it hadn't seen
33
+ ✓ rename Rename a function across files 22s its tests and extra checks pass
31
34
  ✓ precise-edit One-line edit in a long file 10s changed only service_087's timeout
32
- ✓ recover Recover from failing commands 30s used --source and dropped the invalid line
33
- ✓ spec-fix Fix a function to match its spec 55s follows the whole docstring
34
- ✓ feature Add a feature across files 71s priorities work, including old todos
35
+ ✓ recover Recover from failing commands 22s used --source and dropped the invalid line
36
+ ✓ spec-fix Fix a function to match its spec 78s follows the whole docstring
37
+ ✓ feature Add a feature across files 86s priorities work, including old todos
38
+ Attempt 2 of 3
39
+ …
35
40
  ```
36
41
 
37
42
  At the end it prints a table comparing the models (see [results](#results-on-a-12-gb-laptop) below).
38
43
 
39
- A model usually takes 4 to 12 minutes; each task stops after 5 minutes (`--timeout`).
44
+ A model usually takes 4 to 12 minutes per attempt at the quick tasks; each stops after 5 minutes,
45
+ and the [longer tasks](#longer-tasks) after 10 (`--timeout` sets one limit for all).
46
+
47
+ ### Three attempts at each task
48
+
49
+ Models sample their answers, so a task near the edge of a model's ability can pass in one run and
50
+ fail in the next. One run of each task is within that noise, so `lcode bench` makes three attempts
51
+ at every task, each in a new folder and conversation: every task once, then every task again. The
52
+ summary adds:
53
+
54
+ | | |
55
+ |---|---|
56
+ | **pass@1** | The share of attempts that passed, averaged over the tasks: the chance that one attempt works |
57
+ | **pass^3** | The share of tasks that passed all three attempts: the ones you can count on |
58
+ | **Each attempt** | How many tasks passed in each attempt. The difference between the best and the worst is the spread between runs |
59
+
60
+ They're counted as in the [public benchmarks](public-benchmarks.md). `--attempts 1` runs each task
61
+ once, as `lcode bench` did before 0.57, in a third of the time; `--attempts 5` gives pass^5. In the
62
+ summary, a task's time is that of one attempt, on average, and *Time* is the total.
40
63
 
41
64
  ### More tasks and features
42
65
 
43
66
  `--tasks find-concept` adds a task in a larger repository: 40 files of a small backend where the
44
- model has to find a function by what it does. `--tasks runtime-bug` adds a bug that shows only
45
- when the code runs: a camera wall's window grows taller with every video frame and can't be made
46
- smaller again. Reading the code suggests band-aids that fail the hidden test; running it shows the
47
- cause. Neither is in the default set, so results stay comparable with earlier versions. `--repo-map` gives the model the [repository map](search.md) and
48
- `--code-search` indexes each task's folder for [semantic search](search.md#semantic-code-search);
49
- both are off in `lcode bench` by default, for the same reason.
67
+ model has to find a function by what it does. It's there to measure `--repo-map`, which gives the
68
+ model the [repository map](search.md), and `--code-search`, which indexes each task's folder for
69
+ [semantic search](search.md#semantic-code-search). Both are off in `lcode bench` by default, so
70
+ results compare across machines and versions.
50
71
 
51
72
  ### A second try, and a stronger model
52
73
 
@@ -57,8 +78,8 @@ would: no questions asked, since the flag is your OK. Comparing the two shows wh
57
78
  model's advice adds to the same second chance:
58
79
 
59
80
  ```bash
60
- lcode bench --tasks runtime-bug --retry --rounds 3
61
- lcode bench --tasks runtime-bug --retry --rounds 3 --escalate ollama/qwen3.8-27b
81
+ lcode bench --tasks runtime-bug --retry --attempts 3
82
+ lcode bench --tasks runtime-bug --retry --attempts 3 --escalate ollama/qwen3.8-27b
62
83
  ```
63
84
 
64
85
  The JSON report has, for each task, `first_passed` (with `--retry`, whether the first try passed)
@@ -77,7 +98,8 @@ lcode bench --context 32k --session --rounds 3
77
98
  lcode bench --context 32k --session --rounds 3 --no-prune
78
99
  ```
79
100
 
80
- `--rounds 3` runs the tasks three times, 24 in one conversation, which fills a 32K window several
101
+ With `--session`, an attempt is one conversation, and `--attempts` is 1 unless you set it. `--rounds 3`
102
+ runs the tasks three times in it, 24 in one conversation, which fills a 32K window several
81
103
  times over. With qwen3.6-35b on a 12 GB laptop (two runs each; runs vary a lot from one to the
82
104
  next):
83
105
 
@@ -110,6 +132,8 @@ Every task runs in a new temporary folder, with every permission granted (`yolo`
110
132
  access off, and ends with an automatic check. The folders are deleted afterwards unless you pass
111
133
  `--keep`, which also keeps each task's transcript (`lcode-bench.log`).
112
134
 
135
+ ### Quick tasks
136
+
113
137
  | Task | The model has to | Passes when |
114
138
  |---|---|---|
115
139
  | `fix-bug` | Find and fix a bug so the failing unit tests pass | The tests pass and the test file is unchanged |
@@ -126,12 +150,35 @@ reading and are where smaller models tend to slip. The checks are deterministic
126
150
  by hard-coding: for example, `write-script` reruns the script on new data, and `rename`, `spec-fix`
127
151
  and `feature` are checked with tests the model never saw.
128
152
 
153
+ ### Longer tasks
154
+
155
+ Good models now get every quick task right: qwen3.6-35b passed all 24 attempts. Four longer tasks,
156
+ closer to real work, tell good models from great ones:
157
+
158
+ | Task | The model has to | Passes when |
159
+ |---|---|---|
160
+ | `cli-tool` | Write `logsum.py`, which summarizes web server logs, from a spec: options, text and JSON output, standard input, malformed lines, unreadable files and exit codes | 14 runs on logs it never saw give the same output and exit status as a reference implementation |
161
+ | `flaky-test` | Find why a test fails in about half the runs, with the same code, and fix it without changing the tests | The original tests pass under 24 hash seeds, and so does a hidden test of the order the code promises |
162
+ | `repo-bug` | Fix a bug reported only by its symptom (a second quote gets the first one's shipping cost) in a 47-file repository, keeping its lookups cached | Hidden tests of the report, of the same cause elsewhere and of the cache pass, and so do the repository's own tests |
163
+ | `wide-feature` | Add monthly budgets to an expense tracker: a new command, the report in text and JSON, and the data file, with older data files still working | Its tests pass, and a scripted session from an older data file gives exactly the expected output |
164
+ | `fast-dedupe` | Make a job that merges duplicate customer records fast, from hours to seconds for 200,000 records, without changing its output | On 60,000 records it never saw, it finishes within a minute and its output is the old job's, byte for byte |
165
+ | `runtime-bug` | Fix a camera wall whose window grows taller with every video frame and can't be made smaller again. Reading the code suggests band-aids; running it shows the cause | A hidden test: the window keeps its size, can be made smaller, and the video fits its cell |
166
+
167
+ qwen3.6-35b at 32K passed 14 of the 18 attempts: all of them at the first four, 2 of 3 at
168
+ `fast-dedupe` (in the third, after lcode made room in the context, the model lost track and repeated
169
+ itself until the loop breaker stopped it) and none at `runtime-bug`, where it settled for band-aids.
170
+
171
+ Each rewards what a careful developer does: reading the whole spec, running a flaky test more than
172
+ once, fixing the cause rather than the symptom, trying old data, and comparing the new output with
173
+ the old. The longer tasks stop after 10 minutes instead of 5. `--quick` leaves them out and runs the
174
+ quick tasks once, as `lcode bench` did before 0.57.
175
+
129
176
  ## What's measured
130
177
 
131
178
  | | |
132
179
  |---|---|
133
- | **Passed** | Tasks solved within the time limit |
134
- | **Time** | Total time for the tasks (loading the model is reported separately) |
180
+ | **Passed** | Attempts that solved their task within the time limit; with several, also pass@1, pass^3 and each attempt's ([above](#three-attempts-at-each-task)) |
181
+ | **Time** | Total time for the tasks, every attempt (loading the model is reported separately) |
135
182
  | **Generation** | Output tokens per second, across all the model's responses |
136
183
  | **Prompt reading** | Prompt tokens per second: how fast the model reads files and tool output. Measured per model with fresh 4,000-token prompts (the faster of two readings, since the first one after loading includes warm-up), because during the tasks Ollama serves most of each request from its prompt cache |
137
184
  | **Tool-call errors** | Tool calls that failed (wrong arguments, editing without reading first, unmatched edits) or that the model wrote as invalid JSON |
@@ -144,7 +191,8 @@ to measure a model without reasoning.
144
191
 
145
192
  ## Results on a 12 GB laptop
146
193
 
147
- RTX 4080 Laptop GPU (12 GB) with 31 GB of RAM, Ollama 0.32.15, 32K context, reasoning on:
194
+ RTX 4080 Laptop GPU (12 GB) with 31 GB of RAM, Ollama 0.32.15, 32K context, reasoning on, one
195
+ attempt each (lcode 0.3):
148
196
 
149
197
  | | `qwen3.6-35b` | `qwen3.5-9b` | `qwen3.5-4b` |
150
198
  |---|---|---|---|
@@ -169,8 +217,8 @@ copying `read_file`'s line numbers into a data file, ignoring negative numbers,
169
217
  of the spec, and running out of time.
170
218
 
171
219
  Models sample their answers, so a task near the edge of a model's ability can pass in one run and
172
- fail in the next (`qwen3.6-35b` scored 7/8 in an earlier run). Compare totals rather than single
173
- tasks, and run twice before drawing conclusions.
220
+ fail in the next (`qwen3.6-35b` scored 7/8 in an earlier run), which is why `lcode bench` now makes
221
+ three attempts at each task. Compare pass@1 and pass^3 rather than single tasks.
174
222
 
175
223
  ## Sharing results
176
224
 
@@ -192,10 +240,10 @@ existing fields keep their meaning until `schema` changes.
192
240
  ```json
193
241
  {
194
242
  "schema": 1,
195
- "lcode": "0.3.1",
196
- "ollama": "0.32.15",
197
- "server": "Ollama 0.32.15",
198
- "date": "2026-09-30T19:09:09+02:00",
243
+ "lcode": "0.57.0",
244
+ "ollama": "0.40.13",
245
+ "server": "Ollama 0.40.13",
246
+ "date": "2026-11-02T09:44:14+01:00",
199
247
  "hardware": {
200
248
  "os": "linux", "cpu": "13th Gen Intel(R) Core(TM) i9-13980HX", "ram_gib": 30.96,
201
249
  "gpu": "NVIDIA GeForce RTX 4080 Laptop GPU", "vram_gib": 11.99, "unified": false,
@@ -209,20 +257,22 @@ existing fields keep their meaning until `schema` changes.
209
257
  "context": 32768,
210
258
  "num_batch": null,
211
259
  "think": true,
212
- "load_seconds": 16.2,
213
- "prompt_tps": 854.6,
214
- "memory_gb": 22.3,
215
- "gpu_percent": 45,
216
- "passed": 8,
217
- "total": 8,
218
- "seconds": 237.3,
219
- "generation_tps": 71.4,
220
- "tool_errors": 0,
221
- "usage": {"requests": 56, "prompt_tokens": 221522, "prompt_ns": 73377987000,
222
- "output_tokens": 11490, "output_ns": 161017657999},
260
+ "load_seconds": 17.8,
261
+ "prompt_tps": 904.6,
262
+ "memory_gb": 10.4,
263
+ "gpu_percent": 98,
264
+ "attempts": 3,
265
+ "passed": 24,
266
+ "total": 24,
267
+ "seconds": 756.2,
268
+ "generation_tps": 72.2,
269
+ "tool_errors": 2,
270
+ "summary": {"pass_at_1": 1.0, "pass^3": 1.0, "runs": [1.0, 1.0, 1.0], "spread": 0.0},
271
+ "usage": {"requests": 184, "prompt_tokens": 1058154, "prompt_ns": 199916607993,
272
+ "output_tokens": 38683, "output_ns": 535438114998},
223
273
  "tasks": [
224
- {"id": "fix-bug", "passed": true, "seconds": 21.9, "detail": "the tests pass",
225
- "steps": 5, "tool_errors": 0, "error": null},
274
+ {"id": "fix-bug", "passed": true, "seconds": 21.5, "detail": "the tests pass",
275
+ "steps": 5, "tool_errors": 0, "error": null, "attempt": 1},
226
276
  …
227
277
  ],
228
278
  "error": null,
@@ -241,6 +291,9 @@ existing fields keep their meaning until `schema` changes.
241
291
  | `runs[].generation_tps` | Output tokens per second across the tasks; `null` if Ollama reported no timings |
242
292
  | `runs[].prompt_tps` | Prompt tokens per second for a fresh 4,000-token prompt (the faster of two readings); `null` if it couldn't be measured |
243
293
  | `runs[].usage` | Totals over the tasks as Ollama reports them. `prompt_tokens` includes tokens served from the prompt cache |
294
+ | `runs[].attempts` | Attempts at each task (`--attempts`) |
295
+ | `runs[].summary` | `pass_at_1`, `pass^3` (with the number of attempts), `runs` (each attempt's pass rate) and `spread` (the best minus the worst), counted as in the [public benchmarks](public-benchmarks.md); `null` where there's nothing to count |
296
+ | `runs[].tasks[]` | One entry per attempt at a task; `attempt` says which (1, 2, 3) |
244
297
  | `runs[].tasks[].steps` | Model responses in the task |
245
298
  | `runs[].tasks[].error` | Why the task stopped early (`timed out after 300s`, an Ollama error), otherwise `null` |
246
299
  | `runs[].error` | Why the model didn't run at all (for example, not installed), otherwise `null` |
@@ -12,7 +12,7 @@ lcode
12
12
 
13
13
  ```text
14
14
  ╭──────────────────────────────────────────────╮
15
- │ lcode v0.56.0 — local coding agent │
15
+ │ lcode v0.58.0 — local coding agent │
16
16
  │ │
17
17
  │ model lcode-qwen3.6-35b │
18
18
  │ context 256K tokens │
@@ -66,7 +66,7 @@ whether it is.
66
66
 
67
67
  ## Measured
68
68
 
69
- `lcode bench qwen3.6-35b --tasks find-code,find-concept --rounds 3` on a 12 GB laptop. `find-concept`
69
+ `lcode bench qwen3.6-35b --tasks find-code,find-concept --attempts 3` on a 12 GB laptop. `find-concept`
70
70
  asks which function computes the pause before a failed upload is sent again, in a 40-file backend
71
71
  full of look-alikes (retry policies, job requeue delays, log backoff); the right function's name and
72
72
  docstring use none of the question's words.
@@ -3,7 +3,7 @@
3
3
  From a program: `from lcode import Session` (see lcode.api).
4
4
  """
5
5
 
6
- __version__ = "0.56.0"
6
+ __version__ = "0.58.0"
7
7
 
8
8
  API = ("Session", "Result", "Options", "SetupError")
9
9
 
@@ -19,6 +19,7 @@ import subprocess
19
19
  import sys
20
20
  import tempfile
21
21
  import time
22
+ from collections import Counter
22
23
  from collections.abc import Callable, Iterator
23
24
  from contextlib import contextmanager
24
25
  from dataclasses import asdict, dataclass, field
@@ -38,6 +39,8 @@ from lcode.ollama import Ollama, OllamaError
38
39
  SCHEMA_VERSION = 1
39
40
  DEFAULT_CONTEXT = 32768 # the same everywhere, so results compare across machines
40
41
  DEFAULT_TIMEOUT = 300 # seconds per task
42
+ LONGER_TIMEOUT = 600 # for the longer tasks, which take a strong model up to five minutes
43
+ DEFAULT_ATTEMPTS = 3 # each task's attempts: one run is within the noise between runs
41
44
  CHECK_TIMEOUT = 60
42
45
  PROBE_WORDS = 3000 # about 4,000 tokens
43
46
  PROBE_TEXT = (
@@ -63,6 +66,7 @@ class Task:
63
66
  prompt: str
64
67
  files: dict[str, str]
65
68
  check: Callable[[Path, str], Check] # (task folder, the model's final answer) -> result
69
+ timeout: float = DEFAULT_TIMEOUT # seconds before it stops, unless --timeout says otherwise
66
70
 
67
71
 
68
72
  # ----------------------------------------------------------------------------- helpers for checks
@@ -745,32 +749,41 @@ TASKS = [
745
749
 
746
750
 
747
751
  def extra_tasks() -> list[Task]:
748
- """Tasks that only run when asked for with --tasks (they're slower, or test optional features)."""
749
- from lcode import bench_backend, bench_runtime
752
+ """Tasks that only run when asked for with --tasks (for optional features such as --code-search)."""
753
+ from lcode import bench_backend
754
+
755
+ return [Task("find-concept", "Find code by what it does (40 files)", *parts(bench_backend))]
756
+
757
+
758
+ def work_tasks() -> list[Task]:
759
+ """Tasks closer to real work, after the quick ones: longer, and where good models still slip."""
760
+ from lcode import bench_budgets, bench_dedupe, bench_flaky, bench_logsum, bench_quotes, bench_runtime
750
761
 
751
762
  return [
752
- Task(
753
- "find-concept",
754
- "Find code by what it does (40 files)",
755
- bench_backend.PROMPT,
756
- bench_backend.FILES,
757
- bench_backend.check,
758
- ),
759
- Task(
760
- "runtime-bug",
761
- "Fix a bug that shows only when it runs",
762
- bench_runtime.PROMPT,
763
- bench_runtime.FILES,
764
- bench_runtime.check,
765
- ),
763
+ Task("cli-tool", "Build a tool from a spec", *parts(bench_logsum), LONGER_TIMEOUT),
764
+ Task("flaky-test", "Find why a test is flaky", *parts(bench_flaky), LONGER_TIMEOUT),
765
+ Task("repo-bug", "Fix a bug in a 47-file repo", *parts(bench_quotes), LONGER_TIMEOUT),
766
+ Task("wide-feature", "Add a feature across modules", *parts(bench_budgets), LONGER_TIMEOUT),
767
+ Task("fast-dedupe", "Make a slow job fast, same output", *parts(bench_dedupe), LONGER_TIMEOUT),
768
+ Task("runtime-bug", "Fix a bug that shows only when it runs", *parts(bench_runtime), LONGER_TIMEOUT),
766
769
  ]
767
770
 
768
771
 
772
+ def parts(module) -> tuple:
773
+ """A task module's prompt, files and check."""
774
+ return module.PROMPT, module.FILES, module.check
775
+
776
+
777
+ def default_tasks() -> list[Task]:
778
+ """What `lcode bench` runs: the quick tasks, then the longer ones."""
779
+ return [*TASKS, *work_tasks()]
780
+
781
+
769
782
  def select_tasks(ids: str | None) -> list[Task]:
770
783
  if not ids:
771
- return list(TASKS)
784
+ return default_tasks()
772
785
  wanted = [i.strip() for i in ids.split(",") if i.strip()]
773
- known = {task.id: task for task in [*TASKS, *extra_tasks()]}
786
+ known = {task.id: task for task in [*default_tasks(), *extra_tasks()]}
774
787
  unknown = [i for i in wanted if i not in known]
775
788
  if unknown:
776
789
  raise ValueError(f"unknown task(s) {', '.join(unknown)}; choose from {', '.join(known)}")
@@ -792,6 +805,46 @@ class TaskResult:
792
805
  errors_by_tool: dict[str, int] = field(default_factory=dict) # which tools failed, "malformed" for unreadable calls
793
806
  first_passed: bool | None = None # with --retry: whether the first try passed (None: no retry was needed)
794
807
  escalations: int = 0 # times the stronger model was asked (--escalate)
808
+ attempt: int = 1 # which of the task's attempts this was (--attempts)
809
+
810
+
811
+ @dataclass
812
+ class PassRates:
813
+ """How often the tasks passed, as `lcode bench --harbor` counts it (lcode.harbor_bench.summarize)."""
814
+
815
+ tries: int # k: each task's tries, its attempts (times the rounds of a --session)
816
+ pass_at_1: float | None # the share of tries that passed, averaged over the tasks
817
+ pass_all: float | None # pass^k: the share of tasks that passed every try (of those with all k)
818
+ attempts: list[tuple[int, int]] # (passed, tasks run) in each attempt, in order
819
+
820
+ @property
821
+ def runs(self) -> list[float]:
822
+ """The pass rate of each attempt that ran every task."""
823
+ full = max((ran for _, ran in self.attempts), default=0)
824
+ return [passed / ran for passed, ran in self.attempts if ran == full and ran]
825
+
826
+ @property
827
+ def spread(self) -> float | None:
828
+ runs = self.runs
829
+ return max(runs) - min(runs) if len(runs) > 1 else None
830
+
831
+
832
+ def pass_rates(results: list[TaskResult], attempts: int) -> PassRates:
833
+ tries: dict[str, list[bool]] = {}
834
+ for result in results:
835
+ tries.setdefault(result.id, []).append(result.passed)
836
+ per_attempt = Counter((result.id, result.attempt) for result in results)
837
+ k = max(1, attempts) * max(per_attempt.values(), default=1)
838
+ full = [passed for passed in tries.values() if len(passed) >= k]
839
+ by_attempt: dict[int, list[bool]] = {}
840
+ for result in results:
841
+ by_attempt.setdefault(result.attempt, []).append(result.passed)
842
+ return PassRates(
843
+ tries=k,
844
+ pass_at_1=statistics.fmean(statistics.fmean(passed) for passed in tries.values()) if tries else None,
845
+ pass_all=statistics.fmean(all(passed[:k]) for passed in full) if full else None,
846
+ attempts=[(sum(passed), len(passed)) for _, passed in sorted(by_attempt.items())],
847
+ )
795
848
 
796
849
 
797
850
  @dataclass
@@ -812,6 +865,10 @@ class ModelRun:
812
865
  session: bool = False # all tasks in one conversation (--session)
813
866
  pruned: int = 0 # times old tool output was removed to make room
814
867
  compacted: int = 0 # times the conversation was summarized
868
+ attempts: int = 1 # each task's attempts, each in a new folder and conversation (--attempts)
869
+
870
+ def rates(self) -> PassRates:
871
+ return pass_rates(self.tasks, self.attempts)
815
872
 
816
873
  @property
817
874
  def passed(self) -> int:
@@ -832,12 +889,19 @@ class ModelRun:
832
889
 
833
890
  def to_json(self) -> dict:
834
891
  data = asdict(self)
892
+ rates = self.rates()
835
893
  data.update(
836
894
  passed=self.passed,
837
895
  total=len(self.tasks),
838
896
  seconds=round(self.seconds, 1),
839
897
  generation_tps=self.generation_tps,
840
898
  tool_errors=self.tool_errors,
899
+ summary={
900
+ "pass_at_1": rates.pass_at_1,
901
+ f"pass^{rates.tries}": rates.pass_all,
902
+ "runs": rates.runs,
903
+ "spread": rates.spread,
904
+ },
841
905
  )
842
906
  return data
843
907
 
@@ -1029,17 +1093,24 @@ def run_model(
1029
1093
  settings: Settings,
1030
1094
  tasks: list[Task],
1031
1095
  console: Console,
1032
- timeout: float = DEFAULT_TIMEOUT,
1096
+ timeout: float | None = None,
1033
1097
  keep: bool = False,
1034
1098
  verbose: bool = False,
1035
1099
  session: bool = False,
1036
1100
  retry: bool = False,
1101
+ attempts: int = 1,
1037
1102
  ) -> ModelRun:
1038
- run = ModelRun(name, settings.model, settings.context, settings.num_batch, settings.think, session=session)
1103
+ """Run the tasks `attempts` times: every task once, then every task again, each time in a new folder and
1104
+ conversation (with `session`, each attempt is one conversation for all the tasks)."""
1105
+ attempts = max(1, attempts)
1106
+ run = ModelRun(
1107
+ name, settings.model, settings.context, settings.num_batch, settings.think, session=session, attempts=attempts
1108
+ )
1039
1109
  shared: Agent | None = None # with --session, one conversation for all tasks
1040
1110
  console.print(
1041
1111
  f"\n[bold]{escape(settings.model)}[/] · {format_tokens(settings.context)} context · "
1042
1112
  f"reasoning {'on' if settings.think else 'off'} · {len(tasks)} task{'' if len(tasks) == 1 else 's'}"
1113
+ + (f" · {attempts} attempts each" if attempts > 1 else "")
1043
1114
  )
1044
1115
  options = {"num_ctx": settings.context, **({"num_batch": settings.num_batch} if settings.num_batch else {})}
1045
1116
  started = time.monotonic()
@@ -1065,30 +1136,41 @@ def run_model(
1065
1136
  console.print(f" [dim]Loaded in {run.load_seconds:.0f}s{where}{reads}[/]")
1066
1137
  elif reads: # the server loads the model itself
1067
1138
  console.print(f" [dim]{reads.removeprefix(' · ').capitalize()}[/]")
1068
- for task in tasks:
1069
- log = console if verbose else Console(file=io.StringIO(), width=120, force_terminal=False)
1070
- if session and shared is None:
1071
- shared = Agent(ollama, settings, Path(tempfile.gettempdir()), console=log)
1072
- if shared is not None:
1073
- shared.console = log
1074
- try:
1075
- if verbose:
1076
- console.rule(f"{task.id}: {task.title}")
1077
- result = run_task(ollama, settings, task, timeout, log, keep, run.usage, shared, retry)
1078
- else:
1079
- with console.status(Elapsed(f" {task.id:<13} {task.title}")):
1080
- result = run_task(ollama, settings, task, timeout, log, keep, run.usage, shared, retry)
1081
- except KeyboardInterrupt:
1082
- console.print(" [yellow]Stopped.[/]")
1083
- run.interrupted = True
1139
+ pruned = compacted = 0 # in the conversations of the earlier attempts (--session)
1140
+ for attempt in range(1, attempts + 1):
1141
+ if attempts > 1:
1142
+ console.print(f" [dim]Attempt {attempt} of {attempts}[/]")
1143
+ if shared is not None: # with --session, each attempt is a conversation of its own
1144
+ pruned, compacted = pruned + shared.pruned, compacted + shared.compacted
1145
+ shared = None
1146
+ for task in tasks:
1147
+ limit = timeout or task.timeout # --timeout, or the task's own
1148
+ log = console if verbose else Console(file=io.StringIO(), width=120, force_terminal=False)
1149
+ if session and shared is None:
1150
+ shared = Agent(ollama, settings, Path(tempfile.gettempdir()), console=log)
1151
+ if shared is not None:
1152
+ shared.console = log
1153
+ try:
1154
+ if verbose:
1155
+ console.rule(f"{task.id}: {task.title}")
1156
+ result = run_task(ollama, settings, task, limit, log, keep, run.usage, shared, retry)
1157
+ else:
1158
+ with console.status(Elapsed(f" {task.id:<13} {task.title}")):
1159
+ result = run_task(ollama, settings, task, limit, log, keep, run.usage, shared, retry)
1160
+ except KeyboardInterrupt:
1161
+ console.print(" [yellow]Stopped.[/]")
1162
+ run.interrupted = True
1163
+ break
1164
+ result.attempt = attempt
1165
+ run.tasks.append(result)
1166
+ mark = "[green]✓[/]" if result.passed else "[red]✗[/]"
1167
+ console.print(
1168
+ f" {mark} {task.id:<13} {task.title:<32} {result.seconds:>5.0f}s [dim]{escape(result.detail)}[/]"
1169
+ )
1170
+ if shared is not None:
1171
+ run.pruned, run.compacted = pruned + shared.pruned, compacted + shared.compacted
1172
+ if run.interrupted:
1084
1173
  break
1085
- run.tasks.append(result)
1086
- mark = "[green]✓[/]" if result.passed else "[red]✗[/]"
1087
- console.print(
1088
- f" {mark} {task.id:<13} {task.title:<32} {result.seconds:>5.0f}s [dim]{escape(result.detail)}[/]"
1089
- )
1090
- if shared is not None:
1091
- run.pruned, run.compacted = shared.pruned, shared.compacted
1092
1174
  if run.memory_gb is None:
1093
1175
  run.memory_gb, run.gpu_percent = memory_use(ollama, settings.model)
1094
1176
  # lcode lowers the batch size or context if the GPU runs out of memory; report what was used.
@@ -1103,21 +1185,39 @@ def duration(seconds: float) -> str:
1103
1185
  return f"{int(seconds // 60)}m {seconds % 60:02.0f}s" if seconds >= 60 else f"{seconds:.0f}s"
1104
1186
 
1105
1187
 
1188
+ def percent(share: float | None) -> str:
1189
+ return "–" if share is None else f"{share * 100:.0f}%"
1190
+
1191
+
1106
1192
  def summary_rows(runs: list[ModelRun], tasks: list[Task]) -> list[tuple[str, list[str]]]:
1107
1193
  rows = []
1108
- for task in {t.id: t for t in tasks}.values(): # with --rounds a task runs several times: one row, a mark each
1194
+ for task in {t.id: t for t in tasks}.values(): # a task that ran several times: one row, a mark each
1109
1195
  cells = []
1110
1196
  for run in runs:
1111
1197
  results = [t for t in run.tasks if t.id == task.id]
1112
1198
  marks = "".join("✓" if r.passed else "✗" for r in results)
1113
- cells.append(f"{marks} {duration(sum(r.seconds for r in results))}" if results else "")
1199
+ each = sum(r.seconds for r in results) / len(results) if results else 0.0 # one try's time, on average
1200
+ cells.append(f"{marks} {duration(each)}" if results else "")
1114
1201
  rows.append((f"{task.id}: {task.title}", cells))
1115
1202
 
1116
1203
  def cell(run: ModelRun, value: str) -> str:
1117
1204
  return "—" if run.error else value
1118
1205
 
1206
+ rows.append(
1207
+ ("Passed", [cell(r, f"{r.passed}/{len(r.tasks)}" + (" (stopped)" if r.interrupted else "")) for r in runs])
1208
+ )
1209
+ rates = [(run, run.rates()) for run in runs]
1210
+ tries = max((rate.tries for _, rate in rates), default=1)
1211
+ if tries > 1:
1212
+ rows += [
1213
+ ("pass@1", [cell(run, percent(rate.pass_at_1)) for run, rate in rates]),
1214
+ (f"pass^{tries}", [cell(run, percent(rate.pass_all)) for run, rate in rates]),
1215
+ ]
1216
+ if any(len(rate.attempts) > 1 for _, rate in rates):
1217
+ rows.append(
1218
+ ("Each attempt", [cell(run, ", ".join(f"{p}/{n}" for p, n in rate.attempts)) for run, rate in rates])
1219
+ )
1119
1220
  rows += [
1120
- ("Passed", [cell(r, f"{r.passed}/{len(r.tasks)}" + (" (stopped)" if r.interrupted else "")) for r in runs]),
1121
1221
  ("Time", [cell(r, duration(r.seconds)) for r in runs]),
1122
1222
  ("Generation", [cell(r, f"{r.generation_tps:.1f} tok/s" if r.generation_tps else "?") for r in runs]),
1123
1223
  ("Prompt reading", [cell(r, f"{r.prompt_tps:,.0f} tok/s" if r.prompt_tps else "?") for r in runs]),
@@ -1162,7 +1262,7 @@ def report(runs: list[ModelRun], hardware: Hardware, ollama_version: str, server
1162
1262
  "server": server or f"Ollama {ollama_version}",
1163
1263
  "date": dt.datetime.now().astimezone().isoformat(timespec="seconds"),
1164
1264
  "hardware": {**asdict(hardware), "description": hardware.describe()},
1165
- "tasks": [{"id": t.id, "title": t.title} for t in TASKS],
1265
+ "tasks": [{"id": t.id, "title": t.title} for t in default_tasks()],
1166
1266
  "runs": [run.to_json() for run in runs],
1167
1267
  }
1168
1268
 
@@ -1192,7 +1292,11 @@ def print_tasks(console: Console) -> None:
1192
1292
  table = Table(title="lcode bench tasks", title_justify="left", header_style="bold")
1193
1293
  table.add_column("Task", style="cyan")
1194
1294
  table.add_column("What it tests")
1195
- for task in TASKS:
1196
- table.add_row(task.id, task.title)
1295
+ table.add_column("Runs", style="dim")
1296
+ for tasks, when in [(TASKS, "always"), (work_tasks(), "not with --quick"), (extra_tasks(), "only with --tasks")]:
1297
+ for task in tasks:
1298
+ table.add_row(task.id, task.title, when)
1197
1299
  console.print(table)
1198
- console.print("[dim]Run a subset with --tasks, e.g. lcode bench --tasks fix-bug,rename[/]")
1300
+ console.print(
1301
+ "[dim]--quick runs the quick ones once; --tasks picks some, e.g. lcode bench --tasks fix-bug,rename[/]"
1302
+ )