[ESSREDUCE] Mapping over components duplicates their shared transformation trunk

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

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

@SimonHeybrock がすでに取り組んでいます。

2026年10月26日 から。

評価

この issue はまだ評価されていません。

説明

Problem

Workflows that handle several components of one kind map over them:

wf[EmptyDetector[SampleRun]] = (
    wf[EmptyDetector[SampleRun]]
    .map({NeXusName[NXdetector]: names})
    .reduce(func=merge_triplets)
)

The map copies the full subgraph per component, including the loading and processing of each component's depends_on chain. The chains usually share a common trunk. On BIFROST all 45 triplets (and the elastic monitor and the analyzers) end in the same links:

channel_i_j_*/transformations/...            per triplet (5 links, via analyzer)
channel_i_arm/transformations/channel_i_arm_r0   shared by the 5 triplets of channel i
detector_tank/transformations/tank_angle     shared by all, NXlog (a4)
sample_position/transformations/beam_axis    shared by all, static

The graph has no node for the shared part. Each branch loads tank_angle from the file again, applies the time interval and the time filter to its own copy, and builds its own transformation. Consequences:

  • No single node for a quantity of the shared trunk. InstrumentAngle (a4) is one value for all detectors, but the detector chains exist only inside the mapped subgraph, so there is no single detector chain to take it from. scipp/ess#807 (for scipp/esslivedata#1318) works around this: extract_instrument_angle reads the angle from the elastic monitor's chain, which is not mapped. This relies on BIFROST having exactly one component on the tank that is not mapped.
  • Live data cannot replace a shared link after the map. esslivedata replaces moving-axis links with the latest stream value by inserting a provider for NeXusTransformationChain[Component, SampleRun]. Once the map has copied the chain provider into every branch, an inserted provider has no effect on the branches. BifrostWorkflow maps in its constructor, so a user of that workflow cannot patch the detector chains. The patch also has to be repeated for every component type whose chain passes through the link (detectors, monitors, analyzers).
  • Redundant work. The same log is read and processed once per branch, 45 times on BIFROST.

The same applies to any instrument with a moving component shared by several mapped components, e.g. a detector carriage carrying several banks.

Questions

  • Should shared links be represented once in the graph rather than once per component? If so, at what level: per NeXus path, per chain prefix, or something else?
  • Does scipp/ess#802 (BIFROST workflow without map-reduce) remove the problem for BIFROST? Does it remain for other workflows that map over components?
  • Are there cases where branches must not share a link, e.g. different time filters per component?

Context: scipp/esslivedata#1427.

主要言語
Python
スター
3
フォーク
6
平均マージ
2日 13時間
マージ済み PR(30日)
35

環境構築

はじめの一歩

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

scipp/ess のほかの issue

scipp/ess の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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