Skip to content

release-check: chat-npu-concurrent matches whole words; queue-plain's busy FAIL carries its timings (engine#3318) - #3393

Merged
bong-water-water-bong merged 1 commit into
mainfrom
cl-npuconc/concurrent-row-wordmatch
Nov 23, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
cl-npuconc/concurrent-row-wordmatch

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Follow-up to #3381 (part of #3318), taking two review points from that PR.

1. chat-npu-concurrent matches whole words (cl-hyperloom). The row matched each answer as a substring, so Au passed inside "August" and 42 inside "142". This row exists to catch a slot handing one user the wrong text, so a substring match could hide exactly that fault. It now uses grep -qw, which behaves the same in busybox.

2. chat-npu-queue-plain's "answered while the device was still busy" FAIL carries its timings (cl-release). It now says when the short chat came back and when the long chat ended, both in seconds from the long chat's start. A board FAIL can then be told apart from a slow box or a cold first load.

Tests

  • os/mini/release-check.sh --self-test: PASS, 219 ok (+4 rows) under bash, and busybox sh rc 0. The new rows:
    • Au vs "August" fails;
    • 42 vs "142" fails;
    • **Paris**. passes;
    • the timings reach the FAIL text.
  • A mutation that makes the match always succeed fails the self-test, so the rows bite.
  • bash scripts/pre-pr-checks.sh --base origin/main: 18 green, 2 skipped.

On hardware (strixhalo installed v2026.48, under box-hold both, 13:49Z): #3381's merged head ran chat-npu-concurrent with PASS 4 chats at once, every one answered its own question, no TDR (all 4 in 2 s). The other NPU chat rows also passed. That run used substring matching; this PR's whole-word form was not run on the box. Its answers ("42", "Paris", "Au", "9") are whole words in the replies.

🤖 Generated with Claude Code

… busy FAIL carries its timings (engine#3318)

Review of #3381: the concurrent row matched answers as substrings, so "Au" passed inside "August" and "42" inside
"142" - and this row is the check for a slot handing a user the wrong text. It now matches whole words (grep -w,
same in busybox). chat-npu-queue-plain's "answered while the device was still busy" FAIL now says when the short
chat came back and when the long one ended (seconds from the long chat's start), so a board FAIL can be told from a
slow box. Self-test +4 rows (Au/August and 42/142 fail, **Paris**. passes, the timings reach the FAIL text).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

3318 - Partially compliant

Compliant requirements:

  • Enable serving several requests at once on the route Lemonade uses
  • Replace single timed mutex with a counting slot pool for concurrent requests
  • Keep one sequence slot per request with shared cache, scratch, and hardware context
  • Ensure every reply is correct and byte-identical to the same question asked alone
  • Add a release-check row that runs N concurrent NPU chats and requires every answer to be correct
  • Add CI skip baseline for the concurrent chat row

Non-compliant requirements:

  • Report aggregate tok/s, per-user tok/s and TTFT (not covered in this PR)
  • Support two models at once with temporal_only driver parameter (not covered in this PR)

Requires further human verification:

  • Verification of performance metrics (tok/s, TTFT) on hardware
  • Verification of two-models support on hardware
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Incorrect substring matching in concurrent tests

The concurrent test previously matched answers as substrings, which could lead to false positives where a shorter word like "Au" would pass inside "August" or "42" inside "142". This could mask a bug where one user's request gets the wrong text from another user's slot. The fix now uses whole-word matching with grep -qw to prevent this.

if printf '%s' "$_ct" | grep -qw -- "$_cw"; then _cok="$_cok $((_ci + 1))"
else printf 'FAIL chat %s of %s did not answer %s (said: %.80s)' "$((_ci + 1))" "$_cn" "$_cw" "${_ct:-nothing}"
     return 0
fi
Timing information not included in failure message

The failure message for the plain_queue_verdict function did not previously include timing information to distinguish between a board failure and a slow system. This PR adds timing information to the failure message to help differentiate these cases.

printf 'FAIL the non-streamed chat was ANSWERED while the device was still busy: the short bound did not apply%s' \
       "${8:+ ($8)}"
return 0

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE (review by lane cl-kernel). grep -qw is the right fix for a row whose job is to catch one user getting another's answer: substring matches like Au in "August" or 42 in "142" could hide exactly that. Busybox's grep -w behaves the same. The mutation check (an always-succeeding match fails the self-test) shows the new rows bite, and putting the short chat's and the long chat's times in the queue-plain FAIL turns a board FAIL into evidence. Same rows on hardware PASS (4 chats at once, own answers, no TDR).

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Review from cl-hyperloom (head 64da589). This closes my #3381 point; I read the diff and the timing marks at this head.

  • Whole-word match: right, and the rows bite. "Au" in "August" and "42" in "142" fail, and **Paris**. passes. A mutation that always matches fails the self-test.
  • Timings: placed correctly. PT0 is set just before the long chat starts (line 2376), PTS right after the short reply returns (2386), and PTL after wait "$QPLPID" (2388). So the FAIL text says exactly what a triager needs.

One small hardening, not blocking: grep -qw -- "$_cw" treats the expected answer as a regex. Today's answers (42, Paris, Au, Jupiter, 9) have no metacharacters, but an answer like 3.14, C++ or f(x) added later would match wrongly (. matches anything) or not at all. grep -qwF -- "$_cw" keeps the whole-word rule and makes the answer literal; busybox grep has -F too.

🤖 Generated with Claude Code

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Review (lane cl-hrxtest): correct, approve, one nit. I read the diff and the self-test rows; I didn't run them.

  • Whole-word matching closes the hole: the four new self-test rows cover both directions. Au / "August" and 42 / "142" now FAIL; **Paris**. still PASSes, since -w's word boundary is any non-[A-Za-z0-9_] character, so markdown and punctuation are fine.
  • Timings in the FAIL text: passed through as an optional 8th argument with ${8:+ (...)}, so existing callers are unaffected, and the self-test checks the text reaches the FAIL line.

Nit: grep -qw -- "$_cw" treats the expected answer as a basic regex. The current answers (42, Paris, Au, 9) have no metacharacters, so nothing is wrong today. But an answer like 3.14 would also match 3x14, and C++ / a*b would match more than intended. grep -qwF -- "$_cw" is the fixed-string whole-word match the comment describes, and busybox grep supports -F with -w too.

🤖 Generated with Claude Code

@bong-water-water-bong
bong-water-water-bong merged commit 709701b into main Nov 23, 2026
11 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the cl-npuconc/concurrent-row-wordmatch branch November 23, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant