ENH: Add a bulk mask read to MaskCompare and use it for every mask read

オープン
#1,895 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 6 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp
領域
backend, data

調査の方向性

Start with src/simplnx/Utilities/MaskCompareUtilities.hpp and .cpp to understand the existing mask interfaces, then inspect the listed OrientationAnalysis and SimplnxCore algorithms that bulk-read typed mask stores. Add a bulk read that reports transfer failures, route those algorithms through MaskCompare, and add the rule to docs/Code_Style_Guide.md. Done means in-core Release performance and out-of-core [ooc] tests meet the stated requirements.

索引モデルが issue の本文から書いたものです。

説明

enhancement Out-of-Core

Summary

Request: give MaskCompare a bulk read of a range of mask values that works for bool and uint8 masks, on in-memory and out-of-core stores, without making in-core algorithms slower. Then change every algorithm that reads a mask to read it through MaskCompare, instead of reading the typed mask stores itself.

Why: today a mask can be read in two different ways, and both are copied around the code base.

  • MaskCompare (MaskCompareUtilities.hpp) handles bool and uint8 masks behind one interface, but it reads one element at a time through the virtual isTrue(index), bothTrue() and bothFalse(). On an out-of-core store, each element read can load a whole chunk, so algorithms that are optimized for out-of-core data do not use it for their main loops.
  • Those algorithms read the mask in bulk instead. Each one checks whether the mask is a UInt8Array or a BoolArray, calls copyIntoBuffer() on the matching store, and copies a bool mask through a contiguous bool scratch buffer, because std::vector<bool> is not contiguous. Each algorithm writes this branch itself.
  • A new algorithm then has to choose between a convenient helper that is slow out-of-core and a hand-written copy of the bulk pattern. Code that reads a mask only with getDataAs<BoolArray>() gets nullptr for a uint8 mask and silently ignores it.

Where it applies:

  • MaskCompare, BoolMaskCompare, UInt8MaskCompare and InstantiateMaskCompare() in src/simplnx/Utilities/MaskCompareUtilities.hpp and .cpp.
  • 27 files call InstantiateMaskCompare() (at 6dd86c67d).
  • These algorithms bulk-read the typed mask stores themselves. Several of them also use MaskCompare for element access, and some handle only one of the two mask types. Each one needs to be checked:
    • OrientationAnalysis: AlignSectionsMisorientation, AlignSectionsMutualInformation, BadDataNeighborOrientationCheckScanline, CAxisSegmentFeatures, ComputeFZQuaternions, EBSDSegmentFeatures, WriteStatsGenOdfAngleFile
    • SimplnxCore: AlignSectionsFeatureCentroid, ComputeArrayHistogram, ComputeArrayHistogramByFeature, ComputeArrayStatistics, ComputeFeaturePhasesBinary, CreateColorMapScanline, DBSCANScanline, ErodeDilateMask, ExtractVertexGeometry
  • Out-of-tree plugins, such as SimplnxReview, may contain the same pattern.

Requirements:

  • The bulk read returns a Result for a failed transfer.
  • In-core performance must not regress: compare the changed algorithms before and after in an in-core Release build.
  • Out-of-core behavior must not regress: run the [ooc] tests in the out-of-core build.
  • When MaskCompare has the bulk read, add a rule to docs/Code_Style_Guide.md that algorithms read masks through MaskCompare, in the same change.

The exact API (the signature of the bulk read, and whether it fills a uint8 or a bool buffer) is still open.

主要言語
C++
スター
18
フォーク
15
平均マージ
4日 23時間
マージ済み PR(30日)
42

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

BlueQuartzSoftware/simplnx のほかの issue

BlueQuartzSoftware/simplnx の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。