This repository was archived by the owner on Nov 21, 2026. It is now read-only.
Repository navigation
bench: pin ladybug 0.22.0 (0.21.2 cannot LOAD vector since the vendor overwrote its download) and bake the extension into the image by sha256 - #541
Merged
Conversation
…nt image at build time ladybug 0.21.2 can no longer LOAD vector: at 04:28 UTC on 2026-10-25 the vendor overwrote the v0.21.0 vector extension that every 0.21.x client downloads with a build of the 0.22 sources (undefined symbol Transaction::getMinUncommittedNodeOffset, LadybugDB/ladybug#1390). The 0.21.x line has no way back to a working extension, so the pin moves to 0.22.0 on the client and dense images. The reason for the 0.21.2 pin (DECISIONS #129, 0.20.4 crashes the dense mutation phase after a deleted vector key is re-inserted) was re-run untimed on the laptop: the 0.20.4 control dies at mutate-insert-start in the same harness, 0.22.0 completes the pass. The vector extension is now installed while the client image is built and checked against a sha256 in build_images.sh (bake_ladybug_extensions.py, LADYBUG_EXTENSIONS). INSTALL is a no-op on a file that is already present, so no lane changes; a replaced binary now stops the build instead of changing the engine under a pinned pass. test_ladybug_pin.py holds the chain. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #66 (
native-two-dist). Closes the hardest native parity gap: Python functions called from SQL and openCypher, record event callbacks, the Ctrl-C behaviour of a Python function, and the crash intests/test_async_executor.py. It covers 31 failures oftest_python_callbacks.py, 1 oftest_python_function_interrupt.pyand the crash, from the 68 failures of the native parity run (parity-native-two-dist). Nothing here raisesNotOnNativeYet: the features work on the nativearcadedb, with the behaviour ofarcadedb-jvm.Status: draft. The code is committed and compiles; the native image with the new entry points is building (
~/build-scratch/native-lib/callbacks), and the test counts below are filled in when the run ends.Design: how the native image calls back into Python
CFUNCTYPEpointer witharcadedb_n_set_upcall(this existed for async callbacks). The image keeps it as aCFunctionPointerand calls it asfn(callbackId, json) -> char*. A Python-side table maps the id to the callable; the table entry is removed when the function is unregistered or replaced, when the listener is removed, and when the database closes, so the table does not grow (the CFUNCTYPE object itself lives as long as the module).arcadedb_n_cb(op, json)registers and removes functions and event listeners. Its checks, error wording, veto and failure rules are those of the JPype bridge (PythonFunctions,PythonRecordEvents): an engine function name is refused,replace=Trueis needed to replace, a revoked function says it was unregistered, a failing callback isPython function 'x' failed: ValueError: ...orPython 'before_create' callback failed: ..., abefore_*callback returningFalsevetoes. The Python-side checks (name, callable, keyword-only, argument counts, event names) are one shared helper inarcadedb.callbacksnow, used by both backends.CFUNCTYPEcall (PyGILState_Ensure), on the calling thread of the query or on a foreign Java thread (an async writer). The foreign-library call that is running the statement released the GIL, so there is no deadlock; a function may call back into the database.NativeCodec), results go back through the same encoder as parameters. A record argument or event record arrives as a dict with@rid,@typeand@catand is wrapped asDocument,VertexorEdge. A result past a Java long is anOverflowError; numpy arrays andDecimal,datetime,list,dictwork as on JPype._dispatchcatchesBaseExceptionand replies{"error": "Type: text"}; the engine turns it into aCommandExecutionException(functions) orDatabaseOperationException(events), so the statement fails with the Python message and the surrounding transaction does not commit.arcadedb_n_alloc); Java copies it and frees it. A thread-local Python buffer is not enough: on an async writer thread the callback's Python thread state ends as the callback returns, and the buffer went with it, so the engine read freed memory.KeyboardInterruptin a function or callback is remembered per thread; the place that turns the statement's failure into anArcadeDBErrorraises theKeyboardInterruptinstead, chained from that error, forquery,command, iteration andto_listalike. The interrupt is cleared when a statement starts, so a stale one never turns a later error into aKeyboardInterrupt. A signal that arrives as the callback is entered is raised by CPython before_dispatchreaches itstry; ctypes reports it as unraisable and returns NULL. A hook records it, and the engine fails the statement on a NULL reply. This is the same rule as the JPype backend (arcadedb.callbacks).The async-executor crash
Not related to the callbacks themselves.
test_per_record_callback_runs_before_the_batch_commits_and_on_ok_aftercallsdb.count_typefrom anon_okcallback, which runs on an async writer thread._thread_handle()saw a thread that was not a Python-created one and attached it to the isolate again as an owned handle. When the callback returned, CPython deleted the callback's thread state,_Thread.__del__calledgraal_detach_threadon a thread that was still running Java code, and the image aborted (Fatal Python error: Aborted). The thread handle now asksgraal_get_current_threadfirst: a thread that is attached already gets a handle that is never detached.Behaviour change
NativeDatabase.register_functionhad positionalmin_argsandmax_args; it has the signature of the JPype one now (keyword-onlymin_args,max_args,deterministic,replace), andunregister_functionandonexist.tests/test_native_udf.pyuses the keywords.test_registering_again_and_again_does_not_grow_the_python_heaponly forces a JVM gc on the JVM backend.What is not here
The other parity failures (positional counts, record id values, bulk insert, log directory, PQ settings, docs examples, XML limits) are another change.
🤖 Generated with Claude Code