Skip to content

Fix Runtime::snapshot access to GraphEntry node#82

Closed
YuMuuu wants to merge 9 commits into
elemaudio:developfrom
YuMuuu:fix/runtime-snapshot-graph-entry
Closed

Fix Runtime::snapshot access to GraphEntry node#82
YuMuuu wants to merge 9 commits into
elemaudio:developfrom
YuMuuu:fix/runtime-snapshot-graph-entry

Conversation

@YuMuuu

@YuMuuu YuMuuu commented Jun 6, 2026

Copy link
Copy Markdown

Summary

Fix Runtime::snapshot() to access getProperties() through the
GraphNode stored in each GraphEntry.

nodeTable maps NodeId to GraphEntry, but GraphEntry itself does not
provide getProperties(). The method belongs to GraphEntry::node.

This regression appears to have been introduced in
a8923b8, when the mapped type of
nodeTable was changed from std::shared_ptr<GraphNode<FloatType>> to
GraphEntry.

Reproduction

At commit a8923b8, run the following from the repository root:

printf '#include "elem/Runtime.h"\nvoid test(elem::Runtime<float>& r)
{ (void)r.snapshot(); }\n' \
  | c++ -Iruntime -std=c++17 -fsyntax-only -x c++ -
In file included from <stdin>:1:
runtime/elem/Runtime.h:527:50: error: member reference type 'std::tuple_element<1, std::pair<const int, elem::Runtime<float>::GraphEntry>>::type' (aka 'elem::Runtime<float>::GraphEntry') is not a pointer; did you mean to use '.'?
          ret.insert({nodeIdToHex(nodeId), node->getProperties()});
                                           ~~~~^~
                                               .
<stdin>:3:13: note: in instantiation of member function 'elem::Runtime<float>::snapshot' requested here
{ (void)r.snapshot(); }
          ^
In file included from <stdin>:1:
runtime/elem/Runtime.h:527:52: error: no member named 'getProperties' in 'elem::Runtime<float>::GraphEntry'
          ret.insert({nodeIdToHex(nodeId), node->getProperties()});
                                           ~~~~  ^
2 errors generated.

Compilation fails with:

error: no member named 'getProperties' in 'elem::Runtime::GraphEntry'

The regular native build does not detect this because Runtime is a class
template and snapshot() is not instantiated unless it is used.

Change:

node->getProperties()

to:

entry.node->getProperties()

The reproduction command succeeds after this change.

@YuMuuu YuMuuu marked this pull request as ready for review June 6, 2026 16:24
@YuMuuu

YuMuuu commented Jun 6, 2026

Copy link
Copy Markdown
Author

This likely affects all releases from v4.0.0 through v4.0.8.

a8923b8#diff-09113ad3ada3d29ef5720cd1d63e85b7a05ef4e3885f217f861f00d7d15f719e

image

@YuMuuu YuMuuu force-pushed the fix/runtime-snapshot-graph-entry branch from 6e6f8db to 2257c7d Compare June 6, 2026 16:34
@YuMuuu YuMuuu closed this Jun 6, 2026
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.

3 participants