vile / bench / native / NOT-378.md
69 lines · 56 sloc · 6.05 KB · 76646891b77a3d5c6af4a1e42b122cd61dc1654b
Raw

Native boolean negation (378)

Eligible native graphs now use the existing truth helper for unary not. It preserves Scheme truth semantics: only false is false, including when an argument is zero, NaN, an empty list or a sequence handle. Unary arity and private uninitialized/error markers are checked before returning a boolean. The graph emits the P_NOT capability macro only when an actual not primitive is used, leaving the new branch out of other generated primitive bodies.

Only two conditional native production files and one new regression file change. The capability flag exists only during graph construction. Generated C ABI, tags, owner/provider/budget guards, pair import policy, journal rollback and fallback remain unchanged. There is no new persistent field, heap allocation or GC dependency. The rejected 377 input conversion is excluded; this candidate starts from retained 376. Interpreted 375 remains separately measured in EQUALITY-375.md.

The unchanged 376 baseline compiles and runs the first new regression, then fails the required enabled-native-plan assertion. All five new cases pass under ASan/UBSan and Boehm: a truth table over scalar and sequence handles including numeric bit patterns, opaque/pair/procedure fallback without copying lists, aliases and rebinding in both syntaxes, bad arities matching independent VM errors after exactly-once capture/vector replay, and early recursive binding errors. The full 165 native/fallback cases per mode, two CLI cases and default-build budget check also pass.

Both collectors were compared against retained 376 and Guile 3.0.10 on the same idle Intel Mac mini. All 24 runtime and 12 mock-WM workloads, fixtures, four-input oracles, batch counts, five warmups and frozen guild-O2/default-JIT Guile wrappers are unchanged. Ten fresh processes per workload/configuration give nine retained samples after excluding sample zero. All 1,800 results pass their oracles. A separate job populated all 144 cold observations; all native comparison warmups and measurements compiled zero sources.

All 36 scaling groups pass 4 versus 400 calls with three repeats and at least 20x elapsed-time growth. This keeps the previous 32 groups and adds both collectors for workspace moves and lifecycle handling, paths that use boolean negation. No performance workload was dropped or reweighted. Builds, tests, cache population and timings ran serially from hash-verified snapshots.

Prepared medians exclude initial setup and first use; repeated loading and macro work inside workloads remains included. Every workload, all losses, raw first-call/process timings and cache libraries are retained. Guile/Vile ratios above one favor Vile. Aggregates are geometric means of per-workload ratios; all 36 workloads have equal weight in the overall result. The full 1.5x goal remains unproven; final 31-sample and full-objective verification remain outstanding.

Suite GC gain vs376 Arena gain vs376 Guile/Vile GC Guile/Vile arena
wm 1.141x 1.157x 0.629x 0.630x
runtime 1.002x 0.998x 1.177x 1.199x
all36 1.047x 1.048x 0.955x 0.968x

Regressions above 5%: wm/wm-hooks (gc, 1.052x elapsed). All losses remain included.

wm

Workload 376 GC ms 378 GC ms Guile ms GC gain Arena gain
wm-callback-chain 0.482939 0.486963 0.641000 0.992x 1.022x
wm-event-dispatch 0.860933 0.837884 0.214250 1.028x 1.048x
wm-focus-cycle 0.483088 0.485945 0.378000 0.994x 1.014x
wm-tiling-layout 0.265263 0.269244 0.109500 0.985x 1.040x
wm-workspace-move 0.988675 0.193213 0.174250 5.117x 5.295x
wm-keybindings 0.976567 0.978343 0.279500 0.998x 0.995x
wm-hooks 2.184126 2.298261 0.355000 0.950x 0.963x
wm-lifecycle 0.875526 0.877119 0.124750 0.998x 0.989x
wm-macro-config 4.420284 4.415239 5.348500 1.001x 0.990x
wm-config-load-tree 4.682063 4.687238 8.930500 0.999x 0.997x
wm-reload-live 4.879605 4.836182 8.124750 1.009x 1.014x
wm-session-replay 4.906519 4.894918 8.095250 1.002x 1.019x

runtime

Workload 376 GC ms 378 GC ms Guile ms GC gain Arena gain
tail-sum-10k 0.005606 0.005607 0.033700 1.000x 1.000x
fib-20 0.147035 0.146840 0.310880 1.001x 0.997x
closure-5k 0.002129 0.002129 0.015590 1.000x 1.002x
list-3k 0.007217 0.007218 0.059760 1.000x 1.000x
flonum-sum-2k 0.002373 0.002370 0.095500 1.001x 1.000x
bignum-fib-200 0.056954 0.056911 0.005417 1.001x 1.006x
rational-harmonic-80 0.103736 0.103640 0.049375 1.001x 0.998x
integer-divmod-5k 0.007914 0.007926 0.169167 0.998x 1.000x
list-map-1k 0.135478 0.134652 0.048500 1.006x 0.998x
list-reverse-2k 0.067575 0.066380 0.060917 1.018x 1.002x
vector-update-2k 0.061239 0.062854 0.016167 0.974x 1.035x
bytevector-fill-4k 0.081722 0.078928 0.086083 1.035x 0.957x
hashtable-count-1k 0.460338 0.458866 5.962833 1.003x 1.000x
string-build-1k 0.045232 0.045248 0.042417 1.000x 1.001x
string-scan-4k 0.097916 0.093626 0.043750 1.046x 0.968x
unicode-scan-1k 0.035608 0.036024 0.011750 0.988x 1.000x
datum-read-write-200 1.550651 1.554696 2.280125 0.997x 0.994x
closure-mutate-2k 0.002906 0.002931 0.008417 0.992x 1.000x
higher-order-2k 0.004085 0.004076 0.006333 1.002x 0.999x
callcc-escape-1k 0.094110 0.093398 0.006583 1.008x 0.995x
values-consumer-1k 0.001553 0.001573 0.004417 0.987x 1.000x
dynamic-wind-200 0.150222 0.150437 0.012583 0.999x 0.997x
goops-dispatch-1k 0.786249 0.784140 0.109625 1.003x 1.000x
goops-allocate-200 0.085968 0.086021 0.054750 0.999x 1.000x

Build: vile-resume.v6wyj5h1. Verification: vile-resume.xcv923s3. Measurement: vile-resume.ze94ydd8. Recovery: validation/not378/.