From 9c37c5fa0f58eefe517ca0456324f5618a13b87d Mon Sep 17 00:00:00 2001 From: eunhhu Date: Sat, 26 Sep 2026 07:29:11 +0100 Subject: Compress the module executor's paths The executor shrinks from 49.8 to 42.2 KB of -O2 text (module.c 34.0 to 27.0 KB) with the module format and API unchanged: - The verifier reads its rules from the signature table: what each opcode's argument names, and which text or list it works on. Cursor and index operands must belong to that text or list and so does a pushed one; other values belong to nothing, so a value that merely came from a text no longer blocks a join. The loader and verifier fail through one path. - The interpreter advances as it fetches and leaves through two exits: a stated fault, or a change the data refused. - Key, text and message events take one path; a message brings its base revision and key. Starting an app opens its module over none, the path replacing takes, so every new state starts from its stored value. - Paths that run once per module or app are marked cold and built for size; event paths stay built for speed (small GETs: 128k/s, as before). --- prototypes/connections/module-save.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'prototypes/connections/module-save.h') diff --git a/prototypes/connections/module-save.h b/prototypes/connections/module-save.h index b6db997..ded9ba9 100644 --- a/prototypes/connections/module-save.h +++ b/prototypes/connections/module-save.h @@ -14,9 +14,11 @@ PureResult pure_save_open_text(PureApp *, const PureModule *m, uint32_t state, P * record differs from m's. */ PureResult pure_save_open_list(PureApp *, const PureModule *m, uint32_t state, PureList **out, PureDraft **draft, PureVersion *saved); -/* Open the stored numbers, cursors and indices of m and, with load, put each - * stored one of the same name and kind that still fits into values. */ -PureResult pure_save_open_values(PureApp *, const PureModule *m, double *values, bool load); +/* Open the stored numbers, cursors and indices, and put each stored one of the + * same name and kind that still fits into values, for the states of m that + * kept marks as new (-1); texts and lists are m's. */ +PureResult pure_save_open_values(PureApp *, const PureModule *m, double *values, const int *kept, + PureDraft *const *texts, PureList *const *lists); /* Store a list whose record changed in its draft, header and items anew. */ PureResult pure_save_rewrite_list(const PureModule *m, uint32_t state, PureList *list, PureDraft *draft); /* Publish the documents and every state changed since the last save -- cgit v1.2.3