Repository navigation
Remove the unused K-D tree and hex cell registry - #20
Merged
Merged
Conversation
Since f6d85c8 moved MarkerManager's spatial queries onto MarkerGridIndex, HexCellRegistry has only been built lazily by MarkerManager.findByIdPrefix, and nothing calls findByIdPrefix: no SDK module, sample or doc, only one assertion in MarkerManagerDestroyTests. KDTree existed only to back the registry, and HexCellWithDistance and RegistryStats only to carry their results. Delete KDTree, HexCellRegistry, RegistryStats, HexCellWithDistance and MarkerManager.findByIdPrefix, along with the lazy registry plumbing in MarkerManager and its share of the memory estimate. HexGeocell, HexCell and HexGeocellProtocol stay; MarkerManager and others still take a geocell. This is a breaking change to the public API; the baseline drops exactly those declarations. The same removal is being made in android-sdk-core and js-sdk-core.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
公開 API の破壊的変更です。 同じ削除を android-sdk-core と js-sdk-core でも進めています。
削除するもの
KDTree(Sources/MapConductorCore/geocell/KDTree.swift)HexCellRegistryとRegistryStats(Sources/MapConductorCore/geocell/HexCellRegistry.swift)HexCellWithDistance(上 2 つの戻り値にしか使われていなかった)MarkerManager.findByIdPrefix(_:)と、それのためだけにあったcellRegistry/ensureCellRegistryLocked()、メモリ見積もりの hex レジストリ分Tests/MapConductorCoreTests/KDTreeRadiusTests.swift、MarkerManagerDestroyTestsのfindByIdPrefixアサーションapi/MapConductorCore.api.swiftから上記の宣言HexGeocell/HexCell/HexGeocellProtocolなどは残します。MarkerManagerほかが今も geocell を受け取っているためです。理由
f6d85c8(2026-09-05、"Give iOS the same marker grid index...")で
MarkerManagerの空間検索はMarkerGridIndexに移りました。それ以降HexCellRegistryを作るのはMarkerManager.findByIdPrefixの遅延構築だけで、そのfindByIdPrefixには呼び出し元がありません(SDK の各モジュール、サンプル、ドキュメントのどこにも無く、テストのアサーション 1 箇所だけ)。KDTreeはHexCellRegistryからしか使われていません。使われていない公開 API を残すとプラットフォーム間で形がずれていくので、移植ではなく削除で揃えます。確認
xcodebuild build-for-testing -scheme mapconductor-core -destination 'generic/platform=iOS'→** TEST BUILD SUCCEEDED **KDTree|HexCellRegistry|RegistryStats|HexCellWithDistance|findByIdPrefixは、ios-sdk 配下の他モジュール(*.swift/*.md)と new-design のドキュメントで 0 件。他モジュールが参照していないので、そちらのビルドは確認していません。api/TOOLCHAIN(27.0)と違うため、scripts/api-surface.sh dumpの出力をそのまま置くとコンパイラ由来の差分が混ざります。そこで手で宣言を消し、develop と本ブランチの.swiftinterfaceを同じ手順(BUILD_LIBRARY_FOR_DISTRIBUTION=YES、iOS Simulator 向け)で生成して、その差分が手編集の差分と完全に一致することを確かめました。swift testは TilePng.xcframework に macOS スライスが無く macOS で動かないことが理由です。今回は削除のみなので、ビルドが通ることで確認としています。