Skip to content

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

Open
Caideyipi wants to merge 2 commits into
apache:masterfrom
Caideyipi:fix/floating-point-min-value-misuse
Open

Fix floating-point sentinel misuse in KDTree and SDT#18302
Caideyipi wants to merge 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

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.

2 participants