diff options
| author | eunhhu <[email protected]> | 2026-10-06 04:06:13 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-10-06 04:06:13 +0100 |
| commit | 06c2978ea0cba0ee08f371ce8ad8717c7fbe9a4f (patch) | |
| tree | a7673f7392f95c22b78b36566ae11bb8f03f0041 /tests/check.py | |
| parent | ed28ecec2062ba19cd63d2d34454d78ccb7ceb55 (diff) | |
| download | pure-06c2978ea0cba0ee08f371ce8ad8717c7fbe9a4f.tar.gz pure-06c2978ea0cba0ee08f371ce8ad8717c7fbe9a4f.zip | |
Batch: a sum into a cell, L[k].f = L[k].f + e (k computed twice the same and e, neither reading L; the set at k's row as found), keeps its rows and e from the pass (the second k, its find and the cell's read skipped) and adds them at the batch's end round by round as the executor adds and sets (a sum not finite: the executor's fault at its round; a column too narrow widened); a batch reading or setting those cells otherwise gives its rounds back. Recurrence steps one dispatch each. PURE_JIT=0 join 428 to 165 ms (the compiled code 78). module_tier makes sums into cells (seeds 1, 23 alike: 278 batches with them in seed 1); BATCH_SOURCE sums into three cells in turn
Diffstat (limited to 'tests/check.py')
| -rw-r--r-- | tests/check.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/check.py b/tests/check.py index 08cf547..f439e73 100644 --- a/tests/check.py +++ b/tests/check.py @@ -1178,7 +1178,8 @@ on go { # four, a fraction and -0 set in the middle of a batch (the columns widened), # 0 divided by at round q (a fault halfway through a batch: the executor's, # at its round), each round reading the last one's set (not apart: run one -# by one), keys going down with an if and an else, two sets of one field. +# by one), keys going down with an if and an else, two sets of one field, +# sums into three cells in turn (the column widened as they grow). BATCH_SOURCE = """record Cell { at = 0 v = 0 @@ -1211,6 +1212,9 @@ on go { t[go.n - 1 - k].v = x + 1 } for k in 0 .. go.n { + t[k - floor(k / 3) * 3].v = t[k - floor(k / 3) * 3].v + k * 1000000 + } + for k in 0 .. go.n { t[k].w = 1000 / (k - go.q) } out = t[go.n - 1].v + t[0].w @@ -1519,8 +1523,11 @@ def tier_program(rng): lines.append(f'{pad} e.append(Cell {{ at: {at()}, v: {number(1, inner)} }})') elif pick < 0.3: lines.append(f'{pad} d.add(Cell {{ at: {rng.choice([name, f"{name} * 3", key(2, inner)])}, v: {number(1, inner)} }})') - elif pick < 0.6: + elif pick < 0.5: lines.append(f'{pad} t[{at()}].v = {number(1, inner)}') + elif pick < 0.6: # a sum into a cell (its rows read and set by the rounds in turn) + cell = at() + lines.append(f'{pad} t[{cell}].v = t[{cell}].v + {number(1, inner)}') else: lines.append(f'{pad} if {cond(1, inner)} {{ t[{at()}].v = {number(1, inner)} }}' + (f' else {{ t[{at()}].v = {number(1, inner)} }}' if rng.random() < 0.4 else '')) @@ -1564,8 +1571,10 @@ def tier_program(rng): lines.append(f'{pad} e.append(Cell {{ at: w{name}, v: x1 }})') elif pick < 0.6: lines.append(f'{pad} t[{rng.choice([name, f"w{name}", f"floor(x1 / 100)"])}].v = x1') - elif pick < 0.8: + elif pick < 0.7: lines.append(f'{pad} x1 = {step()}') + elif pick < 0.8: + lines.append(f'{pad} t[w{name}].v = t[w{name}].v + x1') else: lines.append(f'{pad} ra = ra + w{name}') lines.append(f'{pad}}}') |
