From 042dbfd98d664d67dcb006f1870984fc97bfebe1 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Thu, 8 Oct 2026 14:51:46 +0100 Subject: Batch plans, stage 1 of design 025: each batch loop's block read once at load (pure_batch_plans, after its instructions' plans are final): the locals it sets and whether it sets items, its sums into cells, and at each instruction a role (a sum's again, add or set) and how far on a LOCAL_LOAD's x = x op e is; batch_run, pass and local_load read the plan instead of scanning the block each batch; PURE_BATCH_LANES to build other lane counts; PURE_BATCH_CHECK (a build flag, while the stage is made) reads the block again each batch and stops if the plan differs; seeds 1 2 3 5 23 (default and PURE_SELECT=all), the fixed sources and the unit tests pass with it --- core/module.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/module.h') diff --git a/core/module.h b/core/module.h index ee47429..e10894d 100644 --- a/core/module.h +++ b/core/module.h @@ -261,6 +261,8 @@ typedef struct { * reuse_length; 0: none); at such an earlier root, reuse_from PURE_REUSE_KEPT (its value kept for them). */ uint32_t *reuse_from, *reuse_length; bool reuses; /* some value of it is planned so (else a batch need not look) */ + struct PureBatchPlan **batch_plans; /* each batch loop's block as the load reads it (module-batch.c, docs/design/025), */ + uint32_t batch_plan_count; /* in their loops' order */ struct PureJit *jit; /* its blocks compiled (module-jit.c, docs/design/021), or NULL */ bool batches; /* a loop of it is planned to run in batches (module-batch.c, docs/design/024) */ PureInputShape input[PURE_MODULE_INPUTS]; -- cgit v1.2.3