Skip to content

JVM bulk loads: search for a subnormal exponent, not any "e-3" - #183

Merged
tae898 merged 1 commit into
mainfrom
fix/subnormal-check-precise
Nov 1, 2026
Merged

tae898 merged 1 commit into
mainfrom
fix/subnormal-check-precise

Conversation

@tae898

@tae898 tae898 commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Closes #182

type_conversion._dumps_checked (from #180) now searches the JSON text for the exponent json.dumps writes for a subnormal double (e-308 to e-329 after a digit, compiled pattern) instead of any "e-3". Same C-speed scan; ordinary text such as UUIDs, hex ids or name-3 no longer sends a chunk through the per-row Python walk.

Test: tests/test_bulk_json_paths.py::test_text_that_only_looks_like_an_exponent_skips_the_subnormal_walk (counts the walk calls with a wrapped _has_subnormal: none for UUID-like text and 1e-30; 5e-324 and 2.2250738585072009e-308 still raise ValueError, the per-row path). With the previous substring check the first assertion fails, since "e-3" occurs in "4fe-3a0" and "name-3" (checked against the old condition directly). black, isort, pyflakes clean.

🤖 Generated with Claude Code

#180 sends a bulk JSON chunk through a per-row Python walk when its text
contains "e-3", to catch a subnormal double the engine's parser would
read as a BigDecimal. "e-3" is common in ordinary text (hex ids, UUIDs,
"name-3"), so such loads walked every chunk. The text is now searched
for the exponent json.dumps writes for a subnormal (e-308 to e-329 after
a digit) with a compiled pattern: the same C-speed scan, no false hits on
ordinary text. Test: UUID-like and "name-3" text never reaches the walk;
5e-324 and the largest subnormal still raise ValueError (per-row path).

Closes #182

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tae898
tae898 merged commit bec7071 into main Nov 1, 2026
36 checks passed
@tae898
tae898 deleted the fix/subnormal-check-precise branch November 1, 2026 16:12
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.

JVM bulk loads: the subnormal check walks every row when the text contains "e-3" (UUIDs, hex ids)

1 participant