diff options
Diffstat (limited to 'research/experiments')
7 files changed, 82 insertions, 0 deletions
diff --git a/research/experiments/040-against-c/2026-10-18-counts-s28.jsonl b/research/experiments/040-against-c/2026-10-18-counts-s28.jsonl new file mode 100644 index 0000000..9f15831 --- /dev/null +++ b/research/experiments/040-against-c/2026-10-18-counts-s28.jsonl @@ -0,0 +1,4 @@ +{"serve": "pure-serve", "per_branch": {"instructions": 26993254, "cycles": 11740994}, "in_credit": {"instructions": 3492731, "cycles": 1596075}, "large": {"instructions": 1421590, "cycles": 608185}, "ranks": {"instructions": 24405011, "cycles": 14759082}, "none": {"instructions": 617115, "cycles": 193288}, "field": {"instructions": 9008642, "cycles": 3329258}, "found": {"instructions": 14162159, "cycles": 10622538}} +{"serve": "pure-serve", "per_branch": {"instructions": 26913366, "cycles": 11814716}, "in_credit": {"instructions": 3469742, "cycles": 1611678}, "large": {"instructions": 1419483, "cycles": 613860}, "ranks": {"instructions": 24329541, "cycles": 14818502}, "none": {"instructions": 609616, "cycles": 192301}, "field": {"instructions": 9091175, "cycles": 3335693}, "found": {"instructions": 14192769, "cycles": 10584266}} +{"serve": "pure-serve", "per_branch": {"instructions": 27071550, "cycles": 11772202}, "in_credit": {"instructions": 3510278, "cycles": 1585989}, "large": {"instructions": 1421574, "cycles": 614859}, "ranks": {"instructions": 24447396, "cycles": 14867972}, "none": {"instructions": 617123, "cycles": 195315}, "field": {"instructions": 9008650, "cycles": 3335571}, "found": {"instructions": 14162088, "cycles": 10638817}} +{"serve": "pure-serve", "per_branch": {"instructions": 26862304, "cycles": 11837964}, "in_credit": {"instructions": 3458213, "cycles": 1582318}, "large": {"instructions": 1419531, "cycles": 610145}, "ranks": {"instructions": 24301257, "cycles": 14709708}, "none": {"instructions": 609627, "cycles": 191705}, "field": {"instructions": 9091183, "cycles": 3341920}, "found": {"instructions": 14193944, "cycles": 10536164}} diff --git a/research/experiments/040-against-c/2026-10-18-counts-s28b.jsonl b/research/experiments/040-against-c/2026-10-18-counts-s28b.jsonl new file mode 100644 index 0000000..c01bd1e --- /dev/null +++ b/research/experiments/040-against-c/2026-10-18-counts-s28b.jsonl @@ -0,0 +1,4 @@ +{"serve": "pure-serve", "per_branch": {"instructions": 27001538, "cycles": 11809316}, "in_credit": {"instructions": 3494481, "cycles": 1569742}, "large": {"instructions": 1421590, "cycles": 604735}, "ranks": {"instructions": 24408555, "cycles": 14810612}, "none": {"instructions": 617115, "cycles": 192941}, "field": {"instructions": 9008642, "cycles": 3329022}, "found": {"instructions": 14162664, "cycles": 11129426}} +{"serve": "pure-serve", "per_branch": {"instructions": 26948211, "cycles": 11936877}, "in_credit": {"instructions": 3477619, "cycles": 1611437}, "large": {"instructions": 1419539, "cycles": 610405}, "ranks": {"instructions": 24348016, "cycles": 14784698}, "none": {"instructions": 609616, "cycles": 191620}, "field": {"instructions": 9091175, "cycles": 3341083}, "found": {"instructions": 14194665, "cycles": 10446188}} +{"serve": "pure-serve", "per_branch": {"instructions": 26988888, "cycles": 11750407}, "in_credit": {"instructions": 3491586, "cycles": 1595540}, "large": {"instructions": 1421574, "cycles": 636840}, "ranks": {"instructions": 24400679, "cycles": 14772759}, "none": {"instructions": 617115, "cycles": 195556}, "field": {"instructions": 9008642, "cycles": 3347715}, "found": {"instructions": 14162495, "cycles": 10844953}} +{"serve": "pure-serve", "per_branch": {"instructions": 26996410, "cycles": 11973005}, "in_credit": {"instructions": 3488363, "cycles": 1620090}, "large": {"instructions": 1419507, "cycles": 608760}, "ranks": {"instructions": 24375152, "cycles": 14826597}, "none": {"instructions": 609616, "cycles": 195343}, "field": {"instructions": 9091175, "cycles": 3343996}, "found": {"instructions": 14193560, "cycles": 10567563}} diff --git a/research/experiments/040-against-c/2026-10-18-counts-s29.jsonl b/research/experiments/040-against-c/2026-10-18-counts-s29.jsonl new file mode 100644 index 0000000..81c9bd3 --- /dev/null +++ b/research/experiments/040-against-c/2026-10-18-counts-s29.jsonl @@ -0,0 +1,4 @@ +{"serve": "pure-serve", "per_branch": {"instructions": 27116137, "cycles": 11997606}, "in_credit": {"instructions": 3520317, "cycles": 1616754}, "large": {"instructions": 1421542, "cycles": 614630}, "ranks": {"instructions": 24471297, "cycles": 15007601}, "none": {"instructions": 617115, "cycles": 192792}, "field": {"instructions": 9008642, "cycles": 3337037}, "found": {"instructions": 14159784, "cycles": 10692334}} +{"serve": "pure-serve", "per_branch": {"instructions": 27056903, "cycles": 11835214}, "in_credit": {"instructions": 3506950, "cycles": 1611934}, "large": {"instructions": 1423230, "cycles": 606586}, "ranks": {"instructions": 24440693, "cycles": 14710399}, "none": {"instructions": 617123, "cycles": 188625}, "field": {"instructions": 9028796, "cycles": 3324917}, "found": {"instructions": 14181050, "cycles": 10573198}} +{"serve": "pure-serve", "per_branch": {"instructions": 27248168, "cycles": 11963826}, "in_credit": {"instructions": 3549879, "cycles": 1624579}, "large": {"instructions": 1421510, "cycles": 616012}, "ranks": {"instructions": 24543862, "cycles": 14971502}, "none": {"instructions": 617115, "cycles": 191202}, "field": {"instructions": 9008642, "cycles": 3311617}, "found": {"instructions": 14160408, "cycles": 10612142}} +{"serve": "pure-serve", "per_branch": {"instructions": 27123191, "cycles": 11920638}, "in_credit": {"instructions": 3522018, "cycles": 1662019}, "large": {"instructions": 1423174, "cycles": 607058}, "ranks": {"instructions": 24478800, "cycles": 14557857}, "none": {"instructions": 617115, "cycles": 191160}, "field": {"instructions": 9028788, "cycles": 3349276}, "found": {"instructions": 14179810, "cycles": 10480322}} diff --git a/research/experiments/040-against-c/2026-10-18-counts-s29b.jsonl b/research/experiments/040-against-c/2026-10-18-counts-s29b.jsonl new file mode 100644 index 0000000..a8e790f --- /dev/null +++ b/research/experiments/040-against-c/2026-10-18-counts-s29b.jsonl @@ -0,0 +1,4 @@ +{"serve": "pure-serve", "per_branch": {"instructions": 27029002, "cycles": 11776162}, "in_credit": {"instructions": 3500598, "cycles": 1592396}, "large": {"instructions": 1421494, "cycles": 616464}, "ranks": {"instructions": 24423096, "cycles": 14830472}, "none": {"instructions": 617115, "cycles": 193696}, "field": {"instructions": 9008642, "cycles": 3333335}, "found": {"instructions": 14160504, "cycles": 10573768}} +{"serve": "pure-serve", "per_branch": {"instructions": 26995382, "cycles": 11747780}, "in_credit": {"instructions": 3493042, "cycles": 1601323}, "large": {"instructions": 1423270, "cycles": 627277}, "ranks": {"instructions": 24406230, "cycles": 14860436}, "none": {"instructions": 617123, "cycles": 194410}, "field": {"instructions": 9028796, "cycles": 3475763}, "found": {"instructions": 14181649, "cycles": 10710498}} +{"serve": "pure-serve", "per_branch": {"instructions": 27093262, "cycles": 11829227}, "in_credit": {"instructions": 3515171, "cycles": 1600382}, "large": {"instructions": 1421478, "cycles": 605106}, "ranks": {"instructions": 24459441, "cycles": 14835459}, "none": {"instructions": 617123, "cycles": 205990}, "field": {"instructions": 9008650, "cycles": 3326333}, "found": {"instructions": 14158911, "cycles": 10562014}} +{"serve": "pure-serve", "per_branch": {"instructions": 27075692, "cycles": 12014054}, "in_credit": {"instructions": 3511134, "cycles": 1575796}, "large": {"instructions": 1423230, "cycles": 613250}, "ranks": {"instructions": 24450931, "cycles": 14811696}, "none": {"instructions": 617115, "cycles": 192768}, "field": {"instructions": 9028788, "cycles": 3337929}, "found": {"instructions": 14182210, "cycles": 10470045}} diff --git a/research/experiments/041-batches/2026-10-18-counts.jsonl b/research/experiments/041-batches/2026-10-18-counts.jsonl index d1f5c4d..6db0072 100644 --- a/research/experiments/041-batches/2026-10-18-counts.jsonl +++ b/research/experiments/041-batches/2026-10-18-counts.jsonl @@ -18,3 +18,33 @@ {"version":"b26","way":"rounds","work":"join","instructions":7659168467,"cycles":3373811804} {"version":"b26","way":"batches","work":"bfs","instructions":3371506688,"cycles":1643771467} {"version":"b26","way":"rounds","work":"bfs","instructions":4712039680,"cycles":2075728320} +{"version":"b28","way":"batches","work":"matmul","instructions":713412706,"cycles":228056209} +{"version":"b28","way":"rounds","work":"matmul","instructions":21223846502,"cycles":6836648106} +{"version":"b28","way":"batches","work":"knapsack","instructions":348670652,"cycles":105217756} +{"version":"b28","way":"rounds","work":"knapsack","instructions":22004470545,"cycles":7867695936} +{"version":"b28","way":"batches","work":"roots","instructions":157304315,"cycles":109581739} +{"version":"b28","way":"rounds","work":"roots","instructions":2720117105,"cycles":1008706879} +{"version":"b28","way":"batches","work":"join","instructions":1783743144,"cycles":1007421023} +{"version":"b28","way":"rounds","work":"join","instructions":7692773476,"cycles":3312488537} +{"version":"b28","way":"batches","work":"bfs","instructions":3413152566,"cycles":1688940338} +{"version":"b28","way":"rounds","work":"bfs","instructions":4801845652,"cycles":2100396423} +{"version":"b27","way":"batches","work":"matmul","instructions":713395345,"cycles":228780268} +{"version":"b27","way":"rounds","work":"matmul","instructions":21265005926,"cycles":7318530139} +{"version":"b27","way":"batches","work":"knapsack","instructions":348632551,"cycles":105762362} +{"version":"b27","way":"rounds","work":"knapsack","instructions":21881484253,"cycles":8123105399} +{"version":"b27","way":"batches","work":"roots","instructions":157304178,"cycles":109418657} +{"version":"b27","way":"rounds","work":"roots","instructions":2719816944,"cycles":1106892113} +{"version":"b27","way":"batches","work":"join","instructions":1783718313,"cycles":1008040915} +{"version":"b27","way":"rounds","work":"join","instructions":7669672155,"cycles":3455880586} +{"version":"b27","way":"batches","work":"bfs","instructions":3364522644,"cycles":1647535969} +{"version":"b27","way":"rounds","work":"bfs","instructions":4722342813,"cycles":2084692974} +{"version":"b29","way":"batches","work":"matmul","instructions":713395677,"cycles":232196096} +{"version":"b29","way":"rounds","work":"matmul","instructions":21265247905,"cycles":7417709517} +{"version":"b29","way":"batches","work":"knapsack","instructions":348634210,"cycles":104739014} +{"version":"b29","way":"rounds","work":"knapsack","instructions":21881636483,"cycles":8104673362} +{"version":"b29","way":"batches","work":"roots","instructions":157304837,"cycles":109524488} +{"version":"b29","way":"rounds","work":"roots","instructions":2719817906,"cycles":1110164822} +{"version":"b29","way":"batches","work":"join","instructions":1783720744,"cycles":1038646954} +{"version":"b29","way":"rounds","work":"join","instructions":7670274118,"cycles":3526186126} +{"version":"b29","way":"batches","work":"bfs","instructions":3364524544,"cycles":1644560620} +{"version":"b29","way":"rounds","work":"bfs","instructions":4723942606,"cycles":2096987224} diff --git a/research/experiments/044-specs/2026-10-18-stage3-append.jsonl b/research/experiments/044-specs/2026-10-18-stage3-append.jsonl new file mode 100644 index 0000000..cd60baf --- /dev/null +++ b/research/experiments/044-specs/2026-10-18-stage3-append.jsonl @@ -0,0 +1,5 @@ +{"cards":500,"ns_per_add_so_far":42451} +{"cards":1000,"ns_per_add_so_far":84048} +{"cards":2000,"ns_per_add_so_far":170537} +{"cards":4000,"ns_per_add_so_far":348505} +{"cards":8000,"ns_per_add_so_far":738448} diff --git a/research/experiments/044-specs/append_cost.c b/research/experiments/044-specs/append_cost.c new file mode 100644 index 0000000..a3ef0bb --- /dev/null +++ b/research/experiments/044-specs/append_cost.c @@ -0,0 +1,31 @@ +/* Research 140, design 027 stage 3: the cost of appending into a stored list's item's list (aup's check.py BOARD_SOURCE + * compiled, add_card into one column, in memory): ns an add, on average so far, as the list grows. + * cc -O2 -std=c17 -I../../../core append_cost.c ../../../build/libpure.a -lm -pthread -o append_cost + * ./append_cost board.pmod */ +#define _POSIX_C_SOURCE 200809L +#include "module.h" +#include <stdio.h> +#include <string.h> +#include <time.h> +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]; + 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; + int column = pure_module_input(&m, "add_column"), card = pure_module_input(&m, "add_card"); + pure_app_message(&app, (uint32_t)column, NULL, -1, (PureSpan){(const unsigned char *)"todo", 4}); + unsigned char payload[16]; + double zero = 0; + memcpy(payload, &zero, 8); + memcpy(payload + 8, "card0001", 8); + double start = now_ns(); + for (int n = 1; n <= 8000; ++n) { + if (pure_app_message(&app, (uint32_t)card, NULL, -1, (PureSpan){payload, 16}) != PURE_OK) { fprintf(stderr, "fail at %d\n", n); return 1; } + if (n == 500 || n == 1000 || n == 2000 || n == 4000 || n == 8000) { + double t = now_ns(); + printf("{\"cards\":%d,\"ns_per_add_so_far\":%.0f}\n", n, (t - start) / n); + } + } + return 0; +} |
