Repository navigation
Reject sources with a different SIMD feature set in metadata setters - #205
Merged
Auburn merged 3 commits intoOct 21, 2026
Merged
Conversation
A node reaches its sources through their SIMD class for its own feature set. Connecting a source created with a different feature set only hit an assert, in release the source's SIMD pointer was silently set to null: generation then crashed for a node lookup, or silently used the constant value for a hybrid. The metadata setFunc/setNodeFunc still returned true, so fnSetNodeLookup/fnSetHybridNodeLookup reported success. The metadata source setters now return false when the feature sets differ, without changing the node. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L2fYx8k4WU6rhiZF3mEwgP
The feature set check ran before the target generator was cast, so a null target (e.g. from CreateNode below the minimum compiled feature set) was dereferenced instead of making the setter return false. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L2fYx8k4WU6rhiZF3mEwgP
Declare the cast result on its own line and test it in a plain if condition, keeping the feature set check after the null check.
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.
Problem
A node calls its sources through their SIMD class for its own feature set. When a source with a different feature set was connected, the only check was an assert:
assert( GetActiveFeatureSet() == gen->GetActiveFeatureSet() )inSetSourceMemberVariableassert( simd )inSetSourceSIMDPtrIn release, the source's SIMD pointer was silently set to null. Meanwhile the metadata
setFunc/setNodeFunconlydynamic_castto the node types, which succeeds at any level, and returned true. So:fnSetNodeLookupreported success, then generation segfaulted.fnSetHybridNodeLookupreported success, then the node silently kept using its constant value.Fix
The four metadata source setters return false, without changing the node, when the source's feature set differs from the node's:
AddGeneratorSourceAddPerDimensionGeneratorSourceAddHybridSourceAddPerDimensionHybridSourceThe check runs after the target cast, so a null target still just returns false, as on master.
The C API and
Metadata.hdocs list the new false case. The C++SetSource*functions keep their debug assert.Output change
None. The decoder and benchmark always create every node at the same level.
Testing
Through the C API, with an SSE2
Add/FractalFBmand SSE2 and AVX2Simplexsources:fnSetNodeLookup( Add, LHS, AVX2 Simplex )fnSetHybridNodeLookup( FBm, Gain, AVX2 Simplex )setFunc/setNodeFuncwith a null target (CreateNode( SCALAR ))The 196-row node-type compare (every node type on all four feature sets) is bit-identical.
Generated by Claude Code