interplane.Get Omega
Read in your language

omega-feel

This project has not described itself yet.

Brought by drakestapleton

branch main Branches Tags History

omega-feel / tests / wolfram-slow-trial.wl

25 lines · 2174 bytes Raw Blame History
1(* wolfram-slow-trial.wl: what a challenger of unpredictable slowness costs under the rules of SPEC.md
2 section 3 (see its section 6). A challenger that loses every pair, however slow it is, is turned away by
3 rule 1 at pair NMIN (n >= NMIN, l - w = NMIN >= H, sC >= sI), so the core gives it NMIN timed
4 launches per duel, and V shadow launches the first time. The core cannot give it fewer, and cannot
5 limit the time one launch takes: it sees a time only after the launch.
6 The timeline is the one of tests/expected-wolfram.txt, scenario `cap` (its R events); tests/run.sh
7 compares them. Units: one launch of the incumbent takes 1. A challenger launch takes X.
8 Extra time over running the reference alone, as a share of L launches:
9 (V X + NMIN (X - 1) D(L)) / L, with D(L) the duels that ended by launch L.
10 The final value is one string; written to a file with a final newline it is
11 tests/wolfram-slow-trial-result.txt. *)
12WARM = 64; REST0 = 1024; RESTMAX = 65536; V = 3; NMIN = 32;
13(* launch numbers at which duels end: warm rest, V shadow launches, 2 NMIN launches; then each rest is twice the one before, up to RESTMAX *)
14ends[L_] := Module[{pos = WARM + V + 2 NMIN, rl = REST0, out = {}},
15 While[pos <= L, AppendTo[out, pos]; rl = Min[2 rl, RESTMAX]; pos += rl + 2 NMIN]; out];
16over[X_, L_] := N[(V X + NMIN (X - 1) Length[ends[L]])/L, 4];
17limit[X_] := N[NMIN (X - 1)/(RESTMAX + 2 NMIN), 4];
18f[x_] := ToString[N[x, 4], FortranForm];
19StringRiffle[Join[
20 {"# the launches at which the first 8 duels of a challenger that always loses end (rule 1 at pair NMIN); scenario cap of expected-wolfram.txt has these R events",
21 "rejects " <> StringRiffle[ToString /@ Take[ends[10^6], 8], " "],
22 "# extra time as a share of the reference's time over L launches, a challenger X times slower. columns: X L share",
23 "# lasting rate once every rest is RESTMAX: NMIN (X - 1) / (RESTMAX + 2 NMIN)"},
24 Flatten[Table[ "over " <> StringRiffle[{ToString[X], ToString[L], f[over[X, L]]}, " "], {X, {2, 10, 100, 1000, 10^6}}, {L, {10^4, 10^5, 10^6, 10^7}}]],
25 Table["limit " <> ToString[X] <> " " <> f[limit[X]], {X, {2, 10, 100, 1000, 10^6}}]], "\n"]