Repository navigation
Tests: four more cross-wheel golden cases: to_json text, to_arrow float lists, vector distances, integral DECIMAL (refs #314) - #446
Merged
Conversation
…at lists, vector distances, integral DECIMAL (refs #314) The status comment on #314 lists four cases the golden file does not cover. Each new test asserts what both wheels return alike, with a committed literal and no branch on the backend. Where the wheels differ today, the test pins the part that is equal and its docstring gives the value of each wheel, so nothing here fails on main: - Result.to_json(): the text is compared for INTEGER, DOUBLE, LONG, NULL and LIST; a record row is compared after parsing, the float32 values as float32. FLOAT, float[], DECIMAL, and DATE/DATETIME of a projection row have a different text per wheel. - to_json_list(): a DECIMAL of scale 0 is an int on the JVM wheel and a float on the native wheel; 3 == 3.0 is asserted and the type is one of the two. - vector distances: values that are exact in float32 are compared to the bit; values that round are compared within 1e-5, because the last float32 bits differ between the wheels and between calls on the JVM wheel. - to_arrow(): the float-list columns are the same on both wheels (FixedSizeList<float32> for float[], list<double> for a LIST of floats). Measured on the mini with scripts/dev_overlay.py: the wheels CI built from 6219570 (arcadedb-jvm on engine 26.12.1-SNAPSHOT, arcadedb on engine 26.11.1) and arcadedb-jvm 26.11.1.post4; 24 passed on each.
This was referenced Nov 22, 2026
Closed
Open
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
It adds the four cases that the status comment on #314 lists as not covered to
tests/test_cross_wheel_golden.py: the text ofResult.to_json(), float-list columns into_arrow(), vector distances, and an integralDECIMALinto_json_list(). It is a tests-only change. As in the first six tests, a committed literal is asserted on both wheels with no branch onarcadedb.__backend__.I measured each case on both wheels first. Two of the four are the same on both wheels and two are not, so nothing here fails on
main: where the wheels differ, the test pins the part that is equal and its docstring gives the value of each wheel.to_arrow(): the same on both. Afloat[]isFixedSizeList<float32>and a LIST of floats islist<double>, also when every value would fit a float32. Pinned as type and values.Result.to_json(): the text is the same for INTEGER, DOUBLE, LONG, NULL, and LIST, and that text is the golden. It differs for FLOAT andfloat[](shortest float32 text on the JVM wheel, exact widening on the native wheel), for a DECIMAL (1.50and1.5), and for a DATE and a DATETIME of a projection row. A record row is compared after parsing, because the keys come in a different order, and its float32 values are compared as float32.DECIMALinto_json_list(): the JVM wheel returns anintfor a DECIMAL of scale 0 and the native wheel afloat. The docstring ofto_json_list()says a DECIMAL arrives as a float. The test asserts== 3(true for both) and that the type is one of the two, and a float on both forDecimal("2.00").quantization="NONE", small whole numbers and halves) are the same bits on both wheels and are compared with==over 20 calls. Distances that round differ in the last float32 bits between the wheels, and between calls on the JVM wheel, so they are compared within1e-5.What each wheel returned
Run on the benchmark host (x86-64 Linux, Python 3.12) with
scripts/dev_overlay.py, on the wheels CI built from62195709b7:arcadedb-jvmon engine26.12.1-SNAPSHOTandarcadedbon engine26.11.1. The publishedarcadedb-jvm26.11.1.post4(engine26.11.1) returned the same values as the JVM column, so the differences belong to the wheel and not to the engine version. The values are from a probe script over the table of the test with a few more columns (s,b,fl64, a 20-digit DECIMAL), which is why some rows show columns the test does not have.arcadedb-jvmarcadedb(native)to_json()projection, DOUBLE and LONG{"n":1,"d":0.3333333333333333,"big":-9007199254740993,"maybe":null,"s":"z","b":false}{"n":1,"d":0.3333333333333333,"big":-9007199254740993,"maybe":null,"s":"z","b":false}to_json()projection, LIST{"n":0,"lst":[1,"a",2.5],"fl":[0.5,0.25,-2.75],"fl64":[0.1,0.3333333333333333]}{"n":0,"lst":[1,"a",2.5],"fl":[0.5,0.25,-2.75],"fl64":[0.1,0.3333333333333333]}to_json()projection, FLOAT{"n":0,"f":0.1}{"n":0,"f":0.10000000149011612}to_json()projection,float[]{"n":0,"v3":[0.1,0.33333334,0.5]}{"n":0,"v3":[0.10000000149011612,0.3333333432674408,0.5]}to_json()projection, DECIMAL1.50"dec":1.50"dec":1.5to_json()projection, DATE and DATETIME{"n":0,"day":1767312000000,"ts":"2026-01-02 03:04:05"}{"n":0,"day":20455,"ts":1767323045678}to_json()record row, DATE and DATETIME"day":20455,"ts":1767323045678"day":20455,"ts":1767323045678to_json()record row, FLOAT"f":0.1"f":0.10000000149011612to_arrow()type offloat[](3 values)field v3: fixed_size_list<item: float>[3]field v3: fixed_size_list<item: float>[3]to_arrow()type offloat[](9 values)field v9: fixed_size_list<item: float>[9]field v9: fixed_size_list<item: float>[9]to_arrow()type of a LIST of floats that fit a float32field fl: list<item: double>field fl: list<item: double>to_arrow()type of a LIST of doublesfield fl64: list<item: double>field fl64: list<item: double>to_arrow()values offloat[]pylist v3: [[0.10000000149011612, 0.3333333432674408, 0.5], [0.5, 1.0, -2.75]]pylist v3: [[0.10000000149011612, 0.3333333432674408, 0.5], [0.5, 1.0, -2.75]]to_json_list()ofDecimal("3")int 3float 3.0to_json_list()ofDecimal("-7")int -7float -7.0to_json_list()ofDecimal("2.00")float 2.0float 2.0to_json_list()ofDecimal("12345678901234567890")(not in the test)int 12345678901234567890float 1.2345678901234567e+1920.020.00.39999997615814210.39999997615814210.50.519.67000007629394519.6700019836425782.8699994087219242.8699998855590820.25476145744323730.254761338233947750.215581178665161130.21558105945587158The native wheel returned the same distances on each of 400 calls. The JVM wheel on
26.12.1-SNAPSHOTreturned the values above for the EUCLIDEAN search on 396 of 400 calls and the native values on the other 4; on26.11.1it returned the values above on all 400. I did not look into why.The file passes on all three: 24 passed on the JVM wheel from
main, 24 on the native wheel frommain, and 24 onarcadedb-jvm26.11.1.post4.Related issues
Refs #314. It stays open: the differences above are not fixed here (the
to_json()text, theintfor a DECIMAL of scale 0 on the JVM wheel), and the cost of the longer float text on the JVM wheel is still to be measured.Docs
None needed, no behaviour changes.
Checklist
mainas it is)uvx pre-commit run --files <changed files>passes