Skip to content

Modernize IntaRNA with focused C++23 facilities - #234

Open
Alexander-Mitrofanov wants to merge 23 commits into
refactoringfrom
refactor-to-c++23
Open

Modernize IntaRNA with focused C++23 facilities#234
Alexander-Mitrofanov wants to merge 23 commits into
refactoringfrom
refactor-to-c++23

Conversation

@Alexander-Mitrofanov

@Alexander-Mitrofanov Alexander-Mitrofanov commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

Implements phase 2 of discussion #232 as a focused, scientifically neutral C++23 modernization.

What changed

  • requires strict C++23 and probes the exact library surface used by IntaRNA: string::contains, string::resize_and_overwrite, and basic_stringstream::view
  • compiles IntaRNA production translation units with -pedantic-errors, while treating supported Boost/ViennaRNA paths as system headers
  • builds ViennaRNA constraint buffers with resize_and_overwrite and inserts completed output through non-owning stream views
  • uses scoped ownership for ViennaRNA compounds/parameters/matrices and CLI factory products, closing exception and early-exit leaks without changing public factory signatures
  • removes redundant ViennaRNA sequence allocations and performs exact-ensemble boundary accumulation with one associative lookup
  • adds focused ViennaRNA constraint/storage and repeated-boundary regression coverage
  • documents the C++23 requirement for installed-header consumers and updates ChangeLog

Scientific scope

Predictor recurrences, energy models, coordinate conventions, partition definitions, arithmetic order, OpenMP topology, CLI behavior, and output schemas are unchanged. The modernization deliberately excludes modules, mdspan, format/print, parallel ranges, matrix-layout changes, and recurrence rewrites because they are either unavailable across both required standard libraries or belong in separately benchmarked performance phases.

No implementation code was imported from alternate IntaRNA trees.

Validation

  • fresh local source gate: 4,281 API assertions in 36 cases and all 20 CLI golden cases pass
  • clean configure/build/test/install path passes, followed by all 65 standalone installed-header probes and an explicit-C++23 pkg-config consumer compile/link/run
  • pinned GCC 14.4.0 benchmark gate freshly builds and fully tests both immutable references before measurement
  • scientific parent: 321364c56e914e9eff56ddba4846852297fe5c55
  • modernized executable source: 7a9517b0587dd308659b61f81b26373ac7a5d0b5
  • all eight core cases have identical canonical scientific outputs; deterministic raw outputs are byte-identical, and the four-thread case retains the same canonical rows despite scheduling order
  • AP5 output-heavy case has identical raw and canonical hashes
  • timings are small and mixed (core ratios 0.987x to 1.022x; AP5 0.994x), so this PR claims no general speedup and shows no material performance regression

The raw JSON, compressed outputs, and generated report are in benchmark evidence commit 69174eb and benchmark PR #2. The full decision/evidence record is in doc/refactor/2-c++23.md.

The actual head passed both triggered copies of the required matrix: pull-request run 32979758447 and push run 32979767757. Each passed GCC 14 release, GCC 14 debug, and Apple Clang/libc++ release, including build, full tests, install, 65 public-header probes, and the installed pkg-config consumer. Phase 1 scientific corrections remain in #233.

@martin-raden martin-raden 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.

I have checked and approved all changes.

  • TODO: update "Changelog" file accordingly

and this will be ready to merge

@Alexander-Mitrofanov Alexander-Mitrofanov changed the title Migrate IntaRNA to strict C++23 Modernize IntaRNA with focused C++23 facilities Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants