interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

GitHub aien-dev/omega-mv#406 (code only)

closed derived 9b4f973ea0675426 #406

Imported from GitHub aien-dev/omega-mv#406 (code only)

GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed).

Base c74fe6e53403167ba56d438854f284aba6788ae6 · Head 6b52462634bc4985ac7b0ad908aaad923e24df0a

Apply it

git checkout -b patch-9b4f973ea0675426 c74fe6e53403167ba56d438854f284aba6788ae6
curl -fsSL https://interplane.io/drakestapleton/omega-mv/patches/9b4f973ea0675426.patch | git am

Raw patch (mbox) · Diff

Provenance

This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record:

github-import 1
aien-dev/omega-mv
406
6b52462634bc4985ac7b0ad908aaad923e24df0a
{"kind":"github-import","owner":"aien-dev","repo":"omega-mv","number":406,"url":"https://github.com/aien-dev/omega-mv/pull/406","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:37:46Z","metadata":"unavailable","state_derived":true}

Changes

diff --git a/.crumb b/.crumb
index 75e7cabc9..cc616f81a 100644
--- a/.crumb
+++ b/.crumb
@@ -87,14 +87,14 @@
           "purpose": "Directory spec. Purpose not yet described by a human."
         },
         {
-          "digest": "e68f3e4b6e3f06cf4344bf8e57eb0b1d14e8ccefc9e0047bca02e4e68954840e",
-          "last_commit": "fa60e89a",
+          "digest": "74dd1cf62bb487f5c421f1e4290e0d5a90e49dc7a92076549721f7f9713efbb8",
+          "last_commit": "1e6dfa90",
           "name": "src",
           "purpose": "Directory src. Purpose not yet described by a human."
         },
         {
-          "digest": "0713f610eacc8c4279a0f58379d061a1ec57ca60efd1595fb6fc91868fda5c23",
-          "last_commit": "fa60e89a",
+          "digest": "e59264059051e10ee92dea5caafb09147f1c0c41b6a9eb81427cc6174def0a99",
+          "last_commit": "1e6dfa90",
           "name": "tests",
           "purpose": "Directory tests. Purpose not yet described by a human."
         },
@@ -105,15 +105,15 @@
           "purpose": "Directory tools. Purpose not yet described by a human."
         }
       ],
-      "children_root": "sha256:39a1eb06a2eff06139365aa02b6136288c2b6fb58f7301d376943b64b6160445",
-      "compiled_at": "2026-10-12T05:17:54Z",
+      "children_root": "sha256:a953af5fdd1a4235e4d8bfcb2b54f033acef97313676e86434cee60f5c9c5ad9",
+      "compiled_at": "2026-10-12T06:04:50Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:66f21b04513a8f6d947c440633c416039a7be2126ed0b6056c7356e9dc4184c6",
+      "digest": "sha256:61b5e122ea6b024ad7fd6435a5222deca840eba9c8166f5489340ed94f786f8c",
       "evidence_files": 7245,
       "evidence_root": "sha256:035beef5cdb99afaefd1743640f5e7eeaaed13c4a5ec6c8b4b6a4cb0c528407a",
       "files": 9732,
-      "generated_at_commit": "6e6f1c8e27b4f3a511bb284e7f51f2a957863ded",
-      "source_tree": "sha256:2525062496c1e32058276076772ebca47d19e3bee1d0566050226e6d5934f9ae"
+      "generated_at_commit": "1e6dfa909f2ea951f99597dd68bb89fd62ac2291",
+      "source_tree": "sha256:7e228749e3ccd7483a117d513a98994675b2c49289228e05d04f684c6f8c53b4"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/src/.crumb b/src/.crumb
index 5508890c5..2dae93978 100644
--- a/src/.crumb
+++ b/src/.crumb
@@ -176,14 +176,14 @@
         }
       ],
       "children_root": "sha256:ce7e4b528bec54e15d5f9525026d958e6eab78b88614c65b8e7c51d44c0243af",
-      "compiled_at": "2026-10-12T05:08:10Z",
+      "compiled_at": "2026-10-12T06:04:50Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:e68f3e4b6e3f06cf4344bf8e57eb0b1d14e8ccefc9e0047bca02e4e68954840e",
+      "digest": "sha256:74dd1cf62bb487f5c421f1e4290e0d5a90e49dc7a92076549721f7f9713efbb8",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 451,
-      "generated_at_commit": "fa60e89a1e349a9cb33e6b0d7b548190496b2c40",
-      "source_tree": "sha256:f756c580cf486797b0ba4cb905f784fa68004d7249e302704a9112dac908ab0b"
+      "generated_at_commit": "1e6dfa909f2ea951f99597dd68bb89fd62ac2291",
+      "source_tree": "sha256:21b0010475caae87009c904b3a3156df6c586c7c1bca28c061af049f02eb1cbe"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/src/omega_gpu_attention_api.c b/src/omega_gpu_attention_api.c
index eca045bc9..728ceceff 100644
--- a/src/omega_gpu_attention_api.c
+++ b/src/omega_gpu_attention_api.c
@@ -756,6 +756,26 @@ int omega_gpu_attention_reserve(uint32_t max_context, uint32_t max_seqs, uint32_
     return rc;
 }
 
+int omega_gpu_attention_reserve_rows(uint32_t max_rows, uint32_t num_q_heads, uint32_t head_dim) {
+    if (max_rows == 0 || num_q_heads == 0 || num_q_heads > OMEGA_GPU_ATTN_MAX_Q_HEADS || (head_dim != 64u && head_dim != 128u)) {
+        omega_gpu_session_set_error("attention reserve rows: bad bound");
+        return OMEGA_GPU_ATTN_BAD_ARGS;
+    }
+    uint32_t per = OMEGA_GPU_ATTN_ROWS_MAX_CTAS / num_q_heads;
+    if (per == 0) per = 1;
+    if (per > max_rows) per = max_rows;
+    const size_t qo = (size_t)per * num_q_heads * head_dim * 4u, tab = (size_t)per * 8u;
+    LOCK();
+    int rc = OMEGA_GPU_ATTN_OK;
+    if (g_sim) rc = OMEGA_GPU_ATTN_OK;
+    else if (dev_open_locked() != OMEGA_GPU_ATTN_OK) rc = OMEGA_GPU_ATTN_CHIP_FAIL;
+    else if ((qo > g_q.cap && omega_gpu_session_scratch_reserve(&g_q, qo)) ||
+             (qo > g_out.cap && omega_gpu_session_scratch_reserve(&g_out, qo)) ||
+             (tab > g_tab.cap && omega_gpu_session_scratch_reserve(&g_tab, tab)))
+        rc = OMEGA_GPU_ATTN_CHIP_FAIL; /* growth failed; whatever grew stays reserved at its larger size */
+    UNLOCK();
+    return rc;
+}
 void omega_gpu_attention_unreserve(void) {
     LOCK();
     omega_gpu_session_scratch_unreserve(&g_pool); omega_gpu_session_scratch_unreserve(&g_q);
@@ -840,6 +860,64 @@ int omega_gpu_gqa_attention_f32(const float *q, const float *k_cache, const floa
     return rc;
 }
 
+/* Rows per launch of the rows path: the CTA bound, then (under a reservation) what the q buffer holds. Caller holds the lock. */
+static uint32_t rows_per_launch(uint32_t num_rows, uint32_t num_q_heads, size_t row_bytes) {
+    uint32_t per = OMEGA_GPU_ATTN_ROWS_MAX_CTAS / num_q_heads;
+    if (per == 0) per = 1;
+    if (per > num_rows) per = num_rows;
+    if (!g_sim && g_q.reserved && g_q.cap >= row_bytes) {
+        size_t fit = g_q.cap / row_bytes;
+        if (fit < per) per = (uint32_t)fit;
+    }
+    return per;
+}
+
+int omega_gpu_gqa_attention_rows_f32(const float *q, const float *k_cache, const float *v_cache,
+                                     uint32_t base_len, uint32_t num_rows, uint32_t num_q_heads,
+                                     uint32_t num_kv_heads, uint32_t head_dim, float *out, OmegaGpuAttnInfo *info) {
+    uint64_t t0 = now_ns();
+    if (!q || !k_cache || !v_cache || !out || num_rows == 0) return OMEGA_GPU_ATTN_BAD_ARGS;
+    uint32_t log2gqa;
+    int rc = check_heads(num_q_heads, num_kv_heads, head_dim, &log2gqa);
+    if (rc != OMEGA_GPU_ATTN_OK) return rc;
+    if ((uint64_t)base_len + num_rows > OMEGA_GPU_ATTN_MAX_GQA_CTX) return OMEGA_GPU_ATTN_TOO_LARGE;
+    const uint32_t HD = head_dim, total = base_len + num_rows;
+    const size_t row = (size_t)num_q_heads * HD;
+    Slot *ks = NULL;
+    const uint32_t log2bs = 12; /* one block of 4096 slots, as the single-row call */
+    rc = begin(true, log2bs, log2gqa, HD, &ks, info);
+    if (rc != OMEGA_GPU_ATTN_OK) return rc;
+    /* the whole context (every row's keys are a prefix of it) staged once */
+    size_t plane = (size_t)total * num_kv_heads * HD * 4;
+    void *host_tmp = NULL;
+    int stage_rc;
+    uint8_t *pool = stage_target(2 * plane, &host_tmp, &stage_rc);
+    if (!pool) { UNLOCK(); return stage_rc; }
+    memcpy(pool, k_cache, plane);
+    memcpy(pool + plane, v_cache, plane);
+    if (info) { info->kv_bytes_staged += 2 * plane; info->kv_bytes_naive += (uint64_t)num_rows * 2 * plane; info->kv_blocks_logical += num_rows; info->kv_blocks_unique += 1; }
+    const uint32_t per = rows_per_launch(num_rows, num_q_heads, row * 4);
+    /* table of one launch: per block ids (all 0: the one staged block), then per context lengths */
+    uint32_t *tab = calloc(2 * (size_t)per, sizeof *tab);
+    if (!tab) { free(host_tmp); UNLOCK(); return OMEGA_GPU_ATTN_CHIP_FAIL; }
+    for (uint32_t r0 = 0; r0 < num_rows && rc == OMEGA_GPU_ATTN_OK; r0 += per) {
+        const uint32_t nr = num_rows - r0 < per ? num_rows - r0 : per;
+        for (uint32_t i = 0; i < nr; i++) { tab[i] = 0; tab[nr + i] = base_len + r0 + i + 1; }
+        Launch L = {
+            .q = q + (size_t)r0 * row, .q_bytes = (size_t)nr * row * 4, .pool = pool, .pool_bytes = 2 * plane,
+            .tab = tab, .tab_bytes = (size_t)2 * nr * 4, .out = out + (size_t)r0 * row, .out_bytes = (size_t)nr * row * 4,
+            .grid_x = num_q_heads, .grid_y = nr,
+            .params = { 1, f2u(score_scale(HD)), (uint32_t)(2 * plane), num_kv_heads * HD * 4, (uint32_t)plane, HD * 4, num_q_heads, nr * 4 }
+        };
+        rc = launch(ks, &L, info);
+    }
+    free(tab);
+    free(host_tmp);
+    UNLOCK();
+    if (info) info->call_ns = now_ns() - t0;
+    return rc;
+}
+
 /* Paged path shared by the single and batched entries. tables[s] has n_blocks[s] entries
  * (already filtered of negatives), ctx[s] the context length. */
 static int paged_core(const float *q, const uint8_t *pool, const OmegaGpuKvLayout *ly,
diff --git a/src/omega_gpu_attention_api.h b/src/omega_gpu_attention_api.h
index 999e8630b..78e943dee 100644
--- a/src/omega_gpu_attention_api.h
+++ b/src/omega_gpu_attention_api.h
@@ -123,6 +123,20 @@ int omega_gpu_gqa_attention_f32(const float *q, const float *k_cache, const floa
                                 uint32_t seq_len, uint32_t num_q_heads, uint32_t num_kv_heads,
                                 uint32_t head_dim, float *out, OmegaGpuAttnInfo *info);
 
+/* Contiguous f32 KV, many query rows in one call (the prompt read, 2026-10-12). q and out are
+ * [num_rows][num_q_heads][head_dim]; k_cache and v_cache hold base_len + num_rows tokens as
+ * [token][num_kv_heads][head_dim]. Row i attends over the first base_len + i + 1 tokens (causal:
+ * its own token and everything before it). The KV is staged once per call; the rows go to the
+ * chip in launches of up to OMEGA_GPU_ATTN_ROWS_MAX_CTAS / num_q_heads rows (grid y = row, the
+ * same kernel as omega_gpu_gqa_attention_f32, so one row per launch is bit-identical to that
+ * call). Under a serving reservation the rows per launch are also bounded by the q buffer
+ * omega_gpu_attention_reserve_rows sized. base_len + num_rows <= OMEGA_GPU_ATTN_MAX_GQA_CTX. */
+#define OMEGA_GPU_ATTN_ROWS_MAX_CTAS 1024u
+int omega_gpu_gqa_attention_rows_f32(const float *q, const float *k_cache, const float *v_cache,
+                                     uint32_t base_len, uint32_t num_rows, uint32_t num_q_heads,
+                                     uint32_t num_kv_heads, uint32_t head_dim, float *out,
+                                     OmegaGpuAttnInfo *info);
+
 /* Paged bf16 KV (TensorBackend::paged_attention). pool points at the pool base. */
 int omega_gpu_paged_attention_bf16(const float *q, const void *pool, const OmegaGpuKvLayout *layout,
                                    const uint32_t *block_ids, uint32_t num_block_ids,
@@ -155,6 +169,13 @@ void omega_gpu_attention_cache_clear(void);
  * written the outputs of the earlier chunks: treat TOO_LARGE as "output incomplete". If the reserve fails part way it
  * rolls back: none of this API's buffers stays flagged. 0 on success, else an OMEGA_GPU_ATTN_* code. */
 int omega_gpu_attention_reserve(uint32_t max_context, uint32_t max_seqs, uint32_t num_q_heads, uint32_t num_kv_heads, uint32_t head_dim, uint32_t kv_block_size);
+/* Grows the reservation's q, output and table buffers (never shrinks them) so that
+ * omega_gpu_gqa_attention_rows_f32 can send min(max_rows, OMEGA_GPU_ATTN_ROWS_MAX_CTAS / num_q_heads)
+ * rows per launch. The KV staging pool is untouched: the rows of one call share one staged context,
+ * which omega_gpu_attention_reserve already sized for max_context tokens. Call it after
+ * omega_gpu_attention_reserve (omega_gpu_reserve_serving does, with its max_rows). Without it the
+ * rows path still works under a reservation, in launches of as many rows as the q buffer holds. */
+int omega_gpu_attention_reserve_rows(uint32_t max_rows, uint32_t num_q_heads, uint32_t head_dim);
 void omega_gpu_attention_unreserve(void);
 
 /* Stage name of the most recent CHIP_FAIL ("" if none), shared with the other GPU APIs
diff --git a/src/omega_gpu_serving.c b/src/omega_gpu_serving.c
index 18e0deef8..1fee9cd80 100644
--- a/src/omega_gpu_serving.c
+++ b/src/omega_gpu_serving.c
@@ -7,6 +7,10 @@ int omega_gpu_reserve_serving(const OmegaGpuServingBounds *b) {
     if (!b) return OMEGA_GPU_MATMUL_BAD_ARGS;
     int rc = omega_gpu_attention_reserve(b->max_context, b->max_seqs ? b->max_seqs : 1, b->num_q_heads, b->num_kv_heads, b->head_dim, b->kv_block_size);
     if (rc != 0) return rc;
+    if (b->max_rows > 1) { /* the prompt read's rows path (omega_gpu_gqa_attention_rows_f32): q/out/table for a chunk of rows */
+        rc = omega_gpu_attention_reserve_rows(b->max_rows, b->num_q_heads, b->head_dim);
+        if (rc != 0) { omega_gpu_attention_unreserve(); return rc; }
+    }
     rc = omega_gpu_matmul_reserve(b->max_rows, b->max_k, b->max_n, b->max_n_one_row ? b->max_n_one_row : b->max_n, b->kernel_slots);
     if (rc != 0) omega_gpu_attention_unreserve(); /* the matmul half failed: do not leave half a reservation active */
     return rc;
diff --git a/tests/.crumb b/tests/.crumb
index 6cbe22ba9..e4b7ff7fd 100644
--- a/tests/.crumb
+++ b/tests/.crumb
@@ -290,14 +290,14 @@
         }
       ],
       "children_root": "sha256:9c94c5a57dda7727107b9e1271460c33b2cde72e796459e1ae401d4d4aeaec78",
-      "compiled_at": "2026-10-12T05:17:54Z",
+      "compiled_at": "2026-10-12T06:04:50Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:0713f610eacc8c4279a0f58379d061a1ec57ca60efd1595fb6fc91868fda5c23",
+      "digest": "sha256:e59264059051e10ee92dea5caafb09147f1c0c41b6a9eb81427cc6174def0a99",
       "evidence_files": 16,
       "evidence_root": "sha256:96d08097822ad95f4e562c19e0ba5df5a035774c48632f1832912c40a27bd27a",
       "files": 1022,
-      "generated_at_commit": "6e6f1c8e27b4f3a511bb284e7f51f2a957863ded",
-      "source_tree": "sha256:cc16869b090d52a5aec3b189c098bcd9e658f778f9857ddecb4d06d316754afc"
+      "generated_at_commit": "1e6dfa909f2ea951f99597dd68bb89fd62ac2291",
+      "source_tree": "sha256:9522e4fc71462ea268256a7459b9800891ff1e8a85ebbd08f1b254dd2d5029a7"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/tests/gpu_attention_test.c b/tests/gpu_attention_test.c
index 2eac1d955..3d78faac4 100644
--- a/tests/gpu_attention_test.c
+++ b/tests/gpu_attention_test.c
@@ -231,7 +231,7 @@ static void case_info(Case *c, const OmegaGpuAttnInfo *i) {
     c->chip_ns = i->elapsed_ns; c->call_ns = i->call_ns; c->calls = i->chip_calls; c->unwritten = i->unwritten_words;
     c->kv_staged = i->kv_bytes_staged; c->kv_naive = i->kv_bytes_naive; c->blk_logical = i->kv_blocks_logical; c->blk_unique = i->kv_blocks_unique;
 }
-static Case g_cases[32]; static int g_ncases;
+static Case g_cases[64]; static int g_ncases;
 static int g_mutant_caught[OMEGA_GPU_ATTN_MUTANT_COUNT], g_mutant_run[OMEGA_GPU_ATTN_MUTANT_COUNT];
 
 static void record(Case c, FILE *out) {
@@ -268,6 +268,8 @@ static void run_mutants(Case *c, const int *ms, RunFn run, void *ctx, float *got
 
 typedef struct { const float *q, *kc, *vc; uint32_t seq, nqh, nkv; } GqaCtx;
 static int run_gqa(void *p, float *got, OmegaGpuAttnInfo *info) { GqaCtx *c = p; return omega_gpu_gqa_attention_f32(c->q, c->kc, c->vc, c->seq, c->nqh, c->nkv, g_hd, got, info); }
+typedef struct { const float *q, *kc, *vc; uint32_t base, nr, nqh, nkv; } RowsCtx;
+static int run_rows(void *p, float *got, OmegaGpuAttnInfo *info) { RowsCtx *c = p; return omega_gpu_gqa_attention_rows_f32(c->q, c->kc, c->vc, c->base, c->nr, c->nqh, c->nkv, g_hd, got, info); }
 typedef struct { const float *q; const uint8_t *pool; const OmegaGpuKvLayout *ly; const uint32_t *ids; uint32_t nids, ctx, layer, nqh, nkv; } PagedCtx;
 static int run_paged(void *p, float *got, OmegaGpuAttnInfo *info) { PagedCtx *c = p; return omega_gpu_paged_attention_bf16(c->q, c->pool, c->ly, c->ids, c->nids, c->ctx, c->layer, c->nqh, c->nkv, g_hd, got, info); }
 typedef struct { const float *q; const uint8_t *pool; const OmegaGpuKvLayout *ly; const int32_t *tables, *ctxs; uint32_t maxb, nseq, layer, nqh, nkv; } BatchCtx;
@@ -352,6 +354,50 @@ static int chip(const char *out_path) {
         } else run_mutants(&c, no_mutants, run_gqa, &gc, got, want, n, 2e-4, 2e-5);
         record(c, out); free(q); free(kc); free(vc); free(got); free(want); free(again);
     }
+    /* 1b. rows path (prompt read, 2026-10-12): base_len tokens already in the KV, then num_rows
+     * query rows in one call; row i attends over base_len + i + 1 tokens. Expected per row from
+     * oracle_gqa on that prefix. 40 rows at 32 q heads exceed the 1024-CTA launch bound: 2 launches. */
+    for (int sh = 0; sh < 2; sh++) for (int ri = 0; ri < 3; ri++) {
+        static const uint32_t bases[3] = { 0, 17, 300 }, nrows[3] = { 1, 5, 40 };
+        uint32_t nqh = shapes[sh].nqh, nkv = shapes[sh].nkv, base = bases[ri], nr = nrows[ri], total = base + nr;
+        size_t row = (size_t)nqh * hd, n = row * nr, nkvs = (size_t)total * nkv * hd;
+        float *q = malloc(n * 4), *kc = malloc(nkvs * 4), *vc = malloc(nkvs * 4), *got = malloc(n * 4), *want = malloc(n * 4);
+        for (size_t i = 0; i < n; i++) q[i] = frand(&seed, -1.0f, 1.0f);
+        for (size_t i = 0; i < nkvs; i++) { kc[i] = frand(&seed, -1.0f, 1.0f); vc[i] = frand(&seed, -1.0f, 1.0f); }
+        for (uint32_t i = 0; i < nr; i++) oracle_gqa(q + i * row, kc, vc, base + i + 1, nqh, nkv, hd, want + i * row);
+        char name[96]; snprintf(name, sizeof name, "gqa_rows_f32_%s_%uq%ukv_base%u_rows%u", shapes[sh].model, nqh, nkv, base, nr);
+        Case c = { .name = strdup(name), .n = n };
+        OmegaGpuAttnInfo info;
+        RowsCtx rx = { q, kc, vc, base, nr, nqh, nkv };
+        c.rc = run_rows(&rx, got, &info);
+        c.bad = compare(got, want, n, 2e-4, 2e-5, &c.worst);
+        c.pass = c.rc == OMEGA_GPU_ATTN_OK && c.bad == 0; case_info(&c, &info);
+        if (nr == 1) {
+            /* one row is the single-row call, bit for bit */
+            float *one = malloc(row * 4); OmegaGpuAttnInfo i1;
+            int rc1 = omega_gpu_gqa_attention_f32(q, kc, vc, total, nqh, nkv, hd, one, &i1);
+            CHECK(rc1 == OMEGA_GPU_ATTN_OK && memcmp(got, one, row * 4) == 0, "%s equals omega_gpu_gqa_attention_f32 bit for bit", name);
+            free(one);
+        }
+        if (nr == 40) {
+            CHECK(info.chip_calls == 2, "%s 40 rows x %u heads go in 2 launches (got %u)", name, nqh, info.chip_calls);
+            CHECK(info.kv_bytes_staged == 2 * nkvs * 4, "%s KV staged once (%" PRIu64 " bytes, expected %zu)", name, info.kv_bytes_staged, 2 * nkvs * 4);
+            /* negative control: every row scored over the whole context (no causal cut) must be flagged */
+            float *wrong = malloc(n * 4); double w2;
+            for (uint32_t i = 0; i < nr; i++) oracle_gqa(q + i * row, kc, vc, total, nqh, nkv, hd, wrong + i * row);
+            size_t neg = compare(got, wrong, n, 2e-4, 2e-5, &w2);
+            CHECK(neg > n / 4, "%s negative control: non-causal expectation flagged (%zu of %zu)", name, neg, n);
+            free(wrong);
+            static const int ms[5] = { OMEGA_GPU_ATTN_MUTANT_SLOT, OMEGA_GPU_ATTN_MUTANT_NO_RESCALE, OMEGA_GPU_ATTN_MUTANT_Q_ROW, OMEGA_GPU_ATTN_MUTANT_OUT_ROW, 0 };
+            run_mutants(&c, ms, run_rows, &rx, got, want, n, 2e-4, 2e-5);
+        } else run_mutants(&c, no_mutants, run_rows, &rx, got, want, n, 2e-4, 2e-5);
+        record(c, out); free(q); free(kc); free(vc); free(got); free(want);
+    }
+    {   /* rows path refusals */
+        float d[1]; OmegaGpuAttnInfo i0;
+        CHECK(omega_gpu_gqa_attention_rows_f32(d, d, d, 0, 0, 32, 4, hd, d, &i0) == OMEGA_GPU_ATTN_BAD_ARGS, "rows: zero rows refused");
+        CHECK(omega_gpu_gqa_attention_rows_f32(d, d, d, OMEGA_GPU_ATTN_MAX_GQA_CTX, 1, 32, 4, hd, d, &i0) == OMEGA_GPU_ATTN_TOO_LARGE, "rows: base + rows past the context bound refused");
+    }
     /* 2. large scores (q scaled by 200): the softmax without the running max overflows */
     {
         uint32_t nqh = 32, nkv = 4, seq = 256; size_t n = (size_t)nqh * hd, nkvs = (size_t)seq * nkv * hd;