Particle: Lift state array access outside of loops - #2224
Draft
jeremylt wants to merge 7 commits into
Draft
Conversation
Contributor
Author
|
note to me - issue of requesting ptrs to containers with 0 particles |
jeremylt
force-pushed
the
jeremy/particle-loops
branch
from
August 27, 2026 13:55
9eb7cbf to
5325918
Compare
jeremylt
force-pushed
the
jeremy/particle-loops
branch
2 times, most recently
from
August 27, 2026 14:14
bb03992 to
ab229c1
Compare
jeremylt
force-pushed
the
jeremy/particle-loops
branch
4 times, most recently
from
August 28, 2026 09:54
b03912d to
c8fc45b
Compare
Contributor
Author
|
Couple of failing local tests on last commit, need to investigate after lunch |
jeremylt
force-pushed
the
jeremy/particle-loops
branch
2 times, most recently
from
August 28, 2026 11:21
bed4399 to
fb8feb6
Compare
Contributor
Author
|
Ugh, some of the CI compilers are less capable of understanding overloading than my local machine |
jeremylt
force-pushed
the
jeremy/particle-loops
branch
5 times, most recently
from
August 28, 2026 15:50
5eb559e to
e5b1e4b
Compare
jeremylt
force-pushed
the
jeremy/particle-loops
branch
from
August 31, 2026 06:54
e5b1e4b to
179a39c
Compare
Contributor
Author
|
Ok, logic is straightened out - need to benchmark now and see if this has any perf changes. Optimistically, I'd hope it helps |
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.
Description and Context
This is the bones of my effort to lift particle state array access outside of loops. This is a prerequsite to GPU implementation. I'm not fully satisfied with the code, so this PR is currently in draft. Points of irritation
with callsites looking like
More verbose (though possibly fixable) but clearer intent.
try_*, which maybe could bewith callsites looking like
These two really are showing my stronger knowledge of C and weaker knowledge of C++ conventions (or families of conventions, as it may be).
While (hopefully) the compiler should compile out these temp variables, I wonder if in some spots if it would be easier not to make
foo_iand just usefoo.There is the implicit (and I believe correct) assumption here that the first particle of a pair is always owned? Would be good to document somewhere if I can confirm this.
On the topic of conventions, should I have
ConstParticleContainerBundleStatePtrs&orauto&(andParticleContainerBundleStatePtrs&andauto&?). I created rather verbose type aliases here but I'm not sure of a shorter while also clear name? In any case, I do see usage ofautobut not sure when its preferred and not.Need to profile this. I do wonder if it helps perf.
Edit: Added the
bundle_state_ptrs_indexhelper and it definitely makes intent clearer to read imho. For the moment I'm keeping with the convention of the local variablesfoo_i, as those should be compiled out. I have not switched toauto&at the moment, but that's an easy swap if desired. Profiling is a ToDo I'm curious about.Related Issues and Pull Requests
See long term plan in #2148
Disclosure of AI assistance
None