Skip to content

Instantly share code, notes, and snippets.

@hiiamboris
Created March 18, 2021 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiiamboris/4502f5213b8f2afffdb865b098fa8db5 to your computer and use it in GitHub Desktop.
Save hiiamboris/4502f5213b8f2afffdb865b098fa8db5 to your computer and use it in GitHub Desktop.
Function cache size estimation and cache creation prototype
Red []
#include %assert.red
#include %keep-type.red
#include %composite.red
#include %map-each.red
#include %format-number.red
#macro [#print string!] func [[manual] s e] [insert remove s [print #composite] s]
word-id: routine [word [any-type!] return: [integer!] /local w] [
w: as red-word! word
w/symbol
]
starting-length-factor: any [attempt [to 1 system/options/args/1] 1]
growth-per-iteration: 1
max-iter: total-iter: 0
total-size: 0
create-cache: function [spec [block!] ids [block!]] [
;-- build a list [/ref1-id index-of-ref1 /ref2-id index-of-ref2 ...] to speedup cache creation
refs: map-each/drop/eval [/i ref [refinement!]] spec [[word-id ref i]]
n0: n: starting-length-factor * length? ids
r: clear next [0]
append/dup r -1 n ;-- build a cache of size = n
forever [ ;-- increases cache until there are no collisions
if foreach id ids [
i: id % n + 1
if r/:i >= 0 [break/return none] ;-- slot is already occupied - need bigger cache
r/:i: id ;-- occupy the id slot
][
r/-1: n ;-- save the cache size
map-each/self id r [ ;-- finish the cache creation
any [select/skip refs id 2 -1]
]
break
]
n: n + growth-per-iteration ;-- try longer cache
forall r [r/1: -1] ;-- reset the buffer
append/dup r -1 growth-per-iteration
]
r: copy head r
#print "Created cache in (iter: n - n0 + 1) iterations: (mold r)"
set 'max-iter max max-iter iter
set 'total-iter total-iter + iter
set 'total-size total-size + length? r
r
]
get-ref-offset: function [ref [refinement!] spec [block!] cache [block!]] [
if 0 = period: cache/1 [return none] ;-- no refinements in this func
o: pick cache (word-id ref) % period + 2
if o < 0 [return none] ;-- unused cache slot
if spec/:o <> ref [return none] ;-- provided refinement does not exist in the spec
o ;-- return refinement offset
]
list: to [] system/words
#print "((length? list) / 2) words total"
total-fun: 0
foreach [name value] list [
unless any-function? :value [continue]
unless spec: attempt [spec-of :value] [continue]
spec: keep-type spec all-word!
set 'total-fun total-fun + 1
#print "^/Building cache for (name), with spec: (mold/flat spec)..."
refs: keep-type spec refinement!
if tail? refs [
print "Function has no refinements, cache is empty: [0]"
continue
]
#print "Has (length? refs) refinements: (mold/only/flat refs)"
ids: map-each ref refs [word-id ref]
#print "Resolved ids are: (ids)"
cache: create-cache spec ids
print "Testing lookups..."
#print "offset of /non-existing: (get-ref-offset /non-existing spec cache)"
foreach ref refs [
#print "offset of (mold ref): (get-ref-offset ref spec cache)"
]
; #print [pad name 20 word-id name]
]
#print "=== Maximum number of iterations to create the cache: (max-iter), mean: (format-number total-iter / total-fun 1 2)"
#print "=== Total number of iterations to create all caches: (total-iter)"
#print "=== Total cache size: (total-size * 4) bytes for (total-fun) functions - that's (format-number total-size * 4 / total-fun 1 1) bytes per function"
@hiiamboris
Copy link
Author

Usage (#includes/do won't work in standalone script due to numerous bugs in Red):

git clone https://gitlab.com/hiiamboris/red-mezz-warehouse
cd red-mezz-warehouse
wget https://gist.githubusercontent.com/hiiamboris/4502f5213b8f2afffdb865b098fa8db5/raw/24206b94de65efe69f6fd5aef8b97f21f88e97ae/func-cache-estimation.red
red -c -e func-cache-estimation.red
func-cache-estimation 1    <- any integer = multiplier

@hiiamboris
Copy link
Author

hiiamboris commented Mar 18, 2021

[Click to see] Example output, for multiplier = 3
2215 words total

Building cache for to, with spec: [type spec]...
Function has no refinements, cache is empty: [0]

Building cache for not, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for remove, with spec: [series /part length /key key-arg return:]...
Has 2 refinements: /part /key
Resolved ids are: 238 113
Created cache in 1 iterations: [6 -1 -1 -1 -1 2 4]
Testing lookups...
offset of /non-existing: none
offset of /part: 2
offset of /key: 4

Building cache for while, with spec: [cond body]...
Function has no refinements, cache is empty: [0]

Building cache for collect, with spec: [body /into collected /local keep rule pos]...
Has 2 refinements: /into /local
Resolved ids are: 73 235
Created cache in 2 iterations: [7 -1 -1 -1 2 4 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /into: 2
offset of /local: 4

Building cache for any, with spec: [conds]...
Function has no refinements, cache is empty: [0]

Building cache for copy, with spec: [value /part length /deep /types kind return:]...
Has 3 refinements: /part /deep /types
Resolved ids are: 238 295 296
Created cache in 1 iterations: [9 -1 -1 -1 -1 2 -1 -1 4 5]
Testing lookups...
offset of /non-existing: none
offset of /part: 2
offset of /deep: 4
offset of /types: 5

Building cache for insert, with spec: [series value /part length /only /dup count return:]...
Has 3 refinements: /part /only /dup
Resolved ids are: 238 91 290
Created cache in 1 iterations: [9 -1 5 6 -1 3 -1 -1 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /part: 3
offset of /only: 5
offset of /dup: 6

Building cache for if, with spec: [cond then-blk]...
Function has no refinements, cache is empty: [0]

Building cache for quote, with spec: [:value]...
Function has no refinements, cache is empty: [0]

Building cache for set, with spec: [word value /any /case /only /some return:]...
Has 4 refinements: /any /case /only /some
Resolved ids are: 68 77 91 81
Created cache in 1 iterations: [12 -1 -1 -1 -1 -1 4 -1 5 3 6 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /any: 3
offset of /case: 4
offset of /only: 5
offset of /some: 6

Building cache for case, with spec: [cases /all]...
Has 1 refinements: /all
Resolved ids are: 260
Created cache in 1 iterations: [3 -1 -1 2]
Testing lookups...
offset of /non-existing: none
offset of /all: 2

Building cache for at, with spec: [series index return:]...
Function has no refinements, cache is empty: [0]

Building cache for back, with spec: [series return:]...
Function has no refinements, cache is empty: [0]

Building cache for find, with spec: [series value /part length /only /case /same /any /with wild /skip size /last /reverse /tail /match]...
Has 11 refinements: /part /only /case /same /any /with /skip /last /reverse /tail /match
Resolved ids are: 238 91 77 298 68 239 80 300 178 161 195
Created cache in 1 iterations: [33 -1 7 8 13 -1 -1 -1 3 9 -1 -1 6 -1 14 11 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 5 -1 -1 -1 15 16 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /part: 3
offset of /only: 5
offset of /case: 6
offset of /same: 7
offset of /any: 8
offset of /with: 9
offset of /skip: 11
offset of /last: 13
offset of /reverse: 14
offset of /tail: 15
offset of /match: 16

Building cache for head, with spec: [series return:]...
Function has no refinements, cache is empty: [0]

Building cache for head?, with spec: [series return:]...
Function has no refinements, cache is empty: [0]

Building cache for index?, with spec: [series return:]...
Function has no refinements, cache is empty: [0]

Building cache for length?, with spec: [series return:]...
Function has no refinements, cache is empty: [0]

Building cache for next, with spec: [series return:]...
Function has no refinements, cache is empty: [0]

Building cache for pick, with spec: [series index return:]...
Function has no refinements, cache is empty: [0]

Building cache for skip, with spec: [series offset return:]...
Function has no refinements, cache is empty: [0]

Building cache for select, with spec: [series value /part length /only /case /same /any /with wild /skip size /last /reverse return:]...
Has 9 refinements: /part /only /case /same /any /with /skip /last /reverse
Resolved ids are: 238 91 77 298 68 239 80 300 178
Created cache in 2 iterations: [28 -1 -1 -1 -1 -1 -1 -1 5 -1 -1 14 -1 8 -1 3 9 -1 -1 7 -1 13 6 -1 -1 11 -1 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /part: 3
offset of /only: 5
offset of /case: 6
offset of /same: 7
offset of /any: 8
offset of /with: 9
offset of /skip: 11
offset of /last: 13
offset of /reverse: 14

Building cache for tail, with spec: [series return:]...
Function has no refinements, cache is empty: [0]

Building cache for tail?, with spec: [series return:]...
Function has no refinements, cache is empty: [0]

Building cache for change, with spec: [series value /part range /only /dup count]...
Has 3 refinements: /part /only /dup
Resolved ids are: 238 91 290
Created cache in 1 iterations: [9 -1 5 6 -1 3 -1 -1 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /part: 3
offset of /only: 5
offset of /dup: 6

Building cache for clear, with spec: [series return:]...
Function has no refinements, cache is empty: [0]

Building cache for append, with spec: [series value /part length /only /dup count return:]...
Has 3 refinements: /part /only /dup
Resolved ids are: 238 91 290
Created cache in 1 iterations: [9 -1 5 6 -1 3 -1 -1 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /part: 3
offset of /only: 5
offset of /dup: 6

Building cache for move, with spec: [origin target /part length return:]...
Has 1 refinements: /part
Resolved ids are: 238
Created cache in 1 iterations: [3 -1 3 -1]
Testing lookups...
offset of /non-existing: none
offset of /part: 3

Building cache for poke, with spec: [series index value return:]...
Function has no refinements, cache is empty: [0]

Building cache for put, with spec: [series key value /case return:]...
Has 1 refinements: /case
Resolved ids are: 77
Created cache in 1 iterations: [3 -1 -1 4]
Testing lookups...
offset of /non-existing: none
offset of /case: 4

Building cache for random, with spec: [value /seed /secure /only return:]...
Has 3 refinements: /seed /secure /only
Resolved ids are: 253 254 91
Created cache in 2 iterations: [10 -1 4 -1 2 3 -1 -1 -1 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /seed: 2
offset of /secure: 3
offset of /only: 4

Building cache for reverse, with spec: [series /part length /skip size return:]...
Has 2 refinements: /part /skip
Resolved ids are: 238 80
Created cache in 1 iterations: [6 -1 -1 4 -1 2 -1]
Testing lookups...
offset of /non-existing: none
offset of /part: 2
offset of /skip: 4

Building cache for sort, with spec: [series /case /skip size /compare comparator /part length /all /reverse /stable return:]...
Has 7 refinements: /case /skip /compare /part /all /reverse /stable
Resolved ids are: 77 80 237 238 260 178 307
Created cache in 1 iterations: [21 -1 -1 -1 -1 -1 -1 5 7 9 -1 10 -1 -1 11 2 -1 -1 3 -1 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /case: 2
offset of /skip: 3
offset of /compare: 5
offset of /part: 7
offset of /all: 9
offset of /reverse: 10
offset of /stable: 11

Building cache for swap, with spec: [series1 series2 return:]...
Function has no refinements, cache is empty: [0]

Building cache for take, with spec: [series /part length /deep /last]...
Has 3 refinements: /part /deep /last
Resolved ids are: 238 295 300
Created cache in 1 iterations: [9 -1 -1 -1 5 2 -1 -1 4 -1]
Testing lookups...
offset of /non-existing: none
offset of /part: 2
offset of /deep: 4
offset of /last: 5

Building cache for trim, with spec: [series /head /tail /auto /lines /all /with str]...
Has 6 refinements: /head /tail /auto /lines /all /with
Resolved ids are: 128 161 310 311 260 239
Created cache in 2 iterations: [19 -1 -1 -1 -1 -1 -1 4 5 -1 3 -1 7 -1 6 2 -1 -1 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /head: 2
offset of /tail: 3
offset of /auto: 4
offset of /lines: 5
offset of /all: 6
offset of /with: 7

Building cache for uppercase, with spec: [string /part limit return:]...
Has 1 refinements: /part
Resolved ids are: 238
Created cache in 1 iterations: [3 -1 2 -1]
Testing lookups...
offset of /non-existing: none
offset of /part: 2

Building cache for lowercase, with spec: [string /part limit return:]...
Has 1 refinements: /part
Resolved ids are: 238
Created cache in 1 iterations: [3 -1 2 -1]
Testing lookups...
offset of /non-existing: none
offset of /part: 2

Building cache for checksum, with spec: [data method /with spec return:]...
Has 1 refinements: /with
Resolved ids are: 239
Created cache in 1 iterations: [3 -1 -1 3]
Testing lookups...
offset of /non-existing: none
offset of /with: 3

Building cache for add, with spec: [value1 value2 return:]...
Function has no refinements, cache is empty: [0]

Building cache for subtract, with spec: [value1 value2 return:]...
Function has no refinements, cache is empty: [0]

Building cache for divide, with spec: [value1 value2 return:]...
Function has no refinements, cache is empty: [0]

Building cache for try, with spec: [block /all]...
Has 1 refinements: /all
Resolved ids are: 260
Created cache in 1 iterations: [3 -1 -1 2]
Testing lookups...
offset of /non-existing: none
offset of /all: 2

Building cache for catch, with spec: [block /name word]...
Has 1 refinements: /name
Resolved ids are: 210
Created cache in 1 iterations: [3 2 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /name: 2

Building cache for multiply, with spec: [value1 value2 return:]...
Function has no refinements, cache is empty: [0]

Building cache for browse, with spec: [url]...
Function has no refinements, cache is empty: [0]

Building cache for open, with spec: [port /new /read /write /seek /allow access]...
Has 5 refinements: /new /read /write /seek /allow
Resolved ids are: 315 219 222 316 317
Created cache in 1 iterations: [15 2 5 6 -1 -1 -1 -1 -1 -1 3 -1 -1 4 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /new: 2
offset of /read: 3
offset of /write: 4
offset of /seek: 5
offset of /allow: 6

Building cache for create, with spec: [port]...
Function has no refinements, cache is empty: [0]

Building cache for close, with spec: [port]...
Function has no refinements, cache is empty: [0]

Building cache for delete, with spec: [file]...
Function has no refinements, cache is empty: [0]

Building cache for modify, with spec: [target field value /case]...
Has 1 refinements: /case
Resolved ids are: 77
Created cache in 1 iterations: [3 -1 -1 4]
Testing lookups...
offset of /non-existing: none
offset of /case: 4

Building cache for query, with spec: [target]...
Function has no refinements, cache is empty: [0]

Building cache for read, with spec: [source /part length /seek index /binary /lines /info /as encoding]...
Has 6 refinements: /part /seek /binary /lines /info /as
Resolved ids are: 238 316 320 311 321 322
Created cache in 1 iterations: [18 -1 -1 -1 -1 2 7 -1 -1 -1 -1 4 -1 -1 -1 6 8 9 -1]
Testing lookups...
offset of /non-existing: none
offset of /part: 2
offset of /seek: 4
offset of /binary: 6
offset of /lines: 7
offset of /info: 8
offset of /as: 9

Building cache for rename, with spec: [from to]...
Function has no refinements, cache is empty: [0]

Building cache for update, with spec: [port]...
Function has no refinements, cache is empty: [0]

Building cache for write, with spec: [destination data /binary /lines /info /append /part length /seek index /allow access /as encoding]...
Has 8 refinements: /binary /lines /info /append /part /seek /allow /as
Resolved ids are: 320 311 321 168 238 316 317 322
Created cache in 1 iterations: [24 6 -1 -1 -1 9 11 -1 -1 3 5 13 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 7 4]
Testing lookups...
offset of /non-existing: none
offset of /binary: 3
offset of /lines: 4
offset of /info: 5
offset of /append: 6
offset of /part: 7
offset of /seek: 9
offset of /allow: 11
offset of /as: 13

Building cache for scan, with spec: [buffer /next /fast return:]...
Has 2 refinements: /next /fast
Resolved ids are: 159 592
Created cache in 1 iterations: [6 -1 -1 -1 2 3 -1]
Testing lookups...
offset of /non-existing: none
offset of /next: 2
offset of /fast: 3

Building cache for load, with spec: [source /header /all /trap /next position /part length /into out /as type /local codec suffix name mime pre-load]...
Has 8 refinements: /header /all /trap /next /part /into /as /local
Resolved ids are: 495 260 593 159 238 73 322 235
Created cache in 7 iterations: [30 -1 -1 -1 -1 -1 -1 -1 -1 -1 5 -1 -1 -1 9 -1 2 -1 -1 -1 -1 3 -1 11 4 -1 13 -1 -1 7 -1]
Testing lookups...
offset of /non-existing: none
offset of /header: 2
offset of /all: 3
offset of /trap: 4
offset of /next: 5
offset of /part: 7
offset of /into: 9
offset of /as: 11
offset of /local: 13

Building cache for comment, with spec: ['value]...
Function has no refinements, cache is empty: [0]

Building cache for throw, with spec: [value /name word]...
Has 1 refinements: /name
Resolved ids are: 210
Created cache in 1 iterations: [3 2 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /name: 2

Building cache for math, with spec: [datum /local match order infix tally enter recur count operator]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 2 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 2

Building cache for make, with spec: [type spec return:]...
Function has no refinements, cache is empty: [0]

Building cache for return, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for reflect, with spec: [value field]...
Function has no refinements, cache is empty: [0]

Building cache for form, with spec: [value /part limit return:]...
Has 1 refinements: /part
Resolved ids are: 238
Created cache in 1 iterations: [3 -1 2 -1]
Testing lookups...
offset of /non-existing: none
offset of /part: 2

Building cache for mold, with spec: [value /only /all /flat /part limit return:]...
Has 4 refinements: /only /all /flat /part
Resolved ids are: 91 260 261 238
Created cache in 1 iterations: [12 -1 -1 -1 -1 -1 -1 -1 2 3 4 5 -1]
Testing lookups...
offset of /non-existing: none
offset of /only: 2
offset of /all: 3
offset of /flat: 4
offset of /part: 5

Building cache for all, with spec: [conds]...
Function has no refinements, cache is empty: [0]

Building cache for absolute, with spec: [value return:]...
Function has no refinements, cache is empty: [0]

Building cache for negate, with spec: [number return:]...
Function has no refinements, cache is empty: [0]

Building cache for power, with spec: [number exponent return:]...
Function has no refinements, cache is empty: [0]

Building cache for remainder, with spec: [value1 value2 return:]...
Function has no refinements, cache is empty: [0]

Building cache for round, with spec: [n /to scale /even /down /half-down /floor /ceiling /half-ceiling]...
Has 7 refinements: /to /even /down /half-down /floor /ceiling /half-ceiling
Resolved ids are: 83 276 277 278 279 280 281
Created cache in 1 iterations: [21 -1 -1 -1 4 5 6 7 8 9 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2]
Testing lookups...
offset of /non-existing: none
offset of /to: 2
offset of /even: 4
offset of /down: 5
offset of /half-down: 6
offset of /floor: 7
offset of /ceiling: 8
offset of /half-ceiling: 9

Building cache for even?, with spec: [number return:]...
Function has no refinements, cache is empty: [0]

Building cache for odd?, with spec: [number return:]...
Function has no refinements, cache is empty: [0]

Building cache for and~, with spec: [value1 value2 return:]...
Function has no refinements, cache is empty: [0]

Building cache for complement, with spec: [value return:]...
Function has no refinements, cache is empty: [0]

Building cache for or~, with spec: [value1 value2 return:]...
Function has no refinements, cache is empty: [0]

Building cache for xor~, with spec: [value1 value2 return:]...
Function has no refinements, cache is empty: [0]

Building cache for with, with spec: [ctx code]...
Function has no refinements, cache is empty: [0]

Building cache for last, with spec: [s]...
Function has no refinements, cache is empty: [0]

Building cache for open?, with spec: [port]...
Function has no refinements, cache is empty: [0]

Building cache for as, with spec: [type spec]...
Function has no refinements, cache is empty: [0]

Building cache for unless, with spec: [cond then-blk]...
Function has no refinements, cache is empty: [0]

Building cache for either, with spec: [cond true-blk false-blk]...
Function has no refinements, cache is empty: [0]

Building cache for until, with spec: [body]...
Function has no refinements, cache is empty: [0]

Building cache for loop, with spec: [count body]...
Function has no refinements, cache is empty: [0]

Building cache for repeat, with spec: ['word value body]...
Function has no refinements, cache is empty: [0]

Building cache for forever, with spec: [body]...
Function has no refinements, cache is empty: [0]

Building cache for foreach, with spec: ['word series body]...
Function has no refinements, cache is empty: [0]

Building cache for forall, with spec: ['word body]...
Function has no refinements, cache is empty: [0]

Building cache for remove-each, with spec: ['word data body]...
Function has no refinements, cache is empty: [0]

Building cache for func, with spec: [spec body]...
Function has no refinements, cache is empty: [0]

Building cache for function, with spec: [spec body /extern]...
Has 1 refinements: /extern
Resolved ids are: 236
Created cache in 1 iterations: [3 -1 -1 3]
Testing lookups...
offset of /non-existing: none
offset of /extern: 3

Building cache for does, with spec: [body]...
Function has no refinements, cache is empty: [0]

Building cache for has, with spec: [vars body]...
Function has no refinements, cache is empty: [0]

Building cache for switch, with spec: [value cases /default case]...
Has 1 refinements: /default
Resolved ids are: 346
Created cache in 1 iterations: [3 -1 3 -1]
Testing lookups...
offset of /non-existing: none
offset of /default: 3

Building cache for do, with spec: [value /expand /args arg /next position]...
Has 3 refinements: /expand /args /next
Resolved ids are: 348 349 159
Created cache in 3 iterations: [11 -1 -1 -1 -1 -1 5 -1 2 3 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /expand: 2
offset of /args: 3
offset of /next: 5

Building cache for reduce, with spec: [value /into out]...
Has 1 refinements: /into
Resolved ids are: 73
Created cache in 1 iterations: [3 -1 2 -1]
Testing lookups...
offset of /non-existing: none
offset of /into: 2

Building cache for compose, with spec: [value /deep /only /into out]...
Has 3 refinements: /deep /only /into
Resolved ids are: 295 91 73
Created cache in 2 iterations: [10 -1 3 -1 4 -1 2 -1 -1 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /deep: 2
offset of /only: 3
offset of /into: 4

Building cache for get, with spec: [word /any /case return:]...
Has 2 refinements: /any /case
Resolved ids are: 68 77
Created cache in 1 iterations: [6 -1 -1 2 -1 -1 3]
Testing lookups...
offset of /non-existing: none
offset of /any: 2
offset of /case: 3

Building cache for print, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for prin, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for equal?, with spec: [value1 value2]...
Function has no refinements, cache is empty: [0]

Building cache for not-equal?, with spec: [value1 value2]...
Function has no refinements, cache is empty: [0]

Building cache for strict-equal?, with spec: [value1 value2]...
Function has no refinements, cache is empty: [0]

Building cache for lesser?, with spec: [value1 value2]...
Function has no refinements, cache is empty: [0]

Building cache for greater?, with spec: [value1 value2]...
Function has no refinements, cache is empty: [0]

Building cache for lesser-or-equal?, with spec: [value1 value2]...
Function has no refinements, cache is empty: [0]

Building cache for greater-or-equal?, with spec: [value1 value2]...
Function has no refinements, cache is empty: [0]

Building cache for same?, with spec: [value1 value2]...
Function has no refinements, cache is empty: [0]

Building cache for type?, with spec: [value /word]...
Has 1 refinements: /word
Resolved ids are: 336
Created cache in 1 iterations: [3 2 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /word: 2

Building cache for stats, with spec: [/show /info return:]...
Has 2 refinements: /show /info
Resolved ids are: 369 321
Created cache in 2 iterations: [7 -1 -1 -1 -1 -1 1 2]
Testing lookups...
offset of /non-existing: none
offset of /show: 1
offset of /info: 2

Building cache for show, with spec: [face /with parent /force return: /local show? f pending owner word target action new index part state new? p obj field pane]...
Has 3 refinements: /with /force /local
Resolved ids are: 239 1817 235
Created cache in 1 iterations: [9 -1 6 -1 -1 -1 2 -1 -1 4]
Testing lookups...
offset of /non-existing: none
offset of /with: 2
offset of /force: 4
offset of /local: 6

Building cache for bind, with spec: [word context /copy return:]...
Has 1 refinements: /copy
Resolved ids are: 70
Created cache in 1 iterations: [3 -1 3 -1]
Testing lookups...
offset of /non-existing: none
offset of /copy: 3

Building cache for context, with spec: [spec]...
Function has no refinements, cache is empty: [0]

Building cache for in, with spec: [object word]...
Function has no refinements, cache is empty: [0]

Building cache for object, with spec: [spec]...
Function has no refinements, cache is empty: [0]

Building cache for parse, with spec: [input rules /case /part length /trace callback return:]...
Has 3 refinements: /case /part /trace
Resolved ids are: 77 238 377
Created cache in 1 iterations: [9 -1 -1 -1 -1 4 3 -1 -1 6]
Testing lookups...
offset of /non-existing: none
offset of /case: 3
offset of /part: 4
offset of /trace: 6

Building cache for union, with spec: [set1 set2 /case /skip size return:]...
Has 2 refinements: /case /skip
Resolved ids are: 77 80
Created cache in 1 iterations: [6 -1 -1 4 -1 -1 3]
Testing lookups...
offset of /non-existing: none
offset of /case: 3
offset of /skip: 4

Building cache for unique, with spec: [set /case /skip size return:]...
Has 2 refinements: /case /skip
Resolved ids are: 77 80
Created cache in 1 iterations: [6 -1 -1 3 -1 -1 2]
Testing lookups...
offset of /non-existing: none
offset of /case: 2
offset of /skip: 3

Building cache for intersect, with spec: [set1 set2 /case /skip size return:]...
Has 2 refinements: /case /skip
Resolved ids are: 77 80
Created cache in 1 iterations: [6 -1 -1 4 -1 -1 3]
Testing lookups...
offset of /non-existing: none
offset of /case: 3
offset of /skip: 4

Building cache for difference, with spec: [set1 set2 /case /skip size return:]...
Has 2 refinements: /case /skip
Resolved ids are: 77 80
Created cache in 1 iterations: [6 -1 -1 4 -1 -1 3]
Testing lookups...
offset of /non-existing: none
offset of /case: 3
offset of /skip: 4

Building cache for exclude, with spec: [set1 set2 /case /skip size return:]...
Has 2 refinements: /case /skip
Resolved ids are: 77 80
Created cache in 1 iterations: [6 -1 -1 4 -1 -1 3]
Testing lookups...
offset of /non-existing: none
offset of /case: 3
offset of /skip: 4

Building cache for complement?, with spec: [bits]...
Function has no refinements, cache is empty: [0]

Building cache for dehex, with spec: [value return:]...
Function has no refinements, cache is empty: [0]

Building cache for enhex, with spec: [value return:]...
Function has no refinements, cache is empty: [0]

Building cache for negative?, with spec: [number return:]...
Function has no refinements, cache is empty: [0]

Building cache for positive?, with spec: [number return:]...
Function has no refinements, cache is empty: [0]

Building cache for max, with spec: [value1 value2]...
Function has no refinements, cache is empty: [0]

Building cache for min, with spec: [value1 value2]...
Function has no refinements, cache is empty: [0]

Building cache for shift, with spec: [data bits /left /logical return:]...
Has 2 refinements: /left /logical
Resolved ids are: 399 400
Created cache in 1 iterations: [6 -1 -1 -1 3 4 -1]
Testing lookups...
offset of /non-existing: none
offset of /left: 3
offset of /logical: 4

Building cache for to-hex, with spec: [value /size length return:]...
Has 1 refinements: /size
Resolved ids are: 129
Created cache in 1 iterations: [3 2 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /size: 2

Building cache for sine, with spec: [angle /radians return:]...
Has 1 refinements: /radians
Resolved ids are: 404
Created cache in 1 iterations: [3 -1 -1 2]
Testing lookups...
offset of /non-existing: none
offset of /radians: 2

Building cache for cosine, with spec: [angle /radians return:]...
Has 1 refinements: /radians
Resolved ids are: 404
Created cache in 1 iterations: [3 -1 -1 2]
Testing lookups...
offset of /non-existing: none
offset of /radians: 2

Building cache for tangent, with spec: [angle /radians return:]...
Has 1 refinements: /radians
Resolved ids are: 404
Created cache in 1 iterations: [3 -1 -1 2]
Testing lookups...
offset of /non-existing: none
offset of /radians: 2

Building cache for arcsine, with spec: [sine /radians return:]...
Has 1 refinements: /radians
Resolved ids are: 404
Created cache in 1 iterations: [3 -1 -1 2]
Testing lookups...
offset of /non-existing: none
offset of /radians: 2

Building cache for arccosine, with spec: [cosine /radians return:]...
Has 1 refinements: /radians
Resolved ids are: 404
Created cache in 1 iterations: [3 -1 -1 2]
Testing lookups...
offset of /non-existing: none
offset of /radians: 2

Building cache for arctangent, with spec: [tangent /radians return:]...
Has 1 refinements: /radians
Resolved ids are: 404
Created cache in 1 iterations: [3 -1 -1 2]
Testing lookups...
offset of /non-existing: none
offset of /radians: 2

Building cache for arctangent2, with spec: [y x /radians return:]...
Has 1 refinements: /radians
Resolved ids are: 404
Created cache in 1 iterations: [3 -1 -1 3]
Testing lookups...
offset of /non-existing: none
offset of /radians: 3

Building cache for NaN?, with spec: [value return:]...
Function has no refinements, cache is empty: [0]

Building cache for zero?, with spec: [value return:]...
Function has no refinements, cache is empty: [0]

Building cache for log-2, with spec: [value return:]...
Function has no refinements, cache is empty: [0]

Building cache for log-10, with spec: [value return:]...
Function has no refinements, cache is empty: [0]

Building cache for log-e, with spec: [value return:]...
Function has no refinements, cache is empty: [0]

Building cache for exp, with spec: [value return:]...
Function has no refinements, cache is empty: [0]

Building cache for square-root, with spec: [value return:]...
Function has no refinements, cache is empty: [0]

Building cache for construct, with spec: [block /with object /only]...
Has 2 refinements: /with /only
Resolved ids are: 239 91
Created cache in 1 iterations: [6 -1 4 -1 -1 -1 2]
Testing lookups...
offset of /non-existing: none
offset of /with: 2
offset of /only: 4

Building cache for value?, with spec: [value return:]...
Function has no refinements, cache is empty: [0]

Building cache for as-pair, with spec: [x y]...
Function has no refinements, cache is empty: [0]

Building cache for as-money, with spec: [currency amount return:]...
Function has no refinements, cache is empty: [0]

Building cache for break, with spec: [/return value]...
Has 1 refinements: /return
Resolved ids are: 58
Created cache in 1 iterations: [3 -1 1 -1]
Testing lookups...
offset of /non-existing: none
offset of /return: 1

Building cache for continue, with spec: []...
Function has no refinements, cache is empty: [0]

Building cache for exit, with spec: []...
Function has no refinements, cache is empty: [0]

Building cache for extend, with spec: [obj spec /case]...
Has 1 refinements: /case
Resolved ids are: 77
Created cache in 1 iterations: [3 -1 -1 3]
Testing lookups...
offset of /non-existing: none
offset of /case: 3

Building cache for debase, with spec: [value /base base-value]...
Has 1 refinements: /base
Resolved ids are: 429
Created cache in 1 iterations: [3 2 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /base: 2

Building cache for enbase, with spec: [value /base base-value]...
Has 1 refinements: /base
Resolved ids are: 429
Created cache in 1 iterations: [3 2 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /base: 2

Building cache for to-local-file, with spec: [path /full return:]...
Has 1 refinements: /full
Resolved ids are: 434
Created cache in 1 iterations: [3 -1 -1 2]
Testing lookups...
offset of /non-existing: none
offset of /full: 2

Building cache for wait, with spec: [value /all]...
Has 1 refinements: /all
Resolved ids are: 260
Created cache in 1 iterations: [3 -1 -1 2]
Testing lookups...
offset of /non-existing: none
offset of /all: 2

Building cache for unset, with spec: [word]...
Function has no refinements, cache is empty: [0]

Building cache for new-line, with spec: [position value /all /skip size return:]...
Has 2 refinements: /all /skip
Resolved ids are: 260 80
Created cache in 2 iterations: [7 -1 3 -1 4 -1 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /all: 3
offset of /skip: 4

Building cache for new-line?, with spec: [position return:]...
Function has no refinements, cache is empty: [0]

Building cache for context?, with spec: [word return:]...
Function has no refinements, cache is empty: [0]

Building cache for set-env, with spec: [var value]...
Function has no refinements, cache is empty: [0]

Building cache for get-env, with spec: [var return:]...
Function has no refinements, cache is empty: [0]

Building cache for list-env, with spec: [return:]...
Function has no refinements, cache is empty: [0]

Building cache for now, with spec: [/year /month /day /time /zone /date /weekday /yearday /precise /utc return:]...
Has 10 refinements: /year /month /day /time /zone /date /weekday /yearday /precise /utc
Resolved ids are: 134 135 136 143 137 133 140 141 447 448
Created cache in 1 iterations: [30 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 6 1 2 3 5 -1 -1 7 8 -1 4 -1 -1 -1 9 10 -1]
Testing lookups...
offset of /non-existing: none
offset of /year: 1
offset of /month: 2
offset of /day: 3
offset of /time: 4
offset of /zone: 5
offset of /date: 6
offset of /weekday: 7
offset of /yearday: 8
offset of /precise: 9
offset of /utc: 10

Building cache for sign?, with spec: [number return:]...
Function has no refinements, cache is empty: [0]

Building cache for call, with spec: [cmd /wait /show /console /shell /input in /output out /error err return:]...
Has 7 refinements: /wait /show /console /shell /input /output /error
Resolved ids are: 435 369 452 453 375 454 226
Created cache in 3 iterations: [23 -1 3 -1 -1 -1 -1 -1 6 -1 -1 -1 -1 -1 -1 -1 4 5 8 -1 10 -1 2 -1]
Testing lookups...
offset of /non-existing: none
offset of /wait: 2
offset of /show: 3
offset of /console: 4
offset of /shell: 5
offset of /input: 6
offset of /output: 8
offset of /error: 10

Building cache for size?, with spec: [file return:]...
Function has no refinements, cache is empty: [0]

Building cache for compress, with spec: [data /zlib /deflate]...
Has 2 refinements: /zlib /deflate
Resolved ids are: 459 460
Created cache in 1 iterations: [6 -1 -1 -1 2 3 -1]
Testing lookups...
offset of /non-existing: none
offset of /zlib: 2
offset of /deflate: 3

Building cache for decompress, with spec: [data /zlib size /deflate size]...
Has 2 refinements: /zlib /deflate
Resolved ids are: 459 460
Created cache in 1 iterations: [6 -1 -1 -1 2 4 -1]
Testing lookups...
offset of /non-existing: none
offset of /zlib: 2
offset of /deflate: 4

Building cache for recycle, with spec: [/on /off]...
Has 2 refinements: /on /off
Resolved ids are: 107 108
Created cache in 1 iterations: [6 2 -1 -1 -1 -1 1]
Testing lookups...
offset of /non-existing: none
offset of /on: 1
offset of /off: 2

Building cache for transcode, with spec: [src /next /one /prescan /scan /part length /into dst /trace callback return:]...
Has 7 refinements: /next /one /prescan /scan /part /into /trace
Resolved ids are: 159 465 223 224 238 73 377
Created cache in 1 iterations: [21 -1 -1 -1 3 -1 -1 -1 6 -1 -1 8 -1 2 4 5 -1 -1 -1 -1 -1 10]
Testing lookups...
offset of /non-existing: none
offset of /next: 2
offset of /one: 3
offset of /prescan: 4
offset of /scan: 5
offset of /part: 6
offset of /into: 8
offset of /trace: 10

Building cache for quit, with spec: [/return status]...
Has 1 refinements: /return
Resolved ids are: 58
Created cache in 1 iterations: [3 -1 1 -1]
Testing lookups...
offset of /non-existing: none
offset of /return: 1

Building cache for +, with spec: [value1 value2 return:]...
Function has no refinements, cache is empty: [0]

Building cache for last-lf?, with spec: []...
Function has no refinements, cache is empty: [0]

Building cache for get-current-dir, with spec: []...
Function has no refinements, cache is empty: [0]

Building cache for set-current-dir, with spec: [path]...
Function has no refinements, cache is empty: [0]

Building cache for make-dir, with spec: [path /deep /local dirs end created dir]...
Has 2 refinements: /deep /local
Resolved ids are: 295 235
Created cache in 2 iterations: [7 -1 2 -1 -1 3 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /deep: 2
offset of /local: 3

Building cache for <, with spec: [value1 value2]...
Function has no refinements, cache is empty: [0]

Building cache for <>, with spec: [value1 value2]...
Function has no refinements, cache is empty: [0]

Building cache for %, with spec: [value1 value2 return:]...
Function has no refinements, cache is empty: [0]

Building cache for <<, with spec: [data bits]...
Function has no refinements, cache is empty: [0]

Building cache for or, with spec: [value1 value2 return:]...
Function has no refinements, cache is empty: [0]

Building cache for cause-error, with spec: [err-type err-id args]...
Function has no refinements, cache is empty: [0]

Building cache for view, with spec: [spec /tight /options opts /flags flgs /no-wait]...
Has 4 refinements: /tight /options /flags /no-wait
Resolved ids are: 1782 635 117 1814
Created cache in 1 iterations: [12 -1 -1 7 -1 -1 -1 2 -1 -1 5 -1 3]
Testing lookups...
offset of /non-existing: none
offset of /tight: 2
offset of /options: 3
offset of /flags: 5
offset of /no-wait: 7

Building cache for unview, with spec: [/all /only face /local all? svs pane]...
Has 3 refinements: /all /only /local
Resolved ids are: 260 91 235
Created cache in 2 iterations: [10 1 2 -1 -1 -1 4 -1 -1 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /all: 1
offset of /only: 2
offset of /local: 4

Building cache for error?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for quit-return, with spec: [status]...
Function has no refinements, cache is empty: [0]

Building cache for series?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for map?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for =, with spec: [value1 value2]...
Function has no refinements, cache is empty: [0]

Building cache for none?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for any-block?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for any-list?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for binary?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for any-string?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for block?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for bitset?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for tag?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for also, with spec: [value1 value2]...
Function has no refinements, cache is empty: [0]

Building cache for **, with spec: [number exponent return:]...
Function has no refinements, cache is empty: [0]

Building cache for *, with spec: [value1 value2 return:]...
Function has no refinements, cache is empty: [0]

Building cache for /, with spec: [value1 value2 return:]...
Function has no refinements, cache is empty: [0]

Building cache for //, with spec: [a b return: /local r]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 4 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 4

Building cache for word?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for url?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for string?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for suffix?, with spec: [path]...
Function has no refinements, cache is empty: [0]

Building cache for second, with spec: [s]...
Function has no refinements, cache is empty: [0]

Building cache for file?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for object?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for body-of, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for first, with spec: [s]...
Function has no refinements, cache is empty: [0]

Building cache for third, with spec: [s]...
Function has no refinements, cache is empty: [0]

Building cache for -, with spec: [value1 value2 return:]...
Function has no refinements, cache is empty: [0]

Building cache for >, with spec: [value1 value2]...
Function has no refinements, cache is empty: [0]

Building cache for mod, with spec: [a b return: /local r]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 4 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 4

Building cache for <=, with spec: [value1 value2]...
Function has no refinements, cache is empty: [0]

Building cache for clean-path, with spec: [file /only /dir /local out cnt f not-file? prot]...
Has 3 refinements: /only /dir /local
Resolved ids are: 91 501 235
Created cache in 3 iterations: [11 -1 -1 -1 2 4 -1 3 -1 -1 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /only: 2
offset of /dir: 3
offset of /local: 4

Building cache for dir?, with spec: [file]...
Function has no refinements, cache is empty: [0]

Building cache for exists?, with spec: [path return:]...
Function has no refinements, cache is empty: [0]

Building cache for normalize-dir, with spec: [dir]...
Function has no refinements, cache is empty: [0]

Building cache for empty?, with spec: [series return:]...
Function has no refinements, cache is empty: [0]

Building cache for dirize, with spec: [path]...
Function has no refinements, cache is empty: [0]

Building cache for create-dir, with spec: [path]...
Function has no refinements, cache is empty: [0]

Building cache for attempt, with spec: [value /safer]...
Has 1 refinements: /safer
Resolved ids are: 553
Created cache in 1 iterations: [3 -1 2 -1]
Testing lookups...
offset of /non-existing: none
offset of /safer: 2

Building cache for charset, with spec: [spec]...
Function has no refinements, cache is empty: [0]

Building cache for what-dir, with spec: [/local path]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 1 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 1

Building cache for expand-directives, with spec: [code /clean /local job]...
Has 2 refinements: /clean /local
Resolved ids are: 1371 235
Created cache in 1 iterations: [6 -1 3 -1 2 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /clean: 2
offset of /local: 3

Building cache for split-path, with spec: [target /local dir pos]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 2 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 2

Building cache for change-dir, with spec: [dir]...
Function has no refinements, cache is empty: [0]

Building cache for path-thru, with spec: [url return: /local so hash file path]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 3 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 3

Building cache for save, with spec: [where value /header header-data /all /length /as format /local dst codec data suffix find-encoder? name pos header-str k v]...
Has 5 refinements: /header /all /length /as /local
Resolved ids are: 495 260 289 322 235
Created cache in 1 iterations: [15 3 -1 -1 -1 6 5 -1 7 -1 -1 9 -1 -1 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /header: 3
offset of /all: 5
offset of /length: 6
offset of /as: 7
offset of /local: 9

Building cache for load-thru, with spec: [url /update /as type /local path file]...
Has 3 refinements: /update /as /local
Resolved ids are: 221 322 235
Created cache in 1 iterations: [9 -1 5 -1 -1 -1 2 -1 3 -1]
Testing lookups...
offset of /non-existing: none
offset of /update: 2
offset of /as: 3
offset of /local: 5

Building cache for sum, with spec: [values /local result value]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 2 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 2

Building cache for set-quiet, with spec: [word value]...
Function has no refinements, cache is empty: [0]

Building cache for set-slot-quiet, with spec: [series value]...
Function has no refinements, cache is empty: [0]

Building cache for =?, with spec: [value1 value2]...
Function has no refinements, cache is empty: [0]

Building cache for >>, with spec: [data bits]...
Function has no refinements, cache is empty: [0]

Building cache for any-word?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for words-of, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-json, with spec: [data /pretty indent /ascii /local result]...
Has 3 refinements: /pretty /ascii /local
Resolved ids are: 1178 1179 235
Created cache in 1 iterations: [9 4 5 -1 -1 -1 -1 -1 -1 2]
Testing lookups...
offset of /non-existing: none
offset of /pretty: 2
offset of /ascii: 4
offset of /local: 5

Building cache for load-json, with spec: [input]...
Function has no refinements, cache is empty: [0]

Building cache for to-csv, with spec: [data /with delimiter /skip size /quote qt-char /local longest keyval? types value]...
Has 4 refinements: /with /skip /quote /local
Resolved ids are: 239 80 76 235
Created cache in 1 iterations: [12 -1 -1 -1 -1 6 -1 -1 8 4 -1 -1 2]
Testing lookups...
offset of /non-existing: none
offset of /with: 2
offset of /skip: 4
offset of /quote: 6
offset of /local: 8

Building cache for load-csv, with spec: [data /with delimiter /header /as-columns /as-records /flat /trim /quote qt-char /local disallowed refs output out-map longest line value newline quotchars valchars quoted-value char normal-value s e single-value values add-value add-line length index line-rule init parsed? mark key-index key]...
Has 8 refinements: /with /header /as-columns /as-records /flat /trim /quote /local
Resolved ids are: 239 495 1215 1216 261 186 76 235
Created cache in 4 iterations: [27 5 6 -1 -1 -1 -1 -1 -1 -1 4 -1 -1 -1 -1 -1 -1 -1 -1 7 11 -1 -1 9 2 8 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /with: 2
offset of /header: 4
offset of /as-columns: 5
offset of /as-records: 6
offset of /flat: 7
offset of /trim: 8
offset of /quote: 9
offset of /local: 11

Building cache for replace, with spec: [series pattern value /all /deep /case /local parse? form? quote? deep? rule many? size seek]...
Has 4 refinements: /all /deep /case /local
Resolved ids are: 260 295 77 235
Created cache in 2 iterations: [13 4 7 -1 -1 -1 -1 -1 -1 -1 5 -1 -1 6]
Testing lookups...
offset of /non-existing: none
offset of /all: 4
offset of /deep: 5
offset of /case: 6
offset of /local: 7

Building cache for keys-of, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for rejoin, with spec: [block]...
Function has no refinements, cache is empty: [0]

Building cache for assert, with spec: [contract /local msg]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 2 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 2

Building cache for >=, with spec: [value1 value2]...
Function has no refinements, cache is empty: [0]

Building cache for reactor, with spec: [spec]...
Function has no refinements, cache is empty: [0]

Building cache for repend, with spec: [series value /only]...
Has 1 refinements: /only
Resolved ids are: 91
Created cache in 1 iterations: [3 -1 3 -1]
Testing lookups...
offset of /non-existing: none
offset of /only: 3

Building cache for set-word?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for stop-reactor, with spec: [face /deep /local list pos f]...
Has 2 refinements: /deep /local
Resolved ids are: 295 235
Created cache in 2 iterations: [7 -1 2 -1 -1 3 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /deep: 2
offset of /local: 3

Building cache for react, with spec: [reaction /link objects /unlink src /later /with ctx return: /local objs found? rule item pos obj saved part path]...
Has 5 refinements: /link /unlink /later /with /local
Resolved ids are: 1280 1282 1279 239 235
Created cache in 1 iterations: [15 -1 -1 -1 -1 6 2 -1 4 -1 -1 10 -1 -1 -1 7]
Testing lookups...
offset of /non-existing: none
offset of /link: 2
offset of /unlink: 4
offset of /later: 6
offset of /with: 7
offset of /local: 10

Building cache for function?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for spec-of, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for unset?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for halt, with spec: [/return status]...
Has 1 refinements: /return
Resolved ids are: 58
Created cache in 1 iterations: [3 -1 1 -1]
Testing lookups...
offset of /non-existing: none
offset of /return: 1

Building cache for get-word?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for paren?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for integer?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for any-function?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for path?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for op?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-paren, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for routine, with spec: [spec body]...
Function has no refinements, cache is empty: [0]

Building cache for to-red-file, with spec: [path return: /local colon? slash? len i c dst]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 3 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 3

Building cache for as-color, with spec: [r g b]...
Function has no refinements, cache is empty: [0]

Building cache for as-rgba, with spec: [a b c d]...
Function has no refinements, cache is empty: [0]

Building cache for class-of, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for size-text, with spec: [face /with text return: /local h]...
Has 2 refinements: /with /local
Resolved ids are: 239 235
Created cache in 1 iterations: [6 -1 5 -1 -1 -1 2]
Testing lookups...
offset of /non-existing: none
offset of /with: 2
offset of /local: 5

Building cache for hex-to-rgb, with spec: [hex return: /local str bin]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 3 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 3

Building cache for tuple?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for offset?, with spec: [series1 series2]...
Function has no refinements, cache is empty: [0]

Building cache for make-face, with spec: [style /spec blk /offset xy /size wh /local svv face styles model opts css]...
Has 4 refinements: /spec /offset /size /local
Resolved ids are: 52 112 129 235
Created cache in 2 iterations: [13 2 8 -1 -1 -1 -1 -1 -1 4 -1 -1 -1 6]
Testing lookups...
offset of /non-existing: none
offset of /spec: 2
offset of /offset: 4
offset of /size: 6
offset of /local: 8

Building cache for debug-info?, with spec: [face return:]...
Function has no refinements, cache is empty: [0]

Building cache for find-flag?, with spec: [facet flag]...
Function has no refinements, cache is empty: [0]

Building cache for draw, with spec: [image cmd /transparent return:]...
Has 1 refinements: /transparent
Resolved ids are: 1669
Created cache in 1 iterations: [3 -1 3 -1]
Testing lookups...
offset of /non-existing: none
offset of /transparent: 3

Building cache for handle?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for link-tabs-to-parent, with spec: [face /init /local faces visible?]...
Has 2 refinements: /init /local
Resolved ids are: 1230 235
Created cache in 1 iterations: [6 2 3 -1 -1 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /init: 2
offset of /local: 3

Building cache for link-sub-to-parent, with spec: [face type old new /local parent]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 5 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 5

Building cache for on-face-deep-change*, with spec: [owner word target action new index part state forced? /local faces face modal? pane]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 10 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 10

Building cache for update-font-faces, with spec: [parent /local f]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 2 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 2

Building cache for do-actor, with spec: [face event type /local result act name]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 4 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 4

Building cache for do-safe, with spec: [code /local result error]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 2 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 2

Building cache for event?, with spec: [value return:]...
Function has no refinements, cache is empty: [0]

Building cache for do-events, with spec: [/no-wait return: /local result win]...
Has 2 refinements: /no-wait /local
Resolved ids are: 1814 235
Created cache in 1 iterations: [6 -1 3 1 -1 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /no-wait: 1
offset of /local: 3

Building cache for pair?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for foreach-face, with spec: [face body /with spec /post /sub post? /local exec]...
Has 4 refinements: /with /post /sub /local
Resolved ids are: 239 127 1836 235
Created cache in 2 iterations: [13 -1 8 -1 6 -1 3 -1 -1 -1 -1 5 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /with: 3
offset of /post: 5
offset of /sub: 6
offset of /local: 8

Building cache for pad, with spec: [str n /left /with c return:]...
Has 2 refinements: /left /with
Resolved ids are: 399 239
Created cache in 1 iterations: [6 -1 -1 -1 3 -1 4]
Testing lookups...
offset of /non-existing: none
offset of /left: 3
offset of /with: 4

Building cache for issue?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for alter, with spec: [series value]...
Function has no refinements, cache is empty: [0]

Building cache for typeset?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for datatype?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for layout, with spec: [spec /tight /options user-opts /flags flgs /only /parent panel divides /styles css /local axis anti background! list reactors local-styles pane-size direction align begin size max-sz current global? below? top-left bound cursor origin spacing opts opt-words re-align sz words reset focal-face svmp pad value anti2 at-offset later? name styling? style styled? st actors face h pos styled w blk vid-align mar divide? index dir pad2 image]...
Has 7 refinements: /tight /options /flags /only /parent /styles /local
Resolved ids are: 1782 635 117 91 1079 1671 235
Created cache in 2 iterations: [22 2 8 -1 7 -1 -1 -1 5 -1 -1 -1 -1 -1 -1 -1 13 -1 -1 -1 3 -1 11]
Testing lookups...
offset of /non-existing: none
offset of /tight: 2
offset of /options: 3
offset of /flags: 5
offset of /only: 7
offset of /parent: 8
offset of /styles: 11
offset of /local: 13

Building cache for set-flag, with spec: [face facet value /local flags]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 4 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 4

Building cache for extract, with spec: [series width /index pos /into output]...
Has 2 refinements: /index /into
Resolved ids are: 292 73
Created cache in 1 iterations: [6 -1 5 -1 -1 3 -1]
Testing lookups...
offset of /non-existing: none
offset of /index: 3
offset of /into: 5

Building cache for image?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for rtd-layout, with spec: [spec /only /with face return:]...
Has 2 refinements: /only /with
Resolved ids are: 91 239
Created cache in 1 iterations: [6 -1 2 -1 -1 -1 3]
Testing lookups...
offset of /non-existing: none
offset of /only: 2
offset of /with: 3

Building cache for to-logic, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-set-word, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-block, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for stop-events, with spec: []...
Function has no refinements, cache is empty: [0]

Building cache for center-face, with spec: [face /x /y /with parent return: /local pos]...
Has 4 refinements: /x /y /with /local
Resolved ids are: 97 98 239 235
Created cache in 1 iterations: [12 -1 2 3 -1 -1 -1 -1 7 -1 -1 -1 4]
Testing lookups...
offset of /non-existing: none
offset of /x: 2
offset of /y: 3
offset of /with: 4
offset of /local: 7

Building cache for dump-face, with spec: [face /local depth f]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 2 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 2

Building cache for request-font, with spec: [/font ft /mono]...
Has 2 refinements: /font /mono
Resolved ids are: 1434 1834
Created cache in 1 iterations: [6 1 -1 -1 -1 3 -1]
Testing lookups...
offset of /non-existing: none
offset of /font: 1
offset of /mono: 3

Building cache for request-file, with spec: [/title text /file name /filter list /save /multi]...
Has 5 refinements: /title /file /filter /save /multi
Resolved ids are: 544 314 1641 681 1835
Created cache in 3 iterations: [17 1 7 -1 -1 -1 -1 -1 -1 3 5 -1 -1 -1 -1 -1 -1 8]
Testing lookups...
offset of /non-existing: none
offset of /title: 1
offset of /file: 3
offset of /filter: 5
offset of /save: 7
offset of /multi: 8

Building cache for request-dir, with spec: [/title text /dir name /filter list /keep /multi]...
Has 5 refinements: /title /dir /filter /keep /multi
Resolved ids are: 544 501 1641 93 1835
Created cache in 2 iterations: [16 1 -1 -1 -1 -1 3 -1 -1 -1 5 -1 8 -1 7 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /title: 1
offset of /dir: 3
offset of /filter: 5
offset of /keep: 7
offset of /multi: 8

Building cache for shift-right, with spec: [data bits]...
Function has no refinements, cache is empty: [0]

Building cache for shift-left, with spec: [data bits]...
Function has no refinements, cache is empty: [0]

Building cache for shift-logical, with spec: [data bits]...
Function has no refinements, cache is empty: [0]

Building cache for os-info, with spec: []...
Function has no refinements, cache is empty: [0]

Building cache for as-ipv4, with spec: [a b c d]...
Function has no refinements, cache is empty: [0]

Building cache for count-chars, with spec: [start pos return:]...
Function has no refinements, cache is empty: [0]

Building cache for read-clipboard, with spec: [return:]...
Function has no refinements, cache is empty: [0]

Building cache for write-clipboard, with spec: [data return:]...
Function has no refinements, cache is empty: [0]

Building cache for write-stdout, with spec: [data]...
Function has no refinements, cache is empty: [0]

Building cache for alert, with spec: [msg]...
Function has no refinements, cache is empty: [0]

Building cache for ??, with spec: ['value]...
Function has no refinements, cache is empty: [0]

Building cache for probe, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for fourth, with spec: [s]...
Function has no refinements, cache is empty: [0]

Building cache for fifth, with spec: [s]...
Function has no refinements, cache is empty: [0]

Building cache for values-of, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for char?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for email?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for float?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for get-path?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for hash?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for lit-path?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for lit-word?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for logic?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for percent?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for refinement?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for set-path?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for time?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for date?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for money?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for ref?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for action?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for native?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for routine?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for vector?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for any-object?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for any-path?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for number?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for immediate?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for scalar?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for all-word?, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-bitset, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-binary, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-char, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-email, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-file, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-float, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-get-path, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-get-word, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-hash, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-integer, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-issue, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-lit-path, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-lit-word, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-map, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-none, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-pair, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-path, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-percent, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-refinement, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-set-path, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-string, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-tag, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-time, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-typeset, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-tuple, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-unset, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-url, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-word, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-image, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-date, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-money, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for to-ref, with spec: [value]...
Function has no refinements, cache is empty: [0]

Building cache for parse-trace, with spec: [input rules /case /part limit return:]...
Has 2 refinements: /case /part
Resolved ids are: 77 238
Created cache in 1 iterations: [6 -1 -1 -1 -1 4 3]
Testing lookups...
offset of /non-existing: none
offset of /case: 3
offset of /part: 4

Building cache for modulo, with spec: [a b return: /local r]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 4 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 4

Building cache for eval-set-path, with spec: [value1]...
Function has no refinements, cache is empty: [0]

Building cache for extract-boot-args, with spec: [/local args at-arg2 ws split-mode arg-end s' e' arg2-update s e]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 1 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 1

Building cache for flip-exe-flag, with spec: [path /local file buffer flag]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 2 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 2

Building cache for split, with spec: [series dlm /local s num]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 3 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 3

Building cache for do-file, with spec: [file /local ws saved src code new-path header list c]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 2 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 2

Building cache for exists-thru?, with spec: [url]...
Function has no refinements, cache is empty: [0]

Building cache for read-thru, with spec: [url /update /binary /local path data]...
Has 3 refinements: /update /binary /local
Resolved ids are: 221 320 235
Created cache in 2 iterations: [10 3 2 -1 -1 -1 4 -1 -1 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /update: 2
offset of /binary: 3
offset of /local: 4

Building cache for do-thru, with spec: [url /update]...
Has 1 refinements: /update
Resolved ids are: 221
Created cache in 1 iterations: [3 -1 -1 2]
Testing lookups...
offset of /non-existing: none
offset of /update: 2

Building cache for cos, with spec: [angle]...
Function has no refinements, cache is empty: [0]

Building cache for sin, with spec: [angle]...
Function has no refinements, cache is empty: [0]

Building cache for tan, with spec: [angle]...
Function has no refinements, cache is empty: [0]

Building cache for acos, with spec: [cosine]...
Function has no refinements, cache is empty: [0]

Building cache for asin, with spec: [sine]...
Function has no refinements, cache is empty: [0]

Building cache for atan, with spec: [tangent]...
Function has no refinements, cache is empty: [0]

Building cache for atan2, with spec: [y x return:]...
Function has no refinements, cache is empty: [0]

Building cache for sqrt, with spec: [number return:]...
Function has no refinements, cache is empty: [0]

Building cache for to-UTC-date, with spec: [date return:]...
Function has no refinements, cache is empty: [0]

Building cache for to-local-date, with spec: [date return:]...
Function has no refinements, cache is empty: [0]

Building cache for transcode-trace, with spec: [src]...
Function has no refinements, cache is empty: [0]

Building cache for average, with spec: [block]...
Function has no refinements, cache is empty: [0]

Building cache for last?, with spec: [series]...
Function has no refinements, cache is empty: [0]

Building cache for dt, with spec: [body return: /local t0]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 3 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 3

Building cache for single?, with spec: [series]...
Function has no refinements, cache is empty: [0]

Building cache for ==, with spec: [value1 value2]...
Function has no refinements, cache is empty: [0]

Building cache for >>>, with spec: [data bits]...
Function has no refinements, cache is empty: [0]

Building cache for and, with spec: [value1 value2 return:]...
Function has no refinements, cache is empty: [0]

Building cache for xor, with spec: [value1 value2 return:]...
Function has no refinements, cache is empty: [0]

Building cache for deep-reactor, with spec: [spec]...
Function has no refinements, cache is empty: [0]

Building cache for clear-reactions, with spec: []...
Function has no refinements, cache is empty: [0]

Building cache for dump-reactions, with spec: [/local limit count obj field reaction target list]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 1 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 1

Building cache for is, with spec: ['field reaction /local obj rule item]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 3 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 3

Building cache for react?, with spec: [reactor field /target return: /local pos]...
Has 2 refinements: /target /local
Resolved ids are: 262 235
Created cache in 1 iterations: [6 -1 5 -1 -1 3 -1]
Testing lookups...
offset of /non-existing: none
offset of /target: 3
offset of /local: 5

Building cache for register-scheme, with spec: [spec /native dispatch]...
Has 1 refinements: /native
Resolved ids are: 1288
Created cache in 1 iterations: [3 -1 2 -1]
Testing lookups...
offset of /non-existing: none
offset of /native: 2

Building cache for decode-url, with spec: [url]...
Function has no refinements, cache is empty: [0]

Building cache for encode-url, with spec: [url-obj /local result]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 2 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 2

Building cache for within?, with spec: [point offset size return:]...
Function has no refinements, cache is empty: [0]

Building cache for overlap?, with spec: [A B return: /local A1 B1 A2 B2]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 4 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 4

Building cache for distance?, with spec: [A B return:]...
Function has no refinements, cache is empty: [0]

Building cache for face?, with spec: [value return:]...
Function has no refinements, cache is empty: [0]

Building cache for caret-to-offset, with spec: [face pos /lower return: /local opt]...
Has 2 refinements: /lower /local
Resolved ids are: 1404 235
Created cache in 1 iterations: [6 3 5 -1 -1 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /lower: 3
offset of /local: 5

Building cache for offset-to-caret, with spec: [face pt return:]...
Function has no refinements, cache is empty: [0]

Building cache for offset-to-char, with spec: [face pt return:]...
Function has no refinements, cache is empty: [0]

Building cache for metrics?, with spec: [face type /total axis /local res]...
Has 2 refinements: /total /local
Resolved ids are: 1351 235
Created cache in 2 iterations: [7 3 -1 -1 -1 5 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /total: 3
offset of /local: 5

Building cache for get-scroller, with spec: [face orientation return: /local position page min-size max-size parent vertical?]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 4 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 4

Building cache for insert-event-func, with spec: [fun]...
Function has no refinements, cache is empty: [0]

Building cache for remove-event-func, with spec: [fun]...
Function has no refinements, cache is empty: [0]

Building cache for set-focus, with spec: [face /local p]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 2 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 2

Building cache for keep-type, with spec: [list type /local r]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 3 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 3

Building cache for composite, with spec: [ctx str /local s b v e]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 3 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 3

Building cache for bind-only, with spec: [where what /strict /local w found? finder p ctx rule]...
Has 2 refinements: /strict /local
Resolved ids are: 2169 235
Created cache in 1 iterations: [6 -1 4 -1 3 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /strict: 3
offset of /local: 4

Building cache for for-each, with spec: ['spec series code /reverse /stride /case /same /local _ w x r index-word val-cmp-op types values values-mask use-types? get-word word type use-values? filtered? size range? step ahead length index end-cond ctx index-word-bound upd-idx where refill prefix old spec-fill test type-check values-check move-idxs advance]...
Has 5 refinements: /reverse /stride /case /same /local
Resolved ids are: 178 2184 77 298 235
Created cache in 2 iterations: [16 -1 -1 4 -1 -1 -1 -1 -1 5 -1 7 8 -1 6 -1 -1]
Testing lookups...
offset of /non-existing: none
offset of /reverse: 4
offset of /stride: 5
offset of /case: 6
offset of /same: 7
offset of /local: 8

Building cache for map-each, with spec: ['spec series code /only /eval /drop /case /same /self /local r size track? pos index-word get-pos call keep do-code tgt old-advance new-advance new do-once old advance]...
Has 7 refinements: /only /eval /drop /case /same /self /local
Resolved ids are: 91 1262 1544 77 298 99 235
Created cache in 5 iterations: [25 -1 -1 7 -1 -1 -1 -1 -1 -1 -1 10 -1 5 -1 -1 -1 4 -1 -1 6 -1 -1 -1 8 9]
Testing lookups...
offset of /non-existing: none
offset of /only: 4
offset of /eval: 5
offset of /drop: 6
offset of /case: 7
offset of /same: 8
offset of /self: 9
offset of /local: 10

Building cache for format-number, with spec: [num integral frac /local r dot n]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 4 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 4

Building cache for create-cache, with spec: [spec ids /local refs n0 n r id i iter]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 3 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 3

Building cache for word-id, with spec: [word return:]...
Function has no refinements, cache is empty: [0]

Building cache for get-ref-offset, with spec: [ref spec cache /local period o]...
Has 1 refinements: /local
Resolved ids are: 235
Created cache in 1 iterations: [3 -1 4 -1]
Testing lookups...
offset of /non-existing: none
offset of /local: 4
=== Maximum number of iterations to create the cache: 7, mean: 0.41
=== Total number of iterations to create all caches: 185
=== Total cache size: 4940 bytes for 441 functions - that's 11.2 bytes per function

@hiiamboris
Copy link
Author

hiiamboris commented Mar 21, 2021

[Click to see] More optimized version (doesn't have to clear the cache after each iteration, and with a special case for 1 refinement)
Red []
#include %keep-type.red
#include %composite.red
#include %map-each.red
#include %format-number.red

#macro [#print string!] func [[manual] s e] [insert remove s [print #composite] s]

word-id: routine [word [any-type!] return: [integer!] /local w] [
	w: as red-word! word
	w/symbol
]

starting-length-factor: any [attempt [to 1 system/options/args/1]  1]
growth-per-iteration: 1

max-iter: total-iter: 0
total-size: 0

create-cache: function [spec [block!] ids [block!]] [
	;-- build a list [/ref1-id index-of-ref1 /ref2-id index-of-ref2 ...] to speedup cache creation
	refs: map-each/drop/eval [/i ref [refinement!]] spec [[word-id ref  i]]

	n0: n: starting-length-factor * length? ids
	if 1 = n [						;-- special case of only one refinement (e.g. /local)
		cache: reduce [1 refs/2]
		#print "Created cache immediately for single refinement: (mold cache)"
		set 'total-size total-size + length? cache
		return cache
	]

	;-- buffers should be static so we won't have to reallocate them
	slots: clear []
	append/dup slots -1 n							;-- build a buffer of size = n which will hold the remainders
	cache: clear next [0]							;-- cache will hold words ids (and `n`), filled at the same time
	append/dup cache -1 n
	forever [										;-- increases cache until there are no collisions
		collision?: no
		foreach id ids [
			i: id % n + 1
			if slots/:i = n [collision?: yes break]		;-- slot is already occupied - need bigger cache
			slots/:i: n									;-- occupy the id % n slot, `n` marks which iteration occupied it
			cache/:i: id								;-- save the id so we won't have to repeat (slow) division
		]
		unless collision? [
			cache/-1: n									;-- save the cache size
			repeat i n [								;-- finish the cache creation
				id: cache/:i
				cache/:i: either slots/:i = n [
					select/skip refs id 2				;-- by filling it with /ref indexes
				][	-1									;-- and removing leftovers from previous iterations
				]
			]
			break
		]
		n: n + growth-per-iteration						;-- try longer cache
		append/dup slots -1 growth-per-iteration
		append/dup cache -1 growth-per-iteration
	]
	cache: copy head cache
	#print "Created cache in (iter: n - n0 + 1) iterations: (mold cache)"
	set 'max-iter max max-iter iter
	set 'total-iter total-iter + iter
	set 'total-size total-size + length? cache
	cache
]

get-ref-offset: function [ref [refinement!] spec [block!] cache [block!]] [
	if 0 = period: cache/1 [return none]		;-- no refinements in this func
	o: pick cache (word-id ref) % period + 2
	if o < 0 [return none]						;-- unused cache slot
	if spec/:o <> ref [return none]				;-- provided refinement does not exist in the spec
	o											;-- return refinement offset
]

;-- extreme case
; all-refs: [/part /key /into /local /deep /types /only /dup /any /case /some /all /same /with /skip /last /reverse /tail /match /seed /secure /compare /stable /head /auto /lines /name /new /read /write /seek /allow /binary /info /as /append /next /fast /header /trap /flat /to /even /down /half-down /floor /ceiling /half-ceiling /extern /default /expand /args /word /show /force /copy /trace /left /logical /size /radians /return /base /full /year /month /day /time /zone /date /weekday /yearday /precise /utc /wait /console /shell /input /output /error /zlib /deflate /on /off /one /prescan /scan /tight /options /flags /no-wait /dir /safer /clean /length /update /pretty /ascii /quote /as-columns /as-records /trim /link /unlink /later /spec /offset /transparent /init /post /sub /parent /styles /index /x /y /font /mono /title /file /filter /save /multi /keep /target /native /lower /total /strict /stride /eval /drop /self]
; f1: func all-refs []
; f2: func sort copy all-refs []
; f3: func sort/reverse copy all-refs []
; probe length? all-refs

list: to [] system/words
#print "((length? list) / 2) words total"
total-fun: 0

foreach [name value] list [
	unless any-function? :value [continue]
	unless spec: attempt [spec-of :value] [continue]
	spec: keep-type spec all-word!
	set 'total-fun total-fun + 1
	
	#print "^/Building cache for (name), with spec: (mold/flat spec)..."
	refs: keep-type spec refinement!
	; append all-refs refs
	if tail? refs [
		print "Function has no refinements, cache is empty: [0]"
		set 'total-size total-size + 1		;-- count the `0` too
		continue
	]
	#print "Has (length? refs) refinements: (mold/only/flat refs)"
	ids: map-each ref refs [word-id ref]
	#print "Resolved ids are: (ids)"
	cache: create-cache spec ids

	print "Testing lookups..."
	#print "offset of /non-existing: (get-ref-offset /non-existing spec cache)"
	foreach ref refs [
		#print "offset of (mold ref): (get-ref-offset ref spec cache)"
	]

	; #print [pad name 20 word-id name]
]

#print "=== Maximum number of iterations to create the cache: (max-iter), mean: (format-number total-iter / total-fun 1 2)"
#print "=== Total number of iterations to create all caches: (total-iter)"
#print "=== Total cache size: (total-size * 4) bytes for (total-fun) functions - that's (format-number total-size * 4 / total-fun 1 1) bytes per function"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment