Skip to content

Temper randomness in 3D GWN method #1881

Open
jcs15c wants to merge 6 commits into
developfrom
bugfix/spainhour/deterministic_3d_gwn
Open

Temper randomness in 3D GWN method #1881
jcs15c wants to merge 6 commits into
developfrom
bugfix/spainhour/deterministic_3d_gwn

Conversation

@jcs15c

@jcs15c jcs15c commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

I've noticed that the text primal_solid_angle_test fails a bit more frequently than I'd like, as the underlying 3D GWN method has a few random components that fail with probability 0 mathematically, but probability >0 in floating point (by my estimate, about 0.1% of the time).

In particular, this PR addresses:

  • Within the GWN algorithm, a re-cast ray was taken to be a random unit vector. This has been reworked to use a Halton sequence projected onto the unit sphere, which also has the advantage of more reliably distributing the cast attempts over the unit sphere.
  • The per-surface cast-direction is taken to be the surface's average normal, plus a small perturbation. This has been changed so that the perturbation is seeded deterministically based on a (possibly too-simple) hashed function of the surface bounding box.

I've also added a simple test to verify this in primal_solid_angle.cpp.

@jcs15c jcs15c self-assigned this Jun 9, 2026
@jcs15c jcs15c added bug Something isn't working Primal Issues related to Axom's 'primal component labels Jun 9, 2026
@jcs15c jcs15c changed the title Remove randomness from 3D GWN method Temper randomness in 3D GWN method Jun 9, 2026
@jcs15c jcs15c marked this pull request as ready for review June 10, 2026 16:19

@kennyweiss kennyweiss left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!
Would it make sense for halton to be a core utility function w/ unit tests?
Perhaps not this time, but the next time we need it (?)

Please update the RELEASE_NOTES about this change.

@jcs15c

jcs15c commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks! Would it make sense for halton to be a core utility function w/ unit tests? Perhaps not this time, but the next time we need it (?)

It could get put it in axom::utilities alongside binomial_coefficient, but yes, since it's just used in this single lambda function for now, I think it'd be overkill. However, I do like Halton sequences on an aesthetic level, and will be eagerly looking for other places they could be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Primal Issues related to Axom's 'primal component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants