🔧 Run the A/B bench at :advanced, now that the corruption is answered

The :simple pin existed because datascript's query layer was broken at
:advanced under this toolchain, which mirror:ds-advanced-corruption has
since answered: shadow-cljs never reads a library's own deps.cljs
externs declaration, so the build must name the file itself.

:ab-bench therefore runs :advanced with :externs
["datascript/externs.js"], and with :infer-externs :all to match the
datahike column, whose build needs it. The default :auto infers externs
for a project's own sources and not for a jar.

bench.core/-main now exits explicitly. Datahike keeps the node event
loop alive after the last reading, and the shared body must stay
identical between the two worktrees.

Entry: pp🪞graph-overlay-experiment
AI-assisted-by: opus-5
This commit is contained in:
Álvaro Tejero Cantero 2026-09-02 00:19:35 +02:00
parent c4ccbdb973
commit a0ec4225b4
No known key found for this signature in database
2 changed files with 14 additions and 7 deletions

View File

@ -166,10 +166,11 @@
{:test {:init-fn frontend-tests.runner/init
:prepend-js ";if (typeof globalThis.navigator?.userAgent === 'undefined') { globalThis.navigator = {userAgent: ''}; };"}}}
;; The A/B bench pins :simple so the two engines are measured under one
;; compiler configuration; the 2026-08-21 datahike report's V8 table was
;; read that way. Lifting the pin needs :externs ["datascript/externs.js"]
;; here, for the reason bench.debug states, and a fresh table.
;; The A/B bench runs both engines at :advanced under one compiler
;; configuration, each build naming its own library's externs declaration
;; because shadow-cljs never reads it from the library's deps.cljs. The
;; :simple pin this replaces was forced by that unread declaration, and the
;; 2026-08-21 report's V8 table was read under it.
:ab-bench
{:target :node-script
:output-to "target/ab-bench.js"
@ -177,9 +178,13 @@
:main bench.core/-main
:compiler-options
{:optimizations :simple
{:optimizations :advanced
:output-wrapper false
:warnings {:fn-deprecated false}}}
:warnings {:fn-deprecated false}
;; :all, not the default :auto, to match the datahike column: :auto
;; infers externs for this project's own sources and not for a jar.
:infer-externs :all
:externs ["datascript/externs.js"]}}
;; The gate for mirror:ds-advanced-corruption: bench.debug reads one
;; database six ways and exits non-zero on a wrong answer. Its release

View File

@ -77,4 +77,6 @@
:rev-rows rev-rows :desc-rows desc-rows
:heap-mb (fmt (/ (.-heapUsed (js/process.memoryUsage)) 1e6))}))))
(defn -main [& _] (run))
;; Datahike keeps the node event loop alive after the last reading, so the
;; bench exits itself rather than hanging until a timeout kills it.
(defn -main [& _] (run) (js/process.exit 0))