Skip to content

Conversation

@sherholz-intel
Copy link
Collaborator

This PR improves some numerical stabilities when using integer arithmetic when calculating the splitting statistics during KD tree building.
In addition, it fixes some numerical instabilities for the VMM fitting when only one sample is used to fit an VMM.
This is an unusual case but now it is at least stable.

…ginning more gracefully.

Adding an initialized flag to each Region.
The Region content is now only validated if the region was initialized first.
… using integer arithmetic

This bug led to splits with regions containing zero number of samples
…se integer arithmetic when parallel pivot splitting is disabled.
… increase robustness on very large scenes and adding some additional checks
…rithmetric based sample statistic estimation
The regionPivot is separated from the SampleStatistics mean position in case no samples are collected after a spatial split which clears the SampleStatistics.
float minDistance = length(sampleVariance);
float norm = sampleVariance.x * sampleVariance.x + sampleVariance.y * sampleVariance.y + sampleVariance.z * sampleVariance.z;
norm = std::max(FLT_EPSILON, norm);
float minDistance = std::sqrt(norm);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixing std::sqrt() and sqrt()

// merge split handling
regionAndRangeData.first.sampleStatistics.split(splitDim, splitPos, 0.25f, false);
regionAndRangeDataRight.first.sampleStatistics.split(splitDim, splitPos, 0.25f, true);
// regionAndRangeData.first.sampleStatistics.split(splitDim, splitPos, 0.25f, false);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this commented code still necessary or can it be removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am currently keeping it to remember that I removed it for this fix.
Just in case that we need to revert this.
Maybe adding a comment would be a good idea.

@sherholz-intel sherholz-intel merged commit d93ceae into devel Jun 18, 2025
4 checks passed
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