Repository navigation
Share numeric value equality across validation keywords (#1307) - #1343
Conversation
|
Review result: No actionable regressions found in PR #1343 (master) at the reviewed head. Validation: Full offline verification passed on JDK 25: 10,015 tests, 30 skipped. GitNexus results were inconclusive. |
|
Review notes for #1343. Nothing here blocks on correctness of the new equality code. What I checked
Findings
🤖 Generated with Claude Code |
|
Follow-up: my earlier review notes are addressed in b218bdc.
I reran my fuzz on b218bdc: 771,728,400 number pairs across Int/Long/Float/Double/BigInteger/BigDecimal, with no mismatches in equality, nested equality or hash agreement. That covers only the numeric equality and hashing code, not the schema-level enum/const/uniqueItems behavior. I did not rerun the old-vs-new schema comparison. Remote CI is still pending. 🤖 Generated with Claude Code |
Refs #1307. Companion PR: #1344.
Share numeric value equality and matching hashes across
const,enumanduniqueItems, including nested arrays and objects, extreme decimal scales, and matching non-finite float/double values. Preserve the shortest-decimal interpretation of floating-point nodes; exact decimal reading remains separate in #1293.Keys retain only the node and cached hash. Remove the per-number kind/value cache and duplicate numeric comparison dispatch. Compare large integer pairs directly. Default enum conversion avoids normalized numeric copies and deep-copied arrays while retaining protected conversion hooks. Prepare loose scalar matching once per schema and skip containers. This fixes the existing Jackson 3 exception for array/object enum members.
Preserve existing branch-specific
typeLoosecompatibility: enum[100]matches string"1E+2"on master/Jackson 3. Tests and changelog explain the existing divergence. Coverage includes the 900-pair numeric matrix, loose container matching, decimal scales, extreme exponents, hash collisions, numeric enum deduplication and protected conversion overrides.Validation:
mvn -B clean verifypassed independently on JDK 17/21/25: 10,023 tests per run, zero failures/errors, 30 skips. No exclusions or POM changes.git diff --checkpassed.JDK 17 JMH allocation check (1,000 unique items, two 1s warmups, three 1s measurements, one fork, GC profiler, 256MB heap): about 8 KB/op less allocation for top-level decimal, BigInteger and double shapes versus the previously recorded cached-key results; nested allocation unchanged. No general throughput improvement is claimed. Reproduce with
mvn -B -Pbenchmark clean package, thenjava -jar target/benchmarks.jar NumericUniqueItemsBenchmark -p duplicate=false -wi 2 -i 3 -w 1s -r 1s -f 1 -prof gc -jvmArgs "-Xms256m -Xmx256m".Follow-up policy decision: #1349 tracks the existing master/2.x difference in numeric
enumstring matching withtypeLoose. This PR preserves the branch's current behavior; alignment and compatibility policy will be decided separately.