bots-garden/razorbillpublic Fork
⑂ 21f251c
Commits
⬇ Clone ▾
git clone https://git.rickub.com/bots-garden/razorbill.git
git clone ssh://git@rickub.com/bots-garden/razorbill.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

#43: Mac tests green; compat.sh always rebuilds rzb

ConstrainedSmokeTests: greedy Qwen3-0.6B looped on an open-ended joke prompt
under json_object; use a factual prompt and check finish_reason first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
k33g committed 2026-11-25T19:30:48+01:00 Browse files
21f251c parent: e69a810
modified .memory/history.md +5 -0
@@ -230,3 +230,8 @@ reader; (2) the model did not know JSON was expected and planned prose while thi
230230 adding the schema instruction to the system message (measured 3/3 correct with vs prose in fields
231231 without). Decision taken without asking (strong evidence); flagged to the user. Linux tests 155,
232232 gate PASS (run #18). Mac re-run pending: the host-runner stayed busy with the server (see handoff).
233+Follow-up: Mac XCTest re-run after the fixes — 1 failure, `jsonObjectOutputIsAnObject`: greedy
234+Qwen3-0.6B looped ("tuna tuna…") to max_tokens on "Tell me a joke." once the JSON instruction was
235+added. Model degeneration, not a server bug: prompt changed to a factual question, and the test now
236+checks finish_reason == stop first (readable failure). Mac 178 pass. compat.sh fixed to always rebuild
237+(it would have tested a stale Release binary). Compat run on the Mac handed to the user.
@@ -230,3 +230,8 @@ reader; (2) the model did not know JSON was expected and planned prose while thi
230 adding the schema instruction to the system message (measured 3/3 correct with vs prose in fields230 adding the schema instruction to the system message (measured 3/3 correct with vs prose in fields
231 without). Decision taken without asking (strong evidence); flagged to the user. Linux tests 155,231 without). Decision taken without asking (strong evidence); flagged to the user. Linux tests 155,
232 gate PASS (run #18). Mac re-run pending: the host-runner stayed busy with the server (see handoff).232 gate PASS (run #18). Mac re-run pending: the host-runner stayed busy with the server (see handoff).
233+Follow-up: Mac XCTest re-run after the fixes — 1 failure, `jsonObjectOutputIsAnObject`: greedy
234+Qwen3-0.6B looped ("tuna tuna…") to max_tokens on "Tell me a joke." once the JSON instruction was
235+added. Model degeneration, not a server bug: prompt changed to a factual question, and the test now
236+checks finish_reason == stop first (readable failure). Mac 178 pass. compat.sh fixed to always rebuild
237+(it would have tested a stale Release binary). Compat run on the Mac handed to the user.
modified .memory/summary.md +3 -1
@@ -178,7 +178,9 @@ Server tests start the real server on a random port (`HummingbirdTesting` `.live
178178 the docs' curl examples (`Tests/Compatibility/`, deps via `uv`). It starts `rzb serve` with ids
179179 `chat` / `embed` / `unforced` (Llama, if cached) and stops it; `RZB_URL=…/v1` targets a running
180180 server instead. Linux = fake engine (protocol only, `real_model` tests skipped): 28 pass, 19 skip.
181-Mac (MLX, Qwen3-4B + bge-small + Llama-3.2-3B): 45/46 before the #43 fixes.
181+Mac (MLX, Qwen3-4B + bge-small + Llama-3.2-3B): 45/46 before the #43 fixes; re-run after them
182+awaits the user (run on the Mac). compat.sh always rebuilds rzb (incremental) unless RZB_BIN is set.
183+Tests 2026-11-25 after #43 fixes: Linux 155, Mac 178.
182184
183185 ## mlx-swift-lm API version trap
184186
@@ -178,7 +178,9 @@ Server tests start the real server on a random port (`HummingbirdTesting` `.live
178 the docs' curl examples (`Tests/Compatibility/`, deps via `uv`). It starts `rzb serve` with ids178 the docs' curl examples (`Tests/Compatibility/`, deps via `uv`). It starts `rzb serve` with ids
179 `chat` / `embed` / `unforced` (Llama, if cached) and stops it; `RZB_URL=…/v1` targets a running179 `chat` / `embed` / `unforced` (Llama, if cached) and stops it; `RZB_URL=…/v1` targets a running
180 server instead. Linux = fake engine (protocol only, `real_model` tests skipped): 28 pass, 19 skip.180 server instead. Linux = fake engine (protocol only, `real_model` tests skipped): 28 pass, 19 skip.
181-Mac (MLX, Qwen3-4B + bge-small + Llama-3.2-3B): 45/46 before the #43 fixes.181+Mac (MLX, Qwen3-4B + bge-small + Llama-3.2-3B): 45/46 before the #43 fixes; re-run after them
182+awaits the user (run on the Mac). compat.sh always rebuilds rzb (incremental) unless RZB_BIN is set.
183+Tests 2026-11-25 after #43 fixes: Linux 155, Mac 178.
182 184
183 ## mlx-swift-lm API version trap185 ## mlx-swift-lm API version trap
184 186
modified Tests/RazorbillMLXTests/ConstrainedSmokeTests.swift +8 -2
@@ -58,8 +58,14 @@ struct ConstrainedSmokeTests {
5858
5959 @Test func jsonObjectOutputIsAnObject() async throws {
6060 let response = try await complete(
61- try plan("Tell me a joke.", extra: #","response_format":{"type":"json_object"}"#))
62- let content = try #require(response.choices.first?.message.content)
61+ // Greedy Qwen3-0.6B loops on open-ended prompts ("Tell me a joke." repeated "tuna"
62+ // until max_tokens once the JSON instruction was added, #43): ask for facts.
63+ try plan(
64+ "Give the name, the country and the population of the capital of France.",
65+ extra: #","response_format":{"type":"json_object"}"#))
66+ let choice = try #require(response.choices.first)
67+ let content = choice.message.content ?? ""
68+ #expect(choice.finishReason == .stop, "truncated: \(content)")
6369 #expect(try JSONSerialization.jsonObject(with: Data(content.utf8)) is [String: Any])
6470 }
6571
@@ -58,8 +58,14 @@ struct ConstrainedSmokeTests {
58 58
59 @Test func jsonObjectOutputIsAnObject() async throws {59 @Test func jsonObjectOutputIsAnObject() async throws {
60 let response = try await complete(60 let response = try await complete(
61- try plan("Tell me a joke.", extra: #","response_format":{"type":"json_object"}"#))61+ // Greedy Qwen3-0.6B loops on open-ended prompts ("Tell me a joke." repeated "tuna"
62- let content = try #require(response.choices.first?.message.content)62+ // until max_tokens once the JSON instruction was added, #43): ask for facts.
63+ try plan(
64+ "Give the name, the country and the population of the capital of France.",
65+ extra: #","response_format":{"type":"json_object"}"#))
66+ let choice = try #require(response.choices.first)
67+ let content = choice.message.content ?? ""
68+ #expect(choice.finishReason == .stop, "truncated: \(content)")
63 #expect(try JSONSerialization.jsonObject(with: Data(content.utf8)) is [String: Any])69 #expect(try JSONSerialization.jsonObject(with: Data(content.utf8)) is [String: Any])
64 }70 }
65 71
modified scripts/compat.sh +6 -4
@@ -34,17 +34,19 @@ fi
3434 is_cached() { [[ -d "$HUB/models--${1//\//--}" ]]; }
3535
3636 if [[ "$(uname)" == "Darwin" ]]; then
37- RZB_BIN="${RZB_BIN:-.build/xcode/Build/Products/Release/rzb}"
38- if [[ ! -x "$RZB_BIN" ]]; then
37+ if [[ -z "${RZB_BIN:-}" ]]; then # incremental: never test a stale binary
3938 xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \
4039 -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation -quiet
40+ RZB_BIN=.build/xcode/Build/Products/Release/rzb
4141 fi
4242 for model in "$RZB_COMPAT_CHAT_SOURCE" "$RZB_COMPAT_EMBED_SOURCE"; do
4343 is_cached "$model" || { echo "missing model: run rzb models pull $model" >&2; exit 1; }
4444 done
4545 else
46- RZB_BIN="${RZB_BIN:-.build/linux/debug/rzb}"
47- swift build --scratch-path .build/linux --product rzb >&2
46+ if [[ -z "${RZB_BIN:-}" ]]; then
47+ swift build --scratch-path .build/linux --product rzb >&2
48+ RZB_BIN=.build/linux/debug/rzb
49+ fi
4850 fi
4951
5052 work="$(mktemp -d)"
@@ -34,17 +34,19 @@ fi
34 is_cached() { [[ -d "$HUB/models--${1//\//--}" ]]; }34 is_cached() { [[ -d "$HUB/models--${1//\//--}" ]]; }
35 35
36 if [[ "$(uname)" == "Darwin" ]]; then36 if [[ "$(uname)" == "Darwin" ]]; then
37- RZB_BIN="${RZB_BIN:-.build/xcode/Build/Products/Release/rzb}"37+ if [[ -z "${RZB_BIN:-}" ]]; then # incremental: never test a stale binary
38- if [[ ! -x "$RZB_BIN" ]]; then
39 xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \38 xcodebuild build -scheme razorbill -destination 'platform=macOS' -configuration Release \
40 -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation -quiet39 -derivedDataPath .build/xcode -skipPackagePluginValidation -skipMacroValidation -quiet
40+ RZB_BIN=.build/xcode/Build/Products/Release/rzb
41 fi41 fi
42 for model in "$RZB_COMPAT_CHAT_SOURCE" "$RZB_COMPAT_EMBED_SOURCE"; do42 for model in "$RZB_COMPAT_CHAT_SOURCE" "$RZB_COMPAT_EMBED_SOURCE"; do
43 is_cached "$model" || { echo "missing model: run rzb models pull $model" >&2; exit 1; }43 is_cached "$model" || { echo "missing model: run rzb models pull $model" >&2; exit 1; }
44 done44 done
45 else45 else
46- RZB_BIN="${RZB_BIN:-.build/linux/debug/rzb}"46+ if [[ -z "${RZB_BIN:-}" ]]; then
47- swift build --scratch-path .build/linux --product rzb >&247+ swift build --scratch-path .build/linux --product rzb >&2
48+ RZB_BIN=.build/linux/debug/rzb
49+ fi
48 fi50 fi
49 51
50 work="$(mktemp -d)"52 work="$(mktemp -d)"