aien-dev has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
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#277 (code only)
Apply it
git checkout -b patch-55797ab454d62dcb 8f5bae12afb1287e426aa42552d330a33b2eb916 curl -fsSL https://interplane.io/drakestapleton/omega-mv/patches/55797ab454d62dcb.patch | git am
Provenance
github-import 1
aien-dev/omega-mv
277
1ed2d2a3bb0d7e700a1c23f136adf222fddd75e7
{"kind":"github-import","owner":"aien-dev","repo":"omega-mv","number":277,"url":"https://github.com/aien-dev/omega-mv/pull/277","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:37:05Z","metadata":"unavailable","state_derived":true}
Changes
diff --git a/.crumb b/.crumb index 1d9fffc0c..b701ab135 100644 --- a/.crumb +++ b/.crumb @@ -51,7 +51,7 @@ "purpose": "Directory calibration. Purpose not yet described by a human." }, { - "digest": "1c478a7e59b6a030f35f00356f51098708307326e8bd7127d99573e98666b395", + "digest": "e4131510711c62d46378596fc17892088d9fe5724dc37f63eee3993e19070a2e", "last_commit": "e5593ae", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." @@ -93,7 +93,7 @@ "purpose": "Directory src. Purpose not yet described by a human." }, { - "digest": "14a5005df7f8959b4d7cd589771f7aed8a731730fe3eaace565a6e9d215eb790", + "digest": "6613e15a29e55246a9939492011b26ec53c87eef79764f87ef6eecc7d46f8e54", "last_commit": "b544d81", "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:789ce8e6aab90408b91294e5a23f441c903841254257f551de4f82b26bac5edf", - "compiled_at": "2026-10-05T03:37:31Z", + "children_root": "sha256:414c6e899ef028d51e16400548f0606212dcba2d7105fcad536b3517aecc4061", + "compiled_at": "2026-10-05T03:52:02Z", "compiler": "crumb-compile/1", - "digest": "sha256:8dd3e973b1dbbc4170937f389fc8d4b9b7a185abe25991140d349f486437aa30", + "digest": "sha256:d439887f337ce2974a405954db80453ce6ecf5dc71e4ee491477cf9b8a42ff55", "evidence_files": 1733, "evidence_root": "sha256:0b92d15f30b595de70a79ce6c93f76d3b90cbb8bb113f4bcd543fd4787e47532", "files": 3499, - "generated_at_commit": "bef94924aaa5a1eb4e6657305299d67790cb0853", - "source_tree": "sha256:931f316cc6ad5e0e10c19fbe79e2d8d07104606c4eeae261e5816dc2ceac0cf7" + "generated_at_commit": "8f5bae12afb1287e426aa42552d330a33b2eb916", + "source_tree": "sha256:42b8f68cd7b7d359317b6f478cb27c77bb1a7f4d81c67c1e6235bee685b831dd" }, "owner_lane": "", "provenance": { diff --git a/docs/.crumb b/docs/.crumb index 3ce0ed302..8435bf7f3 100644 --- a/docs/.crumb +++ b/docs/.crumb @@ -81,8 +81,8 @@ "purpose": "Directory docs/estimation. Purpose not yet described by a human." }, { - "digest": "9d273061333f2d4c54d4450cf2ed8f5aad36e301fe2ba299399d388c47f86f8a", - "last_commit": "d12d012", + "digest": "ed0c4e7b8e7ba3b7ef4acee3c7d7d4d0c013529d514626339899d3862df052ea", + "last_commit": "e5593ae", "name": "numeric", "purpose": "Directory docs/numeric. Purpose not yet described by a human." }, @@ -117,15 +117,15 @@ "purpose": "Directory docs/turing. Purpose not yet described by a human." } ], - "children_root": "sha256:202ed4db636f4f835d49c1b95ba93276d042d33cab14e49d40266d0905e7d125", - "compiled_at": "2026-10-04T19:57:41Z", + "children_root": "sha256:fce9617f5526572d088e1aa791b05e09064083acd701bcf1b816f544367769d5", + "compiled_at": "2026-10-05T03:24:21Z", "compiler": "crumb-compile/1", - "digest": "sha256:1c478a7e59b6a030f35f00356f51098708307326e8bd7127d99573e98666b395", + "digest": "sha256:e4131510711c62d46378596fc17892088d9fe5724dc37f63eee3993e19070a2e", "evidence_files": 26, "evidence_root": "sha256:f58236184eadc5f8c8f95499127a9f43c2f4dc702ddca267853d8c3dee0690f1", "files": 100, - "generated_at_commit": "d12d012a763f44ebb367431497eaf727256b25a8", - "source_tree": "sha256:905f8c986ea594eb1dc8d8ed2ab228ff5f06078a5c3eb04b5a2f1b9d3e67c0ab" + "generated_at_commit": "b544d81db1f8d576685a8de19add13c7c59b052a", + "source_tree": "sha256:591c886445ea08315c7f4505339175112ac1474e4be86a360b57a6ca4afee19f" }, "owner_lane": "", "provenance": { diff --git a/docs/numeric/.crumb b/docs/numeric/.crumb index 0061435f9..d73d20fce 100644 --- a/docs/numeric/.crumb +++ b/docs/numeric/.crumb @@ -7,14 +7,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-04T19:18:09Z", + "compiled_at": "2026-10-05T03:24:21Z", "compiler": "crumb-compile/1", - "digest": "sha256:9d273061333f2d4c54d4450cf2ed8f5aad36e301fe2ba299399d388c47f86f8a", + "digest": "sha256:ed0c4e7b8e7ba3b7ef4acee3c7d7d4d0c013529d514626339899d3862df052ea", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 10, - "generated_at_commit": "a274e0a2c8d39f3a9cb57cb9681a500b7d9f2252", - "source_tree": "sha256:afc08234f882c5d3af02da93f4e4443870ff429bc8c89c4a36647bbb5adaa66a" + "generated_at_commit": "b544d81db1f8d576685a8de19add13c7c59b052a", + "source_tree": "sha256:1585c3906422d4a1d6481b39728d70d350aa3a0cf121e058fb71fcf70f054026" }, "owner_lane": "", "provenance": { diff --git a/docs/numeric/FB1_CUT5_ATTENTION.md b/docs/numeric/FB1_CUT5_ATTENTION.md index 87ea07774..72786f45d 100644 --- a/docs/numeric/FB1_CUT5_ATTENTION.md +++ b/docs/numeric/FB1_CUT5_ATTENTION.md @@ -88,6 +88,14 @@ mutant's. Names come from `omega_gpu_attention_mutant_name` (table checked again Negative control: the comparison must reject the oracle with kv heads swapped. Repeat run on a cache hit must be bit-identical. +Single vs batched parity and repeat (L6-KV, 2026-10-05): for the 3-sequence batch (padded +table entries, an empty context, a context truncated by its table) and both shared-prefix +batches, each sequence is run alone through `omega_gpu_paged_attention_bf16` with the batch's +rules applied by hand (negatives removed, ctx <= 0 -> 0) and must equal its batched row bit for +bit; then the batch is called again and must be a kernel cache hit, bit-identical, with the same +staging counters. A throwaway run comparing each sequence against the neighbouring row failed +all 11 single-call checks (the check has teeth). Host simulator: 122 checks (was 108). + ## Staging dedupe per launch (OM-2) The paged path stages the referenced blocks' layer slice into a GPU-uncached staging buffer. diff --git a/tests/.crumb b/tests/.crumb index 696cde1fa..9a82dabeb 100644 --- a/tests/.crumb +++ b/tests/.crumb @@ -110,188 +110,188 @@ "children": [ { "digest": "e7498eca87fe5ca8dc27d92f2d99be0de3e4c804711f9d8cba5bb1e47ca95f74", - "last_commit": "e5593ae", + "last_commit": "28911be", "name": "algebra", "purpose": "Directory tests/algebra. Purpose not yet described by a human." }, { "digest": "d484ca176e9932b098df5664d01bdd679c78f5b89f4d15a77eb30f43d235f570", - "last_commit": "e5593ae", + "last_commit": "834ee93", "name": "ans", "purpose": "Tests 1-10 for ANS (docs/ans/INERTIAL_ALIGNMENT_SPEC_V1.md): freeze/digest, hostile reference mu" }, { "digest": "bd7114b42f99c7e51741abdf24329d20713c73a332bd5f349e04384fd0241e91", - "last_commit": "e5593ae", + "last_commit": "e722877", "name": "brownian", "purpose": "Directory tests/brownian. Purpose not yet described by a human." }, { "digest": "1cbe9561b87b394e200f67996ce1407c377025d07ad033b27cdd542625e277d4", - "last_commit": "e5593ae", + "last_commit": "30bb116", "name": "canonicalization", "purpose": "Directory tests/canonicalization. Purpose not yet described by a human." }, { "digest": "d93d50a07f61b032e5476e0066cad83c42d51427a0b206585e05fff56350e12e", - "last_commit": "e5593ae", + "last_commit": "dce821c", "name": "compiler", "purpose": "Directory tests/compiler. Purpose not yet described by a human." }, { "digest": "47683e6a56ca8e14ee526004b2a90dd08498507e8d4b0b42c3d85d22afb07d28", - "last_commit": "e5593ae", + "last_commit": "28b8793", "name": "constraints", "purpose": "Directory tests/constraints. Purpose not yet described by a human." }, { "digest": "95b2041562face1ba7baa6c57456bf07d77a0f44e093b989ec18f559064e22d9", - "last_commit": "e5593ae", + "last_commit": "49abb02", "name": "crumbline", "purpose": "Directory tests/crumbline. Purpose not yet described by a human." }, { "digest": "d57833fb3f63ef6475cf25e2e16319d818a0a407b825d5b4c5cbdd3cc0e06492", - "last_commit": "e5593ae", + "last_commit": "00f54b6", "name": "dual_experiment", "purpose": "Tests for the DUAL applicability experiment: determinism (same seed, byte-identical results dige" }, { "digest": "fb0a9296a93d065d5e016ad0a950fc6b9691f8ddca12ad0111cee2e35791cdb4", - "last_commit": "e5593ae", + "last_commit": "c819b37", "name": "effect", "purpose": "Directory tests/effect. Purpose not yet described by a human." }, { "digest": "bc2473da101ba5a74c32021a9d27ecb2007897f07a9689ba50ccc99b9030bf0c", - "last_commit": "e5593ae", + "last_commit": "1a147e4", "name": "estimation", "purpose": "Directory tests/estimation. Purpose not yet described by a human." }, { "digest": "de2bc4e310a257dbd21cc5c9624641b137b1b4487d8876cb52469aea2af5b904", - "last_commit": "e5593ae", + "last_commit": "3108fc2", "name": "fabric", "purpose": "Directory tests/fabric. Purpose not yet described by a human." }, { "digest": "90418926706f827aafd72938aee1dea89222cb5e465fba06a8df5a83253e0412", - "last_commit": "e5593ae", + "last_commit": "28b8793", "name": "identity", "purpose": "Directory tests/identity. Purpose not yet described by a human." }, { "digest": "c653c851c8934ce9ac4eabaa32a9df65d858c9ac7a556e76b265b1ee81494443", - "last_commit": "e5593ae", + "last_commit": "4f55f45", "name": "language", "purpose": "Directory tests/language. Purpose not yet described by a human." }, { "digest": "e485aa0a00f0a588e22d55caa704db8581a5da1b53080b311086e6edd38f6044", - "last_commit": "e5593ae", + "last_commit": "30bb116", "name": "malformed", "purpose": "Directory tests/malformed. Purpose not yet described by a human." }, { "digest": "adba9b5ea1c000db36078fca7d1bfef0b2769b73c8fb474024d9409bd48bdbc1", - "last_commit": "e5593ae", + "last_commit": "40d1ea3", "name": "numeric_native", "purpose": "Simulated M16 driver for numeric resource-lifecycle tests. No device execution or numeric parity" }, { "digest": "a4d320b3203650a28c43ea954957d8902d1cc25cbdc8aecd15628c01a92f68f8", - "last_commit": "e5593ae", + "last_commit": "d550b70", "name": "path", "purpose": "Directory tests/path. Purpose not yet described by a human." }, { "digest": "1fd5f914f326a1a51fc343ab633ac411e86bea22beee718b1460db066807f292", - "last_commit": "e5593ae", + "last_commit": "8a2e268", "name": "physics0", "purpose": "PD-0 gates: world self-test, oracle calibration, learner L0/L1/NULL, mutations, OSC differential" }, { "digest": "4619a90a957e77cd3d5680132ab4d1a5ef65f43419ddcc089743ca5b7a7719ee", - "last_commit": "e5593ae", + "last_commit": "8f8babe", "name": "polyglot", "purpose": "Directory tests/polyglot. Purpose not yet described by a human." }, { "digest": "16bea65aa50f0b3ab8b90cb286de048639fa8e635ff84e517e138c6f9f26a059", - "last_commit": "e5593ae", + "last_commit": "3c82389", "name": "program", "purpose": "Directory tests/program. Purpose not yet described by a human." }, { "digest": "ba0c09f67d12b5d7de906129bdbe2f6e0a228e1a34236ecc4b779c523cb2061e", - "last_commit": "e5593ae", + "last_commit": "6fdc4c3", "name": "r16_inventory", "purpose": "Directory tests/r16_inventory. Purpose not yet described by a human." }, { "digest": "ee440289b52f009835a35b384e086872b04cecb15665b9682a0d27a5dfee30c9", - "last_commit": "e5593ae", + "last_commit": "520c895", "name": "r16_negative", "purpose": "Directory tests/r16_negative. Purpose not yet described by a human." }, { "digest": "25cabf47d18353539db28146434d246a2f81bf9c323471566451aca56806f279", - "last_commit": "e5593ae", + "last_commit": "44d8c06", "name": "r16_surface", "purpose": "Directory tests/r16_surface. Purpose not yet described by a human." }, { "digest": "9106f2ea57e8f453322f0a988b61cfcbd06631573c9ff32a777903d27d7741e1", - "last_commit": "e5593ae", + "last_commit": "40d1ea3", "name": "realize", "purpose": "Directory tests/realize. Purpose not yet described by a human." }, { "digest": "381184e79b26920b256dd4a774fb11f17a92afa8ceda4813eada241bac4163a9", - "last_commit": "e5593ae", + "last_commit": "30bb116", "name": "relations", "purpose": "Directory tests/relations. Purpose not yet described by a human." }, { "digest": "f49db08f5e2f8ad20c9e10f7eaaa27e7f264b6bfc17e4d4fad16e60eb1495f1d", - "last_commit": "e5593ae", + "last_commit": "3a3144d", "name": "runtime", "purpose": "Directory tests/runtime. Purpose not yet described by a human." }, { "digest": "b1311025a3bfd8dd7b5e07b1adf1d7ece502a15200f7207f515334f7083b8315", - "last_commit": "e5593ae", + "last_commit": "5ae192a", "name": "searchtrace", "purpose": "Directory tests/searchtrace. Purpose not yet described by a human." }, { "digest": "3ecf636e2923038708cafa062895b8d8f2664dc1865cdff38575911eaa9f1b2d", - "last_commit": "e5593ae", + "last_commit": "54826a3", "name": "train", "purpose": "Directory tests/train. Purpose not yet described by a human." }, { "digest": "75d5e576c38a0497a55e9f5ee79550cb94f9b75008f3e4e126312802704b3f86", - "last_commit": "e5593ae", + "last_commit": "2564f57", "name": "turing", "purpose": "Directory tests/turing. Purpose not yet described by a human." }, { "digest": "3f19e3034ff999211cb13ab8995ca6c38d0d8e1f5bfbbbd621caaa08412d3f1f", - "last_commit": "e5593ae", + "last_commit": "fed4f07", "name": "visor", "purpose": "Directory tests/visor. Purpose not yet described by a human." } ], "children_root": "sha256:0a4e348cf355e1fa5924f9c76a460d1d49bc285687b134365ef0fb9dab4f0855", - "compiled_at": "2026-10-05T00:54:08Z", + "compiled_at": "2026-10-05T03:24:21Z", "compiler": "crumb-compile/1", - "digest": "sha256:14a5005df7f8959b4d7cd589771f7aed8a731730fe3eaace565a6e9d215eb790", + "digest": "sha256:6613e15a29e55246a9939492011b26ec53c87eef79764f87ef6eecc7d46f8e54", "evidence_files": 11, "evidence_root": "sha256:d5c1bceb4d57ef0eb42797c58801b5926509711614c3e38bb7105b6efa3942f2", "files": 791, - "generated_at_commit": "e5593ae488fcb9038557a4317a07faa7625649a3", - "source_tree": "sha256:d798ce914c2f79b84c086322a184e76652759744bd0632c46663ea7dd64df980" + "generated_at_commit": "b544d81db1f8d576685a8de19add13c7c59b052a", + "source_tree": "sha256:a55b39ff19e82f59a9fbd00005a43310011cad05be3b789d94e8a9a69d916349" }, "owner_lane": "", "provenance": { diff --git a/tests/gpu_attention_test.c b/tests/gpu_attention_test.c index af714069b..9fb8abbbe 100644 --- a/tests/gpu_attention_test.c +++ b/tests/gpu_attention_test.c @@ -267,6 +267,35 @@ typedef struct { const float *q; const uint8_t *pool; const OmegaGpuKvLayout *ly 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, 64, 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; static int run_batch(void *p, float *got, OmegaGpuAttnInfo *info) { BatchCtx *c = p; return omega_gpu_paged_attention_batch_bf16(c->q, c->pool, c->ly, c->tables, c->ctxs, c->maxb, c->nseq, c->layer, c->nqh, c->nkv, 64, got, info); } +/* single vs batched parity and repeat (L6-KV, CAND-0 coverage): each sequence of a batch, run + * alone through the single-sequence entry point with the batch's own rules applied by hand + * (negative table entries removed, ctx <= 0 -> 0), must equal its row of the batched output bit + * for bit (same kernel, same per-CTA inputs; the batch only shares staging). Then the batch is + * called again with the same inputs: kernel cache hit, bit-identical output, identical staging + * counters. `got` must hold the batched output of `bc`. */ +static void batch_single_repeat_checks(const char *name, const BatchCtx *bc, const float *got, const Case *c) { + size_t row = (size_t)bc->nqh * 64, n = (size_t)bc->nseq * row; + float *one = malloc(row * 4), *again = malloc(n * 4); + uint32_t *ids = malloc((bc->maxb ? bc->maxb : 1) * 4); + for (uint32_t s = 0; s < bc->nseq; s++) { + uint32_t nb = 0; + for (uint32_t b = 0; b < bc->maxb; b++) { int32_t v = bc->tables[(size_t)s * bc->maxb + b]; if (v >= 0) ids[nb++] = (uint32_t)v; } + uint32_t ctx = bc->ctxs[s] > 0 ? (uint32_t)bc->ctxs[s] : 0; + for (size_t i = 0; i < row; i++) one[i] = -7.0f; /* poison: an unwritten row cannot match */ + OmegaGpuAttnInfo si; + int src = omega_gpu_paged_attention_bf16(bc->q + (size_t)s * row, bc->pool, bc->ly, ids, nb, ctx, bc->layer, bc->nqh, bc->nkv, 64, one, &si); + CHECK(src == OMEGA_GPU_ATTN_OK && memcmp(one, got + (size_t)s * row, row * 4) == 0, + "%s: sequence %u alone (single entry point, %u blocks, ctx %u) is bit-identical to its batched row (rc=%s)", name, s, nb, ctx, omega_gpu_attention_rc_name(src)); + } + OmegaGpuAttnInfo ri; + int rrc = omega_gpu_paged_attention_batch_bf16(bc->q, bc->pool, bc->ly, bc->tables, bc->ctxs, bc->maxb, bc->nseq, bc->layer, bc->nqh, bc->nkv, 64, again, &ri); + CHECK(rrc == OMEGA_GPU_ATTN_OK && ri.kernel_cache_hit && memcmp(again, got, n * 4) == 0 && ri.kv_bytes_staged == c->kv_staged && ri.kv_bytes_naive == c->kv_naive + && ri.kv_blocks_unique == c->blk_unique && ri.kv_blocks_logical == c->blk_logical, + "%s: repeated batch call is a cache hit, bit-identical, same staging counters (rc=%s hit=%d staged %" PRIu64 "/%" PRIu64 ")", + name, omega_gpu_attention_rc_name(rrc), (int)ri.kernel_cache_hit, ri.kv_bytes_staged, c->kv_staged); + free(one); free(again); free(ids); +} + static int chip(const char *out_path) { FILE *out = out_path ? fopen(out_path, "w") : NULL; @@ -414,6 +443,7 @@ static int chip(const char *out_path) { c.pass = c.rc == OMEGA_GPU_ATTN_OK && c.bad == 0; case_info(&c, &info); int zeros = 1; for (size_t i = 0; i < (size_t)nqh * hd; i++) if (got[(size_t)nqh * hd + i] != 0.0f) zeros = 0; CHECK(zeros, "batch: the empty sequence is all zeros"); + batch_single_repeat_checks(c.name, &bc, got, &c); static const int ms[5] = { OMEGA_GPU_ATTN_MUTANT_KV_HEAD, OMEGA_GPU_ATTN_MUTANT_SLOT, OMEGA_GPU_ATTN_MUTANT_Q_ROW, OMEGA_GPU_ATTN_MUTANT_OUT_ROW, 0 }; run_mutants(&c, ms, run_batch, &bc, got, want, n, 2e-4, 2e-5); /* all 7 referenced blocks are distinct here, so dedupe stages exactly the naive figure */ @@ -466,6 +496,7 @@ static int chip(const char *out_path) { CHECK(li.kv_blocks_unique == logical && li.kv_bytes_staged == li.kv_bytes_naive && li.kv_bytes_staged > c.kv_staged, "%s negative control: duplicated prefix staging is flagged (legacy staged %" PRIu64 " == naive %" PRIu64 ", dedupe %" PRIu64 ")", name, li.kv_bytes_staged, li.kv_bytes_naive, c.kv_staged); CHECK(memcmp(got, legacy, n * 4) == 0, "%s: dedupe and legacy staging are bit-identical", name); + batch_single_repeat_checks(name, &bc, got, &c); static const int ms5[3] = { OMEGA_GPU_ATTN_MUTANT_KV_HEAD, OMEGA_GPU_ATTN_MUTANT_SLOT, 0 }; run_mutants(&c, ms5, run_batch, &bc, got, want, n, 2e-4, 2e-5); record(c, out); free(pool); free(tables); free(q); free(got); free(want); free(legacy);