Skip to content

test(turbo): exercise the steel kernel and classify #1712 failures - #2318

Merged
inureyes merged 2 commits into
mainfrom
fix/issue-1712-delegated-steel-envelope-diagnostics
Oct 15, 2026
Merged

inureyes merged 2 commits into
mainfrom
fix/issue-1712-delegated-steel-envelope-diagnostics

Conversation

@inureyes

Copy link
Copy Markdown
Member

Summary

Classify the #1712 failure as far as the evidence allows, make the next recurrence self-classifying, and fix a coverage gap found on the way: the "steel envelope" test has not exercised the steel kernel since May.

Findings

The test never reached the steel kernel. update_and_turbo4_delegated_attention tries the dequant-first SDPA route first, and that route has been default-on since f77e98b (2026-05-08, two days after the test landed in 09d9cc6). Under the default env the wrapper returns before attention_turbo4_delegated_steel, and nothing else calls it. So the test, and the launcher CONTRIBUTING.md names for post-pin-bump re-validation, compared dequant-first SDPA against the cold-only composition. The 4.6824e-1 came from that pairing, not from turbo4_delegated_steel_sdpa.

The wrong value is "cold V contribution dropped". I rebuilt step 0 (cold_offset=8, hot_offset=1, same seeds) on CUDA and measured candidate wrong outputs against the graph reference. Attention with the cold V rows zeroed sits at RMS 4.6820e-1, 4e-5 from the reported 4.6824e-1 (the two correct paths differ by about 1.4e-4). The next closest candidates are far off: K read at full buffer capacity 4.03e-1, all-zero output 5.12e-1, hot V dropped 5.15e-2, missing inverse rotation 7.85e-1. So on one side the cold contribution was all zeros: either the bulk rotated-dequant output (dequant-SDPA route), the cold weighted-sum output (cold-only route), or a zero v_rescale. A never-written fresh Metal buffer reads as zeros, which explains why the value repeated to five digits while the failure itself was rare. The value alone cannot tell which side or which of these.

It has not recurred. Nightly verify since 2026-09-08: 48 runs. 44 ran the test and all 44 passed (0accedd through 537ebe1, four Mac minis). One run failed before the test step (38430123889) and one was cancelled. Six of the passes ran on MLX 243bdf09 (PR #2304 branch and main after the merge). Every nightly passes --test-threads=1, while both failures came from multi-threaded workspace gates. That fits the shared-device hazard of #163/#1008 but does not prove it. In this window the delegated kernel source changed only by #2029 (dispatch through select_kernel_port, kernel bodies untouched), the #2305 move, and the #1796 header update. A code read of the three launchers found no unwritten output region, out-of-bounds index, or missing barrier.

Changes

  • New test-only cache/delegated_parity_diag.rs. On failure it reports the route gates, a comparison of the two caches' K, packed V, rescale and hot V, each observed output against the graph reference (with the max-abs location), the dropped-contribution signatures, and an in-process re-run of every route on both caches. Thresholds are unchanged.
  • Both steel tests now also call attention_turbo4_delegated_steel directly, and still check the wrapper's output, so the pairing that failed keeps its coverage.

Test plan

  • CUDA (GB10): new cache::delegated_parity_diag_tests (2 tests) pass and run the full report path. The step-0 candidate table above comes from a throwaway test on the same binary.
  • The two macOS-gated tests compile on Linux with their gate lifted (clippy -D warnings, --lib --tests). Gate restored before commit.
  • Metal: Nightly verify dispatched on this branch, run 38777513435, pending. The steel kernel has not been tested since May, so a red result here is a real finding, not noise.

Refs #1712

The steel-envelope parity test reached attention_turbo4_delegated_steel only through update_and_turbo4_delegated_attention, which has returned from the default-on dequant-first SDPA route since f77e98b, so the steel launcher had no test. Both steel tests now call it directly and still hold the wrapper's output to the same bound.

On failure the tests panic with a report from the new test-only cache/delegated_parity_diag.rs: route gates, a comparison of both caches' state, each output against the graph reference with its max-abs location, dropped-contribution signatures, and an in-process re-run of every route. Thresholds are unchanged. The #1712 value 4.6824e-1 matches the cold-V-dropped signature (4.6820e-1) reproduced on CUDA.

Validated on CUDA: the new diag tests pass, and clippy -D warnings is clean with the macOS gate lifted.

Refs #1712
@inureyes inureyes added status:done Completed type:test Test related changes priority:low Low priority area:core mlxcel-core: MLX FFI, primitives, KV cache, layers labels Oct 15, 2026
@inureyes
inureyes merged commit 2777f66 into main Oct 15, 2026
26 checks passed
@inureyes
inureyes deleted the fix/issue-1712-delegated-steel-envelope-diagnostics branch October 15, 2026 17:55
@inureyes inureyes added this to the 0.8 milestone Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core mlxcel-core: MLX FFI, primitives, KV cache, layers priority:low Low priority status:done Completed type:test Test related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant