diff --git a/SPIKE-CALLBACKS.md b/SPIKE-CALLBACKS.md new file mode 100644 index 0000000..5a7512e --- /dev/null +++ b/SPIKE-CALLBACKS.md @@ -0,0 +1,208 @@ +# Guarded callback specialization experiment + +The first spike is preserved as commit `7df8ac8`. This second experiment stays +on `spike/closure-analysis` and remains opt-in. + +## Questions and decision criteria + +1. Does an existing Shen workload spend meaningful work crossing a closure + boundary that we can remove safely? +2. Can a modest program built from escaping, stateful closures approach a + manually specialized implementation? +3. What changes in callback construction, tracing, compile cost, code size, + and retained memory explain or constrain the result? + +There is no universal 10% whole-application gate. Compare the measured gain +with the opportunity and the manual reference, and retain negative findings. +Custom closure objects, a new collector, and virtual-object reconstruction on +JIT exits are separate hypotheses and are not implemented here. + +## Target selection + +`bench/callback_profile.lua` instruments native map calls while loading the +vendored `tests/interpreter.shen`, then typechecks its y-combinator expression. +The baseline load makes 140,708 map calls over 450,870 elements and constructs +149,074 generated MKFUN closures. The dominant callback source locations map +to `shen.beta` (94,251 calls), `shen.walk` (37,560), and `shen.alpha-convert` +(4,536). The following typecheck makes only 30 map calls over 60 elements. + +This selects compiler tree traversal as the real workload. The instrumented +inclusive map times are NOT an estimate of uninstrumented CPU share: wrapper, +clock, list-walking, and debug-info overhead substantially distort those times. +`bench/results/callback-profile.txt` retains the raw observations. + +## Implementation and semantic boundary + +`SHEN_MAP_CLOSURES=on` enables one transformation, independent of +`SHEN_CLOSURES`: a literal unary lambda passed to a known-arity global `map` +inside a defun becomes a chunk-scope worker. Captures are explicit worker +parameters; the worker contains the callback body and list traversal. No +callback or environment object is allocated on the native-consumer path. + +The worker guards the selected consumer against the exact native map identity. +A replacement consumer gets a freshly materialized ordinary closure and the +original input. It can retain, compare, or invoke that closure arbitrarily. +The selected callee follows the existing compiler's lookup timing, including +when evaluating the list expression changes the global function table. + +The loop follows native map's left-to-right callback evaluation, reversed +accumulator, and final reversal. It deliberately keeps the same two output-list +allocation passes. An improper tail delegates to the native map's original +error/fallback function with the current tail and accumulator, never replaying +the processed prefix. Returned closures capture fresh per-iteration item +locals. Shared vectors remain shared references; they are never copied. + +Eligibility is bounded to a literal callback body of at most 80 syntax-tree +nodes and at most eight captures. Unknown callbacks, partial applications, +lexically shadowed consumers, and oversized cases keep existing codegen. +The cache key includes the flag. This remains a source-checkout experiment, +not a published release or a new general closure IR. + +## Workloads and measurement protocol + +`bench/closure_application.lua` boots a fresh process with kernel and FASL +caching disabled, measures interpreter loading, then warms and measures three +typechecks. Each typecheck resets the inference counter to respect the kernel's +per-query inference budget. All runs must infer the same type. + +`bench/closure_objects.lua` creates 1,024 surviving objects, each represented +by three escaping closures sharing a vector: process a batch, read accumulated +state, and update configuration. Processing maps over 32 elements; the callback +updates accumulated state and reads current configuration. The host retains the +objects, changes configuration, invokes their methods, and checks the accumulated +history. Ordinary, optimized, and manually specialized KL implementations run +the same workload. The manual reference includes its worker in code-size and +compilation-cost totals. This is a proposed programming-style workload, not an +existing customer application. + +`bench/closure_experiments.py` runs six independent processes per mode, alternating +application order and using all six permutations of the three object modes. +Object timing is the median of five warmed 20,000-method batches per process. +Timing runs have no profiling wrappers and execute sequentially after tests. +GC-stopped heap growth is probed separately over 1,000 calls; it includes any +remaining trace/compiler allocations and is not an allocator-event count. +Retained heap is measured after full collection with the objects still rooted. + +`bench/closure_diagnostics.py` runs separate callback-count and `-jv` probes. +Trace markers exclude object construction and boot from workload trace counts. +The diagnostic runs' timings are not used for performance conclusions. + +## First-spike control follow-up + +Four alternating fresh-process rounds do not reproduce the original 4–6% +control slowdown. Median on/off ratios are 0.976 for escaping callbacks and +0.987 for deferred callbacks. The controls' generated Lua is byte-for-byte +identical in fresh compilers (SHA256 +`dd97c5fe93b23c62e08cc125e24af7c676c3a1c2ccc5d45ccaba0d5733beab80`). +These small differences are not evidence of a control-case improvement either. + +The original interpreter controls already showed gains without JIT execution +(about 7.5x immediate and 3.3x local). Thus allocation/call simplification matters +independently of tracing. Comparing these with JIT ratios is not a controlled +numeric decomposition of allocation versus tracing benefits. + +## Diagnostics + +Interpreter loading constructs 149,074 generated callbacks in ordinary mode +versus 8,366 in optimized mode: 140,708 fewer (94.4%). Both infer `(list l-formula)`. +The object allocation probe constructs 1,000 callbacks in ordinary mode versus +zero in optimized and manual modes. Ordinary workload tracing reports 26 FNEW +aborts; optimized/manual report zero. FNEW is confirmed against this LuaJIT's +opcode table. Optimized execution still reports inner-loop trace limitations; +this is not a claim that the entire caller becomes one ideal trace. + +Retained object heap is effectively unchanged between ordinary and optimized +(about 689 KiB in the diagnostic run). The surviving methods and state still +allocate and remain rooted. This experiment does not establish retained-memory +improvement or any need for a different collector. + +## Final timing results + +Local arm64 LuaJIT 2.1.1774638290, six fresh processes per mode. Values below +are medians of process results; ranges are across those six processes. These +are CPU seconds, not wall-clock latency. Shen caches were disabled for the +application comparison; OS filesystem caches were not flushed. + +| Measured phase | Ordinary | Optimized | Manual reference | +| --- | ---: | ---: | ---: | +| Interpreter load/compilation | 0.745090 | 0.540169 | — | +| Warm y-combinator typecheck | 0.099235 | 0.121838 | — | +| Stateful objects, 20,000 batches | 0.122676 | 0.097784 | 0.086749 | + +Interpreter loading improves **27.5%**, with non-overlapping observed ranges: +0.627108–0.810611 ordinary, 0.486806–0.591180 optimized. This is a real Shen +compilation/loading workload, not an end-to-end process-startup measurement. + +The object workload improves **20.3%** and recovers **69.3%** of the measured +ordinary-to-manual time gap. Optimized remains **12.7% slower** than manual. +Ranges: ordinary 0.102052–0.133343, optimized 0.081064–0.103044, manual +0.075787–0.092902. This supports making this particular closure-heavy style +cheaper; it does not measure every style of stateful-closure programming. + +**Typecheck performance is unresolved.** The final optimized median is 22.8% +slower, with very broad overlapping ranges (ordinary 0.058485–0.162242; +optimized 0.036322–0.146308). Three paired rounds favor each mode. An earlier +six-process pilot favored optimized at the median instead. Neither a speedup +nor a stable regression is established. JIT-history sensitivity is a possible +explanation, not a verified cause. Isolate that before considering default-on +behavior for general workloads. + +Costs and memory: + +| Metric | Ordinary | Optimized | Manual reference | +| --- | ---: | ---: | ---: | +| Generated kernel Lua bytes | 588,900 | 618,740 | — | +| Uncached kernel load, including compilation | 0.423356 s | 0.431287 s | — | +| Object implementation Lua bytes | 576 | 1,029 | 815 | +| Object implementation compile/load median | 3.291 ms | 3.284 ms | 3.423 ms | +| Heap growth, 1,000 object-method calls | 5,554.688 KiB | 5,500 KiB | 5,500 KiB | +| Retained heap with 1,024 objects alive | 655.816 KiB | 655.816 KiB | 647.896 KiB | + +Kernel source grows **5.1%**; the narrowly measured object implementation grows +78.6% because it embeds the traversal plus two materialization fallbacks. +The uncached kernel-load metric includes parsing, code generation, loading, +and installation; it does not isolate compiler CPU time. Target compile times +are short and noisy, so no compile-time improvement is claimed. + +Object heap growth falls only about **1%**: list cells dominate this workload. +Together with the eliminated FNEW aborts and the interpreter-control findings, +this supports both call/allocation simplification and improved traceability; +it does not assign an exact fraction of the speedup to either mechanism. +Retained heap does not improve. + +## Validation and reproduction + +- Original local-elimination spike: commit `7df8ac8`. +- Final default and combined-enabled runs: **1,128 port checks**, zero failures, + across 23 specs; **134 canonical kernel tests**, zero failures in each run. +- New map spec: 36 checks across both map modes, covering redefinition, + replacement consumers retaining callbacks, absent consumers, lexical + shadowing, capture-budget fallback, nested maps, escaping result closures, + shared mutation, evaluation order, and errors after a processed prefix. +- Every application run inferred `(list l-formula)`; every object run validated + the full accumulated state history. Generated control source matches exactly. +- `git diff --check` passes. Original checkout remains unchanged. + +```sh +make test-all +SHEN_CLOSURES=on SHEN_MAP_CLOSURES=on SHEN_KERNEL_CACHE=off make test-all +SHEN_FASL=off luajit bench/callback_profile.lua +python3 bench/closure_controls.py +python3 bench/closure_experiments.py +python3 bench/closure_diagnostics.py +``` + +The fresh-process experiment runs its children sequentially with per-process +timeouts. Run it without concurrent test/profiling jobs. Raw observations live +in `bench/results/closure-experiments.{json,txt}`, `closure-controls.{json,txt}`, +`closure-diagnostics.txt`, and `closure-traces-*.txt`. Full validation logs are +`/tmp/shen-callbacks-off.log` and `/tmp/shen-callbacks-on.log`. + +## Decision + +Continue with bounded, guarded compiler specialization. It demonstrably reaches +hot existing code and brings a stateful closure workload closer to its manual +reference without changing shared-state or escape semantics. Keep the flag off +by default while investigating typecheck timing variability and reviewing code +size/fallback costs. This is evidence for this compiler path; long-lived capture +management and a different collector remain open, separate experiments. diff --git a/SPIKE-CLOSURES.md b/SPIKE-CLOSURES.md new file mode 100644 index 0000000..15391e4 --- /dev/null +++ b/SPIKE-CLOSURES.md @@ -0,0 +1,116 @@ +# Closure analysis spike (LuaJIT) + +Branch: spike/closure-analysis. Opt-in; baseline remains unchanged. + +Plan: +1. Add a lexical closure analysis pass with explicit capture/use records. +2. Eliminate immediate and non-escaping local unary lambdas by hygienic + let insertion. Preserve evaluation order, object identity, deferred bodies, + shadowing, and runtime fallback for unknown/escaping applications. +3. Compare enabled/disabled semantics, generated allocation sites, warmed time, + and GC-stopped heap growth on bounded workloads; run port/kernel checks. +4. Record evidence and limits here. Explicit heap environments, interprocedural + map specialization, partial application elimination, and speculative exit + reconstruction are deferred until this experiment warrants them. + +## Implementation + +`SHEN_CLOSURES=on` enables `closure_ir.optimize` before defun code generation. +`C.CLOSURES` allows direct in-process codegen comparisons (set the environment +before boot when using persistent caches). Top-level expression compilation is +unchanged. The default is off. + +The pass alpha-renames lexical binders, then records local closure candidates: +code body in the syntax tree, lexical capture names, direct-call count, escape +status, and elimination decision. `C.CLOSURE_REPORT` exposes the last defun's +records. This is an analysis prototype, not a backend-independent closure IR. + +An immediate unary lambda becomes a let. A let-bound lambda becomes lets at +its call sites only when every reference is an exact unary call outside deferred +bodies. A maximum of four uses and an 80-node body cap bound duplication. No +argument expression is duplicated; arguments execute once before the body. +Unused lambda bodies remain unevaluated. Unique lexical names preserve capture +binding across call-site shadowing. References to mutable vectors remain the +same references, including when two closures share a vector. + +Value uses (including equality), storage, unknown consumers, non-unary calls, +and references inside lambdas/freezes cause fallback. Special-form shadowing +causes the entire analysis to bail out. If no elimination occurs, the original +syntax tree is returned. Existing freeze lowering and LuaJIT GC remain in charge. +The cache fingerprint includes both the flag and the enabled pass's source. + +This is a source-checkout spike: release rockspecs and standalone bundles have +not been extended to package the optional module. + +## Reproduce + +```sh +make test-all +SHEN_CLOSURES=on SHEN_KERNEL_CACHE=off make test-all +luajit bench/closures.lua 1000000 +luajit -joff bench/closures.lua 1000000 +luajit bench/closure_inventory.lua klambda/*.kl +``` + +The benchmark compiles the same four definitions in both modes, flushes the +JIT, warms for 20,000 calls, and reports the median of five timed samples. +Timed calls run with GC enabled. Separate 10,000-call probes stop GC to measure +heap growth, then collect to measure retained heap delta. These are heap proxies, +not allocator event counts; retained deltas can be slightly negative as older +objects are collected. Trace stop/abort counts cover warm-up; exit events are +sampled separately over 1,000 calls, outside the timing window. Zero exit events +can also reflect execution in the interpreter and do not prove exit-free native +execution. All benchmark sums are checked. + +## Scope finding + +Kernel inventory: 737 defuns, 31 candidates, **2 eliminated**, 29 escaping or +used in deferred bodies. These are candidates recognized by this pass, not a +census of every lambda. Raw output: `bench/results/closure-inventory.txt`. + +This experiment demonstrates local closure elimination, not general map/callback +specialization or partial-application elimination. Those operations retain their +existing runtime behavior. Explicit heap environments, mutable-cell scalar +replacement, native GC metadata, and JIT exit reconstruction remain DEFERRED. +A useful next spike is a guarded, bounded specialization of a known higher-order +consumer, with dynamic redefinition and escaping callback tests. Whole-program +performance improvement remains UNKNOWN. + +## Results (2026-09-27, local arm64 LuaJIT 2.1.1774638290) + +Final JIT-enabled samples, one million calls, median CPU seconds: + +| Case | Off | On | GC-stopped growth per 10,000 calls, off / on | +| --- | ---: | ---: | ---: | +| Immediate lambda | 0.430640 | 0.020572 | 937.5 / 0 KiB | +| Local callback, two calls | 0.540989 | 0.027926 | 937.5 / 0 KiB | +| Escaping callback | 0.502972 | 0.523506 | 937.5 / 937.5 KiB | +| Deferred callback | 0.477620 | 0.506964 | 1796.875 / 1796.875 KiB | + +The eligible synthetic cases improve about 19–21x and lose their generated +MKFUN sites. Surviving closures retain their allocation behavior. Controls were +4–6% slower in this run; no control-case speedup is claimed. This is a local +microbenchmark with fixed ordering, not a statistically controlled application +benchmark. Retained deltas were zero here, so this does not demonstrate retained +memory improvement. Raw timing, heap, and trace observations are in +`bench/results/closures.txt`; the interpreter control is in +`bench/results/closures-interpreter.txt`. + +Validation: +- Final port suite: 1,092 passed, zero failed, across 22 specs in each mode. +- Canonical kernel suite: 134 passed, zero failed in both modes (baseline full + run plus final enabled full run). +- New spec: 41 checks spanning both modes, including captures, sharing, + shadowing, nested invocation, overapplication, identity, delayed errors, + argument evaluation once, and recursive escaping closures. +- Existing freeze, Prolog, evaluation-order, tail-call, and boot-cache specs pass. +- `git diff --check` passes. Base checkout is unchanged. + +Local full-run logs: `/tmp/shen-closures-baseline.log`, +`/tmp/shen-closures-baseline-port.log`, `/tmp/shen-closures-on.log`. + + +Follow-up: see [SPIKE-CALLBACKS.md](SPIKE-CALLBACKS.md) for guarded higher-order +specialization, stateful escaping closures, and the fresh-process control audit. +The follow-up judges gains against measured opportunity rather than a universal +10% whole-application threshold. diff --git a/SPIKE-TYPECHECK.md b/SPIKE-TYPECHECK.md new file mode 100644 index 0000000..5916ac0 --- /dev/null +++ b/SPIKE-TYPECHECK.md @@ -0,0 +1,107 @@ +# Typechecking and specialization + +Status: research only. Runtime remains at the guarded-closure implementation in +PR #68; none of the datatype experiments changes normal compilation or execution. + +## Plan and scope + +Publish the closure spike, isolate query work from boot history, profile the hot +path, and compare bounded dispatch experiments. Preserve inference counts, +predicate redefinition, cuts, exceptions, and whole-query legacy fallback. +Promote a runtime change only with repeatable evidence. + +## Query audit + +`bench/typecheck_specialization.lua` loads the canonical interpreter workload and +typechecks its recursive addition term. Every query must return `(list l-formula)` +and exactly 431,741 inferences. One priming query installs lazy native drivers. +Each process then runs 12 queries; reported process times are the median of queries +7–12. GC runs before each timed query. The workload, initialization, and timing +boundary are identical within comparisons; startup and compilation are excluded. + +`bench/typecheck_audit.py` alternates ordinary and specialized map across three +fresh-process pairs per JIT-history setting. Local closure elimination is off. +Times below are medians of the three process medians, in seconds. + +| JIT history | Ordinary map | Specialized map | +|---|---:|---:| +| Preserve boot traces | 0.138591 | 0.111951 | +| Flush after priming | 0.136424 | 0.103966 | +| Disable after priming | 0.649022 | 0.631897 | + +These are **not established speedups**. Flushed ordinary runs range from 0.061373 +to 0.145591 seconds, and specialized runs from 0.054520 to 0.128424. Flushing boot +traces does not remove variability. Interpreter results are much tighter. The +previous closure report's slower typechecking median does not establish a stable +map-specialization regression. + +## Hot path and bounded experiments + +A separate 30-query sampling run recorded 2,050 interpreted and 961 compiled +samples. Native datatype predicate dispatch and its arena operations dominate the +interpreted stacks. Profiling includes between-query GCs, so these counts are not +query-only execution percentages. A separate query trace log contains 150 +`trace too long` aborts. These observations motivate investigating trace formation +around datatype dispatch; they do not establish one causal bottleneck. + +1. **Unrolled dispatch:** give each datatype entry its own guarded predicate call + site, up to 32 entries, with generic suffix fallback. The actual workload has + four entries (2,588 bytes of generated worker source). Four fresh-process pairs + gave a JIT median of 0.086217 seconds ordinary versus 0.151296 specialized; + interpreter medians were 0.632305 versus 0.631386. Rejected for runtime adoption. + The benchmark-only module preserves live predicate lookup and suffix fallback. +2. **Recorder limits:** default, 8,000, and 16,000 recorded instructions gave four- + process medians of 0.062221, 0.135616, and 0.053224 seconds respectively. Variation + remained large and a short semantic-check process overlapped part of this + exploratory run. No global LuaJIT tuning is justified by this evidence. +3. **Loop dispatch:** replace recursive tail dispatch with an explicit loop, + retaining one dynamic predicate call site. Initial four-process medians were + 0.120075 seconds ordinary, 0.079047 loop, and 0.065525 loop with an 8,000-instruction + limit. Repeat measurements below isolate the loop with default recorder settings. + +The six-pair repeat gave 0.125050 seconds ordinary versus 0.072319 loop; the loop +won five pairs. Ranges still overlap: ordinary 0.039086–0.143462, loop +0.049287–0.111584. The median difference (42.2%) is promising exploratory evidence, +not an established application-wide speedup. Keep the loop benchmark-only until +multiple datatype workloads and trace diagnostics confirm the benefit. Do not +combine it with recorder tuning on this evidence. + +The next bounded specialization target is the native datatype predicate path: +inspect where recordings repeatedly expand through dispatch and continuation calls, +then compare any change against this loop reference. Preserve mutable predicate +lookup and the existing native/legacy ABI boundary. + +## Validation and reproduction + +The unrolled dispatcher passes 57 focused checks; the loop passes 54. These +compare results, inference counts, invocation order, redefinition during dispatch, +malformed entries, cuts, exceptions, reached/unreached missing predicates, long +lists, and positive/negative typechecking against the ordinary dispatcher. +They supplement the closure PR's 1,128 port checks and 134 kernel tests, already +passing in ordinary and combined closure/map configurations. + +Run from the repository root with LuaJIT on PATH: + +```sh +luajit bench/datatype_dispatch_spec.lua dispatch +luajit bench/datatype_dispatch_spec.lua loop +python3 bench/typecheck_audit.py +python3 bench/typecheck_dispatch_ab.py +python3 bench/typecheck_record_ab.py +python3 bench/typecheck_loop_ab.py +python3 bench/typecheck_loop_repeat.py +``` + +Each timing subprocess has a 90-second timeout. Processes run sequentially in +alternating/rotated order. Measurements used macOS arm64, LuaJIT 2.1.1774638290. This was a shared +machine with unrelated work running; CPU-time measurements reduce, but do not +eliminate, scheduling and resource-contention effects. No isolated-host claim is made. +Raw per-query data and summaries are in `bench/results/typecheck-*`. + +Provenance limitation: the archived dispatch A/B measurements used the temporary +runtime integration in `bench/results/datatype-dispatch.patch` against commit +`1a27f1d`, installed before the priming query and refreshed at native query entry. +That integration was reverted. The committed benchmark module installs after +priming and refreshes explicitly; rerunning the current dispatcher harness measures +that revised protocol, not an exact reproduction of the archived run. The archived +patch is evidence only and is not applied by any test or runtime path. diff --git a/bench/callback_profile.lua b/bench/callback_profile.lua new file mode 100644 index 0000000..3f5dbcd --- /dev/null +++ b/bench/callback_profile.lua @@ -0,0 +1,36 @@ +-- Instrumentation only: do not use these timings as A/B performance evidence. +local P,R=require('boot'),require('runtime') +P.load_kernel(false); P.initialise() +P.GLOBALS['*hush*']=true +local ffi=require('ffi'); ffi.cdef'int chdir(const char*);' +assert(ffi.C.chdir('tests')==0) +local rows, calls, elems, depth, map_time, created = {},0,0,0,0,0 +local mk=P.ENV.MKFUN +P.ENV.MKFUN=function(n,f) created=created+1; return mk(n,f) end +local orig=P.F.map +local wrapper=function(f,l) + calls=calls+1 + local info=type(f)=='function' and debug.getinfo(f,'S') + local key=info and (info.short_src..':'..info.linedefined) or tostring(f) + local row=rows[key] or {0,0}; rows[key]=row; row[1]=row[1]+1 + local x=l; while R.is_cons(x) do elems=elems+1; row[2]=row[2]+1; x=x[2] end + local start=depth==0 and os.clock(); depth=depth+1 + local result=orig(f,l) + depth=depth-1; if start then map_time=map_time+os.clock()-start end + return result +end +P.F.map=wrapper; P.FA[wrapper]=2 +local function phase(label,fn) + rows={}; calls=0; elems=0; created=0; map_time=0 + local t=os.clock(); fn(); t=os.clock()-t + print(string.format('%s seconds=%.6f map_inclusive_seconds=%.6f calls=%d elements=%d mkfun=%d',label,t,map_time,calls,elems,created)) + local sorted={}; for key,r in pairs(rows) do sorted[#sorted+1]={key,r[1],r[2]} end + table.sort(sorted,function(a,b)return a[3]>b[3] end) + for i=1,math.min(12,#sorted) do print(unpack(sorted[i])) end +end +phase('load-interpreter',function() P.F.load('interpreter.shen') end) +local term=P.F.hd(P.F['read-from-string']('[[[y-combinator [/. ADD [/. X [/. Y [if [= X 0] Y [[ADD [-- X]] [++ Y]]]]]]] 3] 4]')) +phase('typecheck-y',function() + local r=P.F['shen.typecheck'](term,P.F.gensym(R.intern('A'))) + assert(r~=false) +end) diff --git a/bench/closure_application.lua b/bench/closure_application.lua new file mode 100644 index 0000000..c6e1cae --- /dev/null +++ b/bench/closure_application.lua @@ -0,0 +1,31 @@ +-- Fresh process: SHEN_FASL=off SHEN_KERNEL_CACHE=off luajit bench/closure_application.lua +local P,R,C=require('boot'),require('runtime'),require('compiler') +assert(os.getenv('SHEN_FASL')=='off', 'disable fasl for compilation measurements') +local bytes,defs=0,0 +local compile=C.compile_top +C.compile_top=function(f) local s=compile(f); bytes=bytes+#s; defs=defs+1; return s end +local t=os.clock(); P.load_kernel(false); local kernel_compile=os.clock()-t +local kernel_bytes=bytes +P.initialise(); P.GLOBALS['*hush*']=true +local ffi=require('ffi'); ffi.cdef'int chdir(const char*);' +assert(ffi.C.chdir('tests')==0) +collectgarbage('collect') +local mkfun, original_mkfun=0,P.ENV.MKFUN +if os.getenv('SHEN_CALLBACK_COUNTS') then + P.ENV.MKFUN=function(n,f) mkfun=mkfun+1; return original_mkfun(n,f) end +else mkfun=-1 end +t=os.clock(); P.F.load('interpreter.shen'); local loadtime=os.clock()-t +P.ENV.MKFUN=original_mkfun +local term=P.F.hd(P.F['read-from-string']('[[[y-combinator [/. ADD [/. X [/. Y [if [= X 0] Y [[ADD [-- X]] [++ Y]]]]]]] 3] 4]')) +local times={}; local semantic +for i=1,4 do + P.GLOBALS["shen.*infs*"]=0 + collectgarbage('collect'); local start=os.clock() + local result=P.F['shen.typecheck'](term,P.F.gensym(R.intern('A'))) + assert(result~=false) + local rendered=R.to_str(result):gsub("%s+", "") + assert(not semantic or semantic==rendered, "stable inferred type"); semantic=rendered + if i>1 then times[#times+1]=os.clock()-start end +end +table.sort(times) +print(string.format('RESULT load=%.6f typecheck=%.6f kernel_compile=%.6f kernel_bytes=%d load_mkfun=%d semantic=%s',loadtime,times[2],kernel_compile,kernel_bytes,mkfun,semantic)) diff --git a/bench/closure_controls.py b/bench/closure_controls.py new file mode 100644 index 0000000..db89e65 --- /dev/null +++ b/bench/closure_controls.py @@ -0,0 +1,16 @@ +"""Fresh-process alternating-order controls; run from repository root.""" +import csv, io, json, subprocess, statistics +rows = [] +for round in range(4): + for mode in (['off', 'on'] if round % 2 == 0 else ['on', 'off']): + p = subprocess.run(['luajit', 'bench/closures.lua', '200000', mode], + text=True, capture_output=True, check=True, timeout=60) + for row in csv.DictReader(io.StringIO('\n'.join(p.stdout.splitlines()[1:]))): + row['round'] = round + rows.append(row) +with open('bench/results/closure-controls.json', 'w') as f: + json.dump(rows, f, indent=2) +for case in ['immediate', 'local', 'escaping', 'deferred']: + values = {m: [float(r['median_seconds']) for r in rows if r['case']==case and r['mode']==m] for m in ['off','on']} + med = {m: statistics.median(v) for m,v in values.items()} + print(case, values, 'median on/off=', med['on']/med['off']) diff --git a/bench/closure_diagnostics.py b/bench/closure_diagnostics.py new file mode 100644 index 0000000..32f78b2 --- /dev/null +++ b/bench/closure_diagnostics.py @@ -0,0 +1,20 @@ +"""Allocation counters and JIT diagnostics. These runs are not timing evidence.""" +import os, subprocess +from pathlib import Path +out=Path('bench/results') +lines=[] +for mode in ['off','on']: + env=dict(os.environ,SHEN_CLOSURES='off',SHEN_CALLBACK_COUNTS='1',SHEN_MAP_CLOSURES=mode,SHEN_FASL='off',SHEN_KERNEL_CACHE='off') + p=subprocess.run(['luajit','bench/closure_application.lua'],env=env,capture_output=True,text=True,timeout=90,check=True) + lines.append('application '+mode+' '+p.stdout.strip()) +for mode in ['ordinary','optimized','manual']: + env=dict(os.environ,SHEN_CLOSURES='off',SHEN_CALLBACK_COUNTS='1',SHEN_TRACE_MARKERS='1',SHEN_MAP_CLOSURES='off') + p=subprocess.run(['luajit','-jv','bench/closure_objects.lua',mode],env=env,capture_output=True,text=True,timeout=60,check=True) + lines.append('objects '+mode+' '+p.stdout.strip()) + log=p.stderr + assert len(log)<1000000, 'trace log exceeds budget' + (out/('closure-traces-'+mode+'.txt')).write_text(log) + measured=log.split('WORKLOAD_BEGIN\n')[1].split('WORKLOAD_END\n')[0] + lines.append(mode+' workload_trace_abort_FNEW='+str(measured.count('NYI: bytecode FNEW'))+' workload_trace_lines='+str(len(measured.splitlines()))) +(out/'closure-diagnostics.txt').write_text('\n'.join(lines)+'\n') +print('\n'.join(lines)) diff --git a/bench/closure_experiments.py b/bench/closure_experiments.py new file mode 100644 index 0000000..20610b7 --- /dev/null +++ b/bench/closure_experiments.py @@ -0,0 +1,36 @@ +"""Bounded, sequential fresh-process experiments. No profiling during timings.""" +import hashlib, itertools, json, os, statistics, subprocess +from pathlib import Path +out=Path('bench/results') +def run(args, env=None): + p=subprocess.run(args, env=env, capture_output=True, text=True, timeout=90) + if p.returncode: + raise RuntimeError(p.stdout[-2000:]+p.stderr[-2000:]) + lines=[s for s in p.stdout.splitlines() if s.startswith('RESULT ')] + assert len(lines)==1, p.stdout[-2000:] + return dict(s.split('=',1) for s in lines[0].split()[1:]) +# Check the unchanged controls in fresh compilers, including generated names. +control='''local C,R=require('compiler'),require('runtime'); require('prims'); C.CLOSURES=%s +for _,s in ipairs{'(defun ctrl (N) (let F (lambda X (+ N X)) (do (set escaped F) (F 3))))', '(defun ctrl (N) (let F (lambda X (+ N X)) (thaw (freeze (F 3)))))'} do print(C.cdefun(R.read_all(s)[1])) end''' +sources=[subprocess.check_output(['luajit','-e',control % m],timeout=15) for m in ['false','true']] +assert sources[0]==sources[1], 'unchanged controls differ in generated source' +print('controls identical source sha256='+hashlib.sha256(sources[0]).hexdigest(),flush=True) +app=[]; objects=[] +for round in range(6): + for mode in (['off','on'] if round%2==0 else ['on','off']): + env=dict(os.environ,SHEN_MAP_CLOSURES=mode,SHEN_CLOSURES='off',SHEN_FASL='off',SHEN_KERNEL_CACHE='off') + row=run(['luajit','bench/closure_application.lua'],env) + row.update(round=round,mode=mode); app.append(row) + print('app', row,flush=True) + order=list(itertools.permutations(['ordinary','optimized','manual']))[round] + for mode in order: + env=dict(os.environ,SHEN_MAP_CLOSURES='off',SHEN_CLOSURES='off') + row=run(['luajit','bench/closure_objects.lua',mode],env) + row.update(round=round); objects.append(row) + print('objects',row,flush=True) + (out/'closure-experiments.json').write_text(json.dumps(dict(application=app,objects=objects),indent=2)) +assert len({r['semantic'] for r in app})==1, 'same inferred type in every mode' +for group,rows,metric in [('application',app,'load'),('typecheck',app,'typecheck'),('objects',objects,'seconds')]: + for mode in sorted({r['mode'] for r in rows}): + vals=[float(r[metric]) for r in rows if r['mode']==mode] + print(group,mode,'median=',statistics.median(vals),'range=',min(vals),max(vals),flush=True) diff --git a/bench/closure_inventory.lua b/bench/closure_inventory.lua new file mode 100644 index 0000000..d38bb97 --- /dev/null +++ b/bench/closure_inventory.lua @@ -0,0 +1,23 @@ +-- luajit bench/closure_inventory.lua klambda/*.kl +local R, IR = require('runtime'), require('closure_ir') +local functions, candidates, eliminated, escaping = 0, 0, 0, 0 +for _,path in ipairs(arg) do + local f=assert(io.open(path)); local source=f:read('*a'); f:close() + for _,form in ipairs(R.read_all(source)) do + if R.is_cons(form) and R.is_symbol(form[1]) and form[1].name=='defun' then + local params={}; local p=form[2][2][1] + while R.is_cons(p) do params[#params+1]=p[1]; p=p[2] end + local _,records=IR.optimize(form[2][2][2][1],params) + functions=functions+1 + for _,r in ipairs(records) do + candidates=candidates+1 + if r.eliminated then + eliminated=eliminated+1 + print('eliminated '..form[2][1].name..' kind='..r.kind..' calls='..r.calls) + end + if r.escapes then escaping=escaping+1 end + end + end + end +end +print(string.format('defuns=%d candidates=%d eliminated=%d escaping_or_deferred=%d',functions,candidates,eliminated,escaping)) diff --git a/bench/closure_objects.lua b/bench/closure_objects.lua new file mode 100644 index 0000000..8ac911c --- /dev/null +++ b/bench/closure_objects.lua @@ -0,0 +1,52 @@ +-- Stateful closures escaping to the host and sharing mutable configuration. +-- luajit bench/closure_objects.lua ordinary|optimized|manual +local P,R,C=require('boot'),require('runtime'),require('compiler') +P.load_kernel(false) +local mode=arg[1] or 'ordinary' +assert(mode=='ordinary' or mode=='optimized' or mode=='manual') +C.MAP_CLOSURES=mode=='optimized' +local effect='(do (address-> S 1 (+ (<-address S 1) X)) (* X (<-address S 2)))' +local method=mode=='manual' and '(sc-manual S L ())' or '(map (lambda X '..effect..') L)' +local src='(defun sc-new (Factor) (let S (absvector 3) (do (address-> S 1 0) (do (address-> S 2 Factor) (cons (lambda L '..method..') (cons (lambda Unused (<-address S 1)) (cons (lambda Factor (address-> S 2 Factor)) ())))))))' +local manual='(defun sc-manual (S L Acc) (if (= L ()) (reverse Acc) (let X (hd L) (sc-manual S (tl L) (cons '..effect..' Acc)))))' +local t=os.clock() +local manual_code=mode=='manual' and C.cdefun(R.read_all(manual)[1]) or '' +if mode=='manual' then P.load_chunk(manual_code, 'object-manual')() end +local generated=C.cdefun(R.read_all(src)[1]); P.load_chunk(generated, 'object-factory')() +local compile_time=os.clock()-t +assert(mode~='optimized' or generated:find('MAP_BASE',1,true), 'specialization reached') +local input=R.NIL; for i=32,1,-1 do input=R.cons(i,input) end +for i=1,64 do P.F['sc-new'](i) end +collectgarbage('collect'); collectgarbage('collect'); local before=collectgarbage('count') +local objects={} +for i=1,1024 do objects[i]=P.F['sc-new'](i%7+1) end +collectgarbage('collect'); local retained=collectgarbage('count')-before +local invocations=0 +local function run(n) + local checksum=0 + for i=1,n do + local o=objects[i%#objects+1] + local factor=i%7+1 + P.APP(o[2][2][1],factor) + local result=P.APP(o[1],input) + assert(result[1]==factor) + checksum=checksum+result[1] + end + invocations=invocations+n + return checksum +end +if os.getenv('SHEN_TRACE_MARKERS') then io.stderr:write('WORKLOAD_BEGIN\n') end +run(5000) +local times={} +for i=1,5 do collectgarbage('collect'); t=os.clock(); run(20000); times[i]=os.clock()-t end +table.sort(times) +local probe_mkfun, original_mkfun=0,P.ENV.MKFUN +if os.getenv('SHEN_CALLBACK_COUNTS') then + P.ENV.MKFUN=function(n,f) probe_mkfun=probe_mkfun+1; return original_mkfun(n,f) end +else probe_mkfun=-1 end +collectgarbage('collect'); collectgarbage('stop'); before=collectgarbage('count'); run(1000) +local growth=collectgarbage('count')-before; collectgarbage('restart'); P.ENV.MKFUN=original_mkfun +local total=0; for _,o in ipairs(objects) do total=total+P.APP(o[2][1],0) end +assert(total==invocations*528, 'shared state history') +if os.getenv('SHEN_TRACE_MARKERS') then io.stderr:write('WORKLOAD_END\n') end +print(string.format('RESULT mode=%s seconds=%.6f growth_kib=%.3f retained_kib=%.3f code_bytes=%d compile_seconds=%.6f total=%d probe_mkfun=%d',mode,times[3],growth,retained,#generated+#manual_code,compile_time,total,probe_mkfun)) diff --git a/bench/closures.lua b/bench/closures.lua new file mode 100644 index 0000000..5f408ba --- /dev/null +++ b/bench/closures.lua @@ -0,0 +1,48 @@ +-- Run from repo root: luajit bench/closures.lua [iterations] +local P,R,C=require('boot'),require('runtime'),require('compiler') +P.load_kernel(false) +local N=tonumber(arg[1]) or 100000 +assert(N>=1000 and N<=1000000, 'iterations must be 1000..1000000') +local cases={ + {'immediate', '((lambda X (+ N X)) 3)'}, + {'local', '(let F (lambda X (+ N X)) (+ (F 3) (F 4)))'}, + {'escaping', '(let F (lambda X (+ N X)) (do (set cs-escape F) (F 3)))'}, + {'deferred', '(let F (lambda X (+ N X)) (thaw (freeze (F 3))))'}, +} +print(jit.version..' '..jit.arch..' jit='..tostring(jit.status())..' iterations='..N) +print('case,mode,median_seconds,heap_growth_KiB_10000,retained_KiB,MKFUN_sites,trace_stops,trace_aborts,exit_events_1000') +for _,case in ipairs(cases) do + for _,on in ipairs{false,true} do + if not arg[2] or arg[2]==(on and "on" or "off") then + C.CLOSURES=on + local form=R.read_all('(defun cs-bench (N) '..case[2]..')')[1] + local src=C.cdefun(form) + P.eval(form) + local fn=P.F['cs-bench'] + jit.flush() + local stops,aborts=0,0 + local function event(what) if what=='stop' then stops=stops+1 elseif what=='abort' then aborts=aborts+1 end end + jit.attach(event,'trace') + local sum=0 + local function run(n) local s=0; for i=1,n do s=s+fn(i%100) end; return s end + sum=run(20000) + jit.attach(event) + local times={} + for k=1,5 do collectgarbage('collect'); local t=os.clock(); sum=run(N); times[k]=os.clock()-t end + table.sort(times) + collectgarbage('collect'); collectgarbage('stop') + local before=collectgarbage('count'); run(10000) + local growth=collectgarbage('count')-before + collectgarbage('restart'); collectgarbage('collect') + local retained=collectgarbage('count')-before + local exits=0 + local function exit() exits=exits+1 end + jit.attach(exit,'texit'); run(1000); jit.attach(exit) + local _,sites=src:gsub('MKFUN','') + print(string.format('%s,%s,%.6f,%.3f,%.3f,%d,%d,%d,%d',case[1],on and 'on' or 'off',times[3],growth,retained,sites,stops,aborts,exits)) + local q,r=math.floor(N/100),N%100 + local inputs=q*4950+r*(r+1)/2 + assert(sum==(case[1]=='local' and (2*inputs+7*N) or (inputs+3*N))) + end + end +end diff --git a/bench/datatype_dispatch.lua b/bench/datatype_dispatch.lua new file mode 100644 index 0000000..6522a20 --- /dev/null +++ b/bench/datatype_dispatch.lua @@ -0,0 +1,63 @@ +-- Rejected runtime candidate, retained for reproducible experiments only. +local function new(P,E) +local R=require('runtime') +local Cons,Symbol,getmt=R.Cons,R.Symbol,getmetatable +local NP=E.NativePred +local generic_sud=assert(NP['shen.search-user-datatypes']) +local dispatch_root,dispatch_worker +local M={dispatch_stats={builds=0,sites=0,bytes=0},NATIVE_MISS=require('typecheck_native').NATIVE_MISS} +-- Bounded callback specialization for the ordered datatype list. Each site +-- keeps its live NP lookup (so redefinitions are observed) but has a distinct +-- Lua call instruction. Guards fall back at the current suffix, never replaying +-- predicates already tried. No predicate is translated merely to build this. +function M.refresh_datatype_dispatch() + local root = P.GLOBALS["shen.*datatypes*"] + if root == dispatch_root and dispatch_worker then return end + local names, rest = {}, root + while getmt(rest) == Cons and #names < 32 do + local entry = rest[1] + if getmt(entry) ~= Cons or getmt(entry[1]) ~= Symbol then break end + names[#names+1] = entry[1] + rest = rest[2] + end + if #names == 0 then + NP["shen.search-user-datatypes"] = generic_sud + dispatch_root, dispatch_worker = root, nil + return + end + local code = { "local E,NP,names,generic,miss = ...; return function(goal,assum,l,n,cont) local r" } + for i,nm in ipairs(names) do + code[#code+1] = ([=[ + do + if not E.lock_is_open() then return false end + l = E.lazyderef(l) + if l < E.CONS_BASE then return false end + local entry = E.lazyderef(E.car(l)) + if entry < E.CONS_BASE or E.atomval(E.lazyderef(E.car(entry))) ~= names[%d] then + return generic(goal,assum,l,n,cont) + end + local fn = NP[%q] + if fn == nil then error(miss,0) end + E.incinfs() + r = fn(goal,assum,n,cont) + if r ~= false then return r end + if not E.lock_is_open() then return false end + E.incinfs() + l = E.cdr(l) + end + ]=]):format(i,nm.name) + end + code[#code+1] = "return generic(goal,assum,l,n,cont) end" + local src = table.concat(code, "\n") + local make = assert((loadstring or load)(src, "@datatype-dispatch")) + dispatch_worker = make(E,NP,names,generic_sud,M.NATIVE_MISS) + dispatch_root = root + NP["shen.search-user-datatypes"] = dispatch_worker + M.dispatch_stats.builds = M.dispatch_stats.builds + 1 + M.dispatch_stats.sites, M.dispatch_stats.bytes = #names, #src +end + +M.refresh_datatype_dispatch() +return M +end +return {new=new} diff --git a/bench/datatype_dispatch_spec.lua b/bench/datatype_dispatch_spec.lua new file mode 100644 index 0000000..ce15cc7 --- /dev/null +++ b/bench/datatype_dispatch_spec.lua @@ -0,0 +1,78 @@ +local TN=require('typecheck_native') +local variant=arg[1] or 'dispatch' +assert(variant=='dispatch' or variant=='loop') +local P,R,E=require('boot'),require('runtime'),require('prolog_engine') +P.load_kernel(false); P.initialise() +TN.native_typecheck(1,R.intern('number')) -- force lazy driver installation +local NP=E.NativePred +local generic=NP['shen.search-user-datatypes'] +local original=P.GLOBALS['shen.*datatypes*'] +local D=require('bench.datatype_'..variant).new(P,E) +local n, calls=0,{} +local function check(x,label) assert(x,label); n=n+1 end +local function root(names) + local t={}; for _,name in ipairs(names) do t[#t+1]=R.cons(R.intern(name),function() end) end + return R.from_table(t) +end +local function setup(names) + P.GLOBALS['shen.*datatypes*']=root(names) + D.refresh_datatype_dispatch() + return NP['shen.search-user-datatypes'],P.GLOBALS['shen.*datatypes*'] +end +local function invoke(fn,list) + calls={}; local q=E.query_begin(); E.setinfs(0) + local ok,r=pcall(fn,0,0,E.import_cached(list),0,function() return true end) + local inf=E.getinfs(); E.query_end(q) + return {ok,r,inf,table.concat(calls,',')} +end +local function pred(name,result) + return function() calls[#calls+1]=name; return result end +end +local function equivalent(worker,list,reset,label) + reset(); local a=invoke(generic,list) + reset(); local b=invoke(worker,list) + for i=1,4 do check(a[i]==b[i],label..' field '..i) end + return b +end +local worker,list=setup{'dd-a','dd-b'} +if variant=='dispatch' then check(D.dispatch_stats.sites==2,'two sites') end +local function ordinary() NP['dd-a']=pred('a',false); NP['dd-b']=pred('b',99) end +local r=equivalent(worker,list,ordinary,'ordered success') +check(r[2]==99 and r[3]==3 and r[4]=='a,b','exact order and infs') +equivalent(worker,list,function() NP['dd-a']=pred('a',false); NP['dd-b']=pred('b',false) end,'all fail') +equivalent(worker,list,function() + NP['dd-a']=function() calls[#calls+1]='a'; NP['dd-b']=pred('new',17); return false end + NP['dd-b']=pred('old',99) +end,'mid-dispatch redefinition') +equivalent(worker,root{'dd-a','dd-c'},function() ordinary(); NP['dd-c']=pred('c',18) end,'suffix mismatch') +local bad=R.cons(R.intern('malformed'),root{'dd-b'}) +equivalent(worker,bad,ordinary,'malformed entry') +equivalent(worker,list,function() + NP['dd-a']=function() calls[#calls+1]='cut'; return E.cut(1,function() return false end) end + NP['dd-b']=pred('unreachable',99) +end,'cut prevents later callbacks') +local sentinel={} +equivalent(worker,list,function() NP['dd-a']=function() error(sentinel,0) end end,'error propagates') +worker,list=setup{'dd-a','dd-missing'} +equivalent(worker,list,function() NP['dd-a']=pred('a',77); NP['dd-missing']=nil end,'unreached missing predicate') +equivalent(worker,list,function() NP['dd-a']=pred('a',false); NP['dd-missing']=nil end,'reached missing predicate') +local names={}; for i=1,40 do names[i]='dd-'..i; NP[names[i]]=pred(tostring(i),i==40 and 40 or false) end +worker,list=setup(names) +if variant=='dispatch' then check(D.dispatch_stats.sites==32 and D.dispatch_stats.bytes<32000,'bounded code generation') end +r=equivalent(worker,list,function() end,'long list suffix') +check(r[2]==40 and r[3]==79,'long list count') +P.GLOBALS['shen.*datatypes*']=R.NIL; D.refresh_datatype_dispatch() +if variant=='dispatch' then check(NP['shen.search-user-datatypes']==generic,'empty list restores generic') end +P.GLOBALS['shen.*datatypes*']=original +local cases={{'1','number',true},{'"x"','number',false},{'[1 2]','(list number)',true}, + {'(+ 1 "x")','number',false},{'(/. X X)','(number --> number)',true}, + {'(if true 1 "x")','number',false}} +for _,enabled in ipairs{false,true} do + if not enabled then NP['shen.search-user-datatypes']=generic else D.refresh_datatype_dispatch() end + for _,c in ipairs(cases) do + P.GLOBALS['shen.*infs*']=0 + local result=TN.native_typecheck(P.F['read-from-string'](c[1])[1],P.F['read-from-string'](c[2])[1]) + check((result~=false)==c[3],'typing '..c[1]) + end +end +print('datatype_'..variant..'_spec: '..n..' pass, 0 fail') diff --git a/bench/datatype_loop.lua b/bench/datatype_loop.lua new file mode 100644 index 0000000..12a74a6 --- /dev/null +++ b/bench/datatype_loop.lua @@ -0,0 +1,29 @@ +-- Experiment: give LuaJIT an explicit loop instead of recursive tail dispatch. +local function new(P,E) + local NP=E.NativePred + local Symbol=require("runtime").Symbol + local miss=require('typecheck_native').NATIVE_MISS + local function search(goal,assum,dts,n,cont) + while true do + if not E.lock_is_open() then return false end + local l=E.lazyderef(dts) + if l=E.CONS_BASE then + local nm=E.atomval(E.lazyderef(E.car(entry))) + local fn=(getmetatable(nm)==Symbol) and NP[nm.name] or nil + if fn==nil then error(miss,0) end + E.incinfs(); r=fn(goal,assum,n,cont) + end + if r~=false then return r end + if not E.lock_is_open() then return false end + E.incinfs(); dts=E.cdr(l) + end + end + local M={dispatch_stats={builds=1,sites=1,bytes=0}} + function M.refresh_datatype_dispatch() NP['shen.search-user-datatypes']=search end + M.refresh_datatype_dispatch() + return M +end +return {new=new} diff --git a/bench/results/callback-profile.txt b/bench/results/callback-profile.txt new file mode 100644 index 0000000..eee9080 --- /dev/null +++ b/bench/results/callback-profile.txt @@ -0,0 +1,15 @@ +load-interpreter seconds=0.782151 map_inclusive_seconds=0.590701 calls=140708 elements=450870 mkfun=149074 +[string "core"]:48 94251 299894 +[string "macros"]:3 37560 122351 +[string "core"]:45 4536 14362 +[string "reader"]:119 3361 10016 +[string "macros"]:1 360 2520 +[string "reader"]:121 361 841 +[string "prolog"]:53 112 269 +[string "reader"]:122 10 188 +[string "core"]:7 52 126 +[string "t-star"]:10 32 64 +[string "core"]:44 26 63 +[string "prolog"]:15 16 56 +typecheck-y seconds=0.401663 map_inclusive_seconds=0.000180 calls=30 elements=60 mkfun=609 +[string "t-star"]:10 30 60 diff --git a/bench/results/closure-controls.json b/bench/results/closure-controls.json new file mode 100644 index 0000000..51d5110 --- /dev/null +++ b/bench/results/closure-controls.json @@ -0,0 +1,386 @@ +[ + { + "case": "immediate", + "mode": "off", + "median_seconds": "0.088270", + "heap_growth_KiB_10000": "937.500", + "retained_KiB": "-0.500", + "MKFUN_sites": "1", + "trace_stops": "3", + "trace_aborts": "17", + "exit_events_1000": "0", + "round": 0 + }, + { + "case": "local", + "mode": "off", + "median_seconds": "0.112272", + "heap_growth_KiB_10000": "937.500", + "retained_KiB": "0.000", + "MKFUN_sites": "1", + "trace_stops": "4", + "trace_aborts": "13", + "exit_events_1000": "0", + "round": 0 + }, + { + "case": "escaping", + "mode": "off", + "median_seconds": "0.108037", + "heap_growth_KiB_10000": "937.500", + "retained_KiB": "0.000", + "MKFUN_sites": "1", + "trace_stops": "5", + "trace_aborts": "12", + "exit_events_1000": "0", + "round": 0 + }, + { + "case": "deferred", + "mode": "off", + "median_seconds": "0.107808", + "heap_growth_KiB_10000": "1796.875", + "retained_KiB": "0.000", + "MKFUN_sites": "1", + "trace_stops": "7", + "trace_aborts": "12", + "exit_events_1000": "0", + "round": 0 + }, + { + "case": "immediate", + "mode": "on", + "median_seconds": "0.000731", + "heap_growth_KiB_10000": "0.000", + "retained_KiB": "-4.000", + "MKFUN_sites": "0", + "trace_stops": "1", + "trace_aborts": "0", + "exit_events_1000": "1", + "round": 0 + }, + { + "case": "local", + "mode": "on", + "median_seconds": "0.000860", + "heap_growth_KiB_10000": "0.000", + "retained_KiB": "0.000", + "MKFUN_sites": "0", + "trace_stops": "2", + "trace_aborts": "0", + "exit_events_1000": "1", + "round": 0 + }, + { + "case": "escaping", + "mode": "on", + "median_seconds": "0.106652", + "heap_growth_KiB_10000": "937.500", + "retained_KiB": "0.000", + "MKFUN_sites": "1", + "trace_stops": "4", + "trace_aborts": "15", + "exit_events_1000": "0", + "round": 0 + }, + { + "case": "deferred", + "mode": "on", + "median_seconds": "0.104896", + "heap_growth_KiB_10000": "1796.875", + "retained_KiB": "0.000", + "MKFUN_sites": "1", + "trace_stops": "5", + "trace_aborts": "12", + "exit_events_1000": "0", + "round": 0 + }, + { + "case": "immediate", + "mode": "on", + "median_seconds": "0.000465", + "heap_growth_KiB_10000": "0.000", + "retained_KiB": "-4.000", + "MKFUN_sites": "0", + "trace_stops": "1", + "trace_aborts": "0", + "exit_events_1000": "1", + "round": 1 + }, + { + "case": "local", + "mode": "on", + "median_seconds": "0.000471", + "heap_growth_KiB_10000": "0.000", + "retained_KiB": "0.000", + "MKFUN_sites": "0", + "trace_stops": "2", + "trace_aborts": "0", + "exit_events_1000": "1", + "round": 1 + }, + { + "case": "escaping", + "mode": "on", + "median_seconds": "0.106465", + "heap_growth_KiB_10000": "937.500", + "retained_KiB": "0.000", + "MKFUN_sites": "1", + "trace_stops": "5", + "trace_aborts": "17", + "exit_events_1000": "0", + "round": 1 + }, + { + "case": "deferred", + "mode": "on", + "median_seconds": "0.112222", + "heap_growth_KiB_10000": "1796.875", + "retained_KiB": "0.000", + "MKFUN_sites": "1", + "trace_stops": "6", + "trace_aborts": "13", + "exit_events_1000": "0", + "round": 1 + }, + { + "case": "immediate", + "mode": "off", + "median_seconds": "0.094384", + "heap_growth_KiB_10000": "937.500", + "retained_KiB": "-0.500", + "MKFUN_sites": "1", + "trace_stops": "2", + "trace_aborts": "19", + "exit_events_1000": "0", + "round": 1 + }, + { + "case": "local", + "mode": "off", + "median_seconds": "0.114615", + "heap_growth_KiB_10000": "937.500", + "retained_KiB": "0.000", + "MKFUN_sites": "1", + "trace_stops": "4", + "trace_aborts": "12", + "exit_events_1000": "0", + "round": 1 + }, + { + "case": "escaping", + "mode": "off", + "median_seconds": "0.109507", + "heap_growth_KiB_10000": "937.500", + "retained_KiB": "0.000", + "MKFUN_sites": "1", + "trace_stops": "5", + "trace_aborts": "13", + "exit_events_1000": "0", + "round": 1 + }, + { + "case": "deferred", + "mode": "off", + "median_seconds": "0.115244", + "heap_growth_KiB_10000": "1796.875", + "retained_KiB": "0.000", + "MKFUN_sites": "1", + "trace_stops": "6", + "trace_aborts": "12", + "exit_events_1000": "0", + "round": 1 + }, + { + "case": "immediate", + "mode": "off", + "median_seconds": "0.087405", + "heap_growth_KiB_10000": "937.500", + "retained_KiB": "-0.500", + "MKFUN_sites": "1", + "trace_stops": "4", + "trace_aborts": "22", + "exit_events_1000": "0", + "round": 2 + }, + { + "case": "local", + "mode": "off", + "median_seconds": "0.112534", + "heap_growth_KiB_10000": "937.500", + "retained_KiB": "0.000", + "MKFUN_sites": "1", + "trace_stops": "4", + "trace_aborts": "12", + "exit_events_1000": "0", + "round": 2 + }, + { + "case": "escaping", + "mode": "off", + "median_seconds": "0.108970", + "heap_growth_KiB_10000": "937.500", + "retained_KiB": "0.000", + "MKFUN_sites": "1", + "trace_stops": "6", + "trace_aborts": "12", + "exit_events_1000": "0", + "round": 2 + }, + { + "case": "deferred", + "mode": "off", + "median_seconds": "0.113906", + "heap_growth_KiB_10000": "1796.875", + "retained_KiB": "0.000", + "MKFUN_sites": "1", + "trace_stops": "4", + "trace_aborts": "12", + "exit_events_1000": "0", + "round": 2 + }, + { + "case": "immediate", + "mode": "on", + "median_seconds": "0.000844", + "heap_growth_KiB_10000": "0.000", + "retained_KiB": "-4.000", + "MKFUN_sites": "0", + "trace_stops": "2", + "trace_aborts": "0", + "exit_events_1000": "1", + "round": 2 + }, + { + "case": "local", + "mode": "on", + "median_seconds": "0.000466", + "heap_growth_KiB_10000": "0.000", + "retained_KiB": "0.000", + "MKFUN_sites": "0", + "trace_stops": "3", + "trace_aborts": "0", + "exit_events_1000": "1", + "round": 2 + }, + { + "case": "escaping", + "mode": "on", + "median_seconds": "0.111013", + "heap_growth_KiB_10000": "937.500", + "retained_KiB": "0.000", + "MKFUN_sites": "1", + "trace_stops": "5", + "trace_aborts": "17", + "exit_events_1000": "0", + "round": 2 + }, + { + "case": "deferred", + "mode": "on", + "median_seconds": "0.109151", + "heap_growth_KiB_10000": "1796.875", + "retained_KiB": "0.000", + "MKFUN_sites": "1", + "trace_stops": "5", + "trace_aborts": "12", + "exit_events_1000": "0", + "round": 2 + }, + { + "case": "immediate", + "mode": "on", + "median_seconds": "0.000675", + "heap_growth_KiB_10000": "0.000", + "retained_KiB": "-4.000", + "MKFUN_sites": "0", + "trace_stops": "2", + "trace_aborts": "0", + "exit_events_1000": "1", + "round": 3 + }, + { + "case": "local", + "mode": "on", + "median_seconds": "0.000590", + "heap_growth_KiB_10000": "0.000", + "retained_KiB": "0.000", + "MKFUN_sites": "0", + "trace_stops": "4", + "trace_aborts": "0", + "exit_events_1000": "1", + "round": 3 + }, + { + "case": "escaping", + "mode": "on", + "median_seconds": "0.099663", + "heap_growth_KiB_10000": "937.500", + "retained_KiB": "0.000", + "MKFUN_sites": "1", + "trace_stops": "4", + "trace_aborts": "17", + "exit_events_1000": "0", + "round": 3 + }, + { + "case": "deferred", + "mode": "on", + "median_seconds": "0.111256", + "heap_growth_KiB_10000": "1796.875", + "retained_KiB": "0.000", + "MKFUN_sites": "1", + "trace_stops": "6", + "trace_aborts": "13", + "exit_events_1000": "0", + "round": 3 + }, + { + "case": "immediate", + "mode": "off", + "median_seconds": "0.088329", + "heap_growth_KiB_10000": "937.500", + "retained_KiB": "-0.500", + "MKFUN_sites": "1", + "trace_stops": "3", + "trace_aborts": "18", + "exit_events_1000": "0", + "round": 3 + }, + { + "case": "local", + "mode": "off", + "median_seconds": "0.113372", + "heap_growth_KiB_10000": "937.500", + "retained_KiB": "0.000", + "MKFUN_sites": "1", + "trace_stops": "4", + "trace_aborts": "13", + "exit_events_1000": "0", + "round": 3 + }, + { + "case": "escaping", + "mode": "off", + "median_seconds": "0.109431", + "heap_growth_KiB_10000": "937.500", + "retained_KiB": "0.000", + "MKFUN_sites": "1", + "trace_stops": "5", + "trace_aborts": "12", + "exit_events_1000": "0", + "round": 3 + }, + { + "case": "deferred", + "mode": "off", + "median_seconds": "0.109391", + "heap_growth_KiB_10000": "1796.875", + "retained_KiB": "0.000", + "MKFUN_sites": "1", + "trace_stops": "6", + "trace_aborts": "12", + "exit_events_1000": "0", + "round": 3 + } +] \ No newline at end of file diff --git a/bench/results/closure-controls.txt b/bench/results/closure-controls.txt new file mode 100644 index 0000000..006241a --- /dev/null +++ b/bench/results/closure-controls.txt @@ -0,0 +1,4 @@ +immediate {'off': [0.08827, 0.094384, 0.087405, 0.088329], 'on': [0.000731, 0.000465, 0.000844, 0.000675]} median on/off= 0.007961539986070137 +local {'off': [0.112272, 0.114615, 0.112534, 0.113372], 'on': [0.00086, 0.000471, 0.000466, 0.00059]} median on/off= 0.0046966437367754734 +escaping {'off': [0.108037, 0.109507, 0.10897, 0.109431], 'on': [0.106652, 0.106465, 0.111013, 0.099663]} median on/off= 0.9758059715843791 +deferred {'off': [0.107808, 0.115244, 0.113906, 0.109391], 'on': [0.104896, 0.112222, 0.109151, 0.111256]} median on/off= 0.9870575959372495 diff --git a/bench/results/closure-diagnostics.txt b/bench/results/closure-diagnostics.txt new file mode 100644 index 0000000..250242a --- /dev/null +++ b/bench/results/closure-diagnostics.txt @@ -0,0 +1,8 @@ +application off RESULT load=0.708923 typecheck=0.059198 kernel_compile=0.341980 kernel_bytes=588900 load_mkfun=149074 semantic=(listl-formula) +application on RESULT load=0.491955 typecheck=0.113069 kernel_compile=0.326067 kernel_bytes=618740 load_mkfun=8366 semantic=(listl-formula) +objects ordinary RESULT mode=ordinary seconds=0.102783 growth_kib=5556.453 retained_kib=689.262 code_bytes=576 compile_seconds=0.003182 total=55968000 probe_mkfun=1000 +ordinary workload_trace_abort_FNEW=26 workload_trace_lines=59 +objects optimized RESULT mode=optimized seconds=0.076007 growth_kib=5500.000 retained_kib=689.574 code_bytes=1029 compile_seconds=0.003307 total=55968000 probe_mkfun=0 +optimized workload_trace_abort_FNEW=0 workload_trace_lines=49 +objects manual RESULT mode=manual seconds=0.070935 growth_kib=5500.000 retained_kib=681.262 code_bytes=815 compile_seconds=0.002401 total=55968000 probe_mkfun=0 +manual workload_trace_abort_FNEW=0 workload_trace_lines=8 diff --git a/bench/results/closure-experiments.json b/bench/results/closure-experiments.json new file mode 100644 index 0000000..eeb89c1 --- /dev/null +++ b/bench/results/closure-experiments.json @@ -0,0 +1,324 @@ +{ + "application": [ + { + "load": "0.736475", + "typecheck": "0.060459", + "kernel_compile": "0.422396", + "kernel_bytes": "588900", + "load_mkfun": "-1", + "semantic": "(listl-formula)", + "round": 0, + "mode": "off" + }, + { + "load": "0.591180", + "typecheck": "0.146308", + "kernel_compile": "0.440880", + "kernel_bytes": "618740", + "load_mkfun": "-1", + "semantic": "(listl-formula)", + "round": 0, + "mode": "on" + }, + { + "load": "0.547895", + "typecheck": "0.131657", + "kernel_compile": "0.458172", + "kernel_bytes": "618740", + "load_mkfun": "-1", + "semantic": "(listl-formula)", + "round": 1, + "mode": "on" + }, + { + "load": "0.753705", + "typecheck": "0.058485", + "kernel_compile": "0.426760", + "kernel_bytes": "588900", + "load_mkfun": "-1", + "semantic": "(listl-formula)", + "round": 1, + "mode": "off" + }, + { + "load": "0.810611", + "typecheck": "0.162242", + "kernel_compile": "0.391570", + "kernel_bytes": "588900", + "load_mkfun": "-1", + "semantic": "(listl-formula)", + "round": 2, + "mode": "off" + }, + { + "load": "0.532443", + "typecheck": "0.062623", + "kernel_compile": "0.380144", + "kernel_bytes": "618740", + "load_mkfun": "-1", + "semantic": "(listl-formula)", + "round": 2, + "mode": "on" + }, + { + "load": "0.486806", + "typecheck": "0.129009", + "kernel_compile": "0.421693", + "kernel_bytes": "618740", + "load_mkfun": "-1", + "semantic": "(listl-formula)", + "round": 3, + "mode": "on" + }, + { + "load": "0.726390", + "typecheck": "0.062396", + "kernel_compile": "0.437516", + "kernel_bytes": "588900", + "load_mkfun": "-1", + "semantic": "(listl-formula)", + "round": 3, + "mode": "off" + }, + { + "load": "0.768166", + "typecheck": "0.150995", + "kernel_compile": "0.424315", + "kernel_bytes": "588900", + "load_mkfun": "-1", + "semantic": "(listl-formula)", + "round": 4, + "mode": "off" + }, + { + "load": "0.562775", + "typecheck": "0.114666", + "kernel_compile": "0.441122", + "kernel_bytes": "618740", + "load_mkfun": "-1", + "semantic": "(listl-formula)", + "round": 4, + "mode": "on" + }, + { + "load": "0.522398", + "typecheck": "0.036322", + "kernel_compile": "0.394084", + "kernel_bytes": "618740", + "load_mkfun": "-1", + "semantic": "(listl-formula)", + "round": 5, + "mode": "on" + }, + { + "load": "0.627108", + "typecheck": "0.136074", + "kernel_compile": "0.384590", + "kernel_bytes": "588900", + "load_mkfun": "-1", + "semantic": "(listl-formula)", + "round": 5, + "mode": "off" + } + ], + "objects": [ + { + "mode": "ordinary", + "seconds": "0.133343", + "growth_kib": "5554.688", + "retained_kib": "655.820", + "code_bytes": "576", + "compile_seconds": "0.003528", + "total": "55968000", + "probe_mkfun": "-1", + "round": 0 + }, + { + "mode": "optimized", + "seconds": "0.103044", + "growth_kib": "5500.000", + "retained_kib": "656.062", + "code_bytes": "1029", + "compile_seconds": "0.003881", + "total": "55968000", + "probe_mkfun": "-1", + "round": 0 + }, + { + "mode": "manual", + "seconds": "0.092902", + "growth_kib": "5500.000", + "retained_kib": "648.062", + "code_bytes": "815", + "compile_seconds": "0.004005", + "total": "55968000", + "probe_mkfun": "-1", + "round": 0 + }, + { + "mode": "ordinary", + "seconds": "0.120599", + "growth_kib": "5554.688", + "retained_kib": "655.820", + "code_bytes": "576", + "compile_seconds": "0.001983", + "total": "55968000", + "probe_mkfun": "-1", + "round": 1 + }, + { + "mode": "manual", + "seconds": "0.082645", + "growth_kib": "5500.000", + "retained_kib": "647.543", + "code_bytes": "815", + "compile_seconds": "0.003052", + "total": "55968000", + "probe_mkfun": "-1", + "round": 1 + }, + { + "mode": "optimized", + "seconds": "0.096073", + "growth_kib": "5500.000", + "retained_kib": "655.812", + "code_bytes": "1029", + "compile_seconds": "0.002723", + "total": "55968000", + "probe_mkfun": "-1", + "round": 1 + }, + { + "mode": "optimized", + "seconds": "0.098806", + "growth_kib": "5500.000", + "retained_kib": "655.543", + "code_bytes": "1029", + "compile_seconds": "0.003804", + "total": "55968000", + "probe_mkfun": "-1", + "round": 2 + }, + { + "mode": "ordinary", + "seconds": "0.128137", + "growth_kib": "5554.688", + "retained_kib": "656.062", + "code_bytes": "576", + "compile_seconds": "0.003664", + "total": "55968000", + "probe_mkfun": "-1", + "round": 2 + }, + { + "mode": "manual", + "seconds": "0.091718", + "growth_kib": "5500.000", + "retained_kib": "648.062", + "code_bytes": "815", + "compile_seconds": "0.003794", + "total": "55968000", + "probe_mkfun": "-1", + "round": 2 + }, + { + "mode": "optimized", + "seconds": "0.098020", + "growth_kib": "5500.000", + "retained_kib": "655.730", + "code_bytes": "1029", + "compile_seconds": "0.003506", + "total": "55968000", + "probe_mkfun": "-1", + "round": 3 + }, + { + "mode": "manual", + "seconds": "0.086522", + "growth_kib": "5500.000", + "retained_kib": "647.730", + "code_bytes": "815", + "compile_seconds": "0.004353", + "total": "55968000", + "probe_mkfun": "-1", + "round": 3 + }, + { + "mode": "ordinary", + "seconds": "0.104714", + "growth_kib": "5554.688", + "retained_kib": "655.812", + "code_bytes": "576", + "compile_seconds": "0.003512", + "total": "55968000", + "probe_mkfun": "-1", + "round": 3 + }, + { + "mode": "manual", + "seconds": "0.086975", + "growth_kib": "5500.000", + "retained_kib": "647.723", + "code_bytes": "815", + "compile_seconds": "0.002665", + "total": "55968000", + "probe_mkfun": "-1", + "round": 4 + }, + { + "mode": "ordinary", + "seconds": "0.124753", + "growth_kib": "5554.688", + "retained_kib": "655.812", + "code_bytes": "576", + "compile_seconds": "0.002177", + "total": "55968000", + "probe_mkfun": "-1", + "round": 4 + }, + { + "mode": "optimized", + "seconds": "0.097547", + "growth_kib": "5585.938", + "retained_kib": "656.102", + "code_bytes": "1029", + "compile_seconds": "0.003061", + "total": "55968000", + "probe_mkfun": "-1", + "round": 4 + }, + { + "mode": "manual", + "seconds": "0.075787", + "growth_kib": "5500.000", + "retained_kib": "648.062", + "code_bytes": "815", + "compile_seconds": "0.002903", + "total": "55968000", + "probe_mkfun": "-1", + "round": 5 + }, + { + "mode": "optimized", + "seconds": "0.081064", + "growth_kib": "5585.938", + "retained_kib": "655.820", + "code_bytes": "1029", + "compile_seconds": "0.002685", + "total": "55968000", + "probe_mkfun": "-1", + "round": 5 + }, + { + "mode": "ordinary", + "seconds": "0.102052", + "growth_kib": "5554.688", + "retained_kib": "655.730", + "code_bytes": "576", + "compile_seconds": "0.003070", + "total": "55968000", + "probe_mkfun": "-1", + "round": 5 + } + ] +} \ No newline at end of file diff --git a/bench/results/closure-experiments.txt b/bench/results/closure-experiments.txt new file mode 100644 index 0000000..3805b1e --- /dev/null +++ b/bench/results/closure-experiments.txt @@ -0,0 +1,38 @@ +controls identical source sha256=dd97c5fe93b23c62e08cc125e24af7c676c3a1c2ccc5d45ccaba0d5733beab80 +app {'load': '0.736475', 'typecheck': '0.060459', 'kernel_compile': '0.422396', 'kernel_bytes': '588900', 'load_mkfun': '-1', 'semantic': '(listl-formula)', 'round': 0, 'mode': 'off'} +app {'load': '0.591180', 'typecheck': '0.146308', 'kernel_compile': '0.440880', 'kernel_bytes': '618740', 'load_mkfun': '-1', 'semantic': '(listl-formula)', 'round': 0, 'mode': 'on'} +objects {'mode': 'ordinary', 'seconds': '0.133343', 'growth_kib': '5554.688', 'retained_kib': '655.820', 'code_bytes': '576', 'compile_seconds': '0.003528', 'total': '55968000', 'probe_mkfun': '-1', 'round': 0} +objects {'mode': 'optimized', 'seconds': '0.103044', 'growth_kib': '5500.000', 'retained_kib': '656.062', 'code_bytes': '1029', 'compile_seconds': '0.003881', 'total': '55968000', 'probe_mkfun': '-1', 'round': 0} +objects {'mode': 'manual', 'seconds': '0.092902', 'growth_kib': '5500.000', 'retained_kib': '648.062', 'code_bytes': '815', 'compile_seconds': '0.004005', 'total': '55968000', 'probe_mkfun': '-1', 'round': 0} +app {'load': '0.547895', 'typecheck': '0.131657', 'kernel_compile': '0.458172', 'kernel_bytes': '618740', 'load_mkfun': '-1', 'semantic': '(listl-formula)', 'round': 1, 'mode': 'on'} +app {'load': '0.753705', 'typecheck': '0.058485', 'kernel_compile': '0.426760', 'kernel_bytes': '588900', 'load_mkfun': '-1', 'semantic': '(listl-formula)', 'round': 1, 'mode': 'off'} +objects {'mode': 'ordinary', 'seconds': '0.120599', 'growth_kib': '5554.688', 'retained_kib': '655.820', 'code_bytes': '576', 'compile_seconds': '0.001983', 'total': '55968000', 'probe_mkfun': '-1', 'round': 1} +objects {'mode': 'manual', 'seconds': '0.082645', 'growth_kib': '5500.000', 'retained_kib': '647.543', 'code_bytes': '815', 'compile_seconds': '0.003052', 'total': '55968000', 'probe_mkfun': '-1', 'round': 1} +objects {'mode': 'optimized', 'seconds': '0.096073', 'growth_kib': '5500.000', 'retained_kib': '655.812', 'code_bytes': '1029', 'compile_seconds': '0.002723', 'total': '55968000', 'probe_mkfun': '-1', 'round': 1} +app {'load': '0.810611', 'typecheck': '0.162242', 'kernel_compile': '0.391570', 'kernel_bytes': '588900', 'load_mkfun': '-1', 'semantic': '(listl-formula)', 'round': 2, 'mode': 'off'} +app {'load': '0.532443', 'typecheck': '0.062623', 'kernel_compile': '0.380144', 'kernel_bytes': '618740', 'load_mkfun': '-1', 'semantic': '(listl-formula)', 'round': 2, 'mode': 'on'} +objects {'mode': 'optimized', 'seconds': '0.098806', 'growth_kib': '5500.000', 'retained_kib': '655.543', 'code_bytes': '1029', 'compile_seconds': '0.003804', 'total': '55968000', 'probe_mkfun': '-1', 'round': 2} +objects {'mode': 'ordinary', 'seconds': '0.128137', 'growth_kib': '5554.688', 'retained_kib': '656.062', 'code_bytes': '576', 'compile_seconds': '0.003664', 'total': '55968000', 'probe_mkfun': '-1', 'round': 2} +objects {'mode': 'manual', 'seconds': '0.091718', 'growth_kib': '5500.000', 'retained_kib': '648.062', 'code_bytes': '815', 'compile_seconds': '0.003794', 'total': '55968000', 'probe_mkfun': '-1', 'round': 2} +app {'load': '0.486806', 'typecheck': '0.129009', 'kernel_compile': '0.421693', 'kernel_bytes': '618740', 'load_mkfun': '-1', 'semantic': '(listl-formula)', 'round': 3, 'mode': 'on'} +app {'load': '0.726390', 'typecheck': '0.062396', 'kernel_compile': '0.437516', 'kernel_bytes': '588900', 'load_mkfun': '-1', 'semantic': '(listl-formula)', 'round': 3, 'mode': 'off'} +objects {'mode': 'optimized', 'seconds': '0.098020', 'growth_kib': '5500.000', 'retained_kib': '655.730', 'code_bytes': '1029', 'compile_seconds': '0.003506', 'total': '55968000', 'probe_mkfun': '-1', 'round': 3} +objects {'mode': 'manual', 'seconds': '0.086522', 'growth_kib': '5500.000', 'retained_kib': '647.730', 'code_bytes': '815', 'compile_seconds': '0.004353', 'total': '55968000', 'probe_mkfun': '-1', 'round': 3} +objects {'mode': 'ordinary', 'seconds': '0.104714', 'growth_kib': '5554.688', 'retained_kib': '655.812', 'code_bytes': '576', 'compile_seconds': '0.003512', 'total': '55968000', 'probe_mkfun': '-1', 'round': 3} +app {'load': '0.768166', 'typecheck': '0.150995', 'kernel_compile': '0.424315', 'kernel_bytes': '588900', 'load_mkfun': '-1', 'semantic': '(listl-formula)', 'round': 4, 'mode': 'off'} +app {'load': '0.562775', 'typecheck': '0.114666', 'kernel_compile': '0.441122', 'kernel_bytes': '618740', 'load_mkfun': '-1', 'semantic': '(listl-formula)', 'round': 4, 'mode': 'on'} +objects {'mode': 'manual', 'seconds': '0.086975', 'growth_kib': '5500.000', 'retained_kib': '647.723', 'code_bytes': '815', 'compile_seconds': '0.002665', 'total': '55968000', 'probe_mkfun': '-1', 'round': 4} +objects {'mode': 'ordinary', 'seconds': '0.124753', 'growth_kib': '5554.688', 'retained_kib': '655.812', 'code_bytes': '576', 'compile_seconds': '0.002177', 'total': '55968000', 'probe_mkfun': '-1', 'round': 4} +objects {'mode': 'optimized', 'seconds': '0.097547', 'growth_kib': '5585.938', 'retained_kib': '656.102', 'code_bytes': '1029', 'compile_seconds': '0.003061', 'total': '55968000', 'probe_mkfun': '-1', 'round': 4} +app {'load': '0.522398', 'typecheck': '0.036322', 'kernel_compile': '0.394084', 'kernel_bytes': '618740', 'load_mkfun': '-1', 'semantic': '(listl-formula)', 'round': 5, 'mode': 'on'} +app {'load': '0.627108', 'typecheck': '0.136074', 'kernel_compile': '0.384590', 'kernel_bytes': '588900', 'load_mkfun': '-1', 'semantic': '(listl-formula)', 'round': 5, 'mode': 'off'} +objects {'mode': 'manual', 'seconds': '0.075787', 'growth_kib': '5500.000', 'retained_kib': '648.062', 'code_bytes': '815', 'compile_seconds': '0.002903', 'total': '55968000', 'probe_mkfun': '-1', 'round': 5} +objects {'mode': 'optimized', 'seconds': '0.081064', 'growth_kib': '5585.938', 'retained_kib': '655.820', 'code_bytes': '1029', 'compile_seconds': '0.002685', 'total': '55968000', 'probe_mkfun': '-1', 'round': 5} +objects {'mode': 'ordinary', 'seconds': '0.102052', 'growth_kib': '5554.688', 'retained_kib': '655.730', 'code_bytes': '576', 'compile_seconds': '0.003070', 'total': '55968000', 'probe_mkfun': '-1', 'round': 5} +application off median= 0.74509 range= 0.627108 0.810611 +application on median= 0.540169 range= 0.486806 0.59118 +typecheck off median= 0.099235 range= 0.058485 0.162242 +typecheck on median= 0.12183750000000002 range= 0.036322 0.146308 +objects manual median= 0.0867485 range= 0.075787 0.092902 +objects optimized median= 0.0977835 range= 0.081064 0.103044 +objects ordinary median= 0.12267600000000001 range= 0.102052 0.133343 diff --git a/bench/results/closure-inventory.txt b/bench/results/closure-inventory.txt new file mode 100644 index 0000000..e8d4dca --- /dev/null +++ b/bench/results/closure-inventory.txt @@ -0,0 +1,3 @@ +eliminated shen.typecheck kind=immediate calls=1 +eliminated declare kind=immediate calls=1 +defuns=737 candidates=31 eliminated=2 escaping_or_deferred=29 diff --git a/bench/results/closure-traces-manual.txt b/bench/results/closure-traces-manual.txt new file mode 100644 index 0000000..0797d69 --- /dev/null +++ b/bench/results/closure-traces-manual.txt @@ -0,0 +1,453 @@ +[TRACE 1 boot.lua:230 loop] +[TRACE 2 (1/3) boot.lua:236 stitch io.open] +[TRACE 3 (2/stitch) boot.lua:257 stitch io.method.read] +[TRACE 4 (3/stitch) boot.lua:259 stitch io.method.close] +[TRACE 5 (4/stitch) boot.lua:259 -> 1] +[TRACE 6 boot.lua:383 return] +[TRACE 7 boot.lua:402 loop] +[TRACE 8 boot.lua:413 stitch string.match] +[TRACE 9 (8/stitch) boot.lua:415 -> 8] +[TRACE 10 boot.lua:311 up-recursion] +[TRACE 11 (10/2) boot.lua:322 -> 10] +[TRACE 12 (10/0) boot.lua:312 -> 10] +[TRACE 13 (11/2) boot.lua:323 -> 10] +[TRACE 14 (10/7) boot.lua:323 -> 10] +[TRACE 15 (10/12) boot.lua:330 -> 10] +[TRACE --- runtime.lua:41 -- leaving loop in root trace at boot.lua:321] +[TRACE --- runtime.lua:41 -- leaving loop in root trace at boot.lua:321] +[TRACE --- runtime.lua:41 -- leaving loop in root trace at boot.lua:321] +[TRACE 16 (11/7) boot.lua:330 -> 10] +[TRACE 17 prims.lua:341 loop] +[TRACE 18 "sys":17 loop] +[TRACE 19 prims.lua:1910 return] +[TRACE 20 runtime.lua:42 return] +[TRACE --- (19/1) prims.lua:1910 -- loop unroll limit reached at "sys":71] +[TRACE --- (19/1) prims.lua:1910 -- NYI: bytecode FNEW at "sys":67] +[TRACE 21 "core":52 return] +[TRACE --- (19/0) prims.lua:1910 -- loop unroll limit reached at "sys":70] +[TRACE 22 "sys":70 return] +[TRACE --- (19/0) prims.lua:1910 -- loop unroll limit reached at "sys":71] +[TRACE --- (19/0) prims.lua:1910 -- loop unroll limit reached at "sys":71] +[TRACE --- (19/1) prims.lua:1910 -- loop unroll limit reached at "sys":71] +[TRACE --- (19/1) prims.lua:1910 -- loop unroll limit reached at "sys":71] +[TRACE 23 (19/1) prims.lua:1910 -- fallback to interpreter] +[TRACE 24 "sys":92 return] +[TRACE 25 prims.lua:1929 return] +[TRACE --- (19/0) prims.lua:1910 -- loop unroll limit reached at "sys":70] +[TRACE 26 prims.lua:1928 return] +[TRACE 27 (19/0) prims.lua:1910 -- fallback to interpreter] +[TRACE 28 "sys":71 loop] +[TRACE --- (26/1) runtime.lua:42 -- loop unroll limit reached at prims.lua:148] +[TRACE --- (26/1) runtime.lua:42 -- loop unroll limit reached at "sys":95] +[TRACE 29 "sys":70 loop] +[TRACE 30 (26/1) runtime.lua:42 -> 29] +[TRACE --- (28/12) prims.lua:1910 -- NYI: bytecode FNEW at "sys":67] +[TRACE 31 (28/12) prims.lua:1910 -> 28] +[TRACE 32 (28/6) prims.lua:1910 -> 28] +[TRACE --- (30/1) runtime.lua:42 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (30/1) runtime.lua:42 -- loop unroll limit reached at prims.lua:148] +[TRACE --- (30/1) runtime.lua:42 -- NYI: bytecode UCLO at "sys":67] +[TRACE 33 (29/2) runtime.lua:42 -> 29] +[TRACE 34 (28/5) runtime.lua:42 -> 28] +[TRACE --- (30/1) runtime.lua:42 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "sys":92 -- inner loop in root trace] +[TRACE 35 (30/1) runtime.lua:42 -- fallback to interpreter] +[TRACE 36 "sys":68 loop] +[TRACE 37 (22/2) runtime.lua:42 -> 29] +[TRACE --- (28/0) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE 38 "sys":92 return] +[TRACE 39 "sys":82 loop] +[TRACE --- prims.lua:2004 -- leaving loop in root trace at "sys":92] +[TRACE 40 "sys":95 loop] +[TRACE 41 prims.lua:1948 return] +[TRACE 42 (30/2) prims.lua:1928 -> 28] +[TRACE 43 (38/1) "sys":92 -> 38] +[TRACE 44 (34/2) prims.lua:1910 -> 28] +[TRACE 45 (24/6) prims.lua:2005 -> 38] +[TRACE 46 (29/13) runtime.lua:42 -> 29] +[TRACE 47 (29/0) "sys":70 loop] +[TRACE 48 (28/0) "sys":71 loop] +[TRACE 49 prims.lua:2020 return] +[TRACE 50 (48/12) prims.lua:1910 -> 28] +[TRACE 51 (48/6) prims.lua:1910 -> 28] +[TRACE --- (39/8) "sys":82 -- NYI: bytecode UCLO at "sys":67] +[TRACE 52 (36/6) "sys":68 -> 36] +[TRACE 53 (40/12) "sys":95 -> 39] +[TRACE --- (39/8) "sys":82 -- NYI: bytecode UCLO at "sys":67] +[TRACE 54 (36/1) "sys":68 -> 29] +[TRACE 55 (33/2) prims.lua:1910 -> 28] +[TRACE --- (39/8) "sys":82 -- NYI: bytecode UCLO at "sys":67] +[TRACE --- (39/8) "sys":82 -- NYI: bytecode UCLO at "sys":67] +[TRACE 56 (36/19) runtime.lua:42 -> 36] +[TRACE 57 (39/8) "sys":82 -- fallback to interpreter] +[TRACE --- (31/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE 58 runtime.lua:22 return] +[TRACE --- (31/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (32/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (31/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (42/1) prims.lua:1928 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (32/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (31/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (32/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "writer":13 -- NYI: bytecode FNEW at "writer":24] +[TRACE 59 (31/2) "sys":71 -- fallback to interpreter] +[TRACE --- (49/0) prims.lua:2020 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (49/0) prims.lua:2020 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "sys":95 -- inner loop in root trace] +[TRACE --- (32/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (42/1) prims.lua:1928 -- NYI: bytecode FNEW at "sys":67] +[TRACE 60 (32/2) "sys":71 -- fallback to interpreter] +[TRACE --- (49/0) prims.lua:2020 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (49/0) prims.lua:2020 -- NYI: bytecode FNEW at "sys":67] +[TRACE 61 (36/12) "sys":68 -> 29] +[TRACE --- (42/1) prims.lua:1928 -- NYI: bytecode FNEW at "sys":67] +[TRACE 62 (49/0) prims.lua:2020 -- fallback to interpreter] +[TRACE --- (42/1) prims.lua:1928 -- NYI: bytecode FNEW at "sys":67] +[TRACE 63 (42/1) prims.lua:1928 -- fallback to interpreter] +[TRACE --- "writer":14 -- NYI: bytecode FNEW at "writer":24] +[TRACE 64 "sys":126 return] +[TRACE 65 prims.lua:2019 return] +[TRACE --- prims.lua:280 -- NYI: return to lower frame at prims.lua:285] +[TRACE 66 prims.lua:1914 return] +[TRACE --- "sys":62 -- leaving loop in root trace at "sys":59] +[TRACE 67 (47/11) prims.lua:1910 -> 28] +[TRACE 68 "sys":19 return] +[TRACE 69 "sys":25 return] +[TRACE --- "declarations":43 -- NYI: bytecode FNEW at "sys":67] +[TRACE 70 "writer":26 return] +[TRACE --- (68/0) "sys":19 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (68/0) "sys":19 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "writer":24 -- NYI: bytecode FNEW ] +[TRACE --- (68/0) "sys":19 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (68/0) "sys":19 -- NYI: bytecode FNEW at "sys":67] +[TRACE 71 (68/0) "sys":19 -- fallback to interpreter] +[TRACE 72 (47/3) prims.lua:1910 -> 28] +[TRACE --- (48/3) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (48/3) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "writer":14 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (51/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (48/3) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (48/3) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "sys":91 -- NYI: bytecode FNEW at "writer":24] +[TRACE 73 (48/3) "sys":71 -- fallback to interpreter] +[TRACE --- (51/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (51/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE 74 prims.lua:1994 return] +[TRACE --- "sys":62 -- leaving loop in root trace at "sys":59] +[TRACE 75 prims.lua:108 return] +[TRACE --- "sys":92 -- inner loop in root trace] +[TRACE --- "sys":95 -- inner loop in root trace] +[TRACE --- (51/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE 76 "declarations":43 return] +[TRACE --- "declarations":43 -- NYI: bytecode FNEW at "sys":67] +[TRACE 77 (52/2) prims.lua:1910 -> 36] +[TRACE --- prims.lua:280 -- NYI: return to lower frame at prims.lua:285] +[TRACE 78 (51/2) "sys":71 -- fallback to interpreter] +[TRACE 79 prims.lua:1967 return] +[TRACE --- "sys":62 -- leaving loop in root trace at "sys":59] +[TRACE --- "sys":66 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "sys":68 -- inner loop in root trace] +[TRACE --- (50/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (50/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (50/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (50/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "writer":24 -- NYI: bytecode FNEW ] +[TRACE 80 (50/2) "sys":71 -- fallback to interpreter] +[TRACE --- "writer":14 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (79/0) prims.lua:1968 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "sys":94 -- inner loop in root trace at "sys":95] +[TRACE --- "writer":24 -- NYI: return to lower frame at prims.lua:285] +[TRACE --- (66/1) prims.lua:185 -- NYI: return to lower frame at "sys":59] +[TRACE --- "sys":92 -- inner loop in root trace] +[TRACE --- "sys":59 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (79/0) prims.lua:1968 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "sys":67 -- NYI: bytecode FNEW ] +[TRACE --- (79/0) prims.lua:1968 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "writer":13 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (79/0) prims.lua:1968 -- NYI: bytecode FNEW at "sys":67] +[TRACE 81 (79/0) prims.lua:1968 -- fallback to interpreter] +[TRACE --- "sys":66 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- prims.lua:280 -- NYI: return to lower frame at prims.lua:285] +[TRACE 82 (58/0) runtime.lua:23 -> 17] +[TRACE --- (82/2) runtime.lua:27 -- trace too long at runtime.lua:23] +[TRACE --- (82/2) runtime.lua:27 -- loop unroll limit reached at prims.lua:1883] +[TRACE 83 prims.lua:1882 loop] +[TRACE 84 (83/1) prims.lua:1889 -> 83] +[TRACE --- (82/2) runtime.lua:27 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (64/0) "sys":126 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (64/0) "sys":126 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (64/0) "sys":126 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (64/0) "sys":126 -- NYI: bytecode FNEW at "writer":24] +[TRACE 85 (64/0) "sys":126 -- fallback to interpreter] +[TRACE --- (40/4) runtime.lua:42 -- NYI: bytecode FNEW at "declarations":42] +[TRACE --- (40/4) runtime.lua:42 -- NYI: bytecode FNEW at "declarations":42] +[TRACE --- "sys":68 -- inner loop in root trace] +[TRACE --- (40/4) runtime.lua:42 -- NYI: bytecode FNEW at "declarations":42] +[TRACE --- (40/4) runtime.lua:42 -- NYI: bytecode FNEW at "declarations":42] +[TRACE 86 (40/4) runtime.lua:42 -- fallback to interpreter] +[TRACE --- "writer":24 -- NYI: return to lower frame at prims.lua:285] +[TRACE --- (79/4) prims.lua:1973 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (79/4) prims.lua:1973 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (79/4) prims.lua:1973 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (79/4) prims.lua:1973 -- NYI: bytecode FNEW at "writer":24] +[TRACE 87 (79/4) prims.lua:1973 -- fallback to interpreter] +[TRACE --- "sys":95 -- inner loop in root trace] +[TRACE --- (66/3) prims.lua:189 -- NYI: bytecode UCLO at "sys":64] +[TRACE --- "sys":63 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (66/3) prims.lua:189 -- NYI: bytecode UCLO at "sys":64] +[TRACE --- (66/3) prims.lua:189 -- NYI: bytecode UCLO at "sys":64] +[TRACE --- (25/1) runtime.lua:42 -- NYI: return to lower frame at prims.lua:1929] +[TRACE --- (66/3) prims.lua:189 -- NYI: bytecode UCLO at "sys":64] +[TRACE --- (25/1) runtime.lua:42 -- NYI: return to lower frame at prims.lua:1929] +[TRACE --- "sys":94 -- inner loop in root trace at "sys":95] +[TRACE 88 (66/3) prims.lua:189 -- fallback to interpreter] +[TRACE 89 prims.lua:190 return] +[TRACE --- (25/1) runtime.lua:42 -- NYI: return to lower frame at prims.lua:1929] +[TRACE --- (25/1) runtime.lua:42 -- NYI: return to lower frame at prims.lua:1929] +[TRACE 90 (25/1) runtime.lua:42 -- fallback to interpreter] +[TRACE --- "writer":24 -- NYI: bytecode FNEW ] +[TRACE --- (82/2) runtime.lua:27 -- NYI: bytecode FNEW at "sys":18] +[TRACE 91 (82/2) runtime.lua:27 -- fallback to interpreter] +[TRACE 92 runtime.lua:70 return] +[TRACE --- (92/0) runtime.lua:70 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (92/0) runtime.lua:70 -- NYI: return to lower frame at prims.lua:285] +[TRACE --- (92/0) runtime.lua:70 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (92/0) runtime.lua:70 -- NYI: return to lower frame at prims.lua:285] +[TRACE --- (65/0) prims.lua:2019 -- NYI: return to lower frame] +[TRACE 93 prims.lua:184 return] +[TRACE 94 (92/0) runtime.lua:70 -- fallback to interpreter] +[TRACE --- (65/0) prims.lua:2019 -- NYI: return to lower frame] +[TRACE --- (41/0) prims.lua:1949 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (65/0) prims.lua:2019 -- NYI: return to lower frame] +[TRACE --- (66/0) prims.lua:1914 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (41/0) prims.lua:1949 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (65/0) prims.lua:2019 -- NYI: return to lower frame] +[TRACE --- (66/0) prims.lua:1914 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (41/0) prims.lua:1949 -- NYI: bytecode FNEW at "writer":24] +[TRACE 95 (65/0) prims.lua:2019 -- fallback to interpreter] +[TRACE --- (66/0) prims.lua:1914 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (41/0) prims.lua:1949 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (66/0) prims.lua:1914 -- NYI: bytecode FNEW at "writer":24] +[TRACE 96 (41/0) prims.lua:1949 -- fallback to interpreter] +[TRACE 97 (66/0) prims.lua:1914 -- fallback to interpreter] +[TRACE --- (70/0) "writer":26 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (70/0) "writer":26 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (70/0) "writer":26 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (70/0) "writer":26 -- NYI: bytecode FNEW at "writer":24] +[TRACE 98 (70/0) "writer":26 -- fallback to interpreter] +[TRACE 99 "sys":31 return] +[TRACE --- prims.lua:280 -- NYI: return to lower frame at prims.lua:285] +[TRACE --- "writer":24 -- NYI: bytecode FNEW ] +[TRACE --- "writer":24 -- NYI: return to lower frame at prims.lua:285] +[TRACE 100 (89/2) prims.lua:194 -> 89] +[TRACE --- "declarations":42 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "declarations":42 -- NYI: bytecode FNEW ] +[TRACE --- "writer":14 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- "writer":13 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- "sys":67 -- NYI: bytecode FNEW ] +[TRACE --- "sys":46 -- inner loop in root trace at prims.lua:191] +[TRACE 101 "declarations":42 return] +[TRACE --- prims.lua:698 -- NYI: bytecode FNEW at "declarations":42] +[TRACE --- "sys":92 -- inner loop in root trace] +[TRACE --- "sys":46 -- inner loop in root trace at prims.lua:191] +[TRACE --- "sys":46 -- inner loop in root trace at prims.lua:191] +[TRACE --- "declarations":42 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "declarations":42 -- NYI: bytecode FNEW ] +[TRACE --- "sys":68 -- inner loop in root trace] +[TRACE --- "sys":63 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- prims.lua:685 -- NYI: bytecode FNEW at prims.lua:693] +[TRACE --- prims.lua:698 -- NYI: bytecode FNEW at "declarations":42] +[TRACE --- "sys":94 -- inner loop in root trace at "sys":95] +[TRACE --- "sys":46 -- inner loop in root trace at prims.lua:191] +[TRACE --- "sys":91 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- "sys":63 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "writer":24 -- NYI: bytecode FNEW ] +[TRACE --- "sys":63 -- NYI: bytecode FNEW at "writer":24] +[TRACE 102 prims.lua:33 return] +[TRACE --- "sys":46 -- inner loop in root trace at prims.lua:191] +[TRACE --- runtime.lua:41 -- leaving loop in root trace at "sys":95] +[TRACE --- "sys":46 -- inner loop in root trace at prims.lua:191] +[TRACE --- prims.lua:280 -- NYI: return to lower frame at prims.lua:285] +[TRACE 103 prims.lua:100 return] +[TRACE --- "writer":24 -- NYI: return to lower frame at prims.lua:285] +[TRACE 104 (39/4) runtime.lua:42 -> 39] +[TRACE --- "reader":34 -- leaving loop in root trace] +[TRACE 105 "reader":34 loop] +[TRACE 106 prims.lua:318 return] +[TRACE 107 (105/20) "reader":34 stitch loadstring] +[TRACE 108 (107/stitch) prims.lua:2091 stitch setfenv] +[TRACE --- (108/stitch) prims.lua:2093 -- NYI: bytecode FNEW at "eval":1] +[TRACE --- "reader":34 -- inner loop in root trace] +[TRACE --- "reader":34 -- inner loop in root trace] +[TRACE 109 "reader":34 return] +[TRACE --- "reader":34 -- inner loop in root trace] +[TRACE --- "reader":34 -- inner loop in root trace] +[TRACE 110 boot.lua:672 loop] +[TRACE 111 (110/5) boot.lua:672 -> 110] +[TRACE 112 (110/4) boot.lua:672 -> 110] +[TRACE 113 (110/2) boot.lua:672 -> 110] +[TRACE 114 (110/1) boot.lua:672 -> 110] +[TRACE 115 prolog_engine.lua:305 loop] +[TRACE 116 (115/0) prolog_engine.lua:306 loop] +[TRACE 117 runtime.lua:150 loop] +[TRACE --- runtime.lua:103 -- inner loop in root trace at runtime.lua:105] +[TRACE --- runtime.lua:104 -- leaving loop in root trace at runtime.lua:115] +[TRACE 118 (117/12) runtime.lua:156 stitch string.match] +[TRACE 119 (118/stitch) runtime.lua:92 stitch string.match] +[TRACE 120 (119/stitch) runtime.lua:92 stitch string.match] +[TRACE 121 runtime.lua:104 loop] +[TRACE 122 (120/stitch) runtime.lua:93 stitch string.match] +[TRACE 123 (122/stitch) runtime.lua:93 stitch string.match] +[TRACE 124 (121/1) runtime.lua:106 -> 117] +[TRACE 125 (123/stitch) runtime.lua:94 -> 121] +[TRACE --- runtime.lua:103 -- inner loop in root trace at runtime.lua:105] +[TRACE 126 (121/5) runtime.lua:106 -> 121] +[TRACE --- runtime.lua:122 -- inner loop in root trace at runtime.lua:105] +[TRACE 127 (124/6) runtime.lua:115 -> 121] +[TRACE 128 (125/5) runtime.lua:160 -> 121] +[TRACE 129 (124/10) runtime.lua:167 -> 121] +[TRACE 130 (117/18) runtime.lua:156 stitch string.match] +[TRACE 131 (127/5) runtime.lua:129 -> 121] +[TRACE 132 (130/stitch) runtime.lua:92 stitch string.match] +[TRACE --- runtime.lua:122 -- inner loop in root trace at runtime.lua:105] +[TRACE 133 (132/stitch) runtime.lua:92 stitch string.match] +[TRACE 134 (133/stitch) runtime.lua:93 stitch string.match] +[TRACE 135 (134/stitch) runtime.lua:93 stitch string.match] +[TRACE 136 (135/stitch) runtime.lua:94 -> 121] +[TRACE 137 (125/8) runtime.lua:129 -> 121] +[TRACE 138 (128/2) runtime.lua:129 -> 121] +[TRACE 139 runtime.lua:134 loop] +[TRACE 140 (127/15) runtime.lua:135 -> 121] +[TRACE 141 (127/17) runtime.lua:134 -> 139] +[TRACE 142 (136/7) runtime.lua:129 -> 121] +[TRACE --- runtime.lua:122 -- inner loop in root trace at runtime.lua:105] +[TRACE 143 (141/2) runtime.lua:135 -> 121] +[TRACE 144 (140/2) runtime.lua:129 -> 121] +[TRACE 145 (127/11) runtime.lua:134 -> 139] +[TRACE --- runtime.lua:103 -- inner loop in root trace at runtime.lua:105] +[TRACE 146 (139/4) runtime.lua:135 -> 121] +[TRACE 147 (136/4) runtime.lua:159 -> 121] +[TRACE 148 (127/19) runtime.lua:129 -> 121] +[TRACE 149 (127/8) runtime.lua:131 -> 121] +[TRACE 150 (124/2) runtime.lua:107 -> 121] +[TRACE 151 (127/1) runtime.lua:115 -> 121] +[TRACE 152 (127/18) runtime.lua:135 -> 121] +[TRACE --- runtime.lua:185 -- inner loop in root trace at runtime.lua:105] +[TRACE --- typecheck_native.lua:109 -- leaving loop in root trace at typecheck_native.lua:113] +[TRACE 69 typecheck_native.lua:109 return] +[TRACE --- (69/1) typecheck_native.lua:110 -- call unroll limit reached at typecheck_native.lua:109] +[TRACE --- typecheck_native.lua:109 -- leaving loop in root trace at typecheck_native.lua:113] +[TRACE 64 typecheck_native.lua:109 return] +[TRACE --- (64/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE --- (64/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:204] +[TRACE --- (64/1) typecheck_native.lua:110 -- call unroll limit reached at typecheck_native.lua:109] +[TRACE --- typecheck_native.lua:109 -- leaving loop in root trace at typecheck_native.lua:113] +[TRACE --- typecheck_native.lua:197 -- call unroll limit reached at typecheck_native.lua:109] +[TRACE 85 typecheck_native.lua:109 return] +[TRACE --- (85/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:204] +[TRACE --- (85/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:204] +[TRACE --- (85/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:204] +[TRACE --- (85/1) typecheck_native.lua:110 -- call unroll limit reached at typecheck_native.lua:109] +[TRACE 99 typecheck_native.lua:109 return] +[TRACE --- (99/1) typecheck_native.lua:110 -- call unroll limit reached at typecheck_native.lua:109] +[TRACE 153 typecheck_native.lua:109 return] +[TRACE --- (153/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE --- (153/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:204] +[TRACE --- (153/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:204] +[TRACE --- (153/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:204] +[TRACE 154 (153/1) typecheck_native.lua:110 -- fallback to interpreter] +[TRACE 155 typecheck_native.lua:197 loop] +[TRACE --- (155/13) typecheck_native.lua:110 -- call unroll limit reached at typecheck_native.lua:109] +[TRACE 156 typecheck_native.lua:109 return] +[TRACE 157 (155/13) typecheck_native.lua:110 -> 155] +[TRACE --- (156/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE --- runtime.lua:41 -- NYI: return to lower frame at typecheck_native.lua:204] +[TRACE --- (156/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE --- (156/1) typecheck_native.lua:110 -- call unroll limit reached at typecheck_native.lua:109] +[TRACE 158 typecheck_native.lua:109 return] +[TRACE --- (158/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE --- (158/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE --- (158/1) typecheck_native.lua:110 -- call unroll limit reached at typecheck_native.lua:109] +[TRACE 159 typecheck_native.lua:109 return] +[TRACE --- (159/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE --- (159/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE --- (159/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE --- (159/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE 160 (159/1) typecheck_native.lua:110 -- fallback to interpreter] +[TRACE --- (157/3) typecheck_native.lua:110 -- call unroll limit reached at typecheck_native.lua:109] +[TRACE --- (157/3) typecheck_native.lua:110 -- call unroll limit reached at typecheck_native.lua:109] +[TRACE 161 typecheck_native.lua:109 return] +[TRACE --- (157/3) typecheck_native.lua:110 -- call unroll limit reached at typecheck_native.lua:109] +[TRACE --- typecheck_native.lua:109 -- leaving loop in root trace at typecheck_native.lua:113] +[TRACE --- (157/3) typecheck_native.lua:110 -- call unroll limit reached at typecheck_native.lua:109] +[TRACE 162 (157/3) typecheck_native.lua:110 -- fallback to interpreter] +[TRACE 163 (117/0) runtime.lua:151 loop] +[TRACE 164 (121/0) runtime.lua:105 -> 121] +[TRACE 165 (164/7) runtime.lua:115 -> 121] +[TRACE 166 (164/1) runtime.lua:107 -> 121] +[TRACE 167 (164/10) runtime.lua:168 -> 117] +[TRACE 168 (163/12) runtime.lua:156 stitch string.match] +[TRACE 169 (139/0) runtime.lua:134 -> 121] +[TRACE 170 (168/stitch) runtime.lua:92 stitch string.match] +[TRACE 171 (170/stitch) runtime.lua:92 stitch string.match] +[TRACE 172 (171/stitch) runtime.lua:93 stitch string.match] +[TRACE 173 (172/stitch) runtime.lua:93 stitch string.match] +[TRACE 174 (173/stitch) runtime.lua:94 -> 121] +[TRACE 175 (165/5) runtime.lua:126 -> 139] +[TRACE 176 (169/2) runtime.lua:134 -> 139] +[TRACE 177 compiler.lua:18 return] +[TRACE --- (20/1) runtime.lua:42 -- loop unroll limit reached at compiler.lua:187] +[TRACE --- (20/1) runtime.lua:42 -- call unroll limit reached at compiler.lua:163] +[TRACE --- (20/1) runtime.lua:42 -- call unroll limit reached at compiler.lua:163] +[TRACE --- (20/1) runtime.lua:42 -- NYI: bytecode UCLO at compiler.lua:873] +[TRACE 178 (20/1) runtime.lua:42 -- fallback to interpreter] +[TRACE 179 compiler.lua:19 return] +[TRACE --- (20/0) runtime.lua:42 -- NYI: bytecode UCLO at compiler.lua:1042] +[TRACE --- compiler.lua:451 -- inner loop in root trace at compiler.lua:472] +[TRACE --- (20/0) runtime.lua:42 -- NYI: bytecode UCLO at compiler.lua:873] +[TRACE --- (20/0) runtime.lua:42 -- NYI: bytecode UCLO at compiler.lua:873] +[TRACE --- (20/0) runtime.lua:42 -- NYI: bytecode UCLO at compiler.lua:1042] +[TRACE 180 (163/0) runtime.lua:151 loop] +[TRACE 181 (164/0) runtime.lua:105 -> 121] +[TRACE 182 (181/7) runtime.lua:115 -> 121] +[TRACE 183 (181/11) runtime.lua:168 -> 117] +[TRACE 184 (181/1) runtime.lua:107 -> 121] +[TRACE 185 (180/13) runtime.lua:156 stitch string.match] +[TRACE 186 (185/stitch) runtime.lua:92 stitch string.match] +[TRACE 187 (169/0) runtime.lua:134 loop] +[TRACE 188 (186/stitch) runtime.lua:92 stitch string.match] +[TRACE 189 (188/stitch) runtime.lua:93 stitch string.match] +[TRACE 190 (189/stitch) runtime.lua:93 stitch string.match] +[TRACE 191 (190/stitch) runtime.lua:94 -> 121] +[TRACE 192 (182/5) runtime.lua:126 -> 121] +[TRACE 193 (187/4) runtime.lua:135 -> 121] +[TRACE 194 (20/0) runtime.lua:42 -- fallback to interpreter] +[TRACE 195 compiler.lua:186 loop] +[TRACE 196 compiler.lua:316 loop] +[TRACE --- (177/0) compiler.lua:18 -- NYI: bytecode UCLO at compiler.lua:873] +[TRACE 197 compiler.lua:22 loop] +[TRACE 198 closure_objects.lua:18 loop] +[TRACE 199 (17/0) prims.lua:341 loop] +[TRACE 200 closure_objects.lua:19 -> 17] +[TRACE --- (199/2) prims.lua:341 -- NYI: return to lower frame at "object-factory":1] +[TRACE --- (199/2) prims.lua:341 -- NYI: return to lower frame at "object-factory":1] +[TRACE --- (199/2) prims.lua:341 -- NYI: return to lower frame at "object-factory":1] +[TRACE --- (199/2) prims.lua:341 -- NYI: return to lower frame at "object-factory":1] +[TRACE 201 (199/2) prims.lua:341 -- fallback to interpreter] +[TRACE --- (75/0) prims.lua:108 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE --- (75/0) prims.lua:108 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE --- (75/0) prims.lua:108 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE --- (75/0) prims.lua:108 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE 64 (75/0) prims.lua:108 -- fallback to interpreter] +[TRACE 69 prims.lua:339 -> 17] +[TRACE 85 closure_objects.lua:22 -> 69] +WORKLOAD_BEGIN +[TRACE 99 "object-manual":1 loop] +[TRACE 115 prims.lua:802 loop] +[TRACE 116 "object-factory":1 return] +[TRACE --- closure_objects.lua:27 -- inner loop in root trace at "object-manual":1] +[TRACE 153 (99/8) "object-manual":1 -> 115] +[TRACE 154 (115/6) prims.lua:803 -> 99] +[TRACE 156 "object-factory":1 return] +[TRACE 158 closure_objects.lua:49 loop] +WORKLOAD_END diff --git a/bench/results/closure-traces-optimized.txt b/bench/results/closure-traces-optimized.txt new file mode 100644 index 0000000..aba95f6 --- /dev/null +++ b/bench/results/closure-traces-optimized.txt @@ -0,0 +1,434 @@ +[TRACE 1 boot.lua:230 loop] +[TRACE 2 (1/3) boot.lua:236 stitch io.open] +[TRACE 3 (2/stitch) boot.lua:257 stitch io.method.read] +[TRACE 4 (3/stitch) boot.lua:259 stitch io.method.close] +[TRACE 5 (4/stitch) boot.lua:259 -> 1] +[TRACE 6 boot.lua:383 return] +[TRACE 7 boot.lua:402 loop] +[TRACE 8 boot.lua:413 stitch string.match] +[TRACE 9 (8/stitch) boot.lua:415 -> 8] +[TRACE 10 boot.lua:311 return] +[TRACE --- (10/2) boot.lua:318 -- call unroll limit reached at boot.lua:311] +[TRACE 11 boot.lua:311 up-recursion] +[TRACE 12 (11/2) boot.lua:322 -> 11] +[TRACE 13 (11/7) boot.lua:323 -> 11] +[TRACE 14 (12/2) boot.lua:324 -> 11] +[TRACE 15 (11/0) boot.lua:312 -> 11] +[TRACE 16 (11/12) boot.lua:330 -> 11] +[TRACE --- runtime.lua:41 -- leaving loop in root trace at boot.lua:321] +[TRACE --- runtime.lua:41 -- leaving loop in root trace at boot.lua:321] +[TRACE --- runtime.lua:41 -- leaving loop in root trace at boot.lua:321] +[TRACE 17 (14/5) boot.lua:330 -> 11] +[TRACE 18 prims.lua:341 loop] +[TRACE 19 (18/2) prims.lua:341 -> 18] +[TRACE 20 "sys":17 loop] +[TRACE 21 runtime.lua:22 return] +[TRACE 22 runtime.lua:42 return] +[TRACE --- prims.lua:1998 -- leaving loop in root trace at "sys":92] +[TRACE 23 prims.lua:1928 return] +[TRACE --- (23/1) runtime.lua:42 -- loop unroll limit reached at "sys":71] +[TRACE 24 prims.lua:1910 return] +[TRACE 25 prims.lua:1929 return] +[TRACE 26 "sys":71 return] +[TRACE --- (23/1) runtime.lua:42 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (23/1) runtime.lua:42 -- loop unroll limit reached at prims.lua:148] +[TRACE --- (23/1) runtime.lua:42 -- loop unroll limit reached at prims.lua:148] +[TRACE --- (24/1) prims.lua:1910 -- loop unroll limit reached at "sys":70] +[TRACE --- (24/1) prims.lua:1910 -- loop unroll limit reached at "sys":70] +[TRACE 27 (23/1) runtime.lua:42 -- fallback to interpreter] +[TRACE 28 (24/0) prims.lua:1910 -> 26] +[TRACE 29 (26/9) "sys":71 -> 26] +[TRACE 30 (26/6) prims.lua:1910 -> 26] +[TRACE --- (21/0) runtime.lua:23 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (24/1) prims.lua:1910 -- loop unroll limit reached at "sys":70] +[TRACE --- (24/1) prims.lua:1910 -- loop unroll limit reached at "sys":70] +[TRACE 31 (24/1) prims.lua:1910 -- fallback to interpreter] +[TRACE --- "sys":70 -- leaving loop in root trace at prims.lua:1929] +[TRACE --- (21/0) runtime.lua:23 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (21/0) runtime.lua:23 -- NYI: bytecode FNEW at "writer":24] +[TRACE 32 (26/5) runtime.lua:42 -> 26] +[TRACE --- (21/0) runtime.lua:23 -- NYI: bytecode FNEW at "sys":67] +[TRACE 33 (21/0) runtime.lua:23 -- fallback to interpreter] +[TRACE 34 prims.lua:1908 return] +[TRACE 35 "sys":70 loop] +[TRACE 36 (28/1) prims.lua:1910 -> 35] +[TRACE 37 "sys":92 loop] +[TRACE 38 "sys":82 loop] +[TRACE 39 (28/0) prims.lua:1910 -> 26] +[TRACE --- (26/0) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "sys":67 -- leaving loop in root trace at "sys":95] +[TRACE --- "sys":95 -- leaving loop in root trace at "sys":81] +[TRACE 40 prims.lua:1907 return] +[TRACE 41 "sys":68 loop] +[TRACE 42 (35/2) runtime.lua:42 -> 35] +[TRACE 43 (34/0) prims.lua:1908 -> 35] +[TRACE 44 prims.lua:1994 return] +[TRACE 45 (28/2) prims.lua:1910 -> 41] +[TRACE 46 (32/2) prims.lua:1910 -> 26] +[TRACE 47 prims.lua:1914 return] +[TRACE --- "sys":95 -- leaving loop in root trace at "sys":81] +[TRACE --- "writer":13 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- "sys":71 -- inner loop in root trace] +[TRACE 48 (35/0) "sys":70 loop] +[TRACE 49 (26/0) "sys":71 loop] +[TRACE --- (37/14) "sys":92 -- loop unroll limit reached at "sys":67] +[TRACE 50 (49/12) prims.lua:1910 -> 26] +[TRACE 51 (49/6) prims.lua:1910 -> 26] +[TRACE 52 (37/14) "sys":92 -> 38] +[TRACE --- (38/8) "sys":82 -- NYI: bytecode UCLO at "sys":67] +[TRACE --- "sys":59 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (38/8) "sys":82 -- NYI: bytecode UCLO at "sys":67] +[TRACE 53 (41/6) "sys":68 -> 41] +[TRACE --- (38/8) "sys":82 -- NYI: bytecode UCLO at "sys":67] +[TRACE --- (38/8) "sys":82 -- NYI: bytecode UCLO at "sys":67] +[TRACE 54 (38/8) "sys":82 -- fallback to interpreter] +[TRACE 55 (35/13) runtime.lua:42 -> 35] +[TRACE 56 (41/19) runtime.lua:42 -> 41] +[TRACE 57 (41/1) "sys":68 -> 35] +[TRACE 58 (42/2) prims.lua:1910 -> 26] +[TRACE --- prims.lua:2008 -- leaving loop in root trace at "sys":95] +[TRACE --- "sys":92 -- inner loop in root trace] +[TRACE --- (52/21) "sys":95 -- loop unroll limit reached at prims.lua:148] +[TRACE --- (52/21) "sys":95 -- loop unroll limit reached] +[TRACE --- (52/21) "sys":95 -- loop unroll limit reached at prims.lua:148] +[TRACE --- (52/21) "sys":95 -- loop unroll limit reached at prims.lua:148] +[TRACE 59 "writer":26 return] +[TRACE 60 (52/21) "sys":95 -- fallback to interpreter] +[TRACE 61 "sys":95 loop] +[TRACE 62 prims.lua:1967 return] +[TRACE --- "sys":92 -- inner loop in root trace] +[TRACE 63 (61/12) "sys":95 -> 38] +[TRACE --- prims.lua:1998 -- leaving loop in root trace at "sys":92] +[TRACE 64 (41/12) "sys":68 -> 35] +[TRACE --- "declarations":43 -- NYI: bytecode FNEW at "sys":67] +[TRACE 65 "sys":19 return] +[TRACE --- "writer":24 -- NYI: bytecode FNEW ] +[TRACE --- prims.lua:2004 -- leaving loop in root trace at "sys":92] +[TRACE --- "sys":66 -- NYI: bytecode FNEW at "sys":67] +[TRACE 66 (48/11) prims.lua:1910 -> 26] +[TRACE --- (62/0) prims.lua:1968 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (62/0) prims.lua:1968 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (62/0) prims.lua:1968 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (62/0) prims.lua:1968 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- prims.lua:2008 -- leaving loop in root trace at "sys":95] +[TRACE 67 (62/0) prims.lua:1968 -- fallback to interpreter] +[TRACE 68 prims.lua:108 return] +[TRACE --- "sys":91 -- NYI: bytecode FNEW at "writer":24] +[TRACE 69 runtime.lua:70 return] +[TRACE 70 (48/3) prims.lua:1910 -> 26] +[TRACE --- (49/3) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (49/3) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- prims.lua:280 -- NYI: return to lower frame at prims.lua:285] +[TRACE --- "sys":67 -- leaving loop in root trace at "sys":95] +[TRACE --- (51/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "writer":14 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (49/3) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (49/3) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "sys":92 -- inner loop in root trace] +[TRACE 71 (49/3) "sys":71 -- fallback to interpreter] +[TRACE --- "declarations":43 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (51/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (51/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE 72 "sys":126 return] +[TRACE --- (65/0) "sys":19 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "sys":92 -- inner loop in root trace] +[TRACE --- (65/0) "sys":19 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (65/0) "sys":19 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "sys":68 -- inner loop in root trace] +[TRACE --- (51/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (65/0) "sys":19 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- prims.lua:280 -- NYI: return to lower frame at prims.lua:285] +[TRACE 73 prims.lua:1948 return] +[TRACE 74 (53/2) prims.lua:1910 -> 41] +[TRACE 75 (65/0) "sys":19 -- fallback to interpreter] +[TRACE 76 "core":52 return] +[TRACE --- (47/1) prims.lua:185 -- NYI: return to lower frame at "sys":59] +[TRACE 77 "declarations":43 return] +[TRACE --- prims.lua:2004 -- leaving loop in root trace at "sys":92] +[TRACE --- "sys":92 -- inner loop in root trace] +[TRACE 78 (61/1) "sys":95 -> 38] +[TRACE 79 (51/2) "sys":71 -- fallback to interpreter] +[TRACE --- "sys":92 -- inner loop in root trace] +[TRACE --- "sys":62 -- leaving loop in root trace at "sys":59] +[TRACE --- "sys":67 -- NYI: bytecode FNEW ] +[TRACE --- (50/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "sys":91 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (50/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (50/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (50/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE 80 (50/2) "sys":71 -- fallback to interpreter] +[TRACE 81 "sys":25 return] +[TRACE --- "writer":14 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- prims.lua:1998 -- leaving loop in root trace at "sys":92] +[TRACE --- (47/1) prims.lua:185 -- NYI: return to lower frame at "sys":59] +[TRACE --- "sys":92 -- inner loop in root trace] +[TRACE --- (47/1) prims.lua:185 -- NYI: return to lower frame at "sys":59] +[TRACE --- "declarations":43 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "sys":68 -- inner loop in root trace] +[TRACE --- "writer":13 -- NYI: bytecode FNEW at "writer":24] +[TRACE 82 prims.lua:1882 loop] +[TRACE 83 (82/1) prims.lua:1889 -> 82] +[TRACE 84 (37/1) "sys":92 -> 61] +[TRACE --- (72/0) "sys":126 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (72/0) "sys":126 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (72/0) "sys":126 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- "sys":92 -- inner loop in root trace] +[TRACE --- (72/0) "sys":126 -- NYI: bytecode FNEW at "writer":24] +[TRACE 85 (72/0) "sys":126 -- fallback to interpreter] +[TRACE --- "sys":67 -- NYI: bytecode FNEW ] +[TRACE --- (61/4) runtime.lua:42 -- NYI: bytecode FNEW at "declarations":42] +[TRACE --- (61/4) runtime.lua:42 -- NYI: bytecode FNEW at "declarations":42] +[TRACE --- (61/4) runtime.lua:42 -- NYI: bytecode FNEW at "declarations":42] +[TRACE --- (61/4) runtime.lua:42 -- NYI: bytecode FNEW at "declarations":42] +[TRACE 86 (61/4) runtime.lua:42 -- fallback to interpreter] +[TRACE --- (62/4) prims.lua:1973 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- "writer":24 -- NYI: return to lower frame at prims.lua:285] +[TRACE --- (62/4) prims.lua:1973 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (62/4) prims.lua:1973 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (62/4) prims.lua:1973 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- "sys":66 -- NYI: bytecode FNEW at "sys":67] +[TRACE 87 (62/4) prims.lua:1973 -- fallback to interpreter] +[TRACE --- "sys":67 -- leaving loop in root trace at "sys":95] +[TRACE --- "writer":13 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (47/3) prims.lua:189 -- NYI: bytecode UCLO at "sys":64] +[TRACE --- (47/3) prims.lua:189 -- NYI: bytecode UCLO at "sys":64] +[TRACE --- (47/3) prims.lua:189 -- NYI: bytecode UCLO at "sys":64] +[TRACE --- runtime.lua:41 -- leaving loop in root trace at "sys":95] +[TRACE --- (47/3) prims.lua:189 -- NYI: bytecode UCLO at "sys":64] +[TRACE --- (25/1) runtime.lua:42 -- NYI: return to lower frame at prims.lua:1929] +[TRACE --- prims.lua:2004 -- leaving loop in root trace at "sys":92] +[TRACE --- "writer":24 -- NYI: return to lower frame at prims.lua:285] +[TRACE 88 (47/3) prims.lua:189 -- fallback to interpreter] +[TRACE --- (25/1) runtime.lua:42 -- NYI: return to lower frame at prims.lua:1929] +[TRACE --- (25/1) runtime.lua:42 -- NYI: return to lower frame at prims.lua:1929] +[TRACE --- (25/1) runtime.lua:42 -- NYI: return to lower frame at prims.lua:1929] +[TRACE 89 (25/1) runtime.lua:42 -- fallback to interpreter] +[TRACE --- prims.lua:685 -- NYI: bytecode FNEW at prims.lua:693] +[TRACE --- prims.lua:2019 -- NYI: return to lower frame] +[TRACE --- (73/0) prims.lua:1949 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (47/0) prims.lua:1914 -- NYI: bytecode FNEW at "writer":24] +[TRACE 90 (69/0) runtime.lua:70 return] +[TRACE --- (73/0) prims.lua:1949 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (40/0) prims.lua:1907 -- NYI: bytecode FNEW at "writer":23] +[TRACE --- (47/0) prims.lua:1914 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (73/0) prims.lua:1949 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (40/0) prims.lua:1907 -- NYI: bytecode FNEW at "writer":23] +[TRACE --- (47/0) prims.lua:1914 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (73/0) prims.lua:1949 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (40/0) prims.lua:1907 -- NYI: bytecode FNEW at "writer":23] +[TRACE --- (47/0) prims.lua:1914 -- NYI: bytecode FNEW at "writer":24] +[TRACE 91 (73/0) prims.lua:1949 -- fallback to interpreter] +[TRACE --- (40/0) prims.lua:1907 -- NYI: bytecode FNEW at "writer":23] +[TRACE 92 (47/0) prims.lua:1914 -- fallback to interpreter] +[TRACE --- (59/0) "writer":26 -- NYI: bytecode FNEW at "writer":24] +[TRACE 93 (40/0) prims.lua:1907 -- fallback to interpreter] +[TRACE --- (59/0) "writer":26 -- NYI: bytecode FNEW at "writer":24] +[TRACE 94 prims.lua:1906 return] +[TRACE --- (59/0) "writer":26 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (59/0) "writer":26 -- NYI: bytecode FNEW at "writer":24] +[TRACE 95 (59/0) "writer":26 -- fallback to interpreter] +[TRACE 96 prims.lua:100 return] +[TRACE --- "writer":14 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- "declarations":49 -- NYI: bytecode FNEW at "declarations":42] +[TRACE 97 prims.lua:190 return] +[TRACE --- prims.lua:2008 -- leaving loop in root trace at "sys":95] +[TRACE --- prims.lua:280 -- NYI: return to lower frame at prims.lua:285] +[TRACE 98 (97/2) prims.lua:194 -> 97] +[TRACE --- "declarations":42 -- NYI: bytecode FNEW ] +[TRACE --- "sys":68 -- inner loop in root trace] +[TRACE --- "sys":92 -- inner loop in root trace] +[TRACE --- "sys":91 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- "sys":66 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "writer":24 -- NYI: bytecode FNEW ] +[TRACE --- "sys":46 -- inner loop in root trace at prims.lua:191] +[TRACE --- "sys":63 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- prims.lua:698 -- NYI: bytecode FNEW at "declarations":42] +[TRACE --- "sys":67 -- NYI: bytecode FNEW ] +[TRACE --- "writer":24 -- NYI: return to lower frame at prims.lua:285] +[TRACE --- "sys":46 -- inner loop in root trace at prims.lua:191] +[TRACE --- "declarations":42 -- NYI: bytecode FNEW ] +[TRACE --- prims.lua:2004 -- leaving loop in root trace at "sys":92] +[TRACE --- "writer":24 -- NYI: bytecode FNEW ] +[TRACE --- prims.lua:280 -- NYI: return to lower frame at prims.lua:285] +[TRACE --- "sys":46 -- inner loop in root trace at prims.lua:191] +[TRACE --- "sys":63 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- prims.lua:698 -- NYI: bytecode FNEW at "declarations":42] +[TRACE --- "sys":92 -- inner loop in root trace] +[TRACE --- "writer":14 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- "sys":46 -- inner loop in root trace at prims.lua:191] +[TRACE --- "declarations":49 -- NYI: bytecode FNEW at "declarations":42] +[TRACE --- "sys":66 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- prims.lua:1998 -- leaving loop in root trace at "sys":92] +[TRACE --- "sys":46 -- inner loop in root trace at prims.lua:191] +[TRACE 99 (38/4) runtime.lua:42 -> 38] +[TRACE 100 "reader":34 loop] +[TRACE 101 (100/20) "reader":34 stitch loadstring] +[TRACE 102 (101/stitch) prims.lua:2091 stitch setfenv] +[TRACE --- (102/stitch) prims.lua:2093 -- NYI: bytecode FNEW at "eval":1] +[TRACE --- "reader":34 -- inner loop in root trace] +[TRACE --- "reader":34 -- inner loop in root trace] +[TRACE --- "reader":34 -- inner loop in root trace] +[TRACE --- "reader":34 -- inner loop in root trace] +[TRACE 103 "reader":34 return] +[TRACE --- boot.lua:640 -- NYI: bytecode FNEW at "extension-features":3] +[TRACE 104 boot.lua:672 loop] +[TRACE 105 (104/5) boot.lua:672 -> 104] +[TRACE 106 (104/4) boot.lua:672 -> 104] +[TRACE 107 (104/2) boot.lua:672 -> 104] +[TRACE 108 prims.lua:1687 return] +[TRACE 109 prolog_engine.lua:305 loop] +[TRACE 110 runtime.lua:150 loop] +[TRACE 111 runtime.lua:104 loop] +[TRACE 112 (110/12) runtime.lua:156 stitch string.match] +[TRACE 113 (112/stitch) runtime.lua:92 stitch string.match] +[TRACE 114 (111/1) runtime.lua:106 -> 110] +[TRACE 115 (113/stitch) runtime.lua:92 stitch string.match] +[TRACE 116 (115/stitch) runtime.lua:93 stitch string.match] +[TRACE 117 (116/stitch) runtime.lua:93 stitch string.match] +[TRACE 118 (117/stitch) runtime.lua:94 -> 111] +[TRACE 119 (111/5) runtime.lua:106 -> 111] +[TRACE 120 (114/6) runtime.lua:115 -> 111] +[TRACE --- runtime.lua:122 -- inner loop in root trace at runtime.lua:105] +[TRACE 121 (120/5) runtime.lua:126 -> 111] +[TRACE 122 (114/10) runtime.lua:167 -> 111] +[TRACE 123 (110/18) runtime.lua:156 stitch string.match] +[TRACE 124 (123/stitch) runtime.lua:92 stitch string.match] +[TRACE 125 (124/stitch) runtime.lua:92 stitch string.match] +[TRACE 126 (125/stitch) runtime.lua:93 stitch string.match] +[TRACE --- runtime.lua:134 -- leaving loop in root trace at runtime.lua:135] +[TRACE --- runtime.lua:122 -- inner loop in root trace at runtime.lua:105] +[TRACE 127 (118/5) runtime.lua:160 -> 111] +[TRACE 128 (126/stitch) runtime.lua:93 stitch string.match] +[TRACE 129 (128/stitch) runtime.lua:94 -> 111] +[TRACE 130 (118/7) runtime.lua:129 -> 111] +[TRACE 131 (121/9) runtime.lua:134 -> 111] +[TRACE 132 (121/11) runtime.lua:129 -> 111] +[TRACE 133 (127/3) runtime.lua:129 -> 111] +[TRACE 134 runtime.lua:134 loop] +[TRACE 135 (131/2) runtime.lua:134 -> 111] +[TRACE 136 (131/4) runtime.lua:129 -> 111] +[TRACE --- runtime.lua:122 -- inner loop in root trace at runtime.lua:105] +[TRACE 137 (121/5) runtime.lua:134 -> 134] +[TRACE 138 (129/7) runtime.lua:129 -> 111] +[TRACE 139 (134/4) runtime.lua:135 -> 111] +[TRACE 140 (135/4) runtime.lua:129 -> 111] +[TRACE 141 (129/4) runtime.lua:159 -> 111] +[TRACE 142 (121/2) runtime.lua:131 -> 111] +[TRACE 143 (114/2) runtime.lua:107 -> 111] +[TRACE 144 (120/1) runtime.lua:115 -> 111] +[TRACE 145 (131/3) runtime.lua:135 -> 111] +[TRACE 10 typecheck_native.lua:109 up-recursion] +[TRACE 146 (10/3) typecheck_native.lua:110 -> 10] +[TRACE --- (10/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE --- (10/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE --- (10/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE --- (10/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE 147 (10/1) typecheck_native.lua:110 -- fallback to interpreter] +[TRACE 148 (10/5) typecheck_native.lua:110 -> 10] +[TRACE --- runtime.lua:41 -- leaving loop in root trace at typecheck_native.lua:113] +[TRACE --- runtime.lua:163 -- inner loop in root trace at runtime.lua:105] +[TRACE 149 (110/0) runtime.lua:151 loop] +[TRACE 150 (111/0) runtime.lua:105 -> 111] +[TRACE 151 (150/7) runtime.lua:115 -> 111] +[TRACE 152 (150/10) runtime.lua:168 -> 110] +[TRACE 153 (150/1) runtime.lua:107 -> 111] +[TRACE 154 (149/12) runtime.lua:156 stitch string.match] +[TRACE 155 (154/stitch) runtime.lua:92 stitch string.match] +[TRACE 156 (134/0) runtime.lua:134 loop] +[TRACE 157 (155/stitch) runtime.lua:92 stitch string.match] +[TRACE 158 (157/stitch) runtime.lua:93 stitch string.match] +[TRACE 159 (158/stitch) runtime.lua:93 stitch string.match] +[TRACE 160 (159/stitch) runtime.lua:94 -> 111] +[TRACE 161 (151/5) runtime.lua:126 -> 134] +[TRACE 162 (156/4) runtime.lua:135 -> 111] +[TRACE 163 (149/18) runtime.lua:156 stitch string.match] +[TRACE --- (69/1) runtime.lua:70 -- loop unroll limit reached at compiler.lua:213] +[TRACE --- (69/1) runtime.lua:70 -- call unroll limit reached at compiler.lua:209] +[TRACE --- (69/1) runtime.lua:70 -- loop unroll limit reached at compiler.lua:187] +[TRACE --- (22/1) runtime.lua:42 -- call unroll limit reached at compiler.lua:114] +[TRACE --- (22/1) runtime.lua:42 -- loop unroll limit reached at compiler.lua:142] +[TRACE --- (22/1) runtime.lua:42 -- loop unroll limit reached at compiler.lua:142] +[TRACE 164 (22/1) runtime.lua:42 stitch os.getenv] +[TRACE --- (69/1) runtime.lua:70 -- NYI: bytecode UCLO at compiler.lua:873] +[TRACE 165 (69/1) runtime.lua:70 -- fallback to interpreter] +[TRACE --- (22/0) runtime.lua:42 -- NYI: bytecode UCLO at compiler.lua:873] +[TRACE --- (22/0) runtime.lua:42 -- NYI: bytecode UCLO at compiler.lua:1043] +[TRACE --- (22/0) runtime.lua:42 -- NYI: bytecode UCLO at compiler.lua:873] +[TRACE --- (22/0) runtime.lua:42 -- NYI: bytecode UCLO at compiler.lua:1043] +[TRACE 166 compiler.lua:18 return] +[TRACE --- (164/2) runtime.lua:42 -- NYI: bytecode UCLO at compiler.lua:873] +[TRACE --- (164/2) runtime.lua:42 -- NYI: bytecode FNEW at compiler.lua:884] +[TRACE 167 compiler.lua:880 return] +[TRACE 168 (22/0) runtime.lua:42 -- fallback to interpreter] +[TRACE --- (167/3) runtime.lua:42 -- call unroll limit reached at compiler.lua:880] +[TRACE --- (164/2) runtime.lua:42 -- call unroll limit reached at compiler.lua:880] +[TRACE --- (164/2) runtime.lua:42 -- call unroll limit reached at compiler.lua:114] +[TRACE --- compiler.lua:141 -- inner loop in root trace at compiler.lua:142] +[TRACE 169 (164/2) runtime.lua:42 -- fallback to interpreter] +[TRACE --- (164/4) runtime.lua:70 -- loop unroll limit reached at compiler.lua:142] +[TRACE 170 (90/0) runtime.lua:70 stitch table.sort] +[TRACE 171 compiler.lua:19 return] +[TRACE --- compiler.lua:478 -- leaving loop in root trace at compiler.lua:481] +[TRACE --- compiler.lua:919 -- NYI: bytecode UCLO at compiler.lua:873] +[TRACE 172 (18/0) prims.lua:341 loop] +[TRACE 173 closure_objects.lua:19 -> 18] +[TRACE --- (172/2) prims.lua:341 -- NYI: return to lower frame at "object-factory":1] +[TRACE --- (172/2) prims.lua:341 -- NYI: return to lower frame at "object-factory":1] +[TRACE --- (172/2) prims.lua:341 -- NYI: return to lower frame at "object-factory":1] +[TRACE --- (172/2) prims.lua:341 -- NYI: return to lower frame at "object-factory":1] +[TRACE 174 (172/2) prims.lua:341 -- fallback to interpreter] +[TRACE 72 prims.lua:339 -> 18] +[TRACE 81 "object-factory":1 -> 72] +[TRACE 85 closure_objects.lua:22 -> 81] +[TRACE 109 prims.lua:2020 return] +WORKLOAD_BEGIN +[TRACE --- (109/0) prims.lua:2020 -- loop unroll limit reached at "object-factory":1] +[TRACE --- (109/0) prims.lua:2020 -- loop unroll limit reached at "object-factory":1] +[TRACE --- (109/0) prims.lua:2020 -- loop unroll limit reached at "object-factory":1] +[TRACE --- (109/0) prims.lua:2020 -- loop unroll limit reached at "object-factory":1] +[TRACE 167 (109/0) prims.lua:2020 -- fallback to interpreter] +[TRACE 175 "object-factory":1 loop] +[TRACE 176 prims.lua:2019 return] +[TRACE 177 "object-factory":1 loop] +[TRACE --- (175/7) "object-factory":1 -- NYI: bytecode UCLO ] +[TRACE 178 (177/11) "object-factory":1 -> 175] +[TRACE --- (175/7) "object-factory":1 -- NYI: bytecode UCLO ] +[TRACE --- (175/7) "object-factory":1 -- NYI: bytecode UCLO ] +[TRACE --- (175/7) "object-factory":1 -- NYI: bytecode UCLO ] +[TRACE 179 (175/7) "object-factory":1 -- fallback to interpreter] +[TRACE --- closure_objects.lua:27 -- inner loop in root trace at "object-factory":1] +[TRACE --- closure_objects.lua:27 -- inner loop in root trace at "object-factory":1] +[TRACE 180 "object-factory":1 return] +[TRACE --- "object-factory":1 -- inner loop in root trace] +[TRACE --- "object-factory":1 -- inner loop in root trace] +[TRACE --- closure_objects.lua:27 -- inner loop in root trace at "object-factory":1] +[TRACE --- "object-factory":1 -- inner loop in root trace] +[TRACE --- "object-factory":1 -- inner loop in root trace] +[TRACE --- closure_objects.lua:27 -- inner loop in root trace at "object-factory":1] +[TRACE --- "object-factory":1 -- inner loop in root trace] +[TRACE --- "object-factory":1 -- inner loop in root trace] +[TRACE --- "object-factory":1 -- inner loop in root trace] +[TRACE --- "object-factory":1 -- inner loop in root trace] +[TRACE --- closure_objects.lua:27 -- inner loop in root trace at "object-factory":1] +[TRACE --- "object-factory":1 -- inner loop in root trace] +[TRACE --- "object-factory":1 -- inner loop in root trace] +[TRACE --- closure_objects.lua:27 -- inner loop in root trace at "object-factory":1] +[TRACE --- "object-factory":1 -- inner loop in root trace] +[TRACE --- "object-factory":1 -- inner loop in root trace] +[TRACE --- closure_objects.lua:27 -- inner loop in root trace at "object-factory":1] +[TRACE --- "object-factory":1 -- inner loop in root trace] +[TRACE --- "object-factory":1 -- inner loop in root trace] +[TRACE --- closure_objects.lua:27 -- inner loop in root trace at "object-factory":1] +[TRACE --- "object-factory":1 -- inner loop in root trace] +[TRACE --- "object-factory":1 -- inner loop in root trace] +[TRACE --- closure_objects.lua:27 -- inner loop in root trace at "object-factory":1] +[TRACE --- "object-factory":1 -- inner loop in root trace] +[TRACE --- "object-factory":1 -- inner loop in root trace] +[TRACE --- closure_objects.lua:27 -- inner loop in root trace at "object-factory":1] +[TRACE --- "object-factory":1 -- inner loop in root trace] +[TRACE --- "object-factory":1 -- inner loop in root trace] +[TRACE --- closure_objects.lua:27 -- inner loop in root trace at "object-factory":1] +[TRACE --- "object-factory":1 -- inner loop in root trace] +[TRACE --- "object-factory":1 -- blacklisted] +[TRACE 181 closure_objects.lua:49 loop] +WORKLOAD_END diff --git a/bench/results/closure-traces-ordinary.txt b/bench/results/closure-traces-ordinary.txt new file mode 100644 index 0000000..7ad80c0 --- /dev/null +++ b/bench/results/closure-traces-ordinary.txt @@ -0,0 +1,443 @@ +[TRACE 1 boot.lua:230 loop] +[TRACE 2 (1/3) boot.lua:236 stitch io.open] +[TRACE 3 (2/stitch) boot.lua:257 stitch io.method.read] +[TRACE 4 (3/stitch) boot.lua:259 stitch io.method.close] +[TRACE 5 (4/stitch) boot.lua:259 -> 1] +[TRACE 6 boot.lua:383 return] +[TRACE 7 boot.lua:402 loop] +[TRACE 8 boot.lua:413 stitch string.match] +[TRACE 9 (8/stitch) boot.lua:415 -> 8] +[TRACE 10 boot.lua:311 return] +[TRACE --- (10/2) boot.lua:318 -- call unroll limit reached at boot.lua:311] +[TRACE 11 boot.lua:311 up-recursion] +[TRACE 12 (11/2) boot.lua:322 -> 11] +[TRACE 13 (11/12) boot.lua:330 -> 11] +[TRACE 14 (11/0) boot.lua:312 -> 11] +[TRACE 15 (11/7) boot.lua:323 -> 11] +[TRACE 16 (12/2) boot.lua:324 -> 11] +[TRACE --- runtime.lua:41 -- leaving loop in root trace at boot.lua:321] +[TRACE --- runtime.lua:41 -- leaving loop in root trace at boot.lua:321] +[TRACE --- runtime.lua:41 -- leaving loop in root trace at boot.lua:321] +[TRACE 17 (16/5) boot.lua:330 -> 11] +[TRACE 18 prims.lua:341 loop] +[TRACE 19 prims.lua:1906 return] +[TRACE 20 "sys":17 loop] +[TRACE 21 runtime.lua:22 return] +[TRACE 22 runtime.lua:42 return] +[TRACE 23 prims.lua:1929 return] +[TRACE 24 prims.lua:1928 return] +[TRACE --- (24/1) runtime.lua:42 -- loop unroll limit reached at "sys":70] +[TRACE --- (24/1) runtime.lua:42 -- loop unroll limit reached at "sys":70] +[TRACE --- (24/1) runtime.lua:42 -- loop unroll limit reached at "sys":70] +[TRACE --- (24/1) runtime.lua:42 -- loop unroll limit reached at "sys":71] +[TRACE 25 (24/1) runtime.lua:42 -- fallback to interpreter] +[TRACE 26 "sys":71 loop] +[TRACE 27 prims.lua:1910 return] +[TRACE --- (26/12) prims.lua:1910 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (21/0) runtime.lua:23 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (27/0) prims.lua:1910 -- loop unroll limit reached at "sys":70] +[TRACE 28 (27/0) prims.lua:1910 -> 26] +[TRACE 29 (26/12) prims.lua:1910 -> 26] +[TRACE 30 (26/6) prims.lua:1910 -> 26] +[TRACE --- (21/0) runtime.lua:23 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (21/0) runtime.lua:23 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (19/0) prims.lua:1906 -- loop unroll limit reached at "sys":70] +[TRACE 31 "sys":70 loop] +[TRACE 32 (26/5) runtime.lua:42 -> 26] +[TRACE --- (21/0) runtime.lua:23 -- NYI: bytecode FNEW at "sys":67] +[TRACE 33 (21/0) runtime.lua:23 -- fallback to interpreter] +[TRACE 34 (19/0) prims.lua:1906 -> 31] +[TRACE 35 "sys":95 loop] +[TRACE 36 "sys":82 loop] +[TRACE 37 (28/0) prims.lua:1910 -> 26] +[TRACE 38 "sys":71 return] +[TRACE --- (26/0) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE 39 "sys":92 return] +[TRACE --- "sys":62 -- leaving loop in root trace at "sys":59] +[TRACE 40 "core":52 return] +[TRACE 41 "sys":68 return] +[TRACE --- prims.lua:2004 -- leaving loop in root trace at "sys":92] +[TRACE 42 (39/1) "sys":92 -> 39] +[TRACE 43 prims.lua:1908 return] +[TRACE 44 (41/1) "sys":68 -> 41] +[TRACE 45 (28/1) prims.lua:1910 -> 41] +[TRACE 46 (32/2) prims.lua:1910 -> 26] +[TRACE 47 (44/6) "sys":68 -> 41] +[TRACE 48 (43/0) prims.lua:1908 -> 31] +[TRACE 49 (35/12) "sys":95 -> 36] +[TRACE --- (36/8) "sys":82 -- NYI: bytecode UCLO at "sys":67] +[TRACE --- (36/8) "sys":82 -- NYI: bytecode UCLO at "sys":67] +[TRACE 50 (31/13) runtime.lua:42 -> 31] +[TRACE 51 (31/2) runtime.lua:42 -> 31] +[TRACE --- (36/8) "sys":82 -- NYI: bytecode UCLO at "sys":67] +[TRACE --- "writer":24 -- NYI: bytecode FNEW ] +[TRACE --- (36/8) "sys":82 -- NYI: bytecode UCLO at "sys":67] +[TRACE 52 (36/8) "sys":82 -- fallback to interpreter] +[TRACE --- (30/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (29/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE 53 (47/2) prims.lua:1910 -> 41] +[TRACE --- (30/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "sys":59 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (29/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE 54 (51/2) prims.lua:1910 -> 26] +[TRACE --- (29/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (29/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "sys":94 -- inner loop in root trace at "sys":95] +[TRACE --- (30/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "sys":70 -- inner loop in root trace] +[TRACE 55 (29/2) "sys":71 -- fallback to interpreter] +[TRACE --- "writer":14 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (30/2) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE 56 (30/2) "sys":71 -- fallback to interpreter] +[TRACE 57 prims.lua:2020 return] +[TRACE --- "sys":92 -- inner loop in root trace] +[TRACE --- "sys":59 -- NYI: bytecode FNEW at "sys":67] +[TRACE 58 prims.lua:2019 return] +[TRACE 59 prims.lua:184 return] +[TRACE --- "sys":67 -- NYI: bytecode FNEW ] +[TRACE --- "writer":13 -- NYI: bytecode FNEW at "writer":24] +[TRACE 60 (31/11) prims.lua:1910 -> 26] +[TRACE 61 "sys":25 return] +[TRACE 62 runtime.lua:70 return] +[TRACE --- "declarations":43 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "sys":66 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- prims.lua:1998 -- leaving loop in root trace at "sys":92] +[TRACE --- "writer":14 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- "sys":91 -- NYI: bytecode FNEW at "writer":24] +[TRACE 63 (31/3) prims.lua:1910 -> 26] +[TRACE --- (26/3) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (26/3) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "sys":70 -- inner loop in root trace] +[TRACE 64 prims.lua:1948 return] +[TRACE --- prims.lua:2004 -- leaving loop in root trace at "sys":92] +[TRACE --- (26/3) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- (26/3) "sys":71 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- prims.lua:1998 -- leaving loop in root trace at "sys":92] +[TRACE 65 (26/3) "sys":71 -- fallback to interpreter] +[TRACE 66 "writer":26 return] +[TRACE --- "declarations":43 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "sys":92 -- inner loop in root trace] +[TRACE --- "sys":66 -- NYI: bytecode FNEW at "sys":67] +[TRACE 67 prims.lua:108 return] +[TRACE --- prims.lua:280 -- NYI: return to lower frame at prims.lua:285] +[TRACE 68 prims.lua:1994 return] +[TRACE 69 prims.lua:1914 return] +[TRACE --- "sys":68 -- inner loop in root trace] +[TRACE 70 "declarations":43 return] +[TRACE --- "sys":62 -- leaving loop in root trace at "sys":59] +[TRACE --- "sys":62 -- leaving loop in root trace at "sys":59] +[TRACE --- "sys":91 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- "sys":94 -- inner loop in root trace at "sys":95] +[TRACE --- "sys":67 -- NYI: bytecode FNEW ] +[TRACE --- prims.lua:1998 -- leaving loop in root trace at "sys":92] +[TRACE --- "sys":69 -- inner loop in root trace at "sys":70] +[TRACE 71 prims.lua:1967 return] +[TRACE --- "sys":95 -- inner loop in root trace] +[TRACE --- "writer":24 -- NYI: return to lower frame at prims.lua:285] +[TRACE --- "sys":92 -- inner loop in root trace] +[TRACE --- "sys":62 -- leaving loop in root trace at "sys":59] +[TRACE --- "declarations":43 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "writer":14 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- prims.lua:280 -- NYI: return to lower frame at prims.lua:285] +[TRACE --- "sys":68 -- inner loop in root trace] +[TRACE 72 "sys":126 return] +[TRACE --- "sys":94 -- inner loop in root trace at "sys":95] +[TRACE --- "sys":70 -- inner loop in root trace] +[TRACE --- "sys":62 -- leaving loop in root trace at "sys":59] +[TRACE 73 prims.lua:1882 loop] +[TRACE 74 (73/1) prims.lua:1889 -> 73] +[TRACE --- "writer":13 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (72/0) "sys":126 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (72/0) "sys":126 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (72/0) "sys":126 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (72/0) "sys":126 -- NYI: bytecode FNEW at "writer":24] +[TRACE 75 (72/0) "sys":126 -- fallback to interpreter] +[TRACE --- (71/4) prims.lua:1973 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (71/4) prims.lua:1973 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (71/4) prims.lua:1973 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (71/4) prims.lua:1973 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (35/4) runtime.lua:42 -- NYI: bytecode FNEW at "declarations":42] +[TRACE 76 (71/4) prims.lua:1973 -- fallback to interpreter] +[TRACE --- (35/4) runtime.lua:42 -- NYI: bytecode FNEW at "declarations":42] +[TRACE --- (35/4) runtime.lua:42 -- NYI: bytecode FNEW at "declarations":42] +[TRACE --- (35/4) runtime.lua:42 -- NYI: bytecode FNEW at "declarations":42] +[TRACE 77 (35/4) runtime.lua:42 -- fallback to interpreter] +[TRACE --- "writer":24 -- NYI: return to lower frame at prims.lua:285] +[TRACE --- "sys":91 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- "sys":95 -- inner loop in root trace] +[TRACE --- "writer":24 -- NYI: bytecode FNEW ] +[TRACE --- (69/3) prims.lua:189 -- NYI: bytecode UCLO at "sys":64] +[TRACE --- (69/3) prims.lua:189 -- NYI: bytecode UCLO at "sys":64] +[TRACE --- (69/3) prims.lua:189 -- NYI: bytecode UCLO at "sys":64] +[TRACE --- (69/3) prims.lua:189 -- NYI: bytecode UCLO at "sys":64] +[TRACE --- (23/1) runtime.lua:42 -- NYI: return to lower frame at prims.lua:1929] +[TRACE 78 (69/3) prims.lua:189 -- fallback to interpreter] +[TRACE --- (23/1) runtime.lua:42 -- NYI: return to lower frame at prims.lua:1929] +[TRACE --- (23/1) runtime.lua:42 -- NYI: return to lower frame at prims.lua:1929] +[TRACE --- (23/1) runtime.lua:42 -- NYI: return to lower frame at prims.lua:1929] +[TRACE 79 (23/1) runtime.lua:42 -- fallback to interpreter] +[TRACE 80 prims.lua:280 return] +[TRACE --- (58/0) prims.lua:2019 -- NYI: return to lower frame] +[TRACE --- (80/0) prims.lua:281 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (80/0) prims.lua:281 -- NYI: return to lower frame at prims.lua:285] +[TRACE --- (58/0) prims.lua:2019 -- NYI: return to lower frame] +[TRACE --- (64/0) prims.lua:1949 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (80/0) prims.lua:281 -- NYI: return to lower frame at prims.lua:285] +[TRACE --- (58/0) prims.lua:2019 -- NYI: return to lower frame] +[TRACE --- (69/0) prims.lua:1914 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (64/0) prims.lua:1949 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (80/0) prims.lua:281 -- NYI: return to lower frame at prims.lua:285] +[TRACE --- (58/0) prims.lua:2019 -- NYI: return to lower frame] +[TRACE --- (69/0) prims.lua:1914 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (64/0) prims.lua:1949 -- NYI: bytecode FNEW at "writer":24] +[TRACE 81 (80/0) prims.lua:281 -- fallback to interpreter] +[TRACE 82 (58/0) prims.lua:2019 -- fallback to interpreter] +[TRACE --- (69/0) prims.lua:1914 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (64/0) prims.lua:1949 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (69/0) prims.lua:1914 -- NYI: bytecode FNEW at "writer":24] +[TRACE 83 (64/0) prims.lua:1949 -- fallback to interpreter] +[TRACE 84 (69/0) prims.lua:1914 -- fallback to interpreter] +[TRACE --- (59/0) prims.lua:185 -- NYI: bytecode FNEW at "writer":24] +[TRACE 85 prims.lua:1907 return] +[TRACE --- (59/0) prims.lua:185 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (59/0) prims.lua:185 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (59/0) prims.lua:185 -- NYI: bytecode FNEW at "writer":24] +[TRACE 86 (59/0) prims.lua:185 -- fallback to interpreter] +[TRACE --- (66/0) "writer":26 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (66/0) "writer":26 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (66/0) "writer":26 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- (66/0) "writer":26 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- "writer":23 -- NYI: bytecode FNEW ] +[TRACE 87 (66/0) "writer":26 -- fallback to interpreter] +[TRACE --- "writer":24 -- NYI: bytecode FNEW ] +[TRACE --- "writer":14 -- NYI: bytecode FNEW at "writer":24] +[TRACE 88 "sys":31 return] +[TRACE --- prims.lua:1998 -- leaving loop in root trace at "sys":92] +[TRACE --- prims.lua:685 -- NYI: bytecode FNEW at prims.lua:693] +[TRACE --- "writer":24 -- NYI: return to lower frame at prims.lua:285] +[TRACE --- "sys":67 -- NYI: bytecode FNEW ] +[TRACE --- "sys":66 -- NYI: bytecode FNEW at "sys":67] +[TRACE 89 prims.lua:190 return] +[TRACE --- "declarations":42 -- NYI: bytecode FNEW ] +[TRACE 90 (89/2) prims.lua:194 -> 89] +[TRACE --- "writer":13 -- NYI: bytecode FNEW at "writer":24] +[TRACE --- "sys":95 -- inner loop in root trace] +[TRACE --- "sys":46 -- inner loop in root trace at prims.lua:191] +[TRACE --- prims.lua:685 -- NYI: bytecode FNEW at prims.lua:693] +[TRACE --- runtime.lua:41 -- leaving loop in root trace at "sys":95] +[TRACE --- "sys":92 -- inner loop in root trace] +[TRACE --- "sys":68 -- inner loop in root trace] +[TRACE --- "declarations":42 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- prims.lua:2004 -- leaving loop in root trace at "sys":92] +[TRACE --- "sys":46 -- inner loop in root trace at prims.lua:191] +[TRACE --- "declarations":42 -- NYI: bytecode FNEW ] +[TRACE --- prims.lua:1998 -- leaving loop in root trace at "sys":92] +[TRACE --- prims.lua:685 -- NYI: bytecode FNEW at prims.lua:693] +[TRACE --- "sys":70 -- inner loop in root trace] +[TRACE --- "declarations":42 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "sys":92 -- inner loop in root trace] +[TRACE --- "sys":46 -- inner loop in root trace at prims.lua:191] +[TRACE --- "sys":46 -- inner loop in root trace at prims.lua:191] +[TRACE --- "sys":63 -- NYI: bytecode FNEW at "sys":67] +[TRACE --- "writer":24 -- NYI: return to lower frame at prims.lua:285] +[TRACE 91 (36/4) runtime.lua:42 -> 36] +[TRACE 92 "reader":34 return] +[TRACE 93 "reader":34 loop] +[TRACE 94 (93/20) "reader":34 stitch loadstring] +[TRACE 95 (94/stitch) prims.lua:2091 stitch setfenv] +[TRACE --- (95/stitch) prims.lua:2093 -- NYI: bytecode FNEW at "eval":1] +[TRACE --- "reader":34 -- inner loop in root trace] +[TRACE --- "reader":34 -- inner loop in root trace] +[TRACE --- "reader":34 -- inner loop in root trace] +[TRACE --- "reader":34 -- inner loop in root trace] +[TRACE 96 boot.lua:672 loop] +[TRACE 97 (96/4) boot.lua:672 -> 96] +[TRACE 98 (96/1) boot.lua:672 -> 96] +[TRACE 99 (96/5) boot.lua:672 -> 96] +[TRACE 100 prims.lua:1687 return] +[TRACE 101 prolog_engine.lua:305 loop] +[TRACE 102 (101/0) prolog_engine.lua:306 loop] +[TRACE 103 (101/3) prolog_engine.lua:306 -> 101] +[TRACE --- runtime.lua:104 -- leaving loop in root trace at runtime.lua:115] +[TRACE 104 runtime.lua:150 loop] +[TRACE 105 runtime.lua:104 loop] +[TRACE 106 (105/1) runtime.lua:106 -> 105] +[TRACE 107 (106/6) runtime.lua:115 -> 105] +[TRACE 108 (105/5) runtime.lua:106 -> 105] +[TRACE 109 (104/12) runtime.lua:156 stitch string.match] +[TRACE 110 (109/stitch) runtime.lua:92 stitch string.match] +[TRACE 111 (110/stitch) runtime.lua:92 stitch string.match] +[TRACE --- runtime.lua:122 -- inner loop in root trace at runtime.lua:105] +[TRACE 112 (111/stitch) runtime.lua:93 stitch string.match] +[TRACE 113 runtime.lua:134 loop] +[TRACE 114 (106/10) runtime.lua:126 -> 113] +[TRACE 115 (107/5) runtime.lua:168 -> 104] +[TRACE 116 (112/stitch) runtime.lua:93 stitch string.match] +[TRACE 117 (116/stitch) runtime.lua:94 -> 105] +[TRACE --- runtime.lua:103 -- inner loop in root trace at runtime.lua:105] +[TRACE 118 (113/4) runtime.lua:135 -> 105] +[TRACE 119 (117/3) runtime.lua:159 -> 105] +[TRACE --- runtime.lua:122 -- inner loop in root trace at runtime.lua:105] +[TRACE 120 (104/18) runtime.lua:156 stitch string.match] +[TRACE 121 (120/stitch) runtime.lua:92 stitch string.match] +[TRACE 122 (121/stitch) runtime.lua:92 stitch string.match] +[TRACE 123 (122/stitch) runtime.lua:93 stitch string.match] +[TRACE 124 (119/2) runtime.lua:160 -> 105] +[TRACE 125 (123/stitch) runtime.lua:93 stitch string.match] +[TRACE 126 (125/stitch) runtime.lua:94 -> 105] +[TRACE 127 (119/4) runtime.lua:129 -> 105] +[TRACE 128 (118/2) runtime.lua:129 -> 105] +[TRACE --- runtime.lua:103 -- inner loop in root trace at runtime.lua:105] +[TRACE 129 (113/0) runtime.lua:134 loop] +[TRACE 130 (113/2) runtime.lua:135 -> 105] +[TRACE 131 (126/7) runtime.lua:129 -> 105] +[TRACE 132 (124/3) runtime.lua:129 -> 105] +[TRACE 133 (126/4) runtime.lua:159 -> 105] +[TRACE --- runtime.lua:122 -- inner loop in root trace at runtime.lua:105] +[TRACE 134 (114/2) runtime.lua:131 -> 105] +[TRACE 135 (106/2) runtime.lua:107 -> 105] +[TRACE 136 (118/1) runtime.lua:135 -> 105] +[TRACE 137 (107/1) runtime.lua:115 -> 105] +[TRACE 138 typecheck_native.lua:197 loop] +[TRACE --- runtime.lua:41 -- leaving loop in root trace at typecheck_native.lua:113] +[TRACE 139 (138/2) typecheck_native.lua:198 -> 138] +[TRACE 140 typecheck_native.lua:109 up-recursion] +[TRACE --- (140/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE --- (140/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE --- (140/1) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE 141 (140/1) typecheck_native.lua:110 -> 140] +[TRACE --- (140/4) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE --- (140/4) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE --- (140/4) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE --- (141/2) typecheck_native.lua:119 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE --- (140/4) typecheck_native.lua:110 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE 142 (140/4) typecheck_native.lua:110 -- fallback to interpreter] +[TRACE --- (141/2) typecheck_native.lua:119 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE --- (141/2) typecheck_native.lua:119 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE --- (141/2) typecheck_native.lua:119 -- NYI: return to lower frame at typecheck_native.lua:113] +[TRACE 88 (141/2) typecheck_native.lua:119 -- fallback to interpreter] +[TRACE 143 (140/3) typecheck_native.lua:110 -> 140] +[TRACE 144 (139/8) typecheck_native.lua:110 -> 140] +[TRACE 145 (140/6) typecheck_native.lua:110 -> 140] +[TRACE 72 (139/14) typecheck_native.lua:110 -> 140] +[TRACE 75 (139/12) typecheck_native.lua:110 -> 138] +[TRACE 10 (104/0) runtime.lua:151 loop] +[TRACE 61 (105/0) runtime.lua:105 -> 105] +[TRACE 146 (61/7) runtime.lua:115 -> 105] +[TRACE 147 (61/10) runtime.lua:168 -> 104] +[TRACE 148 (61/1) runtime.lua:107 -> 105] +[TRACE 149 (10/12) runtime.lua:156 stitch string.match] +[TRACE 150 (149/stitch) runtime.lua:92 stitch string.match] +[TRACE 151 (129/0) runtime.lua:134 loop] +[TRACE 152 (150/stitch) runtime.lua:92 stitch string.match] +[TRACE 153 (152/stitch) runtime.lua:93 stitch string.match] +[TRACE 154 (153/stitch) runtime.lua:93 stitch string.match] +[TRACE 155 (154/stitch) runtime.lua:94 -> 105] +[TRACE 156 (146/5) runtime.lua:126 -> 113] +[TRACE 157 (151/4) runtime.lua:135 -> 105] +[TRACE 158 (10/18) runtime.lua:156 stitch string.match] +[TRACE --- compiler.lua:20 -- inner loop in root trace at compiler.lua:22] +[TRACE --- (62/1) runtime.lua:70 -- loop unroll limit reached at compiler.lua:213] +[TRACE --- (62/1) runtime.lua:70 -- call unroll limit reached at compiler.lua:209] +[TRACE --- (62/0) runtime.lua:70 -- loop unroll limit reached at compiler.lua:187] +[TRACE --- (22/1) runtime.lua:42 -- call unroll limit reached at compiler.lua:114] +[TRACE --- (22/1) runtime.lua:42 -- loop unroll limit reached at compiler.lua:142] +[TRACE --- (62/0) runtime.lua:70 -- loop unroll limit reached at compiler.lua:142] +[TRACE 159 (22/1) runtime.lua:42 stitch os.getenv] +[TRACE --- (62/1) runtime.lua:70 -- NYI: bytecode UCLO at compiler.lua:873] +[TRACE --- (62/1) runtime.lua:70 -- NYI: bytecode UCLO at compiler.lua:873] +[TRACE --- (22/0) runtime.lua:42 -- NYI: bytecode UCLO at compiler.lua:1043] +[TRACE 160 (62/1) runtime.lua:70 -- fallback to interpreter] +[TRACE --- (22/0) runtime.lua:42 -- NYI: bytecode UCLO at compiler.lua:873] +[TRACE --- (22/0) runtime.lua:42 -- NYI: bytecode UCLO at compiler.lua:1043] +[TRACE --- (159/2) runtime.lua:42 -- NYI: bytecode UCLO at compiler.lua:873] +[TRACE --- (159/2) runtime.lua:42 -- call unroll limit reached at compiler.lua:114] +[TRACE 161 (22/0) runtime.lua:42 stitch table.sort] +[TRACE --- (159/2) runtime.lua:42 -- NYI: bytecode UCLO at compiler.lua:873] +[TRACE --- (159/2) runtime.lua:42 -- NYI: bytecode UCLO at compiler.lua:873] +[TRACE 162 (159/2) runtime.lua:42 -- fallback to interpreter] +[TRACE 163 compiler.lua:18 return] +[TRACE --- (161/1) runtime.lua:42 -- NYI: bytecode UCLO at compiler.lua:873] +[TRACE --- (161/1) runtime.lua:42 -- NYI: bytecode UCLO at compiler.lua:1042] +[TRACE --- (161/1) runtime.lua:42 -- NYI: bytecode UCLO at compiler.lua:873] +[TRACE --- (161/1) runtime.lua:42 -- NYI: bytecode UCLO at compiler.lua:1043] +[TRACE 164 closure_objects.lua:19 -> 18] +[TRACE --- (57/0) prims.lua:2020 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE 165 (18/0) prims.lua:341 loop] +[TRACE --- (57/0) prims.lua:2020 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE --- (57/0) prims.lua:2020 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE --- (57/0) prims.lua:2020 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE 166 (57/0) prims.lua:2020 -- fallback to interpreter] +[TRACE --- (165/2) prims.lua:341 -- NYI: return to lower frame at "object-factory":1] +[TRACE --- (165/2) prims.lua:341 -- NYI: return to lower frame at "object-factory":1] +[TRACE --- (165/2) prims.lua:341 -- NYI: return to lower frame at "object-factory":1] +[TRACE --- (165/2) prims.lua:341 -- NYI: return to lower frame at "object-factory":1] +[TRACE 167 (165/2) prims.lua:341 -- fallback to interpreter] +[TRACE --- (67/0) prims.lua:108 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE --- (67/0) prims.lua:108 -- NYI: bytecode UCLO at "object-factory":1] +[TRACE --- (67/0) prims.lua:108 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE --- (67/0) prims.lua:108 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE 101 (67/0) prims.lua:108 -- fallback to interpreter] +[TRACE 102 prims.lua:339 -> 18] +[TRACE 103 closure_objects.lua:22 -> 102] +WORKLOAD_BEGIN +[TRACE 168 "object-factory":1 return] +[TRACE 169 prims.lua:850 loop] +[TRACE 170 (169/4) prims.lua:148 -> 169] +[TRACE 171 prims.lua:802 loop] +[TRACE 172 (170/0) prims.lua:148 -> 169] +[TRACE --- closure_objects.lua:27 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE 173 (169/1) prims.lua:851 -> 171] +[TRACE --- (171/6) prims.lua:803 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE --- (171/6) prims.lua:803 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE --- (171/6) prims.lua:803 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE --- prims.lua:859 -- inner loop in root trace at prims.lua:851] +[TRACE --- (171/6) prims.lua:803 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE 174 (171/6) prims.lua:803 -- fallback to interpreter] +[TRACE --- "object-factory":1 -- NYI: bytecode FNEW ] +[TRACE --- closure_objects.lua:27 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE --- prims.lua:859 -- inner loop in root trace at prims.lua:851] +[TRACE --- prims.lua:849 -- inner loop in root trace at prims.lua:851] +[TRACE --- closure_objects.lua:27 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE --- "object-factory":1 -- NYI: bytecode FNEW ] +[TRACE 175 "object-factory":1 return] +[TRACE --- prims.lua:849 -- inner loop in root trace at prims.lua:851] +[TRACE --- prims.lua:859 -- inner loop in root trace at prims.lua:851] +[TRACE --- "object-factory":1 -- NYI: bytecode FNEW ] +[TRACE --- closure_objects.lua:27 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE --- prims.lua:849 -- inner loop in root trace at prims.lua:851] +[TRACE --- prims.lua:859 -- inner loop in root trace at prims.lua:851] +[TRACE --- closure_objects.lua:27 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE --- "object-factory":1 -- NYI: bytecode FNEW ] +[TRACE --- prims.lua:849 -- inner loop in root trace at prims.lua:851] +[TRACE --- prims.lua:859 -- inner loop in root trace at prims.lua:851] +[TRACE --- closure_objects.lua:27 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE --- "object-factory":1 -- NYI: bytecode FNEW ] +[TRACE --- prims.lua:849 -- inner loop in root trace at prims.lua:851] +[TRACE --- prims.lua:859 -- inner loop in root trace at prims.lua:851] +[TRACE --- closure_objects.lua:27 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE --- "object-factory":1 -- NYI: bytecode FNEW ] +[TRACE --- prims.lua:849 -- inner loop in root trace at prims.lua:851] +[TRACE --- closure_objects.lua:27 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE --- prims.lua:859 -- inner loop in root trace at prims.lua:851] +[TRACE --- "object-factory":1 -- NYI: bytecode FNEW ] +[TRACE --- prims.lua:849 -- inner loop in root trace at prims.lua:851] +[TRACE --- closure_objects.lua:27 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE --- prims.lua:859 -- inner loop in root trace at prims.lua:851] +[TRACE --- "object-factory":1 -- NYI: bytecode FNEW ] +[TRACE --- prims.lua:849 -- inner loop in root trace at prims.lua:851] +[TRACE --- closure_objects.lua:27 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE --- prims.lua:859 -- inner loop in root trace at prims.lua:851] +[TRACE --- "object-factory":1 -- NYI: bytecode FNEW ] +[TRACE --- prims.lua:849 -- inner loop in root trace at prims.lua:851] +[TRACE --- closure_objects.lua:27 -- NYI: bytecode FNEW at "object-factory":1] +[TRACE --- prims.lua:859 -- inner loop in root trace at prims.lua:851] +[TRACE --- "object-factory":1 -- NYI: bytecode FNEW ] +[TRACE --- prims.lua:849 -- inner loop in root trace at prims.lua:851] +[TRACE --- prims.lua:859 -- inner loop in root trace at prims.lua:851] +[TRACE --- "object-factory":1 -- NYI: bytecode FNEW ] +[TRACE --- prims.lua:849 -- inner loop in root trace at prims.lua:851] +[TRACE --- closure_objects.lua:41 -- leaving loop in root trace at closure_objects.lua:42] +[TRACE 176 closure_objects.lua:45 return] +[TRACE 177 closure_objects.lua:49 loop] +WORKLOAD_END diff --git a/bench/results/closures-interpreter.txt b/bench/results/closures-interpreter.txt new file mode 100644 index 0000000..289e9b3 --- /dev/null +++ b/bench/results/closures-interpreter.txt @@ -0,0 +1,10 @@ +LuaJIT 2.1.1774638290 arm64 jit=false iterations=1000000 +case,mode,median_seconds,heap_growth_KiB_10000,retained_KiB,MKFUN_sites,trace_stops,trace_aborts,exit_events_1000 +immediate,off,0.480237,937.500,0.000,1,0,0,0 +immediate,on,0.064048,0.000,0.000,0,0,0,0 +local,off,0.706924,937.500,0.000,1,0,0,0 +local,on,0.216801,0.000,0.000,0,0,0,0 +escaping,off,0.625483,937.500,0.000,1,0,0,0 +escaping,on,0.635602,937.500,0.000,1,0,0,0 +deferred,off,0.710972,1796.875,0.000,1,0,0,0 +deferred,on,0.713242,1796.875,0.000,1,0,0,0 diff --git a/bench/results/closures.txt b/bench/results/closures.txt new file mode 100644 index 0000000..3f810ca --- /dev/null +++ b/bench/results/closures.txt @@ -0,0 +1,10 @@ +LuaJIT 2.1.1774638290 arm64 jit=true iterations=1000000 +case,mode,median_seconds,heap_growth_KiB_10000,retained_KiB,MKFUN_sites,trace_stops,trace_aborts,exit_events_1000 +immediate,off,0.430640,937.500,0.000,1,3,22,0 +immediate,on,0.020572,0.000,0.000,0,1,0,0 +local,off,0.540989,937.500,0.000,1,4,13,0 +local,on,0.027926,0.000,0.000,0,4,0,0 +escaping,off,0.502972,937.500,0.000,1,5,13,0 +escaping,on,0.523506,937.500,0.000,1,6,12,0 +deferred,off,0.477620,1796.875,0.000,1,4,12,0 +deferred,on,0.506964,1796.875,0.000,1,6,13,0 diff --git a/bench/results/datatype-dispatch.patch b/bench/results/datatype-dispatch.patch new file mode 100644 index 0000000..8094d50 --- /dev/null +++ b/bench/results/datatype-dispatch.patch @@ -0,0 +1,97 @@ +diff --git a/typecheck_native.lua b/typecheck_native.lua +index 88f835d..c23dc52 100644 +--- a/typecheck_native.lua ++++ b/typecheck_native.lua +@@ -32,6 +32,13 @@ + local R = require("runtime") + + local M = {} ++M.DATATYPE_DISPATCH = os.getenv("SHEN_DATATYPE_DISPATCH") == "on" ++M.dispatch_stats = { builds=0, sites=0, bytes=0 } ++local generic_sud, dispatch_root, dispatch_worker ++local function refresh_datatype_dispatch() ++ if not M.DATATYPE_DISPATCH then return end ++ return M.refresh_datatype_dispatch() ++end + + local P, E, F, NP, PC + +@@ -260,6 +267,7 @@ local function install_handports() + E.incinfs() + return sud(goal_t, assum_t, E.cdr(l), n, cont) + end ++ generic_sud = sud + NP["shen.search-user-datatypes"] = sud + + -- shen.show (t-star.kl:25): spy display; materialize and reuse the plain +@@ -280,10 +288,62 @@ M.NATIVE_MISS = setmetatable({}, { __tostring = function() + return "native typecheck: untranslatable datatype predicate" + end }) + ++-- Bounded callback specialization for the ordered datatype list. Each site ++-- keeps its live NP lookup (so redefinitions are observed) but has a distinct ++-- Lua call instruction. Guards fall back at the current suffix, never replaying ++-- predicates already tried. No predicate is translated merely to build this. ++function M.refresh_datatype_dispatch() ++ local root = P.GLOBALS["shen.*datatypes*"] ++ if root == dispatch_root and dispatch_worker then return end ++ local names, rest = {}, root ++ while getmt(rest) == Cons and #names < 32 do ++ local entry = rest[1] ++ if getmt(entry) ~= Cons or getmt(entry[1]) ~= Symbol then break end ++ names[#names+1] = entry[1] ++ rest = rest[2] ++ end ++ if #names == 0 then ++ NP["shen.search-user-datatypes"] = generic_sud ++ dispatch_root, dispatch_worker = root, nil ++ return ++ end ++ local code = { "local E,NP,names,generic,miss = ...; return function(goal,assum,l,n,cont) local r" } ++ for i,nm in ipairs(names) do ++ code[#code+1] = ([=[ ++ do ++ if not E.lock_is_open() then return false end ++ l = E.lazyderef(l) ++ if l < E.CONS_BASE then return false end ++ local entry = E.lazyderef(E.car(l)) ++ if entry < E.CONS_BASE or E.atomval(E.lazyderef(E.car(entry))) ~= names[%d] then ++ return generic(goal,assum,l,n,cont) ++ end ++ local fn = NP[%q] ++ if fn == nil then error(miss,0) end ++ E.incinfs() ++ r = fn(goal,assum,n,cont) ++ if r ~= false then return r end ++ if not E.lock_is_open() then return false end ++ E.incinfs() ++ l = E.cdr(l) ++ end ++ ]=]):format(i,nm.name) ++ end ++ code[#code+1] = "return generic(goal,assum,l,n,cont) end" ++ local src = table.concat(code, "\n") ++ local make = assert((loadstring or load)(src, "@datatype-dispatch")) ++ dispatch_worker = make(E,NP,names,generic_sud,M.NATIVE_MISS) ++ dispatch_root = root ++ NP["shen.search-user-datatypes"] = dispatch_worker ++ M.dispatch_stats.builds = M.dispatch_stats.builds + 1 ++ M.dispatch_stats.sites, M.dispatch_stats.bytes = #names, #src ++end ++ + -- --------------------------------------------------------------------------- + -- the typecheck entry (t-star.kl:1) + -- --------------------------------------------------------------------------- + local function native_typecheck(expr, type_) ++ refresh_datatype_dispatch() + -- pre-processing identical to the legacy entry (plain helpers via F) + local vars = F["shen.extract-vars"](type_) + local rect = F["shen.rectify-type"](type_) +@@ -322,6 +382,7 @@ end + -- install + -- --------------------------------------------------------------------------- + function M.install(Pmod, Emod) ++ dispatch_root, dispatch_worker = nil, nil + P, E = Pmod, Emod + F, NP = P.F, E.NativePred + PC = require("prolog_compile") diff --git a/bench/results/typecheck-audit.json b/bench/results/typecheck-audit.json new file mode 100644 index 0000000..1db4ce2 --- /dev/null +++ b/bench/results/typecheck-audit.json @@ -0,0 +1,20 @@ +[ +{"round":0,"history":"keep","mode":"off","samples":[{"sample":"1","seconds":"0.140108","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.127308","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.135678","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.141128","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.140324","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.133454","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.128163","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.137544","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.137496","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.139637","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.145834","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.141319","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.1385905}, +{"round":0,"history":"keep","mode":"on","samples":[{"sample":"1","seconds":"0.109339","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.111923","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.123405","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.113318","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.116155","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.113807","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.112853","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.111049","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.109857","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.108885","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.123824","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.114167","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.111951}, +{"round":0,"history":"flush","mode":"off","samples":[{"sample":"1","seconds":"0.103183","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.066278","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.063152","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.066523","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.068776","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.062843","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.066065","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.060859","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.065844","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.061887","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.058814","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.057502","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.061373}, +{"round":0,"history":"flush","mode":"on","samples":[{"sample":"1","seconds":"0.216068","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.098912","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.105067","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.099478","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.100366","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.099907","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.104042","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.103889","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.096568","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.106816","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.102014","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.104077","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.10396549999999999}, +{"round":0,"history":"off","mode":"off","samples":[{"sample":"1","seconds":"0.609578","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.595790","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.625454","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.631729","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.598700","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.627518","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.620590","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.613415","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.618495","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.619968","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.619708","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.616225","infs":"431741","jit":"false","semantic":"(listl-formula)"}],"median":0.6191015}, +{"round":0,"history":"off","mode":"on","samples":[{"sample":"1","seconds":"0.646884","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.644541","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.637950","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.614125","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.626720","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.622465","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.624476","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.633400","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.657196","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.630394","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.624581","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.647496","infs":"431741","jit":"false","semantic":"(listl-formula)"}],"median":0.6318969999999999}, +{"round":1,"history":"keep","mode":"on","samples":[{"sample":"1","seconds":"0.050165","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.051814","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.052452","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.052478","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.050091","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.047860","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.047298","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.049769","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.047776","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.052367","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.048355","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.052154","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.049062}, +{"round":1,"history":"keep","mode":"off","samples":[{"sample":"1","seconds":"0.178343","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.175688","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.174525","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.163675","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.169834","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.177221","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.173278","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.176497","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.168989","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.173753","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.176726","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.173816","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.1737845}, +{"round":1,"history":"flush","mode":"on","samples":[{"sample":"1","seconds":"0.091061","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.051709","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.048580","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.052826","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.052449","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.049252","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.050687","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.056463","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.056280","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.053308","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.055731","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.048174","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.0545195}, +{"round":1,"history":"flush","mode":"off","samples":[{"sample":"1","seconds":"0.223718","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.140513","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.133636","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.131691","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.134481","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.129064","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.137884","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.135186","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.133654","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.137661","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.130085","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.139474","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.1364235}, +{"round":1,"history":"off","mode":"on","samples":[{"sample":"1","seconds":"0.633618","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.636458","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.639965","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.631543","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.643576","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.634532","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.628773","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.615051","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.645145","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.653602","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.649208","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.627323","infs":"431741","jit":"false","semantic":"(listl-formula)"}],"median":0.636959}, +{"round":1,"history":"off","mode":"off","samples":[{"sample":"1","seconds":"0.670399","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.655453","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.659800","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.667745","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.680724","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.640503","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.651439","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.640870","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.674155","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.658854","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.672289","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.657692","infs":"431741","jit":"false","semantic":"(listl-formula)"}],"median":0.6582730000000001}, +{"round":2,"history":"keep","mode":"off","samples":[{"sample":"1","seconds":"0.139946","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.132796","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.140854","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.143939","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.139101","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.134947","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.138514","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.127238","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.132400","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.127415","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.134840","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.133292","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.132846}, +{"round":2,"history":"keep","mode":"on","samples":[{"sample":"1","seconds":"0.129790","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.119673","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.123216","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.116964","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.121406","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.127761","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.122811","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.128522","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.124464","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.122157","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.118437","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.120487","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.12248400000000001}, +{"round":2,"history":"flush","mode":"off","samples":[{"sample":"1","seconds":"0.270690","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.144951","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.146543","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.147240","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.147970","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.145826","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.151025","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.145158","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.147443","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.143835","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.145278","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.145904","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.145591}, +{"round":2,"history":"flush","mode":"on","samples":[{"sample":"1","seconds":"0.249600","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.130869","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.133216","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.130775","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.135157","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.136621","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.128971","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.123874","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.127877","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.130914","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.126921","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.134482","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.12842399999999998}, +{"round":2,"history":"off","mode":"off","samples":[{"sample":"1","seconds":"0.656470","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.632422","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.637686","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.662690","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.648128","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.656944","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.631044","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.618951","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.644062","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.674995","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.653982","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.660381","infs":"431741","jit":"false","semantic":"(listl-formula)"}],"median":0.649022}, +{"round":2,"history":"off","mode":"on","samples":[{"sample":"1","seconds":"0.641164","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.643219","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.649966","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.642096","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.641532","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.650230","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.633796","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.632304","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.630682","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.625656","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.636335","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.629979","infs":"431741","jit":"false","semantic":"(listl-formula)"}],"median":0.631493} +] diff --git a/bench/results/typecheck-audit.txt b/bench/results/typecheck-audit.txt new file mode 100644 index 0000000..a7e0e6f --- /dev/null +++ b/bench/results/typecheck-audit.txt @@ -0,0 +1,24 @@ +0 keep off 0.1385905 +0 keep on 0.111951 +0 flush off 0.061373 +0 flush on 0.10396549999999999 +0 off off 0.6191015 +0 off on 0.6318969999999999 +1 keep on 0.049062 +1 keep off 0.1737845 +1 flush on 0.0545195 +1 flush off 0.1364235 +1 off on 0.636959 +1 off off 0.6582730000000001 +2 keep off 0.132846 +2 keep on 0.12248400000000001 +2 flush off 0.145591 +2 flush on 0.12842399999999998 +2 off off 0.649022 +2 off on 0.631493 +keep off 0.1385905 [0.1385905, 0.1737845, 0.132846] +keep on 0.111951 [0.111951, 0.049062, 0.12248400000000001] +flush off 0.1364235 [0.061373, 0.1364235, 0.145591] +flush on 0.10396549999999999 [0.10396549999999999, 0.0545195, 0.12842399999999998] +off off 0.649022 [0.6191015, 0.6582730000000001, 0.649022] +off on 0.6318969999999999 [0.6318969999999999, 0.636959, 0.631493] diff --git a/bench/results/typecheck-dispatch-ab.json b/bench/results/typecheck-dispatch-ab.json new file mode 100644 index 0000000..b71c6a6 --- /dev/null +++ b/bench/results/typecheck-dispatch-ab.json @@ -0,0 +1,18 @@ +[ +{"round":0,"history":"flush","mode":"off","samples":[{"sample":"1","seconds":"0.273684","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.153042","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.143905","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.147109","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.134117","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.142207","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.147310","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.138317","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.139778","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.138854","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.136595","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.140081","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"stats":["DISPATCH builds=0 sites=0 bytes=0"],"median":0.139316}, +{"round":0,"history":"flush","mode":"on","samples":[{"sample":"1","seconds":"0.333699","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.176891","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.183636","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.157015","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.154016","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.152609","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.154994","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.160853","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.151759","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.158911","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.156528","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.158151","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"stats":["DISPATCH builds=1 sites=4 bytes=2588"],"median":0.15733950000000002}, +{"round":0,"history":"off","mode":"off","samples":[{"sample":"1","seconds":"0.634118","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.632291","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.630951","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.618797","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.639125","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.641994","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.652146","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.644674","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.631026","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.644213","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.626950","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.643427","infs":"431741","jit":"false","semantic":"(listl-formula)"}],"stats":["DISPATCH builds=0 sites=0 bytes=0"],"median":0.6438200000000001}, +{"round":0,"history":"off","mode":"on","samples":[{"sample":"1","seconds":"0.639250","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.647115","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.639837","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.647545","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.643950","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.641459","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.641290","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.642312","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.637931","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.627474","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.609755","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.608573","infs":"431741","jit":"false","semantic":"(listl-formula)"}],"stats":["DISPATCH builds=1 sites=4 bytes=2588"],"median":0.6327025}, +{"round":1,"history":"flush","mode":"on","samples":[{"sample":"1","seconds":"0.272445","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.160098","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.156483","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.163736","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.156902","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.160543","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.159535","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.155964","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.158907","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.161699","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.173046","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.171995","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"stats":["DISPATCH builds=1 sites=4 bytes=2588"],"median":0.160617}, +{"round":1,"history":"flush","mode":"off","samples":[{"sample":"1","seconds":"0.119717","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.056631","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.058340","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.057610","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.061052","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.057714","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.055242","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.054642","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.055282","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.052088","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.055666","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.056860","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"stats":["DISPATCH builds=0 sites=0 bytes=0"],"median":0.055262}, +{"round":1,"history":"off","mode":"on","samples":[{"sample":"1","seconds":"0.642823","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.644319","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.639816","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.656814","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.646305","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.634860","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.611041","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.625729","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.648052","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.637353","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.625744","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.634396","infs":"431741","jit":"false","semantic":"(listl-formula)"}],"stats":["DISPATCH builds=1 sites=4 bytes=2588"],"median":0.6300699999999999}, +{"round":1,"history":"off","mode":"off","samples":[{"sample":"1","seconds":"0.623982","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.612125","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.635063","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.634155","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.635197","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.618238","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.598850","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.617734","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.626145","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.622363","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.610164","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.600034","infs":"431741","jit":"false","semantic":"(listl-formula)"}],"stats":["DISPATCH builds=0 sites=0 bytes=0"],"median":0.6139490000000001}, +{"round":2,"history":"flush","mode":"off","samples":[{"sample":"1","seconds":"0.212260","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.120002","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.112839","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.112063","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.115152","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.125986","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.115159","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.116531","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.121801","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.117813","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.113287","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.117989","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"stats":["DISPATCH builds=0 sites=0 bytes=0"],"median":0.117172}, +{"round":2,"history":"flush","mode":"on","samples":[{"sample":"1","seconds":"0.242779","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.128490","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.132586","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.138497","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.124839","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.135888","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.135166","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.135173","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.134475","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.129159","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.125714","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.122590","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"stats":["DISPATCH builds=1 sites=4 bytes=2588"],"median":0.13181700000000002}, +{"round":2,"history":"off","mode":"off","samples":[{"sample":"1","seconds":"0.608535","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.656910","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.595879","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.607130","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.628024","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.649947","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.606697","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.634682","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.631730","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.634329","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.647972","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.653731","infs":"431741","jit":"false","semantic":"(listl-formula)"}],"stats":["DISPATCH builds=0 sites=0 bytes=0"],"median":0.6345055}, +{"round":2,"history":"off","mode":"on","samples":[{"sample":"1","seconds":"0.624887","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.629215","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.617974","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.660067","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.637448","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.625476","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.631175","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.637812","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.630634","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.624927","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.646668","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.635920","infs":"431741","jit":"false","semantic":"(listl-formula)"}],"stats":["DISPATCH builds=1 sites=4 bytes=2588"],"median":0.6335475}, +{"round":3,"history":"flush","mode":"on","samples":[{"sample":"1","seconds":"0.266509","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.142225","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.151675","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.157255","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.147679","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.144551","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.148500","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.143437","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.138868","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.145104","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.145402","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.148163","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"stats":["DISPATCH builds=1 sites=4 bytes=2588"],"median":0.14525300000000002}, +{"round":3,"history":"flush","mode":"off","samples":[{"sample":"1","seconds":"0.111420","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.054312","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.052316","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.055943","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.050403","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.054337","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.050479","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.050075","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.054585","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.052315","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.054531","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.052598","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"stats":["DISPATCH builds=0 sites=0 bytes=0"],"median":0.0524565}, +{"round":3,"history":"off","mode":"on","samples":[{"sample":"1","seconds":"0.629716","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.619058","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.623390","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.618127","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.626079","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.618071","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.610954","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.618255","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.628611","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.605263","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.628971","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.627254","infs":"431741","jit":"false","semantic":"(listl-formula)"}],"stats":["DISPATCH builds=1 sites=4 bytes=2588"],"median":0.6227545}, +{"round":3,"history":"off","mode":"off","samples":[{"sample":"1","seconds":"0.636650","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.625075","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.628211","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.627388","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.634996","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.620096","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.620589","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.629675","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.630535","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.638487","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.622128","infs":"431741","jit":"false","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.640056","infs":"431741","jit":"false","semantic":"(listl-formula)"}],"stats":["DISPATCH builds=0 sites=0 bytes=0"],"median":0.6301049999999999} +] diff --git a/bench/results/typecheck-dispatch-ab.txt b/bench/results/typecheck-dispatch-ab.txt new file mode 100644 index 0000000..cbd7c1c --- /dev/null +++ b/bench/results/typecheck-dispatch-ab.txt @@ -0,0 +1,20 @@ +0 flush off 0.139316 ['DISPATCH builds=0 sites=0 bytes=0'] +0 flush on 0.15733950000000002 ['DISPATCH builds=1 sites=4 bytes=2588'] +0 off off 0.6438200000000001 ['DISPATCH builds=0 sites=0 bytes=0'] +0 off on 0.6327025 ['DISPATCH builds=1 sites=4 bytes=2588'] +1 flush on 0.160617 ['DISPATCH builds=1 sites=4 bytes=2588'] +1 flush off 0.055262 ['DISPATCH builds=0 sites=0 bytes=0'] +1 off on 0.6300699999999999 ['DISPATCH builds=1 sites=4 bytes=2588'] +1 off off 0.6139490000000001 ['DISPATCH builds=0 sites=0 bytes=0'] +2 flush off 0.117172 ['DISPATCH builds=0 sites=0 bytes=0'] +2 flush on 0.13181700000000002 ['DISPATCH builds=1 sites=4 bytes=2588'] +2 off off 0.6345055 ['DISPATCH builds=0 sites=0 bytes=0'] +2 off on 0.6335475 ['DISPATCH builds=1 sites=4 bytes=2588'] +3 flush on 0.14525300000000002 ['DISPATCH builds=1 sites=4 bytes=2588'] +3 flush off 0.0524565 ['DISPATCH builds=0 sites=0 bytes=0'] +3 off on 0.6227545 ['DISPATCH builds=1 sites=4 bytes=2588'] +3 off off 0.6301049999999999 ['DISPATCH builds=0 sites=0 bytes=0'] +flush off 0.086217 [0.139316, 0.055262, 0.117172, 0.0524565] +flush on 0.15129625000000002 [0.15733950000000002, 0.160617, 0.13181700000000002, 0.14525300000000002] +off off 0.6323052499999999 [0.6438200000000001, 0.6139490000000001, 0.6345055, 0.6301049999999999] +off on 0.6313862499999999 [0.6327025, 0.6300699999999999, 0.6335475, 0.6227545] diff --git a/bench/results/typecheck-loop-ab.json b/bench/results/typecheck-loop-ab.json new file mode 100644 index 0000000..e5b91c2 --- /dev/null +++ b/bench/results/typecheck-loop-ab.json @@ -0,0 +1,14 @@ +[ +{"round":0,"mode":"default","samples":[{"sample":"1","seconds":"0.328838","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.163986","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.156317","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.167028","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.160614","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.155208","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.154570","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.148867","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.155864","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.153278","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.151866","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.156574","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.153924}, +{"round":0,"mode":"loop","samples":[{"sample":"1","seconds":"0.131671","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.082917","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.086272","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.091902","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.092307","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.081985","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.084773","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.083923","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.084228","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.082998","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.088615","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.084751","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.0844895}, +{"round":0,"mode":"loop8000","samples":[{"sample":"1","seconds":"0.111955","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.078105","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.071728","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.072328","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.076267","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.077152","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.073849","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.077162","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.076013","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.069735","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.067077","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.074329","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.074089}, +{"round":1,"mode":"loop","samples":[{"sample":"1","seconds":"0.111820","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.081206","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.083881","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.084445","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.086657","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.078865","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.080183","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.082735","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.077685","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.077694","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.080023","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.080946","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.08010300000000001}, +{"round":1,"mode":"loop8000","samples":[{"sample":"1","seconds":"0.215930","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.062891","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.061194","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.066187","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.061592","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.061585","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.055440","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.062426","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.057117","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.057904","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.056806","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.056648","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.0569615}, +{"round":1,"mode":"default","samples":[{"sample":"1","seconds":"0.147205","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.107440","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.104387","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.106391","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.110884","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.115985","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.112404","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.105793","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.108787","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.112809","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.114159","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.115735","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.1126065}, +{"round":2,"mode":"loop8000","samples":[{"sample":"1","seconds":"0.115363","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.077105","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.074589","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.080615","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.080731","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.082792","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.077488","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.078352","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.077621","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.077946","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.078056","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.076308","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.0777835}, +{"round":2,"mode":"default","samples":[{"sample":"1","seconds":"0.116198","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.072064","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.072371","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.076893","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.074603","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.069857","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.074114","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.074080","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.069405","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.074374","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.070900","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.070301","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.07249}, +{"round":2,"mode":"loop","samples":[{"sample":"1","seconds":"0.109353","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.078859","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.079033","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.080312","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.082590","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.077526","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.079171","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.075263","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.077634","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.084509","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.076439","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.078347","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.07799049999999999}, +{"round":3,"mode":"default","samples":[{"sample":"1","seconds":"0.278783","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.125616","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.126539","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.130351","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.131158","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.123155","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.127243","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.128879","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.125668","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.127845","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.123123","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.128729","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.127544}, +{"round":3,"mode":"loop","samples":[{"sample":"1","seconds":"0.094009","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.061413","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.058957","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.073305","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.061999","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.060529","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.061916","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.062759","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.060114","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.060820","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.062870","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.062853","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.0623375}, +{"round":3,"mode":"loop8000","samples":[{"sample":"1","seconds":"0.095715","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.061032","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.052981","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.059391","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.062760","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.057252","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.054288","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.059135","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.051945","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.056660","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.055944","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.059066","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.056302000000000005} +] diff --git a/bench/results/typecheck-loop-ab.txt b/bench/results/typecheck-loop-ab.txt new file mode 100644 index 0000000..7e41f83 --- /dev/null +++ b/bench/results/typecheck-loop-ab.txt @@ -0,0 +1,15 @@ +0 default 0.153924 +0 loop 0.0844895 +0 loop8000 0.074089 +1 loop 0.08010300000000001 +1 loop8000 0.0569615 +1 default 0.1126065 +2 loop8000 0.0777835 +2 default 0.07249 +2 loop 0.07799049999999999 +3 default 0.127544 +3 loop 0.0623375 +3 loop8000 0.056302000000000005 +default 0.12007525 [0.153924, 0.1126065, 0.07249, 0.127544] +loop 0.07904675 [0.0844895, 0.08010300000000001, 0.07799049999999999, 0.0623375] +loop8000 0.06552525000000001 [0.074089, 0.0569615, 0.0777835, 0.056302000000000005] diff --git a/bench/results/typecheck-loop-repeat.json b/bench/results/typecheck-loop-repeat.json new file mode 100644 index 0000000..b8647ab --- /dev/null +++ b/bench/results/typecheck-loop-repeat.json @@ -0,0 +1,14 @@ +[ +{"round":0,"mode":"default","samples":[{"sample":"1","seconds":"0.258614","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.126761","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.124848","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.124345","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.120217","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.117352","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.118219","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.124186","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.120535","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.130991","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.132313","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.126425","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.12530550000000001}, +{"round":0,"mode":"loop","samples":[{"sample":"1","seconds":"0.114332","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.086630","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.087937","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.085692","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.087243","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.082269","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.084051","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.090797","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.082571","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.082217","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.080925","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.084316","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.083311}, +{"round":1,"mode":"loop","samples":[{"sample":"1","seconds":"0.122282","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.059649","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.055903","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.060302","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.063784","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.056947","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.055627","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.057178","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.058884","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.057209","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.062233","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.056197","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.0571935}, +{"round":1,"mode":"default","samples":[{"sample":"1","seconds":"0.121024","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.077561","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.083069","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.080717","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.078463","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.075786","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.076494","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.076453","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.080380","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.067541","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.073015","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.074226","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.0753395}, +{"round":2,"mode":"default","samples":[{"sample":"1","seconds":"0.105760","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.038232","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.040537","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.043236","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.043703","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.045590","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.039384","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.038303","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.042657","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.036847","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.038787","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.039834","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.0390855}, +{"round":2,"mode":"loop","samples":[{"sample":"1","seconds":"0.139289","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.117374","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.116775","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.118106","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.117497","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.111795","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.111801","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.112804","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.111367","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.114999","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.106473","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.099639","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.11158399999999999}, +{"round":3,"mode":"loop","samples":[{"sample":"1","seconds":"0.136916","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.051712","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.047985","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.055970","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.049552","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.046136","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.052817","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.043031","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.048381","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.047203","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.055291","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.050192","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.0492865}, +{"round":3,"mode":"default","samples":[{"sample":"1","seconds":"0.271911","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.134935","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.146009","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.143911","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.139486","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.140204","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.133462","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.140399","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.131607","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.140049","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.137097","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.136280","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.1366885}, +{"round":4,"mode":"default","samples":[{"sample":"1","seconds":"0.252270","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.146721","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.142639","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.153266","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.145316","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.149412","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.150719","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.142916","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.151411","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.142586","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.138555","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.144008","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.14346199999999998}, +{"round":4,"mode":"loop","samples":[{"sample":"1","seconds":"0.115724","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.081826","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.082082","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.088793","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.077393","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.080137","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.083517","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.080713","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.075338","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.075768","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.075613","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.068999","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.0756905}, +{"round":5,"mode":"loop","samples":[{"sample":"1","seconds":"0.119008","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.071819","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.076216","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.074745","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.073556","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.071221","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.071558","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.067018","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.066513","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.073198","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.070877","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.065223","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.0689475}, +{"round":5,"mode":"default","samples":[{"sample":"1","seconds":"0.239594","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.117669","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.113250","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.111381","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.125125","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.119351","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.125092","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.124497","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.127451","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.128236","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.107140","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.114642","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.1247945} +] diff --git a/bench/results/typecheck-loop-repeat.txt b/bench/results/typecheck-loop-repeat.txt new file mode 100644 index 0000000..54bcde2 --- /dev/null +++ b/bench/results/typecheck-loop-repeat.txt @@ -0,0 +1,14 @@ +0 default 0.12530550000000001 +0 loop 0.083311 +1 loop 0.0571935 +1 default 0.0753395 +2 default 0.0390855 +2 loop 0.11158399999999999 +3 loop 0.0492865 +3 default 0.1366885 +4 default 0.14346199999999998 +4 loop 0.0756905 +5 loop 0.0689475 +5 default 0.1247945 +default 0.12505 [0.12530550000000001, 0.0753395, 0.0390855, 0.1366885, 0.14346199999999998, 0.1247945] +loop 0.072319 [0.083311, 0.0571935, 0.11158399999999999, 0.0492865, 0.0756905, 0.0689475] diff --git a/bench/results/typecheck-profile.txt b/bench/results/typecheck-profile.txt new file mode 100644 index 0000000..12b24bd --- /dev/null +++ b/bench/results/typecheck-profile.txt @@ -0,0 +1,140 @@ + 2050 Interpreted + -- 495 fn < shen.search-user-datatypes < thawH + -- 146 shen.search-user-datatypes < thawH < THAW + -- 117 LZD < fn < shen.search-user-datatypes + -- 104 CAR < fn < shen.search-user-datatypes + -- 101 NEWVAR < fn < shen.search-user-datatypes + -- 101 POPVAR < fn < shen.search-user-datatypes + -- 94 LOCKOPEN < fn < shen.search-user-datatypes + -- 89 fn < shen.search-user-datatypes < LF12 + -- 79 thawH < THAW < THAW + -- 46 cons < materialize < materialize + -- 45 CDR < fn < shen.search-user-datatypes + -- 40 incinfs < shen.search-user-datatypes < thawH + -- 38 fn < shen.search-user-datatypes < THAW + -- 37 MAT < thawH < THAW + -- 35 INCINFS < fn < shen.search-user-datatypes + -- 27 materialize < materialize < materialize + -- 23 LOCKOPEN < thawH < THAW + -- 20 cons < materialize < MAT + -- 19 NEWCONT6 < fn < shen.search-user-datatypes + -- 18 cons < MAT < thawH + -- 16 car < shen.search-user-datatypes < thawH + -- 16 materialize < MAT < thawH + -- 15 lock_is_open < shen.search-user-datatypes < thawH + -- 15 LZD < thawH < THAW + -- 14 shen.search-user-datatypes < LF12 < LF10 + -- 14 shen.lua-guard-51 < LF1 < fn + -- 13 THAW < thawH < THAW + -- 13 cdr < shen.search-user-datatypes < thawH + -- 13 lazyderef < shen.search-user-datatypes < thawH + 961 Compiled + -- 117 NEWVAR < fn < shen.search-user-datatypes + -- 93 LZD < fn < shen.search-user-datatypes + -- 78 NEWCONT6 < fn < shen.search-user-datatypes + -- 41 POPVAR < fn < shen.search-user-datatypes + -- 40 query_end < typecheck_native.lua:286 < pcall + -- 40 LOCKOPEN < fn < shen.search-user-datatypes + -- 35 CAR < fn < shen.search-user-datatypes + -- 29 CDR < fn < shen.search-user-datatypes + -- 24 materialize < materialize < materialize + -- 20 INCINFS < fn < shen.search-user-datatypes + -- 19 materialize < MAT < thawH + -- 17 NEWCONT7 < fn < shen.search-user-datatypes + -- 14 fn < shen.search-user-datatypes < thawH + -- 11 LZD < thawH < THAW + -- 11 shen.consume3853 < fn < shen.search-user-datatypes + -- 10 shen.consume3653 < fn < shen.search-user-datatypes + -- 10 NEWCONT5 < THAW < shen.system-S + -- 10 shen.consume3538 < fn < shen.search-user-datatypes + -- 10 MAT < thawH < THAW + -- 10 incinfs < shen.search-user-datatypes < thawH + -- 9 shen.consume3167 < fn < shen.search-user-datatypes + -- 9 thawH < THAW < THAW + -- 9 car < shen.search-user-datatypes < thawH + -- 9 CONS < thawH < THAW + -- 8 INCINFS < thawH < THAW + -- 8 shen.consume4053 < fn < shen.search-user-datatypes + -- 8 lazyderef < shen.search-user-datatypes < thawH + -- 8 NEWCONT5 < fn < shen.search-user-datatypes + -- 8 shen.consume3067 < fn < shen.search-user-datatypes + -- 8 shen.consume4214 < fn < shen.search-user-datatypes + -- 7 shen.consume3753 < fn < shen.search-user-datatypes + -- 7 NEWCONT5 < thawH < THAW + -- 7 cdr < shen.search-user-datatypes < thawH + -- 6 MKFUN < shen.lua-guard-51 < LF1 + -- 6 THAW < THAW < shen.system-S + -- 5 shen.consume3423 < fn < shen.search-user-datatypes + -- 5 THAW < LF7 < THAW + -- 5 NEWCONT5 < THAW < THAW + -- 5 LOCKOPEN < thawH < THAW + -- 5 atomval < shen.search-user-datatypes < thawH + 852 Garbage Collector + -- 852 typecheck_specialization.lua:0 < @0x01020b5ed4 + 194 C code + -- 151 shen.lua-guard-51 < LF1 < fn + -- 22 typecheck_specialization.lua:0 < @0x01020b5ed4 + -- 8 LZD < fn < shen.search-user-datatypes + -- 6 LZD < THAW < LF12 + -- 2 MAT < thawH < THAW + -- 2 materialize < materialize < materialize + -- 1 LZD < shen.consume4214 < fn + -- 1 materialize < MAT < thawH + -- 1 BIND1 < fn < shen.search-user-datatypes + 92 JIT Compiler + -- 10 fn < shen.search-user-datatypes < thawH + -- 6 CAR < fn < shen.search-user-datatypes + -- 5 LZD < fn < shen.search-user-datatypes + -- 4 shen.system-S < thawH < BIND1 + -- 4 NEWCONT6 < fn < shen.search-user-datatypes + -- 3 NEWVAR < fn < shen.search-user-datatypes + -- 2 THAW < shen.system-S < LF1 + -- 2 THAW < THAW < shen.system-S + -- 2 incinfs < shen.search-user-datatypes < thawH + -- 2 LF12 < LF10 < THAW + -- 2 mkcons < import < import + -- 2 CDR < fn < shen.search-user-datatypes + -- 2 CONS < LF12 < LF10 + -- 2 shen.lua-guard-51 < LF1 < fn + -- 2 shen.search-user-datatypes < thawH < THAW + -- 2 fn < shen.search-user-datatypes < LF12 + -- 1 shen.consume3653 < fn < shen.search-user-datatypes + -- 1 query_end < typecheck_native.lua:286 < pcall + -- 1 shen.l-rules < thawH < THAW + -- 1 THAW < THAW < LF1 + -- 1 materialize < materialize < materialize + -- 1 LF11 < fn < shen.search-user-datatypes + -- 1 THAW < LF12 < LF10 + -- 1 POPVAR < fn < shen.search-user-datatypes + -- 1 NEWCONT7 < fn < shen.search-user-datatypes + -- 1 LOCKOPEN < shen.consume4141 < fn + -- 1 MKFUN < shen.lua-guard-51 < LF1 + -- 1 CONS < thawH < THAW + -- 1 fn < shen.search-user-datatypes < THAW + -- 1 THAW < shen.system-S < LF3 + -- 1 thawH < THAW < THAW + -- 1 lazyderef < shen.search-user-datatypes < THAW + -- 1 MAT < LF1 < fn + -- 1 LF1 < fn < shen.search-user-datatypes + -- 1 import < import < imp + -- 1 import < import < IMP + -- 1 import < import < import + -- 1 THAW < LF1 < fn + -- 1 THAW < thawH < THAW + -- 1 query < typecheck_specialization.lua:0 < @0x01020b5ed4 + -- 1 LOCKOPEN < fn < shen.search-user-datatypes + -- 1 thawH < BIND1 < fn + -- 1 NEWVAR < LF12 < LF10 + -- 1 shen.system-S < LF1 < fn + -- 1 LF36 < fn < shen.search-user-datatypes + -- 1 THAW < LF7 < THAW + -- 1 typecheck_specialization.lua:0 < @0x01020b5ed4 + -- 1 lazyderef < materialize < materialize + -- 1 incinfs < shen.search-user-datatypes < LF12 + -- 1 thawH < BIND1 < thawH + -- 1 [string]:10 < APP < f1 + -- 1 MAT < thawH < BIND1 + -- 1 LZD < shen.consume3753 < fn + -- 1 shen.system-S < LF36 < fn + -- 1 shen.system-S < LF3 < fn + -- 1 LZD < THAW < LF12 diff --git a/bench/results/typecheck-record-ab.json b/bench/results/typecheck-record-ab.json new file mode 100644 index 0000000..44697b2 --- /dev/null +++ b/bench/results/typecheck-record-ab.json @@ -0,0 +1,14 @@ +[ +{"round":0,"mode":"default","samples":[{"sample":"1","seconds":"0.106223","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.057219","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.058213","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.060349","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.058143","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.056422","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.052303","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.051408","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.052685","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.057535","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.057521","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.053177","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.052931000000000006}, +{"round":0,"mode":"8000","samples":[{"sample":"1","seconds":"0.105676","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.046559","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.045832","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.046628","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.046457","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.050572","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.044642","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.049702","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.046707","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.044453","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.043846","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.044232","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.044547500000000004}, +{"round":0,"mode":"16000","samples":[{"sample":"1","seconds":"0.137206","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.095812","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.097911","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.098550","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.099893","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.099766","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.093118","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.090094","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.096278","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.095225","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.096232","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.093556","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.0943905}, +{"round":1,"mode":"8000","samples":[{"sample":"1","seconds":"0.341691","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.194320","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.136071","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.131938","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.123552","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.136782","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.133124","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.126221","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.132305","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.128186","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.120252","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.126107","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.1272035}, +{"round":1,"mode":"16000","samples":[{"sample":"1","seconds":"0.113001","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.059068","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.059657","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.059886","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.061612","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.057381","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.054819","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.055256","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.059948","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.060092","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.053924","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.057391","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.0563235}, +{"round":1,"mode":"default","samples":[{"sample":"1","seconds":"0.117405","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.075326","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.077952","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.082046","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.079055","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.077903","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.072500","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.077817","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.077203","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.076004","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.084239","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.077471","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.07733699999999999}, +{"round":2,"mode":"16000","samples":[{"sample":"1","seconds":"0.112330","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.045491","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.044211","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.047764","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.045682","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.045979","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.043792","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.038047","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.042973","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.045343","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.048065","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.046686","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.044567499999999996}, +{"round":2,"mode":"default","samples":[{"sample":"1","seconds":"0.094506","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.047935","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.050026","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.052345","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.050138","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.048953","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.048893","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.049554","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.047108","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.049687","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.052874","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.051133","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.0496205}, +{"round":2,"mode":"8000","samples":[{"sample":"1","seconds":"0.313993","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.162496","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.156608","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.156147","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.154229","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.153795","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.151996","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.154737","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.151658","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.155095","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.155162","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.155937","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.154916}, +{"round":3,"mode":"default","samples":[{"sample":"1","seconds":"0.103870","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.068207","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.064682","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.071469","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.073377","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.069416","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.071946","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.068895","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.071133","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.073175","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.071889","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.069210","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.07151099999999999}, +{"round":3,"mode":"8000","samples":[{"sample":"1","seconds":"0.231244","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.143352","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.139560","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.144815","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.148769","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.137208","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.144887","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.142485","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.146572","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.146573","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.142131","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.143169","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.144028}, +{"round":3,"mode":"16000","samples":[{"sample":"1","seconds":"0.108590","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"2","seconds":"0.055119","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"3","seconds":"0.056283","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"4","seconds":"0.066593","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"5","seconds":"0.057584","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"6","seconds":"0.055801","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"7","seconds":"0.049726","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"8","seconds":"0.052704","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"9","seconds":"0.047755","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"10","seconds":"0.051358","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"11","seconds":"0.049493","infs":"431741","jit":"true","semantic":"(listl-formula)"},{"sample":"12","seconds":"0.050521","infs":"431741","jit":"true","semantic":"(listl-formula)"}],"median":0.0501235} +] diff --git a/bench/results/typecheck-record-ab.txt b/bench/results/typecheck-record-ab.txt new file mode 100644 index 0000000..12b7d0c --- /dev/null +++ b/bench/results/typecheck-record-ab.txt @@ -0,0 +1,15 @@ +0 default 0.052931000000000006 +0 8000 0.044547500000000004 +0 16000 0.0943905 +1 8000 0.1272035 +1 16000 0.0563235 +1 default 0.07733699999999999 +2 16000 0.044567499999999996 +2 default 0.0496205 +2 8000 0.154916 +3 default 0.07151099999999999 +3 8000 0.144028 +3 16000 0.0501235 +default 0.062221 [0.052931000000000006, 0.07733699999999999, 0.0496205, 0.07151099999999999] +8000 0.13561574999999998 [0.044547500000000004, 0.1272035, 0.154916, 0.144028] +16000 0.0532235 [0.0943905, 0.0563235, 0.044567499999999996, 0.0501235] diff --git a/bench/results/typecheck-traces.txt b/bench/results/typecheck-traces.txt new file mode 100644 index 0000000..e533e37 --- /dev/null +++ b/bench/results/typecheck-traces.txt @@ -0,0 +1,508 @@ +[TRACE 1 runtime.lua:22 return] +[TRACE 2 runtime.lua:42 return] +[TRACE 3 prims.lua:732 loop] +[TRACE --- (3/10) prims.lua:185 -- NYI: bytecode FNEW at "t-star":10] +[TRACE --- (3/10) prims.lua:185 -- NYI: bytecode FNEW at "t-star":10] +[TRACE --- (3/10) prims.lua:185 -- NYI: bytecode FNEW at "t-star":10] +[TRACE --- (3/10) prims.lua:185 -- NYI: bytecode FNEW at "t-star":10] +[TRACE 4 (3/10) prims.lua:185 -- fallback to interpreter] +[TRACE 5 prims.lua:1928 return] +[TRACE 6 prolog_engine.lua:179 return] +[TRACE 7 prolog_engine.lua:543 loop] +[TRACE --- prolog_engine.lua:539 -- inner loop in root trace at prolog_engine.lua:544] +[TRACE 8 (7/2) prolog_engine.lua:543 -> 7] +[TRACE 9 (7/3) prolog_engine.lua:544 -> 7] +[TRACE --- prolog_engine.lua:548 -- leaving loop in root trace at prolog_engine.lua:551] +[TRACE --- prolog_engine.lua:548 -- leaving loop in root trace at prolog_engine.lua:551] +[TRACE 10 prolog_engine.lua:621 loop] +[TRACE 11 (10/4) prolog_engine.lua:197 -> 10] +[TRACE 12 (10/12) prolog_engine.lua:615 -> 10] +[TRACE 13 (10/11) prolog_engine.lua:197 -> 10] +[TRACE --- (10/1) prolog_engine.lua:201 -- blacklisted at runtime.lua:41] +[TRACE --- (10/1) prolog_engine.lua:201 -- blacklisted at runtime.lua:41] +[TRACE --- (10/1) prolog_engine.lua:201 -- blacklisted at runtime.lua:41] +[TRACE --- (10/1) prolog_engine.lua:201 -- blacklisted at runtime.lua:41] +[TRACE 14 (10/1) prolog_engine.lua:201 -- fallback to interpreter] +[TRACE --- (10/8) prolog_engine.lua:201 -- blacklisted at runtime.lua:41] +[TRACE --- (10/8) prolog_engine.lua:201 -- blacklisted at runtime.lua:41] +[TRACE --- (10/8) prolog_engine.lua:201 -- blacklisted at runtime.lua:41] +[TRACE 15 prolog_engine.lua:527 return] +[TRACE --- (10/8) prolog_engine.lua:201 -- blacklisted at runtime.lua:41] +[TRACE 16 (10/8) prolog_engine.lua:201 -- fallback to interpreter] +[TRACE 17 prolog_engine.lua:196 return] +[TRACE 18 (17/1) prolog_engine.lua:197 -> 10] +[TRACE 19 (18/2) prolog_engine.lua:201 -> 7] +[TRACE --- prolog_engine.lua:197 -- leaving loop in root trace at prolog_engine.lua:201] +[TRACE --- (19/1) prolog_engine.lua:201 -- trace too long at prolog_engine.lua:159] +[TRACE 20 prolog_engine.lua:157 return] +[TRACE --- (19/1) prolog_engine.lua:201 -- trace too long at prolog_engine.lua:197] +[TRACE --- (19/1) prolog_engine.lua:201 -- trace too long at prolog_engine.lua:197] +[TRACE --- (19/1) prolog_engine.lua:201 -- trace too long at prolog_engine.lua:198] +[TRACE 21 (19/1) prolog_engine.lua:201 -- fallback to interpreter] +[TRACE 22 prolog_engine.lua:152 return] +[TRACE 23 prolog_engine.lua:175 return] +[TRACE 24 prolog_engine.lua:355 return] +[TRACE 25 prolog_engine.lua:502 return] +[TRACE --- prolog:shen.primitive:57 -- inner loop in root trace at prolog_engine.lua:622] +[TRACE 26 prolog_engine.lua:189 return] +[TRACE 27 (12/0) prolog_engine.lua:615 -> 10] +[TRACE 28 prims.lua:1914 return] +[TRACE 29 prolog_engine.lua:190 return] +[TRACE 30 prolog_engine.lua:220 return] +[TRACE 31 (18/1) prolog_engine.lua:197 -> 10] +[TRACE --- (25/0) prolog_engine.lua:502 -- trace too long at prolog_engine.lua:159] +[TRACE 32 prolog_engine.lua:576 return] +[TRACE --- (25/0) prolog_engine.lua:502 -- loop unroll limit reached at "shen:shen.lua-guard-24":1] +[TRACE --- (25/0) prolog_engine.lua:502 -- loop unroll limit reached at "shen:shen.lua-guard-24":1] +[TRACE 33 "shen:shen.lua-guard-25":1 return] +[TRACE --- (25/0) prolog_engine.lua:502 -- loop unroll limit reached at "shen:shen.lua-guard-24":1] +[TRACE 34 (25/0) prolog_engine.lua:502 -- fallback to interpreter] +[TRACE --- typecheck_native.lua:249 -- inner loop in root trace at prolog_engine.lua:198] +[TRACE 35 prolog:shen.by-hypothesis:39 return] +[TRACE 36 prolog_engine.lua:270 return] +[TRACE --- prolog:shen.system-S:29 -- inner loop in root trace at prolog_engine.lua:622] +[TRACE 37 (19/42) prims.lua:1950 -> 10] +[TRACE 38 prolog:shen.consume3953:85 return] +[TRACE 39 prims.lua:1948 return] +[TRACE --- (18/27) prolog_engine.lua:201 -- trace too long at prolog_engine.lua:197] +[TRACE 40 prolog_engine.lua:612 return] +[TRACE --- (18/27) prolog_engine.lua:201 -- trace too long at prolog_engine.lua:527] +[TRACE --- (31/3) prolog_engine.lua:201 -- trace too long at prolog_engine.lua:221] +[TRACE 41 prolog_engine.lua:260 return] +[TRACE --- (31/3) prolog_engine.lua:201 -- loop unroll limit reached at prolog:shen.system-S:35] +[TRACE --- (18/27) prolog_engine.lua:201 -- trace too long at prolog:shen.system-S-h:712] +[TRACE 42 (18/27) prolog_engine.lua:201 -> 10] +[TRACE 43 typecheck_native.lua:249 return] +[TRACE 44 (39/0) prims.lua:1949 -> 10] +[TRACE --- (43/1) prolog_engine.lua:197 -- trace too long] +[TRACE --- (31/3) prolog_engine.lua:201 -- trace too deep at prolog:shen.l-rules:137] +[TRACE --- (43/1) prolog_engine.lua:197 -- loop unroll limit reached at "shen:shen.lua-guard-25":1] +[TRACE --- (43/1) prolog_engine.lua:197 -- loop unroll limit reached at typecheck_native.lua:268] +[TRACE 45 (43/1) prolog_engine.lua:197 -> 10] +[TRACE 46 runtime.lua:70 return] +[TRACE 47 prolog:pattern#type:112 return] +[TRACE --- (45/13) prolog_engine.lua:527 -- trace too long at prolog_engine.lua:197] +[TRACE 48 prolog_engine.lua:590 return] +[TRACE --- (45/13) prolog_engine.lua:527 -- trace too long at prolog_engine.lua:197] +[TRACE --- (45/13) prolog_engine.lua:527 -- trace too long at prolog_engine.lua:197] +[TRACE --- (45/13) prolog_engine.lua:527 -- trace too long] +[TRACE 49 prolog:shen.consume4214:85 return] +[TRACE 50 prolog_engine.lua:517 return] +[TRACE 51 (45/13) prolog_engine.lua:527 -- fallback to interpreter] +[TRACE 52 prolog_engine.lua:212 up-recursion] +[TRACE 53 (42/107) prolog:primitive-object#type:224 -> 52] +[TRACE 54 (52/0) prolog_engine.lua:213 -> 10] +[TRACE 55 prolog_engine.lua:280 return] +[TRACE --- (50/0) prolog_engine.lua:518 -- trace too long at prolog:l-formula#type:1965] +[TRACE 56 (50/0) prolog_engine.lua:518 -> 52] +[TRACE 57 (54/0) prolog_engine.lua:213 -> 52] +[TRACE 58 (40/1) prolog_engine.lua:197 -> 10] +[TRACE 59 prolog:shen.consume3538:100 return] +[TRACE 60 (57/0) prolog_engine.lua:213 -> 52] +[TRACE 61 prolog:shen.consume3853:85 return] +[TRACE --- (53/47) prolog:pattern#type:133 -- trace too long at prolog_engine.lua:221] +[TRACE 62 (56/1) prolog_engine.lua:521 -> 52] +[TRACE --- (53/47) prolog:pattern#type:133 -- trace too long at prolog_engine.lua:221] +[TRACE 63 "shen:shen.lua-guard-6":1 return] +[TRACE 64 (54/3) prolog_engine.lua:201 -> 52] +[TRACE 65 (53/47) prolog:pattern#type:133 -> 52] +[TRACE 66 (62/9) prolog:shen.system-S:150 -> 52] +[TRACE 67 prolog:shen.consume3423:100 return] +[TRACE --- prolog:primitive-object#type:21 -- inner loop in root trace at prolog_engine.lua:622] +[TRACE 68 (57/102) prolog:primitive-object#type:173 -> 52] +[TRACE 69 "shen:shen.lua-guard-12":1 return] +[TRACE 70 (66/1) prolog:shen.system-S:150 -> 52] +[TRACE 71 (64/2) prolog_engine.lua:615 -> 52] +[TRACE --- (65/15) prolog_engine.lua:201 -- trace too long at prolog_engine.lua:197] +[TRACE --- (65/15) prolog_engine.lua:201 -- trace too long at prolog_engine.lua:197] +[TRACE --- (65/15) prolog_engine.lua:201 -- trace too long at prolog_engine.lua:197] +[TRACE --- (45/27) prolog:primitive-object#type:173 -- trace too long at prolog_engine.lua:197] +[TRACE 72 (70/1) prolog:shen.system-S:150 -> 52] +[TRACE 73 (60/0) prolog_engine.lua:213 -> 52] +[TRACE --- (31/2) prolog_engine.lua:197 -- trace too long at prolog:l-formula#type:641] +[TRACE --- (45/27) prolog:primitive-object#type:173 -- trace too long at prolog_engine.lua:159] +[TRACE --- (45/27) prolog:primitive-object#type:173 -- trace too long at prolog_engine.lua:159] +[TRACE --- (47/15) prolog_engine.lua:201 -- trace too long at prolog_engine.lua:527] +[TRACE 74 (65/15) prolog_engine.lua:201 -> 52] +[TRACE 75 (42/106) prolog:primitive-object#type:171 -> 10] +[TRACE --- (42/79) prolog:num#type:59 -- trace too long at prolog_engine.lua:177] +[TRACE --- (72/1) prolog:shen.system-S:150 -- trace too long at prolog_engine.lua:197] +[TRACE --- (72/1) prolog:shen.system-S:150 -- trace too long at prolog_engine.lua:197] +[TRACE 76 (72/1) prolog:shen.system-S:150 -> 52] +[TRACE --- (47/15) prolog_engine.lua:201 -- trace too long at prolog_engine.lua:527] +[TRACE --- (31/2) prolog_engine.lua:197 -- trace too long at prolog:l-formula#type:641] +[TRACE 77 prolog:shen.consume3653:85 return] +[TRACE --- (47/15) prolog_engine.lua:201 -- trace too long at prolog_engine.lua:527] +[TRACE --- (31/2) prolog_engine.lua:197 -- trace too long at prolog:l-formula#type:641] +[TRACE --- (62/2) prolog:shen.system-S-h:1694 -- trace too long at prolog_engine.lua:284] +[TRACE --- (62/2) prolog:shen.system-S-h:1694 -- trace too long at prolog_engine.lua:197] +[TRACE --- (62/2) prolog:shen.system-S-h:1694 -- trace too long at prolog_engine.lua:177] +[TRACE --- (56/101) prolog:pattern#type:133 -- trace too long at prolog_engine.lua:167] +[TRACE --- (56/101) prolog:pattern#type:133 -- trace too long at prolog_engine.lua:167] +[TRACE 78 prolog:shen.l-rules:137 return] +[TRACE --- (45/27) prolog:primitive-object#type:173 -- trace too long at prolog_engine.lua:159] +[TRACE --- (47/15) prolog_engine.lua:201 -- trace too long at prolog_engine.lua:527] +[TRACE 79 prolog:shen.consume4141:72 return] +[TRACE 80 (45/27) prolog:primitive-object#type:173 -- fallback to interpreter] +[TRACE 81 (47/15) prolog_engine.lua:201 -- fallback to interpreter] +[TRACE 82 prolog:num#type:40 return] +[TRACE --- (76/1) prolog:shen.system-S:150 -- trace too long at prolog_engine.lua:197] +[TRACE --- (76/1) prolog:shen.system-S:150 -- trace too long at prolog:l-formula#type:1891] +[TRACE --- (76/1) prolog:shen.system-S:150 -- trace too long at prolog_engine.lua:197] +[TRACE --- (76/1) prolog:shen.system-S:150 -- trace too long at prolog_engine.lua:283] +[TRACE --- (42/79) prolog:num#type:59 -- trace too long at prolog_engine.lua:177] +[TRACE 83 (76/1) prolog:shen.system-S:150 -- fallback to interpreter] +[TRACE --- (42/79) prolog:num#type:59 -- trace too long at prolog_engine.lua:177] +[TRACE 84 (68/46) prolog:pattern#type:131 -> 52] +[TRACE 85 (68/16) prolog:primitive-object#type:222 -> 52] +[TRACE 86 (57/5) prolog:shen.primitive:204 -> 52] +[TRACE --- (57/1) prolog_engine.lua:197 -- loop unroll limit reached at typecheck_native.lua:268] +[TRACE --- (31/2) prolog_engine.lua:197 -- trace too long] +[TRACE --- (62/2) prolog:shen.system-S-h:1694 -- trace too long at prolog_engine.lua:197] +[TRACE 87 (62/2) prolog:shen.system-S-h:1694 -- fallback to interpreter] +[TRACE 88 (57/1) prolog_engine.lua:197 -> 52] +[TRACE 89 (31/2) prolog_engine.lua:197 -- fallback to interpreter] +[TRACE --- (45/26) prolog_engine.lua:197 -- trace too long] +[TRACE --- (45/26) prolog_engine.lua:197 -- trace too long at prolog_engine.lua:177] +[TRACE 90 prolog:shen.consume3753:85 return] +[TRACE --- (74/104) prolog:l-formula#type:396 -- trace too long at typecheck_native.lua:268] +[TRACE --- (74/104) prolog:l-formula#type:396 -- trace too long at typecheck_native.lua:268] +[TRACE --- (74/104) prolog:l-formula#type:396 -- trace too long at typecheck_native.lua:268] +[TRACE --- (42/79) prolog:num#type:59 -- trace too long at prolog_engine.lua:177] +[TRACE --- (45/26) prolog_engine.lua:197 -- trace too long at prolog_engine.lua:177] +[TRACE --- (45/26) prolog_engine.lua:197 -- trace too long] +[TRACE 91 (45/26) prolog_engine.lua:197 -- fallback to interpreter] +[TRACE --- (47/13) prolog_engine.lua:197 -- trace too long at prolog_engine.lua:159] +[TRACE --- (47/13) prolog_engine.lua:197 -- trace too long] +[TRACE --- (47/13) prolog_engine.lua:197 -- trace too long at prolog_engine.lua:159] +[TRACE --- (47/13) prolog_engine.lua:197 -- trace too long at prolog_engine.lua:159] +[TRACE --- (57/4) prolog:shen.primitive:182 -- trace too long at prolog_engine.lua:284] +[TRACE --- (57/3) prolog:shen.primitive:160 -- trace too long at prolog_engine.lua:221] +[TRACE --- (57/2) prolog:shen.primitive:138 -- trace too long at prolog:l-formula#type:393] +[TRACE --- (57/4) prolog:shen.primitive:182 -- trace too long at prolog_engine.lua:284] +[TRACE --- (57/3) prolog:shen.primitive:160 -- trace too long at prolog_engine.lua:221] +[TRACE --- (57/2) prolog:shen.primitive:138 -- trace too long at prolog:l-formula#type:393] +[TRACE --- (57/4) prolog:shen.primitive:182 -- trace too long at prolog_engine.lua:284] +[TRACE --- (57/3) prolog:shen.primitive:160 -- trace too long at prolog_engine.lua:221] +[TRACE --- (57/2) prolog:shen.primitive:138 -- trace too long at prolog:l-formula#type:393] +[TRACE --- (57/4) prolog:shen.primitive:182 -- trace too long at prolog_engine.lua:284] +[TRACE --- (57/3) prolog:shen.primitive:160 -- trace too long at prolog_engine.lua:221] +[TRACE --- (57/2) prolog:shen.primitive:138 -- trace too long at prolog:l-formula#type:393] +[TRACE --- (76/7) prolog_engine.lua:201 -- trace too long at prolog_engine.lua:197] +[TRACE 92 (57/4) prolog:shen.primitive:182 -- fallback to interpreter] +[TRACE 93 (57/3) prolog:shen.primitive:160 -- fallback to interpreter] +[TRACE 94 (57/2) prolog:shen.primitive:138 -- fallback to interpreter] +[TRACE --- (76/7) prolog_engine.lua:201 -- too many snapshots at prolog_engine.lua:264] +[TRACE 95 (42/79) prolog:num#type:59 -- fallback to interpreter] +[TRACE --- (74/104) prolog:l-formula#type:396 -- trace too long at typecheck_native.lua:268] +[TRACE 96 (74/104) prolog:l-formula#type:396 -- fallback to interpreter] +[TRACE 97 prolog:l-formula#type:375 return] +[TRACE 98 (73/0) prolog_engine.lua:213 -> 52] +[TRACE 99 (47/13) prolog_engine.lua:197 -- fallback to interpreter] +[TRACE 100 (18/52) prolog_engine.lua:201 -> 52] +[TRACE --- prolog_engine.lua:197 -- leaving loop in root trace at prolog_engine.lua:201] +[TRACE --- (37/37) prolog_engine.lua:197 -- trace too long at prolog:l-formula#type:1281] +[TRACE --- (82/13) prolog_engine.lua:197 -- trace too long at prolog_engine.lua:527] +[TRACE --- (76/7) prolog_engine.lua:201 -- trace too long at prolog_engine.lua:197] +[TRACE --- (97/15) prolog_engine.lua:201 -- trace too long at prolog_engine.lua:592] +[TRACE --- (97/15) prolog_engine.lua:201 -- trace too long at prolog_engine.lua:592] +[TRACE --- (97/15) prolog_engine.lua:201 -- trace too long at prolog_engine.lua:592] +[TRACE --- (97/15) prolog_engine.lua:201 -- trace too long at prolog_engine.lua:197] +[TRACE 101 (97/15) prolog_engine.lua:201 -- fallback to interpreter] +[TRACE --- (76/7) prolog_engine.lua:201 -- trace too long at prolog_engine.lua:197] +[TRACE 102 (73/10) prolog_engine.lua:197 -> 10] +[TRACE --- (82/13) prolog_engine.lua:197 -- trace too long at prolog:l-formula#type:1632] +[TRACE --- (37/37) prolog_engine.lua:197 -- trace too long at prolog:l-formula#type:1281] +[TRACE --- (82/13) prolog_engine.lua:197 -- trace too long at prolog_engine.lua:527] +[TRACE --- (82/13) prolog_engine.lua:197 -- trace too long at prolog:l-formula#type:1632] +[TRACE --- (37/37) prolog_engine.lua:197 -- trace too long at prolog:l-formula#type:1281] +[TRACE 103 (82/13) prolog_engine.lua:197 -- fallback to interpreter] +[TRACE 104 (76/7) prolog_engine.lua:201 -- fallback to interpreter] +[TRACE --- (82/14) prolog:num#type:59 -- trace too long at prolog_engine.lua:197] +[TRACE --- (82/14) prolog:num#type:59 -- trace too long at prolog_engine.lua:197] +[TRACE 105 prolog:shen.consume3167:85 return] +[TRACE --- (57/110) runtime.lua:70 -- trace too long at prolog_engine.lua:197] +[TRACE 106 "sys":29 return] +[TRACE --- (57/110) runtime.lua:70 -- trace too long at prolog_engine.lua:197] +[TRACE --- (37/37) prolog_engine.lua:197 -- trace too long at prolog:l-formula#type:1281] +[TRACE 107 (37/37) prolog_engine.lua:197 -- fallback to interpreter] +[TRACE --- (97/13) prolog_engine.lua:197 -- trace too long at prolog:shen.system-S-h:1593] +[TRACE 108 prolog:shen.consume3067:85 return] +[TRACE --- (82/14) prolog:num#type:59 -- trace too long at prolog_engine.lua:197] +[TRACE --- (82/14) prolog:num#type:59 -- trace too long at prolog_engine.lua:197] +[TRACE --- (57/110) runtime.lua:70 -- trace too long at prolog_engine.lua:197] +[TRACE --- (88/1) prolog_engine.lua:197 -- loop unroll limit reached at typecheck_native.lua:268] +[TRACE --- (97/13) prolog_engine.lua:197 -- trace too long at prolog:shen.system-S-h:1593] +[TRACE --- (97/13) prolog_engine.lua:197 -- trace too long at prolog:shen.system-S-h:1694] +[TRACE --- (97/13) prolog_engine.lua:197 -- trace too long at typecheck_native.lua:253] +[TRACE --- (88/1) prolog_engine.lua:197 -- loop unroll limit reached at typecheck_native.lua:268] +[TRACE 109 (97/13) prolog_engine.lua:197 -- fallback to interpreter] +[TRACE 110 (82/14) prolog:num#type:59 -- fallback to interpreter] +[TRACE 111 "shen:shen.lua-guard-24":1 return] +[TRACE --- (57/110) runtime.lua:70 -- trace too long at prolog_engine.lua:197] +[TRACE 112 (57/110) runtime.lua:70 -- fallback to interpreter] +[TRACE --- (88/1) prolog_engine.lua:197 -- loop unroll limit reached at typecheck_native.lua:268] +[TRACE --- (88/1) prolog_engine.lua:197 -- loop unroll limit reached at typecheck_native.lua:268] +[TRACE 113 (88/1) prolog_engine.lua:197 -- fallback to interpreter] +[TRACE --- "shen:shen.lua-guard-51":1 -- NYI: bytecode FNEW at "sys":29] +[TRACE --- (47/24) prolog_engine.lua:197 -- trace too long] +[TRACE --- (65/119) prolog:l-formula#type:396 -- trace too long at typecheck_native.lua:268] +[TRACE --- (65/119) prolog:l-formula#type:396 -- trace too long at typecheck_native.lua:268] +[TRACE --- (65/119) prolog:l-formula#type:396 -- trace too long at typecheck_native.lua:268] +[TRACE --- (47/24) prolog_engine.lua:197 -- trace too long] +[TRACE --- (47/24) prolog_engine.lua:197 -- trace too long] +[TRACE --- prolog_engine.lua:197 -- leaving loop in root trace at prolog_engine.lua:201] +[TRACE 114 (40/2) prolog_engine.lua:615 -> 52] +[TRACE --- (47/24) prolog_engine.lua:197 -- trace too long] +[TRACE --- (65/119) prolog:l-formula#type:396 -- trace too long at typecheck_native.lua:268] +[TRACE 115 (65/119) prolog:l-formula#type:396 -- fallback to interpreter] +[TRACE 116 (47/24) prolog_engine.lua:197 -- fallback to interpreter] +[TRACE 117 "shen:shen.lua-guard-28":1 return] +[TRACE --- (97/24) prolog_engine.lua:197 -- trace too long at typecheck_native.lua:252] +[TRACE --- (97/24) prolog_engine.lua:197 -- trace too long at typecheck_native.lua:252] +[TRACE --- (97/24) prolog_engine.lua:197 -- trace too long at typecheck_native.lua:252] +[TRACE 118 "shen:shen.lua-guard-27":1 return] +[TRACE 119 prolog:num#type:21 return] +[TRACE 120 (98/0) prolog_engine.lua:213 -> 52] +[TRACE --- (97/24) prolog_engine.lua:197 -- trace too long at typecheck_native.lua:252] +[TRACE 121 (97/24) prolog_engine.lua:197 -- fallback to interpreter] +[TRACE --- "sys":29 -- NYI: bytecode FNEW ] +[TRACE 122 prims.lua:280 return] +[TRACE 123 prolog:shen.primitive:33 return] +[TRACE 124 prolog:shen.primitive:21 return] +[TRACE --- prolog_engine.lua:197 -- leaving loop in root trace at prolog_engine.lua:201] +[TRACE 125 prims.lua:108 return] +[TRACE --- (46/0) runtime.lua:70 -- trace too long at prolog_engine.lua:284] +[TRACE 126 prolog:shen.primitive:45 return] +[TRACE --- (126/3) prolog_engine.lua:615 -- trace too long at prolog:l-formula#type:641] +[TRACE --- (126/3) prolog_engine.lua:615 -- trace too long at prolog:l-formula#type:641] +[TRACE --- (126/3) prolog_engine.lua:615 -- trace too long at prolog:l-formula#type:641] +[TRACE --- (126/3) prolog_engine.lua:615 -- trace too long at prolog:l-formula#type:641] +[TRACE 127 prolog:shen.system-S:54 -> 52] +[TRACE 128 (126/3) prolog_engine.lua:615 -- fallback to interpreter] +[TRACE --- "sys":29 -- NYI: bytecode FNEW ] +[TRACE --- (46/0) runtime.lua:70 -- NYI: bytecode UCLO at "sys":29] +[TRACE --- (46/0) runtime.lua:70 -- trace too long at prolog_engine.lua:284] +[TRACE 129 (120/0) prolog_engine.lua:213 -> 127] +[TRACE --- prims.lua:870 -- NYI: bytecode FNEW at "sys":29] +[TRACE 130 (76/16) prolog_engine.lua:197 -> 127] +[TRACE 131 "sys":29 return] +[TRACE --- (97/25) prolog:l-formula#type:444 -- trace too long at prolog_engine.lua:177] +[TRACE --- (97/25) prolog:l-formula#type:444 -- trace too long at prolog_engine.lua:177] +[TRACE --- (97/25) prolog:l-formula#type:444 -- trace too long at prolog_engine.lua:177] +[TRACE --- (97/245) prolog:l-formula#type:1472 -- trace too long at prolog_engine.lua:284] +[TRACE --- (97/245) prolog:l-formula#type:1472 -- trace too long at prolog:l-formula#type:1252] +[TRACE --- (46/0) runtime.lua:70 -- NYI: bytecode UCLO at "sys":29] +[TRACE 132 (46/0) runtime.lua:70 -- fallback to interpreter] +[TRACE --- prolog_engine.lua:633 -- leaving loop in root trace at prolog_engine.lua:636] +[TRACE --- prolog_engine.lua:633 -- blacklisted at runtime.lua:41] +[TRACE --- prolog_engine.lua:633 -- blacklisted at runtime.lua:41] +[TRACE --- prolog_engine.lua:633 -- blacklisted at runtime.lua:41] +[TRACE --- prolog_engine.lua:633 -- blacklisted at runtime.lua:41] +[TRACE --- "shen:shen.lua-guard-51":1 -- NYI: bytecode FNEW at "sys":29] +[TRACE --- prolog_engine.lua:633 -- leaving loop in root trace at prolog_engine.lua:636] +[TRACE --- prolog_engine.lua:197 -- leaving loop in root trace at prolog_engine.lua:201] +[TRACE --- prolog_engine.lua:633 -- blacklisted at runtime.lua:41] +[TRACE --- (97/300) prolog_engine.lua:197 -- trace too long at prolog:l-formula#type:870] +[TRACE --- (97/300) prolog_engine.lua:197 -- trace too long at prolog_engine.lua:177] +[TRACE --- (97/25) prolog:l-formula#type:444 -- trace too long at prolog_engine.lua:177] +[TRACE 133 (97/25) prolog:l-formula#type:444 -- fallback to interpreter] +[TRACE 134 (97/245) prolog:l-formula#type:1472 -> 127] +[TRACE --- (57/109) prolog_engine.lua:615 -- NYI: bytecode UCLO at "sys":29] +[TRACE --- prolog_engine.lua:633 -- leaving loop in root trace at prolog_engine.lua:636] +[TRACE --- prims.lua:870 -- NYI: bytecode FNEW at "sys":29] +[TRACE --- "sys":29 -- NYI: bytecode FNEW ] +[TRACE 135 "sys":29 return] +[TRACE --- (57/109) prolog_engine.lua:615 -- NYI: bytecode UCLO at "sys":29] +[TRACE --- (86/3) prolog_engine.lua:615 -- trace too long at prolog:l-formula#type:641] +[TRACE 136 (129/0) prolog_engine.lua:213 -> 127] +[TRACE 137 prims.lua:100 return] +[TRACE --- (57/109) prolog_engine.lua:615 -- NYI: bytecode UCLO at "sys":29] +[TRACE --- (86/3) prolog_engine.lua:615 -- trace too long at prolog:l-formula#type:641] +[TRACE 138 (97/300) prolog_engine.lua:197 -> 127] +[TRACE --- prolog_engine.lua:633 -- blacklisted at runtime.lua:41] +[TRACE --- (57/109) prolog_engine.lua:615 -- NYI: bytecode UCLO at "sys":29] +[TRACE --- (86/3) prolog_engine.lua:615 -- trace too long at prolog:l-formula#type:641] +[TRACE --- (118/0) "shen:shen.lua-guard-27":1 -- trace too long at prolog_engine.lua:284] +[TRACE 139 (57/109) prolog_engine.lua:615 -- fallback to interpreter] +[TRACE --- (86/3) prolog_engine.lua:615 -- trace too long at prolog:l-formula#type:641] +[TRACE --- (123/3) prolog_engine.lua:615 -- trace too long at prolog_engine.lua:284] +[TRACE 140 (124/3) prolog_engine.lua:615 -> 52] +[TRACE --- (134/233) prolog:shen.system-S:150 -- trace too long at prolog_engine.lua:197] +[TRACE 141 (134/233) prolog:shen.system-S:150 -> 127] +[TRACE 142 (86/3) prolog_engine.lua:615 -- fallback to interpreter] +[TRACE --- (123/3) prolog_engine.lua:615 -- trace too long at prolog_engine.lua:284] +[TRACE --- (123/3) prolog_engine.lua:615 -- trace too long at prolog_engine.lua:284] +[TRACE --- "shen:shen.lua-guard-51":1 -- NYI: bytecode FNEW at "sys":29] +[TRACE --- prolog_engine.lua:197 -- leaving loop in root trace at prolog_engine.lua:201] +[TRACE 143 (136/0) prolog_engine.lua:213 -> 127] +[TRACE --- prolog_engine.lua:633 -- blacklisted at runtime.lua:41] +[TRACE --- (138/179) prolog:shen.system-S:150 -- trace too long at prolog_engine.lua:197] +[TRACE --- (138/179) prolog:shen.system-S:150 -- trace too long at prolog_engine.lua:181] +[TRACE --- (106/0) "sys":29 -- NYI: bytecode UCLO ] +[TRACE --- (123/3) prolog_engine.lua:615 -- trace too long at prolog_engine.lua:284] +[TRACE --- (125/0) prims.lua:108 -- NYI: bytecode UCLO at "sys":29] +[TRACE --- (31/3) prolog_engine.lua:201 -- trace too long at prolog_engine.lua:183] +[TRACE --- (106/0) "sys":29 -- NYI: bytecode UCLO ] +[TRACE 144 (123/3) prolog_engine.lua:615 -- fallback to interpreter] +[TRACE --- (118/0) "shen:shen.lua-guard-27":1 -- trace too long at prolog_engine.lua:284] +[TRACE 145 (31/3) prolog_engine.lua:201 -- fallback to interpreter] +[TRACE --- (106/0) "sys":29 -- NYI: bytecode UCLO ] +[TRACE --- (118/0) "shen:shen.lua-guard-27":1 -- trace too long at prolog_engine.lua:284] +[TRACE --- (125/0) prims.lua:108 -- NYI: bytecode UCLO at "sys":29] +[TRACE --- (106/0) "sys":29 -- NYI: bytecode UCLO ] +[TRACE --- (118/0) "shen:shen.lua-guard-27":1 -- trace too long at prolog_engine.lua:284] +[TRACE 146 (106/0) "sys":29 -- fallback to interpreter] +[TRACE 147 (118/0) "shen:shen.lua-guard-27":1 -- fallback to interpreter] +[TRACE 148 (31/4) prolog:primitive-object#type:377 -> 127] +[TRACE --- prims.lua:870 -- NYI: bytecode FNEW at "sys":29] +[TRACE --- "sys":29 -- NYI: bytecode FNEW ] +[TRACE --- (125/0) prims.lua:108 -- NYI: bytecode UCLO at "sys":29] +[TRACE --- (125/0) prims.lua:108 -- NYI: bytecode UCLO at "sys":29] +[TRACE 149 "shen:shen.lua-guard-29":1 return] +[TRACE --- (138/179) prolog:shen.system-S:150 -- trace too long at prolog_engine.lua:197] +[TRACE --- (138/179) prolog:shen.system-S:150 -- trace too long at prolog_engine.lua:181] +[TRACE 150 (76/17) prolog:l-formula#type:444 -> 127] +[TRACE 151 (125/0) prims.lua:108 -- fallback to interpreter] +[TRACE 152 (143/0) prolog_engine.lua:213 -> 127] +[TRACE 153 (138/179) prolog:shen.system-S:150 -- fallback to interpreter] +[TRACE --- (141/1) prolog:shen.system-S:150 -- trace too long at prolog_engine.lua:159] +[TRACE --- "shen:shen.lua-guard-51":1 -- NYI: bytecode FNEW at "sys":29] +[TRACE --- prolog_engine.lua:197 -- leaving loop in root trace at prolog_engine.lua:201] +[TRACE --- prims.lua:870 -- NYI: bytecode UCLO at "sys":29] +[TRACE --- (141/1) prolog:shen.system-S:150 -- trace too long at prolog_engine.lua:197] +[TRACE --- prolog_engine.lua:633 -- blacklisted at runtime.lua:41] +[TRACE 154 prolog:shen.consume4053:85 return] +[TRACE --- (141/1) prolog:shen.system-S:150 -- trace too long at prolog_engine.lua:197] +[TRACE --- "sys":29 -- NYI: bytecode UCLO ] +[TRACE --- (141/1) prolog:shen.system-S:150 -- trace too long at prolog_engine.lua:197] +[TRACE 155 (31/1) prolog_engine.lua:201 -> 52] +[TRACE 156 (141/1) prolog:shen.system-S:150 -- fallback to interpreter] +[TRACE 157 (152/0) prolog_engine.lua:213 -> 10] +[TRACE 158 prolog_engine.lua:688 loop] +[TRACE 159 (46/1) runtime.lua:70 stitch string.gsub] +[TRACE --- "t-star":11 -- inner loop in root trace at prims.lua:733] +[TRACE --- "t-star":10 -- inner loop in root trace at prims.lua:733] +[TRACE 160 (44/0) prims.lua:1949 -> 3] +[TRACE 161 "t-star":10 return] +[TRACE 162 (8/7) prolog_engine.lua:540 -> 7] +[TRACE 163 prolog_engine.lua:548 loop] +[TRACE 164 prolog_engine.lua:484 -> 52] +[TRACE 165 (157/0) prolog_engine.lua:213 -> 164] +[TRACE 166 (18/28) prolog_engine.lua:197 -> 127] +[TRACE 167 (155/1) prolog_engine.lua:201 -> 164] +[TRACE 168 (165/0) prolog_engine.lua:213 -> 127] +[TRACE 169 prolog_engine.lua:251 return] +[TRACE --- "shen:shen.lua-guard-51":1 -- NYI: bytecode FNEW at "sys":29] +[TRACE --- prims.lua:870 -- NYI: bytecode FNEW at "sys":29] +[TRACE --- prolog_engine.lua:197 -- leaving loop in root trace at prolog_engine.lua:201] +[TRACE 170 "sys":29 return] +[TRACE --- "sys":29 -- NYI: bytecode FNEW ] +[TRACE 171 (168/0) prolog_engine.lua:213 -> 127] +[TRACE 172 (159/stitch) typecheck_specialization.lua:15 stitch os.clock] +[TRACE 173 (161/1) "t-star":10 -> 3] +[TRACE 174 prims.lua:1929 return] +[TRACE --- "t-star":10 -- NYI: bytecode UCLO ] +[TRACE 175 (163/9) prolog_engine.lua:551 -> 163] +[TRACE 176 (163/17) prolog_engine.lua:551 -> 163] +[TRACE 177 (32/0) prolog_engine.lua:577 -> 127] +[TRACE 178 (167/1) prolog_engine.lua:201 -> 164] +[TRACE 179 (171/0) prolog_engine.lua:213 -> 52] +[TRACE 180 (163/1) prolog_engine.lua:540 -> 7] +[TRACE 181 (7/1) prolog_engine.lua:545 -> 163] +[TRACE 182 prolog:l-formula#type:346 -> 127] +[TRACE 183 (179/0) prolog_engine.lua:213 -> 127] +[TRACE --- "shen:shen.lua-guard-51":1 -- NYI: bytecode UCLO at "sys":29] +[TRACE --- prims.lua:870 -- NYI: bytecode FNEW at "sys":29] +[TRACE 184 (178/1) prolog_engine.lua:201 -> 164] +[TRACE --- prolog_engine.lua:684 -- leaving loop in root trace at prolog_engine.lua:687] +[TRACE 185 (172/stitch) typecheck_specialization.lua:32 return] +[TRACE 186 "t-star":10 return] +[TRACE 187 "t-star":10 return] +[TRACE --- "t-star":10 -- NYI: bytecode UCLO ] +[TRACE 188 (9/0) prolog_engine.lua:544 -> 7] +[TRACE 189 (183/0) prolog_engine.lua:213 -> 10] +[TRACE --- prolog_engine.lua:197 -- leaving loop in root trace at prolog_engine.lua:201] +[TRACE --- (76/2) prolog:l-formula#type:30 -- trace too long at prolog_engine.lua:197] +[TRACE 190 (72/2) prolog:primitive-object#type:50 -> 164] +[TRACE 191 (189/0) prolog_engine.lua:213 -> 127] +[TRACE 192 (70/2) prolog:primitive-object#type:69 -> 164] +[TRACE 193 (62/10) prolog:primitive-object#type:88 -> 164] +[TRACE 194 (66/2) prolog:primitive-object#type:107 -> 164] +[TRACE 195 (76/2) prolog:l-formula#type:30 -> 164] +[TRACE 196 "t-star":10 return] +[TRACE 197 "t-star":10 return] +[TRACE --- prims.lua:801 -- inner loop in root trace at prims.lua:803] +[TRACE --- "t-star":10 -- NYI: bytecode UCLO ] +[TRACE --- "t-star":10 -- NYI: bytecode UCLO ] +[TRACE --- (161/0) "t-star":10 -- NYI: bytecode UCLO ] +[TRACE --- (161/0) "t-star":10 -- NYI: bytecode UCLO ] +[TRACE 198 (162/9) prolog_engine.lua:549 -> 163] +[TRACE 199 (191/0) prolog_engine.lua:213 -> 164] +[TRACE --- "sys":29 -- NYI: bytecode UCLO ] +[TRACE 200 (199/0) prolog_engine.lua:213 -> 127] +[TRACE 201 (184/1) prolog_engine.lua:201 -> 164] +[TRACE --- (161/0) "t-star":10 -- NYI: bytecode UCLO ] +[TRACE 202 "t-star":10 return] +[TRACE --- (161/0) "t-star":10 -- NYI: bytecode UCLO ] +[TRACE 203 (161/0) "t-star":10 -- fallback to interpreter] +[TRACE 204 (162/10) prolog_engine.lua:540 -> 163] +[TRACE 205 (166/1) prolog_engine.lua:201 -> 164] +[TRACE 206 (177/1) prolog_engine.lua:540 -> 7] +[TRACE 207 (200/0) prolog_engine.lua:213 -> 127] +[TRACE --- "shen:shen.lua-guard-51":1 -- NYI: bytecode UCLO at "sys":29] +[TRACE --- prims.lua:870 -- NYI: bytecode FNEW at "sys":29] +[TRACE 208 (165/5) prolog_engine.lua:197 -> 10] +[TRACE 209 (58/1) prolog_engine.lua:197 -> 10] +[TRACE 210 prolog_engine.lua:704 loop] +[TRACE --- prims.lua:801 -- inner loop in root trace at prims.lua:803] +[TRACE 211 prolog_engine.lua:243 return] +[TRACE --- prolog_engine.lua:197 -- leaving loop in root trace at prolog_engine.lua:201] +[TRACE 212 (207/0) prolog_engine.lua:213 -> 127] +[TRACE --- "t-star":10 -- inner loop in root trace at prims.lua:733] +[TRACE --- (187/0) "t-star":10 -- NYI: bytecode UCLO ] +[TRACE --- (187/0) "t-star":10 -- NYI: bytecode UCLO ] +[TRACE --- (187/0) "t-star":10 -- NYI: bytecode UCLO ] +[TRACE --- (187/0) "t-star":10 -- NYI: bytecode UCLO ] +[TRACE --- (202/0) "t-star":10 -- NYI: bytecode UCLO ] +[TRACE 213 (212/0) prolog_engine.lua:213 -> 127] +[TRACE 214 (69/1) "shen:shen.lua-guard-12":1 -> 52] +[TRACE 215 (159/2) runtime.lua:70 stitch string.find] +[TRACE --- (202/0) "t-star":10 -- NYI: bytecode UCLO ] +[TRACE --- "t-star":10 -- inner loop in root trace at prims.lua:733] +[TRACE --- (202/0) "t-star":10 -- NYI: bytecode UCLO ] +[TRACE --- (202/0) "t-star":10 -- NYI: bytecode UCLO ] +[TRACE 216 (201/1) prolog_engine.lua:201 -> 164] +[TRACE 217 (9/2) prolog_engine.lua:543 -> 163] +[TRACE 218 (213/0) prolog_engine.lua:213 -> 164] +[TRACE 219 (13/1) prolog_engine.lua:197 -> 10] +[TRACE 220 (158/4) prolog_engine.lua:689 -> 158] +[TRACE 221 (158/1) prolog_engine.lua:689 -> 210] +[TRACE 222 (122/1) runtime.lua:70 stitch string.find] +[TRACE 223 (202/0) "t-star":10 -- fallback to interpreter] +[TRACE 224 (187/0) "t-star":10 -- fallback to interpreter] +[TRACE --- (186/0) "t-star":10 -- NYI: bytecode UCLO ] +[TRACE --- (186/0) "t-star":10 -- NYI: bytecode UCLO ] +[TRACE --- (186/0) "t-star":10 -- NYI: bytecode UCLO ] +[TRACE --- (162/3) prolog_engine.lua:112 -- NYI: bytecode UCLO at typecheck_native.lua:369] +[TRACE --- (148/21) prolog_engine.lua:197 -- trace too long at prolog_engine.lua:177] +[TRACE 225 (138/194) prolog_engine.lua:197 -> 127] +[TRACE 226 (70/16) prolog_engine.lua:197 -> 127] +[TRACE 227 (62/24) prolog_engine.lua:197 -> 127] +[TRACE 228 (66/16) prolog_engine.lua:197 -> 127] +[TRACE 229 (166/149) prolog:pattern#type:133 -> 127] +[TRACE --- "sys":29 -- NYI: bytecode FNEW ] +[TRACE 230 (159/5) runtime.lua:279 stitch string.gsub] +[TRACE --- (222/stitch) prims.lua:874 -- blacklisted at runtime.lua:41] +[TRACE --- (197/0) "t-star":10 -- NYI: bytecode UCLO ] +[TRACE --- prims.lua:801 -- inner loop in root trace at prims.lua:803] +[TRACE --- (197/0) "t-star":10 -- NYI: bytecode UCLO ] +[TRACE --- (197/0) "t-star":10 -- NYI: bytecode UCLO ] +[TRACE 231 (175/1) prolog_engine.lua:551 -> 7] +[TRACE --- (162/3) prolog_engine.lua:112 -- NYI: bytecode UCLO at typecheck_native.lua:369] +[TRACE 232 (166/41) prims.lua:1950 -> 7] +[TRACE --- (175/7) prolog_engine.lua:551 -- trace too long at prolog_engine.lua:159] +[TRACE 233 (166/115) prolog:primitive-object#type:222 -> 127] +[TRACE --- "shen:shen.lua-guard-51":1 -- NYI: bytecode UCLO at "sys":29] +[TRACE --- prims.lua:870 -- NYI: bytecode FNEW at "sys":29] +[TRACE 234 (230/stitch) typecheck_specialization.lua:15 stitch os.clock] diff --git a/bench/typecheck_audit.py b/bench/typecheck_audit.py new file mode 100644 index 0000000..1e57cad --- /dev/null +++ b/bench/typecheck_audit.py @@ -0,0 +1,26 @@ +"""History controls: separate processes, balanced order, bounded queries.""" +import os,json,statistics,subprocess +from pathlib import Path +rows=[] +for round in range(3): + for history in ['keep','flush','off']: + for mode in (['off','on'] if round%2==0 else ['on','off']): + env=dict(os.environ,SHEN_MAP_CLOSURES=mode,SHEN_CLOSURES='off',SHEN_FASL='off',SHEN_KERNEL_CACHE='off') + env['SHEN_DATATYPE_LOOP']='off' + env.pop('SHEN_TC_MAXRECORD',None) + env['SHEN_DATATYPE_DISPATCH']='off' + env.pop('SHEN_TC_TRACE',None) + env.pop('SHEN_TC_PROFILE',None) + p=subprocess.run(['luajit','bench/typecheck_specialization.lua',history,'12'],env=env,text=True,capture_output=True,timeout=90) + if p.returncode: raise RuntimeError(p.stderr+p.stdout[-2000:]) + samples=[dict(x.split('=',1) for x in line.split()[1:]) for line in p.stdout.splitlines() if line.startswith('QUERY ')] + assert len(samples)==12 + row=dict(round=round,history=history,mode=mode,samples=samples) + row['median']=statistics.median(float(s['seconds']) for s in samples[6:]) + rows.append(row) + print(round,history,mode,row['median'],flush=True) + Path('bench/results/typecheck-audit.json').write_text('[\n'+',\n'.join(json.dumps(r,separators=(',',':')) for r in rows)+'\n]\n') +for history in ['keep','flush','off']: + for mode in ['off','on']: + v=[r['median'] for r in rows if r['history']==history and r['mode']==mode] + print(history,mode,statistics.median(v),v) diff --git a/bench/typecheck_dispatch_ab.py b/bench/typecheck_dispatch_ab.py new file mode 100644 index 0000000..1e17928 --- /dev/null +++ b/bench/typecheck_dispatch_ab.py @@ -0,0 +1,24 @@ +"""Benchmark-only dispatcher A/B. Historical results used the archived runtime patch.""" +import os,json,statistics,subprocess +from pathlib import Path +rows=[] +for round in range(4): + for history in ['flush','off']: + for mode in (['off','on'] if round%2==0 else ['on','off']): + env=dict(os.environ,SHEN_DATATYPE_DISPATCH=mode,SHEN_MAP_CLOSURES='off',SHEN_CLOSURES='off',SHEN_FASL='off',SHEN_KERNEL_CACHE='off') + env['SHEN_DATATYPE_LOOP']='off' + env.pop('SHEN_TC_MAXRECORD',None) + env.pop('SHEN_TC_TRACE',None) + env.pop('SHEN_TC_PROFILE',None) + p=subprocess.run(['luajit','bench/typecheck_specialization.lua',history,'12'],env=env,text=True,capture_output=True,timeout=90) + if p.returncode: raise RuntimeError(p.stderr+p.stdout[-2000:]) + samples=[dict(x.split('=',1) for x in line.split()[1:]) for line in p.stdout.splitlines() if line.startswith('QUERY ')] + stats=[line for line in p.stdout.splitlines() if line.startswith('DISPATCH ')] + row=dict(round=round,history=history,mode=mode,samples=samples,stats=stats) + row['median']=statistics.median(float(s['seconds']) for s in samples[6:]); rows.append(row) + print(round,history,mode,row['median'],stats,flush=True) + Path('bench/results/typecheck-dispatch-ab.json').write_text('[\n'+',\n'.join(json.dumps(r,separators=(',',':')) for r in rows)+'\n]\n') +for history in ['flush','off']: + for mode in ['off','on']: + v=[r['median'] for r in rows if r['history']==history and r['mode']==mode] + print(history,mode,statistics.median(v),v) diff --git a/bench/typecheck_loop_ab.py b/bench/typecheck_loop_ab.py new file mode 100644 index 0000000..a529102 --- /dev/null +++ b/bench/typecheck_loop_ab.py @@ -0,0 +1,24 @@ +"""Bound recorder growth; compare independent processes in rotated order.""" +import os,json,statistics,subprocess +from pathlib import Path +rows=[] +for round in range(4): + modes=['default','loop','loop8000'] + modes=modes[round%3:]+modes[:round%3] + for mode in modes: + env=dict(os.environ,SHEN_MAP_CLOSURES='off',SHEN_CLOSURES='off',SHEN_FASL='off',SHEN_KERNEL_CACHE='off',SHEN_DATATYPE_DISPATCH='off') + env.pop('SHEN_TC_MAXRECORD',None) + env['SHEN_DATATYPE_LOOP']='off' if mode=='default' else 'on' + if mode=='loop8000':env['SHEN_TC_MAXRECORD']='8000' + env.pop('SHEN_TC_TRACE',None) + env.pop('SHEN_TC_PROFILE',None) + p=subprocess.run(['luajit','bench/typecheck_specialization.lua','flush','12'],env=env,text=True,capture_output=True,timeout=90) + if p.returncode:raise RuntimeError(p.stderr+p.stdout[-2000:]) + samples=[dict(x.split('=',1) for x in l.split()[1:]) for l in p.stdout.splitlines() if l.startswith('QUERY ')] + row=dict(round=round,mode=mode,samples=samples) + row['median']=statistics.median(float(s['seconds']) for s in samples[6:]);rows.append(row) + print(round,mode,row['median'],flush=True) + Path('bench/results/typecheck-loop-ab.json').write_text('[\n'+',\n'.join(json.dumps(r,separators=(',',':')) for r in rows)+'\n]\n') +for mode in ['default','loop','loop8000']: + v=[r['median'] for r in rows if r['mode']==mode] + print(mode,statistics.median(v),v) diff --git a/bench/typecheck_loop_repeat.py b/bench/typecheck_loop_repeat.py new file mode 100644 index 0000000..a0deaea --- /dev/null +++ b/bench/typecheck_loop_repeat.py @@ -0,0 +1,23 @@ +"""Bound recorder growth; compare independent processes in rotated order.""" +import os,json,statistics,subprocess +from pathlib import Path +rows=[] +for round in range(6): + modes=['default','loop'] + modes=modes[round%2:]+modes[:round%2] + for mode in modes: + env=dict(os.environ,SHEN_MAP_CLOSURES='off',SHEN_CLOSURES='off',SHEN_FASL='off',SHEN_KERNEL_CACHE='off',SHEN_DATATYPE_DISPATCH='off') + env.pop('SHEN_TC_MAXRECORD',None) + env['SHEN_DATATYPE_LOOP']='off' if mode=='default' else 'on' + env.pop('SHEN_TC_TRACE',None) + env.pop('SHEN_TC_PROFILE',None) + p=subprocess.run(['luajit','bench/typecheck_specialization.lua','flush','12'],env=env,text=True,capture_output=True,timeout=90) + if p.returncode:raise RuntimeError(p.stderr+p.stdout[-2000:]) + samples=[dict(x.split('=',1) for x in l.split()[1:]) for l in p.stdout.splitlines() if l.startswith('QUERY ')] + row=dict(round=round,mode=mode,samples=samples) + row['median']=statistics.median(float(s['seconds']) for s in samples[6:]);rows.append(row) + print(round,mode,row['median'],flush=True) + Path('bench/results/typecheck-loop-repeat.json').write_text('[\n'+',\n'.join(json.dumps(r,separators=(',',':')) for r in rows)+'\n]\n') +for mode in ['default','loop']: + v=[r['median'] for r in rows if r['mode']==mode] + print(mode,statistics.median(v),v) diff --git a/bench/typecheck_record_ab.py b/bench/typecheck_record_ab.py new file mode 100644 index 0000000..a5db691 --- /dev/null +++ b/bench/typecheck_record_ab.py @@ -0,0 +1,24 @@ +"""Bound recorder growth; compare independent processes in rotated order.""" +import os,json,statistics,subprocess +from pathlib import Path +rows=[] +for round in range(4): + modes=['default','8000','16000'] + modes=modes[round%3:]+modes[:round%3] + for mode in modes: + env=dict(os.environ,SHEN_MAP_CLOSURES='off',SHEN_CLOSURES='off',SHEN_FASL='off',SHEN_KERNEL_CACHE='off',SHEN_DATATYPE_DISPATCH='off') + env.pop('SHEN_TC_MAXRECORD',None) + if mode!='default':env['SHEN_TC_MAXRECORD']=mode + env['SHEN_DATATYPE_LOOP']='off' + env.pop('SHEN_TC_TRACE',None) + env.pop('SHEN_TC_PROFILE',None) + p=subprocess.run(['luajit','bench/typecheck_specialization.lua','flush','12'],env=env,text=True,capture_output=True,timeout=90) + if p.returncode:raise RuntimeError(p.stderr+p.stdout[-2000:]) + samples=[dict(x.split('=',1) for x in l.split()[1:]) for l in p.stdout.splitlines() if l.startswith('QUERY ')] + row=dict(round=round,mode=mode,samples=samples) + row['median']=statistics.median(float(s['seconds']) for s in samples[6:]);rows.append(row) + print(round,mode,row['median'],flush=True) + Path('bench/results/typecheck-record-ab.json').write_text('[\n'+',\n'.join(json.dumps(r,separators=(',',':')) for r in rows)+'\n]\n') +for mode in ['default','8000','16000']: + v=[r['median'] for r in rows if r['mode']==mode] + print(mode,statistics.median(v),v) diff --git a/bench/typecheck_specialization.lua b/bench/typecheck_specialization.lua new file mode 100644 index 0000000..9cd9f20 --- /dev/null +++ b/bench/typecheck_specialization.lua @@ -0,0 +1,44 @@ +-- Sequential fresh-process audit; the timing region contains queries only. +local P,R=require('boot'),require('runtime') +local loop_module=os.getenv('SHEN_DATATYPE_LOOP')=='on' and require('bench.datatype_loop') +local dispatch_module=os.getenv('SHEN_DATATYPE_DISPATCH')=='on' and require('bench.datatype_dispatch') +P.load_kernel(false); P.initialise(); P.GLOBALS['*hush*']=true +local ffi=require('ffi'); ffi.cdef'int chdir(const char*);' +assert(ffi.C.chdir('tests')==0) +P.F.load('interpreter.shen') +local term=P.F.hd(P.F['read-from-string']('[[[y-combinator [/. ADD [/. X [/. Y [if [= X 0] Y [[ADD [-- X]] [++ Y]]]]]]] 3] 4]')) +local history=arg[1] or 'keep' +local count=tonumber(arg[2]) or 12 +assert(count>=4 and count<=30) +local semantic,inferences +local function query() + P.GLOBALS['shen.*infs*']=0 + local result=P.F['shen.typecheck'](term,P.F.gensym(R.intern('A'))) + local s=R.to_str(result):gsub('%s+','') + assert(s=='(listl-formula)',s) + local inf=P.GLOBALS['shen.*infs*'] + assert(inf==431741,'expected inference count') + assert(not inferences or inf==inferences,'stable inference count') + semantic,inferences=s,inf +end +local maxrecord=os.getenv('SHEN_TC_MAXRECORD') +if maxrecord then jit.opt.start('maxrecord='..assert(tonumber(maxrecord))) end +query() -- force lazy native-driver translation before controlling JIT history +local dispatch=(loop_module or dispatch_module) and (loop_module or dispatch_module).new(P,require('prolog_engine')) +if history=='flush' then jit.flush() +elseif history=='off' then jit.off(); jit.flush() +else assert(history=='keep') end +local tracepath=os.getenv('SHEN_TC_TRACE') +if tracepath then require('jit.v').start(tracepath) end +local profpath=os.getenv('SHEN_TC_PROFILE') +local profiler=profpath and require('jit.p') +if profiler then profiler.start('vf3ri1m1',profpath) end +for i=1,count do + collectgarbage('collect') + local t=os.clock(); query(); local dt=os.clock()-t + print(string.format('QUERY sample=%d seconds=%.6f infs=%d jit=%s semantic=%s',i,dt,inferences,tostring(jit.status()),semantic)) +end +if profiler then profiler.stop() end + +local st=dispatch and dispatch.dispatch_stats or {builds=0,sites=0,bytes=0} +print(string.format('DISPATCH builds=%d sites=%d bytes=%d',st.builds,st.sites,st.bytes)) diff --git a/boot.lua b/boot.lua index 9125657..bea17d8 100644 --- a/boot.lua +++ b/boot.lua @@ -272,6 +272,9 @@ local function cache_key() h = fnv1a(CACHE_FORMAT .. table.concat(FILES, ","), h) -- codegen switches that change compiled output (SHEN_TRMC -> compiler.lua C.TRMC) h = fnv1a("trmc=" .. tostring(os.getenv("SHEN_TRMC") ~= "off"), h) + h = fnv1a("map_closures=" .. tostring(C.MAP_CLOSURES), h) + h = fnv1a("closures=" .. tostring(C.CLOSURES), h) + if C.CLOSURES then h = fnv1a(module_source("closure_ir"), h) end for _, m in ipairs({ "compiler", "runtime", "prims" }) do h = fnv1a(module_source(m), h) end diff --git a/closure_ir.lua b/closure_ir.lua new file mode 100644 index 0000000..2b0203b --- /dev/null +++ b/closure_ir.lua @@ -0,0 +1,119 @@ +-- Experimental lexical closure pass. No runtime representation changes. +local R = require('runtime') +local M = {} +local function array(x) + local a = {} + while R.is_cons(x) do a[#a+1] = x[1]; x = x[2] end + return a +end +local function list(a) + local x = R.NIL + for i = #a, 1, -1 do x = R.cons(a[i], x) end + return x +end +local function name(x) return R.is_symbol(x) and x.name end +local function copy(t) local u = {}; for k,v in pairs(t) do u[k]=v end; return u end +local specials = {['let']=true, ['lambda']=true, ['freeze']=true, + ['defun']=true, ['if']=true, ['cond']=true, ['do']=true, + ['trap-error']=true, ['and']=true, ['or']=true, ['type']=true} + +function M.optimize(form, params) + local original, changed = form, false + local records, used, unsafe = {}, {}, false + local function scan(x) + if R.is_symbol(x) then used[x.name] = true + elseif R.is_cons(x) then + local a = array(x) + if (name(a[1]) == 'let' or name(a[1]) == 'lambda') and specials[name(a[2])] then unsafe = true end + for _,v in ipairs(a) do scan(v) end + end + end + scan(form) + for _,p in ipairs(params or {}) do used[p.name]=true; if specials[p.name] then unsafe=true end end + if unsafe then return form, records end + local serial = 0 + local function fresh() + local n + repeat serial=serial+1; n='ClosureSpike'..serial until not used[n] + used[n]=true + return R.intern(n) + end + -- Unique lexical names prevent both argument capture and definition-site + -- captures being rebound by lets at the call site. Input trees are immutable. + local function alpha(x, env) + if R.is_symbol(x) then return env[x.name] or x end + if not R.is_cons(x) then return x end + local a=array(x); local op=name(a[1]) + if op=='let' or op=='lambda' then + local e=copy(env); local v=fresh(); e[name(a[2])]=v + if op=='let' then return list{a[1],v,alpha(a[3],env),alpha(a[4],e)} end + return list{a[1],v,alpha(a[3],e)} + end + for i,v in ipairs(a) do a[i]=alpha(v,env) end + return list(a) + end + form=alpha(form,{}) + local function uses(x, target, deferred, r) + if R.is_symbol(x) then if x.name==target then r.escapes=true end; return end + if not R.is_cons(x) then return end + local a=array(x); local op=name(a[1]) + if op==target then + if #a~=2 or deferred then r.escapes=true else r.calls=r.calls+1 end + for i=2,#a do uses(a[i],target,deferred,r) end + return + end + local d=deferred or op=='lambda' or op=='freeze' or op=='defun' + for _,v in ipairs(a) do uses(v,target,d,r) end + end + local function replace(x,target,lam) + if not R.is_cons(x) then return x end + local a=array(x) + if name(a[1])==target then + return list{R.intern('let'),lam[2],replace(a[2],target,lam),lam[3]} + end + for i,v in ipairs(a) do a[i]=replace(v,target,lam) end + return list(a) + end + local function walk(x, scope) + if not R.is_cons(x) then return x end + local a=array(x); local op=name(a[1]) + if op=='lambda' then + local s=copy(scope); s[name(a[2])]=true + a[3]=walk(a[3],s); return list(a) + elseif op=='let' then + a[3]=walk(a[3],scope) + local s=copy(scope); s[name(a[2])]=true + a[4]=walk(a[4],s) + local lam=R.is_cons(a[3]) and array(a[3]) + if lam and name(lam[1])=='lambda' then + local r={kind='closure', binding=name(a[2]), calls=0, escapes=false, captures={}} + local seen={}; local size=0 + local function captures(v) + size=size+1 + if R.is_symbol(v) and scope[v.name] then seen[v.name]=true + elseif R.is_cons(v) then for _,w in ipairs(array(v)) do captures(w) end end + end + captures(lam[3]); for n in pairs(seen) do r.captures[#r.captures+1]=n end + table.sort(r.captures); uses(a[4],r.binding,false,r) + r.eliminated=not r.escapes and r.calls<=4 and size<=80 + records[#records+1]=r + if r.eliminated then changed=true; return replace(a[4],r.binding,lam) end + end + return list(a) + end + for i,v in ipairs(a) do a[i]=walk(v,scope) end + if R.is_cons(a[1]) and #a==2 then + local lam=array(a[1]) + if name(lam[1])=='lambda' then + changed=true + records[#records+1]={kind='immediate',calls=1,escapes=false,eliminated=true} + return list{R.intern('let'),lam[2],a[2],lam[3]} + end + end + return list(a) + end + local scope={}; for _,p in ipairs(params or {}) do scope[p.name]=true end + local result=walk(form,scope) + return changed and result or original, records +end +return M diff --git a/compiler.lua b/compiler.lua index ff48196..440f1bd 100644 --- a/compiler.lua +++ b/compiler.lua @@ -10,6 +10,10 @@ local is_symbol = R.is_symbol local C = {} +-- Experimental, opt-in lexical closure elimination; see SPIKE-CLOSURES.md. +C.CLOSURES = os.getenv("SHEN_CLOSURES") == "on" +C.MAP_CLOSURES = os.getenv("SHEN_MAP_CLOSURES") == "on" + -- list helpers over runtime cons local function car(x) return x[1] end local function cdr(x) return x[2] end @@ -312,7 +316,7 @@ local function extend(env, kname, lname) local e = {}; for k,v in pairs(env) do e[k]=v end; e[kname]=lname; return e end -local cexpr, ctail -- forward +local cexpr, ctail, push_inline_cont -- forward -- a symbol used as a *value* (self-evaluating) -> intern at runtime local function symlit(name) return 'S(' .. qstr(name) .. ')' end @@ -860,8 +864,61 @@ local function curried_call(form, env) .. table.concat(cargs, ", ") .. ")" end +-- Bounded known-consumer experiment: a literal unary callback to native map. +-- Code and captures become a chunk-scope worker with explicit parameters. +-- A different consumer identity materializes the ordinary closure and calls it. +local function try_map_closure(form, env) + if not C.MAP_CLOSURES or not CTX or env.map or env.lambda + or not is_symbol(car(form)) or car(form).name ~= "map" + or C.ARITY.map ~= 2 then return end + local args = to_array(cdr(form)) + if #args ~= 2 or not is_cons(args[1]) then return end + local lam = to_array(args[1]) + if #lam ~= 3 or not is_symbol(lam[1]) or lam[1].name ~= "lambda" + or not is_symbol(lam[2]) then return end + local nodes = 0 + local function count(x) + nodes = nodes + 1 + if nodes > 80 then return end + if is_cons(x) then count(x[1]); count(x[2]) end + end + count(lam[3]); if nodes > 80 then return end + local fv, caps = {}, {} + collect_free(args[1], env, {}, fv) + for k in pairs(fv) do caps[#caps+1] = env[k] end + table.sort(caps) + if #caps > 8 then return end + local consumer = callee_ref("map") + local item, target, xs, rev, out = gen("v"), gen("mf"), gen("ml"), gen("mr"), gen("mo") + local saved_self, saved_h, saved_cc, saved_fnl = SELF, HOIST, CCACHE, FNL + local saved_impl, saved_cont = IN_IMPL, push_inline_cont() + SELF=nil; HOIST=nil; CCACHE={}; FNL=new_fnl(true); IN_IMPL=false + local body = cexpr(lam[3], extend(env, lam[2].name, item)) + -- A spill table belongs to this worker, not the enclosing implementation. + local spill = FNL.pt and "local PT = {}; " or "" + SELF, HOIST, CCACHE, FNL = saved_self, saved_h, saved_cc, saved_fnl + IN_IMPL, CONT = saved_impl, saved_cont + local fallback = "MKFUN(1, function(" .. item .. ") return " .. body .. " end)" + local suffix = #caps > 0 and (", " .. table.concat(caps, ", ")) or "" + local idx = #CTX.cbodies + 1 + CTX.cbodies[idx] = "function(" .. target .. ", " .. xs .. suffix .. ") " .. spill + .. "if MAP_BASE == nil or " .. target .. " ~= MAP_BASE then return " .. target .. "(" .. fallback .. ", " .. xs .. ") end; " + .. "local " .. rev .. " = NIL; while " .. xs .. " ~= NIL do " + .. "if getmetatable(" .. xs .. ") ~= CMT then return MAP_TAIL(" .. fallback .. ", " .. xs .. ", " .. rev .. ") end; " + .. "local " .. item .. " = " .. xs .. "[1]; " + .. rev .. " = setmetatable({" .. body .. ", " .. rev .. "}, CMT); " + .. xs .. " = " .. xs .. "[2]; end; local " .. out .. " = NIL; " + .. "while " .. rev .. " ~= NIL do " .. out .. " = setmetatable({" .. rev .. "[1], " .. out .. "}, CMT); " + .. rev .. " = " .. rev .. "[2]; end; return " .. out .. " end" + local input = cexpr(args[2], env) + if HOIST then HOIST.pure=false end + return "KC[" .. idx .. "](" .. consumer .. ", " .. input .. suffix .. ")" +end + -- compile a call (F a1..an) in expression position local function ccall(form, env) + local mapped = try_map_closure(form, env) + if mapped then return mapped end local head = car(form) local args = to_array(cdr(form)) local cargs = {} @@ -1580,7 +1637,7 @@ local function try_lower_freeze_let(var, val, body, env) .. ctail(eform, freeze_env) end -local function push_inline_cont() +push_inline_cont = function() local saved = CONT local f = {} for i = 1, #CONT do @@ -1980,6 +2037,10 @@ local function cdefun(form) local name = car(cdr(form)).name local params = to_array(car(cdr(cdr(form)))) local body = car(cdr(cdr(cdr(form)))) + C.CLOSURE_REPORT = nil + if C.CLOSURES then + body, C.CLOSURE_REPORT = require("closure_ir").optimize(body, params) + end local env = {} local lnames = {} for i=1,#params do diff --git a/prims.lua b/prims.lua index 14d79f0..dbb5e7a 100644 --- a/prims.lua +++ b/prims.lua @@ -1704,6 +1704,8 @@ function P.install_native_stdlib() install("reverse", reverse, 1) install("shen.map-h", map_h, 3) install("map", map, 2) + -- Identity and malformed-tail fallback for the opt-in compiler experiment. + P.ENV.MAP_BASE, P.ENV.MAP_TAIL = map, orig_maph install("not", native_not, 1) install("boolean?", boolean_q, 1) install("empty?", empty_q, 1) diff --git a/scripts/run-tests.lua b/scripts/run-tests.lua index 46ac766..8f555ed 100644 --- a/scripts/run-tests.lua +++ b/scripts/run-tests.lua @@ -31,6 +31,7 @@ end local specs = { "test/boot_cache_spec.lua", "test/cli_spec.lua", + "test/closure_ir_spec.lua", "test/engine_spec.lua", "test/error_robustness_spec.lua", "test/eval_order_spec.lua", @@ -40,6 +41,7 @@ local specs = { "test/io_spec.lua", "test/jit_spec.lua", "test/library_spec.lua", + "test/map_closure_spec.lua", "test/numeric_literal_spec.lua", "test/numeric_render_spec.lua", "test/primitives_spec.lua", diff --git a/test/closure_ir_spec.lua b/test/closure_ir_spec.lua new file mode 100644 index 0000000..b16a294 --- /dev/null +++ b/test/closure_ir_spec.lua @@ -0,0 +1,60 @@ +package.path = (arg[0]:gsub('test/[^/]*$', '')) .. '?.lua;' .. package.path +local P, R, C = require('boot'), require('runtime'), require('compiler') +P.load_kernel(false) +local n = 0 +local function ev(s) + local r + for _,f in ipairs(R.read_all(s)) do r=P.eval(f) end + return r +end +local cases = { + {'(let F (lambda X (+ N X)) (F 3))', 10, true}, + {'((lambda X (+ X N)) 3)', 10, true}, + {'(let F (lambda X (+ N X)) (let N 99 (F 3)))', 10, true}, + {'(let F (lambda N (+ N 1)) (+ (F 2) (F 3)))', 7, true}, + {'(let F (lambda X (+ N X)) (let F (lambda X X) (F 3)))', 3, true}, + {'(let F (lambda X (+ N X)) ((lambda G (G 3)) F))', 10, false}, + {'(let F (lambda X (+ N X)) (thaw (freeze (F 3))))', 10, false}, + {'(let F (lambda X (lambda Y (+ X Y))) ((F 3) 4))', 7, false}, + {'(let F (lambda X (+ X 1)) (F (F 2)))', 4, true}, + {'(let F (lambda X (+ N X)) (do (set cs-f F) ((value cs-f) 3)))', 10, false}, + {'(let F (lambda X (do (set cs-count (+ 1 (value cs-count))) X)) (do (F 2) (F 3)))', 3, true}, + {'(let F (lambda X (<-address N 1)) (do (address-> N 1 42) (F 0)))', 42, true, '(absvector 2)'}, + {'(let F (lambda X (address-> N 1 X)) (let G (lambda X (<-address N 1)) (do (F 42) (G 0))))', 42, true, '(absvector 2)'}, + {'(let F (lambda X (+ X N)) (F (do (set cs-count 9) 3)))', 10, true}, + {'(let F (lambda X (lambda Y (+ X Y))) (F 3 4))', 7, false}, + {'(let F (lambda X (simple-error "unused")) 9)', 9, true}, +} +for _,on in ipairs{false,true} do + C.CLOSURES=on + for i,t in ipairs(cases) do + ev('(set cs-count 0)') + local def='(defun cs-test (N) '..t[1]..')' + local src=C.cdefun(R.read_all(def)[1]) + ev(def) + assert(ev('(cs-test '..(t[4] or '7')..')')==t[2], 'value case '..i..' mode '..tostring(on)) + if on and t[3] then assert(not src:find('MKFUN',1,true),'allocation case '..i) end + if i==11 then assert(ev('(value cs-count)')==2,'effects once per call') end + n=n+1 + end + -- Escaped closures from recursive iterations must retain distinct captures. + ev('(defun cs-build (N) (if (= N 0) () (cons (lambda X (+ N X)) (cs-build (- N 1)))))') + assert(ev('(let L (cs-build 3) (+ ((hd L) 0) ((hd (tl L)) 0)))')==5) + n=n+1 + ev('(defun cs-delay (N) (let F (lambda X (simple-error "delayed")) (if (= N 0) 7 (F 1))))') + assert(ev('(cs-delay 0)')==7) + assert(not pcall(ev,'(cs-delay 1)')) + ev('(defun cs-once (N) (let F (lambda X (+ X X)) (F (do (set cs-count (+ 1 (value cs-count))) N))))') + ev('(set cs-count 0)') + assert(ev('(cs-once 7)')==14 and ev('(value cs-count)')==1) + -- Function identity remains observable when a closure is used as a value. + ev('(defun cs-identity (N) (let F (lambda X N) (= F F)))') + assert(ev('(cs-identity 7)')==true) + n=n+3 +end +-- Inspect analysis records, not just runtime results. +local IR=require('closure_ir') +local _,report=IR.optimize(R.read_all('(let F (lambda X (+ N X)) (F 3))')[1],{R.intern('N')}) +assert(#report==1 and report[1].eliminated and report[1].calls==1 and report[1].captures[1]=='N') +n=n+1 +print('closure_ir_spec: '..n..' pass, 0 fail') diff --git a/test/map_closure_spec.lua b/test/map_closure_spec.lua new file mode 100644 index 0000000..0069e3d --- /dev/null +++ b/test/map_closure_spec.lua @@ -0,0 +1,62 @@ +package.path=(arg[0]:gsub('test/[^/]*$',''))..'?.lua;'..package.path +local P,R,C=require('boot'),require('runtime'),require('compiler') +P.load_kernel(false) +local native=P.F.map +local function ev(s) return P.run_kl_string(s) end +local function show(x) + if R.is_cons(x) then return '('..show(x[1])..' '..show(x[2])..')' end + return x==R.NIL and 'nil' or tostring(x) +end +local n=0 +local function check(x,label) assert(x,label); n=n+1 end +for _,on in ipairs{false,true} do + C.MAP_CLOSURES=on; P.F.map=native; C.ARITY.map=2 + local def='(defun mc-add (N L) (map (lambda X (+ N X)) L))' + local src=C.cdefun(R.read_all(def)[1]); ev(def) + check((src:find('MAP_BASE',1,true)~=nil)==on,'guard shape') + check(show(ev('(mc-add 7 (cons 1 (cons 2 ())))'))=='(8 (9 nil))','captured addition') + check(ev('(mc-add 7 ())')==R.NIL,'empty') + -- Returned element closures must capture distinct loop items. + ev('(defun mc-return (N L) (map (lambda X (lambda Y (+ X N))) L))') + check(ev('(let L (mc-return 7 (cons 1 (cons 2 ()))) (+ ((hd L) 0) ((hd (tl L)) 0)))')==17,'escaped per-item capture') + -- Multiple calls share mutable captured state in left-to-right order. + ev('(defun mc-state (V L) (map (lambda X (do (address-> V 1 (+ (<-address V 1) X)) (<-address V 1))) L))') + check(show(ev('(let V (absvector 2) (do (address-> V 1 0) (mc-state V (cons 1 (cons 2 ())))))'))=='(1 (3 nil))','shared state') + ev('(defun mc-effects (L) (map (lambda X (do (set mc-count (+ 1 (value mc-count))) X)) L))') + ev('(set mc-count 0)') + check(not pcall(ev,'(mc-effects (cons 1 (cons 2 99)))'),'improper list fails') + check(ev('(value mc-count)')==2,'improper tail never replays prefix') + ev('(set mc-count 0)') + ev('(defun mc-raise (L) (map (lambda X (do (set mc-count (+ 1 (value mc-count))) (if (= X 2) (simple-error "stop") X))) L))') + check(not pcall(ev,'(mc-raise (cons 1 (cons 2 (cons 3 ()))))'),'callback raises') + check(ev('(value mc-count)')==2,'stop at throwing callback') + -- Dynamic redefinition: replacement may store and later invoke the callback. + local saved + P.F.map=function(f,l) saved=f; return P.APP(f,10) end + P.FA[P.F.map]=2 + check(ev('(mc-add 7 ())')==17,'replacement consumer') + check(P.APP(saved,20)==27,'replacement can retain callback') + P.F.map=native + -- Callee selection follows existing compiler entry-time lookup even if the + -- list-producing expression changes F.map before the call. + P.F['mc-list']=function() P.F.map=function() return 999 end; P.FA[P.F.map]=2; return R.cons(3,R.NIL) end + P.FA[P.F['mc-list']]=0; C.ARITY['mc-list']=0 + ev('(defun mc-select (N) (map (lambda X (+ X N)) (mc-list)))') + check(show(ev('(mc-select 7)'))=='(10 nil)','callee evaluation order') + check(ev('(mc-select 7)')==999,'later invocation sees replacement') + P.F.map=native + local base=P.ENV.MAP_BASE + P.ENV.MAP_BASE=nil; P.F.map=nil + check(not pcall(ev,'(mc-add 7 ())'), 'absent consumer is not native') + P.ENV.MAP_BASE=base; P.F.map=native + ev('(defun mc-nested (A B) (map (lambda X (map (lambda Y (+ X Y)) B)) A))') + check(show(ev('(mc-nested (cons 1 (cons 2 ())) (cons 10 (cons 20 ())))'))=='((11 (21 nil)) ((12 (22 nil)) nil))', 'nested specialized captures') + ev('(defun mc-shadow (map N L) (map (lambda X (+ N X)) L))') + check(P.F['mc-shadow'](function(f) return P.APP(f,10) end,7,R.NIL)==17, 'lexically shadowed consumer') + local bounded=C.cdefun(R.read_all('(defun mc-bound (A B C D E F G H I L) (map (lambda X (nine A B C D E F G H I X)) L))')[1]) + check(not bounded:find('MAP_BASE',1,true), 'capture budget fallback') + -- Unknown callback is deliberately outside the specialization. + local unknown=C.cdefun(R.read_all('(defun mc-unknown (F L) (map F L))')[1]) + check(not unknown:find('MAP_BASE',1,true),'unknown callback fallback') +end +print('map_closure_spec: '..n..' pass, 0 fail')