vile / bench / runtime / CALLS-367.md
69 lines · 56 sloc · 6.23 KB · 76646891b77a3d5c6af4a1e42b122cd61dc1654b
Raw

Ordinary fixed-arity closure entry (367)

Fixed-arity closure calls can enter through a smaller ordinary-interpreter path. It validates the live procedure owner and mode, argument count, code protocol, available application budget, frame limit/capacity and pending GOOPS state. Rest/keyword procedures, internal nil-code bridges, special method bindings, control execution, hard-bounded VMs and frame growth retain the complete dispatcher. An active native scope always retains the original native-backend opportunity.

The existing activation API still owns environment reuse, allocation, internal-definition reset, escape tracking and tail-parent cleanup. Parameter copies, saved frames, stack truncation and return registers preserve the ordinary calling convention. Success charges the same single application step; rejected cases fall through without mutation so original error ordering and source locations remain available. No bytecode rewrite, JIT, persistent environment pointer or GC dependency is added.

All 127 relevant ordinary-interpreter cases and 147 native/fallback cases pass under both ASan/UBSan and Boehm, plus CLI and default-build budget checks. Coverage includes comparison with single-instruction results/errors/exact step counts, every limit from 1 through 47 on representative programs, bounded-dispatch budgets, live bindings, primitive extensions, both syntaxes, large indexes, vector identities, continuation reentry, source locations, controls, namespaces, libraries, stack roots, parameters and arena ownership. Tests ran in serial groups under the shared lock.

All 36 unchanged workloads are included: 24 runtime and 12 mock-WM, retained366 interpreter GC/arena and new367 interpreter GC/arena, plus Guile 3.0.10 with frozen guild-O2 wrappers and default JIT. Ten fresh processes per configuration/workload give nine retained process samples. All 1800 checked rows pass; every Vile warmup/measured native entry, compilation and cache counter is zero. Builds and tests were separate from timings on the same idle Intel Mac mini using hash-verified snapshots. Prepared per-call medians exclude parsing, setup and first use; raw first-call and whole-process times remain available.

All eight 4-versus-400-call scaling groups pass with three repeats per count, at least 20x total-time growth, and zero native execution/compilation. Fixtures, four-input oracles, batch sizes and five warmup calls are unchanged. The initial cached-only entry trial is archived separately in validation/interpreter367-initial-trial, including its WM regressions. The retained candidate removes an unnecessary allocation-eligibility probe and orders cheap callable checks first, while keeping the original activation API and its policies.

Suite GC gain vs366 Arena gain vs366 Guile advantage over GC Guile advantage over arena
wm 1.047x 1.052x 5.035x 5.321x
runtime 1.087x 1.080x 7.881x 8.123x
all36 1.073x 1.071x 6.788x 7.055x

Guile advantage is Vile time divided by Guile time: above one means Guile is faster. All 36 gives every workload equal weight. Guile still leads; the full 1.5x-faster goal is unmet and final 31-sample/full-objective verification remains outstanding. This report measures the interpreter; previous native-backend comparisons keep their own source snapshots.

Regressions over 5%: none. All losses remain in the tables and aggregates.

wm

Workload 366 GC ms 367 GC ms Guile ms GC gain Arena gain
wm-callback-chain 5.863615 5.159008 0.638000 1.137x 1.114x
wm-event-dispatch 4.307897 3.948793 0.214000 1.091x 1.087x
wm-focus-cycle 5.076728 4.740452 0.378000 1.071x 1.072x
wm-tiling-layout 2.944797 2.719392 0.113250 1.083x 1.092x
wm-workspace-move 1.579816 1.500483 0.173750 1.053x 1.066x
wm-keybindings 4.514221 4.625516 0.279500 0.976x 1.005x
wm-hooks 3.449728 3.307205 0.355000 1.043x 1.034x
wm-lifecycle 1.196996 1.132627 0.125500 1.057x 1.067x
wm-macro-config 4.577148 4.554233 5.269750 1.005x 1.015x
wm-config-load-tree 5.181835 5.188141 8.995750 0.999x 0.998x
wm-reload-live 8.587702 8.255301 8.243750 1.040x 1.043x
wm-session-replay 8.123636 7.918745 8.035000 1.026x 1.043x

runtime

Workload 366 GC ms 367 GC ms Guile ms GC gain Arena gain
tail-sum-10k 0.864823 0.707601 0.033660 1.222x 1.251x
fib-20 5.544286 4.518425 0.311270 1.227x 1.247x
closure-5k 0.703134 0.539326 0.015520 1.304x 1.257x
list-3k 1.139275 1.066718 0.059870 1.068x 1.042x
flonum-sum-2k 0.499842 0.485081 0.095583 1.030x 1.027x
bignum-fib-200 0.051333 0.048352 0.005500 1.062x 1.036x
rational-harmonic-80 0.095122 0.094450 0.049750 1.007x 1.011x
integer-divmod-5k 0.874201 0.839079 0.168167 1.042x 1.072x
list-map-1k 0.127903 0.130921 0.048417 0.977x 0.998x
list-reverse-2k 0.664303 0.647755 0.060583 1.026x 0.989x
vector-update-2k 0.422427 0.379120 0.016167 1.114x 1.065x
bytevector-fill-4k 0.830020 0.791310 0.086083 1.049x 1.083x
hashtable-count-1k 0.448351 0.433416 6.005083 1.034x 1.039x
string-build-1k 0.043221 0.041848 0.043250 1.033x 1.026x
string-scan-4k 0.964050 0.898034 0.043750 1.074x 1.035x
unicode-scan-1k 0.254893 0.241261 0.011750 1.057x 1.052x
datum-read-write-200 1.225931 1.216574 2.266625 1.008x 1.014x
closure-mutate-2k 0.356942 0.290868 0.008500 1.227x 1.170x
higher-order-2k 0.506912 0.375527 0.006333 1.350x 1.280x
callcc-escape-1k 0.087828 0.072329 0.006667 1.214x 1.239x
values-consumer-1k 0.625344 0.609207 0.004417 1.026x 1.027x
dynamic-wind-200 0.142540 0.142272 0.012667 1.002x 1.014x
goops-dispatch-1k 0.742892 0.745467 0.110375 0.997x 1.005x
goops-allocate-200 0.103836 0.100168 0.055000 1.037x 1.043x

Build snapshot: vile-resume.m2oth4qk. Verification: vile-resume.pbk1349e. Measurement: vile-resume.0fezqnsg. Recovery: validation/interpreter367/.