Skip to content

cuda tests: kernel-contract no longer panics in ck_lane's prepare (Debug, ReleaseSafe) - #1073

Closed
jschmied wants to merge 1 commit into
ashhart:mainfrom
jschmied:contract-ck-lane-zeros
Closed

jschmied wants to merge 1 commit into
ashhart:mainfrom
jschmied:contract-ck-lane-zeros

Conversation

@jschmied

Copy link
Copy Markdown
Contributor

What this changes

tf-cuda-test kernel-contract built Debug or ReleaseSafe panics in contract_ck_lane.zig's prepare:
index out of bounds: index 1056768, len 1048576. The input's zero codes (rows * k bytes) were sliced from a
buffer of padded(n) * k bytes. At the n tile shapes the contract derives from the first served shape (129 rows,
n 64 and 128, k 8192) padded(n) is 128, one row short. The buffer is now @max(padded(n), rows) * k. ReleaseFast
read past the allocation; quant8 then overwrites the whole input, so no verdict depended on those bytes. Test code
only.

Receipt

  • Environment: TensorFold d1018b31 (main, 1.1.1) plus this branch; one DGX Spark (GB10, sm_121, CUDA 13.0, nvcc
    13.0.88). No checkpoint needed.
  • Exactness, decode speed, prompt speed: n/a, test code only.
  • tf-cuda-test kernel-contract (built -Dnvcc):
    • main, ReleaseSafe: panics at contract_ck_lane.zig:108, index 1056768, len 1048576, no SUMMARY.
    • main, ReleaseFast: SUMMARY 85 kernels: 85 pass gates 1-4, 0 fail, 0 known findings; 7 controls: 7 red as planted, 0 missed; 1533 limit problems
    • this branch, ReleaseFast, ReleaseSafe and Debug: the same SUMMARY. Every PASS/FAIL/control line equals main
      ReleaseFast's apart from timings and the atomic-add control's first differing byte; both ck_lane entries' lines
      are identical.
    • The 1533 limit problems are on main already; this does not touch them.
  • zig build test from an empty cache: 211/211 steps, 1401/1407 tests passed (6 skipped). zig fmt clean;
    tools/zig/lean_check.py count unchanged (444 before and after).
  • No new test: the Debug and ReleaseSafe bounds check is the regression check (ReleaseSafe panics on main; ReleaseSafe and Debug run through here).
  • Not run: Metal (no Mac change), other CUDA GPUs.

Checklist

  • Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off.
  • Drafted output equals "draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (No
    serving path changes.)
  • No precision traded for speed. If the bits change, the description says which sums change and why.
  • A new or changed GPU kernel is registered with the kernel contract (docs/kernel-contract.md); each backend's SUMMARY line is in the receipt. (No kernel
    changes; the CUDA SUMMARY lines are in the receipt.)
  • Prompt processing is no slower than the last release.
  • The description says which platforms I ran, Metal M1 to M5 and CUDA, and which I could not.
  • New tests fail before the change, pass after it, and skip cleanly without their dependency. (No new test; ReleaseSafe
    panics on main, ReleaseSafe and Debug run to SUMMARY here.)
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths. No AI attribution lines.

…eight

contract_ck_lane.zig took the input's zero codes (rows * k bytes) from a buffer
of padded(n) * k bytes. At the n tile shapes (129 rows, n 64 and 128, so
padded(n) is 128) the slice ran one row past the buffer: Debug and ReleaseSafe
builds of kernel-contract panicked, ReleaseFast read past the allocation.
ashhart added a commit that referenced this pull request Oct 21, 2026
…dits

The 1.1.2 section had no entries for the contributed pull requests carried into this release, so neither their
changes nor their authors reached the release notes. Add an entry for each, written from its commits: Flash Next's
CUDA prompt tiles and structured output (#1046, #1062), --thinking-reserve, the long-loop guard and the --vision
template diagnostic (#1064, #1075, #1076), GLM's Metal eh_proj tile and CUDA waiting ranks (#1066, #1053), M1's
simdgroup cap (#1055), Nemotron's CUDA image and shared-window fixes (#1057, #1058), Qwen's live-row expert routing
(#1047), the shared CUDA operators and contract fixture (#1056, #1068, #1070, #1071, #1073), the ROCm receipt,
drafter and draft-count work (#1043, #1044, #1045), the ModelOpt recipe numbers (#1042), the Windows host build
(#1034) and the session store's allocation-free rollback (#637). Thank #643's and #1060's reporters as the other
entries thank theirs.
@ashhart

ashhart commented Oct 21, 2026

Copy link
Copy Markdown
Owner

The ck_lane contract-fixture preparation fix is included in 1.1.2 (https://github.com/ashhart/TensorFold/releases/tag/v1.1.2), with your original authorship retained. Its zero buffer now covers both the input rows and padded weights, avoiding the out-of-bounds slice when the input is larger. Closing this as carried, and thank you.

It landed as 94ee4ca.

- Synthema, Ash's AI Assistant.

@ashhart ashhart closed this Oct 21, 2026
@jschmied
jschmied deleted the contract-ck-lane-zeros branch October 23, 2026 21:02
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.

2 participants