Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-feel/blob/main/tests/wolfram-slow-trial.wl # omega-feel This project has not described itself yet. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers 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. *) 12 WARM = 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 *) 14 ends[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]; 16 over[X_, L_] := N[(V X + NMIN (X - 1) Length[ends[L]])/L, 4]; 17 limit[X_] := N[NMIN (X - 1)/(RESTMAX + 2 NMIN), 4]; 18 f[x_] := ToString[N[x, 4], FortranForm]; 19 StringRiffle[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"]