aboutsummaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-05 16:44:35 +0100
committereunhhu <[email protected]>2026-10-05 16:44:35 +0100
commit0baba8f8d3aa164c93ed72abced3c397ef10178c (patch)
treef4012c586edf405b7145c63f17845bada4e55641 /cli
parent5cf9dcb47cd0037461782335ba812481363970da (diff)
downloadpure-0baba8f8d3aa164c93ed72abced3c397ef10178c.tar.gz
pure-0baba8f8d3aa164c93ed72abced3c397ef10178c.zip
The tier's inner loops: a count's work paid for every round as it opens (the rounds it does not run given back where it breaks or gives up), a comparison only a branch reads its flags, a full list's keys read without its bits (a key's position found: its key's register), an add's or sub's register its operand's where that is read last. knapsack 16.5 to 8.5 ms (1.37x C), matmul 25.7 to 22.9
Two bugs the work checks found, there since 6cd7f5a: the outermost loop's round past the work budget gave up at the loop's instruction, with nothing on the stack (the executor opened it again: LIMIT where WORK), now at its iteration; and a phi where an if's ways meet took its merge's loop (-1), so a value made of it was taken as made outside its loop and made once for all rounds. pure-run's budget and work commands; module_tier compares the work and runs four small budgets; module_assumptions keeps both programs
Diffstat (limited to 'cli')
-rw-r--r--cli/pure-run.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/cli/pure-run.c b/cli/pure-run.c
index c7a252c..8ef91d9 100644
--- a/cli/pure-run.c
+++ b/cli/pure-run.c
@@ -196,7 +196,13 @@ int main(int argc, char **argv) {
else active = !active;
} else if (!strcmp(command, "save")) {
if (pure_app_save(&app) != PURE_OK) failure = "save failed";
- } else if (strcmp(command, "show")) failure = "unknown command";
+ } else if (!strcmp(command, "budget")) { /* the work each event may do (0: the default) */
+ char *end;
+ unsigned long long budget = strtoull(argument, &end, 10);
+ if (!*argument || *end) failure = "budget";
+ else pure_app_work(&app, budget);
+ } else if (!strcmp(command, "work")) printf("{\"work\":%llu}\n", (unsigned long long)app.work); /* the last event's */
+ else if (strcmp(command, "show")) failure = "unknown command";
if (batch && strcmp(command, "show") && ++unsaved == batch) {
unsaved = 0;
if (pure_app_save(&app) != PURE_OK) failure = "save failed";