From f205d1b29d3b24d0039e58b8400f8426ffbdf908 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Fri, 16 Oct 2026 12:58:31 -0500 Subject: [PATCH 01/10] DEPFLAGS WIP (worker C, 2026-10-16): dependency-flag prologue/epilogue, strong LDG/ATOMG/MEMBAR/ERRBAR/CS2R encodings, dep mode switch. Untested, not built; committed so nothing is lost. Co-Authored-By: Claude Fable 5.1 --- Makefile | 2 +- src/omega_blackwell_codegen.c | 41 +++++++++ src/omega_blackwell_codegen.h | 12 ++- src/omega_blackwell_codegen_attn.c | 3 + src/omega_blackwell_codegen_attn.h | 1 + src/omega_blackwell_codegen_bf16.c | 2 + src/omega_blackwell_codegen_bf16.h | 1 + src/omega_blackwell_codegen_dec.c | 7 ++ src/omega_blackwell_codegen_dec.h | 1 + src/omega_blackwell_codegen_moe.c | 2 + src/omega_blackwell_codegen_moe.h | 1 + src/omega_blackwell_codegen_router.c | 2 + src/omega_blackwell_codegen_router.h | 1 + src/omega_bw_dep.h | 128 +++++++++++++++++++++++++++ src/omega_gpu_dep.c | 9 ++ src/omega_gpu_dep.h | 17 ++++ 16 files changed, 228 insertions(+), 2 deletions(-) create mode 100644 src/omega_bw_dep.h create mode 100644 src/omega_gpu_dep.c create mode 100644 src/omega_gpu_dep.h diff --git a/Makefile b/Makefile index 3551fea3f..d0c10814f 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ SRCS += src/omega_gpu_hostmath.c # OWN-30B cut 8 item 2 (2026-10-13): one-launch MoE router (omega_gpu_router_api.h), new files only SRCS += src/omega_blackwell_codegen_router.c src/omega_gpu_router_api.c # OWN-30B W-L2 (2026-10-13): decode launch collapse, new files only: command list (N launches, one submit) + glue kernels -SRCS += src/omega_gpu_cmdlist.c src/omega_blackwell_codegen_dec.c +SRCS += src/omega_gpu_cmdlist.c src/omega_blackwell_codegen_dec.c src/omega_gpu_dep.c SRCS += src/omega_gpu_mem_cached.c SRCS += src/omega_gpu_decode_graph.c # OWN-30B (2026-10-13): bf16 streaming GEMV for the lm_head (omega_gpu_bf16_gemv_api.h), new files only diff --git a/src/omega_blackwell_codegen.c b/src/omega_blackwell_codegen.c index b09fa1e54..928ce87eb 100644 --- a/src/omega_blackwell_codegen.c +++ b/src/omega_blackwell_codegen.c @@ -522,6 +522,47 @@ static int encode_single_insn(const BlackwellIRInsn *insn, const OmegaRegAlloc * w[3] = insn->control ? insn->control : 0x00321e00; break; + case BW_IR_LDG_STRONG_GPU: + /* LDG.E.STRONG.GPU Rd, desc[URd][Ra.64]: LDG.E.STRONG.SYS with the scope field (w[2] bits 13..16) 0x7 (nvdisasm: + * 0x0000000402007981 / 0x004ea8000c1ef900). */ + w[0] = 0x7981 | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24); + w[1] = (uint32_t)(ureg & 0xff); + w[2] = 0x0c1ef900; + w[3] = insn->control ? insn->control : 0x000f2200; + break; + + case BW_IR_ATOMG_ADD_STRONG_GPU: + /* ATOMG.E.ADD.STRONG.GPU PT, Rd, desc[URd][Ra.64], Rb (nvdisasm: 0x80000009040509a8 / 0x001ea200081ef104). */ + w[0] = 0x79a8 | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24); + w[1] = (uint32_t)(src2 & 0xff) | 0x80000000u; + w[2] = 0x081ef100 | (uint32_t)(ureg & 0xff); + w[3] = insn->control ? insn->control : 0x00321e00; + break; + + case BW_IR_MEMBAR_ALL_GPU: + /* MEMBAR.ALL.GPU (nvdisasm: 0x0000000000007992 / 0x000fec000000a000) */ + w[0] = 0x00007992; w[1] = 0; w[2] = 0x0000a000; + w[3] = insn->control ? insn->control : 0x000fec00; + break; + + case BW_IR_ERRBAR: + /* ERRBAR (nvdisasm: 0x00000000000079ab / 0x000fc00000000000) */ + w[0] = 0x000079ab; w[1] = 0; w[2] = 0; + w[3] = insn->control ? insn->control : 0x000fc000; + break; + + case BW_IR_CGAERRBAR: + /* CGAERRBAR (nvdisasm: 0x00000000000075ab / 0x000fec0000000000) */ + w[0] = 0x000075ab; w[1] = 0; w[2] = 0; + w[3] = insn->control ? insn->control : 0x000fec00; + break; + + case BW_IR_CS2R_GLOBALTIMER: + /* CS2R Rd:Rd+1, SR_GLOBALTIMERLO (nvdisasm: 0x0000000000087805 / 0x000fca0000015200; the .32 form has w[2] 0x5200) */ + w[0] = 0x7805 | ((uint32_t)(dst & 0xff) << 16); w[1] = 0; w[2] = 0x00015200; + w[3] = insn->control ? insn->control : 0x000fca00; + break; + case BW_IR_ATOMG_EXCH_STRONG_SYS: w[0] = 0x79a8 | ((uint32_t)(dst & 0xff) << 16) | ((uint32_t)(src1 & 0xff) << 24); w[1] = (uint32_t)(src2 & 0xff) | 0x80000000u; diff --git a/src/omega_blackwell_codegen.h b/src/omega_blackwell_codegen.h index cc36e237d..1f46add86 100644 --- a/src/omega_blackwell_codegen.h +++ b/src/omega_blackwell_codegen.h @@ -100,7 +100,17 @@ typedef enum { BW_IR_LDG_E_128, /* LDG.E.128 Rd..Rd+3, desc[URd][Ra.64+imm] */ /* Batched attention loads (2026-10-12). Words matched against nvcc 13.0.88 -arch=sm_121 * (omega_blackwell_verify_codegen_fixtures_fragmm). imm = unsigned byte offset < 2^23; dst an aligned quad. */ - BW_IR_LDS128 /* LDS.128 Rd..Rd+3, [Ra+imm] */ + BW_IR_LDS128, /* LDS.128 Rd..Rd+3, [Ra+imm] */ + /* Dependency flags between the launches of one command list (DEPFLAGS, 2026-10-16). Words from nvcc 13.0.88 + * -arch=sm_121 + nvdisasm (investigations/2026-10-16-DEPFLAGS/sass): ld.acquire.gpu -> LDG.E.STRONG.GPU + CCTL.IVALL; + * red.release.gpu.add -> MEMBAR.ALL.GPU; ERRBAR; CGAERRBAR; REDG/ATOMG.E.ADD.STRONG.GPU; mov.u64 %globaltimer -> + * CS2R Rd:Rd+1, SR_GLOBALTIMERLO. Scope field = w[2] bits 13..16 (0xa SYS, 0x7 GPU), as PR #484 found for the F32 twins. */ + BW_IR_LDG_STRONG_GPU, /* LDG.E.STRONG.GPU Rd, desc[URd][Ra.64]: a flag another CTA of this GPU writes */ + BW_IR_ATOMG_ADD_STRONG_GPU,/* ATOMG.E.ADD.STRONG.GPU PT, Rd, desc[URd][Ra.64], Rb */ + BW_IR_MEMBAR_ALL_GPU, /* MEMBAR.ALL.GPU */ + BW_IR_ERRBAR, /* ERRBAR */ + BW_IR_CGAERRBAR, /* CGAERRBAR */ + BW_IR_CS2R_GLOBALTIMER /* CS2R Rd:Rd+1, SR_GLOBALTIMERLO (64-bit ns timer; dst a register pair) */ } BlackwellIROpcode; /* Barrier (reconvergence) registers: the sm_121 BSSY/BSYNC words carry a 4-bit barrier id diff --git a/src/omega_blackwell_codegen_attn.c b/src/omega_blackwell_codegen_attn.c index 37a67d8df..d6e0ae101 100644 --- a/src/omega_blackwell_codegen_attn.c +++ b/src/omega_blackwell_codegen_attn.c @@ -163,6 +163,7 @@ int omega_blackwell_codegen_decode_attn_prog(const OmegaDecodeAttnSpec *spec, Bl s2r(e, tid, BW_SR_TID_X); s2r(e, cx, BW_SR_CTAID_X); s2r(e, cy, BW_SR_CTAID_Y); movi(e, one, 1); movrz(e, R(zero)); movi(e, c7fff, 0x7fffu); movi(e, c16, 16); shr(e, warp, tid, 5); + OmegaBwDep D; dep_prologue(e, spec->dep, udesc, tid, &D); andi(e, R(lane), R(tid), 31u); /* range of this CTA: base = cx * per; end = min(base + per, pos + 1) */ @@ -476,6 +477,7 @@ int omega_blackwell_codegen_decode_attn_prog(const OmegaDecodeAttnSpec *spec, Bl lds32(e, R(ep[0]), t1, 1); isetp_ge_u32(e, ep[0], splitsm1); const int bra_last = bra_if_p0_fwd(e); + dep_epilogue(e, udesc, tid, &D); /* CTA-uniform exit (ep[0] is one shared word): all threads take it */ exit_k(e); patch_bra(e, bra_last, here(e)); /* combine: thread tid, outputs o = tid + 256 r (head o >> 7, dim o & 127), r = 0..3 */ @@ -535,6 +537,7 @@ int omega_blackwell_codegen_decode_attn_prog(const OmegaDecodeAttnSpec *spec, Bl /* thread 0 resets the counter for the next launch (every other CTA of this head has already added) */ isetp_ge_u32(e, tid, one); { Region r = region_skip_if_p0(e); imadw(e, pb64, cy, 4u, pcnt); stg(e, BW_IR_STG_STRONG_SYS, pb64, R(zero), udesc); region_end(e, r); } + dep_epilogue(e, udesc, tid, &D); tail(e); if (e->err) return -1; return omega_bw_regalloc_solve(prog); diff --git a/src/omega_blackwell_codegen_attn.h b/src/omega_blackwell_codegen_attn.h index 102a3f2e5..bd67b8fe0 100644 --- a/src/omega_blackwell_codegen_attn.h +++ b/src/omega_blackwell_codegen_attn.h @@ -79,6 +79,7 @@ typedef struct { uint32_t depth; /* prefetch depth of the K and V streams, 1..4 */ int mutant; /* TEST ONLY. 0 none; 1 no RoPE on q and k; 2 V read one position late; 3 the new K/V are not * written to the cache; 4 the cross-split combine ignores the max (differs only when splits > 1). */ + uint32_t dep; /* OMEGA_DEP_FLAGS | OMEGA_DEP_CAMERA (omega_bw_dep.h); 0 = none */ } OmegaDecodeAttnSpec; /* Builds the IR program (register-allocated) into *prog. 0 ok, -1 refused (depth 0 or > 4, mutant outside 0..4, diff --git a/src/omega_blackwell_codegen_bf16.c b/src/omega_blackwell_codegen_bf16.c index 08125e6c6..3ba673a5c 100644 --- a/src/omega_blackwell_codegen_bf16.c +++ b/src/omega_blackwell_codegen_bf16.c @@ -151,6 +151,7 @@ int omega_blackwell_codegen_bf16_gemv_prog(const OmegaBf16GemvSpec *spec, Blackw s2r(e, tid, BW_SR_TID_X); s2r(e, cx, BW_SR_CTAID_X); movi(e, one, 1); shr(e, warp, tid, 0, 5); + OmegaBwDep D; dep_prologue(e, spec->dep, udesc, tid, &D); andi(e, lane, tid, 0, 31); imadi(e, wlane, lane, 0, 16, NOREG); /* byte offset of this lane's chunk in a row step */ imadi(e, rg, cx, 0, W, warp); /* first row group of this warp */ @@ -232,6 +233,7 @@ int omega_blackwell_codegen_bf16_gemv_prog(const OmegaBf16GemvSpec *spec, Blackw loop_end(e); const int L_end = here(e); patch_bra(e, bra_end, L_end); + dep_epilogue(e, udesc, tid, &D); tail(e); if (e->err) return -1; return omega_bw_regalloc_solve(prog); diff --git a/src/omega_blackwell_codegen_bf16.h b/src/omega_blackwell_codegen_bf16.h index c7a22cdfd..1cb9b4fbc 100644 --- a/src/omega_blackwell_codegen_bf16.h +++ b/src/omega_blackwell_codegen_bf16.h @@ -51,6 +51,7 @@ typedef struct { uint32_t warps; /* 1 .. 32 (the host simulator runs up to 8) */ uint32_t depth; /* K steps per loop iteration: divides k / 256; rows * depth <= 16 */ int mutant; /* 0 production; 1, 2, 3 as above */ + uint32_t dep; /* OMEGA_DEP_FLAGS | OMEGA_DEP_CAMERA (omega_bw_dep.h); 0 = none */ } OmegaBf16GemvSpec; int omega_blackwell_codegen_bf16_gemv_prog(const OmegaBf16GemvSpec *spec, BlackwellIRProgram *prog); diff --git a/src/omega_blackwell_codegen_dec.c b/src/omega_blackwell_codegen_dec.c index b2ec67d7f..00117283d 100644 --- a/src/omega_blackwell_codegen_dec.c +++ b/src/omega_blackwell_codegen_dec.c @@ -156,6 +156,7 @@ static int gen_axpy(Em *e, const OmegaDecSpec *sp) { ldc64(e, px, OMEGA_DEC_AXPY_X); ldc64(e, pa, OMEGA_DEC_AXPY_A); ldc32(e, iters, OMEGA_DEC_AXPY_ITERS); s2r(e, tid, BW_SR_TID_X); s2r(e, cta, BW_SR_CTAID_X); imadi(e, R(gid), R(cta), OMEGA_DEC_THREADS, tid); + OmegaBwDep D; dep_prologue(e, sp->dep, udesc, tid, &D); imadw(e, xa, gid, 4u, px); imadw(e, aa, gid, 4u, pa); movrz(e, R(it)); movi(e, one, 1); const int L = here(e); @@ -170,6 +171,7 @@ static int gen_axpy(Em *e, const OmegaDecSpec *sp) { bra(e, L); loop_end(e); patch_bra(e, done, here(e)); + dep_epilogue(e, udesc, tid, &D); tail(e); return e->err; } @@ -188,6 +190,7 @@ static int gen_res(Em *e, const OmegaDecSpec *sp) { movi(e, one, 1); shr(e, warp, tid, 5); andi(e, R(lane), R(tid), 31u); + OmegaBwDep D; dep_prologue(e, sp->dep, udesc, tid, &D); imadi(e, R(toff), R(tid), 32u, NOREG); imadw(e, xa, toff, 1u, px); ldg(e, BW_IR_LDG_E_128, xq0, xa, 0, udesc, 1); ldg(e, BW_IR_LDG_E_128, xq1, xa, 16, udesc, 0); @@ -247,6 +250,7 @@ static int gen_res(Em *e, const OmegaDecSpec *sp) { stg(e, ya, R(yv), udesc); } } + dep_epilogue(e, udesc, tid, &D); tail(e); return e->err; } @@ -259,6 +263,7 @@ static int gen_swiglu(Em *e, const OmegaDecSpec *sp) { ldc64(e, pgu, OMEGA_DEC_SW_GU); ldc64(e, pact, OMEGA_DEC_SW_ACT); ldc32(e, scale, OMEGA_DEC_SW_SCALE); s2r(e, tid, BW_SR_TID_X); s2r(e, cx, BW_SR_CTAID_X); s2r(e, cy, BW_SR_CTAID_Y); imadi(e, R(c), R(cx), OMEGA_DEC_THREADS, tid); + OmegaBwDep D; dep_prologue(e, sp->dep, udesc, tid, &D); imadi(e, R(gi), R(cy), 2u * OMEGA_DEC_INTER, c); imadi(e, R(ai), R(cy), OMEGA_DEC_INTER, c); /* the up half sits INTER floats after the gate: its own address (the 32-bit LDG.E encoding carries no immediate @@ -280,6 +285,7 @@ static int gen_swiglu(Em *e, const OmegaDecSpec *sp) { fmul(e, R(t), R(t), R(uv)); fmul(e, R(t), R(t), R(scale)); stg(e, aa, R(t), udesc); + dep_epilogue(e, udesc, tid, &D); tail(e); return e->err; } @@ -339,6 +345,7 @@ static int gen_argmax(Em *e, const OmegaDecSpec *sp) { imadw(e, oa, cta, 4u, poi); stg(e, oa, R(best), udesc); region_end(e, r); } + dep_epilogue(e, udesc, tid, &D); tail(e); return e->err; } diff --git a/src/omega_blackwell_codegen_dec.h b/src/omega_blackwell_codegen_dec.h index 0ea33231e..4f8ab29e0 100644 --- a/src/omega_blackwell_codegen_dec.h +++ b/src/omega_blackwell_codegen_dec.h @@ -74,6 +74,7 @@ typedef struct { uint32_t stride; /* AXPY: elements per iteration (grid_x * 256) */ int mutant; /* TEST ONLY. RES: 1 = norm without the weight; 2 = COMBINE skips expert 7. SWIGLU: 1 = up half read at +767. ARGMAX: 1 = last equal index instead of first. 0 none */ + uint32_t dep; /* OMEGA_DEP_FLAGS | OMEGA_DEP_CAMERA (omega_bw_dep.h); 0 = none */ } OmegaDecSpec; int omega_blackwell_codegen_dec_prog(const OmegaDecSpec *spec, BlackwellIRProgram *prog); diff --git a/src/omega_blackwell_codegen_moe.c b/src/omega_blackwell_codegen_moe.c index 14d9d5c4f..61486d7b3 100644 --- a/src/omega_blackwell_codegen_moe.c +++ b/src/omega_blackwell_codegen_moe.c @@ -181,6 +181,7 @@ int omega_blackwell_codegen_fp8_gemv_prog(const OmegaFp8GemvSpec *spec, Blackwel s2r(e, tid, BW_SR_TID_X); s2r(e, cx, BW_SR_CTAID_X); s2r(e, cy, BW_SR_CTAID_Y); movi(e, one, 1); shr(e, warp, tid, 0, 5); + OmegaBwDep D; dep_prologue(e, spec->dep, udesc, tid, &D); /* before the first LDG: the table entry is router-written */ andi(e, lane, tid, 0, 31); if (spec->mutant == 3) xorr(e, gidx, cy, one); else imadi(e, gidx, cy, 0, 1, NOREG); imadw(e, tent, gidx, 16, ptab); @@ -298,6 +299,7 @@ int omega_blackwell_codegen_fp8_gemv_prog(const OmegaFp8GemvSpec *spec, Blackwel loop_end(e); const int L_end = here(e); patch_bra(e, bra_end, L_end); + dep_epilogue(e, udesc, tid, &D); tail(e); if (e->err) return -1; return omega_bw_regalloc_solve(prog); diff --git a/src/omega_blackwell_codegen_moe.h b/src/omega_blackwell_codegen_moe.h index 4140f2fc7..e0c47e4d8 100644 --- a/src/omega_blackwell_codegen_moe.h +++ b/src/omega_blackwell_codegen_moe.h @@ -84,6 +84,7 @@ typedef struct { * flight per warp); x comes from shared memory (LDS.128). Needs KS % D == 0, * rows * D * lane_bytes <= 128, k % (32 * warps) == 0 and k <= 512 * warps (staging rounds). */ int mutant; /* 0 production; 1, 2, 3 as above */ + uint32_t dep; /* OMEGA_DEP_FLAGS | OMEGA_DEP_CAMERA (omega_bw_dep.h): launch ordering by GPU-side counters; 0 = none */ } OmegaFp8GemvSpec; /* 0 on success (prog solved and register-allocated), -1 on a refused spec or an allocator failure. */ diff --git a/src/omega_blackwell_codegen_router.c b/src/omega_blackwell_codegen_router.c index 31e21331d..ecf013f7b 100644 --- a/src/omega_blackwell_codegen_router.c +++ b/src/omega_blackwell_codegen_router.c @@ -171,6 +171,7 @@ int omega_blackwell_codegen_router_prog(const OmegaRouterSpec *spec, BlackwellIR s2r(e, tid, BW_SR_TID_X); movi(e, one, 1); movrz(e, R(zero)); movi(e, c2p23, C_2P23); movi(e, cneg, NEG_BIG); shr(e, warp, tid, 5); + OmegaBwDep D; dep_prologue(e, spec->dep, udesc, tid, &D); andi(e, R(lane), R(tid), 31u); /* ---- phase 1: RMSNorm ---- */ @@ -390,6 +391,7 @@ int omega_blackwell_codegen_router_prog(const OmegaRouterSpec *spec, BlackwellIR region_end(e, rg); } patch_bra(e, bra_tail, here(e)); + dep_epilogue(e, udesc, tid, &D); tail(e); (void)zero; if (e->err) return -1; diff --git a/src/omega_blackwell_codegen_router.h b/src/omega_blackwell_codegen_router.h index 2b2b62f8d..d71cc1fef 100644 --- a/src/omega_blackwell_codegen_router.h +++ b/src/omega_blackwell_codegen_router.h @@ -73,6 +73,7 @@ typedef struct { int mutant; /* TEST ONLY. 0 none; 1 RMSNorm without the weight; 2 the mask after each argmax round removes * expert id ^ 1 (the winner can be picked again); 3 the directory entries copied are those of * id ^ 1; 4 the weights are not normalised (den = 1). */ + uint32_t dep; /* OMEGA_DEP_FLAGS | OMEGA_DEP_CAMERA (omega_bw_dep.h); 0 = none */ } OmegaRouterSpec; /* Builds the register-allocated IR program into *prog. 0 ok, -1 refused. */ diff --git a/src/omega_bw_dep.h b/src/omega_bw_dep.h new file mode 100644 index 000000000..47d6fe06f --- /dev/null +++ b/src/omega_bw_dep.h @@ -0,0 +1,128 @@ +/* omega_bw_dep.h: dependency flags between the launches of one command list (DEPFLAGS, 2026-10-16), the kernel side. + * + * Why: the decode graph serialised its ~436 dependent launches per token with WAIT_FOR_IDLE + INVALIDATE_SHADER_CACHES, + * and the launch-cost study (evidence/OWN30B-L2D-BARRIER-20261014) measured 20-28 us per dependent launch for that drain + * and refill against ~4 us without a barrier. With flags the list runs with barrier NONE and every kernel orders itself: + * prologue warp 0 polls the previous launch's done counter (LDG.E.STRONG.GPU) until counter - target < 2^31 (wrap-safe), + * then BAR.SYNC and CCTL.IVALL (nvcc's lowering of ld.acquire.gpu, probe in investigations/2026-10-16-DEPFLAGS/sass); + * a poll that never succeeds (DEP_POLL_LIMIT iterations) adds DEP_TIMEOUT_SENTINEL to this launch's own counter + * and continues, so the host sees the wrong count and nothing hangs the chip. + * epilogue before every EXIT: MEMBAR.ALL.GPU; ERRBAR; CGAERRBAR (nvcc's lowering of fence + red.release.gpu), BAR.SYNC, + * thread 0 ATOMG.E.ADD.STRONG.GPU done, 1 (the CUDA Programming Guide reduction sample: a device-scope fence + * before the count increment, and a device-scope acquire load of the flag on the other side). + * camera (dep bit 1) CS2R SR_GLOBALTIMERLO at entry and before EXIT; thread 0 stores {t0, t1} (16 B) at + * cam_base + 16 * (slot & (OMEGA_DEP_CAM_SLOTS - 1)), slot from an atomic add on the counter line's word 1. + * Constant bank words (every kernel kind; the cmdlist writes them): OMEGA_DEP_ARG_WAIT u64 va of the counter to wait on, + * OMEGA_DEP_ARG_DONE u64 va of this launch's counter line, OMEGA_DEP_ARG_TARGET u32. Counter line (64 B, GPU-cached, only the + * GPU writes it after the host's one-time init): +0 u32 done, +4 u32 camera slot allocator, +8 u64 camera base (0 = off). + * Header-only, included by a generator AFTER its Em / emit / I0 / V / V64 / here / patch_bra definitions (all five share them). */ +#ifndef OMEGA_BW_DEP_H +#define OMEGA_BW_DEP_H +#define OMEGA_DEP_ARG_WAIT 0x3e8u +#define OMEGA_DEP_ARG_DONE 0x3f0u +#define OMEGA_DEP_ARG_TARGET 0x3f8u +#define OMEGA_DEP_FLAGS 1u +#define OMEGA_DEP_CAMERA 2u +#define OMEGA_DEP_LINE_BYTES 64u +#define OMEGA_DEP_CAM_SLOTS 4096u /* records per launch (16 B each): CTAs beyond that wrap onto the first slots */ +#define OMEGA_DEP_POLL_LIMIT (1u << 18) +#define OMEGA_DEP_TIMEOUT_SENTINEL 0x12345678u + +typedef struct { int pdone, t0; uint32_t dep; } OmegaBwDep; + +static void dep_insn(Em *e, BlackwellIROpcode op, int d, int a, int b, int u, int kind) { + BlackwellIRInsn i = I0(op); i.dst_vreg = d; i.src1_vreg = a; i.src2_vreg = b; i.ureg = u; emit(e, i, kind); +} +static void dep_imadi(Em *e, int d, int a, uint32_t imm, int c) { BlackwellIRInsn i = I0(BW_IR_IMAD); i.dst_vreg = d; i.src1_vreg = a; i.imm = imm; i.src3_vreg = c; emit(e, i, K_FIXED); } +static void dep_movi(Em *e, int d, uint32_t imm) { BlackwellIRInsn i = I0(BW_IR_MOV_IMM); i.dst_vreg = d; i.imm = imm; emit(e, i, K_FIXED); } +static void dep_shr(Em *e, int d, int a, uint32_t imm) { BlackwellIRInsn i = I0(BW_IR_SHF_R); i.dst_vreg = d; i.src1_vreg = a; i.imm = imm; emit(e, i, K_FIXED); } +static void dep_isetp_ge(Em *e, int a, int b) { BlackwellIRInsn i = I0(BW_IR_ISETP_GE_U32); i.src1_vreg = a; i.src2_vreg = b; emit(e, i, K_PRED); } +static int dep_bra_p0_fwd(Em *e) { int at = here(e); BlackwellIRInsn i = I0(BW_IR_BRA); i.predicate_p0 = true; i.imm = 1; emit(e, i, K_BRA); return at; } +static void dep_bra_to(Em *e, int target) { BlackwellIRInsn i = I0(BW_IR_BRA); i.imm = (uint32_t)(target - here(e)); emit(e, i, K_BRA); } +static void dep_ldc64(Em *e, int d, uint32_t off) { BlackwellIRInsn i = I0(BW_IR_LDC64); i.dst_vreg = d; i.imm = off; emit(e, i, K_VAR); } +static void dep_ldc32(Em *e, int d, uint32_t off) { BlackwellIRInsn i = I0(BW_IR_LDC); i.dst_vreg = d; i.imm = off; emit(e, i, K_VAR); } +static void dep_bar(Em *e) { emit(e, I0(BW_IR_BAR_SYNC), K_SYNC); } +/* The linear-scan allocator knows no back edges (same rule as the generators' loop_end): a value defined before the poll + * loop and read inside it must stay live until the back-branch, else the allocator hands its register to a loop temporary. */ +static void dep_loop_extend(Em *e, int start, int end) { + OmegaRegAlloc *ra = &e->p->regalloc; + for (int v = 0; v < ra->num_vregs; v++) { + OmegaLiveInterval *iv = &ra->intervals[v]; + if (iv->first_def >= 0 && iv->first_def < start && iv->last_use >= start && iv->last_use < end) iv->last_use = end; + } +} + +/* Prologue: call after the kernel read its thread id (tid, warp index `warp` = tid >> 5) and the uniform descriptor, BEFORE + * its first global load. dep 0: emits nothing. */ +static void dep_prologue(Em *e, uint32_t dep, int udesc, int tid, OmegaBwDep *D) { + memset(D, 0, sizeof *D); D->dep = dep; D->pdone = -1; D->t0 = -1; + if (!dep) return; + D->pdone = V64(e); + if (dep & OMEGA_DEP_CAMERA) { D->t0 = V64(e); if (e->err) return; dep_insn(e, BW_IR_CS2R_GLOBALTIMER, D->t0, -1, -1, -1, K_VAR); } + dep_ldc64(e, D->pdone, OMEGA_DEP_ARG_DONE); + if (!(dep & OMEGA_DEP_FLAGS)) return; + int pwait = V64(e), target = V(e), v = V(e), diff = V(e), cnt = V(e), one = V(e), lim = V(e), sent = V(e), scratch = V(e), warp = V(e); + if (e->err) return; + dep_shr(e, warp, tid, 5); + dep_ldc64(e, pwait, OMEGA_DEP_ARG_WAIT); dep_ldc32(e, target, OMEGA_DEP_ARG_TARGET); + dep_movi(e, one, 1); dep_movi(e, lim, OMEGA_DEP_POLL_LIMIT); dep_movi(e, cnt, 0); + dep_isetp_ge(e, warp, one); /* P0: warp >= 1 -> straight to the barrier (warp 0 polls) */ + const int to_join = dep_bra_p0_fwd(e); + const int L = here(e); + dep_insn(e, BW_IR_LDG_STRONG_GPU, v, pwait, -1, udesc, K_VAR); + dep_imadi(e, diff, target, 0xffffffffu, v); /* v - target */ + dep_shr(e, diff, diff, 31); /* 0 when 0 <= v - target < 2^31 (wrap-safe) */ + dep_isetp_ge(e, one, diff); /* P0: satisfied */ + const int to_done = dep_bra_p0_fwd(e); + dep_imadi(e, cnt, one, 1u, cnt); + dep_isetp_ge(e, cnt, lim); /* P0: timed out */ + const int to_timeout = dep_bra_p0_fwd(e); + dep_bra_to(e, L); + dep_loop_extend(e, L, here(e) - 1); + const int at_timeout = here(e); + dep_movi(e, sent, OMEGA_DEP_TIMEOUT_SENTINEL); + dep_insn(e, BW_IR_ATOMG_ADD_STRONG_GPU, scratch, D->pdone, sent, udesc, K_VAR); /* names this launch to the host; no hang */ + const int at_join = here(e); + patch_bra(e, to_join, at_join); patch_bra(e, to_done, at_join); patch_bra(e, to_timeout, at_timeout); + dep_bar(e); + emit(e, I0(BW_IR_CCTL_IVALL), K_FIXED); /* acquire: no stale L1 line of a buffer the previous launch rewrote */ +} + +/* Epilogue: call before EVERY exit of the kernel, with all threads of the CTA converged (after the output stores). */ +static void dep_epilogue(Em *e, int udesc, int tid, OmegaBwDep *D) { + if (!D->dep) return; + int one = V(e), scratch = V(e); + if (e->err) return; + dep_movi(e, one, 1); + if (D->dep & OMEGA_DEP_FLAGS) { + emit(e, I0(BW_IR_MEMBAR_ALL_GPU), K_FIXED); emit(e, I0(BW_IR_ERRBAR), K_FIXED); emit(e, I0(BW_IR_CGAERRBAR), K_FIXED); + } + dep_bar(e); + dep_isetp_ge(e, tid, one); /* P0: not thread 0 -> skip */ + const int at_bssy = here(e); { BlackwellIRInsn i = I0(BW_IR_BSSY); i.bar_reg = 0; i.imm = 2; emit(e, i, K_BSSY); } + const int skip = dep_bra_p0_fwd(e); + if (D->dep & OMEGA_DEP_FLAGS) dep_insn(e, BW_IR_ATOMG_ADD_STRONG_GPU, scratch, D->pdone, one, udesc, K_VAR); + if (D->dep & OMEGA_DEP_CAMERA) { + int t1 = V64(e), pslot = V64(e), slot = V(e), cam = V64(e), rec = V64(e); + if (e->err) return; + dep_insn(e, BW_IR_CS2R_GLOBALTIMER, t1, -1, -1, -1, K_VAR); + { BlackwellIRInsn i = I0(BW_IR_IMAD_WIDE); i.dst_vreg = pslot; i.src1_vreg = one; i.imm = 4u; i.src3_vreg = D->pdone; emit(e, i, K_FIXED); } + dep_insn(e, BW_IR_ATOMG_ADD_STRONG_GPU, slot, pslot, one, udesc, K_VAR); + { BlackwellIRInsn i = I0(BW_IR_LDG_E_64); i.dst_vreg = cam; i.src1_vreg = D->pdone; i.imm = 8u; i.ureg = udesc; emit(e, i, K_VAR); } + { BlackwellIRInsn i = I0(BW_IR_LOP3_AND); i.dst_vreg = slot; i.src1_vreg = slot; i.imm = OMEGA_DEP_CAM_SLOTS - 1u; emit(e, i, K_FIXED); } + { BlackwellIRInsn i = I0(BW_IR_IMAD_WIDE); i.dst_vreg = rec; i.src1_vreg = slot; i.imm = 16u; i.src3_vreg = cam; emit(e, i, K_FIXED); } + dep_isetp_ge(e, cam, one); /* P0: camera base non-zero (low word; the host keeps bases above 4 GB-aligned pages) */ + const int at_bssy2 = here(e); { BlackwellIRInsn i = I0(BW_IR_BSSY); i.bar_reg = 1; i.imm = 2; emit(e, i, K_BSSY); } + const int to_store = dep_bra_p0_fwd(e); + const int to_end = here(e); dep_bra_to(e, to_end + 1); + patch_bra(e, to_store, here(e)); + for (unsigned q = 0; q < 4; q++) { BlackwellIRInsn st = I0(BW_IR_STG_E); st.src1_vreg = rec; st.src2_vreg = q < 2 ? D->t0 : t1; st.src2_subreg = (uint8_t)(q & 1u); st.imm = 4u * q; st.ureg = udesc; emit(e, st, K_STORE); } + patch_bra(e, to_end, here(e)); + { BlackwellIRInsn i = I0(BW_IR_BSYNC); i.bar_reg = 1; emit(e, i, K_BSYNC); } + patch_bra(e, at_bssy2, here(e)); /* BSSY imm = distance to its BSYNC + 1 as bssy_fwd/patch_bra use (target = at_bsync + 1) */ + } + const int at_bsync = here(e); + { BlackwellIRInsn i = I0(BW_IR_BSYNC); i.bar_reg = 0; emit(e, i, K_BSYNC); } + patch_bra(e, skip, at_bsync); patch_bra(e, at_bssy, at_bsync + 1); +} +#endif diff --git a/src/omega_gpu_dep.c b/src/omega_gpu_dep.c new file mode 100644 index 000000000..069d3301f --- /dev/null +++ b/src/omega_gpu_dep.c @@ -0,0 +1,9 @@ +/* omega_gpu_dep.c: see the header. */ +#include "omega_gpu_dep.h" +#include +static int g_set; static uint32_t g_mode; +uint32_t omega_gpu_dep_mode(void) { + if (!g_set) { const char *e = getenv("AIEN_OMEGA_DEP"); g_mode = e ? (uint32_t)atoi(e) & 3u : 0u; g_set = 1; } + return g_mode; +} +void omega_gpu_dep_set_mode(uint32_t mode) { g_mode = mode & 3u; g_set = 1; } diff --git a/src/omega_gpu_dep.h b/src/omega_gpu_dep.h new file mode 100644 index 000000000..739973428 --- /dev/null +++ b/src/omega_gpu_dep.h @@ -0,0 +1,17 @@ +#ifndef OMEGA_GPU_DEP_H +#define OMEGA_GPU_DEP_H +/* omega_gpu_dep: the process-wide dependency-flag mode for the decode kernels (DEPFLAGS, 2026-10-16). + * 0 = none (the WAIT_FOR_IDLE barrier orders the launches, the default), 1 = flags (OMEGA_DEP_FLAGS), 2 = camera only, + * 3 = flags + camera. Setter, else env AIEN_OMEGA_DEP read once. Every kernel API folds it into its spec (kernel cache key), + * the decode graph passes it to the command list (opts.dep). Changing it after kernels were built rebuilds them on the + * next call (different spec); the caller clears caches it pinned. */ +#include +#ifdef __cplusplus +extern "C" { +#endif +uint32_t omega_gpu_dep_mode(void); +void omega_gpu_dep_set_mode(uint32_t mode); +#ifdef __cplusplus +} +#endif +#endif From 2c8ee0590fbac9d38079f1967dc42fd548e0d8e9 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Fri, 16 Oct 2026 13:39:33 -0500 Subject: [PATCH 02/10] depflags: make the WIP compile: include the dep header, argmax prologue, moe2 hooks, test initialisers What was wrong (BUG 2 of the DEPFLAGS WIP f205d1b2): no generator included omega_bw_dep.h (the mentions were comments), so dep_prologue / dep_epilogue / OmegaBwDep were undeclared; in attn, bf16, moe and router the new `OmegaBwDep D` collided with the existing `const uint32_t D = spec->depth`; gen_argmax called dep_epilogue with no prologue and no D; the fp8 GEMV variant 2 generator (moe2.c, AIEN_OMEGA_FP8_GEMV=2) had no dep hooks at all, so in dep mode its CTAs would never report; and the four test suites brace-initialise the specs, so the new `dep` field failed -Werror=missing-field-initializers. Fix: `#include "omega_bw_dep.h"` right after each generator's patch_bra (attn, bf16, moe, moe2, router, dec); the dep state is `Dp` where `D` is the depth; gen_argmax gets its prologue after the thread index and before the first logits load; moe2 gets the prologue before the router-written table load and the epilogue before its tail; every test spec initialiser gets the dep field (0 = today). Proof: `make build/libomega_gpu.a` failed on the WIP with 48 error lines (receipt investigations/2026-10-16-DEPFLAGS/runs/p1-red-bug2-build.log) and builds clean after (p1-bug2-build-after.log). Suites at dep 0 (kernels unchanged: dep 0 emits nothing): test-gpu-cmdlist 20 + 39 checks, test-gpu-router 69 + 10, test-gpu-bf16-gemv 185 + 11, test-gpu-decode-attn 41 + 12, gpu_fp8_api_test --host-only 1482 and --sim 70, gpu_decode_graph_test --host-only 18, all 0 failed (p1-dep0-baseline-suites-2.log, p1-dep0-baseline-fp8-after-moe2.log). Co-Authored-By: Claude Fable 5.1 --- src/omega_blackwell_codegen_attn.c | 7 ++++--- src/omega_blackwell_codegen_bf16.c | 5 +++-- src/omega_blackwell_codegen_dec.c | 2 ++ src/omega_blackwell_codegen_moe.c | 5 +++-- src/omega_blackwell_codegen_moe2.c | 3 +++ src/omega_blackwell_codegen_router.c | 5 +++-- tests/gpu_bf16_gemv_test.c | 12 ++++++------ tests/gpu_cmdlist_test.c | 18 +++++++++--------- tests/gpu_decode_attn_test.c | 6 +++--- tests/gpu_router_test.c | 10 +++++----- 10 files changed, 41 insertions(+), 32 deletions(-) diff --git a/src/omega_blackwell_codegen_attn.c b/src/omega_blackwell_codegen_attn.c index d6e0ae101..d7e81ff72 100644 --- a/src/omega_blackwell_codegen_attn.c +++ b/src/omega_blackwell_codegen_attn.c @@ -104,6 +104,7 @@ static void isetp_ge_u32(Em *e, int a, int b) { BlackwellIRInsn i = I0(BW_IR_ISE static void bra(Em *e, int target) { BlackwellIRInsn i = I0(BW_IR_BRA); i.imm = (uint32_t)(target - here(e)); emit(e, i, K_BRA); } static int bra_if_p0_fwd(Em *e) { int at = here(e); BlackwellIRInsn i = I0(BW_IR_BRA); i.predicate_p0 = true; i.imm = 1; emit(e, i, K_BRA); return at; } static void patch_bra(Em *e, int at, int target) { if (!e->err) e->p->insns[at].imm = (uint32_t)(target - at); } +#include "omega_bw_dep.h" /* DEPFLAGS: needs Em, emit, I0, V, V64, here, patch_bra, K_* above */ static int bssy_fwd(Em *e) { int at = here(e); BlackwellIRInsn i = I0(BW_IR_BSSY); i.bar_reg = 0; i.imm = 2; emit(e, i, K_BSSY); return at; } static void bsync(Em *e) { BlackwellIRInsn i = I0(BW_IR_BSYNC); i.bar_reg = 0; emit(e, i, K_BSYNC); } static void exit_k(Em *e) { emit(e, I0(BW_IR_EXIT), K_EXIT); } @@ -163,7 +164,7 @@ int omega_blackwell_codegen_decode_attn_prog(const OmegaDecodeAttnSpec *spec, Bl s2r(e, tid, BW_SR_TID_X); s2r(e, cx, BW_SR_CTAID_X); s2r(e, cy, BW_SR_CTAID_Y); movi(e, one, 1); movrz(e, R(zero)); movi(e, c7fff, 0x7fffu); movi(e, c16, 16); shr(e, warp, tid, 5); - OmegaBwDep D; dep_prologue(e, spec->dep, udesc, tid, &D); + OmegaBwDep Dp; dep_prologue(e, spec->dep, udesc, tid, &Dp); andi(e, R(lane), R(tid), 31u); /* range of this CTA: base = cx * per; end = min(base + per, pos + 1) */ @@ -477,7 +478,7 @@ int omega_blackwell_codegen_decode_attn_prog(const OmegaDecodeAttnSpec *spec, Bl lds32(e, R(ep[0]), t1, 1); isetp_ge_u32(e, ep[0], splitsm1); const int bra_last = bra_if_p0_fwd(e); - dep_epilogue(e, udesc, tid, &D); /* CTA-uniform exit (ep[0] is one shared word): all threads take it */ + dep_epilogue(e, udesc, tid, &Dp); /* CTA-uniform exit (ep[0] is one shared word): all threads take it */ exit_k(e); patch_bra(e, bra_last, here(e)); /* combine: thread tid, outputs o = tid + 256 r (head o >> 7, dim o & 127), r = 0..3 */ @@ -537,7 +538,7 @@ int omega_blackwell_codegen_decode_attn_prog(const OmegaDecodeAttnSpec *spec, Bl /* thread 0 resets the counter for the next launch (every other CTA of this head has already added) */ isetp_ge_u32(e, tid, one); { Region r = region_skip_if_p0(e); imadw(e, pb64, cy, 4u, pcnt); stg(e, BW_IR_STG_STRONG_SYS, pb64, R(zero), udesc); region_end(e, r); } - dep_epilogue(e, udesc, tid, &D); + dep_epilogue(e, udesc, tid, &Dp); tail(e); if (e->err) return -1; return omega_bw_regalloc_solve(prog); diff --git a/src/omega_blackwell_codegen_bf16.c b/src/omega_blackwell_codegen_bf16.c index 3ba673a5c..b1a2483c9 100644 --- a/src/omega_blackwell_codegen_bf16.c +++ b/src/omega_blackwell_codegen_bf16.c @@ -95,6 +95,7 @@ static void bra(Em *e, int target) { BlackwellIRInsn i = I0(BW_IR_BRA); i.imm = /* a forward branch whose target is patched when known: returns the instruction index */ static int bra_if_p0_fwd(Em *e) { int at = here(e); BlackwellIRInsn i = I0(BW_IR_BRA); i.predicate_p0 = true; i.imm = 1; emit(e, i, K_BRA); return at; } static void patch_bra(Em *e, int at, int target) { if (!e->err) e->p->insns[at].imm = (uint32_t)(target - at); } +#include "omega_bw_dep.h" /* DEPFLAGS: needs Em, emit, I0, V, V64, here, patch_bra, K_* above */ static int bssy_fwd(Em *e) { int at = here(e); BlackwellIRInsn i = I0(BW_IR_BSSY); i.bar_reg = 0; i.imm = 2; emit(e, i, K_BSSY); return at; } static void bsync(Em *e) { BlackwellIRInsn i = I0(BW_IR_BSYNC); i.bar_reg = 0; emit(e, i, K_BSYNC); } static void tail(Em *e) { @@ -151,7 +152,7 @@ int omega_blackwell_codegen_bf16_gemv_prog(const OmegaBf16GemvSpec *spec, Blackw s2r(e, tid, BW_SR_TID_X); s2r(e, cx, BW_SR_CTAID_X); movi(e, one, 1); shr(e, warp, tid, 0, 5); - OmegaBwDep D; dep_prologue(e, spec->dep, udesc, tid, &D); + OmegaBwDep Dp; dep_prologue(e, spec->dep, udesc, tid, &Dp); andi(e, lane, tid, 0, 31); imadi(e, wlane, lane, 0, 16, NOREG); /* byte offset of this lane's chunk in a row step */ imadi(e, rg, cx, 0, W, warp); /* first row group of this warp */ @@ -233,7 +234,7 @@ int omega_blackwell_codegen_bf16_gemv_prog(const OmegaBf16GemvSpec *spec, Blackw loop_end(e); const int L_end = here(e); patch_bra(e, bra_end, L_end); - dep_epilogue(e, udesc, tid, &D); + dep_epilogue(e, udesc, tid, &Dp); tail(e); if (e->err) return -1; return omega_bw_regalloc_solve(prog); diff --git a/src/omega_blackwell_codegen_dec.c b/src/omega_blackwell_codegen_dec.c index 00117283d..07f010a8d 100644 --- a/src/omega_blackwell_codegen_dec.c +++ b/src/omega_blackwell_codegen_dec.c @@ -94,6 +94,7 @@ static void isetp_ge_u32(Em *e, int a, int b) { BlackwellIRInsn i = I0(BW_IR_ISE static void bra(Em *e, int target) { BlackwellIRInsn i = I0(BW_IR_BRA); i.imm = (uint32_t)(target - here(e)); emit(e, i, K_BRA); } static int bra_if_p0_fwd(Em *e) { int at = here(e); BlackwellIRInsn i = I0(BW_IR_BRA); i.predicate_p0 = true; i.imm = 1; emit(e, i, K_BRA); return at; } static void patch_bra(Em *e, int at, int target) { if (!e->err) e->p->insns[at].imm = (uint32_t)(target - at); } +#include "omega_bw_dep.h" /* DEPFLAGS: needs Em, emit, I0, V, V64, here, patch_bra, K_* above */ static int bssy_fwd(Em *e) { int at = here(e); BlackwellIRInsn i = I0(BW_IR_BSSY); i.bar_reg = 0; i.imm = 2; emit(e, i, K_BSSY); return at; } static void bsync(Em *e) { BlackwellIRInsn i = I0(BW_IR_BSYNC); i.bar_reg = 0; emit(e, i, K_BSYNC); } static void exit_k(Em *e) { emit(e, I0(BW_IR_EXIT), K_EXIT); } @@ -304,6 +305,7 @@ static int gen_argmax(Em *e, const OmegaDecSpec *sp) { shr(e, warp, tid, 5); andi(e, R(lane), R(tid), 31u); imadi(e, R(gid), R(cta), OMEGA_DEC_THREADS, tid); + OmegaBwDep D; dep_prologue(e, sp->dep, udesc, tid, &D); /* before the first global load: the logits are lm_head-written */ imadi(e, R(off), R(gid), 32u, NOREG); imadw(e, va, off, 1u, pv); ldg(e, BW_IR_LDG_E_128, vq0, va, 0, udesc, 1); ldg(e, BW_IR_LDG_E_128, vq1, va, 16, udesc, 0); diff --git a/src/omega_blackwell_codegen_moe.c b/src/omega_blackwell_codegen_moe.c index 61486d7b3..979562e37 100644 --- a/src/omega_blackwell_codegen_moe.c +++ b/src/omega_blackwell_codegen_moe.c @@ -101,6 +101,7 @@ static void bra(Em *e, int target) { BlackwellIRInsn i = I0(BW_IR_BRA); i.imm = /* a forward branch whose target is patched when known: returns the instruction index */ static int bra_if_p0_fwd(Em *e) { int at = here(e); BlackwellIRInsn i = I0(BW_IR_BRA); i.predicate_p0 = true; i.imm = 1; emit(e, i, K_BRA); return at; } static void patch_bra(Em *e, int at, int target) { if (!e->err) e->p->insns[at].imm = (uint32_t)(target - at); } +#include "omega_bw_dep.h" /* DEPFLAGS: needs Em, emit, I0, V, V64, here, patch_bra, K_* above */ static int bssy_fwd(Em *e) { int at = here(e); BlackwellIRInsn i = I0(BW_IR_BSSY); i.bar_reg = 0; i.imm = 2; emit(e, i, K_BSSY); return at; } static void bsync(Em *e) { BlackwellIRInsn i = I0(BW_IR_BSYNC); i.bar_reg = 0; emit(e, i, K_BSYNC); } static void tail(Em *e) { @@ -181,7 +182,7 @@ int omega_blackwell_codegen_fp8_gemv_prog(const OmegaFp8GemvSpec *spec, Blackwel s2r(e, tid, BW_SR_TID_X); s2r(e, cx, BW_SR_CTAID_X); s2r(e, cy, BW_SR_CTAID_Y); movi(e, one, 1); shr(e, warp, tid, 0, 5); - OmegaBwDep D; dep_prologue(e, spec->dep, udesc, tid, &D); /* before the first LDG: the table entry is router-written */ + OmegaBwDep Dp; dep_prologue(e, spec->dep, udesc, tid, &Dp); /* before the first LDG: the table entry is router-written */ andi(e, lane, tid, 0, 31); if (spec->mutant == 3) xorr(e, gidx, cy, one); else imadi(e, gidx, cy, 0, 1, NOREG); imadw(e, tent, gidx, 16, ptab); @@ -299,7 +300,7 @@ int omega_blackwell_codegen_fp8_gemv_prog(const OmegaFp8GemvSpec *spec, Blackwel loop_end(e); const int L_end = here(e); patch_bra(e, bra_end, L_end); - dep_epilogue(e, udesc, tid, &D); + dep_epilogue(e, udesc, tid, &Dp); tail(e); if (e->err) return -1; return omega_bw_regalloc_solve(prog); diff --git a/src/omega_blackwell_codegen_moe2.c b/src/omega_blackwell_codegen_moe2.c index 967822300..ad41423b5 100644 --- a/src/omega_blackwell_codegen_moe2.c +++ b/src/omega_blackwell_codegen_moe2.c @@ -104,6 +104,7 @@ static void isetp_ge_u32(Em *e, int a, int b) { BlackwellIRInsn i = I0(BW_IR_ISE static void bra(Em *e, int target) { BlackwellIRInsn i = I0(BW_IR_BRA); i.imm = (uint32_t)(target - here(e)); emit(e, i, K_BRA); } static int bra_if_p0_fwd(Em *e) { int at = here(e); BlackwellIRInsn i = I0(BW_IR_BRA); i.predicate_p0 = true; i.imm = 1; emit(e, i, K_BRA); return at; } static void patch_bra(Em *e, int at, int target) { if (!e->err) e->p->insns[at].imm = (uint32_t)(target - at); } +#include "omega_bw_dep.h" /* DEPFLAGS: needs Em, emit, I0, V, V64, here, patch_bra, K_* above */ static int bssy_fwd(Em *e) { int at = here(e); BlackwellIRInsn i = I0(BW_IR_BSSY); i.bar_reg = 0; i.imm = 2; emit(e, i, K_BSSY); return at; } static void bsync(Em *e) { BlackwellIRInsn i = I0(BW_IR_BSYNC); i.bar_reg = 0; emit(e, i, K_BSYNC); } static void tail(Em *e) { @@ -188,6 +189,7 @@ int omega_blackwell_codegen_fp8_gemv2_prog(const OmegaFp8GemvSpec *spec, Blackwe ldc64(e, ptab, OMEGA_FP8_ARG_TAB); ldc64(e, px, OMEGA_FP8_ARG_X); ldc64(e, py, OMEGA_FP8_ARG_Y); ldc32(e, rgn, OMEGA_FP8_ARG_RG); ldc32(e, xs, OMEGA_FP8_ARG_XSTRIDE); ldc32(e, ys, OMEGA_FP8_ARG_YSTRIDE); ldc32(e, stride, OMEGA_FP8_ARG_STRIDE); s2r(e, tid, BW_SR_TID_X); s2r(e, cx, BW_SR_CTAID_X); s2r(e, cy, BW_SR_CTAID_Y); + OmegaBwDep Dp; dep_prologue(e, spec->dep, udesc, tid, &Dp); /* before the first LDG: the table entry is router-written */ movi(e, one, 1); shr(e, warp, tid, 0, 5); andi(e, lane, tid, 0, 31); @@ -311,6 +313,7 @@ int omega_blackwell_codegen_fp8_gemv2_prog(const OmegaFp8GemvSpec *spec, Blackwe const int L_end = here(e); patch_bra(e, bra_none, L_end); patch_bra(e, bra_done, L_end); + dep_epilogue(e, udesc, tid, &Dp); tail(e); if (e->err) return -1; return omega_bw_regalloc_solve(prog); diff --git a/src/omega_blackwell_codegen_router.c b/src/omega_blackwell_codegen_router.c index ecf013f7b..c2956ffdf 100644 --- a/src/omega_blackwell_codegen_router.c +++ b/src/omega_blackwell_codegen_router.c @@ -100,6 +100,7 @@ static void isetp_ge_u32(Em *e, int a, int b) { BlackwellIRInsn i = I0(BW_IR_ISE static void bra(Em *e, int target) { BlackwellIRInsn i = I0(BW_IR_BRA); i.imm = (uint32_t)(target - here(e)); emit(e, i, K_BRA); } static int bra_if_p0_fwd(Em *e) { int at = here(e); BlackwellIRInsn i = I0(BW_IR_BRA); i.predicate_p0 = true; i.imm = 1; emit(e, i, K_BRA); return at; } static void patch_bra(Em *e, int at, int target) { if (!e->err) e->p->insns[at].imm = (uint32_t)(target - at); } +#include "omega_bw_dep.h" /* DEPFLAGS: needs Em, emit, I0, V, V64, here, patch_bra, K_* above */ static int bssy_fwd(Em *e) { int at = here(e); BlackwellIRInsn i = I0(BW_IR_BSSY); i.bar_reg = 0; i.imm = 2; emit(e, i, K_BSSY); return at; } static void bsync(Em *e) { BlackwellIRInsn i = I0(BW_IR_BSYNC); i.bar_reg = 0; emit(e, i, K_BSYNC); } static void exit_k(Em *e) { emit(e, I0(BW_IR_EXIT), K_EXIT); } @@ -171,7 +172,7 @@ int omega_blackwell_codegen_router_prog(const OmegaRouterSpec *spec, BlackwellIR s2r(e, tid, BW_SR_TID_X); movi(e, one, 1); movrz(e, R(zero)); movi(e, c2p23, C_2P23); movi(e, cneg, NEG_BIG); shr(e, warp, tid, 5); - OmegaBwDep D; dep_prologue(e, spec->dep, udesc, tid, &D); + OmegaBwDep Dp; dep_prologue(e, spec->dep, udesc, tid, &Dp); andi(e, R(lane), R(tid), 31u); /* ---- phase 1: RMSNorm ---- */ @@ -391,7 +392,7 @@ int omega_blackwell_codegen_router_prog(const OmegaRouterSpec *spec, BlackwellIR region_end(e, rg); } patch_bra(e, bra_tail, here(e)); - dep_epilogue(e, udesc, tid, &D); + dep_epilogue(e, udesc, tid, &Dp); tail(e); (void)zero; if (e->err) return -1; diff --git a/tests/gpu_bf16_gemv_test.c b/tests/gpu_bf16_gemv_test.c index 7b8e231c4..4f242d906 100644 --- a/tests/gpu_bf16_gemv_test.c +++ b/tests/gpu_bf16_gemv_test.c @@ -80,17 +80,17 @@ static void host_only(void) { free(w); free(x); } uint32_t ws[] = { 4, 8, 16, 32 }, rs[] = { 1, 2, 4 }; for (unsigned i = 0; i < 4; i++) for (unsigned j = 0; j < 3; j++) for (uint32_t d = 1; d <= 8; d *= 2) for (int m = 0; m <= 3; m++) { - OmegaBf16GemvSpec s = { 2048, rs[j], ws[i], d, m }; + OmegaBf16GemvSpec s = { 2048, rs[j], ws[i], d, m, 0 }; if (rs[j] * d > 16u) continue; uint32_t n = 0, g = 0; int rc = omega_bf16_gemv_prog_stats(&s, &n, &g); uint32_t decl = ((g + 1 + 7) / 8) * 8; CHECK(rc == 0 && n <= 1024, "codegen k2048 rows %u warps %u depth %u mutant %d: rc %d insns %u gprs %u", rs[j], ws[i], d, m, rc, n, g); if (m == 0 && rc == 0 && rs[j] == 1 && d == 8) printf("codegen rows %u warps %2u depth %u: %u instructions, %u registers (declared %u, register file %u of 65536)%s\n", rs[j], ws[i], d, n, g, decl, 32u * ws[i] * decl, 32u * ws[i] * decl <= 65536u ? "" : " DOES NOT FIT"); } - { OmegaBf16GemvSpec s = { 2048, 3, 8, 8, 0 }; CHECK(omega_bf16_gemv_prog_stats(&s, NULL, NULL) != 0, "rows 3 refused"); } - { OmegaBf16GemvSpec s = { 2000, 1, 8, 8, 0 }; CHECK(omega_bf16_gemv_prog_stats(&s, NULL, NULL) != 0, "k 2000 refused"); } - { OmegaBf16GemvSpec s = { 2048, 1, 8, 3, 0 }; CHECK(omega_bf16_gemv_prog_stats(&s, NULL, NULL) != 0, "depth 3 refused"); } - { OmegaBf16GemvSpec s = { 2048, 1, 8, 8, 4 }; CHECK(omega_bf16_gemv_prog_stats(&s, NULL, NULL) != 0, "mutant 4 refused"); } + { OmegaBf16GemvSpec s = { 2048, 3, 8, 8, 0, 0 }; CHECK(omega_bf16_gemv_prog_stats(&s, NULL, NULL) != 0, "rows 3 refused"); } + { OmegaBf16GemvSpec s = { 2000, 1, 8, 8, 0, 0 }; CHECK(omega_bf16_gemv_prog_stats(&s, NULL, NULL) != 0, "k 2000 refused"); } + { OmegaBf16GemvSpec s = { 2048, 1, 8, 3, 0, 0 }; CHECK(omega_bf16_gemv_prog_stats(&s, NULL, NULL) != 0, "depth 3 refused"); } + { OmegaBf16GemvSpec s = { 2048, 1, 8, 8, 4, 0 }; CHECK(omega_bf16_gemv_prog_stats(&s, NULL, NULL) != 0, "mutant 4 refused"); } CHECK(OMEGA_BF16_ARGS_WORDS <= OMEGA_GPU_SESSION_MAX_ARGS, "argument words fit the constant bank window"); uint16_t bad[256]; memset(bad, 0, sizeof bad); bad[7] = 0x7f80; OmegaGpuBf16Tensor *t = NULL; @@ -102,7 +102,7 @@ static void host_only(void) { static uint64_t g_sim_issues; static int sim_point(uint32_t k, uint32_t n, uint32_t rows, uint32_t warps, uint32_t depth, uint32_t grid_x, int mutant, uint32_t seed, char *msg, size_t msgn, size_t *bad) { static BlackwellIRProgram prog; - OmegaBf16GemvSpec spec = { k, rows, warps, depth, mutant }; + OmegaBf16GemvSpec spec = { k, rows, warps, depth, mutant, 0 }; if (omega_blackwell_codegen_bf16_gemv_prog(&spec, &prog) != 0) { snprintf(msg, msgn, "codegen refused"); return -1; } uint16_t *w = aligned_alloc(16, (size_t)n * k * 2); { uint16_t *t = make_w((size_t)n * k, seed); memcpy(w, t, (size_t)n * k * 2); free(t); } float *x = aligned_alloc(16, (size_t)k * 4); { float *t = make_x(k, seed + 1); memcpy(x, t, (size_t)k * 4); free(t); } diff --git a/tests/gpu_cmdlist_test.c b/tests/gpu_cmdlist_test.c index f0647d615..53d89f4af 100644 --- a/tests/gpu_cmdlist_test.c +++ b/tests/gpu_cmdlist_test.c @@ -122,13 +122,13 @@ static int specs_build(void) { /* ---- host-only ---- */ static int host_only(void) { const struct { const char *name; OmegaDecSpec s; } cases[] = { - { "axpy", { OMEGA_DEC_AXPY, 0, AXPY_STRIDE, 0 } }, - { "res add|norm", { OMEGA_DEC_RES, OMEGA_DEC_RES_ADD | OMEGA_DEC_RES_NORM, 0, 0 } }, - { "res combine|norm", { OMEGA_DEC_RES, OMEGA_DEC_RES_COMBINE | OMEGA_DEC_RES_NORM, 0, 0 } }, - { "res add", { OMEGA_DEC_RES, OMEGA_DEC_RES_ADD, 0, 0 } }, - { "swiglu", { OMEGA_DEC_SWIGLU, 0, 0, 0 } }, - { "argmax", { OMEGA_DEC_ARGMAX, 0, 0, 0 } }, - { "argmax indexed", { OMEGA_DEC_ARGMAX, 1, 0, 0 } }, + { "axpy", { OMEGA_DEC_AXPY, 0, AXPY_STRIDE, 0, 0 } }, + { "res add|norm", { OMEGA_DEC_RES, OMEGA_DEC_RES_ADD | OMEGA_DEC_RES_NORM, 0, 0, 0 } }, + { "res combine|norm", { OMEGA_DEC_RES, OMEGA_DEC_RES_COMBINE | OMEGA_DEC_RES_NORM, 0, 0, 0 } }, + { "res add", { OMEGA_DEC_RES, OMEGA_DEC_RES_ADD, 0, 0, 0 } }, + { "swiglu", { OMEGA_DEC_SWIGLU, 0, 0, 0, 0 } }, + { "argmax", { OMEGA_DEC_ARGMAX, 0, 0, 0, 0 } }, + { "argmax indexed", { OMEGA_DEC_ARGMAX, 1, 0, 0, 0 } }, }; for (unsigned i = 0; i < sizeof cases / sizeof cases[0]; i++) { uint32_t insns = 0, gprs = 0; @@ -137,8 +137,8 @@ static int host_only(void) { CHECK(gprs <= 200, "%s gprs %u within budget", cases[i].name, gprs); printf("codegen %s: %u insns, peak %u gprs, declared %u\n", cases[i].name, insns, gprs, omega_bw_gpr_declared(gprs)); } - OmegaDecSpec bad[] = { { OMEGA_DEC_AXPY, 0, 0, 0 }, { OMEGA_DEC_AXPY, 0, 100, 0 }, { OMEGA_DEC_RES, 0, 0, 0 }, - { OMEGA_DEC_RES, OMEGA_DEC_RES_ADD | OMEGA_DEC_RES_COMBINE, 0, 0 }, { (OmegaDecKind)0, 0, 0, 0 }, { OMEGA_DEC_RES, 8, 0, 0 } }; + OmegaDecSpec bad[] = { { OMEGA_DEC_AXPY, 0, 0, 0, 0 }, { OMEGA_DEC_AXPY, 0, 100, 0, 0 }, { OMEGA_DEC_RES, 0, 0, 0, 0 }, + { OMEGA_DEC_RES, OMEGA_DEC_RES_ADD | OMEGA_DEC_RES_COMBINE, 0, 0, 0 }, { (OmegaDecKind)0, 0, 0, 0, 0 }, { OMEGA_DEC_RES, 8, 0, 0, 0 } }; for (unsigned i = 0; i < sizeof bad / sizeof bad[0]; i++) CHECK(omega_dec_prog_stats(&bad[i], NULL, NULL) != 0, "refusal %u", i); return g_failed ? 1 : 0; } diff --git a/tests/gpu_decode_attn_test.c b/tests/gpu_decode_attn_test.c index 6a30d1835..7c6f5fede 100644 --- a/tests/gpu_decode_attn_test.c +++ b/tests/gpu_decode_attn_test.c @@ -192,12 +192,12 @@ static void host_only(void) { free(ref); case_free(&c); } /* codegen budget */ for (uint32_t d = 1; d <= 4; d++) for (int m = 0; m <= 4; m++) { - OmegaDecodeAttnSpec s = { d, m }; uint32_t n = 0, gp = 0; + OmegaDecodeAttnSpec s = { d, m, 0 }; uint32_t n = 0, gp = 0; int rc = omega_decode_attn_prog_stats(&s, &n, &gp); CHECK(rc == 0 && n <= 1024 && gp <= 128, "codegen depth %u mutant %d: rc %d insns %u gprs %u", d, m, rc, n, gp); if (rc == 0 && m == 0) printf("codegen depth %u: %u instructions, %u registers (declared %u, 256 threads -> %u of 65536)\n", d, n, gp, ((gp + 8) / 8) * 8, 256 * ((gp + 8) / 8) * 8); } - { OmegaDecodeAttnSpec s = { 0, 0 }; CHECK(omega_decode_attn_prog_stats(&s, NULL, NULL) != 0, "depth 0 refused"); + { OmegaDecodeAttnSpec s = { 0, 0, 0 }; CHECK(omega_decode_attn_prog_stats(&s, NULL, NULL) != 0, "depth 0 refused"); s.depth = 5; CHECK(omega_decode_attn_prog_stats(&s, NULL, NULL) != 0, "depth 5 refused"); s.depth = 1; s.mutant = 5; CHECK(omega_decode_attn_prog_stats(&s, NULL, NULL) != 0, "mutant 5 refused"); } CHECK(omega_gpu_decode_attn_cache_alloc(0, 256, THETA, NULL) == OMEGA_GPU_DATTN_BAD_ARGS, "NULL out refused"); @@ -210,7 +210,7 @@ static void host_only(void) { static uint64_t g_sim_issues; static int sim_point(uint32_t max_pos, uint32_t pos, uint32_t depth, int mutant, uint32_t per_split, float qscale, uint32_t seed, char *msg, size_t n, double *worst, size_t *bad, char *rows, size_t rn) { static BlackwellIRProgram prog; - OmegaDecodeAttnSpec spec = { depth, mutant }; + OmegaDecodeAttnSpec spec = { depth, mutant, 0 }; if (omega_blackwell_codegen_decode_attn_prog(&spec, &prog) != 0) { snprintf(msg, n, "codegen refused"); return -1; } Case c; case_make(&c, max_pos, pos, seed, qscale); const uint32_t splits = (pos + per_split) / per_split; diff --git a/tests/gpu_router_test.c b/tests/gpu_router_test.c index 1c274e79a..627684a39 100644 --- a/tests/gpu_router_test.c +++ b/tests/gpu_router_test.c @@ -107,15 +107,15 @@ static void host_only(void) { /* codegen budgets: every production shape fits the register file (32 * warps * declared <= 65536) and the IR limit */ uint32_t ws[] = { 8, 16, 32 }, ds[] = { 1, 2, 4, 8 }; for (unsigned i = 0; i < 3; i++) for (unsigned j = 0; j < 4; j++) for (int m = 0; m <= 4; m++) { - OmegaRouterSpec s = { ws[i], ds[j], m }; uint32_t n = 0, g = 0; + OmegaRouterSpec s = { ws[i], ds[j], m, 0 }; uint32_t n = 0, g = 0; int rc = omega_router_prog_stats(&s, &n, &g); uint32_t decl = ((g + 1 + 7) / 8) * 8; CHECK(rc == 0 && n <= 1024 && 32u * ws[i] * decl <= 65536u, "codegen warps %u depth %u mutant %d: rc %d insns %u gprs %u declared %u", ws[i], ds[j], m, rc, n, g, decl); if (m == 0 && rc == 0) printf("codegen warps %2u depth %u: %u instructions, %u registers (declared %u, register file %u of 65536)\n", ws[i], ds[j], n, g, decl, 32u * ws[i] * decl); } - { OmegaRouterSpec s = { 4, 8, 0 }; CHECK(omega_router_prog_stats(&s, NULL, NULL) != 0, "warps 4 refused"); } - { OmegaRouterSpec s = { 8, 3, 0 }; CHECK(omega_router_prog_stats(&s, NULL, NULL) != 0, "depth 3 refused"); } - { OmegaRouterSpec s = { 8, 8, 5 }; CHECK(omega_router_prog_stats(&s, NULL, NULL) != 0, "mutant 5 refused"); } + { OmegaRouterSpec s = { 4, 8, 0, 0 }; CHECK(omega_router_prog_stats(&s, NULL, NULL) != 0, "warps 4 refused"); } + { OmegaRouterSpec s = { 8, 3, 0, 0 }; CHECK(omega_router_prog_stats(&s, NULL, NULL) != 0, "depth 3 refused"); } + { OmegaRouterSpec s = { 8, 8, 5, 0 }; CHECK(omega_router_prog_stats(&s, NULL, NULL) != 0, "mutant 5 refused"); } CHECK(OMEGA_ROUTER_ARGS_WORDS <= OMEGA_GPU_SESSION_MAX_ARGS, "argument words fit the constant bank window"); } @@ -126,7 +126,7 @@ enum { B_X = 0, B_XOUT = 8192, B_IDS = 16384, B_WTS = 16448, B_TGU = 16512, B_TD static void fake_dirs(uint64_t *dgu, uint64_t *ddn) { for (unsigned e = 0; e < NE; e++) { dgu[2 * e] = 0x100000000ull + e * 16; dgu[2 * e + 1] = 0x200000000ull + e * 16 + 8; ddn[2 * e] = 0x300000000ull + e * 32; ddn[2 * e + 1] = 0x400000000ull + e * 32 + 16; } } static int sim_point(uint32_t depth, int mutant, int norm_topk, float out_scale, uint32_t seed, char *msg, size_t n, int *bad, int *margin_case) { static BlackwellIRProgram prog; - OmegaRouterSpec spec = { 8, depth, mutant }; + OmegaRouterSpec spec = { 8, depth, mutant, 0 }; if (omega_blackwell_codegen_router_prog(&spec, &prog) != 0) { snprintf(msg, n, "codegen refused"); return -1; } Case c; case_make(&c, seed, 1.0f, norm_topk); uint8_t *blk = aligned_alloc(16, B_BYTES); memset(blk, 0, B_BYTES); From 33e2c823bd87045ab442d8282d9267dd6a7e5506 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Fri, 16 Oct 2026 13:41:42 -0500 Subject: [PATCH 03/10] sim: model the DEPFLAGS opcodes, the STG_E immediate, a global timer and a poll hook What was missing: tests/bw_warp_sim_k.h knew none of the six DEPFLAGS opcodes (LDG.E.STRONG.GPU, ATOMG.E.ADD.STRONG.GPU, MEMBAR.ALL.GPU, ERRBAR, CGAERRBAR, CS2R SR_GLOBALTIMERLO) nor CCTL.IVALL, so any dep kernel failed with "opcode not modelled"; and its STG_E ignored insn->imm while the encoder honours a signed 24-bit offset (the camera stores use 0/4/8/12). Fix: GPU-scope loads/atomics behave like the SYS-scope ones (CTAs run one after another, so every earlier add is visible); fences and the L1 invalidate are no-ops (no caches); CS2R returns a 64-bit counter that advances by one per read; STG_E adds the immediate; WsSim gains poll_hook/poll_ctx, called on every LDG.E.STRONG.GPU with the address, so a test can play a late producer. Proof: the existing --sim suites are unchanged with this header (test-gpu-cmdlist 39, router 10, bf16 11, decode-attn 12, fp8 70 checks, 0 failed: investigations/2026-10-16-DEPFLAGS/runs/ p1-dep0-baseline-suites-2.log, p1-dep0-baseline-fp8-after-moe2.log); the DEPFLAGS tests in the next commit run on it. Co-Authored-By: Claude Fable 5.1 --- tests/bw_warp_sim_k.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/bw_warp_sim_k.h b/tests/bw_warp_sim_k.h index 676b29344..6713a8eee 100644 --- a/tests/bw_warp_sim_k.h +++ b/tests/bw_warp_sim_k.h @@ -81,7 +81,7 @@ typedef struct { } WsWarp; typedef struct { uintptr_t lo, hi; } WsRange; -typedef struct { +typedef struct WsSim { const BlackwellIRProgram *p; uint32_t cbank[256]; /* constant bank 0 words (byte offset / 4) */ uint32_t threads; /* per CTA, a multiple of 32, <= WS_MAX_THREADS */ @@ -97,6 +97,10 @@ typedef struct { uint64_t splits; /* branches that split a fragment */ uint64_t bar_split_arrivals; /* BAR.SYNC reached by a fragment that is not the whole live warp */ int max_frags, peak_bars; + /* DEPFLAGS (2026-10-16): called on every LDG.E.STRONG.GPU (once per lane) with the address, so a test can play a late + * producer (bump the counter after N polls). timer: the 64-bit value CS2R SR_GLOBALTIMERLO returns, +1 per read. */ + void (*poll_hook)(struct WsSim *s, uint64_t addr, void *ctx); void *poll_ctx; + uint64_t timer; } WsSim; static void ws_fail(WsSim *s, int err, int pc, const char *what) { @@ -155,7 +159,7 @@ static void ws_lane_exec(WsSim *s, WsLane *l, const BlackwellIRInsn *in, int pc, case BW_IR_ISETP_GE_U32: l->p0 = a >= b; break; case BW_IR_LDG_E: { uint64_t ad = ws_rd64(l, in->src1_vreg, p); if (!ws_mem_ok(s, ad, 4, pc)) return; uint32_t x; memcpy(&x, (const void *)(uintptr_t)ad, 4); ws_wrs(l, in->dst_vreg, in->dst_subreg, x, p); break; } case BW_IR_LDG_E_U16: { uint64_t ad = ws_rd64(l, in->src1_vreg, p); if (!ws_mem_ok(s, ad, 2, pc)) return; uint16_t x; memcpy(&x, (const void *)(uintptr_t)ad, 2); ws_wrs(l, in->dst_vreg, in->dst_subreg, x, p); break; } - case BW_IR_STG_E: { uint64_t ad = ws_rd64(l, in->src1_vreg, p); if (!ws_mem_ok(s, ad, 4, pc)) return; memcpy((void *)(uintptr_t)ad, &b, 4); break; } + case BW_IR_STG_E: { uint64_t ad = ws_rd64(l, in->src1_vreg, p) + (uint64_t)(int64_t)(int32_t)in->imm; if (!ws_mem_ok(s, ad, 4, pc)) return; memcpy((void *)(uintptr_t)ad, &b, 4); break; } /* + imm: the encoder honours a signed 24-bit offset */ case BW_IR_LDG_E_64: case BW_IR_LDG_E_128: { unsigned n = in->op == BW_IR_LDG_E_64 ? 8u : 16u; uint64_t ad = ws_rd64(l, in->src1_vreg, p) + (uint64_t)(int64_t)(int32_t)in->imm; if (!ws_mem_ok(s, ad, n, pc)) { if (getenv("WS_DBG")) fprintf(stderr, " tid %u cx %u cy %u\n", tid, cx, cy); return; } if (ad & (n - 1)) { ws_fail(s, WS_E_MEM, pc, "wide global load not naturally aligned"); return; } uint32_t x[4]; memcpy(x, (const void *)(uintptr_t)ad, n); for (unsigned i = 0; i < n / 4; i++) ws_wrs(l, in->dst_vreg, i, x[i], p); break; } case BW_IR_LDS128: { uint32_t ad = a + in->imm; if (ad & 15u) { ws_fail(s, WS_E_SMEM, pc, "LDS.128 address not 16-byte aligned"); return; } for (unsigned i = 0; i < 4; i++) { uint32_t *m = ws_smem(s, ad + 4u * i, pc); if (!m) return; ws_wrs(l, in->dst_vreg, i, *m, p); } break; } case BW_IR_LDS32: { uint32_t *m = ws_smem(s, a, pc); if (!m) return; ws_wrs(l, in->dst_vreg, in->dst_subreg, *m, p); break; } @@ -174,6 +178,12 @@ static void ws_lane_exec(WsSim *s, WsLane *l, const BlackwellIRInsn *in, int pc, case BW_IR_STG_STRONG_SYS: { uint64_t ad = ws_rd64(l, in->src1_vreg, p); if (!ws_mem_ok(s, ad, 4, pc)) return; memcpy((void *)(uintptr_t)ad, &b, 4); break; } case BW_IR_ATOMG_ADD_STRONG_SYS: { uint64_t ad = ws_rd64(l, in->src1_vreg, p); if (!ws_mem_ok(s, ad, 4, pc)) return; uint32_t old; memcpy(&old, (const void *)(uintptr_t)ad, 4); uint32_t nw = old + b; memcpy((void *)(uintptr_t)ad, &nw, 4); ws_wrs(l, in->dst_vreg, in->dst_subreg, old, p); break; } case BW_IR_MEMBAR_ALL_SYS: break; + /* DEPFLAGS opcodes (omega_bw_dep.h). GPU scope behaves like SYS scope here: CTAs run one after another, so every + * earlier add is visible; the fences and the L1 invalidate are no-ops (the simulator has no caches). */ + case BW_IR_LDG_STRONG_GPU: { uint64_t ad = ws_rd64(l, in->src1_vreg, p); if (s->poll_hook) s->poll_hook(s, ad, s->poll_ctx); if (!ws_mem_ok(s, ad, 4, pc)) return; uint32_t x; memcpy(&x, (const void *)(uintptr_t)ad, 4); ws_wrs(l, in->dst_vreg, in->dst_subreg, x, p); break; } + case BW_IR_ATOMG_ADD_STRONG_GPU: { uint64_t ad = ws_rd64(l, in->src1_vreg, p); if (!ws_mem_ok(s, ad, 4, pc)) return; uint32_t old; memcpy(&old, (const void *)(uintptr_t)ad, 4); uint32_t nw = old + b; memcpy((void *)(uintptr_t)ad, &nw, 4); ws_wrs(l, in->dst_vreg, in->dst_subreg, old, p); break; } + case BW_IR_MEMBAR_ALL_GPU: case BW_IR_ERRBAR: case BW_IR_CGAERRBAR: case BW_IR_CCTL_IVALL: break; + case BW_IR_CS2R_GLOBALTIMER: ws_wr64(l, in->dst_vreg, s->timer++, p); break; default: ws_fail(s, WS_E_OP, pc, "opcode not modelled"); return; } } From d467128a7822d1f2ded374aa25ee4db4c5cad54a Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Fri, 16 Oct 2026 13:44:54 -0500 Subject: [PATCH 04/10] depflags: the poll never waited (compare always true); sentinel once; reconverge after the poll; sim tests What was wrong (BUG 1 of the WIP): the prologue tested P0 = (1 >= diff) where diff = (done - target) >> 31 is 0 or 1 (SHF.R.U32.HI is a logical shift), so P0 was always true and every kernel left the poll on its first read: with barrier NONE the list would have run unordered while looking like it waited. Two more defects the new tests exposed: on the give-up path all 32 lanes of warp 0 executed the ATOMG, adding the sentinel 32 times (0x12345678 x 32 + 8 = 0x468acf08 observed), and a warp whose lanes left the poll on different iterations reached the epilogue's BSSY split (simulator: BSSY_REARM at pc 50). Fix: compare against a zero register (P0 holds only when diff == 0); only lane 0 adds the sentinel (sent = ((tid - 1) >> 31) * SENTINEL, no extra branch); the poll sits in its own BSSY/BSYNC region B0 so the warp reconverges before BAR.SYNC, as nvcc structures every data-dependent loop. The constants and the protocol description move to omega_gpu_dep.h (shared with the command list and the tests); OMEGA_DEP_TEST_NO_PROLOGUE / _NO_EPILOGUE make the prologue or epilogue emit nothing (negative tests). Proof (tests/gpu_cmdlist_test.c --sim, a host mirror of the list protocol on the warp simulator): RED on the WIP compare: "late producer: 256 lane reads, fired 0, x DIFFERS" and the timeout check failed, 4 of 63 (investigations/2026-10-16-DEPFLAGS/runs/p1-red-bug1-late-producer.log). GREEN after: 63 checks, 0 failed (p1-green-bug1-late-producer.log): three-launch chain bit-identical with counter 24; late producer waits (1279 lane reads) and reads the late a[]; NO_PROLOGUE: 0 reads, stale a[] (caught); NO_EPILOGUE: counter 0 of 8 (caught); timeout: 2^18 polls then sentinel + 8 = 0x12345680, kernel completes; camera: 8 {t0, t1} records with t1 > t0. --host-only 36 checks: every glue kernel builds at dep 1 and 3 inside the register budget; argument words end before 0x3e8. Co-Authored-By: Claude Fable 5.1 --- src/omega_bw_dep.h | 47 +++++++------- src/omega_gpu_dep.h | 43 +++++++++++-- tests/gpu_cmdlist_test.c | 133 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 192 insertions(+), 31 deletions(-) diff --git a/src/omega_bw_dep.h b/src/omega_bw_dep.h index 47d6fe06f..f53809ccf 100644 --- a/src/omega_bw_dep.h +++ b/src/omega_bw_dep.h @@ -1,32 +1,24 @@ /* omega_bw_dep.h: dependency flags between the launches of one command list (DEPFLAGS, 2026-10-16), the kernel side. + * The protocol (one shared done counter per command list, bank words, host check) is described in omega_gpu_dep.h. * * Why: the decode graph serialised its ~436 dependent launches per token with WAIT_FOR_IDLE + INVALIDATE_SHADER_CACHES, * and the launch-cost study (evidence/OWN30B-L2D-BARRIER-20261014) measured 20-28 us per dependent launch for that drain * and refill against ~4 us without a barrier. With flags the list runs with barrier NONE and every kernel orders itself: - * prologue warp 0 polls the previous launch's done counter (LDG.E.STRONG.GPU) until counter - target < 2^31 (wrap-safe), - * then BAR.SYNC and CCTL.IVALL (nvcc's lowering of ld.acquire.gpu, probe in investigations/2026-10-16-DEPFLAGS/sass); - * a poll that never succeeds (DEP_POLL_LIMIT iterations) adds DEP_TIMEOUT_SENTINEL to this launch's own counter + * prologue warp 0 polls the shared done counter (LDG.E.STRONG.GPU) until done - target < 2^31 (wrap-safe), then + * BAR.SYNC and CCTL.IVALL (nvcc's lowering of ld.acquire.gpu, probe in investigations/2026-10-16-DEPFLAGS/sass); + * a poll that never succeeds (OMEGA_DEP_POLL_LIMIT iterations) adds OMEGA_DEP_TIMEOUT_SENTINEL once (lane 0) to the counter * and continues, so the host sees the wrong count and nothing hangs the chip. * epilogue before every EXIT: MEMBAR.ALL.GPU; ERRBAR; CGAERRBAR (nvcc's lowering of fence + red.release.gpu), BAR.SYNC, * thread 0 ATOMG.E.ADD.STRONG.GPU done, 1 (the CUDA Programming Guide reduction sample: a device-scope fence * before the count increment, and a device-scope acquire load of the flag on the other side). - * camera (dep bit 1) CS2R SR_GLOBALTIMERLO at entry and before EXIT; thread 0 stores {t0, t1} (16 B) at + * camera (OMEGA_DEP_CAMERA) CS2R SR_GLOBALTIMERLO at entry and before EXIT; thread 0 stores {t0, t1} (16 B) at * cam_base + 16 * (slot & (OMEGA_DEP_CAM_SLOTS - 1)), slot from an atomic add on the counter line's word 1. - * Constant bank words (every kernel kind; the cmdlist writes them): OMEGA_DEP_ARG_WAIT u64 va of the counter to wait on, - * OMEGA_DEP_ARG_DONE u64 va of this launch's counter line, OMEGA_DEP_ARG_TARGET u32. Counter line (64 B, GPU-cached, only the - * GPU writes it after the host's one-time init): +0 u32 done, +4 u32 camera slot allocator, +8 u64 camera base (0 = off). - * Header-only, included by a generator AFTER its Em / emit / I0 / V / V64 / here / patch_bra definitions (all five share them). */ + * Every data buffer the kernels touch is GPU-uncached (omega_gpu_session.h), so only L1 can hold a stale line and + * CCTL.IVALL drops it. Header-only, included by a generator AFTER its Em / emit / I0 / V / V64 / here / patch_bra + * definitions and its K_ enum (all six generators share them). */ #ifndef OMEGA_BW_DEP_H #define OMEGA_BW_DEP_H -#define OMEGA_DEP_ARG_WAIT 0x3e8u -#define OMEGA_DEP_ARG_DONE 0x3f0u -#define OMEGA_DEP_ARG_TARGET 0x3f8u -#define OMEGA_DEP_FLAGS 1u -#define OMEGA_DEP_CAMERA 2u -#define OMEGA_DEP_LINE_BYTES 64u -#define OMEGA_DEP_CAM_SLOTS 4096u /* records per launch (16 B each): CTAs beyond that wrap onto the first slots */ -#define OMEGA_DEP_POLL_LIMIT (1u << 18) -#define OMEGA_DEP_TIMEOUT_SENTINEL 0x12345678u +#include "omega_gpu_dep.h" /* the constants and the protocol description */ typedef struct { int pdone, t0; uint32_t dep; } OmegaBwDep; @@ -56,23 +48,26 @@ static void dep_loop_extend(Em *e, int start, int end) { * its first global load. dep 0: emits nothing. */ static void dep_prologue(Em *e, uint32_t dep, int udesc, int tid, OmegaBwDep *D) { memset(D, 0, sizeof *D); D->dep = dep; D->pdone = -1; D->t0 = -1; - if (!dep) return; + if (!(dep & (OMEGA_DEP_FLAGS | OMEGA_DEP_CAMERA))) return; D->pdone = V64(e); if (dep & OMEGA_DEP_CAMERA) { D->t0 = V64(e); if (e->err) return; dep_insn(e, BW_IR_CS2R_GLOBALTIMER, D->t0, -1, -1, -1, K_VAR); } dep_ldc64(e, D->pdone, OMEGA_DEP_ARG_DONE); - if (!(dep & OMEGA_DEP_FLAGS)) return; - int pwait = V64(e), target = V(e), v = V(e), diff = V(e), cnt = V(e), one = V(e), lim = V(e), sent = V(e), scratch = V(e), warp = V(e); + if (!(dep & OMEGA_DEP_FLAGS) || (dep & OMEGA_DEP_TEST_NO_PROLOGUE)) return; /* TEST bit: no wait (the sim test must catch the early read) */ + int pwait = V64(e), target = V(e), v = V(e), diff = V(e), cnt = V(e), one = V(e), zero = V(e), lim = V(e), sent = V(e), scratch = V(e), warp = V(e); if (e->err) return; dep_shr(e, warp, tid, 5); dep_ldc64(e, pwait, OMEGA_DEP_ARG_WAIT); dep_ldc32(e, target, OMEGA_DEP_ARG_TARGET); - dep_movi(e, one, 1); dep_movi(e, lim, OMEGA_DEP_POLL_LIMIT); dep_movi(e, cnt, 0); - dep_isetp_ge(e, warp, one); /* P0: warp >= 1 -> straight to the barrier (warp 0 polls) */ + dep_movi(e, one, 1); dep_movi(e, zero, 0); dep_movi(e, lim, OMEGA_DEP_POLL_LIMIT); dep_movi(e, cnt, 0); + /* Reconvergence region B0 around the poll (nvcc wraps every data-dependent loop so): lanes may leave the loop on different + * iterations (the sim test makes the producer land mid-warp), and a split warp must not reach the epilogue BSSY. */ + const int at_bssy = here(e); { BlackwellIRInsn bs = I0(BW_IR_BSSY); bs.bar_reg = 0; bs.imm = 2; emit(e, bs, K_BSSY); } + dep_isetp_ge(e, warp, one); /* P0: warp >= 1 -> straight to the join (warp 0 polls) */ const int to_join = dep_bra_p0_fwd(e); const int L = here(e); dep_insn(e, BW_IR_LDG_STRONG_GPU, v, pwait, -1, udesc, K_VAR); dep_imadi(e, diff, target, 0xffffffffu, v); /* v - target */ dep_shr(e, diff, diff, 31); /* 0 when 0 <= v - target < 2^31 (wrap-safe) */ - dep_isetp_ge(e, one, diff); /* P0: satisfied */ + dep_isetp_ge(e, zero, diff); /* P0: satisfied, i.e. diff == 0. (The WIP compared one >= diff, true for diff in {0, 1}: never waited.) */ const int to_done = dep_bra_p0_fwd(e); dep_imadi(e, cnt, one, 1u, cnt); dep_isetp_ge(e, cnt, lim); /* P0: timed out */ @@ -80,10 +75,12 @@ static void dep_prologue(Em *e, uint32_t dep, int udesc, int tid, OmegaBwDep *D) dep_bra_to(e, L); dep_loop_extend(e, L, here(e) - 1); const int at_timeout = here(e); - dep_movi(e, sent, OMEGA_DEP_TIMEOUT_SENTINEL); + /* only lane 0 adds the sentinel (a warp-wide ATOMG adds once per active lane): sent = ((tid - 1) >> 31) * SENTINEL, tid < 32 here */ + dep_imadi(e, sent, one, 0xffffffffu, tid); dep_shr(e, sent, sent, 31); dep_imadi(e, sent, sent, OMEGA_DEP_TIMEOUT_SENTINEL, -1); dep_insn(e, BW_IR_ATOMG_ADD_STRONG_GPU, scratch, D->pdone, sent, udesc, K_VAR); /* names this launch to the host; no hang */ const int at_join = here(e); patch_bra(e, to_join, at_join); patch_bra(e, to_done, at_join); patch_bra(e, to_timeout, at_timeout); + { BlackwellIRInsn bsy = I0(BW_IR_BSYNC); bsy.bar_reg = 0; emit(e, bsy, K_BSYNC); } patch_bra(e, at_bssy, at_join + 1); /* BSYNC at at_join */ dep_bar(e); emit(e, I0(BW_IR_CCTL_IVALL), K_FIXED); /* acquire: no stale L1 line of a buffer the previous launch rewrote */ } @@ -101,7 +98,7 @@ static void dep_epilogue(Em *e, int udesc, int tid, OmegaBwDep *D) { dep_isetp_ge(e, tid, one); /* P0: not thread 0 -> skip */ const int at_bssy = here(e); { BlackwellIRInsn i = I0(BW_IR_BSSY); i.bar_reg = 0; i.imm = 2; emit(e, i, K_BSSY); } const int skip = dep_bra_p0_fwd(e); - if (D->dep & OMEGA_DEP_FLAGS) dep_insn(e, BW_IR_ATOMG_ADD_STRONG_GPU, scratch, D->pdone, one, udesc, K_VAR); + if ((D->dep & OMEGA_DEP_FLAGS) && !(D->dep & OMEGA_DEP_TEST_NO_EPILOGUE)) dep_insn(e, BW_IR_ATOMG_ADD_STRONG_GPU, scratch, D->pdone, one, udesc, K_VAR); /* TEST bit: never reports */ if (D->dep & OMEGA_DEP_CAMERA) { int t1 = V64(e), pslot = V64(e), slot = V(e), cam = V64(e), rec = V64(e); if (e->err) return; diff --git a/src/omega_gpu_dep.h b/src/omega_gpu_dep.h index 739973428..63dbef618 100644 --- a/src/omega_gpu_dep.h +++ b/src/omega_gpu_dep.h @@ -1,16 +1,47 @@ #ifndef OMEGA_GPU_DEP_H #define OMEGA_GPU_DEP_H -/* omega_gpu_dep: the process-wide dependency-flag mode for the decode kernels (DEPFLAGS, 2026-10-16). - * 0 = none (the WAIT_FOR_IDLE barrier orders the launches, the default), 1 = flags (OMEGA_DEP_FLAGS), 2 = camera only, - * 3 = flags + camera. Setter, else env AIEN_OMEGA_DEP read once. Every kernel API folds it into its spec (kernel cache key), - * the decode graph passes it to the command list (opts.dep). Changing it after kernels were built rebuilds them on the - * next call (different spec); the caller clears caches it pinned. */ +/* omega_gpu_dep: dependency flags between the launches of one command list (DEPFLAGS, 2026-10-16), the host-visible part. + * + * Mode (process-wide, omega_gpu_dep_mode): 0 = none (the WAIT_FOR_IDLE barrier orders the launches, the default), + * 1 = flags (OMEGA_DEP_FLAGS), 2 = camera only, 3 = flags + camera. Setter, else env AIEN_OMEGA_DEP read once. The decode + * graph passes it to its command list (omega_gpu_cmdlist_set_dep); every kernel API folds the list's value into its spec + * (kernel cache key), so a direct launch (no list) always builds dep 0 kernels. Changing the mode after kernels were built + * rebuilds them on the next call (different spec); the caller clears caches it pinned. + * + * Protocol (one shared counter per command list, omega_gpu_cmdlist.c writes the bank words, omega_bw_dep.h the kernel): + * counter line 64 B, GPU-uncached (omega_gpu_session_alloc): +0 u32 done (every CTA of every launch adds 1 before it + * exits), +4 u32 camera slot allocator, +8 u64 camera base (0 = off). The host zeroes +0 and +4 before + * every submit, so targets are plain CTA counts. + * bank words OMEGA_DEP_ARG_WAIT u64 = line va, OMEGA_DEP_ARG_DONE u64 = line va (the same line; two words so a + * per-launch-line layout stays possible), OMEGA_DEP_ARG_TARGET u32 = S_(i-1) = CTAs of launches 0..i-1. + * kernel warp 0 polls until done - target < 2^31 (wrap-safe), BAR.SYNC, CCTL.IVALL; at exit MEMBAR.ALL.GPU, + * BAR.SYNC, thread 0 adds 1. Why that orders the list: the first moment done reaches S_i, no CTA of a launch + * j > i has passed its poll (it needs done >= S_(j-1) >= S_i), so all S_i adds came from launches 0..i, which + * have therefore all finished. A launch marked independent waits for S_(i-2) instead; the launch after it + * keeps S_i, which still counts both. A poll that never succeeds (OMEGA_DEP_POLL_LIMIT reads) adds + * OMEGA_DEP_TIMEOUT_SENTINEL and continues, so nothing hangs the chip and the host sees the wrong count. + * host check after the completion marker: done == sum of all CTAs, else an error naming the stage. */ #include #ifdef __cplusplus extern "C" { #endif + +#define OMEGA_DEP_FLAGS 1u /* kernels order themselves with the counter (barrier NONE in the list) */ +#define OMEGA_DEP_CAMERA 2u /* every CTA's thread 0 records {GLOBALTIMER at entry, at exit} */ +#define OMEGA_DEP_TEST_NO_PROLOGUE 4u /* TEST ONLY: emit no wait (a kernel that reads too early; the sim test must catch it) */ +#define OMEGA_DEP_TEST_NO_EPILOGUE 8u /* TEST ONLY: emit no add (a kernel that never reports; the host count must catch it) */ +#define OMEGA_DEP_ARG_WAIT 0x3e8u /* u64 va of the counter to wait on */ +#define OMEGA_DEP_ARG_DONE 0x3f0u /* u64 va of the counter this launch adds to */ +#define OMEGA_DEP_ARG_TARGET 0x3f8u /* u32 */ +#define OMEGA_DEP_ARGS_FIRST 0x3e8u /* kernel arguments must end here: at most (0x3e8 - 0x380) / 4 = 26 words in dep mode */ +#define OMEGA_DEP_MAX_KERNEL_ARGS 26u +#define OMEGA_DEP_LINE_BYTES 64u +#define OMEGA_DEP_CAM_SLOTS 4096u /* records per launch (16 B each): CTAs beyond that wrap onto the first slots */ +#define OMEGA_DEP_POLL_LIMIT (1u << 18) +#define OMEGA_DEP_TIMEOUT_SENTINEL 0x12345678u + uint32_t omega_gpu_dep_mode(void); -void omega_gpu_dep_set_mode(uint32_t mode); +void omega_gpu_dep_set_mode(uint32_t mode); /* masked to OMEGA_DEP_FLAGS | OMEGA_DEP_CAMERA */ #ifdef __cplusplus } #endif diff --git a/tests/gpu_cmdlist_test.c b/tests/gpu_cmdlist_test.c index 53d89f4af..1a1164c10 100644 --- a/tests/gpu_cmdlist_test.c +++ b/tests/gpu_cmdlist_test.c @@ -15,6 +15,7 @@ #include "omega_gpu_cmdlist.h" #include "omega_blackwell_codegen_dec.h" #include "omega_gpu_session.h" +#include "omega_gpu_dep.h" #include "bw_warp_sim_k.h" #include #include @@ -137,6 +138,18 @@ static int host_only(void) { CHECK(gprs <= 200, "%s gprs %u within budget", cases[i].name, gprs); printf("codegen %s: %u insns, peak %u gprs, declared %u\n", cases[i].name, insns, gprs, omega_bw_gpr_declared(gprs)); } + /* DEPFLAGS: every glue kernel also builds with the flags (dep 1) and flags + camera (dep 3) inside the register budget, + * and the kernels' argument words end before the dependency words the command list writes */ + for (unsigned i = 0; i < sizeof cases / sizeof cases[0]; i++) for (uint32_t dep = 1; dep <= 3; dep += 2) { + OmegaDecSpec d = cases[i].s; d.dep = dep; + uint32_t insns = 0, gprs = 0; + int rc = omega_dec_prog_stats(&d, &insns, &gprs); + CHECK(rc == 0 && gprs <= 200, "codegen %s dep %u: rc %d, %u insns, peak %u gprs", cases[i].name, dep, rc, insns, gprs); + if (dep == 1) printf("codegen %s dep 1: %u insns, peak %u gprs\n", cases[i].name, insns, gprs); + } + CHECK(OMEGA_DEC_AXPY_WORDS <= OMEGA_DEP_MAX_KERNEL_ARGS && OMEGA_DEC_RES_WORDS <= OMEGA_DEP_MAX_KERNEL_ARGS && OMEGA_DEC_SW_WORDS <= OMEGA_DEP_MAX_KERNEL_ARGS && OMEGA_DEC_AM_WORDS <= OMEGA_DEP_MAX_KERNEL_ARGS, + "glue kernel arguments end before the dependency words (%u words max)", OMEGA_DEP_MAX_KERNEL_ARGS); + CHECK(0x380u + 4u * OMEGA_DEP_MAX_KERNEL_ARGS == OMEGA_DEP_ARG_WAIT && OMEGA_DEP_ARG_TARGET + 4u <= 0x380u + 4u * OMEGA_GPU_SESSION_MAX_ARGS, "dependency words sit inside the 1 KB bank after the argument window"); OmegaDecSpec bad[] = { { OMEGA_DEC_AXPY, 0, 0, 0, 0 }, { OMEGA_DEC_AXPY, 0, 100, 0, 0 }, { OMEGA_DEC_RES, 0, 0, 0, 0 }, { OMEGA_DEC_RES, OMEGA_DEC_RES_ADD | OMEGA_DEC_RES_COMBINE, 0, 0, 0 }, { (OmegaDecKind)0, 0, 0, 0, 0 }, { OMEGA_DEC_RES, 8, 0, 0, 0 } }; for (unsigned i = 0; i < sizeof bad / sizeof bad[0]; i++) CHECK(omega_dec_prog_stats(&bad[i], NULL, NULL) != 0, "refusal %u", i); @@ -154,6 +167,7 @@ static int sim_one(Kern *k, const uint32_t *args, unsigned n_args, uint32_t gx, CHECK(err == 0, "sim %s: %s (pc %d)", what, s.msg, s.err_pc); return err; } +static int sim_dep(void); static int sim_mode(void) { if (specs_build()) { printf("FAIL: codegen\n"); return 1; } /* AXPY chain: 3 launches x += a over 2048 */ @@ -213,6 +227,125 @@ static int sim_mode(void) { else if (tie) CHECK(oi2[0] != g.am_ref, "sim argmax mutant caught (max at a j == 7 slot)"); printf("sim argmax tie %d mutant %d: index %u value %g (ref %u)\n", tie, mut, oi2[0], ov2[0], g.am_ref); } + if (sim_dep()) return 1; + return g_failed ? 1 : 0; +} + +/* ---- DEPFLAGS (2026-10-16): the kernel side of the dependency flags on the simulator, through a host mirror of the + * command list's protocol (omega_gpu_dep.h): one counter line shared by every launch, bank words OMEGA_DEP_ARG_WAIT / + * _DONE = its address, OMEGA_DEP_ARG_TARGET = the CTAs that must have finished before this launch may read. The + * simulator's poll hook plays the late producer. Negative tests: NO_PROLOGUE (reads too early), NO_EPILOGUE (never + * reports), an unreachable target (times out, sentinel, no hang), and the chain itself. ---- */ +static Kern K_axpy_dep, K_axpy_dep_nopro, K_axpy_dep_noepi, K_axpy_cam; +typedef struct { uint32_t *line; uint64_t polls, fire_at; float *a; unsigned n; float late; uint32_t bump; int fired; } DepPlay; +static void dep_hook(struct WsSim *s, uint64_t addr, void *ctx) { + DepPlay *p = ctx; (void)s; + if (addr != (uint64_t)(uintptr_t)p->line) return; + p->polls++; + if (p->fire_at && p->polls == p->fire_at) { for (unsigned i = 0; i < p->n; i++) p->a[i] = p->late; p->line[0] += p->bump; p->fired = 1; } +} +#define DEP_ARGS 32u /* bank words 0x380..0x3fc: the kernel's arguments, then the three dependency words at 0x3e8.. */ +static void dep_words(uint32_t *args, const uint32_t *line, uint32_t target) { + put64(args, OMEGA_DEP_ARG_WAIT, (uintptr_t)line); put64(args, OMEGA_DEP_ARG_DONE, (uintptr_t)line); args[(OMEGA_DEP_ARG_TARGET - 0x380) / 4] = target; +} +static int sim_dep_run(Kern *k, const uint32_t *args, uint32_t gx, WsRange *ranges, int nr, DepPlay *play, const char *what, double *secs) { + static uint8_t smem[OMEGA_DEC_SHARED_BYTES]; + WsSim s; memset(&s, 0, sizeof s); + s.p = &k->prog; s.threads = OMEGA_DEC_THREADS; s.smem = smem; s.smem_bytes = sizeof smem; + memcpy(&s.cbank[0x380 / 4], args, DEP_ARGS * 4u); + s.nranges = nr; for (int i = 0; i < nr; i++) s.ranges[i] = ranges[i]; + if (play) { s.poll_hook = dep_hook; s.poll_ctx = play; } + struct timespec t0, t1; clock_gettime(CLOCK_MONOTONIC, &t0); + int err = ws_run(&s, gx, 1); + clock_gettime(CLOCK_MONOTONIC, &t1); + if (secs) *secs = (double)(t1.tv_sec - t0.tv_sec) + (double)(t1.tv_nsec - t0.tv_nsec) / 1e9; + CHECK(err == 0, "sim %s: %s (pc %d)", what, s.msg, s.err_pc); + return err; +} +static int sim_dep(void) { + OmegaDecSpec s; + memset(&s, 0, sizeof s); s.kind = OMEGA_DEC_AXPY; s.stride = AXPY_STRIDE; + s.dep = OMEGA_DEP_FLAGS; if (kern_prog(&K_axpy_dep, &s)) { CHECK(0, "codegen axpy dep 1"); return 1; } + s.dep = OMEGA_DEP_FLAGS | OMEGA_DEP_TEST_NO_PROLOGUE; if (kern_prog(&K_axpy_dep_nopro, &s)) { CHECK(0, "codegen axpy dep 1 no-prologue"); return 1; } + s.dep = OMEGA_DEP_FLAGS | OMEGA_DEP_TEST_NO_EPILOGUE; if (kern_prog(&K_axpy_dep_noepi, &s)) { CHECK(0, "codegen axpy dep 1 no-epilogue"); return 1; } + s.dep = OMEGA_DEP_FLAGS | OMEGA_DEP_CAMERA; if (kern_prog(&K_axpy_cam, &s)) { CHECK(0, "codegen axpy dep 3"); return 1; } + const uint32_t CTAS = AXPY_STRIDE / OMEGA_DEC_THREADS; /* 8 */ + static float x[AXPY_STRIDE], a[AXPY_STRIDE], xr[AXPY_STRIDE]; + static uint32_t line[16] __attribute__((aligned(64))); + static uint64_t cam[2 * (OMEGA_DEP_CAM_SLOTS + 1)] __attribute__((aligned(16))); + WsRange r[4] = { { (uintptr_t)x, (uintptr_t)x + sizeof x }, { (uintptr_t)a, (uintptr_t)a + sizeof a }, { (uintptr_t)line, (uintptr_t)line + sizeof line }, { (uintptr_t)cam, (uintptr_t)cam + sizeof cam } }; + uint32_t args[DEP_ARGS]; +#define AXPY_ARGS() do { memset(args, 0, sizeof args); put64(args, OMEGA_DEC_AXPY_X, (uintptr_t)x); put64(args, OMEGA_DEC_AXPY_A, (uintptr_t)a); args[(OMEGA_DEC_AXPY_ITERS - 0x380) / 4] = 1; } while (0) + /* 1. three-launch chain, every target already satisfied when the launch runs (the host mirror: target_i = CTAS * i) */ + { + uint32_t seed = 11; for (unsigned i = 0; i < AXPY_STRIDE; i++) { x[i] = frand(&seed, -1, 1); a[i] = frand(&seed, -1, 1); xr[i] = x[i]; } + memset(line, 0, sizeof line); + for (uint32_t l = 0; l < 3; l++) { + AXPY_ARGS(); dep_words(args, line, CTAS * l); + DepPlay p; memset(&p, 0, sizeof p); p.line = line; + if (sim_dep_run(&K_axpy_dep, args, CTAS, r, 3, &p, "axpy dep chain", NULL)) return 1; + for (unsigned i = 0; i < AXPY_STRIDE; i++) xr[i] = xr[i] + a[i]; + CHECK(line[0] == CTAS * (l + 1), "dep chain launch %u: counter %u (want %u)", l, line[0], CTAS * (l + 1)); + CHECK(p.polls == (uint64_t)CTAS * 32u, "dep chain launch %u: satisfied target read once per CTA by warp 0 (%" PRIu64 " lane reads, want %u)", l, p.polls, CTAS * 32u); + } + CHECK(memcmp(x, xr, sizeof x) == 0, "dep chain: x bit-identical to the host chain"); + printf("dep chain: 3 launches x %u CTAs, counter %u, x %s\n", CTAS, line[0], memcmp(x, xr, sizeof x) == 0 ? "identical" : "DIFFERS"); + } + /* 2. late producer: the counter is below the target when the launch starts; after fire_at lane reads the "previous + * launch" rewrites a[] and finishes (counter += CTAS). A kernel that waits sees the late a[]; one that does not + * (OMEGA_DEP_TEST_NO_PROLOGUE, or a broken poll compare) computes with the old a[] and is caught by parity. */ + for (int variant = 0; variant < 2; variant++) { + uint32_t seed = 23; for (unsigned i = 0; i < AXPY_STRIDE; i++) { x[i] = frand(&seed, -1, 1); a[i] = 1.0f; xr[i] = x[i] + 2.0f; } + memset(line, 0, sizeof line); + AXPY_ARGS(); dep_words(args, line, CTAS); /* target CTAS: one earlier launch of CTAS CTAs has not finished yet */ + DepPlay p; memset(&p, 0, sizeof p); p.line = line; p.fire_at = 1024; p.a = a; p.n = AXPY_STRIDE; p.late = 2.0f; p.bump = CTAS; /* 1024 = whole warps: the bump lands between iterations */ + if (sim_dep_run(variant ? &K_axpy_dep_nopro : &K_axpy_dep, args, CTAS, r, 3, &p, variant ? "late producer no-prologue" : "late producer", NULL)) return 1; + const int parity = memcmp(x, xr, sizeof x) == 0; + if (!variant) { + CHECK(parity && p.fired && p.polls >= 1024, "late producer: the kernel waited (%" PRIu64 " lane reads, fired %d) and read the late a[]: x %s", p.polls, p.fired, parity ? "identical" : "DIFFERS"); + CHECK(line[0] == 2 * CTAS, "late producer: counter %u = producer %u + this launch %u", line[0], CTAS, CTAS); + } else { + CHECK(!parity && !p.fired && p.polls == 0, "late producer NO_PROLOGUE: no wait (%" PRIu64 " reads), stale a[] used: x %s (caught)", p.polls, parity ? "identical: NOT CAUGHT" : "differs"); + } + printf("late producer%s: %" PRIu64 " lane reads, fired %d, counter %u, x %s\n", variant ? " NO_PROLOGUE" : "", p.polls, p.fired, line[0], parity ? "identical" : "DIFFERS"); + } + /* 3. NO_EPILOGUE: the counter stays short by this launch's CTAs; the host's count check is what catches it */ + { + uint32_t seed = 31; for (unsigned i = 0; i < AXPY_STRIDE; i++) { x[i] = frand(&seed, -1, 1); a[i] = frand(&seed, -1, 1); xr[i] = x[i] + a[i]; } + memset(line, 0, sizeof line); + AXPY_ARGS(); dep_words(args, line, 0); + if (sim_dep_run(&K_axpy_dep_noepi, args, CTAS, r, 3, NULL, "no-epilogue", NULL)) return 1; + CHECK(memcmp(x, xr, sizeof x) == 0 && line[0] == 0 && line[0] != CTAS, "NO_EPILOGUE: x right but counter %u (host expects %u): caught by the count check", line[0], CTAS); + } + /* 4. timeout: an unreachable target; every CTA gives up after OMEGA_DEP_POLL_LIMIT reads, adds the sentinel, continues */ + { + uint32_t seed = 37; for (unsigned i = 0; i < AXPY_STRIDE; i++) { x[i] = frand(&seed, -1, 1); a[i] = frand(&seed, -1, 1); xr[i] = x[i] + a[i]; } + memset(line, 0, sizeof line); + AXPY_ARGS(); dep_words(args, line, 125u * CTAS); + DepPlay p; memset(&p, 0, sizeof p); p.line = line; + double secs = 0; + if (sim_dep_run(&K_axpy_dep, args, CTAS, r, 3, &p, "timeout", &secs)) return 1; + /* CTAs run one after another here: CTA 0 gives up and adds the sentinel, which satisfies the other 7 at their first read. + * (On the chip the CTAs run together, so between 1 and CTAS sentinels land; the host only needs counter != expected.) */ + const uint32_t want = OMEGA_DEP_TIMEOUT_SENTINEL + CTAS; + CHECK(line[0] == want, "timeout: counter %08x = sentinel + %u CTAs = %08x: the host sees the stage, nothing hangs", line[0], CTAS, want); + CHECK(p.polls == (uint64_t)OMEGA_DEP_POLL_LIMIT * 32u + (uint64_t)(CTAS - 1) * 32u, "timeout: POLL_LIMIT reads by the first CTA, one by each later CTA (%" PRIu64 " lane reads)", p.polls); + CHECK(memcmp(x, xr, sizeof x) == 0, "timeout: the kernel still ran to completion"); + printf("timeout: 2^18 polls by CTA 0 then %u pass-throughs in %.2f s of simulator time, counter %08x\n", CTAS - 1, secs, line[0]); + } + /* 5. camera (dep 3): line + 8 holds the camera base; every CTA's thread 0 stores {t0, t1} at the slot it allocates at line + 4 */ + { + uint32_t seed = 41; for (unsigned i = 0; i < AXPY_STRIDE; i++) { x[i] = frand(&seed, -1, 1); a[i] = frand(&seed, -1, 1); xr[i] = x[i] + a[i]; } + memset(line, 0, sizeof line); memset(cam, 0, sizeof cam); + uint64_t base = (uintptr_t)cam; memcpy(&line[2], &base, 8); + AXPY_ARGS(); dep_words(args, line, 0); + if (sim_dep_run(&K_axpy_cam, args, CTAS, r, 4, NULL, "camera", NULL)) return 1; + int ok = 1; for (uint32_t c = 0; c < CTAS; c++) if (!(cam[2 * c + 1] > cam[2 * c])) ok = 0; + CHECK(memcmp(x, xr, sizeof x) == 0 && line[0] == CTAS && line[1] == CTAS, "camera: x right, done %u, slots allocated %u (want %u)", line[0], line[1], CTAS); + CHECK(ok && cam[2 * CTAS] == 0 && cam[2 * CTAS + 1] == 0, "camera: %u records with t1 > t0 and none past the CTA count", CTAS); + printf("camera: %u records, first {%" PRIu64 ", %" PRIu64 "}, last {%" PRIu64 ", %" PRIu64 "} (simulator ticks)\n", CTAS, cam[0], cam[1], cam[2 * CTAS - 2], cam[2 * CTAS - 1]); + } +#undef AXPY_ARGS return g_failed ? 1 : 0; } From 22267e2bd92836e1507a5e0917c41317634d0394 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Fri, 16 Oct 2026 13:52:50 -0500 Subject: [PATCH 05/10] depflags: host side of the counter protocol (the WIP had none): list opt-in, bank words, no barrier, count check What was wrong (BUG 3 of the WIP): the kernels could poll and add, but nothing on the host allocated the counter, wrote its address and the per-launch target into the constant bank, dropped the barrier, or checked the count afterwards: omega_gpu_cmdlist_set_dep did not exist (any caller failed to link), so the design could not run on the chip at all. What this adds (omega_gpu_cmdlist.c): - one 64 B GPU-uncached counter line per list (+0 done, +4 camera slot, +8 camera base), allocated at create; - omega_gpu_cmdlist_set_dep(cl, OMEGA_DEP_FLAGS | OMEGA_DEP_CAMERA) on an empty list only, other bits refused; omega_gpu_cmdlist_dep / _dep_counter accessors; stats dep_expected / dep_observed; - add(): in dep mode refuses more than 26 argument words, writes words 0x3e8 / 0x3f0 (counter va) and 0x3f8 (target = CTAs of launches 0..i-1), keeps the running CTA total; mark_independent lowers the target of the marked launch by the CTAs of the one before it (and no longer double-applies); - submit(): in dep mode refuses INLINE, skip_launch and a list that does not fit one submission; emits NO barrier after the first launch (front-end stamps keep the stamps accessor whole); zeroes the counter and syncs it before the submit; after the completion marker reads it back and fails with the stage named when it differs from the CTA total (above: a poll timed out and added the sentinel; below: a launch did not count itself in). - every kernel API (router, decode attention, bf16 GEMV, fp8 GEMV both variants) sets spec.dep from the list it records into, so a dep-mode list only ever holds dep-mode kernels (the spec is the kernel cache key); the decode graph passes omega_gpu_dep_mode() (env AIEN_OMEGA_DEP, default 0) to its list and its glue kernels. dep 0 is untouched: no bank word, no behaviour change, the barrier orders the launches as before. Proof: builds with -Wall -Wextra -Werror; gpu_cmdlist_test --host-only 36/0, --sim 63/0, gpu_decode_graph_test --host-only 18/0 (investigations/2026-10-16-DEPFLAGS/runs/p1-t3-host.log). The chip is the real test of this commit: Phase 2 of the DEPFLAGS record (RED first: barrier NONE with dep 0 on the heavy dependent chain). Co-Authored-By: Claude Fable 5.1 --- src/omega_gpu_bf16_gemv_api.c | 2 +- src/omega_gpu_cmdlist.c | 84 +++++++++++++++++++++++++++++---- src/omega_gpu_cmdlist.h | 21 ++++++++- src/omega_gpu_decode_attn_api.c | 2 +- src/omega_gpu_decode_graph.c | 9 ++-- src/omega_gpu_fp8_api.c | 2 +- src/omega_gpu_router_api.c | 2 +- 7 files changed, 105 insertions(+), 17 deletions(-) diff --git a/src/omega_gpu_bf16_gemv_api.c b/src/omega_gpu_bf16_gemv_api.c index a0d6b3d5e..be0ec7526 100644 --- a/src/omega_gpu_bf16_gemv_api.c +++ b/src/omega_gpu_bf16_gemv_api.c @@ -196,7 +196,7 @@ static int gemv_core(const OmegaGpuBf16Tensor *t, const float *x32, const uint16 if (rec && (!dev_x || !dev_y)) return OMEGA_GPU_BF16_BAD_ARGS; if (!t || !t->w.cpu || (!rec && ((!x32 && !x16) || !y))) return OMEGA_GPU_BF16_BAD_ARGS; const uint32_t n = t->n, k = t->k; - OmegaBf16GemvSpec spec; uint32_t ctas; spec_for(k, &spec, &ctas); + OmegaBf16GemvSpec spec; uint32_t ctas; spec_for(k, &spec, &ctas); spec.dep = rec ? omega_gpu_cmdlist_dep(rec) : 0; /* dep-mode list: the kernel carries the counter protocol */ if (n % spec.rows) return OMEGA_GPU_BF16_CODEGEN_FAIL; const uint32_t RG = n / spec.rows; uint32_t grid_x = (RG + spec.warps - 1) / spec.warps; diff --git a/src/omega_gpu_cmdlist.c b/src/omega_gpu_cmdlist.c index a403e250f..b5cc85da3 100644 --- a/src/omega_gpu_cmdlist.c +++ b/src/omega_gpu_cmdlist.c @@ -7,6 +7,8 @@ * written by the CPU, WAIT_FOR_IDLE sits between launches, and the PCAS launch method. */ #include "omega_gpu_cmdlist.h" +#include "omega_gpu_dep.h" +#include "omega_gpu_fmt.h" #include "omega_blackwell_codegen.h" #include "omega_blackwell_qmd.h" #include "omega_blackwell_submit.h" @@ -46,18 +48,48 @@ struct OmegaGpuCmdList { uint32_t nop_gpr; uint8_t *indep; /* per launch: 1 = shares no data with the launch before it (mark_independent): no barrier before it */ int stamped; /* the last submit had opts.stamps (the accessor refuses stale stamps from an earlier submit) */ + /* dependency flags (omega_gpu_dep.h): the counter line (+0 done, +4 camera slot allocator, +8 u64 camera base), the camera + * records (OMEGA_DEP_CAM_SLOTS x 16 B, allocated with OMEGA_DEP_CAMERA), per-launch CTA counts, the running CTA total */ + OmegaGpuMem dep_line, dep_cam; + uint32_t dep, dep_sum, dep_observed; + uint32_t *ctas; }; static uint32_t g_latched; int omega_gpu_cmdlist_is_latched(void) { return __atomic_load_n(&g_latched, __ATOMIC_ACQUIRE) ? 1 : 0; } uint32_t omega_gpu_cmdlist_count(const OmegaGpuCmdList *cl) { return cl ? cl->n : 0; } -void omega_gpu_cmdlist_reset(OmegaGpuCmdList *cl) { if (cl) cl->n = 0; } +void omega_gpu_cmdlist_reset(OmegaGpuCmdList *cl) { if (cl) { cl->n = 0; cl->dep_sum = 0; } } +static inline uint32_t *dep_target_word(OmegaGpuCmdList *cl, uint32_t i) { + return (uint32_t *)((uint8_t *)cl->banks.cpu + (size_t)i * OMEGA_GPU_CMDLIST_BANK_BYTES + OMEGA_DEP_ARG_TARGET); +} int omega_gpu_cmdlist_mark_independent(OmegaGpuCmdList *cl) { if (!cl || cl->n == 0) { omega_gpu_session_set_error("cmdlist mark_independent: no launch recorded"); return -1; } + if (cl->indep[cl->n - 1]) return 0; /* already marked: do not lower the target twice */ cl->indep[cl->n - 1] = 1; + /* dep mode: wait for the launches before the previous one only (S_(i-2)); the launch after this one keeps S_i, which counts both */ + if ((cl->dep & OMEGA_DEP_FLAGS) && cl->n >= 2) *dep_target_word(cl, cl->n - 1) -= cl->ctas[cl->n - 2]; + return 0; +} +int omega_gpu_cmdlist_set_dep(OmegaGpuCmdList *cl, uint32_t dep) { + if (!cl || (dep & ~(OMEGA_DEP_FLAGS | OMEGA_DEP_CAMERA))) { omega_gpu_session_set_error("cmdlist set_dep: arguments (FLAGS | CAMERA only)"); return -1; } + if (cl->n) { omega_gpu_session_set_error("cmdlist set_dep: the list is not empty (reset first)"); return -1; } + if ((dep & OMEGA_DEP_CAMERA) && !cl->dep_cam.cpu) { + /* one slot past the ring so the base can be moved up by 16 B when its low word would read as zero (the kernel tests the low word) */ + if (omega_gpu_session_alloc((size_t)(OMEGA_DEP_CAM_SLOTS + 1u) * 16u, &cl->dep_cam) != 0) { omega_gpu_session_set_error("cmdlist set_dep: camera alloc"); return -1; } + memset(cl->dep_cam.cpu, 0, (size_t)(OMEGA_DEP_CAM_SLOTS + 1u) * 16u); + if (omega_gpu_session_sync_to_gpu(&cl->dep_cam) != 0) return -1; + } + uint64_t cam = (dep & OMEGA_DEP_CAMERA) ? cl->dep_cam.va : 0; + if (cam && (uint32_t)cam == 0) cam += 16u; + uint64_t *line = cl->dep_line.cpu; + line[0] = 0; line[1] = cam; + if (omega_gpu_session_sync_to_gpu(&cl->dep_line) != 0) return -1; + cl->dep = dep; cl->dep_sum = 0; cl->dep_observed = 0; return 0; } +uint32_t omega_gpu_cmdlist_dep(const OmegaGpuCmdList *cl) { return cl ? cl->dep : 0; } +uint32_t omega_gpu_cmdlist_dep_counter(const OmegaGpuCmdList *cl) { return cl ? cl->dep_observed : 0; } static int build_nop(OmegaGpuCmdList *cl) { BlackwellIRProgram *prog = omega_gpu_host_calloc(1, sizeof *prog); @@ -88,19 +120,22 @@ int omega_gpu_cmdlist_create(uint32_t cap, OmegaGpuCmdList **out) { cl->words_cap = RING_WORDS; cl->words = omega_gpu_host_alloc((size_t)cl->words_cap * 4u); cl->indep = omega_gpu_host_calloc(cap, 1); - int rc = cl->words && cl->indep ? 0 : -1; + cl->ctas = omega_gpu_host_calloc(cap, sizeof *cl->ctas); + int rc = cl->words && cl->indep && cl->ctas ? 0 : -1; omega_gpu_session_lock(); if (rc == 0 && !omega_gpu_session_open()) rc = -1; if (rc == 0 && (omega_gpu_session_alloc((size_t)cap * OMEGA_GPU_CMDLIST_BANK_BYTES, &cl->banks) != 0 || omega_gpu_session_alloc((size_t)cap * OMEGA_GPU_CMDLIST_QMD_BYTES, &cl->qmds) != 0 || omega_gpu_session_alloc((size_t)cap * 16u, &cl->sems) != 0 || omega_gpu_session_alloc((size_t)(cap + 1u) * 16u, &cl->stamps) != 0 || - omega_gpu_session_alloc(0x4000, &cl->scratch) != 0)) + omega_gpu_session_alloc(0x4000, &cl->scratch) != 0 || + omega_gpu_session_alloc(OMEGA_DEP_LINE_BYTES, &cl->dep_line) != 0)) rc = -1; if (rc == 0 && build_nop(cl) != 0) { omega_gpu_session_set_error("cmdlist create: nop kernel"); rc = -1; } if (rc == 0) { memset(cl->scratch.cpu, 0, 0x4000); - if (omega_gpu_session_sync_to_gpu(&cl->scratch) != 0) rc = -1; + memset(cl->dep_line.cpu, 0, OMEGA_DEP_LINE_BYTES); + if (omega_gpu_session_sync_to_gpu(&cl->scratch) != 0 || omega_gpu_session_sync_to_gpu(&cl->dep_line) != 0) rc = -1; } omega_gpu_session_unlock(); if (rc != 0) { omega_gpu_cmdlist_free(cl); return -1; } @@ -111,11 +146,12 @@ int omega_gpu_cmdlist_create(uint32_t cap, OmegaGpuCmdList **out) { void omega_gpu_cmdlist_free(OmegaGpuCmdList *cl) { if (!cl) return; omega_gpu_session_lock(); - OmegaGpuMem *m[] = { &cl->banks, &cl->qmds, &cl->sems, &cl->stamps, &cl->scratch, &cl->nop_code }; + OmegaGpuMem *m[] = { &cl->banks, &cl->qmds, &cl->sems, &cl->stamps, &cl->scratch, &cl->nop_code, &cl->dep_line, &cl->dep_cam }; for (unsigned i = 0; i < sizeof m / sizeof m[0]; i++) if (m[i]->cpu) omega_gpu_session_free(m[i]); omega_gpu_session_unlock(); omega_gpu_host_free(cl->words); omega_gpu_host_free(cl->indep); + omega_gpu_host_free(cl->ctas); omega_gpu_host_free(cl); } @@ -125,6 +161,8 @@ int omega_gpu_cmdlist_add(OmegaGpuCmdList *cl, const OmegaGpuLaunch *L) { if (!cl || !L || !L->args || L->n_args == 0 || L->n_args > OMEGA_GPU_SESSION_MAX_ARGS || L->threads_x == 0 || L->grid_x == 0 || L->grid_y == 0 || L->code_va == 0) { omega_gpu_session_set_error("cmdlist add: arguments"); return -1; } if (cl->n >= cl->cap) { omega_gpu_session_set_error("cmdlist add: list full"); return -1; } + const int depmode = (cl->dep & OMEGA_DEP_FLAGS) != 0; + if (cl->dep && L->n_args > OMEGA_DEP_MAX_KERNEL_ARGS) { omega_gpu_session_set_error("cmdlist add: more than 26 argument words in dep mode (words 0x3e8.. carry the counter)"); return -1; } const uint32_t i = cl->n; const uint32_t ty = L->threads_y ? L->threads_y : 1; const uint64_t bank_va = cl->banks.va + (uint64_t)i * OMEGA_GPU_CMDLIST_BANK_BYTES; @@ -132,8 +170,15 @@ int omega_gpu_cmdlist_add(OmegaGpuCmdList *cl, const OmegaGpuLaunch *L) { uint32_t drv[OMEGA_BW_CBANK_DRIVER_WORDS]; omega_blackwell_build_cbank_driver_2d(drv, bank_va, L->threads_x, ty, L->grid_x, L->grid_y); memcpy(bank, drv, sizeof drv); - memset(bank + sizeof drv, 0, 0x380 - sizeof drv); + memset(bank + sizeof drv, 0, OMEGA_GPU_CMDLIST_BANK_BYTES - sizeof drv); memcpy(bank + 0x380, L->args, (size_t)L->n_args * 4u); + if (cl->dep) { /* counter address for the wait and the add, target = CTAs of every launch before this one (camera-only lists too: the add stays off) */ + const uint64_t line_va = cl->dep_line.va; + memcpy(bank + OMEGA_DEP_ARG_WAIT, &line_va, 8); memcpy(bank + OMEGA_DEP_ARG_DONE, &line_va, 8); + memcpy(bank + OMEGA_DEP_ARG_TARGET, &cl->dep_sum, 4); + } + cl->ctas[i] = L->grid_x * L->grid_y; + if (depmode) cl->dep_sum += cl->ctas[i]; const uint64_t q1_va = cl->qmds.va + (uint64_t)i * OMEGA_GPU_CMDLIST_QMD_BYTES, q0_va = q1_va + 0x200; const uint64_t sem_va = cl->sems.va + (uint64_t)i * 16u; @@ -243,12 +288,20 @@ int omega_gpu_cmdlist_submit(OmegaGpuCmdList *cl, const OmegaGpuCmdListOpts *opt const uint64_t timeout = o.timeout_ms ? o.timeout_ms : DEFAULT_TIMEOUT_MS; const uint32_t spin = o.spin_us ? o.spin_us : omega_gpu_session_spin_us(); const uint64_t th0 = p->time_now_ns(p->ctx); + const int depmode = (cl->dep & OMEGA_DEP_FLAGS) != 0; + if (depmode && o.mode == OMEGA_GPU_CMDLIST_INLINE) { omega_gpu_session_set_error("cmdlist submit: dep flags need PCAS mode (one submission, no per-launch barrier)"); return -1; } + if (depmode && o.skip_launch) { omega_gpu_session_set_error("cmdlist submit: skip_launch with dep flags would hang the launches after it (the sentinel bounds the wait)"); return -1; } - /* semaphores INIT, markers 0, everything the CPU wrote made visible */ + /* semaphores INIT, markers 0, dep counter and camera slot 0, everything the CPU wrote made visible */ uint32_t *sem = cl->sems.cpu; for (uint32_t i = 0; i < cl->n; i++) sem[4 * i] = OMEGA_BW_SEMAPHORE_INTERMEDIATE_INIT; volatile uint32_t *mk = (volatile uint32_t *)((uint8_t *)marker->cpu + MARKER_OFF); mk[0] = 0; mk[4] = 0; + if (cl->dep) { + uint32_t *line = cl->dep_line.cpu; + line[0] = 0; line[1] = 0; cl->dep_observed = 0; + if (p->sync_cpu_to_gpu(p->ctx, cl->dep_line.handle, 0, OMEGA_DEP_LINE_BYTES) != OMEGA_GPU_PLAT_OK) { omega_gpu_session_set_error("cmdlist submit: sync dep line"); return -1; } + } if (p->sync_cpu_to_gpu(p->ctx, cl->banks.handle, 0, (uint64_t)cl->n * OMEGA_GPU_CMDLIST_BANK_BYTES) != OMEGA_GPU_PLAT_OK || p->sync_cpu_to_gpu(p->ctx, cl->qmds.handle, 0, (uint64_t)cl->n * OMEGA_GPU_CMDLIST_QMD_BYTES) != OMEGA_GPU_PLAT_OK || p->sync_cpu_to_gpu(p->ctx, cl->sems.handle, 0, (uint64_t)cl->n * 16u) != OMEGA_GPU_PLAT_OK || @@ -271,6 +324,7 @@ int omega_gpu_cmdlist_submit(OmegaGpuCmdList *cl, const OmegaGpuCmdListOpts *opt } } const uint32_t room = (avail - prefix) / per_launch; + if (depmode && room < cl->n) { omega_gpu_session_set_error("cmdlist submit: dep flags need the whole list in one submission (ring too small for this many launches)"); return -1; } uint64_t elapsed = 0, host = p->time_now_ns(p->ctx) - th0; uint32_t done = 0, submits = 0, words = 0; while (done < cl->n) { @@ -282,7 +336,8 @@ int omega_gpu_cmdlist_submit(OmegaGpuCmdList *cl, const OmegaGpuCmdListOpts *opt for (uint32_t i = done; i < end; i++) { if (o.skip_launch && i == (uint32_t)(o.skip_launch - 1)) continue; /* the first launch of a submission always gets the full barrier (CPU-written QMDs, code and banks before it) */ - const int indep = i != done && cl->indep[i]; /* marked independent: no barrier, overlaps the launch before it */ + /* marked independent, or dep flags (the kernels order themselves): no barrier, the grid may overlap the launch before it */ + const int indep = i != done && (cl->indep[i] || depmode); const OmegaGpuCmdListBarrier b = i == done ? OMEGA_GPU_CMDLIST_BARRIER_WFI : indep ? OMEGA_GPU_CMDLIST_BARRIER_NONE : o.barrier; if (indep && o.stamps) n = emit_stamp(pb, n, cl->stamps.va, i); /* no WFI: slot i is the front-end time, launch i - 1 may still run */ if (b != OMEGA_GPU_CMDLIST_BARRIER_NONE) { @@ -341,6 +396,19 @@ int omega_gpu_cmdlist_submit(OmegaGpuCmdList *cl, const OmegaGpuCmdListOpts *opt } if (st) { st->launches = cl->n; st->submits = submits; st->words = words; st->elapsed_ns = elapsed; st->host_ns = host; st->sems_done = ok; st->first_missing = missing; } if (missing >= 0) { omega_gpu_session_set_error("cmdlist: a launch semaphore is not DONE (launch did not run)"); return -1; } + if (cl->dep) { + (void)p->sync_gpu_to_cpu(p->ctx, cl->dep_line.handle, 0, OMEGA_DEP_LINE_BYTES); + if (cl->dep_cam.cpu) (void)p->sync_gpu_to_cpu(p->ctx, cl->dep_cam.handle, 0, (uint64_t)(OMEGA_DEP_CAM_SLOTS + 1u) * 16u); + cl->dep_observed = ((const uint32_t *)cl->dep_line.cpu)[0]; + if (st) { st->dep_expected = cl->dep_sum; st->dep_observed = cl->dep_observed; } + if (depmode && cl->dep_observed != cl->dep_sum) { + char e[160]; + omega_gpu_fmt(e, sizeof e, "cmdlist: dep counter %u after completion, expected %u CTAs%s", cl->dep_observed, cl->dep_sum, + cl->dep_observed > cl->dep_sum ? " (a launch's poll timed out: sentinel added)" : " (a launch did not count itself in)"); + omega_gpu_session_set_error(e); + return -1; + } + } return 0; } diff --git a/src/omega_gpu_cmdlist.h b/src/omega_gpu_cmdlist.h index aaebf037e..5deb360df 100644 --- a/src/omega_gpu_cmdlist.h +++ b/src/omega_gpu_cmdlist.h @@ -21,6 +21,14 @@ * here is preceded by WAIT_FOR_IDLE and the session's INVALIDATE_SHADER_CACHES_ALL (instruction, data, constant). * OMEGA_GPU_CMDLIST_BARRIER_NONE exists only as the negative control of the chip test. * + * Dependency flags (DEPFLAGS, 2026-10-16, opt-in, omega_gpu_dep.h): omega_gpu_cmdlist_set_dep(cl, OMEGA_DEP_FLAGS) on an + * empty list makes submit emit NO barrier between launches; instead every launch's kernel (built with spec.dep = the list's + * value, see omega_bw_dep.h) polls one shared counter until every CTA of every launch before it has added 1, and adds 1 per + * CTA at exit. add() writes the counter address and the launch's target (CTAs of launches 0..i-1) into bank words + * 0x3e8..0x3fb, so a dep-mode launch may carry at most 26 argument words. The host zeroes the counter before the submit and + * checks it against the CTA total after the completion marker (stats dep_expected / dep_observed). dep 0 (the default) + * changes nothing: the barrier orders the launches exactly as before. + * * Launch methods (opts.mode): * PCAS QMD in memory, SEND_PCAS_A (qmd >> 8) + SEND_SIGNALING_PCAS2_B INVALIDATE_COPY_SCHEDULE (clcec0.h 0x02b4 / * 0x02c0; the NVK dispatch sequence, nvk_cmd_dispatch.c), no dependent QMD: 8 words per launch, a whole @@ -76,6 +84,8 @@ typedef struct { uint64_t host_ns; /* building the method stream (CPU) */ uint32_t sems_done; /* launch semaphores found DONE */ int32_t first_missing; /* index of the first launch whose semaphore was not DONE, -1 if none */ + uint32_t dep_expected; /* dep mode: CTAs over all launches (what the counter must read after completion); 0 in dep 0 */ + uint32_t dep_observed; /* dep mode: the counter read back after completion */ } OmegaGpuCmdListStats; typedef struct OmegaGpuCmdList OmegaGpuCmdList; @@ -91,9 +101,16 @@ uint32_t omega_gpu_cmdlist_count(const OmegaGpuCmdList *cl); * prefetch beside the latency-bound attention). The launch after it gets the normal barrier, which waits for both. * Ignored for the first launch of a submission. 0 ok, -1 (no launch recorded). */ int omega_gpu_cmdlist_mark_independent(OmegaGpuCmdList *cl); +/* Caller holds the lock. Dependency flags for every launch recorded from now on (omega_gpu_dep.h: OMEGA_DEP_FLAGS, | OMEGA_DEP_CAMERA; + * 0 = the barrier, today's behaviour). Only on an empty list (reset first); other bits refused. Kernels recorded into a dep-mode + * list must be built with spec.dep == omega_gpu_cmdlist_dep(cl) (every kernel API does so when given the list). 0 ok, -1. */ +int omega_gpu_cmdlist_set_dep(OmegaGpuCmdList *cl, uint32_t dep); +uint32_t omega_gpu_cmdlist_dep(const OmegaGpuCmdList *cl); +/* After a submit in dep mode: the counter read back (== CTAs of all launches when every launch counted itself in). */ +uint32_t omega_gpu_cmdlist_dep_counter(const OmegaGpuCmdList *cl); /* Caller holds the lock. Writes the launch's bank and QMD into the next slot. The launch's code must stay resident - * until submit returns. Returns the launch index, or -1 (full, bad arguments, QMD refused). L->timeout_ms and - * L->spin_us are ignored (the list has one completion). */ + * until submit returns. Returns the launch index, or -1 (full, bad arguments, QMD refused, more than 26 argument words in + * dep mode). L->timeout_ms and L->spin_us are ignored (the list has one completion). */ int omega_gpu_cmdlist_add(OmegaGpuCmdList *cl, const OmegaGpuLaunch *L); /* Caller holds the lock, device open, not latched. Submits every recorded launch in order, waits for the completion, * checks every launch semaphore. 0 ok; -1 with the stage named (omega_gpu_session_last_error). */ diff --git a/src/omega_gpu_decode_attn_api.c b/src/omega_gpu_decode_attn_api.c index e69f65ad1..03c327ba1 100644 --- a/src/omega_gpu_decode_attn_api.c +++ b/src/omega_gpu_decode_attn_api.c @@ -186,7 +186,7 @@ static int dattn_core(OmegaGpuDecodeAttnCache *c, uint32_t layer, uint32_t pos, const uint32_t splits = (pos + per) / per; /* ceil((pos + 1) / per) */ if (splits > c->max_splits) return OMEGA_GPU_DATTN_TOO_LARGE; OmegaDecodeAttnSpec spec; memset(&spec, 0, sizeof spec); - spec.depth = g.depth ? g.depth : OMEGA_GPU_DATTN_DEPTH; spec.mutant = g.mutant; + spec.depth = g.depth ? g.depth : OMEGA_GPU_DATTN_DEPTH; spec.mutant = g.mutant; spec.dep = rec ? omega_gpu_cmdlist_dep(rec) : 0; /* dep-mode list: the kernel carries the counter protocol */ if (!rec) omega_gpu_session_lock(); #define UNLOCK() do { if (!rec) omega_gpu_session_unlock(); } while (0) diff --git a/src/omega_gpu_decode_graph.c b/src/omega_gpu_decode_graph.c index 5a07c7bb6..9097e3ee4 100644 --- a/src/omega_gpu_decode_graph.c +++ b/src/omega_gpu_decode_graph.c @@ -5,6 +5,7 @@ */ #include "omega_gpu_decode_graph.h" #include "omega_gpu_cmdlist.h" +#include "omega_gpu_dep.h" #include "omega_blackwell_codegen_dec.h" #include "omega_gpu_session.h" #include "omega_gpu_fmt.h" @@ -61,8 +62,8 @@ static int fail(OmegaGpuDecodeGraph *g, const char *what, int rc) { } /* lock held */ -static int kern_build(Kern *k, OmegaDecKind kind, uint32_t mode, int mutant) { - OmegaDecSpec s; memset(&s, 0, sizeof s); s.kind = kind; s.mode = mode; s.mutant = mutant; +static int kern_build(Kern *k, OmegaDecKind kind, uint32_t mode, int mutant, uint32_t dep) { + OmegaDecSpec s; memset(&s, 0, sizeof s); s.kind = kind; s.mode = mode; s.mutant = mutant; s.dep = dep; BlackwellIRProgram *prog = omega_gpu_host_calloc(1, sizeof *prog); if (!prog) return OMEGA_GPU_DGRAPH_CODEGEN_FAIL; int rc = OMEGA_GPU_DGRAPH_OK; @@ -116,6 +117,8 @@ int omega_gpu_decode_graph_create(const OmegaGpuDecodeGraphConfig *cfg, OmegaGpu if (omega_gpu_cmdlist_create(OMEGA_GPU_CMDLIST_MAX_LAUNCHES, &g->cl) != 0) { omega_gpu_decode_graph_free(g); return OMEGA_GPU_DGRAPH_CHIP_FAIL; } omega_gpu_session_lock(); if (!omega_gpu_session_open() || omega_gpu_session_alloc(L->bytes, &g->buf) != 0) rc = OMEGA_GPU_DGRAPH_CHIP_FAIL; + /* DEPFLAGS (opt-in, AIEN_OMEGA_DEP / omega_gpu_dep_set_mode): the list and every kernel recorded into it carry the counter protocol; 0 = the barrier */ + if (rc == OMEGA_GPU_DGRAPH_OK && omega_gpu_cmdlist_set_dep(g->cl, omega_gpu_dep_mode()) != 0) rc = OMEGA_GPU_DGRAPH_CHIP_FAIL; static const struct { OmegaDecKind kind; uint32_t mode; int mutant; } spec[K_COUNT] = { [K_NORM] = { OMEGA_DEC_RES, OMEGA_DEC_RES_NORM, 0 }, [K_ADD] = { OMEGA_DEC_RES, OMEGA_DEC_RES_ADD, 0 }, @@ -126,7 +129,7 @@ int omega_gpu_decode_graph_create(const OmegaGpuDecodeGraphConfig *cfg, OmegaGpu [K_SW_M1] = { OMEGA_DEC_SWIGLU, 0, 1 }, [K_CN_M2] = { OMEGA_DEC_RES, OMEGA_DEC_RES_COMBINE | OMEGA_DEC_RES_NORM, 2 }, }; - for (unsigned i = 0; i < K_COUNT && rc == OMEGA_GPU_DGRAPH_OK; i++) rc = kern_build(&g->k[i], spec[i].kind, spec[i].mode, spec[i].mutant); + for (unsigned i = 0; i < K_COUNT && rc == OMEGA_GPU_DGRAPH_OK; i++) rc = kern_build(&g->k[i], spec[i].kind, spec[i].mode, spec[i].mutant, omega_gpu_cmdlist_dep(g->cl)); if (rc == OMEGA_GPU_DGRAPH_OK) { memset(g->buf.cpu, 0, L->bytes); float *lg = cpu_of(g, L->logits), *amv = cpu_of(g, L->am_v); diff --git a/src/omega_gpu_fp8_api.c b/src/omega_gpu_fp8_api.c index 199dab47a..ae9b5bfd4 100644 --- a/src/omega_gpu_fp8_api.c +++ b/src/omega_gpu_fp8_api.c @@ -303,7 +303,7 @@ static int gemv_core(const OmegaGpuFp8Tensor *t, uint32_t groups, const uint32_t if (groups > OMEGA_GPU_FP8_MAX_GROUPS) return OMEGA_GPU_FP8_TOO_LARGE; if (!dev_tab) for (uint32_t gi = 0; gi < groups; gi++) if (ids[gi] >= t->experts) return OMEGA_GPU_FP8_BAD_ARGS; const uint32_t n = t->n, k = t->k; - OmegaFp8GemvSpec spec; spec_for(k, n, groups, &spec); + OmegaFp8GemvSpec spec; spec_for(k, n, groups, &spec); spec.dep = rec ? omega_gpu_cmdlist_dep(rec) : 0; /* dep-mode list: the kernel carries the counter protocol */ if (n % spec.rows) return OMEGA_GPU_FP8_CODEGEN_FAIL; const uint32_t RG = n / spec.rows; uint32_t grid_x = (RG + spec.warps - 1) / spec.warps; diff --git a/src/omega_gpu_router_api.c b/src/omega_gpu_router_api.c index b786e10d4..21ca674e1 100644 --- a/src/omega_gpu_router_api.c +++ b/src/omega_gpu_router_api.c @@ -188,7 +188,7 @@ static int router_core(OmegaGpuRouter *r, uint32_t layer, const float *x, float if (info) memset(info, 0, sizeof *info); if (!r || layer >= r->layers || (rec ? !dev_x : (!x || !ids || !weights))) return OMEGA_GPU_ROUTER_BAD_ARGS; OmegaRouterSpec spec; memset(&spec, 0, sizeof spec); - spec.warps = g.warps ? g.warps : OMEGA_GPU_ROUTER_WARPS; spec.depth = g.depth ? g.depth : OMEGA_GPU_ROUTER_DEPTH; spec.mutant = g.mutant; + spec.warps = g.warps ? g.warps : OMEGA_GPU_ROUTER_WARPS; spec.depth = g.depth ? g.depth : OMEGA_GPU_ROUTER_DEPTH; spec.mutant = g.mutant; spec.dep = rec ? omega_gpu_cmdlist_dep(rec) : 0; /* dep-mode list: the kernel carries the counter protocol */ if (!rec) omega_gpu_session_lock(); #define UNLOCK() do { if (!rec) omega_gpu_session_unlock(); } while (0) From 8aac5ddb902b493c63fbc0e8aac65b15abada0b3 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Fri, 16 Oct 2026 14:00:46 -0500 Subject: [PATCH 06/10] depflags: dep-mode budget rows and one simulated parity point per kernel API; IR cap 1024 -> 1280 Every production kernel is now built at dep 1 and dep 3 inside its test's register and instruction budget, and one point per API runs the dep-mode kernel on the warp simulator with the counter line armed the way the command list arms it (bank words 0x3e8 / 0x3f0 / 0x3f8, ws_dep_arm in both simulator headers): the answer must match the oracle bit for bit and the counter must read exactly the CTA count afterwards. What the rows found: the depth-4 decode attention kernel (1012 IR instructions at dep 0) grew past the 1024 instruction cap with the prologue and epilogue (1059 at dep 1, 1090 at dep 3), so dep mode would have been refused for the decode graph's default attention depth. The cap is a host-side array bound only (programs are heap-allocated, code is sized by need, nothing on the chip is tied to it): raised to 1280. Proof (investigations/2026-10-16-DEPFLAGS/runs/p1-t4-suites-2.log, p1-t4-dattn-3.log): cmdlist 36/0 + 63/0; router 72/0 + 11/0 ("sim depth 8 norm dep 1: ok"); bf16 188/0 + 12/0 ("dep 1: ok ... bit-identical"); decode attention 44/0 + 13/0 ("depth 2 dep 1: ok bad=0"); fp8 1487/0 host + 74/0 sim (dep 1 variant 1 on a single and a grouped point, variant 2 "dep 1 rc=0 identical_to_v1=1" on two points); decode graph host 18/0. Before the cap change the two attention rows failed (p1-t4-suites.log: "codegen depth 4 dep 1: rc -1"). Co-Authored-By: Claude Fable 5.1 --- src/omega_blackwell_codegen.h | 3 ++- tests/bw_warp_sim.h | 20 ++++++++++++++++++++ tests/bw_warp_sim_k.h | 13 +++++++++++++ tests/gpu_bf16_gemv_test.c | 20 +++++++++++++++++++- tests/gpu_decode_attn_test.c | 18 +++++++++++++++++- tests/gpu_fp8_api_test.c | 25 +++++++++++++++++++++++++ tests/gpu_router_test.c | 20 +++++++++++++++++++- 7 files changed, 115 insertions(+), 4 deletions(-) diff --git a/src/omega_blackwell_codegen.h b/src/omega_blackwell_codegen.h index 1f46add86..cacaa527b 100644 --- a/src/omega_blackwell_codegen.h +++ b/src/omega_blackwell_codegen.h @@ -6,7 +6,8 @@ #include #include "omega_blackwell_matmul.h" -#define BW_MAX_IR_INSNS 1024 /* cut K: the four-head hd 128 attention kernel is ~700 instructions */ +#define BW_MAX_IR_INSNS 1280 /* cut K: the four-head hd 128 attention kernel is ~700 instructions; DEPFLAGS (2026-10-16): the depth-4 decode attention + kernel (1012) plus the counter prologue and epilogue passes 1024. Programs are heap-allocated and code is sized by need. */ #define BW_MAX_VREGS 256 #define BW_MAX_UVREGS 32 #define BW_PHYS_GPR_START 2 /* Reserve R0, R1 */ diff --git a/tests/bw_warp_sim.h b/tests/bw_warp_sim.h index 3e98e8545..e0810e4ae 100644 --- a/tests/bw_warp_sim.h +++ b/tests/bw_warp_sim.h @@ -39,6 +39,7 @@ #define BW_WARP_SIM_H #include "omega_blackwell_codegen.h" +#include "omega_gpu_dep.h" #include #include #include @@ -92,8 +93,21 @@ typedef struct { uint64_t splits; /* branches that split a fragment */ uint64_t bar_split_arrivals; /* BAR.SYNC reached by a fragment that is not the whole live warp */ int max_frags, peak_bars; + uint64_t timer; /* DEPFLAGS camera: the value CS2R SR_GLOBALTIMERLO returns, +1 per read */ } WsSim; +/* DEPFLAGS: arm a pre-satisfied counter line for a dep-mode kernel the way omega_gpu_cmdlist_add does for the first launch of a + * list: bank words 0x3e8 / 0x3f0 = the line, 0x3f8 = target 0 (nothing to wait for), the line declared in the range table. + * After ws_run the test checks line[0] == CTAs of the grid (every CTA's thread 0 added 1 at exit). Same helper as bw_warp_sim_k.h. */ +static inline void ws_dep_arm(WsSim *s, uint32_t *line16) { + memset(line16, 0, 64); + const uint64_t va = (uintptr_t)line16; + s->cbank[OMEGA_DEP_ARG_WAIT / 4] = (uint32_t)va; s->cbank[OMEGA_DEP_ARG_WAIT / 4 + 1] = (uint32_t)(va >> 32); + s->cbank[OMEGA_DEP_ARG_DONE / 4] = (uint32_t)va; s->cbank[OMEGA_DEP_ARG_DONE / 4 + 1] = (uint32_t)(va >> 32); + s->cbank[OMEGA_DEP_ARG_TARGET / 4] = 0; + if (s->nranges < WS_MAX_RANGES) { s->ranges[s->nranges].lo = (uintptr_t)va; s->ranges[s->nranges].hi = (uintptr_t)va + 64; s->nranges++; } +} + static void ws_fail(WsSim *s, int err, int pc, const char *what) { if (s->err) return; s->err = err; s->err_pc = pc; @@ -163,6 +177,12 @@ static void ws_lane_exec(WsSim *s, WsLane *l, const BlackwellIRInsn *in, int pc, case BW_IR_MUFU_EX2: ws_wrs(l, in->dst_vreg, in->dst_subreg, ws_f2u(exp2f(ws_u2f(a))), p); break; case BW_IR_MUFU_RCP: ws_wrs(l, in->dst_vreg, in->dst_subreg, ws_f2u(1.0f / ws_u2f(a)), p); break; case BW_IR_MUFU_RSQ: ws_wrs(l, in->dst_vreg, in->dst_subreg, ws_f2u(1.0f / sqrtf(ws_u2f(a))), p); break; + /* DEPFLAGS opcodes (omega_bw_dep.h), as bw_warp_sim_k.h: GPU scope behaves like SYS scope here (CTAs run one after another, + * every earlier add is visible); the fences and the L1 invalidate are no-ops (the simulator has no caches). */ + case BW_IR_LDG_STRONG_GPU: { uint64_t ad = ws_rd64(l, in->src1_vreg, p); if (!ws_mem_ok(s, ad, 4, pc)) return; uint32_t x; memcpy(&x, (const void *)(uintptr_t)ad, 4); ws_wrs(l, in->dst_vreg, in->dst_subreg, x, p); break; } + case BW_IR_ATOMG_ADD_STRONG_GPU: { uint64_t ad = ws_rd64(l, in->src1_vreg, p); if (!ws_mem_ok(s, ad, 4, pc)) return; uint32_t old; memcpy(&old, (const void *)(uintptr_t)ad, 4); uint32_t nw = old + b; memcpy((void *)(uintptr_t)ad, &nw, 4); ws_wrs(l, in->dst_vreg, in->dst_subreg, old, p); break; } + case BW_IR_MEMBAR_ALL_GPU: case BW_IR_ERRBAR: case BW_IR_CGAERRBAR: case BW_IR_CCTL_IVALL: break; + case BW_IR_CS2R_GLOBALTIMER: ws_wr64(l, in->dst_vreg, s->timer++, p); break; default: ws_fail(s, WS_E_OP, pc, "opcode not modelled"); return; } } diff --git a/tests/bw_warp_sim_k.h b/tests/bw_warp_sim_k.h index 6713a8eee..ce1f045c3 100644 --- a/tests/bw_warp_sim_k.h +++ b/tests/bw_warp_sim_k.h @@ -42,6 +42,7 @@ * The simulator runs CTAs one after another, so an atomic counter sees every earlier CTA's add. */ #include "omega_blackwell_codegen.h" +#include "omega_gpu_dep.h" #include #include #include @@ -103,6 +104,18 @@ typedef struct WsSim { uint64_t timer; } WsSim; +/* DEPFLAGS: arm a pre-satisfied counter line for a dep-mode kernel the way omega_gpu_cmdlist_add does for the first launch of a + * list: bank words 0x3e8 / 0x3f0 = the line, 0x3f8 = target 0 (nothing to wait for), the line declared in the range table. + * After ws_run the test checks line[0] == CTAs of the grid (every CTA's thread 0 added 1 at exit). */ +static inline void ws_dep_arm(WsSim *s, uint32_t *line16) { + memset(line16, 0, 64); + const uint64_t va = (uintptr_t)line16; + s->cbank[OMEGA_DEP_ARG_WAIT / 4] = (uint32_t)va; s->cbank[OMEGA_DEP_ARG_WAIT / 4 + 1] = (uint32_t)(va >> 32); + s->cbank[OMEGA_DEP_ARG_DONE / 4] = (uint32_t)va; s->cbank[OMEGA_DEP_ARG_DONE / 4 + 1] = (uint32_t)(va >> 32); + s->cbank[OMEGA_DEP_ARG_TARGET / 4] = 0; + if (s->nranges < WS_MAX_RANGES) { s->ranges[s->nranges].lo = (uintptr_t)va; s->ranges[s->nranges].hi = (uintptr_t)va + 64; s->nranges++; } +} + static void ws_fail(WsSim *s, int err, int pc, const char *what) { if (s->err) return; s->err = err; s->err_pc = pc; diff --git a/tests/gpu_bf16_gemv_test.c b/tests/gpu_bf16_gemv_test.c index 4f242d906..0a23ff813 100644 --- a/tests/gpu_bf16_gemv_test.c +++ b/tests/gpu_bf16_gemv_test.c @@ -87,6 +87,13 @@ static void host_only(void) { CHECK(rc == 0 && n <= 1024, "codegen k2048 rows %u warps %u depth %u mutant %d: rc %d insns %u gprs %u", rs[j], ws[i], d, m, rc, n, g); if (m == 0 && rc == 0 && rs[j] == 1 && d == 8) printf("codegen rows %u warps %2u depth %u: %u instructions, %u registers (declared %u, register file %u of 65536)%s\n", rs[j], ws[i], d, n, g, decl, 32u * ws[i] * decl, 32u * ws[i] * decl <= 65536u ? "" : " DOES NOT FIT"); } + for (uint32_t dep = 1; dep <= 3; dep += 2) { /* DEPFLAGS: the lm_head shape with the counter prologue/epilogue (and the camera) stays within budget */ + OmegaBf16GemvSpec s = { 2048, 1, 8, 8, 0, dep }; uint32_t n = 0, g = 0; + int rc = omega_bf16_gemv_prog_stats(&s, &n, &g); + uint32_t decl = ((g + 1 + 7) / 8) * 8; + CHECK(rc == 0 && n <= 1024 && 32u * 8u * decl <= 65536u, "codegen k2048 rows 1 warps 8 depth 8 dep %u: rc %d insns %u gprs %u declared %u", dep, rc, n, g, decl); + } + CHECK(OMEGA_BF16_ARGS_WORDS <= OMEGA_DEP_MAX_KERNEL_ARGS, "argument words end before the dep words (0x3e8)"); { OmegaBf16GemvSpec s = { 2048, 3, 8, 8, 0, 0 }; CHECK(omega_bf16_gemv_prog_stats(&s, NULL, NULL) != 0, "rows 3 refused"); } { OmegaBf16GemvSpec s = { 2000, 1, 8, 8, 0, 0 }; CHECK(omega_bf16_gemv_prog_stats(&s, NULL, NULL) != 0, "k 2000 refused"); } { OmegaBf16GemvSpec s = { 2048, 1, 8, 3, 0, 0 }; CHECK(omega_bf16_gemv_prog_stats(&s, NULL, NULL) != 0, "depth 3 refused"); } @@ -100,9 +107,10 @@ static void host_only(void) { /* ------------------------------------------------------------- simulator */ static uint64_t g_sim_issues; +static uint32_t g_sim_dep; /* DEPFLAGS: spec.dep for the next sim point (0, or OMEGA_DEP_FLAGS: counter armed by ws_dep_arm) */ static int sim_point(uint32_t k, uint32_t n, uint32_t rows, uint32_t warps, uint32_t depth, uint32_t grid_x, int mutant, uint32_t seed, char *msg, size_t msgn, size_t *bad) { static BlackwellIRProgram prog; - OmegaBf16GemvSpec spec = { k, rows, warps, depth, mutant, 0 }; + OmegaBf16GemvSpec spec = { k, rows, warps, depth, mutant, g_sim_dep }; if (omega_blackwell_codegen_bf16_gemv_prog(&spec, &prog) != 0) { snprintf(msg, msgn, "codegen refused"); return -1; } uint16_t *w = aligned_alloc(16, (size_t)n * k * 2); { uint16_t *t = make_w((size_t)n * k, seed); memcpy(w, t, (size_t)n * k * 2); free(t); } float *x = aligned_alloc(16, (size_t)k * 4); { float *t = make_x(k, seed + 1); memcpy(x, t, (size_t)k * 4); free(t); } @@ -120,8 +128,10 @@ static int sim_point(uint32_t k, uint32_t n, uint32_t rows, uint32_t warps, uint s.ranges[0].lo = (uintptr_t)w; s.ranges[0].hi = (uintptr_t)w + (size_t)n * k * 2; s.ranges[1].lo = (uintptr_t)x; s.ranges[1].hi = (uintptr_t)x + (size_t)k * 4; s.ranges[2].lo = (uintptr_t)y; s.ranges[2].hi = (uintptr_t)y + (size_t)n * 4; + static uint32_t depline[16]; if (g_sim_dep) ws_dep_arm(&s, depline); err = ws_run(&s, grid_x, 1); if (err) { snprintf(msg, msgn, "order %d: %s (pc %d)", order, s.msg, s.err_pc); break; } + if (g_sim_dep && depline[0] != grid_x) { err = -1; snprintf(msg, msgn, "dep counter %u after %u CTAs", depline[0], grid_x); break; } g_sim_issues += s.warp_issues; size_t unwritten = 0; for (uint32_t i = 0; i < n; i++) if (y[i] == -999.0f) unwritten++; if (unwritten) { err = -1; snprintf(msg, msgn, "%zu output words never written", unwritten); break; } @@ -144,6 +154,14 @@ static void sim_battery(void) { CHECK(!err && bad == 0, "sim k %u n %u rows %u warps %u depth %u grid %u: %s", pts[i].k, pts[i].n, pts[i].rows, pts[i].warps, pts[i].depth, pts[i].grid, msg); printf("sim k %u n %u rows %u warps %u depth %u grid %u: %s %s\n", pts[i].k, pts[i].n, pts[i].rows, pts[i].warps, pts[i].depth, pts[i].grid, err ? "ERROR" : bad ? "MISMATCH" : "ok", msg); } + { /* DEPFLAGS: the dep-mode kernel computes the same rows and every CTA counts itself in */ + char msg[300]; size_t bad = 1; + g_sim_dep = OMEGA_DEP_FLAGS; + int err = sim_point(2048, 64, 1, 8, 4, 2, 0, 31, msg, sizeof msg, &bad); + g_sim_dep = 0; + CHECK(!err && bad == 0, "sim k 2048 n 64 grid 2 with dep flags: %s", msg); + printf("sim k 2048 n 64 grid 2 dep 1: %s %s\n", err ? "ERROR" : bad ? "MISMATCH" : "ok", msg); + } for (int m = 1; m <= 3; m++) { char msg[300]; size_t bad = 0; int err = sim_point(2048, 64, 1, 8, 4, 2, m, 77, msg, sizeof msg, &bad); diff --git a/tests/gpu_decode_attn_test.c b/tests/gpu_decode_attn_test.c index 7c6f5fede..2a0256d1a 100644 --- a/tests/gpu_decode_attn_test.c +++ b/tests/gpu_decode_attn_test.c @@ -197,6 +197,12 @@ static void host_only(void) { CHECK(rc == 0 && n <= 1024 && gp <= 128, "codegen depth %u mutant %d: rc %d insns %u gprs %u", d, m, rc, n, gp); if (rc == 0 && m == 0) printf("codegen depth %u: %u instructions, %u registers (declared %u, 256 threads -> %u of 65536)\n", d, n, gp, ((gp + 8) / 8) * 8, 256 * ((gp + 8) / 8) * 8); } + for (uint32_t dep = 1; dep <= 3; dep += 2) { /* DEPFLAGS: the production depth with the counter prologue/epilogue (and the camera) stays within budget */ + OmegaDecodeAttnSpec s = { OMEGA_GPU_DATTN_DEPTH, 0, dep }; uint32_t n = 0, gp = 0; + int rc = omega_decode_attn_prog_stats(&s, &n, &gp); + CHECK(rc == 0 && n <= BW_MAX_IR_INSNS && gp <= 128, "codegen depth %u dep %u: rc %d insns %u gprs %u (IR cap %u)", OMEGA_GPU_DATTN_DEPTH, dep, rc, n, gp, BW_MAX_IR_INSNS); + } + CHECK(OMEGA_DATTN_ARGS_WORDS <= OMEGA_DEP_MAX_KERNEL_ARGS, "argument words end before the dep words (0x3e8)"); { OmegaDecodeAttnSpec s = { 0, 0, 0 }; CHECK(omega_decode_attn_prog_stats(&s, NULL, NULL) != 0, "depth 0 refused"); s.depth = 5; CHECK(omega_decode_attn_prog_stats(&s, NULL, NULL) != 0, "depth 5 refused"); s.depth = 1; s.mutant = 5; CHECK(omega_decode_attn_prog_stats(&s, NULL, NULL) != 0, "mutant 5 refused"); } @@ -208,9 +214,10 @@ static void host_only(void) { /* ------------------------------------------------------------- simulator */ static uint64_t g_sim_issues; +static uint32_t g_sim_dep; /* DEPFLAGS: spec.dep for the next sim point (0, or OMEGA_DEP_FLAGS: counter armed by ws_dep_arm) */ static int sim_point(uint32_t max_pos, uint32_t pos, uint32_t depth, int mutant, uint32_t per_split, float qscale, uint32_t seed, char *msg, size_t n, double *worst, size_t *bad, char *rows, size_t rn) { static BlackwellIRProgram prog; - OmegaDecodeAttnSpec spec = { depth, mutant, 0 }; + OmegaDecodeAttnSpec spec = { depth, mutant, g_sim_dep }; if (omega_blackwell_codegen_decode_attn_prog(&spec, &prog) != 0) { snprintf(msg, n, "codegen refused"); return -1; } Case c; case_make(&c, max_pos, pos, seed, qscale); const uint32_t splits = (pos + per_split) / per_split; @@ -243,8 +250,10 @@ static int sim_point(uint32_t max_pos, uint32_t pos, uint32_t depth, int mutant, s.ranges[4].lo = (uintptr_t)out; s.ranges[4].hi = (uintptr_t)out + 4096 * 4; s.ranges[5].lo = (uintptr_t)part; s.ranges[5].hi = (uintptr_t)part + (size_t)4 * splits * OMEGA_DATTN_PARTIAL_WORDS * 4; s.ranges[6].lo = (uintptr_t)cnt; s.ranges[6].hi = (uintptr_t)cnt + 16; + static uint32_t depline[16]; if (g_sim_dep) ws_dep_arm(&s, depline); err = ws_run(&s, splits, 4); if (err) { snprintf(msg, n, "order %d: %s (pc %d)", order, s.msg, s.err_pc); break; } + if (g_sim_dep && depline[0] != splits * 4u) { err = -1; snprintf(msg, n, "dep counter %u after %u CTAs", depline[0], splits * 4u); break; } g_sim_issues += s.warp_issues; size_t unwritten = 0; for (unsigned i = 0; i < 4096; i++) if (out[i] == -999.0f) unwritten++; if (unwritten) { err = -1; snprintf(msg, n, "%zu output words never written", unwritten); break; } @@ -282,6 +291,13 @@ static void sim_battery(void) { CHECK(err == 0 && bad == 0, "sim %s depth %u: %s", pts[i].name, pts[i].depth, msg); printf("sim %-50s depth %u: %s %s\n", pts[i].name, pts[i].depth, err ? "ERROR" : bad ? "MISMATCH" : "ok", msg); } + { /* DEPFLAGS: the dep-mode kernel (2 splits x 4 groups = 8 CTAs) computes the same output and every CTA counts itself in */ + g_sim_dep = OMEGA_DEP_FLAGS; + int err = sim_point(512, 300, 2, 0, 256, 1.0f, 100, msg, sizeof msg, &worst, &bad, rows, sizeof rows); + g_sim_dep = 0; + CHECK(err == 0 && bad == 0, "sim context 301 depth 2 with dep flags: %s", msg); + printf("sim context 301 (2 splits) depth 2 dep 1: %s %s\n", err ? "ERROR" : bad ? "MISMATCH" : "ok", msg); + } for (int m = 1; m <= 4; m++) { int err = sim_point(512, 300, 2, m, 256, 1.0f, 200, msg, sizeof msg, &worst, &bad, rows, sizeof rows); int caught = err != 0 || bad > 0; diff --git a/tests/gpu_fp8_api_test.c b/tests/gpu_fp8_api_test.c index bec0db1b9..3b643bf6c 100644 --- a/tests/gpu_fp8_api_test.c +++ b/tests/gpu_fp8_api_test.c @@ -170,6 +170,15 @@ static void host_only(void) { } printf("codegen: %d kernels built, largest %u IR instructions, peak %u GPRs\n", built, worst_insns, worst_gprs); CHECK(worst_insns <= BW_MAX_IR_INSNS && worst_gprs <= 128, "budgets"); + for (uint32_t dep = 1; dep <= 3; dep += 2) { /* DEPFLAGS: the decode shapes with the counter prologue/epilogue (and the camera) stay within budget */ + OmegaFp8GemvSpec sp = { .k = 2048, .lane_bytes = 16, .rows = 1, .warps = 8, .dep = dep }; uint32_t ni = 0, ng = 0; + int rc = omega_fp8_gemv_prog_stats(&sp, &ni, &ng); + CHECK(rc == 0 && ni <= BW_MAX_IR_INSNS && ng <= 128, "codegen k=2048 lb=16 rows=1 warps=8 dep=%u: rc %d insns %u gprs %u", dep, rc, ni, ng); + OmegaFp8GemvSpec gs = { .k = 768, .lane_bytes = 8, .rows = 1, .warps = 32, .dep = dep }; /* the down width: k % 512 != 0, so 8 B lanes */ + rc = omega_fp8_gemv_prog_stats(&gs, &ni, &ng); + CHECK(rc == 0 && ni <= BW_MAX_IR_INSNS && 32u * 32u * (((ng + 1 + 7) / 8) * 8) <= 65536u, "codegen grouped k=768 lb=8 rows=1 warps=32 dep=%u: rc %d insns %u gprs %u", dep, rc, ni, ng); + } + CHECK(OMEGA_FP8_ARGS_WORDS <= OMEGA_DEP_MAX_KERNEL_ARGS, "argument words end before the dep words (0x3e8)"); { OmegaFp8GemvSpec bad = { .k = 192, .lane_bytes = 8, .rows = 1, .warps = 1 }; CHECK(omega_fp8_gemv_prog_stats(&bad, NULL, NULL) != 0, "k not a multiple of 128 refused"); bad.k = 256; bad.lane_bytes = 4; CHECK(omega_fp8_gemv_prog_stats(&bad, NULL, NULL) != 0, "lane_bytes 4 refused (LDG.E has no immediate offset)"); bad.lane_bytes = 8; bad.k = 2048; bad.rows = 3; CHECK(omega_fp8_gemv_prog_stats(&bad, NULL, NULL) != 0, "rows 3 refused"); @@ -279,8 +288,10 @@ static int sim_gemv(const OmegaFp8GemvSpec *spec, const Weights *W, uint32_t gro /* the table is read too */ s.nranges = 5; s.ranges[4].lo = (uintptr_t)tab; s.ranges[4].hi = (uintptr_t)tab + 16 * (size_t)groups; for (size_t i = 0; i < (size_t)groups * n; i++) yd[i] = -999.0f; + static uint32_t depline[16]; if (spec->dep & OMEGA_DEP_FLAGS) ws_dep_arm(&s, depline); err = ws_run(&s, grid_x, groups); if (err) { snprintf(msg, msglen, "order %d: %s", order, s.msg); break; } + if ((spec->dep & OMEGA_DEP_FLAGS) && depline[0] != grid_x * groups) { err = -1; snprintf(msg, msglen, "dep counter %u after %u CTAs", depline[0], grid_x * groups); break; } g_sim_issues += s.warp_issues; size_t unwritten = 0; for (size_t i = 0; i < (size_t)groups * n; i++) if (yd[i] == -999.0f) unwritten++; if (unwritten) { err = -1; snprintf(msg, msglen, "%zu output words never written", unwritten); break; } @@ -357,6 +368,13 @@ static void sim_battery(uint32_t cta_budget) { if (worst > worst_all) worst_all = worst; CHECK(rc == 0 && bad == 0, "sim %s: rc=%d bad=%zu worst_rel=%.3e %s", nm, rc, bad, worst, msg); printf("sim %-45s rc=%d worst_rel=%.3e bad=%zu (%.0f ms)\n", nm, rc, worst, bad, now_ms() - t0); + if (!deep && (i == 1 || i == 7)) { /* DEPFLAGS: one single and one grouped point with the counter protocol (variant 1; variant 2 below) */ + OmegaFp8GemvSpec ds = sp; ds.dep = OMEGA_DEP_FLAGS; + int rcd = sim_gemv(&ds, &W, p->groups, ids, x, p->x_rows, y, cta_budget, 0, msg, sizeof msg); + size_t badd = 0; double worstd = rcd == 0 ? parity(&W, p->groups, ids, x, p->x_rows, y, &badd) : 1.0; + CHECK(rcd == 0 && badd == 0, "sim %s dep 1: rc=%d bad=%zu worst_rel=%.3e %s", p->name, rcd, badd, worstd, msg); + printf("sim %-38s dep 1 rc=%d worst_rel=%.3e bad=%zu\n", p->name, rcd, worstd, badd); + } /* mutants on the two grouped points and the first two single points: each must be caught */ if (i == 1 || i == 4 || i == 7 || i == 8) { for (int m = 1; m <= 4; m++) { @@ -414,6 +432,13 @@ static void sim_battery(uint32_t cta_budget) { CHECK(rc2 == 0 && bad == 0 && same, "sim %s: rc=%d bad=%zu worst_rel=%.3e identical_to_v1=%d %s", p->name, rc2, bad, worst, same, msg); if (same) identical++; printf("sim %-48s rc=%d worst_rel=%.3e bad=%zu identical_to_v1=%d (%.0f ms)\n", p->name, rc2, worst, bad, same, now_ms() - t0); + if (i == 0 || i == 6) { /* DEPFLAGS: variant 2 with the counter protocol stays bit-identical to variant 1 and every CTA counts itself in */ + OmegaFp8GemvSpec ds = sp; ds.dep = OMEGA_DEP_FLAGS; + int rcd = sim_gemv(&ds, &W, p->groups, ids, x, p->x_rows, y2, cta_budget, 0, msg, sizeof msg); + int samed = rc1 == 0 && rcd == 0 && memcmp(y1, y2, ny * 4) == 0; + CHECK(rcd == 0 && samed, "sim %s dep 1: rc=%d identical_to_v1=%d %s", p->name, rcd, samed, msg); + printf("sim %-48s dep 1 rc=%d identical_to_v1=%d\n", p->name, rcd, samed); + } if (i == 0 || i == 6 || i == 7) { for (int m = 1; m <= 3; m++) { if (m == 3 && p->groups == 1) continue; diff --git a/tests/gpu_router_test.c b/tests/gpu_router_test.c index 627684a39..c6d1d8530 100644 --- a/tests/gpu_router_test.c +++ b/tests/gpu_router_test.c @@ -113,6 +113,13 @@ static void host_only(void) { CHECK(rc == 0 && n <= 1024 && 32u * ws[i] * decl <= 65536u, "codegen warps %u depth %u mutant %d: rc %d insns %u gprs %u declared %u", ws[i], ds[j], m, rc, n, g, decl); if (m == 0 && rc == 0) printf("codegen warps %2u depth %u: %u instructions, %u registers (declared %u, register file %u of 65536)\n", ws[i], ds[j], n, g, decl, 32u * ws[i] * decl); } + for (uint32_t dep = 1; dep <= 3; dep += 2) { /* DEPFLAGS: the production shape with the counter prologue/epilogue (and the camera) stays within budget */ + OmegaRouterSpec s = { OMEGA_GPU_ROUTER_WARPS, OMEGA_GPU_ROUTER_DEPTH, 0, dep }; uint32_t n = 0, g = 0; + int rc = omega_router_prog_stats(&s, &n, &g); + uint32_t decl = ((g + 1 + 7) / 8) * 8; + CHECK(rc == 0 && n <= 1024 && 32u * OMEGA_GPU_ROUTER_WARPS * decl <= 65536u, "codegen production shape dep %u: rc %d insns %u gprs %u declared %u", dep, rc, n, g, decl); + } + CHECK(OMEGA_ROUTER_ARGS_WORDS <= OMEGA_DEP_MAX_KERNEL_ARGS, "argument words end before the dep words (0x3e8)"); { OmegaRouterSpec s = { 4, 8, 0, 0 }; CHECK(omega_router_prog_stats(&s, NULL, NULL) != 0, "warps 4 refused"); } { OmegaRouterSpec s = { 8, 3, 0, 0 }; CHECK(omega_router_prog_stats(&s, NULL, NULL) != 0, "depth 3 refused"); } { OmegaRouterSpec s = { 8, 8, 5, 0 }; CHECK(omega_router_prog_stats(&s, NULL, NULL) != 0, "mutant 5 refused"); } @@ -121,12 +128,13 @@ static void host_only(void) { /* ------------------------------------------------------------- simulator */ static uint64_t g_sim_issues; +static uint32_t g_sim_dep; /* DEPFLAGS: spec.dep for the next sim point (0, or OMEGA_DEP_FLAGS: counter armed by ws_dep_arm) */ /* one "device" block: x | xout | ids | wts | tab_gu | tab_dn | dir_gu | dir_dn | norm; the gate row block apart */ enum { B_X = 0, B_XOUT = 8192, B_IDS = 16384, B_WTS = 16448, B_TGU = 16512, B_TDN = 16640, B_DGU = 16768, B_DDN = 16768 + 2048, B_NORM = 16768 + 4096, B_BYTES = 16768 + 4096 + 8192 }; static void fake_dirs(uint64_t *dgu, uint64_t *ddn) { for (unsigned e = 0; e < NE; e++) { dgu[2 * e] = 0x100000000ull + e * 16; dgu[2 * e + 1] = 0x200000000ull + e * 16 + 8; ddn[2 * e] = 0x300000000ull + e * 32; ddn[2 * e + 1] = 0x400000000ull + e * 32 + 16; } } static int sim_point(uint32_t depth, int mutant, int norm_topk, float out_scale, uint32_t seed, char *msg, size_t n, int *bad, int *margin_case) { static BlackwellIRProgram prog; - OmegaRouterSpec spec = { 8, depth, mutant, 0 }; + OmegaRouterSpec spec = { 8, depth, mutant, g_sim_dep }; if (omega_blackwell_codegen_router_prog(&spec, &prog) != 0) { snprintf(msg, n, "codegen refused"); return -1; } Case c; case_make(&c, seed, 1.0f, norm_topk); uint8_t *blk = aligned_alloc(16, B_BYTES); memset(blk, 0, B_BYTES); @@ -152,8 +160,10 @@ static int sim_point(uint32_t depth, int mutant, int norm_topk, float out_scale, s.nranges = 2; s.ranges[0].lo = (uintptr_t)blk; s.ranges[0].hi = (uintptr_t)blk + B_BYTES; s.ranges[1].lo = (uintptr_t)gate; s.ranges[1].hi = (uintptr_t)gate + (size_t)NE * H * 2; + static uint32_t depline[16]; if (g_sim_dep) ws_dep_arm(&s, depline); err = ws_run(&s, 1, 1); if (err) { snprintf(msg, n, "order %d: %s (pc %d)", order, s.msg, s.err_pc); break; } + if (g_sim_dep && depline[0] != 1u) { err = -1; snprintf(msg, n, "dep counter %u after 1 CTA (want 1)", depline[0]); break; } g_sim_issues += s.warp_issues; size_t unwritten = 0; for (unsigned i = 0; i < H; i++) if (xo[i] == -999.0f) unwritten++; for (unsigned i = 0; i < TK; i++) if (wd[i] == -999.0f || idd[i] == 0xffffffffu) unwritten++; @@ -177,6 +187,14 @@ static void sim_battery(void) { CHECK(!err && bad == 0, "sim %s: %s", pts[i].name, msg); printf("sim %s: %s %s\n", pts[i].name, err ? "ERROR" : bad ? "MISMATCH" : "ok", msg); } + { /* DEPFLAGS: the dep-mode kernel (poll, BAR, CCTL.IVALL in front; fence, BAR, counter add behind) computes the same answer and counts itself in */ + char msg[300]; int bad = 0, mc = 0; + g_sim_dep = OMEGA_DEP_FLAGS; + int err = sim_point(8, 0, 1, 1.0f, 11, msg, sizeof msg, &bad, &mc); + g_sim_dep = 0; + CHECK(!err && bad == 0, "sim depth 8 norm with dep flags: %s", msg); + printf("sim depth 8 norm dep 1: %s %s\n", err ? "ERROR" : bad ? "MISMATCH" : "ok", msg); + } for (int m = 1; m <= 4; m++) { char msg[300]; int bad = 0, mc = 0; int err = sim_point(8, m, 1, 1.0f, 21, msg, sizeof msg, &bad, &mc); From 2f655fbf90ac15e379a06cc01014bfcee940d501 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Fri, 16 Oct 2026 14:05:18 -0500 Subject: [PATCH 07/10] depflags: chip study in gpu_cmdlist_test --depflags (RED none/dep0, A wfi/dep0, D none/dep1) The record's Phase 2 asks for a negative control first: barrier NONE with dep 0 on the dependent heavy AXPY chain (32 launches, 1M elements, 256 CTAs each) must corrupt x, because those kernels carry no ordering of their own. Then A (today's WFI + INVALIDATE ALL, dep 0) and D (barrier NONE, dep 1, omega_gpu_cmdlist_set_dep) interleaved --reps times each, PTIMER stamps on, parity on every element after every run, counter == CTA total in D. One line per run, medians and D/A fraction at the end, JSON with --out. Co-Authored-By: Claude Fable 5.1 --- tests/gpu_cmdlist_test.c | 82 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 79 insertions(+), 3 deletions(-) diff --git a/tests/gpu_cmdlist_test.c b/tests/gpu_cmdlist_test.c index 1a1164c10..6d07b4551 100644 --- a/tests/gpu_cmdlist_test.c +++ b/tests/gpu_cmdlist_test.c @@ -580,18 +580,94 @@ static int chip_run(const char *out_path, uint32_t reps) { return g_failed ? 1 : 0; } +/* ---- DEPFLAGS chip study (--depflags, 2026-10-16): the heavy dependent AXPY chain (32 launches x 1M elements, 256 CTAs each) three ways. + * RED barrier NONE, dep 0: the kernels carry no ordering of their own, so overlapping grids must corrupt x (the negative control: the + * run where the instrument says "no"; without it a clean D run proves nothing). + * A barrier WFI + INVALIDATE ALL, dep 0: today's default. + * D barrier NONE, dep 1: the kernels order themselves with the list's counter (omega_gpu_cmdlist_set_dep). + * RED reps times first, then A and D interleaved reps times each, GPU PTIMER stamps on: span = stamps[N] - stamps[0] (the first + * stamp sits after the first launch's WFI, the last after the final WFI, so the span covers all N grids in both variants); parity on + * every element after every run; in D the counter read back must equal the CTA total. One line per run; JSON with --out. */ +static uint64_t med64(uint64_t *v, uint32_t n) { for (uint32_t i = 1; i < n; i++) for (uint32_t j = i; j > 0 && v[j - 1] > v[j]; j--) { uint64_t t = v[j]; v[j] = v[j - 1]; v[j - 1] = t; } return n ? v[n / 2] : 0; } +static int chip_depflags(const char *out_path, uint32_t reps) { + FILE *out = out_path ? fopen(out_path, "w") : NULL; + if (out_path && !out) { printf("cannot write %s\n", out_path); return 1; } + if (specs_build()) { printf("FAIL: codegen\n"); return 1; } + static Kern K_dep; + { OmegaDecSpec s; memset(&s, 0, sizeof s); s.kind = OMEGA_DEC_AXPY; s.stride = AXPY_BIG_STRIDE; s.dep = OMEGA_DEP_FLAGS; if (kern_prog(&K_dep, &s)) { printf("FAIL: codegen dep\n"); return 1; } } + OmegaGpuCmdList *cl = NULL; + if (omega_gpu_cmdlist_create(OMEGA_GPU_CMDLIST_MAX_LAUNCHES, &cl) != 0) return chip_fail("cmdlist create"); + omega_gpu_session_lock(); + if (kern_upload(&K_axpy_big) || kern_upload(&K_dep)) { omega_gpu_session_unlock(); return chip_fail("kernel upload"); } + const uint32_t N = 32; const size_t n = (size_t)AXPY_BIG_STRIDE * AXPY_BIG_ITERS, big = n * 4u; + OmegaGpuMem bx, ba, bx0; + if (omega_gpu_session_alloc(big, &bx) || omega_gpu_session_alloc(big, &ba) || omega_gpu_session_alloc(big, &bx0)) { omega_gpu_session_unlock(); return chip_fail("alloc"); } + uint32_t s = 11; float *x0 = bx0.cpu, *a = ba.cpu, *x = bx.cpu; + for (size_t i = 0; i < n; i++) { x0[i] = frand(&s, -1, 1); a[i] = frand(&s, -1, 1); } + omega_gpu_session_sync_to_gpu(&ba); + float *xr = malloc(big); memcpy(xr, x0, big); + for (uint32_t l = 0; l < N; l++) for (size_t i = 0; i < n; i++) xr[i] = xr[i] + a[i]; + uint32_t ab[OMEGA_DEC_AXPY_WORDS] = { 0 }; put64(ab, OMEGA_DEC_AXPY_X, bx.va); put64(ab, OMEGA_DEC_AXPY_A, ba.va); ab[(OMEGA_DEC_AXPY_ITERS - 0x380) / 4] = AXPY_BIG_ITERS; + OmegaGpuLaunch L0 = axpy_launch(&K_axpy_big, ab, AXPY_BIG_STRIDE, AXPY_BIG_ITERS), L1 = axpy_launch(&K_dep, ab, AXPY_BIG_STRIDE, AXPY_BIG_ITERS); + static uint64_t stamps[OMEGA_GPU_CMDLIST_MAX_LAUNCHES + 1]; + const uint32_t ctas = AXPY_BIG_STRIDE / OMEGA_DEC_THREADS; + printf("depflags chip study: %u launches x %zu elements, %u CTAs per launch, dep kernel %u gprs (dep 0: %u), reps %u\n", N, n, ctas, K_dep.gpr, K_axpy_big.gpr, reps); + if (out) fprintf(out, "{\"receipt\":\"OMEGA_DEPFLAGS_CHIP_V1\",\"launches\":%u,\"elements\":%zu,\"ctas_per_launch\":%u,\"reps\":%u,\"runs\":[", N, n, ctas, reps); + uint64_t span_a[256], span_d[256]; uint32_t na = 0, nd = 0, red_corrupt = 0, red_runs = 0, par_a = 0, par_d = 0; int first = 1; + if (reps > 256) reps = 256; + for (uint32_t rep = 0; rep < 3 * reps && !omega_gpu_cmdlist_is_latched(); rep++) { + const int variant = rep < reps ? 0 : ((rep - reps) & 1 ? 2 : 1); /* RED x reps, then A, D, A, D, ... */ + memcpy(x, x0, big); omega_gpu_session_sync_to_gpu(&bx); + omega_gpu_cmdlist_reset(cl); + if (omega_gpu_cmdlist_set_dep(cl, variant == 2 ? OMEGA_DEP_FLAGS : 0) != 0) { omega_gpu_session_unlock(); return chip_fail("set_dep"); } + for (uint32_t l = 0; l < N; l++) if (omega_gpu_cmdlist_add(cl, variant == 2 ? &L1 : &L0) < 0) { omega_gpu_session_unlock(); return chip_fail("add"); } + OmegaGpuCmdListOpts o; memset(&o, 0, sizeof o); o.mode = OMEGA_GPU_CMDLIST_PCAS; o.timeout_ms = 20000; o.stamps = 1; + o.barrier = variant == 1 ? OMEGA_GPU_CMDLIST_BARRIER_WFI : OMEGA_GPU_CMDLIST_BARRIER_NONE; + OmegaGpuCmdListStats st; int rc = omega_gpu_cmdlist_submit(cl, &o, &st); + omega_gpu_session_sync_to_cpu(&bx); + size_t d = 0; for (size_t i = 0; i < n; i++) if (x[i] != xr[i]) d++; + int cnt = rc == 0 ? omega_gpu_cmdlist_stamps(cl, stamps, N + 1) : -1; + int mono = 1; for (int i = 1; i < cnt; i++) if (stamps[i] < stamps[i - 1]) mono = 0; + const uint64_t span = cnt == (int)N + 1 ? stamps[N] - stamps[0] : 0; + const char *name = variant == 0 ? "RED none dep0" : variant == 1 ? "A wfi dep0" : "D none dep1"; + printf("run %2u %-13s rc %d differ %zu/%zu chip %.1f us stamps %d mono %d span %.1f us per-launch %.2f us counter %u/%u%s%s\n", rep, name, rc, d, n, st.elapsed_ns / 1e3, cnt, mono, + span / 1e3, span / 1e3 / N, st.dep_observed, st.dep_expected, rc ? " ERR: " : "", rc ? omega_gpu_session_last_error() : ""); + if (out) fprintf(out, "%s{\"run\":%u,\"variant\":\"%s\",\"rc\":%d,\"differ\":%zu,\"chip_ns\":%" PRIu64 ",\"stamps\":%d,\"span_ns\":%" PRIu64 ",\"counter\":%u,\"expected\":%u}", + first ? "" : ",", rep, name, rc, d, st.elapsed_ns, cnt, span, st.dep_observed, st.dep_expected); + first = 0; + if (variant == 0) { red_runs++; if (d) red_corrupt++; } + else if (variant == 1) { if (rc == 0 && d == 0 && cnt == (int)N + 1 && mono) par_a++; if (span) span_a[na++] = span; } + else { if (rc == 0 && d == 0 && cnt == (int)N + 1 && mono && st.dep_observed == st.dep_expected && st.dep_expected == N * ctas) par_d++; if (span) span_d[nd++] = span; } + } + CHECK(red_corrupt > 0, "RED: barrier NONE with dep 0 corrupted x in %u of %u runs (the instrument can say no)", red_corrupt, red_runs); + CHECK(par_a == reps, "A wfi dep0: parity, %u stamps, monotonic in %u of %u runs", N + 1, par_a, reps); + CHECK(par_d == reps, "D none dep1: parity, stamps, counter == %u CTAs in %u of %u runs", N * ctas, par_d, reps); + const uint64_t ma = med64(span_a, na), md = med64(span_d, nd); + printf("A wfi dep0 span median %.1f us (min %.1f max %.1f, %u runs), per launch %.2f us\n", ma / 1e3, na ? span_a[0] / 1e3 : 0.0, na ? span_a[na - 1] / 1e3 : 0.0, na, ma / 1e3 / N); + printf("D none dep1 span median %.1f us (min %.1f max %.1f, %u runs), per launch %.2f us; D/A %.3f\n", md / 1e3, nd ? span_d[0] / 1e3 : 0.0, nd ? span_d[nd - 1] / 1e3 : 0.0, nd, md / 1e3 / N, ma ? (double)md / (double)ma : 0.0); + if (out) fprintf(out, "],\"red\":{\"runs\":%u,\"corrupt\":%u},\"A\":{\"parity\":%u,\"span_med_ns\":%" PRIu64 ",\"span_min_ns\":%" PRIu64 ",\"span_max_ns\":%" PRIu64 "},\"D\":{\"parity\":%u,\"span_med_ns\":%" PRIu64 ",\"span_min_ns\":%" PRIu64 ",\"span_max_ns\":%" PRIu64 "},\"latched\":%d}\n", + red_runs, red_corrupt, par_a, ma, na ? span_a[0] : 0, na ? span_a[na - 1] : 0, par_d, md, nd ? span_d[0] : 0, nd ? span_d[nd - 1] : 0, omega_gpu_cmdlist_is_latched()); + if (out) fclose(out); + free(xr); + omega_gpu_session_free(&bx); omega_gpu_session_free(&ba); omega_gpu_session_free(&bx0); + omega_gpu_session_unlock(); + omega_gpu_cmdlist_free(cl); + return g_failed ? 1 : 0; +} + int main(int argc, char **argv) { - int host = 0, sim = 0; uint32_t reps = 20; const char *out = NULL; + int host = 0, sim = 0, depflags = 0; uint32_t reps = 20; const char *out = NULL; for (int i = 1; i < argc; i++) { if (strcmp(argv[i], "--host-only") == 0) host = 1; else if (strcmp(argv[i], "--sim") == 0) sim = 1; + else if (strcmp(argv[i], "--depflags") == 0) depflags = 1; /* DEPFLAGS chip study (RED, A, D; --reps N each, --out) */ else if (strcmp(argv[i], "--reps") == 0 && i + 1 < argc) reps = (uint32_t)atoi(argv[++i]); else if (strcmp(argv[i], "--spin-us") == 0 && i + 1 < argc) omega_gpu_session_set_spin_us((uint32_t)atoi(argv[++i])); else if (strcmp(argv[i], "--out") == 0 && i + 1 < argc) out = argv[++i]; else { printf("usage: %s [--host-only|--sim] [--reps N] [--spin-us U] [--out receipt.json]\n", argv[0]); return 2; } } if (reps == 0) reps = 1; - int rc = host ? host_only() : sim ? sim_mode() : chip_run(out, reps); - printf("%s: %d checks, %d failed: %s\n", host ? "host-only" : sim ? "sim" : "chip", g_checks, g_failed, rc ? "FAIL" : "PASS"); + int rc = host ? host_only() : sim ? sim_mode() : depflags ? chip_depflags(out, reps) : chip_run(out, reps); + printf("%s: %d checks, %d failed: %s\n", host ? "host-only" : sim ? "sim" : depflags ? "chip-depflags" : "chip", g_checks, g_failed, rc ? "FAIL" : "PASS"); return rc; } From b6f7a7f3dd11a1eb1c98591a926e3e565c5981f7 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Fri, 16 Oct 2026 14:08:31 -0500 Subject: [PATCH 08/10] depflags: one resident kernel per dep mode in the attention and router caches (the chip refused the first dep-mode record) What was wrong: omega_gpu_decode_attn_api and omega_gpu_router_api hold a single resident kernel. The decode graph warms up through the host path (dep 0 kernels), then records with AIEN_OMEGA_DEP=1, whose kernels carry the counter protocol and so differ in spec. The record path refuses a cache miss that would evict a resident kernel, so the first dep-mode record failed: 'decode attn record: kernel cache miss would evict the resident kernel' (investigations/2026-10-16-DEPFLAGS-CHIP/runs/dgraph-dep1-RED-single-slot.log line 7, 0 launches ran). The fp8 (16 slots) and bf16 (8 slots) caches had room and were not affected. Fix: slot[2], indexed by spec.dep != 0; a miss frees only the slot it replaces; set_depth / set_shape / mutant clear both. Proven: the same command then ran 13/13 (runs/dgraph-dep1.log: argmax identical, B bit-identical to C, both mutants red); gpu_router_test 72+11, gpu_decode_attn_test 44+13, decode graph and cmdlist host suites unchanged. Co-Authored-By: Claude Fable 5.1 --- src/omega_gpu_decode_attn_api.c | 11 ++++++----- src/omega_gpu_router_api.c | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/omega_gpu_decode_attn_api.c b/src/omega_gpu_decode_attn_api.c index 03c327ba1..ff4907deb 100644 --- a/src/omega_gpu_decode_attn_api.c +++ b/src/omega_gpu_decode_attn_api.c @@ -32,14 +32,15 @@ typedef struct { static struct { bool hooked; - Slot slot; + Slot slot[2]; /* [0] today's kernel, [1] the dep-mode kernel (DEPFLAGS): a dep-mode record right after the host path must not evict the resident kernel */ uint32_t depth, per_split; int mutant; } g; static int g_rec; /* 1 while a record call runs (lock held): kernel_for must not evict */ -static void slot_clear_locked(void) { if (g.slot.valid) omega_gpu_session_free(&g.slot.code); memset(&g.slot, 0, sizeof g.slot); } -static void on_session_close(void) { memset(&g.slot, 0, sizeof g.slot); } +static void slot_free_locked(Slot *s) { if (s->valid) omega_gpu_session_free(&s->code); memset(s, 0, sizeof *s); } +static void slot_clear_locked(void) { slot_free_locked(&g.slot[0]); slot_free_locked(&g.slot[1]); } +static void on_session_close(void) { memset(g.slot, 0, sizeof g.slot); } static OmegaGpuSession *dev_open_locked(void) { if (!g.hooked) { (void)omega_gpu_session_on_close(on_session_close); g.hooked = true; } return omega_gpu_session_open(); @@ -149,10 +150,10 @@ int omega_gpu_decode_attn_cache_read(OmegaGpuDecodeAttnCache *c, uint32_t layer, /* ---- kernel ---- */ static int kernel_for(const OmegaDecodeAttnSpec *spec, Slot **out, bool *hit) { - Slot *s = &g.slot; + Slot *s = &g.slot[spec->dep ? 1 : 0]; /* one resident kernel per dep mode */ if (s->valid && memcmp(&s->spec, spec, sizeof *spec) == 0) { *out = s; *hit = true; return OMEGA_GPU_DATTN_OK; } if (g_rec && s->valid) { omega_gpu_session_set_error("decode attn record: kernel cache miss would evict the resident kernel (warm up before recording)"); return OMEGA_GPU_DATTN_TOO_LARGE; } - slot_clear_locked(); + slot_free_locked(s); BlackwellIRProgram *prog = omega_gpu_host_calloc(1, sizeof *prog); if (!prog) { omega_gpu_session_set_error("decode attn codegen: host memory"); return OMEGA_GPU_DATTN_CODEGEN_FAIL; } int cg = omega_blackwell_codegen_decode_attn_prog(spec, prog); diff --git a/src/omega_gpu_router_api.c b/src/omega_gpu_router_api.c index 21ca674e1..9f7a42dbf 100644 --- a/src/omega_gpu_router_api.c +++ b/src/omega_gpu_router_api.c @@ -40,14 +40,15 @@ typedef struct { static struct { bool hooked; - Slot slot; + Slot slot[2]; /* [0] today's kernel, [1] the dep-mode kernel (DEPFLAGS): a dep-mode record right after the host path must not evict the resident kernel */ uint32_t warps, depth; int mutant; } g; static int g_rec; /* 1 while a record call runs (lock held): kernel_for must not evict */ -static void slot_clear_locked(void) { if (g.slot.valid) omega_gpu_session_free(&g.slot.code); memset(&g.slot, 0, sizeof g.slot); } -static void on_session_close(void) { memset(&g.slot, 0, sizeof g.slot); } +static void slot_free_locked(Slot *s) { if (s->valid) omega_gpu_session_free(&s->code); memset(s, 0, sizeof *s); } +static void slot_clear_locked(void) { slot_free_locked(&g.slot[0]); slot_free_locked(&g.slot[1]); } +static void on_session_close(void) { memset(g.slot, 0, sizeof g.slot); } static OmegaGpuSession *dev_open_locked(void) { if (!g.hooked) { (void)omega_gpu_session_on_close(on_session_close); g.hooked = true; } return omega_gpu_session_open(); @@ -157,10 +158,10 @@ int omega_gpu_router_read_back(OmegaGpuRouter *r, float *xout, uint64_t *tab_gu, /* ---- kernel ---- */ static int kernel_for(const OmegaRouterSpec *spec, Slot **out, bool *hit) { - Slot *s = &g.slot; + Slot *s = &g.slot[spec->dep ? 1 : 0]; /* one resident kernel per dep mode */ if (s->valid && memcmp(&s->spec, spec, sizeof *spec) == 0) { *out = s; *hit = true; return OMEGA_GPU_ROUTER_OK; } if (g_rec && s->valid) { omega_gpu_session_set_error("router record: kernel cache miss would evict the resident kernel (warm up before recording)"); return OMEGA_GPU_ROUTER_TOO_LARGE; } - slot_clear_locked(); + slot_free_locked(s); BlackwellIRProgram *prog = omega_gpu_host_calloc(1, sizeof *prog); if (!prog) { omega_gpu_session_set_error("router codegen: host memory"); return OMEGA_GPU_ROUTER_CODEGEN_FAIL; } int cg = omega_blackwell_codegen_router_prog(spec, prog); From 05d0d8e9ab225dba82698bf89128072f3a6f3a7a Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Fri, 16 Oct 2026 14:08:53 -0500 Subject: [PATCH 09/10] crumb: compile for depflags Co-Authored-By: Claude Fable 5.1 --- .crumb | 34 +++++++++++++++----------- calibration/.crumb | 20 ++++++++++++---- docs/.crumb | 10 ++++---- docs/estimation/.crumb | 26 ++++++++++++++++---- research/.crumb | 30 ++++++++++++++++++----- research/atemporal/.crumb | 26 ++++++++++++++++---- research/m15/spbm/.crumb | 35 +++++++++++++++++++++++---- src/.crumb | 10 ++++---- tests/.crumb | 12 +++++----- tests/r16_inventory/.crumb | 10 ++++---- tests/r16_inventory/fixture/.crumb | 38 ++++++++++++++++++++++++++---- 11 files changed, 189 insertions(+), 62 deletions(-) diff --git a/.crumb b/.crumb index 90ded1fe5..4e429d789 100644 --- a/.crumb +++ b/.crumb @@ -41,14 +41,20 @@ "generated": { "children": [ { - "digest": "fb7cc6e608fdbe68a9735a1313285782b9717ff12bde17343f8ce635de3644f6", + "digest": "9dd7474de3f8342f85466d4629e58ebe6a7e9be694f6f282803892d32f9c272f", + "last_commit": "5901baa5", + "name": "bench/prime_race", + "purpose": "AIEN Prime Drag Race implementation side: the shared protocol helper (command line, timed loop, " + }, + { + "digest": "3f2f29e905246ceb0b8778e1392f090ac93c949f89a139da0bd77b520946f30c", "last_commit": "190ff891", "name": "calibration", "purpose": "Directory calibration. Purpose not yet described by a human." }, { - "digest": "d2eb8967a939ebdb0b54e15fe5d849dd5af71c23b812941e4ba86ad2b0f21d39", - "last_commit": "979ac54c", + "digest": "49f12a6fe70d5309b3651b14122809ece58a18d80bc4188aa3f557a4354434c4", + "last_commit": "4870b0a4", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." }, @@ -65,7 +71,7 @@ "purpose": "Directory mk. Purpose not yet described by a human." }, { - "digest": "eccc4aec1037ae222d6370836953732b031b8ed70de28967b7af7ca62c2abe0b", + "digest": "e1b329e45619370357f74f738cc24e6091c9139e9db8e95e324d12955acf3ffa", "last_commit": "5901baa5", "name": "research", "purpose": "Directory research. Purpose not yet described by a human." @@ -77,14 +83,14 @@ "purpose": "Directory spec. Purpose not yet described by a human." }, { - "digest": "dfa36de2ac8649f66f80587abea51a7f166285ee0b92e0e09774c98689055250", - "last_commit": "333091a6", + "digest": "aa2a756962b2afc365533dfae935f9aae337d11f7cd7c85ba0397ca3e9d4c3c6", + "last_commit": "b6f7a7f3", "name": "src", "purpose": "Directory src. Purpose not yet described by a human." }, { - "digest": "1fb9acb543bcc5bb34df8ff3f2bc12e5e75931b3698e8870e95a0c753dc44d87", - "last_commit": "43d8d20d", + "digest": "330a167f7b7e86b2f503911a9853d900987c833862d23a15e60e33ccf3b2754e", + "last_commit": "2f655fbf", "name": "tests", "purpose": "Directory tests. Purpose not yet described by a human." }, @@ -95,15 +101,15 @@ "purpose": "Directory tools. Purpose not yet described by a human." } ], - "children_root": "sha256:58cd6740ca04b3c398bc6ba89fbe52c2999a9064e5a1f889c27b409143af4203", - "compiled_at": "2026-10-16T09:04:56Z", + "children_root": "sha256:efa6b658dcf9a8f32203b8bd403af067a999c0b69c94caa540f381218676046b", + "compiled_at": "2026-10-16T19:08:36Z", "compiler": "crumb-compile/1", - "digest": "sha256:33cb95985ca81cb38d05cb52c1292ab59a65a523e2d9399039d740d5801d34dd", + "digest": "sha256:1dc94f2e59335b5553b7d9c93224a849213e427ac6ae276fe9a18ba5d8fcc010", "evidence_files": 11127, "evidence_root": "sha256:4528085ec1661c442b64fb5dc8def65067ea2620ff88e42bcf52d58b7642ea6e", - "files": 14109, - "generated_at_commit": "9d368679f13ea58c46bf7580899aee92e39f5885", - "source_tree": "sha256:63dba4a6717442292a2be7a2bc5f0da5d3ce5350849634a11630446a24597727" + "files": 14112, + "generated_at_commit": "b6f7a7f3dd11a1eb1c98591a926e3e565c5981f7", + "source_tree": "sha256:120f9833a6157832d67609a0b5753b49eca7f3b91cf988bed4cda46eed28a7b1" }, "owner_lane": "", "provenance": { diff --git a/calibration/.crumb b/calibration/.crumb index 7a4f08dbb..eb5314853 100644 --- a/calibration/.crumb +++ b/calibration/.crumb @@ -38,6 +38,18 @@ "name": "docs", "purpose": "Directory calibration/docs. Purpose not yet described by a human." }, + { + "digest": "1cfc0113fa05f78ebe448d6e09d205399b96d4d7381299e9b8eff508304a34ac", + "last_commit": "d5c97ce9", + "name": "experiments/EXP-001", + "purpose": "Directory calibration/experiments/EXP-001. Purpose not yet described by a human." + }, + { + "digest": "9c1f1bbe230c6ecdac42dbcaa60c5d757470499349dd7cb1124baa45be183ae8", + "last_commit": "190ff891", + "name": "experiments/EXP-001R", + "purpose": "Directory calibration/experiments/EXP-001R. Purpose not yet described by a human." + }, { "digest": "6b36741c5f34a363b7e8cd3c29f8b3f0d43acbb3c2cddd3f5b9ebbade3f85d25", "last_commit": "1cff5260", @@ -63,14 +75,14 @@ "purpose": "Directory calibration/scripts. Purpose not yet described by a human." } ], - "children_root": "sha256:e58b9cc78de81a51c7ed21c725616ddb80bd3d24d171b24a189e8f7132499433", - "compiled_at": "2026-10-14T21:46:29Z", + "children_root": "sha256:3beb3c97b6608f6ccb9b9b84892f708e896bd013f4f5d17afa107a29555a045d", + "compiled_at": "2026-10-16T19:08:36Z", "compiler": "crumb-compile/1", - "digest": "sha256:fb7cc6e608fdbe68a9735a1313285782b9717ff12bde17343f8ce635de3644f6", + "digest": "sha256:3f2f29e905246ceb0b8778e1392f090ac93c949f89a139da0bd77b520946f30c", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 110, - "generated_at_commit": "2a6d6d7b9091bd2184b15dcde893035dbcca40d3", + "generated_at_commit": "b6f7a7f3dd11a1eb1c98591a926e3e565c5981f7", "source_tree": "sha256:b39f40915ce2ed4092ade2a38665d99f6daab78fd462433177cdd0aec5f00bd7" }, "owner_lane": "", diff --git a/docs/.crumb b/docs/.crumb index ca5d5ec00..e2ac91dc8 100644 --- a/docs/.crumb +++ b/docs/.crumb @@ -75,7 +75,7 @@ "purpose": "DUAL (ARCH-0031) documents in omega: applicability experiment method and findings (APPLICABILITY" }, { - "digest": "56a5a999ce726e90d89c1c88b9e20c81857c8e6ee82af8d651ac80ea70e2c46d", + "digest": "1c554227f29c8c6d4f81ca2a5f5380d3646c8c925f4ab0248df73f88138f5432", "last_commit": "38a6a569", "name": "estimation", "purpose": "Directory docs/estimation. Purpose not yet described by a human." @@ -123,14 +123,14 @@ "purpose": "Directory docs/turing. Purpose not yet described by a human." } ], - "children_root": "sha256:ac7f7ea4b00d4620a993c6dd88a0267f2d49008d415162976e45fa4341e43407", - "compiled_at": "2026-10-16T09:04:56Z", + "children_root": "sha256:824d03b6fb7cef707314190e6f66c9de4934f6d67b3fa61cd9d65f8eb614e76c", + "compiled_at": "2026-10-16T19:08:36Z", "compiler": "crumb-compile/1", - "digest": "sha256:d2eb8967a939ebdb0b54e15fe5d849dd5af71c23b812941e4ba86ad2b0f21d39", + "digest": "sha256:49f12a6fe70d5309b3651b14122809ece58a18d80bc4188aa3f557a4354434c4", "evidence_files": 34, "evidence_root": "sha256:589d8b3706e6d7a202ab20b278dac5fc5bafc973f1c2a867b2668aa7210b65cc", "files": 127, - "generated_at_commit": "9d368679f13ea58c46bf7580899aee92e39f5885", + "generated_at_commit": "b6f7a7f3dd11a1eb1c98591a926e3e565c5981f7", "source_tree": "sha256:29d159b6950500f96de859834fd2c5a9e9ba037f9bc88fd97a8ed47a1688233b" }, "owner_lane": "", diff --git a/docs/estimation/.crumb b/docs/estimation/.crumb index f45a9743b..beac278f8 100644 --- a/docs/estimation/.crumb +++ b/docs/estimation/.crumb @@ -16,6 +16,24 @@ "extensions": { "generated": { "children": [ + { + "digest": "544a350adaaed15c87a8006c1ac1be87eda1b7f4493e07bf1e6a0d88b4ab65de", + "last_commit": "f6390e88", + "name": "receipts/est23-v1", + "purpose": "Directory docs/estimation/receipts/est23-v1. Purpose not yet described by a human." + }, + { + "digest": "67bc1848d22db1ef3a2db67a370ea75cd826da2788312f91419dcff93b222d92", + "last_commit": "8a56ace6", + "name": "receipts/est23-v2", + "purpose": "Directory docs/estimation/receipts/est23-v2. Purpose not yet described by a human." + }, + { + "digest": "fbbca721bf11b2fcf5727fab4d703c908e8b6835bce7c749645f0af42db15da9", + "last_commit": "d43a5df8", + "name": "receipts/est3c-v3", + "purpose": "Directory docs/estimation/receipts/est3c-v3. Purpose not yet described by a human." + }, { "digest": "09ae7f9b04e4639bc444223a5566e755c4eadcd517cc57a95a454e9f27c34edf", "last_commit": "f6390e88", @@ -23,14 +41,14 @@ "purpose": "Directory docs/estimation/reviews. Purpose not yet described by a human." } ], - "children_root": "sha256:35cd3af03e079556db7f3ebcfd7590fa68659e84dd603795ae6b5b048dc2af0d", - "compiled_at": "2026-10-14T21:46:29Z", + "children_root": "sha256:d7a9f4bca5e0308c1f3877832d8e5c6b10ca5a09d5c65e8c6c96e2bbaef50871", + "compiled_at": "2026-10-16T19:08:36Z", "compiler": "crumb-compile/1", - "digest": "sha256:56a5a999ce726e90d89c1c88b9e20c81857c8e6ee82af8d651ac80ea70e2c46d", + "digest": "sha256:1c554227f29c8c6d4f81ca2a5f5380d3646c8c925f4ab0248df73f88138f5432", "evidence_files": 34, "evidence_root": "sha256:589d8b3706e6d7a202ab20b278dac5fc5bafc973f1c2a867b2668aa7210b65cc", "files": 47, - "generated_at_commit": "2a6d6d7b9091bd2184b15dcde893035dbcca40d3", + "generated_at_commit": "b6f7a7f3dd11a1eb1c98591a926e3e565c5981f7", "source_tree": "sha256:67ae8d20aca3ae36b8cf0d75c6939058cc9ff8762c977f70d6963c545e3215d8" }, "owner_lane": "", diff --git a/research/.crumb b/research/.crumb index df383ba0d..c2d64ccc2 100644 --- a/research/.crumb +++ b/research/.crumb @@ -21,8 +21,8 @@ "generated": { "children": [ { - "digest": "fce91110a9847be58e4068fc9c24497369672f3f60ca6c7deb5b0699df0e045c", - "last_commit": "e0abd0b5", + "digest": "8aba4c878c9f6317ef666b9795182fe9fb58661b9fe5eefdd0cd786bfb15b39d", + "last_commit": "5901baa5", "name": "atemporal", "purpose": "AT-0 Clock-Free Universe research program: relational (Page-Wootters) quantum models with no ext" }, @@ -31,16 +31,34 @@ "last_commit": "458c57f5", "name": "dirac-oracle", "purpose": "Directory research/dirac-oracle. Purpose not yet described by a human." + }, + { + "digest": "7ca182d0a6bd90801e4386c4627ac58965e0aa2b381e49bb6c5e0d2226ace248", + "last_commit": "72c0c39b", + "name": "m15/pmu", + "purpose": "Directory research/m15/pmu. Purpose not yet described by a human." + }, + { + "digest": "cc7d487eb63f35f0baa47bb0a8c93222655d4bd58b81d413093807c58ebe7a9f", + "last_commit": "559f6e5d", + "name": "m15/spbm", + "purpose": "Directory research/m15/spbm. Purpose not yet described by a human." + }, + { + "digest": "db23aeba4580239d67e68e3fadc064d5bd06570da99c3e97ac6b0d3347ae24a3", + "last_commit": "65c64a3e", + "name": "r14-failure-modes/exact-20260928-130858", + "purpose": "Directory research/r14-failure-modes/exact-20260928-130858. Purpose not yet described by a human" } ], - "children_root": "sha256:47fde1e530a64eb6f5fbecb27fddf6335c32069f1acb4de243826d601361a138", - "compiled_at": "2026-10-14T01:16:48Z", + "children_root": "sha256:6003088071f523982b1e9abf3de083176cce8538444ec586da28ca1e79cecb2c", + "compiled_at": "2026-10-16T19:08:36Z", "compiler": "crumb-compile/1", - "digest": "sha256:eccc4aec1037ae222d6370836953732b031b8ed70de28967b7af7ca62c2abe0b", + "digest": "sha256:e1b329e45619370357f74f738cc24e6091c9139e9db8e95e324d12955acf3ffa", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 538, - "generated_at_commit": "e0abd0b524f5bf8e3ba6960b53868980bdd41b4e", + "generated_at_commit": "b6f7a7f3dd11a1eb1c98591a926e3e565c5981f7", "source_tree": "sha256:2c362ea1c5900e78486cbe9cfc017bd87b53ab97bd93317cd9be0efb6923d9ea" }, "owner_lane": "", diff --git a/research/atemporal/.crumb b/research/atemporal/.crumb index fc9132860..72fc8d310 100644 --- a/research/atemporal/.crumb +++ b/research/atemporal/.crumb @@ -7,16 +7,34 @@ "last_commit": "bacc4b6b", "name": "at0", "purpose": "AT-0 V1: finite clock plus one qubit under the AT0_CASE_V1 / AT0_RESULT_V1 contracts" + }, + { + "digest": "d7472188cc921c2fcedb227495a6fdad3ea575761615f762d37c7703e5ed002b", + "last_commit": "59d3a014", + "name": "at1/evaluator", + "purpose": "AT-1 Agent 4 adversarial evaluator: independent AT1_CASE_V1 codec, exact-arithmetic AT1_RESULT_V" + }, + { + "digest": "163aa7e6fb222ba8c8a9c66a289258e44ccc3ec016721600c6a9587c480a3882", + "last_commit": "c02b278c", + "name": "at1/integration", + "purpose": "AT-1 Agent 5 integration runner (run.sh), engine and oracle shims for the evaluator, contract pi" + }, + { + "digest": "3eb2d35ebbc48ad49b2866922fe1fc5665b0334087412bc55bae4a7c3ff2faaf", + "last_commit": "f2b9e33f", + "name": "at1/oracle", + "purpose": "AT-1 reference oracle (Rust, standard library only, built by rustc directly; research cross-chec" } ], - "children_root": "sha256:f7bd1d7019a69ef57140cd019f86634f3cb80c1e31ca3063dfdf73ac9deef7c6", - "compiled_at": "2026-10-14T01:16:48Z", + "children_root": "sha256:0c3ae36eaf8728c9af97c1a39f90c41b8839ac33c51dbc76b58b94b8ecacb562", + "compiled_at": "2026-10-16T19:08:36Z", "compiler": "crumb-compile/1", - "digest": "sha256:fce91110a9847be58e4068fc9c24497369672f3f60ca6c7deb5b0699df0e045c", + "digest": "sha256:8aba4c878c9f6317ef666b9795182fe9fb58661b9fe5eefdd0cd786bfb15b39d", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 392, - "generated_at_commit": "e0abd0b524f5bf8e3ba6960b53868980bdd41b4e", + "generated_at_commit": "b6f7a7f3dd11a1eb1c98591a926e3e565c5981f7", "source_tree": "sha256:2bdda175595d2ff0ed4424af8e04f326e0c69c0bcac44151aa21771afd647cbe" } }, diff --git a/research/m15/spbm/.crumb b/research/m15/spbm/.crumb index 52b5fb51f..ad3b366bb 100644 --- a/research/m15/spbm/.crumb +++ b/research/m15/spbm/.crumb @@ -11,15 +11,40 @@ ], "extensions": { "generated": { - "children": [], - "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-14T21:46:29Z", + "children": [ + { + "digest": "ba7049fa6e6d47239f9c19a55d0c97a6997c32ca0713ee639aef381dd0c97e4b", + "last_commit": "b80b6e48", + "name": "runs/c2-20260928-01", + "purpose": "Directory research/m15/spbm/runs/c2-20260928-01. Purpose not yet described by a human." + }, + { + "digest": "75964ff2614e66f6e8b89d7275f3c108031cb7625b6dab6f191508512cb4626c", + "last_commit": "4623086f", + "name": "runs/preflight-20260928-01", + "purpose": "Directory research/m15/spbm/runs/preflight-20260928-01. Purpose not yet described by a human." + }, + { + "digest": "c9831d891a21dbc200e3296746d4e4c1aa49134c5cc5e37cb0fd651fd4d6f7c0", + "last_commit": "4623086f", + "name": "runs/preflight-20260928-02", + "purpose": "Directory research/m15/spbm/runs/preflight-20260928-02. Purpose not yet described by a human." + }, + { + "digest": "ec54fe30cc4d8bb423909e76372bb09b92c7d8d446ba4a90534fe17a0094c3c5", + "last_commit": "4623086f", + "name": "runs/preflight-20260928-03", + "purpose": "Directory research/m15/spbm/runs/preflight-20260928-03. Purpose not yet described by a human." + } + ], + "children_root": "sha256:c71e074fd21001f6a22416da7b25c6ccf24f55f1f9ec61f62905168bcd228607", + "compiled_at": "2026-10-16T19:08:36Z", "compiler": "crumb-compile/1", - "digest": "sha256:baf4a6094854fe437a8880b2c90733bbf9048212af7f7b45381db4050d8e128c", + "digest": "sha256:cc7d487eb63f35f0baa47bb0a8c93222655d4bd58b81d413093807c58ebe7a9f", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 129, - "generated_at_commit": "2a6d6d7b9091bd2184b15dcde893035dbcca40d3", + "generated_at_commit": "b6f7a7f3dd11a1eb1c98591a926e3e565c5981f7", "source_tree": "sha256:4b183d9ff80e7d0e7c8ab2925b20c1a8072ffbfa3c6d14d3c1024c1796eb3f5c" }, "owner_lane": "", diff --git a/src/.crumb b/src/.crumb index 4fe5298a4..42e354988 100644 --- a/src/.crumb +++ b/src/.crumb @@ -182,14 +182,14 @@ } ], "children_root": "sha256:15012a017b26a269feb256b64875ece2912f5f82c57804baafa3777c4fcb80b9", - "compiled_at": "2026-10-16T07:33:43Z", + "compiled_at": "2026-10-16T19:08:36Z", "compiler": "crumb-compile/1", - "digest": "sha256:dfa36de2ac8649f66f80587abea51a7f166285ee0b92e0e09774c98689055250", + "digest": "sha256:aa2a756962b2afc365533dfae935f9aae337d11f7cd7c85ba0397ca3e9d4c3c6", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 537, - "generated_at_commit": "1d481ab853a14d3c11eff926ce1e25993085f76a", - "source_tree": "sha256:200c9243151691313acb5f86d3e9cb3058f1a1b92ece2a255b3340b691dfb894" + "files": 540, + "generated_at_commit": "b6f7a7f3dd11a1eb1c98591a926e3e565c5981f7", + "source_tree": "sha256:c361e783d77e59a8903b4bc370b6a3cd9f502ca21d664df7cc19b56ba988c93e" }, "owner_lane": "", "provenance": { diff --git a/tests/.crumb b/tests/.crumb index 5887c156f..c9e395ca2 100644 --- a/tests/.crumb +++ b/tests/.crumb @@ -229,7 +229,7 @@ "purpose": "Directory tests/program. Purpose not yet described by a human." }, { - "digest": "ba0c09f67d12b5d7de906129bdbe2f6e0a228e1a34236ecc4b779c523cb2061e", + "digest": "f6d89b21e8eee52d45a45d38627562b70d91a3ff8153b5a3656257f1ae4af7e4", "last_commit": "6fdc4c33", "name": "r16_inventory", "purpose": "Directory tests/r16_inventory. Purpose not yet described by a human." @@ -295,15 +295,15 @@ "purpose": "Directory tests/visor. Purpose not yet described by a human." } ], - "children_root": "sha256:ddc3618190458bc5073e3bee67ffccc68a2ee9f065f2cb0d86545386a29fddf8", - "compiled_at": "2026-10-16T07:53:23Z", + "children_root": "sha256:0abd5cb2ec210e5d7c53afdc9563f3b4ceecc5a58a00ed4cb11f8c266ee6f284", + "compiled_at": "2026-10-16T19:08:36Z", "compiler": "crumb-compile/1", - "digest": "sha256:1fb9acb543bcc5bb34df8ff3f2bc12e5e75931b3698e8870e95a0c753dc44d87", + "digest": "sha256:330a167f7b7e86b2f503911a9853d900987c833862d23a15e60e33ccf3b2754e", "evidence_files": 16, "evidence_root": "sha256:96d08097822ad95f4e562c19e0ba5df5a035774c48632f1832912c40a27bd27a", "files": 1270, - "generated_at_commit": "4197e0bb49ad1e67d9dac37f259246470ffecedc", - "source_tree": "sha256:62a9c26a26b833178ac09a9dc02479bcd2d7d836e9f3560cc3a43afc9a60975d" + "generated_at_commit": "b6f7a7f3dd11a1eb1c98591a926e3e565c5981f7", + "source_tree": "sha256:1e2a55983734341d926e907067cdc9d5ffc01739de42f7337941ed107280c0c2" }, "owner_lane": "", "provenance": { diff --git a/tests/r16_inventory/.crumb b/tests/r16_inventory/.crumb index e69f87353..802fe78c9 100644 --- a/tests/r16_inventory/.crumb +++ b/tests/r16_inventory/.crumb @@ -13,20 +13,20 @@ "generated": { "children": [ { - "digest": "3b8ee545f13c1a168892b617671eebf2ee65413994332269f5d2f2dcf492aba7", + "digest": "6af59a55e74de68003eb6fdb730872d26605f8f6d0f937f509a48902d656d640", "last_commit": "6fdc4c33", "name": "fixture", "purpose": "Directory tests/r16_inventory/fixture. Purpose not yet described by a human." } ], - "children_root": "sha256:36bda09ce85e797adb7f7712504802354c0adb1e1fc65e0d2ebf6a252f6ee1f0", - "compiled_at": "2026-10-14T21:46:29Z", + "children_root": "sha256:b46adf544583644c50807d180382fe446edd8ff8d265cb170f657f9cc1ba0dfa", + "compiled_at": "2026-10-16T19:08:36Z", "compiler": "crumb-compile/1", - "digest": "sha256:ba0c09f67d12b5d7de906129bdbe2f6e0a228e1a34236ecc4b779c523cb2061e", + "digest": "sha256:f6d89b21e8eee52d45a45d38627562b70d91a3ff8153b5a3656257f1ae4af7e4", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 9, - "generated_at_commit": "2a6d6d7b9091bd2184b15dcde893035dbcca40d3", + "generated_at_commit": "b6f7a7f3dd11a1eb1c98591a926e3e565c5981f7", "source_tree": "sha256:c5359714281d3aee892eff6e268df24c436e97d07a5ac36ca452894067359808" }, "owner_lane": "", diff --git a/tests/r16_inventory/fixture/.crumb b/tests/r16_inventory/fixture/.crumb index 74db6babe..4971983b2 100644 --- a/tests/r16_inventory/fixture/.crumb +++ b/tests/r16_inventory/fixture/.crumb @@ -28,6 +28,36 @@ "extensions": { "generated": { "children": [ + { + "digest": "17abb748e3744726d474d8cf58493ab1ff69c8666fbc206602bb3de696c3b2a5", + "last_commit": "6fdc4c33", + "name": "aegis-runtime/src", + "purpose": "Directory tests/r16_inventory/fixture/aegis-runtime/src. Purpose not yet described by a human." + }, + { + "digest": "dd502fb6702ceeee2e94f977b468c6aad84ed3be8c84270e99bd2c0d8d0e458a", + "last_commit": "6fdc4c33", + "name": "aien-sovereign-core/src", + "purpose": "Directory tests/r16_inventory/fixture/aien-sovereign-core/src. Purpose not yet described by a hu" + }, + { + "digest": "5d9ff20385cf5f9815af835ed9b8570c8420ea361881055cf7f5551de9ff0226", + "last_commit": "6fdc4c33", + "name": "aienos/src", + "purpose": "Directory tests/r16_inventory/fixture/aienos/src. Purpose not yet described by a human." + }, + { + "digest": "a2e33609182947dc2854c5c9f6f1cbf42b6c72173e1e9030c4d7775de98a348b", + "last_commit": "6fdc4c33", + "name": "omega/src", + "purpose": "Directory tests/r16_inventory/fixture/omega/src. Purpose not yet described by a human." + }, + { + "digest": "9fa71756e80a0d5dbe92789ba2cc0221f643fb0a900b4725d72da75e8080787a", + "last_commit": "6fdc4c33", + "name": "omega/tools", + "purpose": "Directory tests/r16_inventory/fixture/omega/tools. Purpose not yet described by a human." + }, { "digest": "9bfb0d9ca42bc56414db9d1842488e657e7163a3804e9c82c4c5a6629cf94399", "last_commit": "6fdc4c33", @@ -35,14 +65,14 @@ "purpose": "Directory tests/r16_inventory/fixture/physics. Purpose not yet described by a human." } ], - "children_root": "sha256:a7d5f146d5c99c75701c8f384732dbdf7158a8fcd7295d0c0761c1e84d2c4e9d", - "compiled_at": "2026-10-14T21:46:29Z", + "children_root": "sha256:1af8057189e2525c3642ad11f0cb41ba41a943874bb3182c25fbeeafe8bd0318", + "compiled_at": "2026-10-16T19:08:36Z", "compiler": "crumb-compile/1", - "digest": "sha256:3b8ee545f13c1a168892b617671eebf2ee65413994332269f5d2f2dcf492aba7", + "digest": "sha256:6af59a55e74de68003eb6fdb730872d26605f8f6d0f937f509a48902d656d640", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 8, - "generated_at_commit": "2a6d6d7b9091bd2184b15dcde893035dbcca40d3", + "generated_at_commit": "b6f7a7f3dd11a1eb1c98591a926e3e565c5981f7", "source_tree": "sha256:be8537e95e5ed29a32f2e6267c290f8b999a1537c3dd5c7e4f691791eabb74b6" }, "owner_lane": "", From 2f4672e0dece9ebef2475838c23b3c193cde3de3 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Fri, 16 Oct 2026 15:31:54 -0500 Subject: [PATCH 10/10] crumb: recompile (tool @ d0f0b95d) Co-Authored-By: Claude Opus 5.5 --- .crumb | 22 +++++++---------- calibration/.crumb | 20 ++++------------ docs/.crumb | 10 ++++---- docs/estimation/.crumb | 26 ++++---------------- research/.crumb | 28 ++++------------------ research/atemporal/.crumb | 26 ++++---------------- research/m15/spbm/.crumb | 35 ++++----------------------- tests/.crumb | 10 ++++---- tests/r16_inventory/.crumb | 10 ++++---- tests/r16_inventory/fixture/.crumb | 38 ++++-------------------------- 10 files changed, 49 insertions(+), 176 deletions(-) diff --git a/.crumb b/.crumb index 4e429d789..d0ba3d2fd 100644 --- a/.crumb +++ b/.crumb @@ -41,19 +41,13 @@ "generated": { "children": [ { - "digest": "9dd7474de3f8342f85466d4629e58ebe6a7e9be694f6f282803892d32f9c272f", - "last_commit": "5901baa5", - "name": "bench/prime_race", - "purpose": "AIEN Prime Drag Race implementation side: the shared protocol helper (command line, timed loop, " - }, - { - "digest": "3f2f29e905246ceb0b8778e1392f090ac93c949f89a139da0bd77b520946f30c", + "digest": "fb7cc6e608fdbe68a9735a1313285782b9717ff12bde17343f8ce635de3644f6", "last_commit": "190ff891", "name": "calibration", "purpose": "Directory calibration. Purpose not yet described by a human." }, { - "digest": "49f12a6fe70d5309b3651b14122809ece58a18d80bc4188aa3f557a4354434c4", + "digest": "d2eb8967a939ebdb0b54e15fe5d849dd5af71c23b812941e4ba86ad2b0f21d39", "last_commit": "4870b0a4", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." @@ -71,7 +65,7 @@ "purpose": "Directory mk. Purpose not yet described by a human." }, { - "digest": "e1b329e45619370357f74f738cc24e6091c9139e9db8e95e324d12955acf3ffa", + "digest": "eccc4aec1037ae222d6370836953732b031b8ed70de28967b7af7ca62c2abe0b", "last_commit": "5901baa5", "name": "research", "purpose": "Directory research. Purpose not yet described by a human." @@ -89,7 +83,7 @@ "purpose": "Directory src. Purpose not yet described by a human." }, { - "digest": "330a167f7b7e86b2f503911a9853d900987c833862d23a15e60e33ccf3b2754e", + "digest": "392d42cef45d31a5a27b58fa82d1ef89594ba9db17f3bcb973777119b2f97986", "last_commit": "2f655fbf", "name": "tests", "purpose": "Directory tests. Purpose not yet described by a human." @@ -101,14 +95,14 @@ "purpose": "Directory tools. Purpose not yet described by a human." } ], - "children_root": "sha256:efa6b658dcf9a8f32203b8bd403af067a999c0b69c94caa540f381218676046b", - "compiled_at": "2026-10-16T19:08:36Z", + "children_root": "sha256:ad43fe7ac833928d1cf09e0b8a22f3f5048748e7d78eb1d3dae3bcffe9b4c14e", + "compiled_at": "2026-10-16T20:31:51Z", "compiler": "crumb-compile/1", - "digest": "sha256:1dc94f2e59335b5553b7d9c93224a849213e427ac6ae276fe9a18ba5d8fcc010", + "digest": "sha256:fccbf6f324d7bf226b48c8928819ee6f0147f79b70808ec446a2b506f6da0cf1", "evidence_files": 11127, "evidence_root": "sha256:4528085ec1661c442b64fb5dc8def65067ea2620ff88e42bcf52d58b7642ea6e", "files": 14112, - "generated_at_commit": "b6f7a7f3dd11a1eb1c98591a926e3e565c5981f7", + "generated_at_commit": "05d0d8e9ab225dba82698bf89128072f3a6f3a7a", "source_tree": "sha256:120f9833a6157832d67609a0b5753b49eca7f3b91cf988bed4cda46eed28a7b1" }, "owner_lane": "", diff --git a/calibration/.crumb b/calibration/.crumb index eb5314853..79ce4b629 100644 --- a/calibration/.crumb +++ b/calibration/.crumb @@ -38,18 +38,6 @@ "name": "docs", "purpose": "Directory calibration/docs. Purpose not yet described by a human." }, - { - "digest": "1cfc0113fa05f78ebe448d6e09d205399b96d4d7381299e9b8eff508304a34ac", - "last_commit": "d5c97ce9", - "name": "experiments/EXP-001", - "purpose": "Directory calibration/experiments/EXP-001. Purpose not yet described by a human." - }, - { - "digest": "9c1f1bbe230c6ecdac42dbcaa60c5d757470499349dd7cb1124baa45be183ae8", - "last_commit": "190ff891", - "name": "experiments/EXP-001R", - "purpose": "Directory calibration/experiments/EXP-001R. Purpose not yet described by a human." - }, { "digest": "6b36741c5f34a363b7e8cd3c29f8b3f0d43acbb3c2cddd3f5b9ebbade3f85d25", "last_commit": "1cff5260", @@ -75,14 +63,14 @@ "purpose": "Directory calibration/scripts. Purpose not yet described by a human." } ], - "children_root": "sha256:3beb3c97b6608f6ccb9b9b84892f708e896bd013f4f5d17afa107a29555a045d", - "compiled_at": "2026-10-16T19:08:36Z", + "children_root": "sha256:e58b9cc78de81a51c7ed21c725616ddb80bd3d24d171b24a189e8f7132499433", + "compiled_at": "2026-10-16T20:31:51Z", "compiler": "crumb-compile/1", - "digest": "sha256:3f2f29e905246ceb0b8778e1392f090ac93c949f89a139da0bd77b520946f30c", + "digest": "sha256:fb7cc6e608fdbe68a9735a1313285782b9717ff12bde17343f8ce635de3644f6", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 110, - "generated_at_commit": "b6f7a7f3dd11a1eb1c98591a926e3e565c5981f7", + "generated_at_commit": "05d0d8e9ab225dba82698bf89128072f3a6f3a7a", "source_tree": "sha256:b39f40915ce2ed4092ade2a38665d99f6daab78fd462433177cdd0aec5f00bd7" }, "owner_lane": "", diff --git a/docs/.crumb b/docs/.crumb index e2ac91dc8..a6e043aa4 100644 --- a/docs/.crumb +++ b/docs/.crumb @@ -75,7 +75,7 @@ "purpose": "DUAL (ARCH-0031) documents in omega: applicability experiment method and findings (APPLICABILITY" }, { - "digest": "1c554227f29c8c6d4f81ca2a5f5380d3646c8c925f4ab0248df73f88138f5432", + "digest": "56a5a999ce726e90d89c1c88b9e20c81857c8e6ee82af8d651ac80ea70e2c46d", "last_commit": "38a6a569", "name": "estimation", "purpose": "Directory docs/estimation. Purpose not yet described by a human." @@ -123,14 +123,14 @@ "purpose": "Directory docs/turing. Purpose not yet described by a human." } ], - "children_root": "sha256:824d03b6fb7cef707314190e6f66c9de4934f6d67b3fa61cd9d65f8eb614e76c", - "compiled_at": "2026-10-16T19:08:36Z", + "children_root": "sha256:ac7f7ea4b00d4620a993c6dd88a0267f2d49008d415162976e45fa4341e43407", + "compiled_at": "2026-10-16T20:31:51Z", "compiler": "crumb-compile/1", - "digest": "sha256:49f12a6fe70d5309b3651b14122809ece58a18d80bc4188aa3f557a4354434c4", + "digest": "sha256:d2eb8967a939ebdb0b54e15fe5d849dd5af71c23b812941e4ba86ad2b0f21d39", "evidence_files": 34, "evidence_root": "sha256:589d8b3706e6d7a202ab20b278dac5fc5bafc973f1c2a867b2668aa7210b65cc", "files": 127, - "generated_at_commit": "b6f7a7f3dd11a1eb1c98591a926e3e565c5981f7", + "generated_at_commit": "05d0d8e9ab225dba82698bf89128072f3a6f3a7a", "source_tree": "sha256:29d159b6950500f96de859834fd2c5a9e9ba037f9bc88fd97a8ed47a1688233b" }, "owner_lane": "", diff --git a/docs/estimation/.crumb b/docs/estimation/.crumb index beac278f8..251c4cc79 100644 --- a/docs/estimation/.crumb +++ b/docs/estimation/.crumb @@ -16,24 +16,6 @@ "extensions": { "generated": { "children": [ - { - "digest": "544a350adaaed15c87a8006c1ac1be87eda1b7f4493e07bf1e6a0d88b4ab65de", - "last_commit": "f6390e88", - "name": "receipts/est23-v1", - "purpose": "Directory docs/estimation/receipts/est23-v1. Purpose not yet described by a human." - }, - { - "digest": "67bc1848d22db1ef3a2db67a370ea75cd826da2788312f91419dcff93b222d92", - "last_commit": "8a56ace6", - "name": "receipts/est23-v2", - "purpose": "Directory docs/estimation/receipts/est23-v2. Purpose not yet described by a human." - }, - { - "digest": "fbbca721bf11b2fcf5727fab4d703c908e8b6835bce7c749645f0af42db15da9", - "last_commit": "d43a5df8", - "name": "receipts/est3c-v3", - "purpose": "Directory docs/estimation/receipts/est3c-v3. Purpose not yet described by a human." - }, { "digest": "09ae7f9b04e4639bc444223a5566e755c4eadcd517cc57a95a454e9f27c34edf", "last_commit": "f6390e88", @@ -41,14 +23,14 @@ "purpose": "Directory docs/estimation/reviews. Purpose not yet described by a human." } ], - "children_root": "sha256:d7a9f4bca5e0308c1f3877832d8e5c6b10ca5a09d5c65e8c6c96e2bbaef50871", - "compiled_at": "2026-10-16T19:08:36Z", + "children_root": "sha256:35cd3af03e079556db7f3ebcfd7590fa68659e84dd603795ae6b5b048dc2af0d", + "compiled_at": "2026-10-16T20:31:51Z", "compiler": "crumb-compile/1", - "digest": "sha256:1c554227f29c8c6d4f81ca2a5f5380d3646c8c925f4ab0248df73f88138f5432", + "digest": "sha256:56a5a999ce726e90d89c1c88b9e20c81857c8e6ee82af8d651ac80ea70e2c46d", "evidence_files": 34, "evidence_root": "sha256:589d8b3706e6d7a202ab20b278dac5fc5bafc973f1c2a867b2668aa7210b65cc", "files": 47, - "generated_at_commit": "b6f7a7f3dd11a1eb1c98591a926e3e565c5981f7", + "generated_at_commit": "05d0d8e9ab225dba82698bf89128072f3a6f3a7a", "source_tree": "sha256:67ae8d20aca3ae36b8cf0d75c6939058cc9ff8762c977f70d6963c545e3215d8" }, "owner_lane": "", diff --git a/research/.crumb b/research/.crumb index c2d64ccc2..b2b356140 100644 --- a/research/.crumb +++ b/research/.crumb @@ -21,7 +21,7 @@ "generated": { "children": [ { - "digest": "8aba4c878c9f6317ef666b9795182fe9fb58661b9fe5eefdd0cd786bfb15b39d", + "digest": "fce91110a9847be58e4068fc9c24497369672f3f60ca6c7deb5b0699df0e045c", "last_commit": "5901baa5", "name": "atemporal", "purpose": "AT-0 Clock-Free Universe research program: relational (Page-Wootters) quantum models with no ext" @@ -31,34 +31,16 @@ "last_commit": "458c57f5", "name": "dirac-oracle", "purpose": "Directory research/dirac-oracle. Purpose not yet described by a human." - }, - { - "digest": "7ca182d0a6bd90801e4386c4627ac58965e0aa2b381e49bb6c5e0d2226ace248", - "last_commit": "72c0c39b", - "name": "m15/pmu", - "purpose": "Directory research/m15/pmu. Purpose not yet described by a human." - }, - { - "digest": "cc7d487eb63f35f0baa47bb0a8c93222655d4bd58b81d413093807c58ebe7a9f", - "last_commit": "559f6e5d", - "name": "m15/spbm", - "purpose": "Directory research/m15/spbm. Purpose not yet described by a human." - }, - { - "digest": "db23aeba4580239d67e68e3fadc064d5bd06570da99c3e97ac6b0d3347ae24a3", - "last_commit": "65c64a3e", - "name": "r14-failure-modes/exact-20260928-130858", - "purpose": "Directory research/r14-failure-modes/exact-20260928-130858. Purpose not yet described by a human" } ], - "children_root": "sha256:6003088071f523982b1e9abf3de083176cce8538444ec586da28ca1e79cecb2c", - "compiled_at": "2026-10-16T19:08:36Z", + "children_root": "sha256:47fde1e530a64eb6f5fbecb27fddf6335c32069f1acb4de243826d601361a138", + "compiled_at": "2026-10-16T20:31:51Z", "compiler": "crumb-compile/1", - "digest": "sha256:e1b329e45619370357f74f738cc24e6091c9139e9db8e95e324d12955acf3ffa", + "digest": "sha256:eccc4aec1037ae222d6370836953732b031b8ed70de28967b7af7ca62c2abe0b", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 538, - "generated_at_commit": "b6f7a7f3dd11a1eb1c98591a926e3e565c5981f7", + "generated_at_commit": "05d0d8e9ab225dba82698bf89128072f3a6f3a7a", "source_tree": "sha256:2c362ea1c5900e78486cbe9cfc017bd87b53ab97bd93317cd9be0efb6923d9ea" }, "owner_lane": "", diff --git a/research/atemporal/.crumb b/research/atemporal/.crumb index 72fc8d310..18b99f07d 100644 --- a/research/atemporal/.crumb +++ b/research/atemporal/.crumb @@ -7,34 +7,16 @@ "last_commit": "bacc4b6b", "name": "at0", "purpose": "AT-0 V1: finite clock plus one qubit under the AT0_CASE_V1 / AT0_RESULT_V1 contracts" - }, - { - "digest": "d7472188cc921c2fcedb227495a6fdad3ea575761615f762d37c7703e5ed002b", - "last_commit": "59d3a014", - "name": "at1/evaluator", - "purpose": "AT-1 Agent 4 adversarial evaluator: independent AT1_CASE_V1 codec, exact-arithmetic AT1_RESULT_V" - }, - { - "digest": "163aa7e6fb222ba8c8a9c66a289258e44ccc3ec016721600c6a9587c480a3882", - "last_commit": "c02b278c", - "name": "at1/integration", - "purpose": "AT-1 Agent 5 integration runner (run.sh), engine and oracle shims for the evaluator, contract pi" - }, - { - "digest": "3eb2d35ebbc48ad49b2866922fe1fc5665b0334087412bc55bae4a7c3ff2faaf", - "last_commit": "f2b9e33f", - "name": "at1/oracle", - "purpose": "AT-1 reference oracle (Rust, standard library only, built by rustc directly; research cross-chec" } ], - "children_root": "sha256:0c3ae36eaf8728c9af97c1a39f90c41b8839ac33c51dbc76b58b94b8ecacb562", - "compiled_at": "2026-10-16T19:08:36Z", + "children_root": "sha256:f7bd1d7019a69ef57140cd019f86634f3cb80c1e31ca3063dfdf73ac9deef7c6", + "compiled_at": "2026-10-16T20:31:51Z", "compiler": "crumb-compile/1", - "digest": "sha256:8aba4c878c9f6317ef666b9795182fe9fb58661b9fe5eefdd0cd786bfb15b39d", + "digest": "sha256:fce91110a9847be58e4068fc9c24497369672f3f60ca6c7deb5b0699df0e045c", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 392, - "generated_at_commit": "b6f7a7f3dd11a1eb1c98591a926e3e565c5981f7", + "generated_at_commit": "05d0d8e9ab225dba82698bf89128072f3a6f3a7a", "source_tree": "sha256:2bdda175595d2ff0ed4424af8e04f326e0c69c0bcac44151aa21771afd647cbe" } }, diff --git a/research/m15/spbm/.crumb b/research/m15/spbm/.crumb index ad3b366bb..00df50a9e 100644 --- a/research/m15/spbm/.crumb +++ b/research/m15/spbm/.crumb @@ -11,40 +11,15 @@ ], "extensions": { "generated": { - "children": [ - { - "digest": "ba7049fa6e6d47239f9c19a55d0c97a6997c32ca0713ee639aef381dd0c97e4b", - "last_commit": "b80b6e48", - "name": "runs/c2-20260928-01", - "purpose": "Directory research/m15/spbm/runs/c2-20260928-01. Purpose not yet described by a human." - }, - { - "digest": "75964ff2614e66f6e8b89d7275f3c108031cb7625b6dab6f191508512cb4626c", - "last_commit": "4623086f", - "name": "runs/preflight-20260928-01", - "purpose": "Directory research/m15/spbm/runs/preflight-20260928-01. Purpose not yet described by a human." - }, - { - "digest": "c9831d891a21dbc200e3296746d4e4c1aa49134c5cc5e37cb0fd651fd4d6f7c0", - "last_commit": "4623086f", - "name": "runs/preflight-20260928-02", - "purpose": "Directory research/m15/spbm/runs/preflight-20260928-02. Purpose not yet described by a human." - }, - { - "digest": "ec54fe30cc4d8bb423909e76372bb09b92c7d8d446ba4a90534fe17a0094c3c5", - "last_commit": "4623086f", - "name": "runs/preflight-20260928-03", - "purpose": "Directory research/m15/spbm/runs/preflight-20260928-03. Purpose not yet described by a human." - } - ], - "children_root": "sha256:c71e074fd21001f6a22416da7b25c6ccf24f55f1f9ec61f62905168bcd228607", - "compiled_at": "2026-10-16T19:08:36Z", + "children": [], + "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "compiled_at": "2026-10-16T20:31:51Z", "compiler": "crumb-compile/1", - "digest": "sha256:cc7d487eb63f35f0baa47bb0a8c93222655d4bd58b81d413093807c58ebe7a9f", + "digest": "sha256:baf4a6094854fe437a8880b2c90733bbf9048212af7f7b45381db4050d8e128c", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 129, - "generated_at_commit": "b6f7a7f3dd11a1eb1c98591a926e3e565c5981f7", + "generated_at_commit": "05d0d8e9ab225dba82698bf89128072f3a6f3a7a", "source_tree": "sha256:4b183d9ff80e7d0e7c8ab2925b20c1a8072ffbfa3c6d14d3c1024c1796eb3f5c" }, "owner_lane": "", diff --git a/tests/.crumb b/tests/.crumb index c9e395ca2..f46cd099a 100644 --- a/tests/.crumb +++ b/tests/.crumb @@ -229,7 +229,7 @@ "purpose": "Directory tests/program. Purpose not yet described by a human." }, { - "digest": "f6d89b21e8eee52d45a45d38627562b70d91a3ff8153b5a3656257f1ae4af7e4", + "digest": "ba0c09f67d12b5d7de906129bdbe2f6e0a228e1a34236ecc4b779c523cb2061e", "last_commit": "6fdc4c33", "name": "r16_inventory", "purpose": "Directory tests/r16_inventory. Purpose not yet described by a human." @@ -295,14 +295,14 @@ "purpose": "Directory tests/visor. Purpose not yet described by a human." } ], - "children_root": "sha256:0abd5cb2ec210e5d7c53afdc9563f3b4ceecc5a58a00ed4cb11f8c266ee6f284", - "compiled_at": "2026-10-16T19:08:36Z", + "children_root": "sha256:ddc3618190458bc5073e3bee67ffccc68a2ee9f065f2cb0d86545386a29fddf8", + "compiled_at": "2026-10-16T20:31:51Z", "compiler": "crumb-compile/1", - "digest": "sha256:330a167f7b7e86b2f503911a9853d900987c833862d23a15e60e33ccf3b2754e", + "digest": "sha256:392d42cef45d31a5a27b58fa82d1ef89594ba9db17f3bcb973777119b2f97986", "evidence_files": 16, "evidence_root": "sha256:96d08097822ad95f4e562c19e0ba5df5a035774c48632f1832912c40a27bd27a", "files": 1270, - "generated_at_commit": "b6f7a7f3dd11a1eb1c98591a926e3e565c5981f7", + "generated_at_commit": "05d0d8e9ab225dba82698bf89128072f3a6f3a7a", "source_tree": "sha256:1e2a55983734341d926e907067cdc9d5ffc01739de42f7337941ed107280c0c2" }, "owner_lane": "", diff --git a/tests/r16_inventory/.crumb b/tests/r16_inventory/.crumb index 802fe78c9..5312658da 100644 --- a/tests/r16_inventory/.crumb +++ b/tests/r16_inventory/.crumb @@ -13,20 +13,20 @@ "generated": { "children": [ { - "digest": "6af59a55e74de68003eb6fdb730872d26605f8f6d0f937f509a48902d656d640", + "digest": "3b8ee545f13c1a168892b617671eebf2ee65413994332269f5d2f2dcf492aba7", "last_commit": "6fdc4c33", "name": "fixture", "purpose": "Directory tests/r16_inventory/fixture. Purpose not yet described by a human." } ], - "children_root": "sha256:b46adf544583644c50807d180382fe446edd8ff8d265cb170f657f9cc1ba0dfa", - "compiled_at": "2026-10-16T19:08:36Z", + "children_root": "sha256:36bda09ce85e797adb7f7712504802354c0adb1e1fc65e0d2ebf6a252f6ee1f0", + "compiled_at": "2026-10-16T20:31:51Z", "compiler": "crumb-compile/1", - "digest": "sha256:f6d89b21e8eee52d45a45d38627562b70d91a3ff8153b5a3656257f1ae4af7e4", + "digest": "sha256:ba0c09f67d12b5d7de906129bdbe2f6e0a228e1a34236ecc4b779c523cb2061e", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 9, - "generated_at_commit": "b6f7a7f3dd11a1eb1c98591a926e3e565c5981f7", + "generated_at_commit": "05d0d8e9ab225dba82698bf89128072f3a6f3a7a", "source_tree": "sha256:c5359714281d3aee892eff6e268df24c436e97d07a5ac36ca452894067359808" }, "owner_lane": "", diff --git a/tests/r16_inventory/fixture/.crumb b/tests/r16_inventory/fixture/.crumb index 4971983b2..7dca9e9c7 100644 --- a/tests/r16_inventory/fixture/.crumb +++ b/tests/r16_inventory/fixture/.crumb @@ -28,36 +28,6 @@ "extensions": { "generated": { "children": [ - { - "digest": "17abb748e3744726d474d8cf58493ab1ff69c8666fbc206602bb3de696c3b2a5", - "last_commit": "6fdc4c33", - "name": "aegis-runtime/src", - "purpose": "Directory tests/r16_inventory/fixture/aegis-runtime/src. Purpose not yet described by a human." - }, - { - "digest": "dd502fb6702ceeee2e94f977b468c6aad84ed3be8c84270e99bd2c0d8d0e458a", - "last_commit": "6fdc4c33", - "name": "aien-sovereign-core/src", - "purpose": "Directory tests/r16_inventory/fixture/aien-sovereign-core/src. Purpose not yet described by a hu" - }, - { - "digest": "5d9ff20385cf5f9815af835ed9b8570c8420ea361881055cf7f5551de9ff0226", - "last_commit": "6fdc4c33", - "name": "aienos/src", - "purpose": "Directory tests/r16_inventory/fixture/aienos/src. Purpose not yet described by a human." - }, - { - "digest": "a2e33609182947dc2854c5c9f6f1cbf42b6c72173e1e9030c4d7775de98a348b", - "last_commit": "6fdc4c33", - "name": "omega/src", - "purpose": "Directory tests/r16_inventory/fixture/omega/src. Purpose not yet described by a human." - }, - { - "digest": "9fa71756e80a0d5dbe92789ba2cc0221f643fb0a900b4725d72da75e8080787a", - "last_commit": "6fdc4c33", - "name": "omega/tools", - "purpose": "Directory tests/r16_inventory/fixture/omega/tools. Purpose not yet described by a human." - }, { "digest": "9bfb0d9ca42bc56414db9d1842488e657e7163a3804e9c82c4c5a6629cf94399", "last_commit": "6fdc4c33", @@ -65,14 +35,14 @@ "purpose": "Directory tests/r16_inventory/fixture/physics. Purpose not yet described by a human." } ], - "children_root": "sha256:1af8057189e2525c3642ad11f0cb41ba41a943874bb3182c25fbeeafe8bd0318", - "compiled_at": "2026-10-16T19:08:36Z", + "children_root": "sha256:a7d5f146d5c99c75701c8f384732dbdf7158a8fcd7295d0c0761c1e84d2c4e9d", + "compiled_at": "2026-10-16T20:31:51Z", "compiler": "crumb-compile/1", - "digest": "sha256:6af59a55e74de68003eb6fdb730872d26605f8f6d0f937f509a48902d656d640", + "digest": "sha256:3b8ee545f13c1a168892b617671eebf2ee65413994332269f5d2f2dcf492aba7", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 8, - "generated_at_commit": "b6f7a7f3dd11a1eb1c98591a926e3e565c5981f7", + "generated_at_commit": "05d0d8e9ab225dba82698bf89128072f3a6f3a7a", "source_tree": "sha256:be8537e95e5ed29a32f2e6267c290f8b999a1537c3dd5c7e4f691791eabb74b6" }, "owner_lane": "",