From 1d255b735e92c2d6b360ed5ea150a1e42f6dd535 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Sun, 18 Oct 2026 22:33:19 +0100 Subject: 027's 4f-1: a module's tables sized to it: PureModule's thirty-four tables of states, inputs, message fields, views (the columns the load makes among them, counted from the view and record entries first), handlers, records, record fields, functions and signature items point into one block the load lays out (lay_tables) and pure_module_release gives back, so PureModule is 2,752 bytes, not 24,320; a sanitized build poisons 16 bytes between tables, so reading past one is caught (none was); limits as they were; a test and five of research 044's timers gave the load a module never zeroed (it gives back what one holds), now zeroed; counts: b38 against b37 with batches within 0.25%, without batches matmul -0.45%, join +0.36%, knapsack +0.28%, BFS -0.25%; the bank's queries (s37 and s38 on one aup module in turns, three each) field -0.68%, found -0.51%, large -0.47%, the rest -0.11% to -0.20%; 027's 4f designed in four steps and 4f-1 as made --- research/experiments/044-specs/append_cost.c | 2 +- research/experiments/044-specs/json_rec_time.c | 2 +- research/experiments/044-specs/json_time.c | 2 +- research/experiments/044-specs/json_tree_time.c | 2 +- research/experiments/044-specs/time.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'research/experiments/044-specs') diff --git a/research/experiments/044-specs/append_cost.c b/research/experiments/044-specs/append_cost.c index a3ef0bb..d91e82e 100644 --- a/research/experiments/044-specs/append_cost.c +++ b/research/experiments/044-specs/append_cost.c @@ -9,7 +9,7 @@ #include static double now_ns(void) { struct timespec t; clock_gettime(CLOCK_MONOTONIC, &t); return t.tv_sec * 1e9 + t.tv_nsec; } int main(int argc, char **argv) { - PureModule m; char error[160]; + PureModule m = {0}; char error[160]; if (pure_module_read(argv[1], &m, error, sizeof(error)) != PURE_OK) { fprintf(stderr, "%s\n", error); return 1; } PureApp app; if (pure_app_start(&app, &m, (PureData){0}) != PURE_OK) return 1; diff --git a/research/experiments/044-specs/json_rec_time.c b/research/experiments/044-specs/json_rec_time.c index 03c02c4..0d5b225 100644 --- a/research/experiments/044-specs/json_rec_time.c +++ b/research/experiments/044-specs/json_rec_time.c @@ -73,7 +73,7 @@ int main(int argc, char **argv) { n += (size_t)sprintf(doc + n, "%s{\"key%d\": [1.5e3, true, null, \"text \\u00e9 %d\"]}", k ? "," : "", k, k); doc[n++] = ']'; doc[n] = 0; - PureModule module; + PureModule module = {0}; char error[160]; if (pure_module_read(argv[1], &module, error, sizeof(error)) != PURE_OK) { fprintf(stderr, "%s\n", error); return 1; } PureApp app; diff --git a/research/experiments/044-specs/json_time.c b/research/experiments/044-specs/json_time.c index b401ece..b4b2eae 100644 --- a/research/experiments/044-specs/json_time.c +++ b/research/experiments/044-specs/json_time.c @@ -100,7 +100,7 @@ int main(int argc, char **argv) { for (int k = 0; k < 2000; ++k) n += (size_t)sprintf((char *)doc + n, "%s{\"key%d\": [1.5e3, true, null, \"text \\u00e9 %d\"]}", k ? "," : "", k, k); doc[n++] = ']'; - PureModule module; + PureModule module = {0}; char error[160]; if (pure_module_read(argv[1], &module, error, sizeof(error)) != PURE_OK) { fprintf(stderr, "%s\n", error); return 1; } PureApp app; diff --git a/research/experiments/044-specs/json_tree_time.c b/research/experiments/044-specs/json_tree_time.c index 1cac21a..0ec4bec 100644 --- a/research/experiments/044-specs/json_tree_time.c +++ b/research/experiments/044-specs/json_tree_time.c @@ -73,7 +73,7 @@ int main(int argc, char **argv) { n += (size_t)sprintf(doc + n, "%s{\"key%d\": [1.5e3, true, null, \"text \\u00e9 %d\"]}", k ? "," : "", k, k); doc[n++] = ']'; doc[n] = 0; - PureModule module; + PureModule module = {0}; char error[160]; if (pure_module_read(argv[1], &module, error, sizeof(error)) != PURE_OK) { fprintf(stderr, "%s\n", error); return 1; } PureApp app; diff --git a/research/experiments/044-specs/time.c b/research/experiments/044-specs/time.c index 248889b..f296ece 100644 --- a/research/experiments/044-specs/time.c +++ b/research/experiments/044-specs/time.c @@ -83,7 +83,7 @@ int main(int argc, char **argv) { uint32_t seed = 140; for (size_t i = 0; i < size; ++i) seed = seed * 1664525u + 1013904223u, data[i] = (unsigned char)(seed >> 24); - PureModule module; + PureModule module = {0}; char error[160]; if (pure_module_read(argv[1], &module, error, sizeof(error)) != PURE_OK) { fprintf(stderr, "%s\n", error); return 1; } PureApp app; -- cgit v1.2.3