From 390169f69dc61ad12f9acb1edc8f1ccee359c696 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Mon, 5 Oct 2026 23:13:47 +0100 Subject: Batch executor stage 2 (024): a loop in the batch's block runs its rounds for every lane together (round t for the lanes with more than t rounds that did not break out; BREAK leaves it lane by lane; its slot as each round sets it), and x = x op e (op +, min, max; x read no other way) is a reduction: each lane's own from op's identity (-0 a sum's), folded in the rounds' order at the batch's end (a sum's lanes of several whole numbers only, below 2^53); nested rounds' work counted for each lane and checked before anything changes; lanes and masks no holder keeps freed between nested rounds. Planned at load: a local read before set in its loop's scope, or not a reduction's, keeps the loop round by round. PURE_JIT=0: roots 130.5 to 16.8 ms, matmul 914.7 to 68.2. module_tier makes nested loops with breaks and reductions (seeds 1, 2, 3, 23: 549 programs alike); NESTED_SOURCE --- core/module-run.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/module-run.h') diff --git a/core/module-run.h b/core/module-run.h index 1e48072..3f8a9ca 100644 --- a/core/module-run.h +++ b/core/module-run.h @@ -162,6 +162,10 @@ int pure_run_rest(Frame *, uint32_t pc); * runs round by round next, at least until round loop->resume), the frame * left as the last of them leaves it, their work counted. */ unsigned pure_batch_run(Frame *, Loop *); +/* Whether the LOCAL_LOAD at pc, in a block ending at end, begins x = x op e + * (x its local, op ADD, MIN or MAX, e computed above x with no branch or + * loop): a reduction across a batch's rounds. *at: op's pc. */ +bool pure_batch_reduces(const PureModule *, uint32_t pc, uint32_t end, uint32_t *at); /* Where a list keeps what compiled code reads of it (module-list.c owns the * layout and says where): its item count, its key set (the words, how many, -- cgit v1.2.3