Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8535376
Reapply "Prohibit ratracing from outside"
sethrj Nov 25, 2025
70b0ffe
Add safety with lmit
sethrj Nov 25, 2025
eacba71
Remove world accessor
sethrj Nov 25, 2025
94ba064
Update type based on BVH::LevelInside
sethrj Nov 25, 2025
53526f0
WIP: use vg bvh for 2.x solids
sethrj Nov 25, 2025
95054ce
Delete unused methods
sethrj Nov 25, 2025
4b723a8
Document fma parameters
sethrj Nov 25, 2025
13b40ad
Move BVH bump into track view
sethrj Nov 25, 2025
e0c42db
WIP: start comparing again
sethrj Nov 25, 2025
fce6f9f
Revert "Update type based on BVH::LevelInside"
sethrj Nov 25, 2025
bb33f4d
Remove extra push from vg track view
sethrj Nov 25, 2025
eb2cd54
Add error checking code to vecgeom track view
sethrj Nov 25, 2025
fdf1432
WIP: field propagation
sethrj Nov 25, 2025
24c0b52
Add comments
sethrj Nov 27, 2025
585a300
Add length units to vecgeom debug output
sethrj Nov 29, 2025
0a573bc
Clear failure flag on reinitialize
sethrj Nov 29, 2025
d6cbcbe
Vecgeom solid 1 and 2 pass vg tests
sethrj Nov 29, 2025
9b0eaa0
All vg, g4, orange passes geo tests
sethrj Nov 29, 2025
a0b5d54
VG solid 1 passes field propagator
sethrj Nov 29, 2025
91d16a9
OK now I guess it passes for real
sethrj Nov 29, 2025
0c0c3aa
Field with vg2 solids passes
sethrj Nov 29, 2025
ccea451
Surface vg passes
sethrj Nov 29, 2025
c11e6c9
Send 'failed' state back to propagation applier
sethrj Nov 29, 2025
2625738
Clean up a few things
sethrj Dec 10, 2025
09f1eaa
Add edge case for starting near boundary at tangent
sethrj Dec 11, 2025
b4f2a5e
Warn when starting on a boundary
sethrj Dec 11, 2025
bca5962
Update geotest/field for vg2 solid init-on-boundary failure
sethrj Dec 11, 2025
67b24b4
VG 2 isn't "reference CI" build
sethrj Dec 11, 2025
59c436d
Allow slight safety overestimates in geo track view
sethrj Dec 11, 2025
fe5a539
Try bumping when initializing on boundary
sethrj Dec 12, 2025
01b03d1
Revert "Try bumping when initializing on boundary"
sethrj Dec 12, 2025
dbcd38f
Merge remote-tracking branch 'upstream/develop'
sethrj Feb 4, 2026
cebffd1
Validate pointers from runtime in BVHNavigator
sethrj Dec 18, 2025
c5e5463
Update executor script
sethrj Feb 4, 2026
3500642
Fix main geometry tests by increasing bump distance due to single-pre…
sethrj Feb 4, 2026
bc5149e
Update field propagator for ORANGE
sethrj Feb 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 34 additions & 24 deletions scripts/cmake-presets/executor.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,21 @@
"name": ".base",
"hidden": true,
"generator": "Ninja",
"inherits": [".spack-env"],
"binaryDir": "${sourceDir}/build-${presetName}",
"cacheVariables": {
"BUILD_SHARED_LIBS": {"type": "BOOL", "value": "ON"},
"BUILD_TESTING": {"type": "BOOL", "value": "ON"},
"CELERITAS_USE_covfie": {"type": "BOOL", "value": "ON"},
"CELERITAS_USE_CUDA": {"type": "BOOL", "value": "OFF"},
"CELERITAS_USE_DD4hep": {"type": "BOOL", "value": "OFF"},
"CELERITAS_USE_LArSoft": {"type": "BOOL", "value": "OFF"},
"CELERITAS_USE_HepMC3": {"type": "BOOL", "value": "ON"},
"CELERITAS_USE_HIP": {"type": "BOOL", "value": "OFF"},
"CELERITAS_USE_Geant4": {"type": "BOOL", "value": "ON"},
"CELERITAS_USE_MPI": {"type": "BOOL", "value": "OFF"},
"CELERITAS_USE_OpenMP": {"type": "BOOL", "value": "OFF"},
"CELERITAS_USE_PNG": {"type": "BOOL", "value": "OFF"},
"CELERITAS_USE_Python": {"type": "BOOL", "value": "ON"},
"CELERITAS_USE_ROOT": {"type": "BOOL", "value": "OFF"},
"CELERITAS_USE_VecGeom": {"type": "BOOL", "value": "OFF"},
"CELERITAS_BUILD_TESTS": {"type": "BOOL", "value": "ON"},
"CELERITAS_BUILTIN_CLI11": {"type": "BOOL", "value": "OFF"},
"CELERITAS_BUILTIN_G4VG": {"type": "BOOL", "value": "OFF"},
"CELERITAS_BUILTIN_nlohmann_json": {"type": "BOOL", "value": "OFF"},
"CELERITAS_BUILTIN_GTest": {"type": "BOOL", "value": "OFF"},
"CMAKE_C_COMPILER_LAUNCHER": null,
"CMAKE_CXX_COMPILER_LAUNCHER": null,
"CMAKE_EXPORT_COMPILE_COMMANDS": {"type": "BOOL", "value": "ON"},
Expand All @@ -47,18 +41,37 @@
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Werror -Wno-error=deprecated -pedantic -fdiagnostics-color=always"
}
},
{
"name": ".spackbase",
"hidden": true,
"generator": "Ninja",
"inherits": [".base", ".spack-env"],
"binaryDir": "${sourceDir}/build-${presetName}",
"cacheVariables": {
"CELERITAS_USE_covfie": {"type": "BOOL", "value": "ON"},
"CELERITAS_USE_HepMC3": {"type": "BOOL", "value": "ON"},
"CELERITAS_USE_Geant4": {"type": "BOOL", "value": "ON"},
"CELERITAS_USE_PNG": {"type": "BOOL", "value": "ON"},
"CELERITAS_USE_Python": {"type": "BOOL", "value": "ON"},
"CELERITAS_BUILD_TESTS": {"type": "BOOL", "value": "ON"},
"CELERITAS_BUILTIN_CLI11": {"type": "BOOL", "value": "OFF"},
"CELERITAS_BUILTIN_G4VG": {"type": "BOOL", "value": "OFF"},
"CELERITAS_BUILTIN_nlohmann_json": {"type": "BOOL", "value": "OFF"},
"CELERITAS_BUILTIN_GTest": {"type": "BOOL", "value": "OFF"}
}
},
{
"name": "iwyu",
"displayName": "Include-what-you-use (see scripts/dev/run-iwyu.sh)",
"inherits": [".base"],
"inherits": [".spackbase"],
"cacheVariables": {
"CELERITAS_BUILD_TESTS": {"type": "BOOL", "value": "OFF"},
"CELERITAS_DEBUG": {"type": "BOOL", "value": "OFF"}
}
},
{
"name": "min",
"displayName": "Goldfinger minimal build",
"displayName": "Executor minimal build",
"inherits": [".base", ".debug", "default"],
"environment": {
"CMAKE_PREFIX_PATH": "$env{SPACK_ROOT}/var/spack/environments/celeritas-min/.spack-env/view"
Expand All @@ -72,7 +85,7 @@
{
"name": "base",
"displayName": "Goldfinger default options",
"inherits": [".ccache", ".base", ".debug", "default"],
"inherits": [".ccache", ".spackbase", ".debug", "default"],
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CELERITAS_BUILD_DOCS": {"type": "BOOL", "value": "ON"},
Expand All @@ -91,15 +104,10 @@
"CELERITAS_REAL_TYPE": "float"
}
},
{
"name": "mini",
"displayName": "Minimal deps",
"inherits": ["minimal", ".base", ".debug"]
},
{
"name": "si",
"displayName": "With SI units",
"inherits": [".base", ".debug", "default"],
"inherits": [".spackbase", ".debug", "default"],
"cacheVariables": {
"CELERITAS_UNITS": "SI",
"CELERITAS_CORE_GEO": "VecGeom",
Expand All @@ -109,7 +117,7 @@
{
"name": "vecgeom",
"displayName": "With vecgeom",
"inherits": [".ccache", ".base", ".debug", "default"],
"inherits": [".ccache", ".spackbase", ".debug", "default"],
"cacheVariables": {
"CELERITAS_USE_VecGeom": {"type": "BOOL", "value": "ON"}
}
Expand All @@ -119,16 +127,18 @@
"displayName": "With local vecgeom",
"inherits": [".ccache", ".base", ".debug", "default"],
"environment": {
"CMAKE_PREFIX_PATH": "/opt/spack/opt/spack/tahoe/geant4/11.3.2/7oydgus:/opt/spack/opt/spack/tahoe/googletest/1.17.0/c332ssk:/opt/spack/opt/spack/tahoe/cli11/2.5.0/pmtt6hb:/opt/spack/opt/spack/tahoe/nlohmann-json/3.12.0/dkrlqn3:/opt/spack/opt/spack/tahoe/covfie/0.15.3/tlzukkw:/opt/spack/opt/spack/tahoe/zlib-ng/2.2.4/qbbzbte"
"CMAKE_PREFIX_PATH": "/opt/spack/opt/spack/tahoe/geant4/11.3.2/gykadvh:/opt/spack/opt/spack/tahoe/covfie/0.15.4/r5g2psb:/opt/spack/opt/spack/tahoe/nlohmann-json/3.12.0/7mlcviu:/opt/spack/opt/spack/tahoe/cli11/2.6.1/znuwv76:/opt/spack/opt/spack/tahoe/googletest/1.17.0/rmxgcak"
},
"cacheVariables": {
"CELERITAS_BUILTIN_CLI11": {"type": "BOOL", "value": "OFF"},
"CELERITAS_BUILTIN_G4VG": {"type": "BOOL", "value": "ON"},
"CELERITAS_BUILTIN_GTest": {"type": "BOOL", "value": "OFF"},
"CELERITAS_BUILTIN_nlohmann_json": {"type": "BOOL", "value": "OFF"},
"CELERITAS_USE_HepMC3": {"type": "BOOL", "value": "OFF"},
"CELERITAS_USE_ROOT": {"type": "BOOL", "value": "OFF"},
"CELERITAS_USE_VecGeom": {"type": "BOOL", "value": "ON"},
"CELERITAS_VecGeom_SURFACE": {"type": "BOOL", "value": "ON"},
"VecGeom_DIR": {"type": "PATH", "value": "/Users/seth/Code/vecgeom/install/lib/cmake/VecGeom"}

}
},
{
Expand All @@ -150,7 +160,7 @@
{
"name": "geant4",
"displayName": "Using Geant4 navigation",
"inherits": [".base", ".debug", "default"],
"inherits": [".spackbase", ".debug", "default"],
"cacheVariables": {
"CELERITAS_CORE_GEO": "Geant4",
"CELERITAS_UNITS": "CLHEP",
Expand All @@ -162,7 +172,7 @@
{
"name": "reldeb",
"displayName": "With ORANGE in optimized+errcheck mode",
"inherits": [".reldeb", ".base"],
"inherits": [".reldeb", ".spackbase"],
"cacheVariables": {
"CELERITAS_USE_ROOT": {"type": "BOOL", "value": "OFF"}
}
Expand All @@ -178,15 +188,15 @@
{
"name": "ndebug",
"displayName": "With ORANGE in optimized mode",
"inherits": [".ccache", ".ndebug", ".base"],
"inherits": [".ccache", ".ndebug", ".spackbase"],
"cacheVariables": {
"CELERITAS_USE_ROOT": {"type": "BOOL", "value": "OFF"}
}
},
{
"name": "ndebug-vecgeom",
"displayName": "With vecgeom, clhep, dev g4 in optimized mode",
"inherits": [".ccache", ".base", ".ndebug", "vecgeom"],
"inherits": [".ccache", ".spackbase", ".ndebug", "vecgeom"],
"cacheVariables": {
"CELERITAS_USE_HepMC3": {"type": "BOOL", "value": "OFF"},
"CELERITAS_USE_ROOT": {"type": "BOOL", "value": "OFF"},
Expand Down
8 changes: 7 additions & 1 deletion src/celeritas/field/FieldPropagator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,13 @@ FieldPropagator<SubstepperT, GTV>::operator()(real_type step) -> result_type
real_type const update_length = substep.length * linear_step.distance
/ chord.length;

if (!linear_step.boundary)
if (CELER_UNLIKELY(geo_.failed()))
{
// Time to die
result.failed = true;
return result;
}
else if (!linear_step.boundary)
{
// No boundary intersection along the chord: accept substep
// movement inside the current volume and reset the remaining
Expand Down
7 changes: 6 additions & 1 deletion src/celeritas/field/LinearPropagator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//---------------------------------------------------------------------------//
#pragma once

#include "corecel/Macros.hh"
#include "corecel/math/Algorithms.hh"
#include "geocel/Types.hh"

Expand Down Expand Up @@ -56,7 +57,11 @@ CELER_FUNCTION auto LinearPropagator<GTV>::operator()(real_type dist)

result_type result = geo_.find_next_step(dist);

if (result.boundary)
if (CELER_UNLIKELY(geo_.failed()))
{
result.failed = true;
}
else if (result.boundary)
{
geo_.move_to_boundary();
}
Expand Down
2 changes: 2 additions & 0 deletions src/corecel/math/Algorithms.hh
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,8 @@ inline CELER_FUNCTION T fastpow(T a, T b)
/*!
* Use fused multiply-add for generic calculations.
*
* \f[ x \gets a \times b + y \f]
*
* This provides a floating point specialization so that \c fma can be used in
* code that is accelerated for floating point calculations but still works
* correctly with integer arithmetic.
Expand Down
5 changes: 5 additions & 0 deletions src/geocel/Types.hh
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,17 @@ struct GeoTrackInitializer
*
* The boundary flag means that the geometry is step limiting, but the surface
* crossing must be called externally.
*
* \todo Change to a status type, or have separate "propagation" and "next
* step" result types. Currently this is copied from the geometry state to the
* propagation result because the track view failure flags are ephemeral.
*/
struct Propagation
{
real_type distance{0}; //!< Distance traveled
bool boundary{false}; //!< True if hit a boundary before given distance
bool looping{false}; //!< True if track is looping in the field propagator
bool failed{false}; //!< True if a failure state occurred
};

//---------------------------------------------------------------------------//
Expand Down
3 changes: 3 additions & 0 deletions src/geocel/detail/LengthUnits.hh
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ namespace lengthunits
CELER_ICC meter{100};
CELER_ICC centimeter{1};
CELER_ICC millimeter{0.1};
inline constexpr char const label[] = "cm";
#elif CELERITAS_UNITS == CELERITAS_UNITS_SI
CELER_ICC meter{1};
CELER_ICC centimeter{0.01};
CELER_ICC millimeter{0.001};
inline constexpr char const label[] = "m";
#elif CELERITAS_UNITS == CELERITAS_UNITS_CLHEP
CELER_ICC meter{1000};
CELER_ICC centimeter{10};
CELER_ICC millimeter{1};
inline constexpr char const label[] = "mm";
#else
# error "CELERITAS_UNITS is undefined"
#endif
Expand Down
1 change: 0 additions & 1 deletion src/geocel/vg/VecgeomData.hh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "corecel/Macros.hh"
#include "corecel/Types.hh"
#include "corecel/data/Collection.hh"
#include "corecel/data/CollectionBuilder.hh"
#include "corecel/sys/ThreadId.hh"
#include "geocel/Types.hh"

Expand Down
1 change: 1 addition & 0 deletions src/geocel/vg/VecgeomParams.cc
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,7 @@ void VecgeomParams::build_volume_tracking()

check_bvh_device_pointers();
check_navindex_device_pointers();
detail::check_other_device_pointers();

device_ownership_ = Ownership::value;
}
Expand Down
Loading
Loading