Run frontier MoE models on hardware you already own β pure C, zero deps, experts streamed from disk. Tiny engine, immense model. π¦
C
tests: include compat.h directly in the converted tests
texasich50f9ee903991
diff --git a/c/tests/bench_inkling_shared_batch.c b/c/tests/bench_inkling_shared_batch.cindex e7a22a8b..7ca6094e 100644--- a/c/tests/bench_inkling_shared_batch.c+++ b/c/tests/bench_inkling_shared_batch.c@@ -11,6 +11,8 @@#include "../inkling.c"#undef main+#include "../compat.h" /* setenv/unsetenv: MinGW has neither */+enum { S = 16, D = 2048, I = 1024, K = 2, NS = 2, REPS = 3 };static uint16_t to_bf16(float x) {diff --git a/c/tests/bench_qwen36_dense_batch.c b/c/tests/bench_qwen36_dense_batch.cindex 8d490ed4..63f0fc22 100644--- a/c/tests/bench_qwen36_dense_batch.c+++ b/c/tests/bench_qwen36_dense_batch.c@@ -9,6 +9,8 @@#include "../qwen36.c"#undef main+#include "../compat.h" /* setenv/unsetenv: MinGW has neither */+enum { S=16, I=2048, O=512, REPS=7 };static float value(int64_t i, int salt) {diff --git a/c/tests/test_inkling_shared_batch.c b/c/tests/test_inkling_shared_batch.cindex 505e2af2..7204abaf 100644--- a/c/tests/test_inkling_shared_batch.c+++ b/c/tests/test_inkling_shared_batch.c@@ -8,6 +8,8 @@#include "../inkling.c"#undef main+#include "../compat.h" /* setenv/unsetenv: MinGW has neither */+static int failures;#define CHECK(cond, ...) do { if (!(cond)) { \fprintf(stderr,"FAIL %s:%d: ",__FILE__,__LINE__); \diff --git a/c/tests/test_qwen36_ctx.c b/c/tests/test_qwen36_ctx.cindex 7b679532..8a906ed3 100644--- a/c/tests/test_qwen36_ctx.c+++ b/c/tests/test_qwen36_ctx.c@@ -21,6 +21,8 @@#include "../qwen36.c"#undef main+#include "../compat.h" /* setenv/unsetenv: MinGW has neither */+static int fails = 0;static void ck(int cond, const char *what) {diff --git a/c/tests/test_qwen36_dense_batch.c b/c/tests/test_qwen36_dense_batch.cindex 9873e4bd..69288725 100644--- a/c/tests/test_qwen36_dense_batch.c+++ b/c/tests/test_qwen36_dense_batch.c@@ -7,6 +7,8 @@#include "../qwen36.c"#undef main+#include "../compat.h" /* setenv/unsetenv: MinGW has neither */+static int failures;#define CHECK(cond, ...) do { if (!(cond)) { \fprintf(stderr,"FAIL %s:%d: ",__FILE__,__LINE__); \diff --git a/c/tests/test_qwen36_tier_int8_decode.c b/c/tests/test_qwen36_tier_int8_decode.cindex 8f989200..7a71795f 100644--- a/c/tests/test_qwen36_tier_int8_decode.c+++ b/c/tests/test_qwen36_tier_int8_decode.c@@ -33,6 +33,8 @@#include "../qwen36.c"#undef main+#include "../compat.h" /* setenv/unsetenv: MinGW has neither */+#include "qwen36_fake_cuda.h"#include "../qwen36_tier.c"diff --git a/c/tests/test_qwen36_tier_int8_engine.c b/c/tests/test_qwen36_tier_int8_engine.cindex c2f1c6a6..f08f4036 100644--- a/c/tests/test_qwen36_tier_int8_engine.c+++ b/c/tests/test_qwen36_tier_int8_engine.c@@ -31,6 +31,8 @@#include "../qwen36.c"#undef main+#include "../compat.h" /* setenv/unsetenv: MinGW has neither */+#include "qwen36_fake_cuda.h"#include "../qwen36_tier.c"diff --git a/c/tests/test_route_trace.c b/c/tests/test_route_trace.cindex 4fd34118..2dcdb565 100644--- a/c/tests/test_route_trace.c+++ b/c/tests/test_route_trace.c@@ -9,10 +9,12 @@* easy to break by "tidying" the header into a comment line or moving the engine hash* into the second field, so it is asserted here against a literal copy of that loop.*- * This test includes route_trace.h and nothing else: no Model, no Cfg, no st.h. That is- * the point of the header β any engine can use it β and compiling this file proves it. */+ * This test includes route_trace.h (plus compat.h) and nothing else: no Model, no Cfg, no st.h.+ * That is the point of the header β any engine can use it β and compiling this file proves it. */#include "../route_trace.h"+#include "../compat.h" /* setenv/unsetenv: MinGW has neither */+static int g_nfails = 0;static void check(int cond, const char *what){if(!cond){ printf("FAIL: %s\n", what); g_nfails++; }diff --git a/c/tests/test_stops.c b/c/tests/test_stops.cindex ad4e7d78..debaf6ff 100644--- a/c/tests/test_stops.c+++ b/c/tests/test_stops.c@@ -23,6 +23,8 @@#include "../colibri.c"#undef main+#include "../compat.h" /* setenv/unsetenv: MinGW has neither */+static const char *TOKJSON ="{\"model\":{\"vocab\":{\"a\":0,\"b\":1,\"c\":2},\"merges\":[[\"a\",\"b\"]]},"" \"added_tokens\":["