ATLAS Offline Software
Loading...
Searching...
No Matches
BucketInferenceToolBase.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN
3 for the benefit of the ATLAS collaboration
4*/
6
12
13#include "BucketGraphUtils.h"
15
16#include <array>
17#include <algorithm>
18#include <cctype>
19#include <limits>
20#include <sstream>
21#include <span>
22
23using namespace MuonML;
24
26 auto notSpace = [](unsigned char c) { return !std::isspace(c); };
27 s.erase(s.begin(), std::find_if(s.begin(), s.end(), notSpace));
28 s.erase(std::find_if(s.rbegin(), s.rend(), notSpace).base(), s.end());
29 return s;
30}
31
32std::vector<std::string> BucketInferenceToolBase::parseFeatureNames(const std::string& raw) {
33 std::vector<std::string> out;
34 const std::string s = trimFeatureToken(raw);
35 if (s.empty()) return out;
36
37 // Preferred exporter format: JSON list of strings.
38 if (!s.empty() && s.front() == '[') {
39 bool inQuote = false;
40 std::string token;
41 for (char c : s) {
42 if (c == '"') {
43 if (inQuote) {
44 if (!token.empty()) out.push_back(token);
45 token.clear();
46 }
47 inQuote = !inQuote;
48 continue;
49 }
50 if (inQuote) token.push_back(c);
51 }
52 if (!out.empty()) return out;
53 }
54
55 // Backward-compatible format: comma-separated.
56 std::istringstream ss(s);
57 std::string tok;
58 while (std::getline(ss, tok, ',')) {
59 tok = trimFeatureToken(tok);
60 if (!tok.empty()) out.push_back(tok);
61 }
62 return out;
63}
64
65Ort::Session& BucketInferenceToolBase::model() const {
66 return m_onnxSessionTool->session();
67}
68
70 ATH_CHECK(m_onnxSessionTool.retrieve());
71 ATH_CHECK(m_readKey.initialize());
72 ATH_CHECK(m_geoCtxKey.initialize());
73
74 // Detect CUDA provider by dynamic-casting the concrete session tool.
75 if (const auto* cudaTool = dynamic_cast<const AthOnnx::OnnxRuntimeSessionToolCUDA*>(
76 m_onnxSessionTool.get())) {
77 m_isCuda = true;
78 m_cudaDeviceId = cudaTool->deviceId();
79 ATH_MSG_INFO("ONNX session is running on CUDA device " << m_cudaDeviceId
80 << ". I/O binding will be used.");
81 } else {
82 m_isCuda = false;
83 ATH_MSG_INFO("ONNX session is running on CPU.");
84 }
85
86 return StatusCode::SUCCESS;
87}
88
89StatusCode BucketInferenceToolBase::buildFeaturesOnly(const EventContext& ctx,
90 GraphRawData& graphData) const {
91 graphData.graph = std::make_unique<InferenceGraph>();
92 graphData.srcEdges.clear();
93 graphData.desEdges.clear();
94 graphData.featureLeaves.clear();
95 graphData.spacePointsInBucket.clear();
96
97 const MuonR4::SpacePointContainer* buckets{nullptr};
98 ATH_CHECK(SG::get(buckets, m_readKey, ctx));
99
100 const ActsTrk::GeometryContext* gctx = nullptr;
101 ATH_CHECK(SG::get(gctx, m_geoCtxKey, ctx));
102
103 std::vector<BucketGraphUtils::NodeAux> nodes;
104 BucketGraphUtils::buildNodesAndFeatures(*buckets, *gctx, nodes,
105 graphData.featureLeaves,
106 graphData.spacePointsInBucket); // now int64_t-compatible
107
108 const int64_t numNodes = static_cast<int64_t>(nodes.size());
109 ATH_MSG_DEBUG("Total buckets: " << buckets->size()
110 << " -> nodes (size>0): " << numNodes
111 << " | features.size()=" << graphData.featureLeaves.size());
112
113 if (numNodes == 0) {
114 ATH_MSG_WARNING("No valid buckets found (all have size 0.0). Skipping inference.");
115 return StatusCode::SUCCESS;
116 }
117
118 const int64_t nFeatPerNode = static_cast<int64_t>(kBucketFeatureCount);
119 if (numNodes * nFeatPerNode != static_cast<int64_t>(graphData.featureLeaves.size())) {
120 ATH_MSG_ERROR( "Feature size mismatch: expected " << (numNodes * nFeatPerNode)
121 << " got " << graphData.featureLeaves.size());
122 return StatusCode::FAILURE;
123 }
124
125 Ort::MemoryInfo memInfo = Ort::MemoryInfo::CreateCpu(OrtDeviceAllocator, OrtMemTypeCPU);
126 std::vector<int64_t> featShape{numNodes, nFeatPerNode};
127 graphData.graph->dataTensor.emplace_back(
128 Ort::Value::CreateTensor<float>(memInfo,
129 graphData.featureLeaves.data(),
130 graphData.featureLeaves.size(),
131 featShape.data(),
132 featShape.size()));
133 return StatusCode::SUCCESS;
134}
135
136StatusCode BucketInferenceToolBase::buildTransformerInputs(const EventContext& ctx,
137 GraphRawData& graphData) const {
138 // Start from (N,6)
139 ATH_CHECK(buildFeaturesOnly(ctx, graphData));
140
141 // Copy features flat buffer for lifetime management
142 std::vector<float> featuresFlat = graphData.featureLeaves;
143 const int64_t S = static_cast<int64_t>(featuresFlat.size() / kBucketFeatureCount);
144
145 if (S == 0) {
146 ATH_MSG_WARNING("No valid features for transformer input. Skipping inference.");
147 return StatusCode::SUCCESS;
148 }
149
150 if (msgLvl(MSG::DEBUG)) {
151 // DEBUG: Print transformer input features for first 10 nodes
152 ATH_MSG_DEBUG("=== DEBUGGING: Transformer input features for first 10 nodes ===");
153 const int64_t debugNodes = std::min(S, static_cast<int64_t>(10));
154 for (int64_t nodeIdx = 0; nodeIdx < debugNodes; ++nodeIdx) {
155 const int64_t baseIdx = nodeIdx * static_cast<int64_t>(kBucketFeatureCount);
156 ATH_MSG_DEBUG("TransformerNode[" << nodeIdx << "]: "
157 << "x=" << featuresFlat[baseIdx + 0] << ", "
158 << "y=" << featuresFlat[baseIdx + 1] << ", "
159 << "z=" << featuresFlat[baseIdx + 2] << ", "
160 << "layers=" << featuresFlat[baseIdx + 3] << ", "
161 << "nSp=" << featuresFlat[baseIdx + 4] << ", "
162 << "bucketSize=" << featuresFlat[baseIdx + 5]);
163 }
164 ATH_MSG_DEBUG("=== END DEBUG TRANSFORMER FEATURES ===");
165 }
166
167 // Rebuild graph with exactly 2 inputs: features [1,S,6], pad_mask [1,S]
168 graphData.graph = std::make_unique<InferenceGraph>();
169
170 Ort::MemoryInfo memInfo = Ort::MemoryInfo::CreateCpu(OrtDeviceAllocator, OrtMemTypeCPU);
171
172 // features: [1,S,6] (backed by graphData.featureLeaves to keep alive)
173 std::vector<int64_t> fShape{1, S, static_cast<int64_t>(kBucketFeatureCount)};
174 graphData.featureLeaves.swap(featuresFlat);
175 graphData.graph->dataTensor.emplace_back(
176 Ort::Value::CreateTensor<float>(memInfo,
177 graphData.featureLeaves.data(),
178 graphData.featureLeaves.size(),
179 fShape.data(),
180 fShape.size()));
181
182 // pad_mask: [1,S] (bool). Create ORT-owned tensor and fill with False (=valid).
183 Ort::AllocatorWithDefaultOptions allocator;
184 std::vector<int64_t> mShape{1, S};
185 Ort::Value padVal = Ort::Value::CreateTensor(allocator,
186 mShape.data(),
187 mShape.size(),
188 ONNX_TENSOR_ELEMENT_DATA_TYPE_BOOL);
189 bool* maskPtr = padVal.GetTensorMutableData<bool>();
190 for (int64_t i = 0; i < S; ++i) maskPtr[i] = false;
191 graphData.graph->dataTensor.emplace_back(std::move(padVal));
192
193 return StatusCode::SUCCESS;
194}
195
196StatusCode BucketInferenceToolBase::buildGraph(const EventContext& ctx,
197 GraphRawData& graphData) const {
198 ATH_CHECK(buildFeaturesOnly(ctx, graphData));
199
200 const MuonR4::SpacePointContainer* buckets{nullptr};
201 ATH_CHECK(SG::get(buckets, m_readKey, ctx));
202
203 const ActsTrk::GeometryContext* gctx = nullptr;
204 ATH_CHECK(SG::get(gctx, m_geoCtxKey, ctx));
205
206 std::vector<BucketGraphUtils::NodeAux> nodes;
207 std::vector<float> throwawayFeatures;
208 std::vector<int64_t> throwawaySp; // int64_t
209 BucketGraphUtils::buildNodesAndFeatures(*buckets, *gctx, nodes, throwawayFeatures, throwawaySp);
210
211 const int64_t numNodes = static_cast<int64_t>(nodes.size());
212 if (numNodes == 0) {
213 ATH_MSG_WARNING("No valid buckets found (all have size 0.0). Skipping graph building.");
214 return StatusCode::SUCCESS;
215 }
216
217 std::vector<int64_t> srcEdges, dstEdges;
224 srcEdges, dstEdges);
225 if (m_validateEdges) {
226 size_t bad = 0;
227 std::vector<int64_t> newSrc;
228 std::vector<int64_t> newDst;
229 newSrc.reserve(srcEdges.size());
230 newDst.reserve(dstEdges.size());
231 for (size_t k = 0; k < srcEdges.size(); ++k) {
232 const int64_t u = srcEdges[k];
233 const int64_t v = dstEdges[k];
234 const bool okU = (u >= 0 && u < numNodes);
235 const bool okV = (v >= 0 && v < numNodes);
236 if (okU && okV) {
237 newSrc.push_back(u);
238 newDst.push_back(v);
239 } else {
240 ++bad;
241 ATH_MSG_DEBUG( "Drop invalid edge " << k << ": (" << u << "->" << v
242 << "), valid node range [0," << (numNodes-1) << "]");
243 }
244 }
245 if (bad) {
246 ATH_MSG_WARNING( "Removed " << bad << " invalid edges out of "
247 << srcEdges.size());
248 srcEdges.swap(newSrc);
249 dstEdges.swap(newDst);
250 }
251 }
252
253 const size_t E = srcEdges.size();
254
255 if (msgLvl(MSG::DEBUG)) {
256 // DEBUG: Count connections per node
257 ATH_MSG_DEBUG("Edges built: " << E);
258 const unsigned int dumpE = std::min<unsigned int>(m_debugDumpFirstNEdges, E);
259 for (unsigned int k = 0; k < dumpE; ++k) {
260 ATH_MSG_DEBUG("EDGE[" << k << "]: " << srcEdges[k] << " -> " << dstEdges[k]);
261 }
262 std::vector<int> nodeConnections(numNodes, 0);
263 for (size_t k = 0; k < srcEdges.size(); ++k) {
264 const int64_t u = srcEdges[k];
265 const int64_t v = dstEdges[k];
266 if (u >= 0 && u < numNodes) nodeConnections[u]++;
267 if (v >= 0 && v < numNodes) nodeConnections[v]++;
268 }
269
270 ATH_MSG_INFO("=== DEBUGGING: Node Connections (first 10 nodes) ===");
271 const int64_t debugNodeCount = std::min(numNodes, static_cast<int64_t>(10));
272 for (int64_t i = 0; i < debugNodeCount; ++i) {
273 ATH_MSG_DEBUG("Node[" << i << "] connections: " << nodeConnections[i]);
274 }
275 ATH_MSG_DEBUG("=== END DEBUG NODE CONNECTIONS ===");
276
277 // DEBUG: Show detailed edge connections for first 10 nodes
278 ATH_MSG_DEBUG("=== DEBUGGING: Detailed Edge Connections (first 10 nodes) ===");
279 for (int64_t nodeIdx = 0; nodeIdx < debugNodeCount; ++nodeIdx) {
280 std::stringstream connections;
281 connections << "Node[" << nodeIdx << "] connected to: ";
282 bool foundAny = false;
283
284 for (size_t k = 0; k < srcEdges.size(); ++k) {
285 const int64_t u = srcEdges[k];
286 const int64_t v = dstEdges[k];
287
288 if (u == nodeIdx) {
289 if (foundAny) connections << ", ";
290 connections << v;
291 foundAny = true;
292 } else if (v == nodeIdx) {
293 if (foundAny) connections << ", ";
294 connections << u;
295 foundAny = true;
296 }
297 }
298
299 if (!foundAny) connections << "none";
300 ATH_MSG_DEBUG(connections.str());
301 }
302 ATH_MSG_DEBUG("=== END DEBUG DETAILED CONNECTIONS ===");
303 }
304
305 graphData.edgeIndexPacked.clear();
306 const size_t Efinal = BucketGraphUtils::packEdgeIndex(srcEdges, dstEdges, graphData.edgeIndexPacked);
307
308 Ort::MemoryInfo memInfo = Ort::MemoryInfo::CreateCpu(OrtDeviceAllocator, OrtMemTypeCPU);
309 std::vector<int64_t> edgeShape{2, static_cast<int64_t>(Efinal)};
310 graphData.graph->dataTensor.emplace_back(
311 Ort::Value::CreateTensor<int64_t>(memInfo,
312 graphData.edgeIndexPacked.data(),
313 graphData.edgeIndexPacked.size(),
314 edgeShape.data(),
315 edgeShape.size()));
316
317 ATH_MSG_DEBUG("Built sparse bucket graph: N=" << numNodes << ", E=" << Efinal);
318 return StatusCode::SUCCESS;
319}
320
322 GraphRawData& graphData,
323 const std::vector<const char*>& inputNames,
324 const std::vector<const char*>& outputNames) const
325{
326 if (!graphData.graph) {
327 ATH_MSG_ERROR("Graph data is not built.");
328 return StatusCode::FAILURE;
329 }
330 if (graphData.graph->dataTensor.empty()) {
331 ATH_MSG_ERROR("No input tensors prepared for inference.");
332 return StatusCode::FAILURE;
333 }
334
335 if (msgLvl(MSG::DEBUG)) {
336 // DEBUG: Print actual input tensor data for features tensor
337
338 ATH_MSG_DEBUG("=== DEBUGGING: ONNX Input tensor data ===");
339 if (!graphData.graph->dataTensor.empty()) {
340 const auto& featureTensor = graphData.graph->dataTensor[0];
341 auto featShape = featureTensor.GetTensorTypeAndShapeInfo().GetShape();
342 ATH_MSG_DEBUG("Features tensor shape: [" << featShape[0]
343 << (featShape.size()>1 ? ("," + std::to_string(featShape[1])) : "")
344 << (featShape.size()>2 ? ("," + std::to_string(featShape[2])) : "") << "]");
345
346 float* featData = const_cast<Ort::Value&>(featureTensor).GetTensorMutableData<float>();
347 const size_t totalElements = featureTensor.GetTensorTypeAndShapeInfo().GetElementCount();
348 ATH_MSG_DEBUG("Features tensor total elements: " << totalElements);
349
350 // Print up to 10 nodes; stride = nFeat from tensor shape
351 const size_t nFeat = (featShape.size() > 1 && featShape[1] > 0) ? static_cast<size_t>(featShape[1]) : 1;
352 const size_t nNodes = totalElements / nFeat;
353 const size_t debugNodes = std::min(nNodes, static_cast<size_t>(10));
354
355 // Try to read feature names from model custom metadata.
356 // Prefer x_feature_names (current exporter), then fall back to legacy keys.
357 std::vector<std::string> featNames;
358 {
359 Ort::AllocatorWithDefaultOptions allocator;
360 Ort::ModelMetadata meta = model().GetModelMetadata();
361 auto keys = meta.GetCustomMetadataMapKeysAllocated(allocator);
362 std::vector<std::string> keyNames;
363 keyNames.reserve(keys.size());
364 for (const auto& k : keys) keyNames.emplace_back(k.get());
365 const std::array<std::string, 4> candidates{
366 "x_feature_names", "node_feature_names", "feature_names", "input_feature_names"};
367 for (const std::string& key : candidates) {
368 if (std::find(keyNames.begin(), keyNames.end(), key) != keyNames.end()) {
369 std::string val = meta.LookupCustomMetadataMapAllocated(key.c_str(), allocator).get();
370 featNames = parseFeatureNames(val);
371 break;
372 }
373 }
374 if (featNames.empty()) {
375 ATH_MSG_DEBUG("No usable feature-name metadata key found in model; using generic fN labels.");
376 }
377 }
378 auto featLabel = [&](size_t f) -> std::string {
379 if (f < featNames.size()) return featNames[f];
380 return "f" + std::to_string(f);
381 };
382
383 // Print legend
384 {
385 std::ostringstream legend;
386 legend << "Node feature legend (" << nFeat << " features):";
387 for (size_t f = 0; f < nFeat; ++f) {
388 legend << " f" << f << "=" << featLabel(f);
389 if (f + 1 < nFeat) legend << ",";
390 }
391 ATH_MSG_DEBUG(legend.str());
392 }
393
394 for (size_t n = 0; n < debugNodes; ++n) {
395 std::ostringstream row;
396 row << "ONNXNode[" << n << "]:";
397 for (size_t f = 0; f < nFeat; ++f) {
398 row << " f" << f << "=" << featData[n * nFeat + f];
399 if (f + 1 < nFeat) row << ",";
400 }
401 ATH_MSG_DEBUG(row.str());
402 }
403 }
404 ATH_MSG_DEBUG("=== END DEBUG ONNX INPUT ===");
405 }
406
407 Ort::RunOptions run_options;
408 run_options.SetRunLogSeverityLevel(ORT_LOGGING_LEVEL_ERROR);
409
410 if (m_isCuda) {
411 // ---- CUDA path: use IoBinding so tensors stay on device ----
412 Ort::IoBinding binding(model());
413 for (std::size_t i = 0; i < inputNames.size(); ++i) {
414 binding.BindInput(inputNames[i], graphData.graph->dataTensor[i]);
415 }
416 // Bind outputs to CPU so predictions are directly readable after sync.
417 Ort::MemoryInfo cpuOut = Ort::MemoryInfo::CreateCpu(OrtArenaAllocator, OrtMemTypeDefault);
418 for (const char* outName : outputNames) {
419 binding.BindOutput(outName, cpuOut);
420 }
421
422 model().Run(run_options, binding);
423 binding.SynchronizeOutputs();
424
425 std::vector<Ort::Value> outputs = binding.GetOutputValues();
426 if (outputs.empty()) {
427 ATH_MSG_ERROR("IoBinding inference returned empty output.");
428 return StatusCode::FAILURE;
429 }
430
431 float* outData = outputs[0].GetTensorMutableData<float>();
432 const size_t outSize = outputs[0].GetTensorTypeAndShapeInfo().GetElementCount();
433 ATH_MSG_DEBUG("ONNX (IoBinding) raw output elementCount = " << outSize);
434
435 if (m_sanitizeNonFinitePredictions.value()) {
436 std::span<float> preds(outData, outData + outSize);
437 for (size_t i = 0; i < outSize; ++i) {
438 if (!std::isfinite(preds[i])) {
439 ATH_MSG_WARNING("Non-finite prediction detected at " << i << " -> set to -100.");
440 preds[i] = -100.0f;
441 }
442 }
443 }
444
445 for (auto& v : outputs) {
446 graphData.graph->dataTensor.emplace_back(std::move(v));
447 }
448 return StatusCode::SUCCESS;
449 }
450
451 // ---- CPU path ----
452 std::vector<Ort::Value> outputs =
453 model().Run(run_options,
454 inputNames.data(),
455 graphData.graph->dataTensor.data(),
456 graphData.graph->dataTensor.size(),
457 outputNames.data(),
458 outputNames.size());
459
460 if (outputs.empty()) {
461 ATH_MSG_ERROR("Inference returned empty output.");
462 return StatusCode::FAILURE;
463 }
464
465 float* outData = outputs[0].GetTensorMutableData<float>();
466 const size_t outSize = outputs[0].GetTensorTypeAndShapeInfo().GetElementCount();
467 ATH_MSG_DEBUG("ONNX raw output elementCount = " << outSize);
468
469 if (m_sanitizeNonFinitePredictions.value()) {
470 std::span<float> preds(outData, outData + outSize);
471 for (size_t i = 0; i < outSize; ++i) {
472 if (!std::isfinite(preds[i])) {
473 ATH_MSG_WARNING("Non-finite prediction detected at " << i << " -> set to -100.");
474 preds[i] = -100.0f;
475 }
476 }
477 }
478
479 for (auto& v : outputs) {
480 graphData.graph->dataTensor.emplace_back(std::move(v));
481 }
482 return StatusCode::SUCCESS;
483}
484
486 std::vector<const char*> inputNames = {"features", "edge_index"};
487 std::vector<const char*> outputNames = {m_outputName.value().c_str()};
488 return runNamedInference(graphData, inputNames, outputNames);
489}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
static Double_t ss
Handle class for reading from StoreGate.
size_type size() const noexcept
Returns the number of elements in the collection.
StatusCode buildGraph(const EventContext &ctx, GraphRawData &graphData) const
GNN-style graph builder (features + edges). Kept for tools that want it.
StatusCode buildFeaturesOnly(const EventContext &ctx, GraphRawData &graphData) const
Build only features (N,6); attaches one tensor in graph.dataTensor[0].
static std::string trimFeatureToken(std::string s)
StatusCode buildTransformerInputs(const EventContext &ctx, GraphRawData &graphData) const
Build Transformer inputs: features [1,S,6] and pad_mask [1,S] (False = valid), as tensors 0 and 1.
Gaudi::Property< std::string > m_outputName
Gaudi::Property< unsigned int > m_debugDumpFirstNEdges
static constexpr std::size_t kBucketFeatureCount
static std::vector< std::string > parseFeatureNames(const std::string &raw)
StatusCode runNamedInference(GraphRawData &graphData, const std::vector< const char * > &inputNames, const std::vector< const char * > &outputNames) const
Generic named inference, for tools with different I/O conventions.
Gaudi::Property< bool > m_sanitizeNonFinitePredictions
ToolHandle< AthOnnx::IOnnxRuntimeSessionTool > m_onnxSessionTool
StatusCode runInference(GraphRawData &graphData) const
Default ONNX run for GNN case: inputs {"features","edge_index"} -> outputs {"logits"}...
SG::ReadHandleKey< MuonR4::SpacePointContainer > m_readKey
Gaudi::Property< double > m_maxDistXY
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
void buildNodesAndFeatures(const MuonR4::SpacePointContainer &buckets, const ActsTrk::GeometryContext &gctx, std::vector< NodeAux > &nodes, std::vector< float > &featuresLeaves, std::vector< int64_t > &spInBucket)
Build nodes + flat features (N,6) and number of SPs per kept bucket.
void buildSparseEdges(const std::vector< NodeAux > &nodes, int minLayers, int maxChamberDelta, int maxSectorDelta, double maxDistXY, double maxAbsDz, std::vector< int64_t > &srcEdges, std::vector< int64_t > &dstEdges)
size_t packEdgeIndex(const std::vector< int64_t > &srcEdges, const std::vector< int64_t > &dstEdges, std::vector< int64_t > &edgeIndexPacked)
DataVector< SpacePointBucket > SpacePointContainer
Abrivation of the space point container type.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
-diff
Helper struct to ship the Graph from the space point buckets to ONNX.
Definition GraphData.h:25
FeatureVec_t featureLeaves
Vector containing all features.
Definition GraphData.h:30
EdgeCounterVec_t edgeIndexPacked
Packed edge index buffer (kept alive for ONNX tensors that reference it) This stores [srcEdges,...
Definition GraphData.h:42
std::unique_ptr< InferenceGraph > graph
Pointer to the graph to be parsed to ONNX.
Definition GraphData.h:46
EdgeCounterVec_t srcEdges
Vector encoding the source index of the.
Definition GraphData.h:32
EdgeCounterVec_t desEdges
Vect.
Definition GraphData.h:34
NodeConnectVec_t spacePointsInBucket
Vector keeping track of how many space points are in each parsed bucket.
Definition GraphData.h:36