celeritas-project / celeritas

Celeritas is a new Monte Carlo transport code designed to accelerate scientific discovery in high energy physics by improving detector simulation throughput and energy efficiency using GPUs.
https://celeritas-project.github.io/celeritas/user/index.html
Other
58 stars 32 forks source link

Add detailed error checking for action sequence behavior #1303

Closed sethrj closed 2 days ago

sethrj commented 3 days ago

As I work toward error correction (#687) I'm increasingly worried about subtly breaking the tracking loop by improperly changing the track status or setting an action ID that's out of order. This PR is a step in the right by adding a copy of the pre-action track status, post-step action, and pre-step action; it then checks after the action that each track's state has been consistently updated.

The status checker can be added by the user to the action registry. If added, the action sequence will run it after every action. This capability is on by default for unit tests.

Enforcing the status checks gives us some nice documentation on what is allowed and when: my initial implementation got several subtle conditions wrong. https://github.com/celeritas-project/celeritas/blob/90a01b395e17199aae6fd6b70f967aa35e0dcf5b/src/celeritas/track/detail/StatusCheckExecutor.hh#L61-L118

esseivaju commented 3 days ago

I'll be flying tomorrow, I should have time to review that then!

sethrj commented 2 days ago

@esseivaju This is ready! Thanks.