Skip to content

Add set of full-precision UDL#2243

Open
esseivaju wants to merge 1 commit intoceleritas-project:developfrom
esseivaju:fp-udl
Open

Add set of full-precision UDL#2243
esseivaju wants to merge 1 commit intoceleritas-project:developfrom
esseivaju:fp-udl

Conversation

@esseivaju
Copy link
Member

@esseivaju esseivaju commented Feb 6, 2026

Following-up discussions in #2235

This update should improve the previously introduced UDL to meet the requirements stated in Constants.hh. floating-point udl will now by default perform operation in, and return real_type, avoiding accidental promotion such as in 2.5_cm * float which would previously promote to double.

For cases where we'd still like full-precision, introduce an extra set of udl with a _fp suffix returning a Constant. This setup should meet the two requirements, preventing accidental promotion, while still allowing explicit full-precision as needed with minimal boilerplate in user code.

Note that there is a small difference compared to before, where 2.5 * units::cm * runtime_float was performed in, and returned double precision regardless of CELERITAS_REAL_TYPE, now 2.5_cm * runtime_float matches real_type

@esseivaju esseivaju requested a review from sethrj February 6, 2026 22:44
@esseivaju esseivaju added core Software engineering infrastructure (corecel) minor Refactoring or minor internal changes/fixes labels Feb 6, 2026
@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.87%. Comparing base (599cdbc) to head (9fee262).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop    #2243    +/-   ##
=========================================
  Coverage    86.87%   86.87%            
=========================================
  Files         1331     1331            
  Lines        42102    42102            
  Branches     12951    13405   +454     
=========================================
  Hits         36578    36578            
- Misses        4319     4508   +189     
+ Partials      1205     1016   -189     
Files with missing lines Coverage Δ
src/celeritas/Units.hh 100.00% <ø> (ø)

... and 118 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

Test summary

 5 913 files   9 451 suites   18m 26s ⏱️
 2 151 tests  2 123 ✅  28 💤 0 ❌
32 338 runs  32 180 ✅ 158 💤 0 ❌

Results for commit 9fee262.

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

Labels

core Software engineering infrastructure (corecel) minor Refactoring or minor internal changes/fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant