Skip to content

build: run the three bounded top-k selection tests in a fast host step - #4095

Merged
ashhart merged 3 commits into
ashhart:mainfrom
jschmied:core-lanes-select-step
Nov 20, 2026
Merged

ashhart merged 3 commits into
ashhart:mainfrom
jschmied:core-lanes-select-step

Conversation

@jschmied

Copy link
Copy Markdown
Contributor

What and why

Follow-up to #3214, from ashhart's comment: the three selection tests #3214 moved into core/lanes/sampling_row_topk.zig ran only in the full zig build test after test-qwen35-metal-host dropped them by name. This adds one filtered host step that runs exactly those three, next to the step that used to run them (zig/build/qwen35_cache_host.zig, +3 lines). No source change.

Part of #2460 (item 3).

Step

zig build test-lanes-topk-host: rooted at zig/src/core/lanes/sampling_row_topk.zig, host target, debug, filters:

  • bounded BF16 keys
  • the blocked selection
  • a non-finite word inside

Run on head 561f5e3 (aarch64 Linux, zig 0.17.0)

1/4 sampling_row_topk.test.bounded BF16 keys preserve numeric order ...OK
2/4 sampling_row_topk.test.the blocked selection equals the scalar walk ...OK
3/4 sampling_row_topk.test.a non-finite word inside a block the selection skips is still refused...OK
4/4 grammar.test_0...OK
run test 4 pass (4 total) 112ms

The 3 named tests run. The fourth is grammar.zig's unnamed test {} import block, which Zig runs under any matching filter; it has no assertions of its own.
test-qwen35-metal-host still passes (10 of 10).

Planted control

Changing the expected error at sampling_row_topk.zig:136 to error.OutOfMemory fails the step by name, exit 1:

run test 3 pass, 1 fail (4 total)
error: 'sampling_row_topk.test.a non-finite word inside a block the selection skips is still refused' failed:
       expected error.OutOfMemory, found error.NonfiniteLogits

Plant reverted before the commit.

Not applicable: no opt-in path, kernel, refusal, served path or speed change; the step only runs existing tests. python3 tools/pr_check.py --base origin/main: 0 errors (the one warning asks for the PR number for the Unreleased line).

Proposed CHANGELOG line

@ashhart

ashhart commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Thanks @jschmied for restoring focused coverage of these three tests. The new host step is rooted at sampling_row_topk.zig and filters exactly the bounded BF16, blocked-selection and non-finite-word cases.

The fourth imported grammar.zig test block is explained in the receipt, and the planted expected-error change proves the non-finite refusal can fail the step by name. The unchanged Qwen Metal host suite still passes 10/10.

The three-line build-only diff applies cleanly to current main and changes no inference source. I found no remaining issue. It goes on a landing train now.

  • Synthena

@AIFlowML

Copy link
Copy Markdown
Contributor

Independent M5 Max check with Zig 0.17.0 on a clean trial merge of 561f5e3f into b7298b4e:

zig build test-lanes-topk-host test-qwen35-metal-host -Dcpu=apple_m1 -j5 --summary all

All 14 tests passed. I ran the focused binary directly to confirm it includes all three named selection cases and the grammar import block. The existing Qwen Metal host target still passed 10/10. The new command runs without a checkpoint or a GPU workload on macOS.

Igor Lessio - AIFLOW LABS

@ashhart
ashhart force-pushed the core-lanes-select-step branch from 561f5e3 to 44af3a3 Compare November 20, 2026 20:38
@ashhart
ashhart merged commit 5e9759a into ashhart:main Nov 20, 2026
ashhart added a commit that referenced this pull request Nov 20, 2026
@ashhart

ashhart commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Thank you @jschmied. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants