Release builds without code-coverage instrumentation (no more default.profraw)
The package scheme gathers test coverage, and Xcode instrumented the Release build as well: rzb wrote default.profraw wherever it ran. -enableCodeCoverage NO CLANG_ENABLE_CODE_COVERAGE=NO on every Release build; release.sh refuses an instrumented rzb, install.sh warns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5ff3ae8 parent: caefc12 modified
.memory/handoffs/2026-11-25-v0-2-server-foundation.md +4 -0 | @@ -141,3 +141,7 @@ Trap: `sed -i` on this mount drops the executable bit (seen on host.sh, host_run | ||
| 141 | 141 | release.sh). After any sed -i on a script, `chmod +x` it and check `git ls-files -s`. |
| 142 | 142 | Default port is now 7920 (the sandbox reaches a Mac server at http://host.docker.internal:7920/v1; |
| 143 | 143 | the user may have to `sbx policy allow network localhost:7920`). |
| 144 | +To verify: after a rebuild with the coverage flags, `grep -c LLVM_PROFILE_FILE` on the Release rzb | |
| 145 | +must be 0 (install.sh warns otherwise). If it is not, try other settings (e.g. building the `rzb` | |
| 146 | +product scheme, or CLANG_COVERAGE_MAPPING=NO) before anything else. The host runner must be | |
| 147 | +restarted to pick up its new build flags. | |
| @@ -141,3 +141,7 @@ Trap: `sed -i` on this mount drops the executable bit (seen on host.sh, host_run | |||
| 141 | release.sh). After any sed -i on a script, `chmod +x` it and check `git ls-files -s`. | 141 | release.sh). After any sed -i on a script, `chmod +x` it and check `git ls-files -s`. |
| 142 | Default port is now 7920 (the sandbox reaches a Mac server at http://host.docker.internal:7920/v1; | 142 | Default port is now 7920 (the sandbox reaches a Mac server at http://host.docker.internal:7920/v1; |
| 143 | the user may have to `sbx policy allow network localhost:7920`). | 143 | the user may have to `sbx policy allow network localhost:7920`). |
| 144 | +To verify: after a rebuild with the coverage flags, `grep -c LLVM_PROFILE_FILE` on the Release rzb | ||
| 145 | +must be 0 (install.sh warns otherwise). If it is not, try other settings (e.g. building the `rzb` | ||
| 146 | +product scheme, or CLANG_COVERAGE_MAPPING=NO) before anything else. The host runner must be | ||
| 147 | +restarted to pick up its new build flags. | ||
modified
.memory/history.md +11 -0 | @@ -385,3 +385,14 @@ when finish_reason is length with no answer); no cache reuse is expected — Qwe | ||
| 385 | 385 | (thermal? memory pressure? something accumulating in the server?) — asked the user for the chip and |
| 386 | 386 | a comparison run. Idea not ticketed yet: checkpoint the recurrent state at the end of the prompt |
| 387 | 387 | so hybrid models can reuse it (llama.cpp does this). |
| 388 | + | |
| 389 | +## 2026-11-26 — default.profraw written by rzb | |
| 390 | + | |
| 391 | +User asked why rzb creates default.profraw. Found: the Release rzb contains the LLVM profile | |
| 392 | +runtime (string LLVM_PROFILE_FILE in the binary; Cmlx Release .resp files carry | |
| 393 | +-fprofile-instr-generate) — the SwiftPM package scheme gathers test coverage and Xcode instruments | |
| 394 | +the Release build too. Fix (not yet verified by a Mac build): `-enableCodeCoverage NO | |
| 395 | +CLANG_ENABLE_CODE_COVERAGE=NO` on every Release `xcodebuild build` (install.sh, release.sh, | |
| 396 | +host_runner.py build/run actions, README, build how-to EN+FR with a troubleshooting row); | |
| 397 | +release.sh refuses an instrumented rzb, install.sh warns. Host-runner test added (10 pass). The | |
| 398 | +copies of default.profraw under mlx-swift checkouts belong to mlx-swift itself (ignore). | |
| @@ -385,3 +385,14 @@ when finish_reason is length with no answer); no cache reuse is expected — Qwe | |||
| 385 | (thermal? memory pressure? something accumulating in the server?) — asked the user for the chip and | 385 | (thermal? memory pressure? something accumulating in the server?) — asked the user for the chip and |
| 386 | a comparison run. Idea not ticketed yet: checkpoint the recurrent state at the end of the prompt | 386 | a comparison run. Idea not ticketed yet: checkpoint the recurrent state at the end of the prompt |
| 387 | so hybrid models can reuse it (llama.cpp does this). | 387 | so hybrid models can reuse it (llama.cpp does this). |
| 388 | + | ||
| 389 | +## 2026-11-26 — default.profraw written by rzb | ||
| 390 | + | ||
| 391 | +User asked why rzb creates default.profraw. Found: the Release rzb contains the LLVM profile | ||
| 392 | +runtime (string LLVM_PROFILE_FILE in the binary; Cmlx Release .resp files carry | ||
| 393 | +-fprofile-instr-generate) — the SwiftPM package scheme gathers test coverage and Xcode instruments | ||
| 394 | +the Release build too. Fix (not yet verified by a Mac build): `-enableCodeCoverage NO | ||
| 395 | +CLANG_ENABLE_CODE_COVERAGE=NO` on every Release `xcodebuild build` (install.sh, release.sh, | ||
| 396 | +host_runner.py build/run actions, README, build how-to EN+FR with a troubleshooting row); | ||
| 397 | +release.sh refuses an instrumented rzb, install.sh warns. Host-runner test added (10 pass). The | ||
| 398 | +copies of default.profraw under mlx-swift checkouts belong to mlx-swift itself (ignore). | ||
modified
.quality/history.jsonl +1 -0 | @@ -32,3 +32,4 @@ | ||
| 32 | 32 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "6e6d79e", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 547, "cyclo": 605, "fields": 1210, "funcs": 583, "lcom": 115, "lines": 10687, "loc": 8507}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 32, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T07:29:39Z"} |
| 33 | 33 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "83271da", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 547, "cyclo": 605, "fields": 1210, "funcs": 583, "lcom": 115, "lines": 10687, "loc": 8507}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 33, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T14:05:13Z"} |
| 34 | 34 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "f95af71", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 547, "cyclo": 605, "fields": 1210, "funcs": 583, "lcom": 115, "lines": 10687, "loc": 8507}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 34, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T14:17:19Z"} |
| 35 | +{"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "caefc12", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 548, "cyclo": 606, "fields": 1210, "funcs": 583, "lcom": 115, "lines": 10692, "loc": 8510}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 35, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T14:42:16Z"} | |
| @@ -32,3 +32,4 @@ | |||
| 32 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "6e6d79e", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 547, "cyclo": 605, "fields": 1210, "funcs": 583, "lcom": 115, "lines": 10687, "loc": 8507}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 32, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T07:29:39Z"} | 32 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "6e6d79e", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 547, "cyclo": 605, "fields": 1210, "funcs": 583, "lcom": 115, "lines": 10687, "loc": 8507}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 32, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T07:29:39Z"} |
| 33 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "83271da", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 547, "cyclo": 605, "fields": 1210, "funcs": 583, "lcom": 115, "lines": 10687, "loc": 8507}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 33, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T14:05:13Z"} | 33 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "83271da", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 547, "cyclo": 605, "fields": 1210, "funcs": 583, "lcom": 115, "lines": 10687, "loc": 8507}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 33, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T14:05:13Z"} |
| 34 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "f95af71", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 547, "cyclo": 605, "fields": 1210, "funcs": 583, "lcom": 115, "lines": 10687, "loc": 8507}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 34, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T14:17:19Z"} | 34 | {"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "f95af71", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 547, "cyclo": 605, "fields": 1210, "funcs": 583, "lcom": 115, "lines": 10687, "loc": 8507}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 34, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T14:17:19Z"} |
| 35 | +{"branch": "feature/v0.2-openai-server", "breaches": [], "commit": "caefc12", "counts": {}, "gate": {"max_error": 0, "max_smells": 0, "max_warning": 0}, "gate_passed": true, "metrics": {"classes": 234, "complex": 548, "cyclo": 606, "fields": 1210, "funcs": 583, "lcom": 115, "lines": 10692, "loc": 8510}, "qlty_version": "qlty 0.672.0 linux-arm64 (4362b62 2026-11-20)", "run": 35, "smells": 0, "swiftlint_version": "0.65.1", "timestamp": "2026-11-26T14:42:16Z"} | ||
added
.quality/report-20261126T144216Z.md +73 -0 | new file mode 100644 | ||
| @@ -0,0 +1,73 @@ | ||
| 1 | +# Quality report — 2026-11-26T14:42:16Z | |
| 2 | + | |
| 3 | +- **Gate**: ✅ **PASS** | |
| 4 | +- **Commit**: `caefc12` on `feature/v0.2-openai-server` | |
| 5 | +- **qlty**: qlty 0.672.0 linux-arm64 (4362b62 2026-11-20) | |
| 6 | +- **swiftlint**: 0.65.1 (run directly, merged into lint issues) | |
| 7 | +- **Run**: #35 (previous: 2026-11-26T14:17:19Z) | |
| 8 | + | |
| 9 | +## Lint issues (`qlty check`) | |
| 10 | + | |
| 11 | +_none_ | |
| 12 | + | |
| 13 | +### Top rules | |
| 14 | + | |
| 15 | +_none_ | |
| 16 | + | |
| 17 | +### Most affected files | |
| 18 | + | |
| 19 | +_none_ | |
| 20 | + | |
| 21 | +## Code smells (`qlty smells`) | |
| 22 | + | |
| 23 | +Total: **0** (vs previous: ±0) | |
| 24 | + | |
| 25 | +_none_ | |
| 26 | + | |
| 27 | +## Metrics (`qlty metrics`) | |
| 28 | + | |
| 29 | +| metric | total | vs previous | | |
| 30 | +|---|---|---| | |
| 31 | +| funcs | 583 | ±0 | | |
| 32 | +| classes | 234 | ±0 | | |
| 33 | +| fields | 1210 | ±0 | | |
| 34 | +| cyclo | 606 | +1 | | |
| 35 | +| complex | 548 | +1 | | |
| 36 | +| lcom | 115 | ±0 | | |
| 37 | +| lines | 10692 | +5 | | |
| 38 | +| loc | 8510 | +3 | | |
| 39 | + | |
| 40 | +### Most complex files | |
| 41 | + | |
| 42 | +| file | complex | cyclo | loc | | |
| 43 | +|---|---|---|---| | |
| 44 | +| Sources/RazorbillServer/CompletionsRoute.swift | 47 | 20 | 242 | | |
| 45 | +| Sources/RazorbillServer/Chat/CompletionStream.swift | 31 | 20 | 125 | | |
| 46 | +| experiments/02-kv-cache-reuse/Sources/KVCacheReuse/KVCacheReuse.swift | 26 | 20 | 285 | | |
| 47 | +| Sources/RazorbillMLX/MLXEngine.swift | 23 | 35 | 246 | | |
| 48 | +| tools/host-runner/host_runner.py | 23 | 23 | 144 | | |
| 49 | +| Sources/RazorbillCore/Config/ConfigValue+JSON.swift | 20 | 25 | 71 | | |
| 50 | +| Sources/RazorbillCore/Config/ServerConfigLoader.swift | 20 | 17 | 227 | | |
| 51 | +| Sources/RazorbillServer/Chat/ToolsAndFormats.swift | 18 | 30 | 170 | | |
| 52 | +| Sources/RazorbillServer/Chat/ChatCompletionRequest.swift | 17 | 24 | 276 | | |
| 53 | +| Sources/RazorbillServer/Chat/ChatCompletionChunk.swift | 16 | 11 | 137 | | |
| 54 | +| Sources/RazorbillServer/ModelManager.swift | 16 | 22 | 220 | | |
| 55 | +| Sources/RazorbillCore/Config/OrderedJSONReader.swift | 15 | 24 | 140 | | |
| 56 | +| Sources/RazorbillCore/Config/GenerationOverrides.swift | 14 | 15 | 67 | | |
| 57 | +| Sources/RazorbillCLI/Commands/ModelsCommand.swift | 13 | 7 | 100 | | |
| 58 | +| Sources/RazorbillServer/EmbeddingsRoute.swift | 13 | 13 | 143 | | |
| 59 | + | |
| 60 | +## Trend | |
| 61 | + | |
| 62 | +| run | timestamp | error | warning | smells | complex | gate | | |
| 63 | +|---|---|---|---|---|---|---| | |
| 64 | +| 26 | 2026-11-25T21:38:24Z | 0 | 0 | 0 | 544 | PASS | | |
| 65 | +| 27 | 2026-11-25T22:01:44Z | 0 | 0 | 0 | 546 | PASS | | |
| 66 | +| 28 | 2026-11-25T22:03:59Z | 0 | 0 | 0 | 546 | PASS | | |
| 67 | +| 29 | 2026-11-26T04:34:58Z | 0 | 0 | 0 | 546 | PASS | | |
| 68 | +| 30 | 2026-11-26T05:21:18Z | 0 | 0 | 0 | 546 | PASS | | |
| 69 | +| 31 | 2026-11-26T07:11:39Z | 0 | 0 | 0 | 546 | PASS | | |
| 70 | +| 32 | 2026-11-26T07:29:39Z | 0 | 0 | 0 | 547 | PASS | | |
| 71 | +| 33 | 2026-11-26T14:05:13Z | 0 | 0 | 0 | 547 | PASS | | |
| 72 | +| 34 | 2026-11-26T14:17:19Z | 0 | 0 | 0 | 547 | PASS | | |
| 73 | +| 35 | 2026-11-26T14:42:16Z | 0 | 0 | 0 | 548 | PASS | | |
| new file mode 100644 | |||
| @@ -0,0 +1,73 @@ | |||
| 1 | +# Quality report — 2026-11-26T14:42:16Z | ||
| 2 | + | ||
| 3 | +- **Gate**: ✅ **PASS** | ||
| 4 | +- **Commit**: `caefc12` on `feature/v0.2-openai-server` | ||
| 5 | +- **qlty**: qlty 0.672.0 linux-arm64 (4362b62 2026-11-20) | ||
| 6 | +- **swiftlint**: 0.65.1 (run directly, merged into lint issues) | ||
| 7 | +- **Run**: #35 (previous: 2026-11-26T14:17:19Z) | ||
| 8 | + | ||
| 9 | +## Lint issues (`qlty check`) | ||
| 10 | + | ||
| 11 | +_none_ | ||
| 12 | + | ||
| 13 | +### Top rules | ||
| 14 | + | ||
| 15 | +_none_ | ||
| 16 | + | ||
| 17 | +### Most affected files | ||
| 18 | + | ||
| 19 | +_none_ | ||
| 20 | + | ||
| 21 | +## Code smells (`qlty smells`) | ||
| 22 | + | ||
| 23 | +Total: **0** (vs previous: ±0) | ||
| 24 | + | ||
| 25 | +_none_ | ||
| 26 | + | ||
| 27 | +## Metrics (`qlty metrics`) | ||
| 28 | + | ||
| 29 | +| metric | total | vs previous | | ||
| 30 | +|---|---|---| | ||
| 31 | +| funcs | 583 | ±0 | | ||
| 32 | +| classes | 234 | ±0 | | ||
| 33 | +| fields | 1210 | ±0 | | ||
| 34 | +| cyclo | 606 | +1 | | ||
| 35 | +| complex | 548 | +1 | | ||
| 36 | +| lcom | 115 | ±0 | | ||
| 37 | +| lines | 10692 | +5 | | ||
| 38 | +| loc | 8510 | +3 | | ||
| 39 | + | ||
| 40 | +### Most complex files | ||
| 41 | + | ||
| 42 | +| file | complex | cyclo | loc | | ||
| 43 | +|---|---|---|---| | ||
| 44 | +| Sources/RazorbillServer/CompletionsRoute.swift | 47 | 20 | 242 | | ||
| 45 | +| Sources/RazorbillServer/Chat/CompletionStream.swift | 31 | 20 | 125 | | ||
| 46 | +| experiments/02-kv-cache-reuse/Sources/KVCacheReuse/KVCacheReuse.swift | 26 | 20 | 285 | | ||
| 47 | +| Sources/RazorbillMLX/MLXEngine.swift | 23 | 35 | 246 | | ||
| 48 | +| tools/host-runner/host_runner.py | 23 | 23 | 144 | | ||
| 49 | +| Sources/RazorbillCore/Config/ConfigValue+JSON.swift | 20 | 25 | 71 | | ||
| 50 | +| Sources/RazorbillCore/Config/ServerConfigLoader.swift | 20 | 17 | 227 | | ||
| 51 | +| Sources/RazorbillServer/Chat/ToolsAndFormats.swift | 18 | 30 | 170 | | ||
| 52 | +| Sources/RazorbillServer/Chat/ChatCompletionRequest.swift | 17 | 24 | 276 | | ||
| 53 | +| Sources/RazorbillServer/Chat/ChatCompletionChunk.swift | 16 | 11 | 137 | | ||
| 54 | +| Sources/RazorbillServer/ModelManager.swift | 16 | 22 | 220 | | ||
| 55 | +| Sources/RazorbillCore/Config/OrderedJSONReader.swift | 15 | 24 | 140 | | ||
| 56 | +| Sources/RazorbillCore/Config/GenerationOverrides.swift | 14 | 15 | 67 | | ||
| 57 | +| Sources/RazorbillCLI/Commands/ModelsCommand.swift | 13 | 7 | 100 | | ||
| 58 | +| Sources/RazorbillServer/EmbeddingsRoute.swift | 13 | 13 | 143 | | ||
| 59 | + | ||
| 60 | +## Trend | ||
| 61 | + | ||
| 62 | +| run | timestamp | error | warning | smells | complex | gate | | ||
| 63 | +|---|---|---|---|---|---|---| | ||
| 64 | +| 26 | 2026-11-25T21:38:24Z | 0 | 0 | 0 | 544 | PASS | | ||
| 65 | +| 27 | 2026-11-25T22:01:44Z | 0 | 0 | 0 | 546 | PASS | | ||
| 66 | +| 28 | 2026-11-25T22:03:59Z | 0 | 0 | 0 | 546 | PASS | | ||
| 67 | +| 29 | 2026-11-26T04:34:58Z | 0 | 0 | 0 | 546 | PASS | | ||
| 68 | +| 30 | 2026-11-26T05:21:18Z | 0 | 0 | 0 | 546 | PASS | | ||
| 69 | +| 31 | 2026-11-26T07:11:39Z | 0 | 0 | 0 | 546 | PASS | | ||
| 70 | +| 32 | 2026-11-26T07:29:39Z | 0 | 0 | 0 | 547 | PASS | | ||
| 71 | +| 33 | 2026-11-26T14:05:13Z | 0 | 0 | 0 | 547 | PASS | | ||
| 72 | +| 34 | 2026-11-26T14:17:19Z | 0 | 0 | 0 | 547 | PASS | | ||
| 73 | +| 35 | 2026-11-26T14:42:16Z | 0 | 0 | 0 | 548 | PASS | | ||
modified
.quality/report-latest.md +9 -9 | @@ -1,10 +1,10 @@ | ||
| 1 | -# Quality report — 2026-11-26T14:17:19Z | |
| 1 | +# Quality report — 2026-11-26T14:42:16Z | |
| 2 | 2 | |
| 3 | 3 | - **Gate**: ✅ **PASS** |
| 4 | -- **Commit**: `f95af71` on `feature/v0.2-openai-server` | |
| 4 | +- **Commit**: `caefc12` on `feature/v0.2-openai-server` | |
| 5 | 5 | - **qlty**: qlty 0.672.0 linux-arm64 (4362b62 2026-11-20) |
| 6 | 6 | - **swiftlint**: 0.65.1 (run directly, merged into lint issues) |
| 7 | -- **Run**: #34 (previous: 2026-11-26T14:05:13Z) | |
| 7 | +- **Run**: #35 (previous: 2026-11-26T14:17:19Z) | |
| 8 | 8 | |
| 9 | 9 | ## Lint issues (`qlty check`) |
| 10 | 10 | |
| @@ -31,11 +31,11 @@ _none_ | ||
| 31 | 31 | | funcs | 583 | ±0 | |
| 32 | 32 | | classes | 234 | ±0 | |
| 33 | 33 | | fields | 1210 | ±0 | |
| 34 | -| cyclo | 605 | ±0 | | |
| 35 | -| complex | 547 | ±0 | | |
| 34 | +| cyclo | 606 | +1 | | |
| 35 | +| complex | 548 | +1 | | |
| 36 | 36 | | lcom | 115 | ±0 | |
| 37 | -| lines | 10687 | ±0 | | |
| 38 | -| loc | 8507 | ±0 | | |
| 37 | +| lines | 10692 | +5 | | |
| 38 | +| loc | 8510 | +3 | | |
| 39 | 39 | |
| 40 | 40 | ### Most complex files |
| 41 | 41 | |
| @@ -45,7 +45,7 @@ _none_ | ||
| 45 | 45 | | Sources/RazorbillServer/Chat/CompletionStream.swift | 31 | 20 | 125 | |
| 46 | 46 | | experiments/02-kv-cache-reuse/Sources/KVCacheReuse/KVCacheReuse.swift | 26 | 20 | 285 | |
| 47 | 47 | | Sources/RazorbillMLX/MLXEngine.swift | 23 | 35 | 246 | |
| 48 | -| tools/host-runner/host_runner.py | 22 | 22 | 141 | | |
| 48 | +| tools/host-runner/host_runner.py | 23 | 23 | 144 | | |
| 49 | 49 | | Sources/RazorbillCore/Config/ConfigValue+JSON.swift | 20 | 25 | 71 | |
| 50 | 50 | | Sources/RazorbillCore/Config/ServerConfigLoader.swift | 20 | 17 | 227 | |
| 51 | 51 | | Sources/RazorbillServer/Chat/ToolsAndFormats.swift | 18 | 30 | 170 | |
| @@ -61,7 +61,6 @@ _none_ | ||
| 61 | 61 | |
| 62 | 62 | | run | timestamp | error | warning | smells | complex | gate | |
| 63 | 63 | |---|---|---|---|---|---|---| |
| 64 | -| 25 | 2026-11-25T21:37:51Z | 0 | 1 | 0 | 544 | FAIL | | |
| 65 | 64 | | 26 | 2026-11-25T21:38:24Z | 0 | 0 | 0 | 544 | PASS | |
| 66 | 65 | | 27 | 2026-11-25T22:01:44Z | 0 | 0 | 0 | 546 | PASS | |
| 67 | 66 | | 28 | 2026-11-25T22:03:59Z | 0 | 0 | 0 | 546 | PASS | |
| @@ -71,3 +70,4 @@ _none_ | ||
| 71 | 70 | | 32 | 2026-11-26T07:29:39Z | 0 | 0 | 0 | 547 | PASS | |
| 72 | 71 | | 33 | 2026-11-26T14:05:13Z | 0 | 0 | 0 | 547 | PASS | |
| 73 | 72 | | 34 | 2026-11-26T14:17:19Z | 0 | 0 | 0 | 547 | PASS | |
| 73 | +| 35 | 2026-11-26T14:42:16Z | 0 | 0 | 0 | 548 | PASS | | |
| @@ -1,10 +1,10 @@ | |||
| 1 | -# Quality report — 2026-11-26T14:17:19Z | 1 | +# Quality report — 2026-11-26T14:42:16Z |
| 2 | 2 | ||
| 3 | - **Gate**: ✅ **PASS** | 3 | - **Gate**: ✅ **PASS** |
| 4 | -- **Commit**: `f95af71` on `feature/v0.2-openai-server` | 4 | +- **Commit**: `caefc12` on `feature/v0.2-openai-server` |
| 5 | - **qlty**: qlty 0.672.0 linux-arm64 (4362b62 2026-11-20) | 5 | - **qlty**: qlty 0.672.0 linux-arm64 (4362b62 2026-11-20) |
| 6 | - **swiftlint**: 0.65.1 (run directly, merged into lint issues) | 6 | - **swiftlint**: 0.65.1 (run directly, merged into lint issues) |
| 7 | -- **Run**: #34 (previous: 2026-11-26T14:05:13Z) | 7 | +- **Run**: #35 (previous: 2026-11-26T14:17:19Z) |
| 8 | 8 | ||
| 9 | ## Lint issues (`qlty check`) | 9 | ## Lint issues (`qlty check`) |
| 10 | 10 | ||
| @@ -31,11 +31,11 @@ _none_ | |||
| 31 | | funcs | 583 | ±0 | | 31 | | funcs | 583 | ±0 | |
| 32 | | classes | 234 | ±0 | | 32 | | classes | 234 | ±0 | |
| 33 | | fields | 1210 | ±0 | | 33 | | fields | 1210 | ±0 | |
| 34 | -| cyclo | 605 | ±0 | | 34 | +| cyclo | 606 | +1 | |
| 35 | -| complex | 547 | ±0 | | 35 | +| complex | 548 | +1 | |
| 36 | | lcom | 115 | ±0 | | 36 | | lcom | 115 | ±0 | |
| 37 | -| lines | 10687 | ±0 | | 37 | +| lines | 10692 | +5 | |
| 38 | -| loc | 8507 | ±0 | | 38 | +| loc | 8510 | +3 | |
| 39 | 39 | ||
| 40 | ### Most complex files | 40 | ### Most complex files |
| 41 | 41 | ||
| @@ -45,7 +45,7 @@ _none_ | |||
| 45 | | Sources/RazorbillServer/Chat/CompletionStream.swift | 31 | 20 | 125 | | 45 | | Sources/RazorbillServer/Chat/CompletionStream.swift | 31 | 20 | 125 | |
| 46 | | experiments/02-kv-cache-reuse/Sources/KVCacheReuse/KVCacheReuse.swift | 26 | 20 | 285 | | 46 | | experiments/02-kv-cache-reuse/Sources/KVCacheReuse/KVCacheReuse.swift | 26 | 20 | 285 | |
| 47 | | Sources/RazorbillMLX/MLXEngine.swift | 23 | 35 | 246 | | 47 | | Sources/RazorbillMLX/MLXEngine.swift | 23 | 35 | 246 | |
| 48 | -| tools/host-runner/host_runner.py | 22 | 22 | 141 | | 48 | +| tools/host-runner/host_runner.py | 23 | 23 | 144 | |
| 49 | | Sources/RazorbillCore/Config/ConfigValue+JSON.swift | 20 | 25 | 71 | | 49 | | Sources/RazorbillCore/Config/ConfigValue+JSON.swift | 20 | 25 | 71 | |
| 50 | | Sources/RazorbillCore/Config/ServerConfigLoader.swift | 20 | 17 | 227 | | 50 | | Sources/RazorbillCore/Config/ServerConfigLoader.swift | 20 | 17 | 227 | |
| 51 | | Sources/RazorbillServer/Chat/ToolsAndFormats.swift | 18 | 30 | 170 | | 51 | | Sources/RazorbillServer/Chat/ToolsAndFormats.swift | 18 | 30 | 170 | |
| @@ -61,7 +61,6 @@ _none_ | |||
| 61 | 61 | ||
| 62 | | run | timestamp | error | warning | smells | complex | gate | | 62 | | run | timestamp | error | warning | smells | complex | gate | |
| 63 | |---|---|---|---|---|---|---| | 63 | |---|---|---|---|---|---|---| |
| 64 | -| 25 | 2026-11-25T21:37:51Z | 0 | 1 | 0 | 544 | FAIL | | ||
| 65 | | 26 | 2026-11-25T21:38:24Z | 0 | 0 | 0 | 544 | PASS | | 64 | | 26 | 2026-11-25T21:38:24Z | 0 | 0 | 0 | 544 | PASS | |
| 66 | | 27 | 2026-11-25T22:01:44Z | 0 | 0 | 0 | 546 | PASS | | 65 | | 27 | 2026-11-25T22:01:44Z | 0 | 0 | 0 | 546 | PASS | |
| 67 | | 28 | 2026-11-25T22:03:59Z | 0 | 0 | 0 | 546 | PASS | | 66 | | 28 | 2026-11-25T22:03:59Z | 0 | 0 | 0 | 546 | PASS | |
| @@ -71,3 +70,4 @@ _none_ | |||
| 71 | | 32 | 2026-11-26T07:29:39Z | 0 | 0 | 0 | 547 | PASS | | 70 | | 32 | 2026-11-26T07:29:39Z | 0 | 0 | 0 | 547 | PASS | |
| 72 | | 33 | 2026-11-26T14:05:13Z | 0 | 0 | 0 | 547 | PASS | | 71 | | 33 | 2026-11-26T14:05:13Z | 0 | 0 | 0 | 547 | PASS | |
| 73 | | 34 | 2026-11-26T14:17:19Z | 0 | 0 | 0 | 547 | PASS | | 72 | | 34 | 2026-11-26T14:17:19Z | 0 | 0 | 0 | 547 | PASS | |
| 73 | +| 35 | 2026-11-26T14:42:16Z | 0 | 0 | 0 | 548 | PASS | | ||
modified
README.md +2 -1 | @@ -81,7 +81,8 @@ The server listens on `127.0.0.1` by default. To serve your network, set an API | ||
| 81 | 81 | |
| 82 | 82 | ```bash |
| 83 | 83 | xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \ |
| 84 | - -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation | |
| 84 | + -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation \ | |
| 85 | + -enableCodeCoverage NO CLANG_ENABLE_CODE_COVERAGE=NO | |
| 85 | 86 | |
| 86 | 87 | .build/xcode/Build/Products/Release/rzb version |
| 87 | 88 | # rzb 0.2.0 (engines: fake, mlx) |
| @@ -81,7 +81,8 @@ The server listens on `127.0.0.1` by default. To serve your network, set an API | |||
| 81 | 81 | ||
| 82 | ```bash | 82 | ```bash |
| 83 | xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \ | 83 | xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \ |
| 84 | - -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation | 84 | + -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation \ |
| 85 | + -enableCodeCoverage NO CLANG_ENABLE_CODE_COVERAGE=NO | ||
| 85 | 86 | ||
| 86 | .build/xcode/Build/Products/Release/rzb version | 87 | .build/xcode/Build/Products/Release/rzb version |
| 87 | # rzb 0.2.0 (engines: fake, mlx) | 88 | # rzb 0.2.0 (engines: fake, mlx) |
modified
demos/test-qwen/README.md +1 -0 | @@ -8,6 +8,7 @@ | ||
| 8 | 8 | |
| 9 | 9 | ```bash |
| 10 | 10 | rzb models pull mlx-community/Qwen3.5-9B-MLX-4bit |
| 11 | + rzb models pull mlx-community/Qwen3-4B-4bit | |
| 11 | 12 | ``` |
| 12 | 13 | |
| 13 | 14 | 2. Start the server in a terminal (`--host 0.0.0.0` is only needed to reach it from another machine): |
| @@ -8,6 +8,7 @@ | |||
| 8 | 8 | ||
| 9 | ```bash | 9 | ```bash |
| 10 | rzb models pull mlx-community/Qwen3.5-9B-MLX-4bit | 10 | rzb models pull mlx-community/Qwen3.5-9B-MLX-4bit |
| 11 | + rzb models pull mlx-community/Qwen3-4B-4bit | ||
| 11 | ``` | 12 | ``` |
| 12 | 13 | ||
| 13 | 2. Start the server in a terminal (`--host 0.0.0.0` is only needed to reach it from another machine): | 14 | 2. Start the server in a terminal (`--host 0.0.0.0` is only needed to reach it from another machine): |
modified
docs/en/how-to/build-on-the-mac.md +3 -1 | @@ -18,7 +18,8 @@ From the repository root: | ||
| 18 | 18 | |
| 19 | 19 | ```bash |
| 20 | 20 | xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \ |
| 21 | - -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation | |
| 21 | + -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation \ | |
| 22 | + -enableCodeCoverage NO CLANG_ENABLE_CODE_COVERAGE=NO | |
| 22 | 23 | ``` |
| 23 | 24 | |
| 24 | 25 | The executable is `.build/xcode/Build/Products/Release/rzb`. Keep it in that folder (or put the folder on your `PATH`): the MLX Metal library, `mlx-swift_Cmlx.bundle`, sits next to it and is loaded at run time. |
| @@ -59,6 +60,7 @@ The script never overwrites or removes an `rzb` launcher it did not write. | ||
| 59 | 60 | | Symptom | Fix | |
| 60 | 61 | | --- | --- | |
| 61 | 62 | | The build fails while compiling MLX's Metal shaders (the `metal` tool is missing) | Run `xcodebuild -downloadComponent MetalToolchain`. | |
| 63 | +| A `default.profraw` file appears in the folder where `rzb` ran | `rzb` was built without `-enableCodeCoverage NO CLANG_ENABLE_CODE_COVERAGE=NO`: the package scheme gathers test coverage and instruments the Release build too. Rebuild with the command above (or `scripts/install.sh`) and delete the file. | | |
| 62 | 64 | | `Failed to load the default metallib` when a model loads | `rzb` was built with `swift build`, or copied away from `mlx-swift_Cmlx.bundle`. Build with `xcodebuild` as above and run it from `Build/Products/Release`. | |
| 63 | 65 | |
| 64 | 66 | ## See also |
| @@ -18,7 +18,8 @@ From the repository root: | |||
| 18 | 18 | ||
| 19 | ```bash | 19 | ```bash |
| 20 | xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \ | 20 | xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \ |
| 21 | - -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation | 21 | + -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation \ |
| 22 | + -enableCodeCoverage NO CLANG_ENABLE_CODE_COVERAGE=NO | ||
| 22 | ``` | 23 | ``` |
| 23 | 24 | ||
| 24 | The executable is `.build/xcode/Build/Products/Release/rzb`. Keep it in that folder (or put the folder on your `PATH`): the MLX Metal library, `mlx-swift_Cmlx.bundle`, sits next to it and is loaded at run time. | 25 | The executable is `.build/xcode/Build/Products/Release/rzb`. Keep it in that folder (or put the folder on your `PATH`): the MLX Metal library, `mlx-swift_Cmlx.bundle`, sits next to it and is loaded at run time. |
| @@ -59,6 +60,7 @@ The script never overwrites or removes an `rzb` launcher it did not write. | |||
| 59 | | Symptom | Fix | | 60 | | Symptom | Fix | |
| 60 | | --- | --- | | 61 | | --- | --- | |
| 61 | | The build fails while compiling MLX's Metal shaders (the `metal` tool is missing) | Run `xcodebuild -downloadComponent MetalToolchain`. | | 62 | | The build fails while compiling MLX's Metal shaders (the `metal` tool is missing) | Run `xcodebuild -downloadComponent MetalToolchain`. | |
| 63 | +| A `default.profraw` file appears in the folder where `rzb` ran | `rzb` was built without `-enableCodeCoverage NO CLANG_ENABLE_CODE_COVERAGE=NO`: the package scheme gathers test coverage and instruments the Release build too. Rebuild with the command above (or `scripts/install.sh`) and delete the file. | | ||
| 62 | | `Failed to load the default metallib` when a model loads | `rzb` was built with `swift build`, or copied away from `mlx-swift_Cmlx.bundle`. Build with `xcodebuild` as above and run it from `Build/Products/Release`. | | 64 | | `Failed to load the default metallib` when a model loads | `rzb` was built with `swift build`, or copied away from `mlx-swift_Cmlx.bundle`. Build with `xcodebuild` as above and run it from `Build/Products/Release`. | |
| 63 | 65 | ||
| 64 | ## See also | 66 | ## See also |
modified
docs/fr/how-to/compiler-sur-le-mac.md +3 -1 | @@ -18,7 +18,8 @@ Depuis la racine du dépôt : | ||
| 18 | 18 | |
| 19 | 19 | ```bash |
| 20 | 20 | xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \ |
| 21 | - -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation | |
| 21 | + -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation \ | |
| 22 | + -enableCodeCoverage NO CLANG_ENABLE_CODE_COVERAGE=NO | |
| 22 | 23 | ``` |
| 23 | 24 | |
| 24 | 25 | L'exécutable est `.build/xcode/Build/Products/Release/rzb`. Laissez-le dans ce dossier (ou ajoutez le dossier à votre `PATH`) : la bibliothèque Metal de MLX, `mlx-swift_Cmlx.bundle`, est à côté de lui et elle est chargée à l'exécution. |
| @@ -59,6 +60,7 @@ Le script n'écrase ni ne supprime jamais un lanceur `rzb` qu'il n'a pas écrit. | ||
| 59 | 60 | | Symptôme | Solution | |
| 60 | 61 | | --- | --- | |
| 61 | 62 | | La compilation échoue en compilant les shaders Metal de MLX (l'outil `metal` manque) | Lancez `xcodebuild -downloadComponent MetalToolchain`. | |
| 63 | +| Un fichier `default.profraw` apparaît dans le dossier où `rzb` a tourné | `rzb` a été compilé sans `-enableCodeCoverage NO CLANG_ENABLE_CODE_COVERAGE=NO` : le scheme du package mesure la couverture des tests et instrumente aussi la compilation Release. Recompilez avec la commande ci-dessus (ou `scripts/install.sh`) et supprimez le fichier. | | |
| 62 | 64 | | `Failed to load the default metallib` au chargement d'un modèle | `rzb` a été compilé avec `swift build`, ou copié loin de `mlx-swift_Cmlx.bundle`. Compilez avec `xcodebuild` comme ci-dessus et lancez-le depuis `Build/Products/Release`. | |
| 63 | 65 | |
| 64 | 66 | ## Voir aussi |
| @@ -18,7 +18,8 @@ Depuis la racine du dépôt : | |||
| 18 | 18 | ||
| 19 | ```bash | 19 | ```bash |
| 20 | xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \ | 20 | xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \ |
| 21 | - -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation | 21 | + -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation \ |
| 22 | + -enableCodeCoverage NO CLANG_ENABLE_CODE_COVERAGE=NO | ||
| 22 | ``` | 23 | ``` |
| 23 | 24 | ||
| 24 | L'exécutable est `.build/xcode/Build/Products/Release/rzb`. Laissez-le dans ce dossier (ou ajoutez le dossier à votre `PATH`) : la bibliothèque Metal de MLX, `mlx-swift_Cmlx.bundle`, est à côté de lui et elle est chargée à l'exécution. | 25 | L'exécutable est `.build/xcode/Build/Products/Release/rzb`. Laissez-le dans ce dossier (ou ajoutez le dossier à votre `PATH`) : la bibliothèque Metal de MLX, `mlx-swift_Cmlx.bundle`, est à côté de lui et elle est chargée à l'exécution. |
| @@ -59,6 +60,7 @@ Le script n'écrase ni ne supprime jamais un lanceur `rzb` qu'il n'a pas écrit. | |||
| 59 | | Symptôme | Solution | | 60 | | Symptôme | Solution | |
| 60 | | --- | --- | | 61 | | --- | --- | |
| 61 | | La compilation échoue en compilant les shaders Metal de MLX (l'outil `metal` manque) | Lancez `xcodebuild -downloadComponent MetalToolchain`. | | 62 | | La compilation échoue en compilant les shaders Metal de MLX (l'outil `metal` manque) | Lancez `xcodebuild -downloadComponent MetalToolchain`. | |
| 63 | +| Un fichier `default.profraw` apparaît dans le dossier où `rzb` a tourné | `rzb` a été compilé sans `-enableCodeCoverage NO CLANG_ENABLE_CODE_COVERAGE=NO` : le scheme du package mesure la couverture des tests et instrumente aussi la compilation Release. Recompilez avec la commande ci-dessus (ou `scripts/install.sh`) et supprimez le fichier. | | ||
| 62 | | `Failed to load the default metallib` au chargement d'un modèle | `rzb` a été compilé avec `swift build`, ou copié loin de `mlx-swift_Cmlx.bundle`. Compilez avec `xcodebuild` comme ci-dessus et lancez-le depuis `Build/Products/Release`. | | 64 | | `Failed to load the default metallib` au chargement d'un modèle | `rzb` a été compilé avec `swift build`, ou copié loin de `mlx-swift_Cmlx.bundle`. Compilez avec `xcodebuild` comme ci-dessus et lancez-le depuis `Build/Products/Release`. | |
| 63 | 65 | ||
| 64 | ## Voir aussi | 66 | ## Voir aussi |
modified
scripts/install.sh +8 -1 | @@ -56,14 +56,21 @@ if [[ "$build" == true ]]; then | ||
| 56 | 56 | [[ "$(uname -s)" == Darwin && "$(uname -m)" == arm64 ]] \ |
| 57 | 57 | || fail "building needs a Mac with Apple Silicon (or pass --no-build)" |
| 58 | 58 | # Same folder as the development build: incremental, so a reinstall only compiles what changed. |
| 59 | + # The package scheme gathers code coverage for its tests, and Xcode then instruments the | |
| 60 | + # Release build too: rzb would write default.profraw in the current folder at every exit. | |
| 59 | 61 | xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \ |
| 60 | - -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation | |
| 62 | + -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation \ | |
| 63 | + -enableCodeCoverage NO CLANG_ENABLE_CODE_COVERAGE=NO | |
| 61 | 64 | fi |
| 62 | 65 | |
| 63 | 66 | [[ -x "$products/rzb" ]] || fail "$products/rzb not found: build first (drop --no-build)" |
| 64 | 67 | [[ -d "$products/mlx-swift_Cmlx.bundle" ]] \ |
| 65 | 68 | || fail "$products/mlx-swift_Cmlx.bundle not found (the MLX Metal library)" |
| 66 | 69 | check_launcher |
| 70 | +if grep -qa LLVM_PROFILE_FILE "$products/rzb"; then | |
| 71 | + echo "warning: $products/rzb is instrumented for code coverage (it writes default.profraw):" \ | |
| 72 | + "rebuild without --no-build" >&2 | |
| 73 | +fi | |
| 67 | 74 | |
| 68 | 75 | staging=$(mktemp -d) |
| 69 | 76 | trap 'rm -rf "$staging"' EXIT |
| @@ -56,14 +56,21 @@ if [[ "$build" == true ]]; then | |||
| 56 | [[ "$(uname -s)" == Darwin && "$(uname -m)" == arm64 ]] \ | 56 | [[ "$(uname -s)" == Darwin && "$(uname -m)" == arm64 ]] \ |
| 57 | || fail "building needs a Mac with Apple Silicon (or pass --no-build)" | 57 | || fail "building needs a Mac with Apple Silicon (or pass --no-build)" |
| 58 | # Same folder as the development build: incremental, so a reinstall only compiles what changed. | 58 | # Same folder as the development build: incremental, so a reinstall only compiles what changed. |
| 59 | + # The package scheme gathers code coverage for its tests, and Xcode then instruments the | ||
| 60 | + # Release build too: rzb would write default.profraw in the current folder at every exit. | ||
| 59 | xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \ | 61 | xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \ |
| 60 | - -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation | 62 | + -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation \ |
| 63 | + -enableCodeCoverage NO CLANG_ENABLE_CODE_COVERAGE=NO | ||
| 61 | fi | 64 | fi |
| 62 | 65 | ||
| 63 | [[ -x "$products/rzb" ]] || fail "$products/rzb not found: build first (drop --no-build)" | 66 | [[ -x "$products/rzb" ]] || fail "$products/rzb not found: build first (drop --no-build)" |
| 64 | [[ -d "$products/mlx-swift_Cmlx.bundle" ]] \ | 67 | [[ -d "$products/mlx-swift_Cmlx.bundle" ]] \ |
| 65 | || fail "$products/mlx-swift_Cmlx.bundle not found (the MLX Metal library)" | 68 | || fail "$products/mlx-swift_Cmlx.bundle not found (the MLX Metal library)" |
| 66 | check_launcher | 69 | check_launcher |
| 70 | +if grep -qa LLVM_PROFILE_FILE "$products/rzb"; then | ||
| 71 | + echo "warning: $products/rzb is instrumented for code coverage (it writes default.profraw):" \ | ||
| 72 | + "rebuild without --no-build" >&2 | ||
| 73 | +fi | ||
| 67 | 74 | ||
| 68 | staging=$(mktemp -d) | 75 | staging=$(mktemp -d) |
| 69 | trap 'rm -rf "$staging"' EXIT | 76 | trap 'rm -rf "$staging"' EXIT |
modified
scripts/release.sh +6 -1 | @@ -39,14 +39,19 @@ if [[ -z "$products" ]]; then | ||
| 39 | 39 | [[ "$(uname -s)" == Darwin && "$(uname -m)" == arm64 ]] \ |
| 40 | 40 | || fail "building needs a Mac with Apple Silicon (or pass --products <dir>)" |
| 41 | 41 | # Own derived-data folder: a release never reuses a Debug or half-updated development build. |
| 42 | + # The package scheme gathers code coverage for its tests, and Xcode then instruments the | |
| 43 | + # Release build too: rzb would write default.profraw in the current folder at every exit. | |
| 42 | 44 | xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \ |
| 43 | - -derivedDataPath .build/release -skipPackagePluginValidation -skipMacroValidation | |
| 45 | + -derivedDataPath .build/release -skipPackagePluginValidation -skipMacroValidation \ | |
| 46 | + -enableCodeCoverage NO CLANG_ENABLE_CODE_COVERAGE=NO | |
| 44 | 47 | products=.build/release/Build/Products/Release |
| 45 | 48 | fi |
| 46 | 49 | |
| 47 | 50 | [[ -x "$products/rzb" ]] || fail "$products/rzb not found" |
| 48 | 51 | [[ -d "$products/mlx-swift_Cmlx.bundle" ]] \ |
| 49 | 52 | || fail "$products/mlx-swift_Cmlx.bundle not found (the MLX Metal library)" |
| 53 | +! grep -qa LLVM_PROFILE_FILE "$products/rzb" \ | |
| 54 | + || fail "$products/rzb is instrumented for code coverage (it would write default.profraw)" | |
| 50 | 55 | |
| 51 | 56 | staging=$(mktemp -d) |
| 52 | 57 | trap 'rm -rf "$staging"' EXIT |
| @@ -39,14 +39,19 @@ if [[ -z "$products" ]]; then | |||
| 39 | [[ "$(uname -s)" == Darwin && "$(uname -m)" == arm64 ]] \ | 39 | [[ "$(uname -s)" == Darwin && "$(uname -m)" == arm64 ]] \ |
| 40 | || fail "building needs a Mac with Apple Silicon (or pass --products <dir>)" | 40 | || fail "building needs a Mac with Apple Silicon (or pass --products <dir>)" |
| 41 | # Own derived-data folder: a release never reuses a Debug or half-updated development build. | 41 | # Own derived-data folder: a release never reuses a Debug or half-updated development build. |
| 42 | + # The package scheme gathers code coverage for its tests, and Xcode then instruments the | ||
| 43 | + # Release build too: rzb would write default.profraw in the current folder at every exit. | ||
| 42 | xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \ | 44 | xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \ |
| 43 | - -derivedDataPath .build/release -skipPackagePluginValidation -skipMacroValidation | 45 | + -derivedDataPath .build/release -skipPackagePluginValidation -skipMacroValidation \ |
| 46 | + -enableCodeCoverage NO CLANG_ENABLE_CODE_COVERAGE=NO | ||
| 44 | products=.build/release/Build/Products/Release | 47 | products=.build/release/Build/Products/Release |
| 45 | fi | 48 | fi |
| 46 | 49 | ||
| 47 | [[ -x "$products/rzb" ]] || fail "$products/rzb not found" | 50 | [[ -x "$products/rzb" ]] || fail "$products/rzb not found" |
| 48 | [[ -d "$products/mlx-swift_Cmlx.bundle" ]] \ | 51 | [[ -d "$products/mlx-swift_Cmlx.bundle" ]] \ |
| 49 | || fail "$products/mlx-swift_Cmlx.bundle not found (the MLX Metal library)" | 52 | || fail "$products/mlx-swift_Cmlx.bundle not found (the MLX Metal library)" |
| 53 | +! grep -qa LLVM_PROFILE_FILE "$products/rzb" \ | ||
| 54 | + || fail "$products/rzb is instrumented for code coverage (it would write default.profraw)" | ||
| 50 | 55 | ||
| 51 | staging=$(mktemp -d) | 56 | staging=$(mktemp -d) |
| 52 | trap 'rm -rf "$staging"' EXIT | 57 | trap 'rm -rf "$staging"' EXIT |
modified
tools/host-runner/host_runner.py +6 -1 | @@ -47,7 +47,7 @@ def xcodebuild(action: str, scheme: str) -> list[str]: | ||
| 47 | 47 | Tests run in Debug, where `@testable import` is allowed; builds are Release. |
| 48 | 48 | """ |
| 49 | 49 | configuration = "Debug" if action == "test" else "Release" |
| 50 | - return [ | |
| 50 | + command = [ | |
| 51 | 51 | "xcodebuild", action, |
| 52 | 52 | "-scheme", scheme, |
| 53 | 53 | "-destination", "platform=macOS", |
| @@ -56,6 +56,11 @@ def xcodebuild(action: str, scheme: str) -> list[str]: | ||
| 56 | 56 | "-skipPackagePluginValidation", |
| 57 | 57 | "-skipMacroValidation", |
| 58 | 58 | ] |
| 59 | + if action != "test": | |
| 60 | + # Otherwise the scheme's test coverage instruments Release builds as well, and the | |
| 61 | + # binaries write default.profraw wherever they run. | |
| 62 | + command += ["-enableCodeCoverage", "NO", "CLANG_ENABLE_CODE_COVERAGE=NO"] | |
| 63 | + return command | |
| 59 | 64 | |
| 60 | 65 | |
| 61 | 66 | def run_command(scheme: str, body: dict, cwd: Path) -> list[str]: |
| @@ -47,7 +47,7 @@ def xcodebuild(action: str, scheme: str) -> list[str]: | |||
| 47 | Tests run in Debug, where `@testable import` is allowed; builds are Release. | 47 | Tests run in Debug, where `@testable import` is allowed; builds are Release. |
| 48 | """ | 48 | """ |
| 49 | configuration = "Debug" if action == "test" else "Release" | 49 | configuration = "Debug" if action == "test" else "Release" |
| 50 | - return [ | 50 | + command = [ |
| 51 | "xcodebuild", action, | 51 | "xcodebuild", action, |
| 52 | "-scheme", scheme, | 52 | "-scheme", scheme, |
| 53 | "-destination", "platform=macOS", | 53 | "-destination", "platform=macOS", |
| @@ -56,6 +56,11 @@ def xcodebuild(action: str, scheme: str) -> list[str]: | |||
| 56 | "-skipPackagePluginValidation", | 56 | "-skipPackagePluginValidation", |
| 57 | "-skipMacroValidation", | 57 | "-skipMacroValidation", |
| 58 | ] | 58 | ] |
| 59 | + if action != "test": | ||
| 60 | + # Otherwise the scheme's test coverage instruments Release builds as well, and the | ||
| 61 | + # binaries write default.profraw wherever they run. | ||
| 62 | + command += ["-enableCodeCoverage", "NO", "CLANG_ENABLE_CODE_COVERAGE=NO"] | ||
| 63 | + return command | ||
| 59 | 64 | ||
| 60 | 65 | ||
| 61 | def run_command(scheme: str, body: dict, cwd: Path) -> list[str]: | 66 | def run_command(scheme: str, body: dict, cwd: Path) -> list[str]: |
modified
tools/host-runner/test_host_runner.py +6 -0 | @@ -37,6 +37,12 @@ class CommandForTests(unittest.TestCase): | ||
| 37 | 37 | argv, _ = runner.command_for("test", {"project": ".", "scheme": "razorbill"}) |
| 38 | 38 | self.assertEqual(argv[:2], ["xcodebuild", "test"]) |
| 39 | 39 | self.assertEqual(argv[argv.index("-configuration") + 1], "Debug") |
| 40 | + self.assertNotIn("CLANG_ENABLE_CODE_COVERAGE=NO", argv) | |
| 41 | + | |
| 42 | + def test_release_builds_are_not_instrumented_for_coverage(self): | |
| 43 | + argv, _ = runner.command_for("build", {"project": ".", "scheme": "razorbill"}) | |
| 44 | + self.assertEqual(argv[argv.index("-enableCodeCoverage") + 1], "NO") | |
| 45 | + self.assertIn("CLANG_ENABLE_CODE_COVERAGE=NO", argv) | |
| 40 | 46 | |
| 41 | 47 | def test_run_passes_arguments_as_a_list(self): |
| 42 | 48 | argv, _ = runner.command_for( |
| @@ -37,6 +37,12 @@ class CommandForTests(unittest.TestCase): | |||
| 37 | argv, _ = runner.command_for("test", {"project": ".", "scheme": "razorbill"}) | 37 | argv, _ = runner.command_for("test", {"project": ".", "scheme": "razorbill"}) |
| 38 | self.assertEqual(argv[:2], ["xcodebuild", "test"]) | 38 | self.assertEqual(argv[:2], ["xcodebuild", "test"]) |
| 39 | self.assertEqual(argv[argv.index("-configuration") + 1], "Debug") | 39 | self.assertEqual(argv[argv.index("-configuration") + 1], "Debug") |
| 40 | + self.assertNotIn("CLANG_ENABLE_CODE_COVERAGE=NO", argv) | ||
| 41 | + | ||
| 42 | + def test_release_builds_are_not_instrumented_for_coverage(self): | ||
| 43 | + argv, _ = runner.command_for("build", {"project": ".", "scheme": "razorbill"}) | ||
| 44 | + self.assertEqual(argv[argv.index("-enableCodeCoverage") + 1], "NO") | ||
| 45 | + self.assertIn("CLANG_ENABLE_CODE_COVERAGE=NO", argv) | ||
| 40 | 46 | ||
| 41 | def test_run_passes_arguments_as_a_list(self): | 47 | def test_run_passes_arguments_as_a_list(self): |
| 42 | argv, _ = runner.command_for( | 48 | argv, _ = runner.command_for( |