Skip to content

Fix floating-point sentinel misuse in KDTree and SDT - #18302

Merged
jt2594838 merged 2 commits into
apache:masterfrom
Caideyipi:fix/floating-point-min-value-misuse
Jul 27, 2026
Merged

Fix floating-point sentinel misuse in KDTree and SDT#18302
jt2594838 merged 2 commits into
apache:masterfrom
Caideyipi:fix/floating-point-min-value-misuse

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Description

Fix floating-point sentinel initialization

  • Initialize the Swinging Door upper and lower bounds with negative and positive infinity. This prevents a first decreasing slope, including one after reset, from immediately crossing the doors.
  • Calculate KDTree bounds across every point with infinity sentinels and independent min/max updates. This prevents incorrect subtree pruning when coordinates are negative or the first point contains an extremum.
  • Use Double.NaN as the integration-test NULL sentinel so delta-based assertions distinguish NULL from a real 0.0 value.

Verification

  • mvn spotless:apply -pl iotdb-core/calc-commons,iotdb-core/node-commons,iotdb-core/datanode
  • mvn spotless:apply -pl integration-test -P with-integration-tests
  • mvn checkstyle:check -pl iotdb-core/calc-commons,iotdb-core/node-commons,iotdb-core/datanode
  • KDTreeUtilTest: 1 test passed through an independent compile/run
  • SwingingDoorTrendingFilterTest: 3 tests passed through an independent compile/run

The standard node-commons and datanode Maven test lifecycles are currently blocked before the test phase by unrelated cross-module missing-symbol errors in the local checkout. The changed source and targeted tests were therefore compiled and executed independently.


This PR has:

  • been self-reviewed.
  • added or modified unit tests to cover the affected code paths.

Key changed/added classes
  • KDTreeUtil
  • SwingingDoorTrendingFilter
  • TestConstant

@jt2594838
jt2594838 merged commit 892dbd8 into apache:master Jul 27, 2026
40 of 41 checks passed
@jt2594838
jt2594838 deleted the fix/floating-point-min-value-misuse branch July 27, 2026 03:12
jt2594838 pushed a commit that referenced this pull request Jul 28, 2026
* Fix floating-point sentinel misuse

* Fix master repair integration test expectations
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.

3 participants