Skip to content

skdb: test high-precision FLOAT round-trip through the text protocol - #1710

Merged
mbouaziz merged 2 commits into
mainfrom
skdb-float-roundtrip
Nov 19, 2026
Merged

mbouaziz merged 2 commits into
mainfrom
skdb-float-roundtrip

Conversation

@mbouaziz

@mbouaziz mbouaziz commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds sql/test/unit/unit_float_roundtrip.sql + a FLOAT ROUNDTRIP check in
sql/unit_tests.sh, pinning full round-trip precision of FLOAT values through
skdb's text protocol (SQL literal -> Float -> storage -> Float.toString ->
parseFloat in JS -> print).

Cases: values needing >9 significant digits (0.1+0.2 ->
0.30000000000000004, 17-digit literals), extreme magnitudes (max double
1.7976931348623157e+308, min normal, min subnormal 5.0e-324), the
fixed/scientific notation boundary, -0.0, and insert/select through a
FLOAT column. The pre-Ryu 9-digit formatter lost digits on all of these.

The SQL lives under test/unit/ (not test/) on purpose: test_sql.sh
runs every test/*.sql through skdb and diffs against sqlite3, whose float
formatting differs from skdb's shortest round-trip form (1e+308 vs
1.0e+308, 0.3 vs 0.30000000000000004), so a precision test cannot live
in that glob.

Validation

  • Built skdb (--release --bin skdb) from this branch with the CI base
    image's toolchain in a container; unit_float_roundtrip.sql output matches
    the FLOAT ROUNDTRIP grep exactly, and the file is no longer matched by
    test/*.sql.
  • Test-only change to the sql package, so no Skargo.toml version bump
    (matches precedent).

Notes

  • AI assistance: commits generated with Mistral Vibe (Co-Authored-By
    trailer); validation performed in-session as described above.

mbouaziz and others added 2 commits November 19, 2026 12:05
Adds unit_float_roundtrip.sql covering values that need more than 9
significant digits to round-trip (0.1+0.2, 17-digit literals), extreme
magnitudes (max double, min normal, min subnormal), the fixed/scientific
notation boundary, -0.0, and insert/select through a FLOAT column. The
pre-Ryu 9-digit formatter lost digits on these.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
Co-Authored-By: Claude Opus 5.5 (Anthropic, via Mistral Vibe; thinking: high) <noreply@anthropic.com>
test_sql.sh runs every test/*.sql through skdb and diffs the output
against sqlite3, whose float formatting differs from skdb's shortest
round-trip form (e.g. 1e+308 vs 1.0e+308, 0.3 vs 0.30000000000000004),
so the new unit_float_roundtrip.sql failed there. Move it under
test/unit/, which only unit_tests.sh runs explicitly.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
Co-Authored-By: Claude Opus 5.5 (Anthropic, via Mistral Vibe; thinking: high) <noreply@anthropic.com>
@mbouaziz
mbouaziz force-pushed the skdb-float-roundtrip branch from e7fdfc9 to 12689ba Compare November 19, 2026 12:05
@mbouaziz
mbouaziz enabled auto-merge November 19, 2026 12:05
@mbouaziz
mbouaziz merged commit c68f473 into main Nov 19, 2026
4 checks passed
@mbouaziz
mbouaziz deleted the skdb-float-roundtrip branch November 19, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant