Skip to content

cuda tests: guard prompt positions in window rows fixtures - #1318

Closed
Maxrio9 wants to merge 1 commit into
ashhart:mainfrom
Maxrio9:fix/window-rows-zero-prefix
Closed

Maxrio9 wants to merge 1 commit into
ashhart:mainfrom
Maxrio9:fix/window-rows-zero-prefix

Conversation

@Maxrio9

@Maxrio9 Maxrio9 commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

What this changes

Fixes #1316. Prepare prompt positions as at + i, matching the fixture's p0, before considering decode-only position arithmetic. This avoids modulo zero for the existing valid zero-prefix prompt cases and mirrors the sibling window-attention fixture.

One line changes in the contract fixture. Decode-position coverage, GPU kernels and contract tolerances are unchanged.

Receipt

  • Source binding: GPU probes used the 67cc8fbc tree with the candidate fixture overlaid; this fixture and its dependencies are identical in 84e0d560. The overlaid file SHA256 is c940ab265f2e2afe48d88ca5ce442295f434f4cd2e6214dc24c63761bd11660c, matching commit 7b04b5edcba1e146cc98c5bcbf14965917c6beca.
  • Environment: base 84e0d560 (native source version 1.1.5), Zig 0.17.0; Linux x86_64 and aarch64 host checks; RTX PRO 4500 Blackwell (SM120), CUDA compiler 13.0.88. Synthetic fixtures only; checkpoint/model revision n/a.
  • Exactness and decode/prompt speed: n/a; this is a test-fixture preparation change, with no runtime call sites.
  • Before: the original prompt registration exited 136 in two isolated ReleaseFast runs. The full runner's divide-error trap maps to Rows.prepare:183. A ReleaseSafe probe reports integer division by zero. A copied expression reports division by zero in Debug on both CPU architectures; the ReleaseFast ARM result does not make modulo zero valid.
  • After: the zero-prefix P32/image prompt's nonfinite gate passes in ReleaseSafe. A separate diagnostic wrapper runs the first nine unchanged registrations/gates with the original seed and fatbins, reporting WROWS DIAGNOSTIC SUMMARY kernels=3 passed=3 failed=0 controls=6 caught=6 missed=0. This covers decode, zero/nonzero prefixes, P32/image prompts, BF16-P prompts and six corruption controls. This is a wrapper summary, not a full official-runner summary.
  • Host checks: zig build test-window-rows-host -j2 --summary all reports 4/4 steps and 8/8 tests passed on each architecture, 0 failed, 0 skipped. The existing zero-prefix device cases supply the regression; no new test is added.
  • Lean checker: 434 inherited findings before and after, 0 new. git diff --check passes.
  • Follow-up official run with both corrections: exit 124 at its 3,600-second guard (3,611.8 seconds including teardown), without a final SUMMARY. It passed the former zero-prefix crash and stopped after repeat cuda wide branch dim512 GQA16 mode1. The emitted lines contain 1,197 PASS, 82 caught corruption controls, two immediately matching registered KNOWN nonfinite cases and 43 N/A gate entries; no unexpected non-control FAIL or missed/error control was emitted. These are partial emitted-line counts, not a full-suite kernel summary. No global pass or device qualification is claimed. The immutable image was sha256:3e80f691fe02f524b29e677173a9b62e460b21c1487b8eb867dd135b81f9f105; driver 615.78.08, NVCC 13.0.88, RTX PRO 4500 SM120. The combined runner includes fixture commit 7b04b5edcba1e146cc98c5bcbf14965917c6beca, file SHA256 c940ab265f2e2afe48d88ca5ce442295f434f4cd2e6214dc24c63761bd11660c, and unmerged l2_ref: preserve signed-zero interval endpoints #1315 commit a3ce6a2f3d1d65094dcf32452fb8e8a4ce826814, reference file SHA256 e0c2ced997f66016d4a26022fa66f8fbd9eab0d7cec5b0f3b6c78ae9e94a7c1d. This is combined-run evidence, not a fixture-candidate-alone full-suite pass.
  • Not run: ARM CUDA device checks, Metal and HIP devices; the ARM host checks do not qualify GPU behavior.

Checklist

  • Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off. (n/a: fixture-only)
  • Drafted output equals "draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (n/a: fixture-only)
  • 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. (n/a: no kernel change)
  • Prompt processing is no slower than the last release. (n/a: fixture-only)
  • The description says which platforms I ran, Metal M1 to M5 and CUDA, and which I could not.
  • Existing zero-prefix prompt cases crash before the change and pass after it; no new test is added.
  • 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.

@ashhart

ashhart commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Thank you @Maxrio9. The same guard is on main as 3cb8cb5 (landed in 84e0d56..24072ec with your #1315 and #1308): prompt rows in the window_rows fixture now sit at p0 + i, as Call.at reads them, with a test for empty and long prefixes. So this one is covered and I'm closing it. Your note on #1284 is right too: its new zero-prefix cases now run on top of that fix.

- Synthema, Ash's AI Assistant.

@ashhart ashhart closed this Oct 25, 2026
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.

kernel-contract: window_rows prompt fixture computes modulo zero for empty prefixes

2 participants