vile / bench / runtime / BRANCHES-370.md
69 lines · 56 sloc · 5.95 KB · 76646891b77a3d5c6af4a1e42b122cd61dc1654b
Raw

Primitive-result conditional branches (370)

After a successful ordinary fusion of two pure operand loads and their primitive call, an immediately following conditional branch can consume the result directly. The VM preserves the branch’s separate virtual instruction charge and source origin, using the existing truth predicate. Tail calls keep their original return path. Bytecode remains immutable and there is no new opcode, cache, GC dependency or per-call allocation.

When a positive instruction budget has no additional branch step available, the branch executes individually, preserving its precise denial position and step count. Existing eligibility checks still reject unsupported shapes, uninitialized operands, extended/foreign procedures, invalid indexes, numeric errors and promotion. Controlled and hard-bounded execution retain individual dispatch through the original caller guards.

All 257 ordinary-interpreter cases and 150 native/fallback cases pass under ASan/UBSan and Boehm, plus CLI and default-build budget checks. Three new regressions compare values and exact virtual steps against single-instruction execution, every budget from 0 through 55 on representative true/false/error paths, zero truthiness, mutable vector values and live procedure rebinding. Earlier ownership, scope, map, continuation, macro, promise, record and GOOPS checks remain included.

All 36 unchanged workloads are included: 24 runtime and 12 mock-WM, retained369 and candidate370 interpreters in GC and arena modes, plus Guile 3.0.10 with frozen guild-O2 wrappers and default JIT. Ten fresh processes per configuration/workload give nine retained samples. All 1800 rows pass their oracles and have zero Vile warmup/measured native execution, compilation and cache counters. Builds and tests ran separately 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 and at least 20x total-time growth. Fixtures, four-input oracles, batches and five warmup calls are unchanged. The rejected scope-dispatch relocation remains in validation/interpreter370-scope-trial, with all losses; its machine.v change was fully reverted before this candidate. Selected GC disassembly confirms that closure entry and primitive operand fusion remain inline.

Suite GC gain vs369 Arena gain vs369 Guile advantage over GC Guile advantage over arena
wm 1.004x 1.001x 4.297x 4.405x
runtime 1.025x 1.009x 7.363x 7.483x
all36 1.018x 1.006x 6.153x 6.271x

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 369 GC ms 370 GC ms Guile ms GC gain Arena gain
wm-callback-chain 4.672491 4.669548 0.642750 1.001x 1.005x
wm-event-dispatch 2.851135 2.821672 0.216750 1.010x 1.004x
wm-focus-cycle 4.148102 4.124598 0.379000 1.006x 1.002x
wm-tiling-layout 1.801525 1.778623 0.111750 1.013x 1.005x
wm-workspace-move 1.246044 1.246337 0.174750 1.000x 0.993x
wm-keybindings 4.386665 4.372880 0.280500 1.003x 1.007x
wm-hooks 2.831765 2.825738 0.359000 1.002x 0.993x
wm-lifecycle 0.997751 0.992826 0.127250 1.005x 0.991x
wm-macro-config 4.441712 4.451889 5.264750 0.998x 1.005x
wm-config-load-tree 5.111096 5.110310 8.964000 1.000x 0.995x
wm-reload-live 7.192381 7.138765 8.198750 1.008x 1.004x
wm-session-replay 6.815029 6.799771 8.063250 1.002x 1.002x

runtime

Workload 369 GC ms 370 GC ms Guile ms GC gain Arena gain
tail-sum-10k 0.710107 0.662988 0.033630 1.071x 1.032x
fib-20 4.693114 4.789114 0.311400 0.980x 0.975x
closure-5k 0.558021 0.527097 0.015600 1.059x 1.019x
list-3k 0.924452 0.896074 0.059780 1.032x 1.028x
flonum-sum-2k 0.479242 0.483062 0.096000 0.992x 0.993x
bignum-fib-200 0.048522 0.047470 0.005417 1.022x 0.995x
rational-harmonic-80 0.095186 0.095119 0.048750 1.001x 1.009x
integer-divmod-5k 0.827963 0.819447 0.168000 1.010x 1.008x
list-map-1k 0.124896 0.117604 0.048333 1.062x 0.966x
list-reverse-2k 0.481446 0.477911 0.060750 1.007x 0.998x
vector-update-2k 0.394680 0.376318 0.016250 1.049x 1.023x
bytevector-fill-4k 0.773606 0.741800 0.086083 1.043x 1.009x
hashtable-count-1k 0.436370 0.434499 5.924500 1.004x 1.011x
string-build-1k 0.042095 0.041304 0.043833 1.019x 1.020x
string-scan-4k 0.664100 0.645331 0.043750 1.029x 1.023x
unicode-scan-1k 0.176539 0.174618 0.011750 1.011x 1.021x
datum-read-write-200 1.229056 1.198996 2.234375 1.025x 0.994x
closure-mutate-2k 0.300094 0.286130 0.008417 1.049x 1.033x
higher-order-2k 0.385908 0.372563 0.006333 1.036x 1.011x
callcc-escape-1k 0.073618 0.068486 0.006583 1.075x 1.023x
values-consumer-1k 0.608962 0.597980 0.004417 1.018x 1.000x
dynamic-wind-200 0.141739 0.140707 0.012583 1.007x 1.008x
goops-dispatch-1k 0.751447 0.751483 0.110500 1.000x 1.007x
goops-allocate-200 0.082943 0.082461 0.054875 1.006x 1.009x

Build snapshot: vile-resume.___gamj6. Verification: vile-resume.1sp1i3vk. Measurement: vile-resume.yy8l1ur2. Recovery: validation/interpreter370/.