Staged scalar captures: initial entry policy (361 trial)
Measured trial: the initial policy slowed dynamic-wind by 30.4% under GC and 23.8% with arenas. A cost check for tiny straight-line captured mutator roots is being qualified before retention. The original data and losses remain here and in validation/captures361-entry-trial/.
Existing scalar captured bindings can be updated inside native graphs. Reads and writes that share a lexical cell use one staged value. Each entry checks alias relationships involving writable cells, including same-code closures that change environments or sharing. Plans retain selectors and alias indices; borrowed environment handles are cleared after the synchronous entry.
Captured VM cells remain unchanged during native execution. The finish callback validates every pending scalar and the return value before committing any captured cell. Failure restores journaled vector writes, discards staged captures, and replays the original VM once. Procedure, borrowed-vector and private-pair publication through captured bindings stays on the VM path. No per-operation closure, environment, map or heap allocation, or new GC dependency, was introduced.
Vile bare-name expressions now support their existing scalar-value or implicit zero-argument-call behavior in native graphs. Tail calls keep their context, including implicit calls inside non-tail binding helpers and unbounded zero-argument self loops. The original VM bytecode and shared language semantics remain intact.
All 84 cases passed under AddressSanitizer/UndefinedBehaviorSanitizer and Boehm, with the default-build budget test and both CLI functions. Coverage includes 4,096-iteration captured-counter and Vile implicit-tail loops in one native entry; alias changes between same-code providers; shared cells at different lexical depths; scalar types; errors/overflow after capture and vector writes; unsupported stores; continuation replay; and cleanup of borrowed environment references. The sanitizer run reuses 21 successful cases only after verifying identical runtime, compiler and test hashes; the corrected 63-case group was rerun, and all 84 Boehm cases ran on the final snapshot. Reuse proofs and original logs are archived.
All 1,800 comparison results passed on the same idle Intel i3 Mac mini: 36 workloads × 5 configurations × 10 fresh processes, nine retained. Configurations are retained360 and new361, each with arena/Boehm, plus Guile 3.0.10. One locked serial job ran from hash-verified snapshots, separately from builds/tests. The 144 native cache-population observations are separate; all 1,440 native comparison processes compiled zero sources. Setup and first use are excluded from prepared medians; raw first-call and process times remain available. The unchanged Guile guild-O2 wrappers use default JIT. All 36 cases and their seed oracles remain included.
All 22 scaling groups passed 4 versus 400 calls, three repetitions per count, requiring total-time ratios above 20. Recovery journals preserve completed samples in the same source/cache context.
| Suite | GC gain vs360 | Arena gain vs360 | Guile/new GC | Guile/new arena |
|---|---|---|---|---|
| wm | 1.009× | 1.011× | 0.336× | 0.316× |
| numeric | 1.217× | 1.227× | 0.550× | 0.549× |
Guile/Vile ratios above one favor Vile. The full requested 1.5× advantage remains unproven; the final 31-sample and full-objective gates are outstanding.
Regressions over 5% against360: dynamic-wind-200 (gc, 30.4% slower), dynamic-wind-200 (arena, 23.8% slower). All losses remain in the tables and aggregates.
wm
| Workload | 360 GC ms | 361 GC ms | Guile ms | GC gain vs360 | Arena gain vs360 |
|---|---|---|---|---|---|
| wm-callback-chain | 0.610 | 0.606 | 0.642 | 1.007× | 1.008× |
| wm-event-dispatch | 1.405 | 1.411 | 0.216 | 0.995× | 0.998× |
| wm-focus-cycle | 3.480 | 3.473 | 0.382 | 1.002× | 1.001× |
| wm-tiling-layout | 0.567 | 0.565 | 0.115 | 1.003× | 1.000× |
| wm-workspace-move | 1.218 | 1.219 | 0.175 | 0.999× | 0.994× |
| wm-keybindings | 4.406 | 4.394 | 0.282 | 1.003× | 1.002× |
| wm-hooks | 2.651 | 2.394 | 0.355 | 1.107× | 1.125× |
| wm-lifecycle | 1.263 | 1.270 | 0.127 | 0.995× | 0.997× |
| wm-macro-config | 4.520 | 4.533 | 5.252 | 0.997× | 1.007× |
| wm-config-load-tree | 5.106 | 5.125 | 8.971 | 0.996× | 0.994× |
| wm-reload-live | 5.655 | 5.616 | 8.133 | 1.007× | 1.001× |
| wm-session-replay | 5.703 | 5.696 | 8.068 | 1.001× | 1.006× |
numeric
| Workload | 360 GC ms | 361 GC ms | Guile ms | GC gain vs360 | Arena gain vs360 |
|---|---|---|---|---|---|
| tail-sum-10k | 0.006 | 0.006 | 0.034 | 1.000× | 1.000× |
| fib-20 | 0.170 | 0.170 | 0.311 | 1.000× | 1.000× |
| closure-5k | 0.003 | 0.003 | 0.016 | 1.001× | 1.000× |
| list-3k | 0.007 | 0.007 | 0.060 | 0.998× | 1.000× |
| flonum-sum-2k | 0.006 | 0.006 | 0.096 | 0.997× | 1.003× |
| bignum-fib-200 | 0.062 | 0.062 | 0.005 | 1.000× | 0.997× |
| rational-harmonic-80 | 0.098 | 0.097 | 0.051 | 1.008× | 1.000× |
| integer-divmod-5k | 0.012 | 0.012 | 0.169 | 0.997× | 1.001× |
| list-map-1k | 0.130 | 0.134 | 0.048 | 0.971× | 0.984× |
| list-reverse-2k | 0.671 | 0.673 | 0.060 | 0.997× | 1.015× |
| vector-update-2k | 0.071 | 0.071 | 0.016 | 1.001× | 1.016× |
| bytevector-fill-4k | 1.025 | 1.022 | 0.086 | 1.003× | 1.012× |
| hashtable-count-1k | 0.488 | 0.483 | 5.980 | 1.011× | 1.001× |
| string-build-1k | 0.049 | 0.049 | 0.043 | 1.016× | 1.004× |
| string-scan-4k | 1.019 | 1.039 | 0.044 | 0.980× | 1.000× |
| unicode-scan-1k | 0.270 | 0.275 | 0.012 | 0.979× | 0.990× |
| datum-read-write-200 | 1.574 | 1.559 | 2.296 | 1.010× | 0.990× |
| closure-mutate-2k | 0.449 | 0.003 | 0.008 | 148.915× | 169.643× |
| higher-order-2k | 0.004 | 0.004 | 0.006 | 0.994× | 0.997× |
| callcc-escape-1k | 0.127 | 0.125 | 0.007 | 1.013× | 1.008× |
| values-consumer-1k | 0.725 | 0.727 | 0.004 | 0.997× | 0.989× |
| dynamic-wind-200 | 0.161 | 0.211 | 0.013 | 0.767× | 0.808× |
| goops-dispatch-1k | 0.790 | 0.787 | 0.110 | 1.005× | 0.990× |
| goops-allocate-200 | 0.113 | 0.113 | 0.055 | 1.002× | 0.997× |
Build snapshot: vile-resume.357xk8cv. Verification snapshot: vile-resume.fudhrvn7. Measurement snapshot: vile-resume.0gwqx0bh. Recovery archive: validation/captures361/.