From a2f86143b7d5220da12b62b6a07edbf995030e54 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Mon, 5 Oct 2026 13:12:37 +0100 Subject: Keep the work an event may still do in a register, x30 among what is kept, small constants and powers of two's products in the instruction; where a check may give up, make the result in x16, the operands as they were for the executor (aup's check caught a register shared with its operand): BFS core 12.5 to 12.2 ms, 46.2M to 43.0M instructions (022) --- tests/check.py | 53 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 10 deletions(-) (limited to 'tests/check.py') diff --git a/tests/check.py b/tests/check.py index e9f00bb..aeb8d87 100644 --- a/tests/check.py +++ b/tests/check.py @@ -1051,12 +1051,40 @@ on go { } """ +# A local's products and sums, whole, of a size the code does not know: where +# a check gives up, the result's register may be its operand's, and the +# executor takes the operands again as they were. +LOCALS_SOURCE = """record Cell { + at = 0 +} +state small = 0 +state big = 0 +input go = message { + n: u32 +} +on go { + let cells: list of Cell + for i in 0 .. go.n { + cells.append(Cell { at: i }) + } + for i in 0 .. go.n { + let c = cells.first + i + let v = c.at + small = small + v * 1048576 + let w = c.at * 1099511627776 + let u = w + w + big = big + w * 3 + u + w * 1024 + } +} +""" + def module_assumptions(aup, pure, work): """The compiled code's integers (Pure docs/design/022) where they stop holding: a loop whose columns hold small whole numbers until, halfway, an item with a fraction (and -0) widens them and a fraction's key takes - a keyed list out of its DENSE form; a product past 2^53. Each event's + a keyed list out of its DENSE form; a product past 2^53; a local's + products and sum past 2^53 and 2^64 (LOCALS_SOURCE). Each event's states, compiled with every loop (PURE_JIT=all) and run by the executor alone (PURE_JIT=0), are the same byte for byte.""" import os @@ -1065,15 +1093,20 @@ def module_assumptions(aup, pure, work): source.write_text(ASSUMPTIONS_SOURCE) compile_module(aup, source, module) runs = [(10, 3), (10, 99), (70, 65), (70, 5), (200, 150), (9000, 4000), (9000, 9999), (3, 0)] - commands = ''.join(f'message go {struct.pack("