vile / bench / native / PAIRS-363.md
70 lines · 56 sloc · 6.29 KB · 76646891b77a3d5c6af4a1e42b122cd61dc1654b
Raw

Native borrowed integer-list inputs (363)

Existing finite proper integer lists can enter eligible native graphs through the existing private pair pool. The importer and generated code share one C pair declaration. Input pairs remain unchanged; copied cells never escape to the VM. Arguments, globals and captures refresh on each entry, and repeated lexical capture selectors reuse their import. Native list identity and pair mutation remain unsupported. Returning or storing a private list uses the original VM replay path, preserving the original pair or tail identity.

Import and private cons share the same bounded 4,096-cell arena pool. Malformed, cyclic, oversized or non-integer lists decline before native execution. A failed bounded import prevents further pair imports for that plan in the current scope, avoiding quadratic copies during VM tail recursion. Scalar and nil calls remain eligible. Graphs that do not read list contents skip pair imports. Vector callbacks keep their existing strict scalar decoder. No per-node heap allocation, GC dependency or VM operation was introduced; existing native function signatures and value layouts remain unchanged.

Captured scalar writes remain staged and vector writes journaled until the result validates. Overflow, pool exhaustion and unsupported pair publication discard or restore speculative effects before replay. The VM source pairs are never modified.

The 3,000-element nonempty-fold regression fails retained362 and passes the candidate in one native entry. All 114 native tests passed freshly under ASan/UBSan and Boehm, alongside both production builds, CLI tests and the default-build budget check. Coverage includes 4,096-cell inputs, 4,095 imports plus private cons, combined input capacity, aliases, mutable and rebound globals/captures, same-code environments, GC between entries, malformed/cyclic inputs, scalar/nil calls after rejection, tail identity, private-list publication, overflow after scalar/vector writes, both frontends and instruction budgets.

All 1,800 comparison results passed on the same idle Intel i3 Mac mini: 36 unchanged workloads × five configurations × ten fresh processes, nine retained. Configurations are retained362 and new363 with arena/Boehm, plus Guile 3.0.10 with unchanged guild-O2 wrappers and default JIT. One locked serial job ran from hash-verified snapshots, separately from builds/tests. All 144 cache-population observations are separate; all 1,440 native comparison processes compiled zero sources. Prepared medians exclude setup and first use; raw first-call and whole-process times remain available. All cases, oracles and losses are included.

All 28 scaling groups passed 4 versus 400 calls, three repetitions per count, requiring total-time ratios above 20 and zero native compilations. Completed samples are journaled in the same source/cache context.

Suite GC gain vs362 Arena gain vs362 Guile/new GC Guile/new arena
wm 0.996× 0.995× 0.438× 0.417×
numeric 1.099× 1.105× 0.652× 0.656×

The initial trial preserves the earlier measurements before the shared C pair declaration. Guile/Vile ratios above one favor Vile. The requested full 1.5× advantage remains unproven; the final 31-sample and full-objective gates are outstanding.

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

wm

Workload 362 GC ms 363 GC ms Guile ms GC gain Arena gain
wm-callback-chain 0.561325 0.567236 0.638750 0.990× 0.991×
wm-event-dispatch 0.927847 0.943207 0.214750 0.984× 1.001×
wm-focus-cycle 0.593932 0.594409 0.377750 0.999× 0.975×
wm-tiling-layout 0.307735 0.312649 0.110000 0.984× 0.984×
wm-workspace-move 1.138399 1.145622 0.179000 0.994× 0.996×
wm-keybindings 4.569757 4.525373 0.282750 1.010× 0.999×
wm-hooks 2.332666 2.377825 0.359500 0.981× 0.997×
wm-lifecycle 1.080234 1.078711 0.127250 1.001× 1.000×
wm-macro-config 4.489630 4.483587 5.245750 1.001× 1.003×
wm-config-load-tree 5.019880 5.033110 8.989500 0.997× 0.987×
wm-reload-live 5.113301 5.113002 8.107000 1.000× 1.004×
wm-session-replay 5.372548 5.319132 8.014250 1.010× 1.004×

numeric

Workload 362 GC ms 363 GC ms Guile ms GC gain Arena gain
tail-sum-10k 0.005606 0.005607 0.033670 1.000× 1.000×
fib-20 0.146848 0.146858 0.310760 1.000× 0.999×
closure-5k 0.002127 0.002129 0.015540 0.999× 1.000×
list-3k 0.007303 0.007287 0.059410 1.002× 1.001×
flonum-sum-2k 0.002383 0.002387 0.096000 0.998× 1.001×
bignum-fib-200 0.061802 0.061487 0.005500 1.005× 1.002×
rational-harmonic-80 0.104498 0.104478 0.048875 1.000× 1.003×
integer-divmod-5k 0.007926 0.007922 0.167750 1.001× 1.000×
list-map-1k 0.130499 0.132779 0.048333 0.983× 0.963×
list-reverse-2k 0.674001 0.068314 0.060583 9.866× 12.098×
vector-update-2k 0.072041 0.071999 0.016167 1.001× 0.999×
bytevector-fill-4k 1.031731 1.026786 0.086167 1.005× 0.995×
hashtable-count-1k 0.485631 0.484342 5.957667 1.003× 0.999×
string-build-1k 0.049006 0.049305 0.042917 0.994× 0.985×
string-scan-4k 1.038158 1.033224 0.043750 1.005× 0.995×
unicode-scan-1k 0.275608 0.272852 0.011750 1.010× 0.989×
datum-read-write-200 1.562996 1.582442 2.248625 0.988× 1.000×
closure-mutate-2k 0.003004 0.003014 0.008417 0.997× 0.996×
higher-order-2k 0.004104 0.004087 0.006333 1.004× 1.000×
callcc-escape-1k 0.126752 0.126661 0.006750 1.001× 0.998×
values-consumer-1k 0.690999 0.718177 0.004417 0.962× 0.990×
dynamic-wind-200 0.159588 0.159550 0.012667 1.000× 1.000×
goops-dispatch-1k 0.782586 0.783387 0.110250 0.999× 0.990×
goops-allocate-200 0.115284 0.113643 0.054625 1.014× 1.001×

Build: vile-resume.9zg4odtw. Verification: vile-resume.6inliw4p. Measurement: vile-resume.fa49u1wf. Recovery: validation/pairs363/.