diff --git a/.crumb b/.crumb index 273408206..cf4510f6d 100644 --- a/.crumb +++ b/.crumb @@ -42,13 +42,13 @@ "children": [ { "digest": "9f19f11674ca5dfc3c9c3ae35fe6106557aee9583210da13d257e1b9d88e052c", - "last_commit": "dc7c1304", + "last_commit": "190ff891", "name": "calibration", "purpose": "Directory calibration. Purpose not yet described by a human." }, { "digest": "2ff2b8f9b497473c444c34383857d29a5ad45a55c274141321d98d608475b97e", - "last_commit": "dc7c1304", + "last_commit": "4870b0a4", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." }, @@ -66,7 +66,7 @@ }, { "digest": "590f1f3a26a12dfd9df281ec944b882b85fd4ac2ae07a88a03bb8bd0d7d62536", - "last_commit": "dc7c1304", + "last_commit": "5901baa5", "name": "research", "purpose": "Directory research. Purpose not yet described by a human." }, @@ -77,33 +77,33 @@ "purpose": "Directory spec. Purpose not yet described by a human." }, { - "digest": "7208b7c84c3cfde224b9d055d0754bc493b240cf0f5a93b96ae405686534783e", - "last_commit": "dc7c1304", + "digest": "2f3fedc677197553bcde41b2ca743c08d175f2f6647e22aaf44ed4ebe34a9d6a", + "last_commit": "c4e01be9", "name": "src", "purpose": "Directory src. Purpose not yet described by a human." }, { - "digest": "1ea94f184a37ca1ca165b6418a9c06785a540dac27b4b1e63fffe06ef4ca496e", - "last_commit": "dc7c1304", + "digest": "d6af28f655ad59a2ad7830e84062cfb476a35dfbe2b07f10e054c621891cdbd0", + "last_commit": "649693b5", "name": "tests", "purpose": "Directory tests. Purpose not yet described by a human." }, { "digest": "1404d3f510dde3affb3153fad5276a4d81f6886f07fd51fd0cf147bf91a051fb", - "last_commit": "dc7c1304", + "last_commit": "88e24bdd", "name": "tools", "purpose": "Directory tools. Purpose not yet described by a human." } ], - "children_root": "sha256:ae62f2bbbc87b2dee06d9445f4b67f92c52114c1349ca42dcf3a1b866f9df8a3", - "compiled_at": "2026-10-24T04:15:18Z", + "children_root": "sha256:af4f7e8fd020a19ffc1b3a20412ec482d4ddc33a7a81c50f2a69b99d313927a5", + "compiled_at": "2026-10-24T06:25:54Z", "compiler": "crumb-compile/1", - "digest": "sha256:66c54072d2713c85d5cbffe12ab7b654c7e25a94f695f02d23fbe73b21214559", + "digest": "sha256:53b630ee7ad67a94c4dd75c79e5d48419038c1e7dc381ab365e1345ae3dfed7b", "evidence_files": 11127, "evidence_root": "sha256:4528085ec1661c442b64fb5dc8def65067ea2620ff88e42bcf52d58b7642ea6e", "files": 14101, - "generated_at_commit": "dc7c1304c038f49db3b121d5a5e27d7bcab5bf6c", - "source_tree": "sha256:824e3a90b89de1651be6bfafb18e8b714e3ed49f7b06e86517ab9a09108d7329" + "generated_at_commit": "acf9a7219349ea7010bfb9cad7fa4af068bf77e2", + "source_tree": "sha256:b5bcb67a9ba6699b7e1fc7d65f92aae201ab29f08a86015459d7819f2507c465" }, "owner_lane": "", "provenance": { diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 47ff40719..bd1fd4ab9 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -11,6 +11,7 @@ Every model below did real work. A model is listed only for work it did. The orc | Gemini 3.8 Flash | Code review of the numeric changes (patch checks, qualifier script, build rules) | | Codex | Numeric uncertain-completion retention, exact completion checks, and simulated-driver lifecycle regression tests | | Claude Opus 5.5 | Ionic-droplet reservoir (#440): pinned reference, CPU simulator and readout, `.mat` reader, Gate 2 comparison, benchmarks, timing and receipt | +| Codex (GPT-6 Astra Pro) | PR #515 integration with current main, generated Crumb conflict resolution with the pinned tool, and host syntax and build review; Spark qualification remains pending | This table starts with the numeric work on this branch. Earlier work in this repository is not yet attributed here; add rows only for work that can be traced to a model. diff --git a/Makefile b/Makefile index 3551fea3f..c1676281f 100644 --- a/Makefile +++ b/Makefile @@ -2470,6 +2470,7 @@ $(GPU_FP8_TEST): tests/gpu_fp8_api_test.c tests/bw_warp_sim.h src/omega_gpu_fp8_ $(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_fp8_api_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm test-gpu-fp8: $(GPU_FP8_TEST) ./$(GPU_FP8_TEST) --host-only + AIEN_OMEGA_FP8_COAL=0 ./$(GPU_FP8_TEST) --coal-default ./$(GPU_FP8_TEST) --sim # omega #457 (2026-10-15): host rewrite of a GPU-cached buffer must be visible to the next launch. Chip only; the gate diff --git a/calibration/.crumb b/calibration/.crumb index 781e3f77c..118faf695 100644 --- a/calibration/.crumb +++ b/calibration/.crumb @@ -58,19 +58,19 @@ }, { "digest": "af056765c0d3db17ce1819cb8aae90f04ae2a9b21b399ec347daf81efe9eff80", - "last_commit": "dc7c1304", + "last_commit": "87f3e8b8", "name": "scripts", "purpose": "Directory calibration/scripts. Purpose not yet described by a human." } ], "children_root": "sha256:d303c33c7df5e0b63fa0438a79bb26c0cb619369ae6f644ce332e10ddc05241b", - "compiled_at": "2026-10-24T04:15:18Z", + "compiled_at": "2026-10-24T06:12:28Z", "compiler": "crumb-compile/1", "digest": "sha256:9f19f11674ca5dfc3c9c3ae35fe6106557aee9583210da13d257e1b9d88e052c", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 110, - "generated_at_commit": "dc7c1304c038f49db3b121d5a5e27d7bcab5bf6c", + "generated_at_commit": "acf9a7219349ea7010bfb9cad7fa4af068bf77e2", "source_tree": "sha256:2df583871de57822c268162a2ba6c6e6d9ecfa3f443af02dc8b47b39ea4b1b9b" }, "owner_lane": "", diff --git a/docs/.crumb b/docs/.crumb index 559223c0a..ae94c4410 100644 --- a/docs/.crumb +++ b/docs/.crumb @@ -88,7 +88,7 @@ }, { "digest": "6fff07c654fe051c1738dd033ac3723f28df48d44efc1365982205eab21337c6", - "last_commit": "dc7c1304", + "last_commit": "f37bf0fd", "name": "osc", "purpose": "Directory docs/osc. Purpose not yet described by a human." }, @@ -124,13 +124,13 @@ } ], "children_root": "sha256:714214544c32beee15166fcc8b150c5847bf3786035848011e1e564bdd72ddd4", - "compiled_at": "2026-10-24T04:15:18Z", + "compiled_at": "2026-10-24T06:12:28Z", "compiler": "crumb-compile/1", "digest": "sha256:2ff2b8f9b497473c444c34383857d29a5ad45a55c274141321d98d608475b97e", "evidence_files": 34, "evidence_root": "sha256:589d8b3706e6d7a202ab20b278dac5fc5bafc973f1c2a867b2668aa7210b65cc", "files": 127, - "generated_at_commit": "dc7c1304c038f49db3b121d5a5e27d7bcab5bf6c", + "generated_at_commit": "acf9a7219349ea7010bfb9cad7fa4af068bf77e2", "source_tree": "sha256:9258a62ccd8cb6745c2c3aebedc9ad5fad089f7e6fafedc20caa26dbd005f2e9" }, "owner_lane": "", diff --git a/docs/estimation/.crumb b/docs/estimation/.crumb index f45a9743b..1cae0c446 100644 --- a/docs/estimation/.crumb +++ b/docs/estimation/.crumb @@ -24,13 +24,13 @@ } ], "children_root": "sha256:35cd3af03e079556db7f3ebcfd7590fa68659e84dd603795ae6b5b048dc2af0d", - "compiled_at": "2026-10-14T21:46:29Z", + "compiled_at": "2026-10-22T14:49:14Z", "compiler": "crumb-compile/1", "digest": "sha256:56a5a999ce726e90d89c1c88b9e20c81857c8e6ee82af8d651ac80ea70e2c46d", "evidence_files": 34, "evidence_root": "sha256:589d8b3706e6d7a202ab20b278dac5fc5bafc973f1c2a867b2668aa7210b65cc", "files": 47, - "generated_at_commit": "2a6d6d7b9091bd2184b15dcde893035dbcca40d3", + "generated_at_commit": "c8415eac86c7a8e1a061af6d9f4d50a7b401044e", "source_tree": "sha256:67ae8d20aca3ae36b8cf0d75c6939058cc9ff8762c977f70d6963c545e3215d8" }, "owner_lane": "", diff --git a/research/.crumb b/research/.crumb index 03aa7f9dd..96a63fe2d 100644 --- a/research/.crumb +++ b/research/.crumb @@ -22,25 +22,25 @@ "children": [ { "digest": "52c3be397b5256bbedfd2131ad15c04eb12ce6fde938d4b35279d4b8836a2d1a", - "last_commit": "dc7c1304", + "last_commit": "5901baa5", "name": "atemporal", "purpose": "AT-0 Clock-Free Universe research program: relational (Page-Wootters) quantum models with no ext" }, { "digest": "87db1defc5aade980a964c2be7856312f9fd5ef77e40b9d8690d51232b3e14e5", - "last_commit": "dc7c1304", + "last_commit": "458c57f5", "name": "dirac-oracle", "purpose": "Directory research/dirac-oracle. Purpose not yet described by a human." } ], "children_root": "sha256:51505e32ba6ea6c03963dea5572d9eeafb0b606af56df338e0ddc613b3d291af", - "compiled_at": "2026-10-24T04:15:18Z", + "compiled_at": "2026-10-24T06:12:28Z", "compiler": "crumb-compile/1", "digest": "sha256:590f1f3a26a12dfd9df281ec944b882b85fd4ac2ae07a88a03bb8bd0d7d62536", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 538, - "generated_at_commit": "dc7c1304c038f49db3b121d5a5e27d7bcab5bf6c", + "generated_at_commit": "acf9a7219349ea7010bfb9cad7fa4af068bf77e2", "source_tree": "sha256:3fa1bc07dd8c0a0839e88d38f860a502bd23580b16380d73a729f7aed885ef63" }, "owner_lane": "", diff --git a/research/atemporal/.crumb b/research/atemporal/.crumb index 5634267fc..67237233e 100644 --- a/research/atemporal/.crumb +++ b/research/atemporal/.crumb @@ -4,19 +4,19 @@ "children": [ { "digest": "5ad6a1ff0fed0195603d5a012f2c76f48a3087b488347884ac76c7fb002f5417", - "last_commit": "dc7c1304", + "last_commit": "bacc4b6b", "name": "at0", "purpose": "AT-0 V1: finite clock plus one qubit under the AT0_CASE_V1 / AT0_RESULT_V1 contracts" } ], "children_root": "sha256:15b18e565d084ce405f46950099fe98902118858b0d7401d672ecbe404b6f001", - "compiled_at": "2026-10-24T04:15:18Z", + "compiled_at": "2026-10-24T06:12:28Z", "compiler": "crumb-compile/1", "digest": "sha256:52c3be397b5256bbedfd2131ad15c04eb12ce6fde938d4b35279d4b8836a2d1a", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 392, - "generated_at_commit": "dc7c1304c038f49db3b121d5a5e27d7bcab5bf6c", + "generated_at_commit": "acf9a7219349ea7010bfb9cad7fa4af068bf77e2", "source_tree": "sha256:e89f94973b5ba39d9e634f8a2f04fc581ec0f46e573ac21e25809da1439ff0e9" } }, diff --git a/research/m15/spbm/.crumb b/research/m15/spbm/.crumb index 7ef0d2e62..207356e99 100644 --- a/research/m15/spbm/.crumb +++ b/research/m15/spbm/.crumb @@ -13,13 +13,13 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-24T04:15:18Z", + "compiled_at": "2026-10-24T06:12:28Z", "compiler": "crumb-compile/1", "digest": "sha256:6e2c078aae19445eb177571719cef864df7301b84c4d6c462143feee517c5026", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 129, - "generated_at_commit": "dc7c1304c038f49db3b121d5a5e27d7bcab5bf6c", + "generated_at_commit": "acf9a7219349ea7010bfb9cad7fa4af068bf77e2", "source_tree": "sha256:6139c7e4ad41cd04c29c5f4a20da6bb46365b5d888b00149ab294d5c11e85b05" }, "owner_lane": "", diff --git a/src/.crumb b/src/.crumb index b7891e09b..da6f37805 100644 --- a/src/.crumb +++ b/src/.crumb @@ -62,134 +62,134 @@ "children": [ { "digest": "728ab6985dea994eb78a7eb2521384a911492d1c36819c17970a5dc3a8a0c5e2", - "last_commit": "dc7c1304", + "last_commit": "7350a61c", "name": "algebra", "purpose": "Directory src/algebra. Purpose not yet described by a human." }, { "digest": "1881ed1d139a405a777d24d4b26f97bc8405dee0552d6ce21841ce4833560ce2", - "last_commit": "dc7c1304", + "last_commit": "834ee93e", "name": "ans", "purpose": "ANS (Alignment Navigation System), Inertial Alignment v1: frozen reference atoms, drift filter o" }, { "digest": "92c3e2481f7457afd6c7717e6c1a75ebab950ec9114b48025dd137a6edb2975c", - "last_commit": "dc7c1304", + "last_commit": "d48ab89e", "name": "autodiff", "purpose": "M21 OMEGA_AUTODIFF: reverse-mode tape over M20 tensor CPU ops, caller-owned nodes and scratch, p" }, { "digest": "3bd51397fcd28cd54db65c1df72c320883798bc8550779b2b79c8498b28ffb0d", - "last_commit": "dc7c1304", + "last_commit": "1edf41a5", "name": "compiler", "purpose": "Directory src/compiler. Purpose not yet described by a human." }, { "digest": "36a66980895553ae73884798bc09a92141e1aeba5e5068a7d9d62a99bad02548", - "last_commit": "dc7c1304", + "last_commit": "3c82389f", "name": "crumbline", "purpose": "Directory src/crumbline. Purpose not yet described by a human." }, { "digest": "c75df77ddb2bae35ac5e1225a0ae9dcef77b24608775c7b8d02dce1af0ec3ca4", - "last_commit": "dc7c1304", + "last_commit": "00f54b6b", "name": "dual_experiment", "purpose": "DUAL applicability experiment library (ARCH-0031 offline evidence lane): deterministic discrete " }, { "digest": "8856d5162c55cb33997201cd580638f80ea933b46e11c61e1913185d419731d7", - "last_commit": "dc7c1304", + "last_commit": "1a147e40", "name": "estimation", "purpose": "Directory src/estimation. Purpose not yet described by a human." }, { "digest": "391e337c60cb8b2ae549595394482c23717c1757d83747a7446e81cd780750c1", - "last_commit": "dc7c1304", + "last_commit": "3108fc2f", "name": "fabric", "purpose": "Directory src/fabric. Purpose not yet described by a human." }, { "digest": "2d33eb528dafb5954bb027cdd9a7c7923594c177f17181194311155b4e1f40b3", - "last_commit": "dc7c1304", + "last_commit": "71c6ff88", "name": "language", "purpose": "Directory src/language. Purpose not yet described by a human." }, { "digest": "cd0551dbfb6fc354741efe9a3ad1808ffaaf6a8d7e9e7345851333d7a721cee0", - "last_commit": "dc7c1304", + "last_commit": "6d8d92ad", "name": "osh", "purpose": "osh (Omega-native shell, arch#158) lexer unit: layout list, generator, osh_lex.osc, C reference " }, { "digest": "2b5dd2c64d4bbba8c41471dc1af5a0b00bfc1361a2c680d78b99fb30b5b547fe", - "last_commit": "dc7c1304", + "last_commit": "d550b705", "name": "path", "purpose": "Directory src/path. Purpose not yet described by a human." }, { "digest": "e0b91129cc9c188fc0e47b7f3189a3a9a09f9c55eecd018786794571ffc39aad", - "last_commit": "dc7c1304", + "last_commit": "e59633e5", "name": "physics0", "purpose": "PD-0 hidden-equation benchmark (Physics-0 Discovery Engine cut 1): world, oracle, scorer, ladder" }, { "digest": "8b923fb5dc1de3b04afae043a4770f7b1fb27d959a8f597191ae2556d822a1cf", - "last_commit": "dc7c1304", + "last_commit": "61c09411", "name": "polyglot", "purpose": "Directory src/polyglot. Purpose not yet described by a human." }, { "digest": "076f486fdf51e12a26160e7f0bf7686fea611db54216f7fef81367620e7a6bdb", - "last_commit": "dc7c1304", + "last_commit": "dd67f6bd", "name": "reservoir", "purpose": "Ionic-droplet reservoir simulator (omega#440): binary32 fixed-step RK4 of the authors' droplet m" }, { "digest": "c6af24b823d6a18a8ad1593003a214fcd577955d1d134bc4304a5c097a71cd35", - "last_commit": "dc7c1304", + "last_commit": "5901baa5", "name": "runtime", "purpose": "Directory src/runtime. Purpose not yet described by a human." }, { "digest": "af5fcc64fe83dc35f782724372854febde5461f5eab8b327f3c3ed75f8572053", - "last_commit": "dc7c1304", + "last_commit": "5901baa5", "name": "searchtrace", "purpose": "Directory src/searchtrace. Purpose not yet described by a human." }, { "digest": "9723dd7c18d4e2c22db631680974e1025bccb9c309619424e2f4dfcc43cc7068", - "last_commit": "dc7c1304", + "last_commit": "f633e343", "name": "tensor", "purpose": "M20 OMEGA_TENSOR: immutable tensor semantic layer, views, generation-checked storage, CPU realiz" }, { "digest": "06d9fb18dddf7ab0f8ad02fffd15ce8b80808c77d0904609b6baae83c2b05ce5", - "last_commit": "dc7c1304", + "last_commit": "54826a37", "name": "train", "purpose": "Directory src/train. Purpose not yet described by a human." }, { "digest": "812a7faed07b21e066b732ed596eb0aea609379a2b2af0e8b61dd1ea05bef602", - "last_commit": "dc7c1304", + "last_commit": "2564f57a", "name": "turing", "purpose": "Directory src/turing. Purpose not yet described by a human." }, { "digest": "b2e34b2ea0392059ac30d17e27289b1146e523db60a02ef825edef96036817ab", - "last_commit": "dc7c1304", + "last_commit": "40d1ea37", "name": "visor", "purpose": "Directory src/visor. Purpose not yet described by a human." } ], "children_root": "sha256:7ae75586ec96c314f5e6eafc3c32775c1feba09ca424b3f26bcde1bd3cc95818", - "compiled_at": "2026-10-24T04:15:18Z", + "compiled_at": "2026-10-24T06:12:28Z", "compiler": "crumb-compile/1", - "digest": "sha256:7208b7c84c3cfde224b9d055d0754bc493b240cf0f5a93b96ae405686534783e", + "digest": "sha256:2f3fedc677197553bcde41b2ca743c08d175f2f6647e22aaf44ed4ebe34a9d6a", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 537, - "generated_at_commit": "dc7c1304c038f49db3b121d5a5e27d7bcab5bf6c", - "source_tree": "sha256:b3422b41f768b6ef5556fe9a3ec3835be5e559478240c4a2be762b5bbff8dfbf" + "generated_at_commit": "acf9a7219349ea7010bfb9cad7fa4af068bf77e2", + "source_tree": "sha256:4cf2c29fe5aeeafd5f917da07445677adf95c1dd7fbcb51fc8ce0165e18d2479" }, "owner_lane": "", "provenance": { diff --git a/src/omega_blackwell_codegen_moe.c b/src/omega_blackwell_codegen_moe.c index 4524e6ed2..36300b59d 100644 --- a/src/omega_blackwell_codegen_moe.c +++ b/src/omega_blackwell_codegen_moe.c @@ -105,6 +105,7 @@ static void ldg_wide(Em *e, BlackwellIROpcode op, int d, int addr64, uint32_t im static void ldg32(Em *e, int d, int addr64, int udesc, int first) { BlackwellIRInsn i = I0(BW_IR_LDG_E); i.dst_vreg = d; i.src1_vreg = addr64; i.ureg = udesc; emit(e, i, first ? K_VAR : K_VAR_MORE); } static void stg(Em *e, int addr64, uint32_t imm, int val, int udesc) { BlackwellIRInsn i = I0(BW_IR_STG_E); i.src1_vreg = addr64; i.src2_vreg = val; i.imm = imm; i.ureg = udesc; emit(e, i, K_STORE); } static void lds128(Em *e, int d128, int addr, uint32_t imm, int first) { BlackwellIRInsn i = I0(BW_IR_LDS128); i.dst_vreg = d128; i.src1_vreg = addr; i.imm = imm; emit(e, i, first ? K_VAR : K_VAR_MORE); } +static void lds32(Em *e, int d, int addr) { BlackwellIRInsn i = I0(BW_IR_LDS32); i.dst_vreg = d; i.src1_vreg = addr; emit(e, i, K_VAR); } static void sts32(Em *e, int addr, int val) { BlackwellIRInsn i = I0(BW_IR_STS32); i.src1_vreg = addr; i.src2_vreg = val; emit(e, i, K_STORE); } static void bar_sync(Em *e) { emit(e, I0(BW_IR_BAR_SYNC), K_SYNC); } static void fadd(Em *e, int d, int a, int b) { BlackwellIRInsn i = I0(BW_IR_FADD); i.dst_vreg = d; i.src1_vreg = a; i.src2_vreg = b; emit(e, i, K_FIXED); } @@ -147,7 +148,9 @@ static int spec_ok(const OmegaFp8GemvSpec *s) { if (s->rows != 1 && s->rows != 2 && s->rows != 4 && s->rows != 8) return 0; if (s->warps < 1 || s->warps > 32) return 0; /* threads_x = 32 * warps <= 1024 */ if (s->k == 0 || s->k > OMEGA_FP8_MAX_K || s->k % OMEGA_FP8_BLOCK || s->k % (32u * s->lane_bytes)) return 0; - if (s->mutant < 0 || s->mutant > 3) return 0; + if (s->mutant < 0 || s->mutant > 5 || (s->mutant >= 4 && !s->coal)) return 0; + if (s->sched > 1 || s->coal > 1 || s->wfirst > 1) return 0; + if (s->coal && s->warps * s->rows > 32u) return 0; /* warp 0 stores the round: one row per lane */ if (s->depth) { /* deep kernel: staging rounds (32-bit words, one per thread per round) must be exact and few */ uint32_t ks = s->k / (32u * s->lane_bytes); if (s->depth > 16 || ks % s->depth || s->rows * s->depth * s->lane_bytes > 128u) return 0; /* <= 128 weight bytes per lane per iteration: instruction and register budgets */ @@ -159,7 +162,13 @@ static int spec_ok(const OmegaFp8GemvSpec *s) { } uint32_t omega_fp8_gemv_steps(const OmegaFp8GemvSpec *spec) { return spec_ok(spec) ? spec->k / (32u * spec->lane_bytes) : 0; } -uint32_t omega_fp8_gemv_shared_bytes(const OmegaFp8GemvSpec *spec) { return spec_ok(spec) && spec->depth ? spec->k * 4u + 16u : 0u; } /* + one dummy slot for the clamped threads of a partial round */ +/* deep: x' (k words) + one dummy slot for the clamped threads of a partial staging round; coal: then two output slot sets */ +static uint32_t x_stage_bytes(const OmegaFp8GemvSpec *s) { return s->depth ? s->k * 4u + 16u : 0u; } +static uint32_t out_slot_bytes(const OmegaFp8GemvSpec *s) { return s->warps * s->rows * 4u; } +uint32_t omega_fp8_gemv_shared_bytes(const OmegaFp8GemvSpec *spec) { + if (!spec_ok(spec)) return 0u; + return x_stage_bytes(spec) + (spec->coal ? 2u * out_slot_bytes(spec) : 0u); +} /* e4m3 byte i of word w -> f32 bits (value * 2^-120): ((b & 0x7F) << 20) | ((b & 0x80) << 24) */ static void decode_byte(Em *e, int f, int wq, unsigned word, unsigned i, int u, int a, int s) { @@ -172,6 +181,104 @@ static void decode_byte(Em *e, int f, int wq, unsigned word, unsigned i, int u, else imadi(e, f, s, 0, 1u, a); } +/* ---- sched 1 (CUT5): pipelined byte decode ---- + * Byte b of a K step (word b / 4, byte b % 4) goes through five instructions: E (shift the byte to bits 20..27), + * S (isolate its sign), M (mask the magnitude), F (sign to bit 31 plus magnitude = the f32 bits) and C (the FFMA into + * dot). Iteration c emits E(c), S(c), M(c - 2), F(c - 3), C(c - 5): every producer is at least 6 instructions ahead of + * its user (E->M 12, S->F 12+, M->F 6, F->C 11), so the stall pass below can give most instructions stall 1 while the + * FFMA chain (one per 5 instructions) runs at the 6-cycle fixed latency. t1 holds a byte from E to F (4 slots), t2 from + * S to C (6 slots). The FFMA order (byte 0, 1, ... of word 0, then word 1 ...) and every operand are those of the + * sched 0 loop, so y is bit-identical. */ +#define PIPE_T1 4 +#define PIPE_T2 6 +static void decode_pipe(Em *e, int wqv, uint32_t words, const int *xq, int dot, const int *t1, const int *t2) { + const uint32_t M = 0x07F00000u, NB = 4u * words; + for (uint32_t c = 0; c < NB + 5u; c++) { + if (c < NB) { + const uint32_t word = c / 4u, i = c % 4u; + const int u = t1[c % PIPE_T1], sg = t2[c % PIPE_T2]; + if (i < 3) imadi(e, u, wqv, word, 1u << (20u - 8u * i), NOREG); else shr(e, u, wqv, word, 4); + andi(e, sg, wqv, word, 0x80u << (8u * i)); + } + if (c >= 2 && c - 2u < NB) { const int u = t1[(c - 2u) % PIPE_T1]; andi(e, u, u, 0, M); } + if (c >= 3 && c - 3u < NB) { + const uint32_t b = c - 3u, i = b % 4u; + const int sg = t2[b % PIPE_T2], u = t1[b % PIPE_T1]; + imadi(e, sg, sg, 0, i < 3 ? 1u << (24u - 8u * i) : 1u, u); + } + if (c >= 5 && c - 5u < NB) { const uint32_t b = c - 5u; ffma(e, dot, t2[b % PIPE_T2], xq[b / 4u], b % 4u, dot); } + } +} + +/* ---- sched 1: dependency-driven stall counts (after register allocation) ---- + * The emitter gives every fixed-latency instruction stall 6, which keeps any user >= 6 cycles behind its producer but + * also makes independent instructions wait 6 cycles each. The repository's chip-proven rule is the distance, not the + * per-instruction count: a fixed-latency producer stalls >= 5 cycles before its consumer (we keep 6; + * omega_gpu_elementwise_api.c:13). Same pass as omega_blackwell_codegen_tern.c (chip-proven at TERN-T0 2300f164) with + * this kernel's fixed-latency set, which adds FFMA, FADD and LOP3_XOR: walk the program in order on physical registers + * and give each instruction the smallest stall that keeps the next instruction >= OMEGA_FP8_FIXED_LAT cycles behind + * every fixed-latency write it reads or overwrites. Before a control instruction (BRA, EXIT, BSSY, BSYNC, BAR) or a + * branch target every fixed-latency write has completed, so straight-line timing never spans a jump. Other instructions + * keep at least their emitted stall (loads 4, ISETP 14 before a predicated branch); wait masks are untouched. */ +static int fp8_fixed(BlackwellIROpcode op) { + switch (op) { + case BW_IR_IMAD: case BW_IR_IMAD_WIDE: case BW_IR_SHF_R: case BW_IR_LOP3_AND: case BW_IR_LOP3_XOR: case BW_IR_MOV_IMM: + case BW_IR_MOV_RZ: case BW_IR_FFMA: case BW_IR_FADD: return 1; + default: return 0; + } +} +static int fp8_control(BlackwellIROpcode op) { + return op == BW_IR_BRA || op == BW_IR_EXIT || op == BW_IR_BSSY || op == BW_IR_BSYNC || op == BW_IR_BAR_SYNC; +} +static void fp8_span(const BlackwellIRProgram *p, int v, int *lo, int *cnt) { + *lo = -1; *cnt = 0; + if (v < 0 || v >= p->regalloc.num_vregs) return; + const int ph = p->regalloc.vreg_to_phys[v]; + if (ph < 0) return; + *lo = ph; *cnt = (int)(p->regalloc.intervals[v].bundle_size ? p->regalloc.intervals[v].bundle_size : 1u); +} +static int fp8_schedule_stalls(BlackwellIRProgram *p) { + static uint8_t target[BW_MAX_IR_INSNS + 1]; + uint64_t ready[BW_MAX_VREGS + 8]; + const size_t n = p->count; + memset(target, 0, sizeof target); + memset(ready, 0, sizeof ready); + for (size_t i = 0; i < n; i++) { + const BlackwellIRInsn *in = &p->insns[i]; + if (in->op == BW_IR_BRA || in->op == BW_IR_BSSY) { + const long t = (long)i + (long)(int32_t)in->imm; + if (t < 0 || t > (long)n) return -1; + target[t] = 1; + } + } + uint64_t T = 0, all = 0; + for (size_t i = 0; i < n; i++) { + BlackwellIRInsn *in = &p->insns[i]; + const uint32_t s_emit = (in->control >> 9) & 0xfu; + const int fixed = fp8_fixed(in->op); + if (fixed) { + int lo, c; fp8_span(p, in->dst_vreg, &lo, &c); + for (int k = 0; k < c; k++) { if (lo + k >= BW_MAX_VREGS + 8) return -1; ready[lo + k] = T + OMEGA_FP8_FIXED_LAT; } + if (c && T + OMEGA_FP8_FIXED_LAT > all) all = T + OMEGA_FP8_FIXED_LAT; + } + uint64_t need = T + (fixed ? 1u : s_emit); + if (i + 1 < n) { + const BlackwellIRInsn *nx = &p->insns[i + 1]; + const int ops[4] = { nx->dst_vreg, nx->src1_vreg, nx->src2_vreg, nx->src3_vreg }; + for (int q = 0; q < 4; q++) { + int lo, c; fp8_span(p, ops[q], &lo, &c); + for (int k = 0; k < c; k++) if (lo + k < BW_MAX_VREGS + 8 && ready[lo + k] > need) need = ready[lo + k]; + } + if ((fp8_control(nx->op) || target[i + 1]) && all > need) need = all; + } + const uint64_t s = need - T; + if (s > 15 || (s == 0 && (fixed || s_emit != 0))) return -1; /* stall 0 only where emitted (the final self-branch) */ + if (fixed || s > s_emit) in->control = (in->control & ~(0xfu << 9)) | ((uint32_t)s << 9); + T = need; + } + return 0; +} + int omega_blackwell_codegen_fp8_gemv_prog(const OmegaFp8GemvSpec *spec, BlackwellIRProgram *prog) { if (!spec_ok(spec) || !prog) return -1; const uint32_t K = spec->k, LB = spec->lane_bytes, R = spec->rows, W = spec->warps; @@ -218,6 +325,16 @@ int omega_blackwell_codegen_fp8_gemv_prog(const OmegaFp8GemvSpec *spec, Blackwel for (uint32_t q = 0; q < WORDS; q++) xq[q] = V128(e); for (uint32_t s = 0; s < D; s++) { sc[s] = V(e); psd[s] = V64(e); } int dot = V(e), u = V(e), a = V(e), sg = V(e), f = V(e), t = V(e); + int pt1[PIPE_T1], pt2[PIPE_T2]; /* sched 1 only: allocated after every sched 0 register, so sched 0 code is unchanged */ + if (spec->sched) { for (int q = 0; q < PIPE_T1; q++) pt1[q] = V(e); for (int q = 0; q < PIPE_T2; q++) pt2[q] = V(e); } + /* coal 1 only, allocated last for the same reason: uc first row group of the CTA's round, rgx the clamped row group */ + const int coal = spec->coal != 0; + int uc = NOREG, rgx = rg, um1 = NOREG, negU = NOREG, negn = NOREG, okw = NOREG, tq = NOREG, slb = NOREG, stog = NOREG; + int so = NOREG, sa = NOREG, wl1 = NOREG, val = NOREG, row = NOREG, skip = NOREG; + if (coal) { + uc = V(e); rgx = V(e); um1 = V(e); negU = V(e); negn = V(e); okw = V(e); tq = V(e); slb = V(e); stog = V(e); + so = V(e); sa = V(e); wl1 = V(e); val = V(e); row = V(e); skip = V(e); + } if (e->err) return -1; if (deep) { @@ -253,13 +370,37 @@ int omega_blackwell_codegen_fp8_gemv_prog(const OmegaFp8GemvSpec *spec, Blackwel imadi(e, xl0, lane, 0, LB * 4u, NOREG); /* this lane's x' chunk of step 0, shared byte offset */ } + if (coal) { + /* ---- coalesced output (variant A): per-CTA round variables. All values stay below 2^31 (RG, n <= 2^24), + * so (a - b) >> 31 is the 0/1 test a < b. ---- */ + const uint32_t nrow = W * R; + imadi(e, um1, one, 0, 0xffffffffu, rgn); /* RG - 1 */ + imadi(e, negU, rgn, 0, 0xffffffffu, NOREG); /* -RG */ + imadi(e, negn, rgn, 0, 0u - R, NOREG); /* -n (n = RG * R) */ + movi(e, slb, x_stage_bytes(spec)); /* slot set of this round (alternates) */ + /* stog = sum of the two set bases: slb = stog - slb alternates (XOR would need a base aligned to the set size) */ + movi(e, stog, 2u * x_stage_bytes(spec) + (spec->mutant == 4 ? 0u : out_slot_bytes(spec))); /* mutant 4: one slot set, the round race */ + imadi(e, so, warp, 0, R * 4u, NOREG); /* this warp's slot: warp * R words */ + imadi(e, tq, lane, 0, 0xffffffffu, NOREG); imadi(e, tq, one, 0, nrow - 1u, tq); shr(e, tq, tq, 0, 31); /* lane >= W R */ + imadi(e, wl1, warp, 0, 1, tq); imadi(e, wl1, one, 0, 1, wl1); /* warp + (lane >= W R) + 1 */ + imadi(e, uc, cx, 0, W, NOREG); /* first row group of this CTA's round (CTA-uniform) */ + } + /* ---- row-group loop ---- */ const int L_rg = here(e); loop_begin(e); - isetp_ge_u32(e, rg, rgn); + isetp_ge_u32(e, coal ? uc : rg, rgn); /* coal: the whole CTA leaves together (barriers inside) */ const int bra_end = bra_if_p0_fwd(e); - imadw(e, pw, rg, R * K, wbase); imadw(e, pw, wlane, 1, pw); - shr(e, srg, rg, 0, (uint32_t)log2rows_per_block); + if (coal) { + /* a warp past the last row group recomputes row group RG - 1 (inside the tensor); its slot is never stored */ + imadi(e, tq, rg, 0, 1, negU); /* rg - RG */ + shr(e, okw, tq, 0, 31); /* 1 if rg < RG */ + imadi(e, tq, one, 0, 1, tq); /* rg - RG + 1 */ + if (spec->mutant == 5) imadi(e, rgx, rg, 0, 1, NOREG); /* mutant 5: no clamp, a warp past RG reads past the tensor */ + else imadr(e, rgx, okw, tq, um1); /* rg < RG ? rg : RG - 1 */ + } + imadw(e, pw, rgx, R * K, wbase); imadw(e, pw, wlane, 1, pw); + shr(e, srg, rgx, 0, (uint32_t)log2rows_per_block); imadw(e, ps, srg, KB * 4u, sbase); imadw(e, ps, slane, 1, ps); if (!deep) imadw(e, pxc, one, 0, xlane); else imadi(e, xl, xl0, 0, 1, NOREG); for (uint32_t r = 0; r < R; r++) movrz(e, acc[r]); @@ -270,15 +411,19 @@ int omega_blackwell_codegen_fp8_gemv_prog(const OmegaFp8GemvSpec *spec, Blackwel loop_begin(e); { int first = 1; - if (!deep) { for (uint32_t q = 0; q < WORDS; q++) { ldg_wide(e, BW_IR_LDG_E_128, xq[q], pxc, q * 16u, udesc, first); first = 0; } } + const int xfirst = !deep && !spec->wfirst, xlast = !deep && spec->wfirst; + if (xfirst) { for (uint32_t q = 0; q < WORDS; q++) { ldg_wide(e, BW_IR_LDG_E_128, xq[q], pxc, q * 16u, udesc, first); first = 0; } } for (uint32_t s = 0; s < D; s++) imadw(e, psd[s], one, spec->mutant == 2 ? 0u : s * BPS * 4u, ps); for (uint32_t s = 0; s < D; s++) for (uint32_t r = 0; r < R; r++) { ldg_wide(e, ldw, wq[r][s], pw, r * K + s * 32u * LB, udesc, first); first = 0; } for (uint32_t s = 0; s < D; s++) ldg32(e, sc[s], psd[s], udesc, 0); + if (xlast) for (uint32_t q = 0; q < WORDS; q++) ldg_wide(e, BW_IR_LDG_E_128, xq[q], pxc, q * 16u, udesc, 0); /* variant B */ } for (uint32_t s = 0; s < D; s++) { if (deep) { int first = 1; for (uint32_t q = 0; q < WORDS; q++) { lds128(e, xq[q], xl, s * 128u * LB + q * 16u, first); first = 0; } } for (uint32_t r = 0; r < R; r++) { movrz(e, dot); + if (spec->sched) decode_pipe(e, wq[r][s], WORDS, xq, dot, pt1, pt2); + else for (uint32_t word = 0; word < WORDS; word++) for (unsigned i = 0; i < 4; i++) { decode_byte(e, f, wq[r][s], word, i, u, a, sg); @@ -300,15 +445,44 @@ int omega_blackwell_codegen_fp8_gemv_prog(const OmegaFp8GemvSpec *spec, Blackwel /* ---- warp reduction, lane 0 stores ---- */ for (uint32_t r = 0; r < R; r++) for (uint32_t o = 16; o >= 1; o /= 2) { shfl_down(e, t, acc[r], o); fadd(e, acc[r], acc[r], t); } - imadw(e, pyr, rg, R * 4u, yrow); - isetp_ge_u32(e, lane, one); - const int at_bssy = bssy_fwd(e); - const int bra_skip = bra_if_p0_fwd(e); - for (uint32_t r = 0; r < R; r++) { imadw(e, pya, one, r * 4u, pyr); stg(e, pya, 0, acc[r], udesc); } /* STG.E with immediate 0 only (the chip-proven form) */ - const int at_bsync = here(e); - bsync(e); - patch_bra(e, bra_skip, at_bsync); - patch_bra(e, at_bssy, at_bsync + 1); + if (!coal) { + imadw(e, pyr, rg, R * 4u, yrow); + isetp_ge_u32(e, lane, one); + const int at_bssy = bssy_fwd(e); + const int bra_skip = bra_if_p0_fwd(e); + for (uint32_t r = 0; r < R; r++) { imadw(e, pya, one, r * 4u, pyr); stg(e, pya, 0, acc[r], udesc); } /* STG.E with immediate 0 only (the chip-proven form) */ + const int at_bsync = here(e); + bsync(e); + patch_bra(e, bra_skip, at_bsync); + patch_bra(e, at_bssy, at_bsync + 1); + } else { + /* lane 0 of each warp parks its R results in this round's slot set */ + isetp_ge_u32(e, lane, one); + int at_bssy = bssy_fwd(e), bra_skip = bra_if_p0_fwd(e); + imadi(e, sa, slb, 0, 1, so); /* slot set + warp * R words */ + for (uint32_t r = 0; r < R; r++) { if (r) imadi(e, sa, one, 0, 4u, sa); sts32(e, sa, acc[r]); } + int at_bsync = here(e); + bsync(e); + patch_bra(e, bra_skip, at_bsync); + patch_bra(e, at_bssy, at_bsync + 1); + bar_sync(e); + /* warp 0, lanes < W R: row = R uc + lane, stored when < n, one coalesced STG for the round */ + imadi(e, row, uc, 0, R, lane); + imadi(e, okw, row, 0, 1, negn); shr(e, okw, okw, 0, 31); /* 1 if row < n */ + imadi(e, skip, okw, 0, 0xffffffffu, wl1); /* warp + (lane >= W R) + 1 - (row < n): 0 only for a store */ + isetp_ge_u32(e, skip, one); + at_bssy = bssy_fwd(e); bra_skip = bra_if_p0_fwd(e); + imadi(e, sa, lane, 0, 4u, slb); + lds32(e, val, sa); + imadw(e, pya, row, 4u, yrow); + stg(e, pya, 0, val, udesc); + at_bsync = here(e); + bsync(e); + patch_bra(e, bra_skip, at_bsync); + patch_bra(e, at_bssy, at_bsync + 1); + imadi(e, slb, slb, 0, 0xffffffffu, stog); /* next round parks in the other slot set: stog - slb */ + imadi(e, uc, stride, 0, 1, uc); + } imadi(e, rg, stride, 0, 1, rg); bra(e, L_rg); loop_end(e); @@ -316,7 +490,8 @@ int omega_blackwell_codegen_fp8_gemv_prog(const OmegaFp8GemvSpec *spec, Blackwel patch_bra(e, bra_end, L_end); tail(e); if (e->err) return -1; - return omega_bw_regalloc_solve(prog); + if (omega_bw_regalloc_solve(prog) != 0) return -1; + return spec->sched ? fp8_schedule_stalls(prog) : 0; } int omega_fp8_gemv_prog_stats(const OmegaFp8GemvSpec *spec, uint32_t *insns, uint32_t *gprs) { diff --git a/src/omega_blackwell_codegen_moe.h b/src/omega_blackwell_codegen_moe.h index d880d6163..717f6a1db 100644 --- a/src/omega_blackwell_codegen_moe.h +++ b/src/omega_blackwell_codegen_moe.h @@ -99,9 +99,28 @@ typedef struct { * loads of D consecutive K steps before using any of them (D x more bytes in * 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 */ + int mutant; /* 0 production; 1, 2, 3 as above; 4, 5 with coal = 1 (below) */ + uint32_t sched; /* 0 (default, chip-proven): every fixed-latency instruction stalls 6, one byte decoded at a time. + * 1 (CUT5, measurement variant): the bytes of a step are decoded in a 3-deep software pipeline with + * their own temporaries, and a pass after register allocation (omega_fp8_schedule_stalls) gives each + * instruction the smallest stall that keeps every user >= OMEGA_FP8_FIXED_LAT cycles behind each + * fixed-latency write (the repo rule, omega_gpu_elementwise_api.c:13). The FFMA order is unchanged, + * so y is bit-identical to sched 0. Appended last: earlier fields keep their offsets. */ + uint32_t coal; /* 0 (default): lane 0 of each warp stores its R row results (4-byte STG each) to y. + * 1 (CUT5 variant A, after omega#490 KT1): the CTA works in rounds (row groups uc .. uc + W - 1, + * uc uniform); lane 0 of each warp parks its R results in shared slots (two slot sets alternating by + * round, one BAR.SYNC per round) and warp 0 stores the round's W * R consecutive rows with one + * coalesced STG. A warp past the last row group recomputes row group RG - 1 and its slot is never + * stored. Needs warps * rows <= 32. Test mutants: 4 = one slot set (the round race), 5 = no clamp. */ + uint32_t wfirst; /* 0 (default): each K step issues the x' loads, then the scale address IMADs, then the weight and + * scale loads. The IMADs wait on the x' loads' scoreboard (every fixed-latency op waits on the pending + * loads, emit()), so each step pays the x' round trip before any weight load goes out. + * 1 (CUT5 variant B): scale addresses first, then weight, scale and x' loads in one batch with no wait + * between them. Ignored by deep kernels (depth >= 1), which read x' from shared memory. */ } OmegaFp8GemvSpec; +#define OMEGA_FP8_FIXED_LAT 6u /* cycles a fixed-latency result needs before a user (the repo keeps 6; hardware minimum 5) */ + /* 0 on success (prog solved and register-allocated), -1 on a refused spec or an allocator failure. */ int omega_blackwell_codegen_fp8_gemv_prog(const OmegaFp8GemvSpec *spec, BlackwellIRProgram *prog); @@ -111,7 +130,8 @@ int omega_blackwell_codegen_fp8_gemv(const OmegaFp8GemvSpec *spec, OmegaBlackwel /* K steps the kernel runs: k / (32 * lane_bytes). 0 when the spec is refused. */ uint32_t omega_fp8_gemv_steps(const OmegaFp8GemvSpec *spec); -/* Shared memory bytes the launch must declare: k * 4 for a deep kernel, 0 otherwise. */ +/* Shared memory bytes the launch must declare: k * 4 + 16 for a deep kernel, 0 otherwise, plus 2 * warps * rows * 4 + * (the two output slot sets) when coal = 1. */ uint32_t omega_fp8_gemv_shared_bytes(const OmegaFp8GemvSpec *spec); /* The IR instruction count and peak GPR count of the solved program (for budgets in tests). */ diff --git a/src/omega_gpu_fp8_api.c b/src/omega_gpu_fp8_api.c index f78574e6c..64cc3d2ea 100644 --- a/src/omega_gpu_fp8_api.c +++ b/src/omega_gpu_fp8_api.c @@ -58,6 +58,8 @@ static struct { int variant, variant_set; /* GEMV variant 1 or 2 (omega_gpu_fp8_set_variant / AIEN_OMEGA_FP8_GEMV), read once */ int weights_cached; /* omega_gpu_fp8_set_weight_cache: uploads after it allocate GPU-cached (read-only weights) */ int weights_cached_set; /* 0: never set, the first upload reads env AIEN_OMEGA_FP8_WEIGHT_CACHE (W-L2d: "1" = cached) */ + int sched, sched_set; /* CUT5: kernel schedule 0 (default) or 1 (pipelined decode + stall pass), variant 1 only; env AIEN_OMEGA_FP8_SCHED when never set */ + int coal, coal_set, wfirst, wfirst_set; /* CUT5 variants A (coalesced output) and B (weights before x), variant 1 only; env AIEN_OMEGA_FP8_COAL / AIEN_OMEGA_FP8_WFIRST when never set */ bool hooked; Slot cache[CACHE_SLOTS]; unsigned next; @@ -123,6 +125,39 @@ void omega_gpu_fp8_set_variant(int variant) { omega_gpu_session_unlock(); } int omega_gpu_fp8_variant(void) { return variant_now(); } + +/* ---- kernel schedule (CUT5): 0 = emitted stalls (default), 1 = pipelined decode + dependency stall pass (variant 1 only) ---- */ +static int sched_now(void) { + if (!g.sched_set) { + const char *v = getenv("AIEN_OMEGA_FP8_SCHED"); + g.sched = (v && v[0] == '1' && v[1] == 0) ? 1 : 0; + g.sched_set = 1; + } + return g.sched; +} +void omega_gpu_fp8_set_sched(int sched) { + omega_gpu_session_lock(); + g.sched = sched == 1 ? 1 : 0; g.sched_set = 1; + cache_clear_locked(); + omega_gpu_session_unlock(); +} +int omega_gpu_fp8_sched(void) { return sched_now(); } +/* ---- CUT5 variants A and B (variant 1 only): 0 = off, 1 = on. Never set: the env decides once; A (coal) defaults ON (env + * value "0" turns it off; SPEED-A 2026-10-17: OWN-30B decode graph 24.49 -> 21.34 ms/token, tokens identical), B (wfirst) + * defaults OFF (env value "1" turns it on; cold bench: not distinguishable from noise) ---- */ +static int flag_now(int *v, int *set, const char *env, int dflt) { + if (!*set) { + const char *s = getenv(env); + *v = (s && s[0] == '0' && s[1] == 0) ? 0 : (s && s[0] == '1' && s[1] == 0) ? 1 : dflt; + *set = 1; + } + return *v; +} +static void flag_set(int *v, int *set, int on) { omega_gpu_session_lock(); *v = on == 1 ? 1 : 0; *set = 1; cache_clear_locked(); omega_gpu_session_unlock(); } +void omega_gpu_fp8_set_coal(int on) { flag_set(&g.coal, &g.coal_set, on); } +int omega_gpu_fp8_coal(void) { return flag_now(&g.coal, &g.coal_set, "AIEN_OMEGA_FP8_COAL", 1); } +void omega_gpu_fp8_set_wfirst(int on) { flag_set(&g.wfirst, &g.wfirst_set, on); } +int omega_gpu_fp8_wfirst(void) { return flag_now(&g.wfirst, &g.wfirst_set, "AIEN_OMEGA_FP8_WFIRST", 0); } /* codegen by variant */ static int prog_for(int variant, const OmegaFp8GemvSpec *spec, BlackwellIRProgram *prog) { return variant == 2 ? omega_blackwell_codegen_fp8_gemv2_prog(spec, prog) : omega_blackwell_codegen_fp8_gemv_prog(spec, prog); @@ -242,9 +277,15 @@ static void spec_for(uint32_t k, uint32_t n, uint32_t groups, OmegaFp8GemvSpec * * the whole row group is always in flight (depth = KS, informational: the generator ignores the field). */ if (!g.warps) spec->warps = OMEGA_GPU_FP8_V2_WARPS; spec->depth = spec->k / (32u * spec->lane_bytes); - } else spec->depth = omega_gpu_fp8_depth_for(spec, n, groups); + } else { + spec->depth = omega_gpu_fp8_depth_for(spec, n, groups); spec->sched = (uint32_t)sched_now(); + spec->coal = omega_gpu_fp8_coal() && spec->warps * spec->rows <= 32u; /* A: shapes whose round fits one store warp */ + spec->wfirst = (uint32_t)omega_gpu_fp8_wfirst(); /* B: deep kernels ignore it */ + } spec->mutant = g.mutant; } +/* Host-only: the spec the automatic choice makes for a call (no chip, no cache; tests check the defaults with it). */ +void omega_gpu_fp8_spec_for(uint32_t k, uint32_t n, uint32_t groups, OmegaFp8GemvSpec *spec) { spec_for(k, n, groups, spec); } int omega_gpu_fp8_prepare(uint32_t k) { OmegaFp8GemvSpec spec; spec_for(k, 1u << 20, 1, &spec); diff --git a/src/omega_gpu_fp8_api.h b/src/omega_gpu_fp8_api.h index 6a9b135cd..c898ed102 100644 --- a/src/omega_gpu_fp8_api.h +++ b/src/omega_gpu_fp8_api.h @@ -162,6 +162,23 @@ void omega_gpu_fp8_set_weight_cache(int on); * per group for grouped launches (the shape and budget knobs above still override). */ void omega_gpu_fp8_set_variant(int variant); int omega_gpu_fp8_variant(void); +/* Kernel schedule (CUT5, measurement knob; clears the kernel cache): 0 (default) = the emitted stalls, 1 = the bytes of a step + * decoded in a software pipeline plus the dependency-driven stall pass (OmegaFp8GemvSpec.sched; y bit-identical to 0). Variant 1 + * only (variant 2 ignores it). Never set: the first kernel build reads env AIEN_OMEGA_FP8_SCHED ("1" = 1). */ +void omega_gpu_fp8_set_sched(int sched); +int omega_gpu_fp8_sched(void); +/* CUT5 variants (variant 1 only; each setter clears the kernel cache; never set: the env is read once at the first build). + * A, coalesced output (OmegaFp8GemvSpec.coal; applied where warps * rows <= 32): ON by default since SPEED-A (2026-10-17, + * OWN-30B decode graph 24.49 -> 21.34 ms/token, tokens identical to golden); AIEN_OMEGA_FP8_COAL=0 or set_coal(0) restores + * the earlier kernel (one 4-byte STG per row, no shared slots). + * B, weight loads before the x loads in each K step (OmegaFp8GemvSpec.wfirst): OFF by default; AIEN_OMEGA_FP8_WFIRST=1 turns it on. */ +void omega_gpu_fp8_set_coal(int on); +int omega_gpu_fp8_coal(void); +void omega_gpu_fp8_set_wfirst(int on); +int omega_gpu_fp8_wfirst(void); +/* Host-only: the spec the automatic choice makes for a call of k columns, n rows, `groups` experts under the current knobs + * (shape, depth, sched, coal, wfirst, mutant). No chip, no kernel build. */ +void omega_gpu_fp8_spec_for(uint32_t k, uint32_t n, uint32_t groups, OmegaFp8GemvSpec *spec); #define OMEGA_GPU_FP8_V2_WARPS 16u #define OMEGA_GPU_FP8_V2_GROUPED_CTAS 12u int omega_gpu_fp8_weight_cache(void); diff --git a/tests/.crumb b/tests/.crumb index af7f23b19..e0e5abbd0 100644 --- a/tests/.crumb +++ b/tests/.crumb @@ -110,200 +110,200 @@ "children": [ { "digest": "2c1deaaa1bae6257789749edde641df61413250fe91ce6aa61a99dfb3b271306", - "last_commit": "dc7c1304", + "last_commit": "28911be7", "name": "algebra", "purpose": "Directory tests/algebra. Purpose not yet described by a human." }, { "digest": "63f086b68bb9ffc032cbd74931309ab34df3c8c341b57935e5db43d8bf475800", - "last_commit": "dc7c1304", + "last_commit": "834ee93e", "name": "ans", "purpose": "Tests 1-10 for ANS (docs/ans/INERTIAL_ALIGNMENT_SPEC_V1.md): freeze/digest, hostile reference mu" }, { "digest": "45c5f4fd157769cf0dcc4b8acbd76b0953580bc328714bab8e1d65e9264a5664", - "last_commit": "dc7c1304", + "last_commit": "1b0e2968", "name": "brownian", "purpose": "Directory tests/brownian. Purpose not yet described by a human." }, { "digest": "1cd97575b2b10d9313ca0df4997391612056754778bb2851bf052c146144f15e", - "last_commit": "dc7c1304", + "last_commit": "30bb116c", "name": "canonicalization", "purpose": "Directory tests/canonicalization. Purpose not yet described by a human." }, { "digest": "646c083a94914e5726634c33cc1e694349cfcd4f43817864ffec83e506a52d4e", - "last_commit": "dc7c1304", + "last_commit": "1edf41a5", "name": "compiler", "purpose": "Directory tests/compiler. Purpose not yet described by a human." }, { "digest": "9e372cfc9747befacdcf31bc8643356aaff861e81ee6640b4866170be67b5e6c", - "last_commit": "dc7c1304", + "last_commit": "28b87934", "name": "constraints", "purpose": "Directory tests/constraints. Purpose not yet described by a human." }, { "digest": "87a3efa5cd0aefa7821046f9a31594bfa0a109e95005a1e12f40c99a1bc6cd3d", - "last_commit": "dc7c1304", + "last_commit": "49abb024", "name": "crumbline", "purpose": "Directory tests/crumbline. Purpose not yet described by a human." }, { "digest": "10aa3424eded7768fee0bae0eedd062b9deac3279d2e5721439fd024493bc42b", - "last_commit": "dc7c1304", + "last_commit": "00f54b6b", "name": "dual_experiment", "purpose": "Tests for the DUAL applicability experiment: determinism (same seed, byte-identical results dige" }, { "digest": "758dde696afa847d9347fad76b0c4935e968f8af4551f0f9810ec2a37ad9847a", - "last_commit": "dc7c1304", + "last_commit": "c819b376", "name": "effect", "purpose": "Directory tests/effect. Purpose not yet described by a human." }, { "digest": "23e559d13ff664995baca31dc157a8cf5a860615f3ecb07a9a40fe4626b57ae3", - "last_commit": "dc7c1304", + "last_commit": "1a147e40", "name": "estimation", "purpose": "Directory tests/estimation. Purpose not yet described by a human." }, { "digest": "b7b6391caf653c76707a21f9969126abcbc730d1243259219225fdb9bc0084e0", - "last_commit": "dc7c1304", + "last_commit": "3108fc2f", "name": "fabric", "purpose": "Directory tests/fabric. Purpose not yet described by a human." }, { "digest": "defc52a44ea0f65ba5de3468de786148ba58d292ffa217fb95629a28a569a977", - "last_commit": "dc7c1304", + "last_commit": "28b87934", "name": "identity", "purpose": "Directory tests/identity. Purpose not yet described by a human." }, { "digest": "6ba43d622b712a4215767cab29425016f29cce4b28eb9e4961fc67fd20e9d765", - "last_commit": "dc7c1304", + "last_commit": "4f55f45e", "name": "language", "purpose": "Directory tests/language. Purpose not yet described by a human." }, { "digest": "54f43a3416595ff5d4e64bd12afe013359e706651c39c78e2896a5799638d263", - "last_commit": "dc7c1304", + "last_commit": "30bb116c", "name": "malformed", "purpose": "Directory tests/malformed. Purpose not yet described by a human." }, { "digest": "a03a4dd9a72f7b449342e562f6d9df1a3348fb03fb640b662956caf163dcd7e9", - "last_commit": "dc7c1304", + "last_commit": "40d1ea37", "name": "numeric_native", "purpose": "Simulated M16 driver for numeric resource-lifecycle tests. No device execution or numeric parity" }, { "digest": "d958af5413726ddc48a47721800d9766939129f480b26492332ba094577837cb", - "last_commit": "dc7c1304", + "last_commit": "6d8d92ad", "name": "osh", "purpose": "osh lexer host driver, vendored aien-protocols PR#16 draft vectors (5ae5292)" }, { "digest": "12b31dc2cd4f6a6c27983db11b4140c597025c9124da5ddcbe6a9230ab4f8410", - "last_commit": "dc7c1304", + "last_commit": "d550b705", "name": "path", "purpose": "Directory tests/path. Purpose not yet described by a human." }, { "digest": "51f14936b27d3d21379cf05ea1b6b532cf3175a40844dac85f023a61e7a0912c", - "last_commit": "dc7c1304", + "last_commit": "5901baa5", "name": "physics0", "purpose": "PD-0 gates: world self-test, oracle calibration, learner L0/L1/NULL, mutations, OSC differential" }, { "digest": "c8524317c751fa8f464cabc31b760cef262abba822f1843482a02e239daa81b3", - "last_commit": "dc7c1304", + "last_commit": "61c09411", "name": "polyglot", "purpose": "Directory tests/polyglot. Purpose not yet described by a human." }, { "digest": "6569e2cd6dbf6f792edb5d83bf0715df9dece42ca7bd9b3a291535de0492d3aa", - "last_commit": "dc7c1304", + "last_commit": "3c82389f", "name": "program", "purpose": "Directory tests/program. Purpose not yet described by a human." }, { "digest": "c549b5b82fd026d664b35e4b1a5d7fd2aaafa13b60b541cfbba87d7522517b1d", - "last_commit": "dc7c1304", + "last_commit": "6fdc4c33", "name": "r16_inventory", "purpose": "Directory tests/r16_inventory. Purpose not yet described by a human." }, { "digest": "855bd23e4c526fb49eeb430c4ea5967d3f2f9da3a5b3aa3ec9dae5b814b11a21", - "last_commit": "dc7c1304", + "last_commit": "46b9cad0", "name": "r16_negative", "purpose": "Directory tests/r16_negative. Purpose not yet described by a human." }, { "digest": "f21be04969cbf51de17118c4f81b103f712db56fd517a1f12dd0d3ac4ff3afe4", - "last_commit": "dc7c1304", + "last_commit": "44d8c06c", "name": "r16_surface", "purpose": "Directory tests/r16_surface. Purpose not yet described by a human." }, { "digest": "b0ba3448394d5f27958c38b7233ae389e5e437e327f0859749a774fb252d6b02", - "last_commit": "dc7c1304", + "last_commit": "40d1ea37", "name": "realize", "purpose": "Directory tests/realize. Purpose not yet described by a human." }, { "digest": "157018d66de5bfd149015654cf0bda1346a9cfcefe5fd552c1d54859cd9ece81", - "last_commit": "dc7c1304", + "last_commit": "30bb116c", "name": "relations", "purpose": "Directory tests/relations. Purpose not yet described by a human." }, { "digest": "e5f68362c083510e34c41f65de3ba2d553eac8a52fbc3e4cc1f69314eac9cc32", - "last_commit": "dc7c1304", + "last_commit": "dd67f6bd", "name": "reservoir", "purpose": "Reservoir tests (omega#440): Gate 1 simulator and readout checks against an independent binary64" }, { "digest": "b766ba124e80979c6d13ddf9bc88dc6f08d68495f47ea096f2c2780d0d68fb23", - "last_commit": "dc7c1304", + "last_commit": "501d555c", "name": "runtime", "purpose": "Directory tests/runtime. Purpose not yet described by a human." }, { "digest": "467652c09505ecbd82d96a5e0e7ea24b19d9216cfd1dad7c60fa8258e47594c0", - "last_commit": "dc7c1304", + "last_commit": "5ae192a4", "name": "searchtrace", "purpose": "Directory tests/searchtrace. Purpose not yet described by a human." }, { "digest": "5c97916fbf20310eff2e502c526337cb093e912cb48f18d44b0345ed8a3c3240", - "last_commit": "dc7c1304", + "last_commit": "54826a37", "name": "train", "purpose": "Directory tests/train. Purpose not yet described by a human." }, { "digest": "7679bd1c49c7e89d8c26ccf8dfb91478f4e6e2f584745806fa8d26061dbdbb9c", - "last_commit": "dc7c1304", + "last_commit": "2564f57a", "name": "turing", "purpose": "Directory tests/turing. Purpose not yet described by a human." }, { "digest": "003966bc697c6f85cfffbae00fae992a634bc386f4a44340daaa8ddcb5618ef6", - "last_commit": "dc7c1304", + "last_commit": "fed4f077", "name": "visor", "purpose": "Directory tests/visor. Purpose not yet described by a human." } ], "children_root": "sha256:a8032c0bd3163305df9246d1e11eaa29d0e624fce9281cacb96d449340913451", - "compiled_at": "2026-10-24T04:15:18Z", + "compiled_at": "2026-10-24T06:12:28Z", "compiler": "crumb-compile/1", - "digest": "sha256:1ea94f184a37ca1ca165b6418a9c06785a540dac27b4b1e63fffe06ef4ca496e", + "digest": "sha256:d6af28f655ad59a2ad7830e84062cfb476a35dfbe2b07f10e054c621891cdbd0", "evidence_files": 16, "evidence_root": "sha256:96d08097822ad95f4e562c19e0ba5df5a035774c48632f1832912c40a27bd27a", "files": 1270, - "generated_at_commit": "dc7c1304c038f49db3b121d5a5e27d7bcab5bf6c", - "source_tree": "sha256:4fa0559f58fdfe83e57bbafc6e3d18b8a93f2fe3734ddbc138577292f0727b9c" + "generated_at_commit": "acf9a7219349ea7010bfb9cad7fa4af068bf77e2", + "source_tree": "sha256:bdc5c5b116d6fb9cc515ab6532592bf9bca5c13f771d755e32c94da9bb271fd8" }, "owner_lane": "", "provenance": { diff --git a/tests/bw_warp_sim.h b/tests/bw_warp_sim.h index 559c42b1d..41513c380 100644 --- a/tests/bw_warp_sim.h +++ b/tests/bw_warp_sim.h @@ -100,6 +100,8 @@ typedef struct { uint32_t smem_bytes; WsRange ranges[WS_MAX_RANGES]; int nranges; /* when > 0, every global access must fall in one */ int order; /* 0 = lowest pc first, 1 = highest pc first */ + uint32_t warp_sched; /* warp visit order per barrier phase: 0 ascending, 1 descending, else a seed for a fresh shuffle each phase + * (the chip gives no order between warps; port of omega#490 bw_warp_sim_k.h) */ int trace; /* print every issue of warp 0 of CTA (0,0) */ /* results */ int err; int err_pc; char msg[200]; @@ -314,9 +316,15 @@ static int ws_run(WsSim *s, uint32_t grid_x, uint32_t grid_y) { /* Barrier phases: every warp runs until all of its fragments are parked at BAR.SYNC or it * has finished (exited lanes do not hold the barrier up: INFERRED, see WS_E_BAR_SPLIT). * Then every parked fragment is released and the next phase starts. */ + uint32_t rng = s->warp_sched; for (int phase = 0; ; phase++) { int parked = 0; - for (uint32_t w = 0; w < nw && !s->err; w++) { + /* visit order: a slot or barrier mistake that the ascending order hides must show under the reversed or a shuffled one */ + uint32_t vis[WS_MAX_WARPS]; + for (uint32_t i = 0; i < nw; i++) vis[i] = s->warp_sched == 1 ? nw - 1u - i : i; + if (s->warp_sched > 1) for (uint32_t i = nw - 1u; i > 0; i--) { rng = rng * 1664525u + 1013904223u; uint32_t j = (rng >> 8) % (i + 1u); uint32_t t = vis[i]; vis[i] = vis[j]; vis[j] = t; } + for (uint32_t vi = 0; vi < nw && !s->err; vi++) { + const uint32_t w = vis[vi]; if (warps[w].nfrag == 0) continue; int r = ws_run_warp(s, &warps[w], w, cx, cy, trace && w == 0); if (r < 0) break; diff --git a/tests/gpu_fp8_api_test.c b/tests/gpu_fp8_api_test.c index 774c473b0..57b53b931 100644 --- a/tests/gpu_fp8_api_test.c +++ b/tests/gpu_fp8_api_test.c @@ -27,7 +27,13 @@ * host no-fold) which the same check must catch * ./gpu_fp8_api_test --out receipt.json chip gate: parity battery, mutants, grouped experts, then the * bandwidth table (median of --reps calls) at the expert and attention shapes + * ./gpu_fp8_api_test --grouped-cold CUT5: the decode graph's two expert launches (gate_up 8 of 128 x 1536 x 2048, + * down 8 of 128 x 2048 x 768) with L2 defeated by rotating 16 disjoint expert + * sets; parity on every timed launch; mutants 1..4; GB/s and fraction of 237.2 * knobs: --lane-bytes N --rows N --warps N --cta-budget N --reps N --spin-us N + * CUT5 variants: --coal 0|1 (A, coalesced output; default 1, AIEN_OMEGA_FP8_COAL=0 turns it off; --coal-default checks that) --wfirst 0|1 (B, weights before x); FP8_SIM_ALL_ORDERS=1 runs every + * simulated kernel in four warp orders (coal kernels always do) + * --sched 0|1 (CUT5 kernel schedule) --variant 1|2 --depth N --no-evict --only NAME * --n N --k K: one custom point n x k instead of the battery (with mutants 1, 2, 4), e.g. 128256 x 2560 * * Pass rule per point: rc OK, every output within TOL of the double oracle relative to the accumulation @@ -38,6 +44,7 @@ #include "omega_blackwell_codegen_moe.h" #include "omega_blackwell_matmul.h" #include "omega_gpu_session.h" +#include "omega_gpu_cmdlist.h" #include "bw_warp_sim.h" #include #include @@ -93,6 +100,63 @@ static double parity(const Weights *W, uint32_t groups, const uint32_t *ids, con return worst; } +/* ---------------------------------------------- stall checker (CUT5) */ +/* Independent of the generator's pass (a different walk, as tests/gpu_tern_api_test.c does): for every fixed-latency + * write, scan forward summing stalls; any instruction that reads or overwrites one of its registers, any control + * instruction and any branch target reached before OMEGA_FP8_FIXED_LAT cycles is a violation. */ +static int fp8_chk_fixed(BlackwellIROpcode op) { + return op == BW_IR_IMAD || op == BW_IR_IMAD_WIDE || op == BW_IR_SHF_R || op == BW_IR_LOP3_AND || op == BW_IR_LOP3_XOR || + op == BW_IR_MOV_IMM || op == BW_IR_MOV_RZ || op == BW_IR_FFMA || op == BW_IR_FADD; +} +static int fp8_chk_overlap(const BlackwellIRProgram *p, int a, int b) { + if (a < 0 || b < 0) return 0; + const int pa = p->regalloc.vreg_to_phys[a], pb = p->regalloc.vreg_to_phys[b]; + if (pa < 0 || pb < 0) return 0; + const int na = (int)(p->regalloc.intervals[a].bundle_size ? p->regalloc.intervals[a].bundle_size : 1u); + const int nb = (int)(p->regalloc.intervals[b].bundle_size ? p->regalloc.intervals[b].bundle_size : 1u); + return pa < pb + nb && pb < pa + na; +} +/* CUT5 A/B structure counters (independent of the generator): instructions of one opcode, and global-load batches. A batch + * opens at a global load issued while no batch is open; any instruction whose wait mask holds the load scoreboard (bit 0 of + * the wait field, SB_GPR in the generator) closes it. One batch = one memory round trip the warp waits for. */ +static int fp8_count_op(const BlackwellIRProgram *p, BlackwellIROpcode op) { int n = 0; for (size_t i = 0; i < p->count; i++) n += p->insns[i].op == op; return n; } +static int fp8_load_batches(const BlackwellIRProgram *p) { + int n = 0, open = 0; + for (size_t i = 0; i < p->count; i++) { + const BlackwellIRInsn *in = &p->insns[i]; + if ((in->control >> 20) & 1u) open = 0; + const int gl = in->op == BW_IR_LDG_E || in->op == BW_IR_LDG_E_64 || in->op == BW_IR_LDG_E_128; + if (gl && !open) { n++; open = 1; } + } + return n; +} +static long fp8_stall_violations(const BlackwellIRProgram *p, uint64_t *cycles) { + static uint8_t tgt[BW_MAX_IR_INSNS + 1]; + memset(tgt, 0, sizeof tgt); + long bad = 0; uint64_t cyc = 0; + for (size_t i = 0; i < p->count; i++) { + const BlackwellIRInsn *in = &p->insns[i]; + cyc += (in->control >> 9) & 0xfu; + if (in->op == BW_IR_BRA || in->op == BW_IR_BSSY) { long t = (long)i + (long)(int32_t)in->imm; if (t >= 0 && t <= (long)p->count) tgt[t] = 1; } + } + for (size_t i = 0; i < p->count; i++) { + const BlackwellIRInsn *in = &p->insns[i]; + if (!fp8_chk_fixed(in->op) || in->dst_vreg < 0) continue; + uint32_t dist = 0; + for (size_t j = i + 1; j < p->count; j++) { + dist += (p->insns[j - 1].control >> 9) & 0xfu; + if (dist >= OMEGA_FP8_FIXED_LAT) break; + const BlackwellIRInsn *u = &p->insns[j]; + const BlackwellIROpcode o = u->op; + if (o == BW_IR_BRA || o == BW_IR_EXIT || o == BW_IR_BSSY || o == BW_IR_BSYNC || o == BW_IR_BAR_SYNC || tgt[j]) { bad++; break; } + if (fp8_chk_overlap(p, in->dst_vreg, u->dst_vreg) || fp8_chk_overlap(p, in->dst_vreg, u->src1_vreg) || + fp8_chk_overlap(p, in->dst_vreg, u->src2_vreg) || fp8_chk_overlap(p, in->dst_vreg, u->src3_vreg)) { bad++; break; } + } + } + if (cycles) *cycles = cyc; + return bad; +} + /* ------------------------------------------------------------- host-only */ static int nvdisasm_check_v(int variant, const OmegaFp8GemvSpec *spec, const char *name); static int nvdisasm_check(const OmegaFp8GemvSpec *spec, const char *name) { return nvdisasm_check_v(1, spec, name); } @@ -127,7 +191,35 @@ static int nvdisasm_check_v(int variant, const OmegaFp8GemvSpec *spec, const cha return (rc == 0 && bad == 0 && miss == 0) ? 0 : -1; } +/* Variant A default (SPEED-A, 2026-10-17): coal is ON unless AIEN_OMEGA_FP8_COAL=0 (or set_coal(0)), and coal 0 gives back + * the earlier kernel (one STG per row, no BAR.SYNC, no shared slots) at the decode graph's two grouped expert shapes and the + * single-projection o_proj shape. make test-gpu-fp8 runs this once with the env unset and once with AIEN_OMEGA_FP8_COAL=0. */ +static int g_coal_arg; /* --coal given: the env default is not what is being tested */ +static void coal_default_check(void) { + const char *e = getenv("AIEN_OMEGA_FP8_COAL"); + const int want = (e && e[0] == '0' && e[1] == 0) ? 0 : 1; + CHECK(omega_gpu_fp8_coal() == want, "coal default %d with AIEN_OMEGA_FP8_COAL=%s (want %d)", omega_gpu_fp8_coal(), e ? e : "(unset)", want); + static const struct { uint32_t k, n, groups; const char *name; } sh[] = { + { 2048, 1536, 8, "gate_up 8 x 1536 x 2048" }, { 768, 2048, 8, "down 8 x 2048 x 768" }, { 4096, 2048, 1, "o_proj 2048 x 4096" } }; + for (int pass = 0; pass < 3; pass++) { + const int on = pass == 0 ? want : pass == 1 ? 0 : 1; + if (pass) omega_gpu_fp8_set_coal(on); + for (size_t q = 0; q < sizeof sh / sizeof sh[0]; q++) { + OmegaFp8GemvSpec sp; omega_gpu_fp8_spec_for(sh[q].k, sh[q].n, sh[q].groups, &sp); + const int fits = sp.warps * sp.rows <= 32u; + static BlackwellIRProgram p; + const int rc = omega_blackwell_codegen_fp8_gemv_prog(&sp, &p); + const int coal = on && fits, bar = rc == 0 ? fp8_count_op(&p, BW_IR_BAR_SYNC) : -1, stg = rc == 0 ? fp8_count_op(&p, BW_IR_STG_E) : -1; + CHECK(rc == 0 && sp.coal == (uint32_t)coal && stg == 1 && (sp.depth ? 1 : bar == coal) && (omega_fp8_gemv_shared_bytes(&sp) != 0) == (coal || sp.depth != 0), + "%s coal %d (pass %d, warps %u rows %u depth %u): spec.coal %u, STG %d, BAR.SYNC %d, shared %u", sh[q].name, on, pass, sp.warps, sp.rows, sp.depth, sp.coal, stg, bar, omega_fp8_gemv_shared_bytes(&sp)); + if (pass == 0) printf("coal default %d: %s warps %u rows %u depth %u -> spec.coal %u, STG %d, BAR.SYNC %d\n", want, sh[q].name, sp.warps, sp.rows, sp.depth, sp.coal, stg, bar); + } + } + omega_gpu_fp8_set_coal(want); +} + static void host_only(void) { + if (!g_coal_arg) coal_default_check(); /* 1. exhaustive conversion: kernel bits * 2^120 == reference, bit for bit, for every non-NaN code; * sign of zero preserved; NaN codes are exactly 0x7f and 0xff and are refused by the scan */ int exact = 0, nan_codes = 0, zero_sign_ok = 0, f32_subnormal = 0; @@ -250,6 +342,102 @@ static void host_only(void) { OmegaFp8GemvSpec v = { .k = 2048, .lane_bytes = 16, .rows = 1, .warps = 16 }; CHECK(nvdisasm_check_v(2, &v, "v2_k2048_lb16_r1_w16") == 0, "nvdisasm listing v2 k=2048"); } + + /* 7. sched 1 (CUT5): pipelined decode + dependency stall pass. Every battery shape builds; the two grouped expert + * shapes fit the register file at 32 warps; an independent walk finds no user closer than OMEGA_FP8_FIXED_LAT + * cycles to a fixed-latency write; shortening one binding stall must be caught (the checker can say no); the + * sched 0 programs pass the same checker (they stall 6 everywhere) */ + { + int built1 = 0; long viol_all = 0; + for (size_t a = 0; a < sizeof ks / sizeof ks[0]; a++) for (size_t b = 0; b < 2; b++) for (size_t c = 0; c < 4; c++) for (int m = 0; m <= 3; m++) for (int deep = 0; deep < 2; deep++) { + OmegaFp8GemvSpec sp = { .k = ks[a], .lane_bytes = lbs[b], .rows = rows[c], .warps = 8, .mutant = m, .sched = 1 }; + if (ks[a] % (32 * lbs[b])) continue; + if (deep) { sp.depth = ks[a] / (32 * lbs[b]); if (sp.depth * sp.rows * lbs[b] > 128 || ks[a] > 4096) continue; } + static BlackwellIRProgram cp; + int rc = omega_blackwell_codegen_fp8_gemv_prog(&sp, &cp); + CHECK(rc == 0 && cp.count <= BW_MAX_IR_INSNS, "sched1 codegen k=%u lb=%u rows=%u mutant=%d deep=%d", sp.k, sp.lane_bytes, sp.rows, m, deep); + if (rc != 0) continue; + built1++; + long v = fp8_stall_violations(&cp, NULL); + viol_all += v; + CHECK(v == 0, "sched1 stall distances k=%u lb=%u rows=%u mutant=%d deep=%d: %ld users closer than %u cycles", sp.k, sp.lane_bytes, sp.rows, m, deep, v, OMEGA_FP8_FIXED_LAT); + } + printf("sched1 codegen: %d kernels built, %ld stall-distance violations\n", built1, viol_all); + static const struct { uint32_t k, lb; const char *name; } prod[] = { { 2048, 16, "gate_up k2048 lb16" }, { 768, 8, "down k768 lb8" } }; + for (size_t q = 0; q < 2; q++) { + static BlackwellIRProgram p0, p1; + OmegaFp8GemvSpec s0 = { .k = prod[q].k, .lane_bytes = prod[q].lb, .rows = 1, .warps = 32 }, s1 = s0; s1.sched = 1; + uint32_t d1 = 0, g1 = 0, g0 = 0; + const int ok = omega_blackwell_codegen_fp8_gemv_prog(&s0, &p0) == 0 && omega_blackwell_codegen_fp8_gemv_prog(&s1, &p1) == 0; + CHECK(ok, "sched 0 and 1 build at %s 32 warps", prod[q].name); + if (!ok) continue; + CHECK(omega_fp8_gemv_prog_stats(&s0, NULL, &g0) == 0 && omega_fp8_gemv_prog_stats(&s1, NULL, &g1) == 0, "stats %s", prod[q].name); + CHECK(omega_gpu_fp8_kernel_fits(&s1, &d1) == OMEGA_GPU_FP8_OK, "sched1 %s at 32 warps fits the register file (declared %u): %s", prod[q].name, d1, omega_gpu_fp8_last_error()); + uint64_t c0 = 0, c1 = 0; + const long v0 = fp8_stall_violations(&p0, &c0), v1 = fp8_stall_violations(&p1, &c1); + CHECK(v0 == 0 && v1 == 0, "%s stall distances: sched0 %ld, sched1 %ld violations", prod[q].name, v0, v1); + /* negative control: the pass gives each instruction its smallest legal stall, so a fixed-latency stall above 1 + * is binding; shortening the first one to 1 must be caught by the independent walk */ + size_t at = p1.count; + for (size_t i = 0; i < p1.count; i++) if (fp8_chk_fixed(p1.insns[i].op) && ((p1.insns[i].control >> 9) & 0xfu) > 1u) { at = i; break; } + if (at < p1.count) p1.insns[at].control = (p1.insns[at].control & ~(0xfu << 9)) | (1u << 9); + CHECK(at < p1.count && fp8_stall_violations(&p1, NULL) > 0, "%s: stall checker catches one shortened stall", prod[q].name); + printf("sched1 %s w32: %zu insns (sched0 %zu), peak %u GPRs (sched0 %u), declared %u; stall cycles in program order %" PRIu64 " (sched0 %" PRIu64 "); shortened-stall control caught\n", + prod[q].name, p1.count, p0.count, g1, g0, d1, c1, c0); + } + { OmegaFp8GemvSpec bad = { .k = 2048, .lane_bytes = 16, .rows = 1, .warps = 8, .sched = 2 }; CHECK(omega_fp8_gemv_prog_stats(&bad, NULL, NULL) != 0, "sched 2 refused"); } + } + + /* 8. CUT5 variants A (coal: coalesced output through shared slots) and B (wfirst: weight loads before the x' loads). + * Every battery shape builds in every combination with sched 0 and 1 (sched 1 with no stall violation); the refusals + * hold; for the two grouped expert shapes at 32 warps: the register file fits, A has one STG and one BAR.SYNC per + * round and declares the two slot sets, and B removes exactly one load round trip per K step (fp8_load_batches: + * a global load that follows a wait on the load scoreboard opens a new batch). Default programs keep their batch + * count, so the counter says "no" when nothing changed (deep kernels, which ignore wfirst). */ + { + int built = 0; long viol = 0; + for (size_t a = 0; a < sizeof ks / sizeof ks[0]; a++) for (size_t b = 0; b < 2; b++) for (size_t c = 0; c < 4; c++) + for (int m = 0; m <= 5; m++) for (int deep = 0; deep < 2; deep++) for (int cw = 1; cw < 4; cw++) for (int sch = 0; sch < 2; sch++) { + OmegaFp8GemvSpec sp = { .k = ks[a], .lane_bytes = lbs[b], .rows = rows[c], .warps = 4, .mutant = m, .sched = (uint32_t)sch, .coal = (uint32_t)(cw & 1), .wfirst = (uint32_t)(cw >> 1) }; + if (ks[a] % (32 * lbs[b]) || (m >= 4 && !sp.coal)) continue; + if (deep) { sp.depth = ks[a] / (32 * lbs[b]); if (sp.depth * sp.rows * lbs[b] > 128 || ks[a] > 2048) continue; } + static BlackwellIRProgram cp; + int rc = omega_blackwell_codegen_fp8_gemv_prog(&sp, &cp); + CHECK(rc == 0 && cp.count <= BW_MAX_IR_INSNS, "A/B codegen k=%u lb=%u rows=%u mutant=%d deep=%d coal=%u wfirst=%u sched=%d", sp.k, sp.lane_bytes, sp.rows, m, deep, sp.coal, sp.wfirst, sch); + if (rc != 0) continue; + built++; + if (sch) { long v = fp8_stall_violations(&cp, NULL); viol += v; CHECK(v == 0, "A/B sched1 stall distances k=%u lb=%u rows=%u coal=%u wfirst=%u: %ld", sp.k, sp.lane_bytes, sp.rows, sp.coal, sp.wfirst, v); } + } + printf("A/B codegen: %d kernels built (coal, wfirst, both x sched 0/1 x mutants), %ld stall-distance violations\n", built, viol); + { OmegaFp8GemvSpec bad = { .k = 2048, .lane_bytes = 16, .rows = 2, .warps = 32, .coal = 1 }; CHECK(omega_fp8_gemv_prog_stats(&bad, NULL, NULL) != 0, "coal refused at warps x rows = 64"); + bad.rows = 1; bad.coal = 2; CHECK(omega_fp8_gemv_prog_stats(&bad, NULL, NULL) != 0, "coal 2 refused"); + bad.coal = 0; bad.wfirst = 2; CHECK(omega_fp8_gemv_prog_stats(&bad, NULL, NULL) != 0, "wfirst 2 refused"); + bad.wfirst = 0; bad.mutant = 4; CHECK(omega_fp8_gemv_prog_stats(&bad, NULL, NULL) != 0, "mutant 4 refused without coal"); } + static const struct { uint32_t k, lb; const char *name; } prod[] = { { 2048, 16, "gate_up k2048 lb16" }, { 768, 8, "down k768 lb8" } }; + for (size_t q = 0; q < 2; q++) { + static BlackwellIRProgram p0, pa, pb, pab; + OmegaFp8GemvSpec s0 = { .k = prod[q].k, .lane_bytes = prod[q].lb, .rows = 1, .warps = 32 }, sa = s0, sb = s0, sab = s0; + sa.coal = 1; sb.wfirst = 1; sab.coal = 1; sab.wfirst = 1; + const int ok = omega_blackwell_codegen_fp8_gemv_prog(&s0, &p0) == 0 && omega_blackwell_codegen_fp8_gemv_prog(&sa, &pa) == 0 && + omega_blackwell_codegen_fp8_gemv_prog(&sb, &pb) == 0 && omega_blackwell_codegen_fp8_gemv_prog(&sab, &pab) == 0; + CHECK(ok, "A, B, A+B build at %s 32 warps", prod[q].name); + if (!ok) continue; + uint32_t da = 0, db = 0, dab = 0; + CHECK(omega_gpu_fp8_kernel_fits(&sa, &da) == OMEGA_GPU_FP8_OK && omega_gpu_fp8_kernel_fits(&sb, &db) == OMEGA_GPU_FP8_OK && omega_gpu_fp8_kernel_fits(&sab, &dab) == OMEGA_GPU_FP8_OK, + "%s A/B/A+B fit the register file at 32 warps (declared %u %u %u)", prod[q].name, da, db, dab); + const int stg0 = fp8_count_op(&p0, BW_IR_STG_E), stga = fp8_count_op(&pa, BW_IR_STG_E), bar0 = fp8_count_op(&p0, BW_IR_BAR_SYNC), bara = fp8_count_op(&pa, BW_IR_BAR_SYNC); + CHECK(stg0 == 1 && stga == 1 && bar0 == 0 && bara == 1 && omega_fp8_gemv_shared_bytes(&sa) == 2u * 32u * 4u && omega_fp8_gemv_shared_bytes(&s0) == 0, + "%s A: STG %d (default %d), BAR.SYNC %d (default %d), shared %u bytes", prod[q].name, stga, stg0, bara, bar0, omega_fp8_gemv_shared_bytes(&sa)); + const int b0 = fp8_load_batches(&p0), bb = fp8_load_batches(&pb), ba = fp8_load_batches(&pa), bab = fp8_load_batches(&pab); + CHECK(b0 - bb == 1 && ba - bab == 1, "%s B: load batches default %d -> wfirst %d, coal %d -> coal+wfirst %d (one round trip less per K step)", prod[q].name, b0, bb, ba, bab); + OmegaFp8GemvSpec sd = s0, sdb; sd.warps = 8; sd.depth = omega_fp8_gemv_steps(&sd); sdb = sd; sdb.wfirst = 1; + static BlackwellIRProgram pd, pdb; + const int okd = omega_blackwell_codegen_fp8_gemv_prog(&sd, &pd) == 0 && omega_blackwell_codegen_fp8_gemv_prog(&sdb, &pdb) == 0; + CHECK(okd && fp8_load_batches(&pd) == fp8_load_batches(&pdb) && pd.count == pdb.count, "%s deep: wfirst changes nothing (batches %d, %d)", prod[q].name, okd ? fp8_load_batches(&pd) : -1, okd ? fp8_load_batches(&pdb) : -1); + printf("A/B %s w32: insns %zu / A %zu / B %zu / A+B %zu; declared regs A %u B %u A+B %u; load batches %d / %d / %d / %d\n", + prod[q].name, p0.count, pa.count, pb.count, pab.count, da, db, dab, b0, ba, bb, bab); + } + } } /* ------------------------------------------------------------- simulator */ @@ -276,10 +464,12 @@ static int sim_gemv(const OmegaFp8GemvSpec *spec, const Weights *W, uint32_t gro float *copy = malloc((size_t)groups * n * 4); uint32_t grid_x = (RG + spec->warps - 1) / spec->warps; if (grid_x > cta_budget) grid_x = cta_budget; if (!grid_x) grid_x = 1; int err = 0; - for (int order = 0; order < 2 && !err; order++) { + const int runs = (spec->coal || getenv("FP8_SIM_ALL_ORDERS")) ? 4 : 2; /* coal: also descending and shuffled warp visit orders per barrier phase (slot races) */ + for (int run = 0; run < runs && !err; run++) { + const int order = run == 1; WsSim s; memset(&s, 0, sizeof s); - s.p = &prog; s.threads = 32 * spec->warps; s.order = order; - static uint8_t smem[OMEGA_FP8_MAX_K * 4]; s.smem = smem; s.smem_bytes = g_sim_variant == 2 ? omega_fp8_gemv2_shared_bytes(spec) : omega_fp8_gemv_shared_bytes(spec); /* the bytes the launch declares (0: any shared access fails) */ + s.p = &prog; s.threads = 32 * spec->warps; s.order = order; s.warp_sched = run == 2 ? 1u : run == 3 ? 0x9e3779b9u : 0u; + static uint8_t smem[OMEGA_FP8_MAX_K * 4 + 4096]; s.smem = smem; s.smem_bytes = g_sim_variant == 2 ? omega_fp8_gemv2_shared_bytes(spec) : omega_fp8_gemv_shared_bytes(spec); /* the bytes the launch declares (0: any shared access fails) */ uint64_t ta = (uintptr_t)tab, xa = (uintptr_t)xf, ya = (uintptr_t)yd; s.cbank[OMEGA_FP8_ARG_TAB / 4] = (uint32_t)ta; s.cbank[OMEGA_FP8_ARG_TAB / 4 + 1] = (uint32_t)(ta >> 32); s.cbank[OMEGA_FP8_ARG_X / 4] = (uint32_t)xa; s.cbank[OMEGA_FP8_ARG_X / 4 + 1] = (uint32_t)(xa >> 32); @@ -296,12 +486,12 @@ static int sim_gemv(const OmegaFp8GemvSpec *spec, const Weights *W, uint32_t gro 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; err = ws_run(&s, grid_x, groups); - if (err) { snprintf(msg, msglen, "order %d: %s", order, s.msg); break; } + if (err) { snprintf(msg, msglen, "run %d (order %d, warp order %u): %s", run, order, s.warp_sched, s.msg); 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; } - if (order == 0) memcpy(copy, yd, (size_t)groups * n * 4); - else if (memcmp(copy, yd, (size_t)groups * n * 4) != 0) { err = -1; snprintf(msg, msglen, "the fragment order changed the result"); } + if (run == 0) memcpy(copy, yd, (size_t)groups * n * 4); + else if (memcmp(copy, yd, (size_t)groups * n * 4) != 0) { if (getenv("FP8_SIM_DIFF")) { int c = 0; for (size_t i = 0; i < (size_t)groups * n && c < 12; i++) if (memcmp(©[i], &yd[i], 4)) { fprintf(stderr, " diff y[%zu] %g vs %g\n", i, copy[i], yd[i]); c++; } } err = -1; snprintf(msg, msglen, "run %d (order %d, warp order %u) changed the result", run, order, s.warp_sched); } } if (!err) memcpy(y, yd, (size_t)groups * n * 4); free(sf); free(xf); free(tab); free(yd); free(copy); @@ -447,6 +637,97 @@ static void sim_battery(uint32_t cta_budget) { } printf("sim v2 battery: %d/%zu points bit-identical to variant 1\n", identical, n2); } + + /* 4. sched 1 (CUT5): y bit-identical to sched 0 on every battery point (step and deep kernels), parity against the + * oracle, mutants 1..3 caught on the grouped points; the identity check is shown to say "no" on a mutant */ + { + int identical = 0, runs = 0; + for (size_t i = 0; i < npts; i++) { + const SimPoint *p = &pts[i]; + Weights W; weights_make(&W, p->experts, p->n, p->k, 1000 + (uint32_t)i); + uint32_t ids[8]; uint32_t st = 77 + (uint32_t)i; + for (uint32_t g = 0; g < p->groups; g++) ids[g] = lcg(&st) % p->experts; + float *x = malloc((size_t)p->x_rows * p->k * 4); for (size_t j = 0; j < (size_t)p->x_rows * p->k; j++) x[j] = frand(&st, -1.0f, 1.0f); + const size_t ny = (size_t)p->groups * p->n; + float *y0 = malloc(ny * 4), *y1 = malloc(ny * 4); + for (int deep = 0; deep < 2; deep++) { + OmegaFp8GemvSpec sp = { .k = p->k, .lane_bytes = p->lb, .rows = p->rows, .warps = p->warps }; + if (deep) { sp.depth = omega_fp8_gemv_steps(&sp); if (sp.depth * sp.rows * sp.lane_bytes > 128 || p->k > 512 * p->warps) continue; } + char nm[96]; snprintf(nm, sizeof nm, "sched1 %s%s", p->name, deep ? " deep" : ""); + int rc0 = sim_gemv(&sp, &W, p->groups, ids, x, p->x_rows, y0, cta_budget, 0, msg, sizeof msg); + CHECK(rc0 == 0, "sched0 reference for %s: %s", nm, msg); + OmegaFp8GemvSpec s1 = sp; s1.sched = 1; + int rc1 = sim_gemv(&s1, &W, p->groups, ids, x, p->x_rows, y1, cta_budget, 0, msg, sizeof msg); + size_t bad = 0; double worst = rc1 == 0 ? parity(&W, p->groups, ids, x, p->x_rows, y1, &bad) : 1.0; + int same = rc0 == 0 && rc1 == 0 && memcmp(y0, y1, ny * 4) == 0; + CHECK(rc1 == 0 && bad == 0 && same, "sim %s: rc=%d bad=%zu worst_rel=%.3e identical_to_sched0=%d %s", nm, rc1, bad, worst, same, msg); + runs++; if (same) identical++; + printf("sim %-52s rc=%d worst_rel=%.3e bad=%zu identical_to_sched0=%d\n", nm, rc1, worst, bad, same); + if (i == 7 || i == 8) { + for (int m = 1; m <= 3; m++) { + if (m == 2 && omega_fp8_gemv_steps(&sp) < 2) continue; + OmegaFp8GemvSpec ms = s1; ms.mutant = m; + int rcm = sim_gemv(&ms, &W, p->groups, ids, x, p->x_rows, y1, cta_budget, 0, msg, sizeof msg); + bad = 0; worst = rcm == 0 ? parity(&W, p->groups, ids, x, p->x_rows, y1, &bad) : 1.0; + int caught = rcm != 0 || bad > 0, differs = rcm != 0 || memcmp(y0, y1, ny * 4) != 0; + CHECK(caught && differs, "sim %s mutant %d NOT caught (bad=%zu worst_rel=%.3e identity says %s)", nm, m, bad, worst, differs ? "different" : "SAME"); + printf("sim %-52s mutant %d: %s (rc=%d bad=%zu worst_rel=%.3e, identity check differs=%d)\n", nm, m, caught ? "caught" : "MISSED", rcm, bad, worst, differs); + } + } + } + free(x); free(y0); free(y1); weights_free(&W); + } + printf("sim sched1 battery: %d/%d runs bit-identical to sched 0\n", identical, runs); + } + + /* 5. CUT5 variants A (coal) and B (wfirst), alone and together: y bit-identical to the default on every battery point + * where A applies (warps * rows <= 32), step and deep kernels, parity against the oracle; coal kernels run in four + * orders (fragment order both ways, warps descending and shuffled per barrier phase). Mutants: 4 (one slot set) must + * be caught by a warp order (points with two or more rounds per CTA), 5 (no clamp) on the points whose last round is + * partial (6, 10), 1..3 on the A+B kernel of point 8 (1, 2 also on point 9). */ + { + int identical = 0, runs = 0; + for (size_t i = 0; i < npts; i++) { + const SimPoint *p = &pts[i]; + Weights W; weights_make(&W, p->experts, p->n, p->k, 1000 + (uint32_t)i); + uint32_t ids[8]; uint32_t st = 77 + (uint32_t)i; + for (uint32_t g = 0; g < p->groups; g++) ids[g] = lcg(&st) % p->experts; + float *x = malloc((size_t)p->x_rows * p->k * 4); for (size_t j = 0; j < (size_t)p->x_rows * p->k; j++) x[j] = frand(&st, -1.0f, 1.0f); + const size_t ny = (size_t)p->groups * p->n; + float *y0 = malloc(ny * 4), *y1 = malloc(ny * 4); + for (int deep = 0; deep < 2; deep++) { + OmegaFp8GemvSpec sp = { .k = p->k, .lane_bytes = p->lb, .rows = p->rows, .warps = p->warps }; + if (deep) { sp.depth = omega_fp8_gemv_steps(&sp); if (sp.depth * sp.rows * sp.lane_bytes > 128 || p->k > 512 * p->warps) continue; } + int rc0 = sim_gemv(&sp, &W, p->groups, ids, x, p->x_rows, y0, cta_budget, 0, msg, sizeof msg); + CHECK(rc0 == 0, "default reference for A/B %s%s: %s", p->name, deep ? " deep" : "", msg); + for (int cw = 1; cw < 4; cw++) { + OmegaFp8GemvSpec sv = sp; sv.coal = (uint32_t)(cw & 1); sv.wfirst = (uint32_t)(cw >> 1); + if (sv.coal && p->warps * p->rows > 32) continue; + char nm[96]; snprintf(nm, sizeof nm, "%s %s%s", cw == 1 ? "A" : cw == 2 ? "B" : "A+B", p->name, deep ? " deep" : ""); + int rc1 = sim_gemv(&sv, &W, p->groups, ids, x, p->x_rows, y1, cta_budget, 0, msg, sizeof msg); + size_t bad = 0; double worst = rc1 == 0 ? parity(&W, p->groups, ids, x, p->x_rows, y1, &bad) : 1.0; + int same = rc0 == 0 && rc1 == 0 && memcmp(y0, y1, ny * 4) == 0; + CHECK(rc1 == 0 && bad == 0 && same, "sim %s: rc=%d bad=%zu worst_rel=%.3e identical_to_default=%d %s", nm, rc1, bad, worst, same, msg); + runs++; if (same) identical++; + printf("sim %-52s rc=%d worst_rel=%.3e bad=%zu identical_to_default=%d\n", nm, rc1, worst, bad, same); + int ms_list[5], nm_list = 0; + if (sv.coal && cw == 1 && (i == 6 || i == 10)) ms_list[nm_list++] = 5; + if (sv.coal && cw == 1 && (i == 1 || i == 6 || i == 8 || i == 10)) ms_list[nm_list++] = 4; + if (cw == 3 && (i == 8 || i == 9)) { ms_list[nm_list++] = 1; if (omega_fp8_gemv_steps(&sp) >= 2) ms_list[nm_list++] = 2; if (i == 8) ms_list[nm_list++] = 3; } /* point 9 draws the same expert for both groups: a table swap is invisible there */ + for (int q = 0; q < nm_list; q++) { + OmegaFp8GemvSpec ms = sv; ms.mutant = ms_list[q]; + int rcm = sim_gemv(&ms, &W, p->groups, ids, x, p->x_rows, y1, cta_budget, 0, msg, sizeof msg); + bad = 0; worst = rcm == 0 ? parity(&W, p->groups, ids, x, p->x_rows, y1, &bad) : 1.0; + int caught = rcm != 0 || bad > 0; + CHECK(caught, "sim %s mutant %d NOT caught (bad=%zu worst_rel=%.3e)", nm, ms.mutant, bad, worst); + printf("sim %-52s mutant %d: %s (rc=%d bad=%zu %s)\n", nm, ms.mutant, caught ? "caught" : "MISSED", rcm, bad, rcm ? msg : ""); + } + } + } + free(x); free(y0); free(y1); weights_free(&W); + } + printf("sim A/B battery: %d/%d runs bit-identical to the default\n", identical, runs); + } } /* ------------------------------------------------------------------- chip */ @@ -466,6 +747,140 @@ static const char *g_only; static int g_depth_forced; /* run only the battery po /* --n N --k K (ternary engine T0, 2026-10-15): run ONE custom point n x k (one expert, one group) instead of the battery, * with the parity check, timing and mutants 1, 2 and 4 (3 needs groups > 1); e.g. the BitNet word table 128256 x 2560. */ static uint32_t g_custom_n, g_custom_k; static char g_custom_name[48]; +/* --grouped-cold (CUT5, 2026-10-16): the decode graph's two expert launches at their real shapes (omega_gpu_decode_graph.c + * record_layer: gate_up [128][1536][2048] with one shared x row, down [128][2048][768] with one x row per group), 8 of 128 + * experts per launch. L2 is defeated by rotation: the 128 experts are split into 16 disjoint sets of 8 and launch r uses + * set r % 16, so consecutive launches share no weight byte and a set returns only after 15 other sets (gate_up 403 MB, + * down 201 MB in between; L2 is 24 MiB, evidence/TERN-T0-KT1-18185404-20261016T0151Z/README.md). Every timed launch is + * checked against the double oracle (outside the chip time); a launch that fails parity fails the run. Mutants 1..4 + * must be caught at both shapes. GB/s = (weight + scale bytes of the 8 experts) / median chip time (launch to completion + * marker: the launch floor is NOT subtracted). */ +static int g_cold; +/* GPU-clock timing for --grouped-cold (CUT5, after omega#507: a host clock around submit and completion is not kernel time). + * The rotation above, recorded as one command list of LIST_N launches (launch i uses set i % 16, writes its own y slot), + * WAIT_FOR_IDLE + shader-cache invalidate before every launch (the decode graph's default barrier), GPU timestamps + * (PTIMER) before launch 0 and after every launch; launch time = stamp[i + 1] - stamp[i] (the barrier and launch floor are + * inside it, not subtracted). Every launch's y is checked against the oracle after the list. lists x LIST_N launches. */ +#define LIST_N 32u +static int cold_list_stamps(const ChipPoint *p, const Weights *W, const OmegaGpuFp8Tensor *t, const uint32_t *perm, const float *x, + uint32_t lists, uint64_t *el, uint32_t *n_el, size_t *bad_out, double *worst_out) { + const size_t ny = (size_t)p->groups * p->n; + OmegaGpuCmdList *cl = NULL; OmegaGpuMem tab, xd, yd; int ok = 1; + memset(&tab, 0, sizeof tab); memset(&xd, 0, sizeof xd); memset(&yd, 0, sizeof yd); + if (omega_gpu_cmdlist_create(LIST_N, &cl) != 0) { printf("cmdlist create: %s\n", omega_gpu_session_last_error()); return -1; } + omega_gpu_session_lock(); + int arc = omega_gpu_session_alloc((size_t)16u * p->groups * 16u, &tab) | omega_gpu_session_alloc((size_t)p->x_rows * p->k * 4u, &xd) | omega_gpu_session_alloc((size_t)LIST_N * ny * 4u, &yd); + omega_gpu_session_unlock(); + if (arc != 0) { printf("list alloc: %s\n", omega_gpu_session_last_error()); ok = 0; } + if (ok) { + uint64_t *tw = tab.cpu; + for (uint32_t s = 0; s < 16u && ok; s++) for (uint32_t g = 0; g < p->groups; g++) + if (omega_gpu_fp8_tensor_entry(t, perm[8u * s + g], &tw[2u * (s * p->groups + g)], &tw[2u * (s * p->groups + g) + 1u]) != 0) ok = 0; + for (uint32_t r = 0; r < p->x_rows; r++) omega_fp8_pack_x_f32(x + (size_t)r * p->k, p->k, (float *)xd.cpu + (size_t)r * p->k); + if (!ok || omega_gpu_session_sync_to_gpu(&tab) != 0 || omega_gpu_session_sync_to_gpu(&xd) != 0) ok = 0; + } + size_t bad_all = 0; double worst_all = 0.0; uint32_t n = 0; + for (uint32_t l = 0; l < lists && ok; l++) { + float *y = yd.cpu; for (size_t i = 0; i < (size_t)LIST_N * ny; i++) y[i] = -999.0f; + if (omega_gpu_session_sync_to_gpu(&yd) != 0) { ok = 0; break; } + if (g_evict) evict_host_caches(); + omega_gpu_session_lock(); + omega_gpu_cmdlist_reset(cl); + for (uint32_t i = 0; i < LIST_N && ok; i++) + if (omega_gpu_fp8_gemv_grouped_record(cl, t, p->groups, tab.va + (uint64_t)(i % 16u) * p->groups * 16u, xd.va, p->x_rows, yd.va + (uint64_t)i * ny * 4u) != 0) { printf("record: %s\n", omega_gpu_fp8_last_error()); ok = 0; } + OmegaGpuCmdListOpts o; memset(&o, 0, sizeof o); o.mode = OMEGA_GPU_CMDLIST_PCAS; o.barrier = OMEGA_GPU_CMDLIST_BARRIER_WFI; o.stamps = 1; + OmegaGpuCmdListStats cs; memset(&cs, 0, sizeof cs); + uint64_t sts[LIST_N + 1]; int cnt = -1; + if (ok && omega_gpu_cmdlist_submit(cl, &o, &cs) != 0) { printf("submit: %s\n", omega_gpu_session_last_error()); ok = 0; } + if (ok) cnt = omega_gpu_cmdlist_stamps(cl, sts, LIST_N + 1); + omega_gpu_session_unlock(); + if (!ok || cnt != (int)LIST_N + 1 || cs.sems_done != LIST_N) { printf("list %u: stamps %d sems_done %u\n", l, cnt, cs.sems_done); ok = 0; break; } + if (omega_gpu_session_sync_to_cpu(&yd) != 0) { ok = 0; break; } + for (uint32_t i = 0; i < LIST_N; i++) { + size_t b = 0; double w = parity(W, p->groups, perm + 8u * (i % 16u), x, p->x_rows, y + (size_t)i * ny, &b); + bad_all += b; if (w > worst_all) worst_all = w; + el[n++] = sts[i + 1] - sts[i]; + } + } + omega_gpu_session_lock(); omega_gpu_session_free(&tab); omega_gpu_session_free(&xd); omega_gpu_session_free(&yd); omega_gpu_session_unlock(); + omega_gpu_cmdlist_free(cl); + *n_el = n; *bad_out = bad_all; *worst_out = worst_all; + return ok ? 0 : -1; +} +static void cold_points(FILE *out, uint32_t reps, int *first) { + static const ChipPoint cpts[] = { + { 128, 1536, 2048, 8, 1, "cold gate_up 8 of 128", 1 }, + { 128, 2048, 768, 8, 8, "cold down 8 of 128", 1 }, + }; + for (size_t i = 0; i < 2; i++) { + const ChipPoint *p = &cpts[i]; + if (g_only && !strstr(p->name, g_only)) continue; + Weights W; weights_make(&W, p->experts, p->n, p->k, 9100 + (uint32_t)i); + uint32_t perm[128], st = 4242 + (uint32_t)i; + for (uint32_t e = 0; e < 128; e++) perm[e] = e; + for (uint32_t e = 127; e > 0; e--) { uint32_t j = lcg(&st) % (e + 1); uint32_t t = perm[e]; perm[e] = perm[j]; perm[j] = t; } + float *x = malloc((size_t)p->x_rows * p->k * 4); for (size_t j = 0; j < (size_t)p->x_rows * p->k; j++) x[j] = frand(&st, -1.0f, 1.0f); + float *y = malloc((size_t)p->groups * p->n * 4); + OmegaGpuFp8Tensor *t = NULL; + int rc = omega_gpu_fp8_tensor_upload(p->experts, p->n, p->k, W.w, W.s, &t); + OmegaGpuFp8Info info; memset(&info, 0, sizeof info); + if (rc == OMEGA_GPU_FP8_OK) rc = omega_gpu_fp8_gemv_grouped_f32(t, p->groups, perm, x, p->x_rows, y, &info); /* builds the kernel */ + size_t bad = 0; double worst = rc == OMEGA_GPU_FP8_OK ? parity(&W, p->groups, perm, x, p->x_rows, y, &bad) : 1.0; + CHECK(rc == OMEGA_GPU_FP8_OK && bad == 0, "chip %s warm-up: rc=%s bad=%zu worst_rel=%.3e (%s)", p->name, omega_gpu_fp8_rc_name(rc), bad, worst, omega_gpu_fp8_last_error()); + uint64_t *el = calloc(reps, sizeof *el); uint32_t done = 0; size_t bad_all = 0; double worst_all = worst; + if (g_evict) evict_host_caches(); + for (uint32_t r = 0; r < reps && rc == OMEGA_GPU_FP8_OK; r++) { + const uint32_t *ids = perm + 8u * (r % 16u); + OmegaGpuFp8Info ti; + if (omega_gpu_fp8_gemv_grouped_f32(t, p->groups, ids, x, p->x_rows, y, &ti) != OMEGA_GPU_FP8_OK) { rc = OMEGA_GPU_FP8_CHIP_FAIL; break; } + size_t b = 0; double w = parity(&W, p->groups, ids, x, p->x_rows, y, &b); + bad_all += b; if (w > worst_all) worst_all = w; + el[done++] = ti.elapsed_ns; + } + CHECK(rc == OMEGA_GPU_FP8_OK && done == reps && bad_all == 0, "chip %s: %u/%u timed launches, %zu elements off the oracle, worst_rel=%.3e (%s)", p->name, done, reps, bad_all, worst_all, omega_gpu_fp8_last_error()); + uint64_t med = 0, lo = 0, hi = 0; double gbs = 0.0; + if (done) { qsort(el, done, sizeof *el, cmp_u64); med = el[done / 2]; lo = el[0]; hi = el[done - 1]; gbs = med ? (double)(info.weight_bytes + info.scale_bytes) / (double)med : 0.0; } + printf("chip %-24s variant=%d sched=%d rc=%-9s timed=%u bad=%zu worst_rel=%.3e grid=%ux%u lb=%u rows=%u warps=%u depth=%u bytes=%" PRIu64 " chip_med=%.1fus min=%.1fus max=%.1fus (%.1f GB/s, %.3f of 237.2)\n", + p->name, omega_gpu_fp8_variant(), omega_gpu_fp8_sched(), omega_gpu_fp8_rc_name(rc), done, bad_all, worst_all, info.grid_x, info.grid_y, info.lane_bytes, info.rows_per_warp, + info.warps_per_cta, info.depth, info.weight_bytes + info.scale_bytes, med / 1e3, lo / 1e3, hi / 1e3, gbs, gbs / 237.2); + if (out) fprintf(out, "%s{\"name\":\"%s\",\"experts\":%u,\"n\":%u,\"k\":%u,\"groups\":%u,\"x_rows\":%u,\"rc\":\"%s\",\"timed\":%u,\"bad\":%zu,\"worst_rel\":%.3e," + "\"variant\":%d,\"sched\":%d,\"grid_x\":%u,\"grid_y\":%u,\"lane_bytes\":%u,\"rows_per_warp\":%u,\"warps_per_cta\":%u,\"depth\":%u,\"bytes\":%" PRIu64 ",\"chip_median_ns\":%" PRIu64 ",\"chip_min_ns\":%" PRIu64 ",\"chip_max_ns\":%" PRIu64 ",\"gbps_chip\":%.2f,\"evict\":%d,\"rotation_sets\":16}", + *first ? "" : ",", p->name, p->experts, p->n, p->k, p->groups, p->x_rows, omega_gpu_fp8_rc_name(rc), done, bad_all, worst_all, + omega_gpu_fp8_variant(), omega_gpu_fp8_sched(), info.grid_x, info.grid_y, info.lane_bytes, info.rows_per_warp, info.warps_per_cta, info.depth, info.weight_bytes + info.scale_bytes, med, lo, hi, gbs, g_evict); + *first = 0; + { /* GPU-stamped timing of the same rotation (the figure CUT5 reports) */ + const uint32_t lists = reps < 2u * LIST_N ? 2u : (reps + LIST_N - 1u) / LIST_N; + uint64_t *e2 = calloc((size_t)lists * LIST_N, sizeof *e2); uint32_t n2 = 0; size_t b2 = 0; double w2 = 0.0; + int lrc = rc == OMEGA_GPU_FP8_OK ? cold_list_stamps(p, &W, t, perm, x, lists, e2, &n2, &b2, &w2) : -1; + CHECK(lrc == 0 && n2 == lists * LIST_N && b2 == 0, "chip %s GPU-stamped list: %u/%u launches, %zu elements off the oracle, worst_rel=%.3e", p->name, n2, lists * LIST_N, b2, w2); + uint64_t m2 = 0, lo2 = 0, hi2 = 0; double g2 = 0.0; + if (n2) { qsort(e2, n2, sizeof *e2, cmp_u64); m2 = e2[n2 / 2]; lo2 = e2[0]; hi2 = e2[n2 - 1]; g2 = m2 ? (double)(info.weight_bytes + info.scale_bytes) / (double)m2 : 0.0; } + printf("chip %-24s GPU-STAMPED coal=%d wfirst=%d launches=%u bad=%zu stamp_med=%.1fus min=%.1fus max=%.1fus (%.1f GB/s, %.3f of 237.2)\n", + p->name, omega_gpu_fp8_coal(), omega_gpu_fp8_wfirst(), n2, b2, m2 / 1e3, lo2 / 1e3, hi2 / 1e3, g2, g2 / 237.2); + if (out) fprintf(out, ",{\"name\":\"%s gpu-stamped\",\"coal\":%d,\"wfirst\":%d,\"sched\":%d,\"launches\":%u,\"bad\":%zu,\"worst_rel\":%.3e,\"bytes\":%" PRIu64 ",\"stamp_median_ns\":%" PRIu64 ",\"stamp_min_ns\":%" PRIu64 ",\"stamp_max_ns\":%" PRIu64 ",\"gbps_stamp\":%.2f,\"barrier\":\"WFI\",\"floor_subtracted\":0}", + p->name, omega_gpu_fp8_coal(), omega_gpu_fp8_wfirst(), omega_gpu_fp8_sched(), n2, b2, w2, info.weight_bytes + info.scale_bytes, m2, lo2, hi2, g2); + free(e2); + } + free(el); + /* mutants: each must be caught at this shape and this kernel configuration */ + for (int m = 1; m <= 4 && rc == OMEGA_GPU_FP8_OK; m++) { + if (m == 4) omega_gpu_fp8_test_set_no_fold(1); else omega_gpu_fp8_test_set_mutant(m); + OmegaGpuFp8Tensor *tm = t; + if (m == 4) { tm = NULL; if (omega_gpu_fp8_tensor_upload(p->experts, p->n, p->k, W.w, W.s, &tm) != OMEGA_GPU_FP8_OK) tm = NULL; } + int r = tm ? omega_gpu_fp8_gemv_grouped_f32(tm, p->groups, perm, x, p->x_rows, y, NULL) : OMEGA_GPU_FP8_CHIP_FAIL; + size_t mb = 0; double mw = r == OMEGA_GPU_FP8_OK ? parity(&W, p->groups, perm, x, p->x_rows, y, &mb) : 1.0; + int caught = r != OMEGA_GPU_FP8_OK || mb > 0; + CHECK(caught, "chip %s mutant %d NOT caught", p->name, m); + printf("chip %-24s mutant %d: %s (rc=%s bad=%zu worst_rel=%.3e)\n", p->name, m, caught ? "caught" : "MISSED", omega_gpu_fp8_rc_name(r), mb, mw); + if (out) fprintf(out, ",{\"name\":\"%s mutant %d\",\"caught\":%d,\"rc\":\"%s\",\"bad\":%zu,\"worst_rel\":%.3e}", p->name, m, caught, omega_gpu_fp8_rc_name(r), mb, mw); + if (m == 4) { omega_gpu_fp8_test_set_no_fold(0); if (tm) omega_gpu_fp8_tensor_free(tm); } else omega_gpu_fp8_test_set_mutant(0); + } + if (t) omega_gpu_fp8_tensor_free(t); + free(x); free(y); weights_free(&W); + if (omega_gpu_session_is_blocked()) { printf("session latched: stopping\n"); break; } + } +} + static int chip_run(const char *out_path, uint32_t reps) { FILE *out = out_path ? fopen(out_path, "w") : NULL; if (out_path && !out) { printf("cannot open %s\n", out_path); return 1; } @@ -514,6 +929,7 @@ static int chip_run(const char *out_path, uint32_t reps) { if (g_custom_n) { snprintf(g_custom_name, sizeof g_custom_name, "custom %ux%u", g_custom_n, g_custom_k); custom = (ChipPoint){ 1, g_custom_n, g_custom_k, 1, 1, g_custom_name, 1 }; P = &custom; npts = 1; } int first = 1; first = out ? 0 : 1; + if (g_cold) npts = 0; /* --grouped-cold: the two real expert shapes instead of the battery */ for (size_t i = 0; i < npts; i++) { const ChipPoint *p = &P[i]; if (g_only && !strstr(p->name, g_only)) continue; @@ -574,6 +990,7 @@ static int chip_run(const char *out_path, uint32_t reps) { free(x); free(y); free(y2); weights_free(&W); if (omega_gpu_session_is_blocked()) { printf("session latched: stopping\n"); break; } } + if (g_cold && !omega_gpu_session_is_blocked()) cold_points(out, reps, &first); if (out) { fprintf(out, "],\"checks\":%d,\"failed\":%d,\"device_opens\":%u,\"verdict\":\"%s\"}\n", g_checks, g_failed, omega_gpu_session_open_count(), g_failed == 0 ? "OMEGA_GPU_FP8_GEMV_PASS" : "OMEGA_GPU_FP8_GEMV_FAIL"); fclose(out); } return 0; } @@ -597,6 +1014,11 @@ int main(int argc, char **argv) { else if (strcmp(argv[i], "--k") == 0 && i + 1 < argc) g_custom_k = (uint32_t)atoi(argv[++i]); else if (strcmp(argv[i], "--gpr-pad") == 0 && i + 1 < argc) omega_gpu_fp8_set_gpr_pad((uint32_t)atoi(argv[++i])); else if (strcmp(argv[i], "--variant") == 0 && i + 1 < argc) omega_gpu_fp8_set_variant(atoi(argv[++i])); /* 1 (default) or 2 (W-L2c row-pipelined) */ + else if (strcmp(argv[i], "--sched") == 0 && i + 1 < argc) omega_gpu_fp8_set_sched(atoi(argv[++i])); /* CUT5: 0 (default) or 1 (pipelined decode + stall pass) */ + else if (strcmp(argv[i], "--coal") == 0 && i + 1 < argc) { omega_gpu_fp8_set_coal(atoi(argv[++i])); g_coal_arg = 1; } /* CUT5 variant A: coalesced output through shared slots */ + else if (strcmp(argv[i], "--wfirst") == 0 && i + 1 < argc) omega_gpu_fp8_set_wfirst(atoi(argv[++i])); /* CUT5 variant B: weight loads before the x loads */ + else if (strcmp(argv[i], "--coal-default") == 0) { coal_default_check(); printf("gpu_fp8_api_test: %d checks, %d failed: %s\n", g_checks, g_failed, g_failed ? "FAIL" : "PASS"); return g_failed ? 1 : 0; } /* variant A default vs env only */ + else if (strcmp(argv[i], "--grouped-cold") == 0) g_cold = 1; /* CUT5: the two decode expert launches, 8 of 128, L2 defeated */ else { printf("unknown argument %s\n", argv[i]); return 2; } } if (host) host_only(); diff --git a/tests/gpu_gpr_boundary_test.c b/tests/gpu_gpr_boundary_test.c index ae3cfdd10..da94bb1b2 100644 --- a/tests/gpu_gpr_boundary_test.c +++ b/tests/gpu_gpr_boundary_test.c @@ -61,7 +61,7 @@ int main(void) { /* every buildable fp8 GEMV variant */ { unsigned bad = 0, n = 0; for (unsigned k = 256; k <= 8192; k += 256) for (unsigned lb = 8; lb <= 16; lb += 8) for (unsigned rows = 1; rows <= 8; rows *= 2) for (unsigned w = 1; w <= 32; w *= 2) for (unsigned dp = 0; dp <= 8; dp += dp ? dp : 1) { - OmegaFp8GemvSpec s = { k, lb, rows, w, dp, 0 }; uint32_t peak = 0, decl = 0; + OmegaFp8GemvSpec s = { .k = k, .lane_bytes = lb, .rows = rows, .warps = w, .depth = dp, .mutant = 0, .sched = 0, .coal = 0, .wfirst = 0 }; uint32_t peak = 0, decl = 0; if (omega_fp8_gemv_prog_stats(&s, NULL, &peak) != 0) continue; n++; (void)omega_gpu_fp8_kernel_fits(&s, &decl); if (!omega_bw_gpr_declared_ok(decl, peak) && decl != 0) bad++; diff --git a/tests/r16_inventory/.crumb b/tests/r16_inventory/.crumb index f60d1e5da..46176e637 100644 --- a/tests/r16_inventory/.crumb +++ b/tests/r16_inventory/.crumb @@ -14,19 +14,19 @@ "children": [ { "digest": "6f79ae41f77cf53584bc94f7c0bd2ad19b8f5a23c5336461d071045e95266c73", - "last_commit": "dc7c1304", + "last_commit": "6fdc4c33", "name": "fixture", "purpose": "Directory tests/r16_inventory/fixture. Purpose not yet described by a human." } ], "children_root": "sha256:192ff49cc8bb80a45310b55fb3b6a7291c26916980d8746ddf1d31b4960fab69", - "compiled_at": "2026-10-24T04:15:18Z", + "compiled_at": "2026-10-24T06:12:28Z", "compiler": "crumb-compile/1", "digest": "sha256:c549b5b82fd026d664b35e4b1a5d7fd2aaafa13b60b541cfbba87d7522517b1d", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 9, - "generated_at_commit": "dc7c1304c038f49db3b121d5a5e27d7bcab5bf6c", + "generated_at_commit": "acf9a7219349ea7010bfb9cad7fa4af068bf77e2", "source_tree": "sha256:a560592546d62027838fe9e1843dacc258648470f98d0e6cbf276388f03d2a9a" }, "owner_lane": "", diff --git a/tests/r16_inventory/fixture/.crumb b/tests/r16_inventory/fixture/.crumb index 0676c0523..20074c387 100644 --- a/tests/r16_inventory/fixture/.crumb +++ b/tests/r16_inventory/fixture/.crumb @@ -30,19 +30,19 @@ "children": [ { "digest": "553951739f671a96a4f163d5f96c4ba6b7a3ac3b74aa52b87e81b0e9a422e962", - "last_commit": "dc7c1304", + "last_commit": "6fdc4c33", "name": "physics", "purpose": "Directory tests/r16_inventory/fixture/physics. Purpose not yet described by a human." } ], "children_root": "sha256:2512031bf4062feeba56c1a807c950b1e241e098dc23b5c5171388a886efdd9d", - "compiled_at": "2026-10-24T04:15:18Z", + "compiled_at": "2026-10-24T06:12:28Z", "compiler": "crumb-compile/1", "digest": "sha256:6f79ae41f77cf53584bc94f7c0bd2ad19b8f5a23c5336461d071045e95266c73", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 8, - "generated_at_commit": "dc7c1304c038f49db3b121d5a5e27d7bcab5bf6c", + "generated_at_commit": "acf9a7219349ea7010bfb9cad7fa4af068bf77e2", "source_tree": "sha256:04b5953e42e5eb87ac03039c60650ef526808aa4fa8f35f5786e9105c1d89137" }, "owner_lane": "",