Skip to content

Add standalone IntaRNA 4.0 implementation - #231

Open
Alexander-Mitrofanov wants to merge 1 commit into
BackofenLab:masterfrom
Alexander-Mitrofanov:IntaRNA_4.0
Open

Add standalone IntaRNA 4.0 implementation#231
Alexander-Mitrofanov wants to merge 1 commit into
BackofenLab:masterfrom
Alexander-Mitrofanov:IntaRNA_4.0

Conversation

@Alexander-Mitrofanov

Copy link
Copy Markdown

Summary

  • Add the standalone C++23 IntaRNAnew implementation under IntaRNAnew/.
  • Include native command-line tools, Make and CMake build metadata, correctness oracles, compatibility fixtures, benchmark tooling, and the mathematical audit.
  • Add an output-aware scalar predictor for exact, unseeded base-pair/model-S requests that need ranked boundaries and energies, while retaining the general predictor for broader configurations.
  • Report the implementation version as 4.0.0.

Scope

This pull request adds only the IntaRNAnew/ directory. No existing Legacy source, build, documentation, or repository-root file is modified. Generated binaries, object files, archives, and profiling artifacts are excluded.

Compatibility and performance

All 17 fixture configurations pass byte-for-byte comparison with IntaRNA Legacy. The three bounded biological workloads also pass byte-for-byte before timing. On the documented GCC 13.3 / AMD Ryzen 5 7530U single-thread benchmark, the optimized output-aware path achieved:

Case Legacy IntaRNAnew Speedup
fhlA/OxyS 504.936 ms 36.066 ms 14.000x
ilvE/GcvB-ST 4008.653 ms 208.473 ms 19.229x
phoB/GcvB 3821.776 ms 205.155 ms 18.629x
Geometric mean 17.117x

The benchmark methodology and its applicability limits are documented in IntaRNAnew/benchmarks/README.md.

Validation

  • Full native Make test suite passed.
  • All predictor, folding, accessibility, output, runner, compression, CLI, and companion-tool contract tests passed.
  • Legacy fixture parity passed: 17/17.
  • Repository-integrated biological parity passed: 3/3.
  • The executable reports IntaRNAnew 4.0.0.
  • The committed tree passed whitespace, binary-blob, and path-scope audits.

Introduce IntaRNAnew as an isolated C++23 implementation with native tools, correctness oracles, Legacy parity gates, benchmark fixtures, and an output-aware exact predictor optimized for ranked boundary and energy output.
@martin-raden

Copy link
Copy Markdown
Member

sorry @Alexander-Mitrofanov , didnt remember correctly, there is no dev branch... 🙄

Comment on lines +253 to +261
### 5.4 Scope

Equation (6) is exact for additive-pair noncrossing matchings with unit weights for allowed unpaired positions. It is used by:

- NativeAccessibility; and
- base-pair folding when noLP=false and noGUend=false.

It is **not** directly valid for Turner loop energies, noLP, or noGU-end, where a pair token has grammar state. Those cases retain the existing stateful/per-interval recurrence. A future extension must carry pair, stack, multiloop, and outside state indices.

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.

so is the speeup for turner energies or for some adapted energy model?

Comment on lines +418 to +433
### 9.2 Confirmed remaining defects

These findings affect both Legacy and Next unless marked otherwise. They were audited but not modified in this task.

| Status | Finding | Consequence |
|---|---|---|
| reproduced, source-confirmed | Heuristic noLP counts the direct stacked continuation and also admits the equivalent w1=w2=1 loop continuation, violating Equation (16). | Base-pair examples: length 4 exact Eall=-5.30 vs heuristic -5.46; length 5 exact -6.50 vs heuristic -6.73. The heuristic improperly has more weight than the exact recurrence. |
| reproduced, source-confirmed | Ensemble updateZ bypasses the base predictor's noGU-end and maxED filters and directly increments Zall. | One-base G/U reports Eall=-1 with noGU-end both false and true, although the true ensemble is empty; unchecked arithmetic can also overflow or propagate non-finite weights. |
| source-confirmed | Base-pair \(E_S\) uses full \(Q\), although its API defines substructures with at least one intramolecular pair. | Correct substructure energy is \(E_S=-RT\log(Q-1)\); whole-monomer energy remains \(-RT\log Q\). |
| reproduced, source-confirmed | PredictorMfeEns retains an unordered map keyed by all four site boundaries while the exact 2-D matrix is advertised as \(O(n_1n_2)\). | Retained space is \(O(n_1n_2L_1L_2)\), quartic at full length. Complementary toys used 9.6 MiB at n=20 and 106.2 MiB at n=50. |
| source-confirmed | Some seed predictors return before initZ on reuse. | Z/site state can leak from an earlier prediction. |
| source-confirmed | Out-of-range Nussinov getQb returns one rather than zero. | An invalid paired state contributes multiplicative identity. |
| source-confirmed, Legacy only | Seed extension adds independent Boltzmann factors instead of multiplying them; also duplicates adjacent noLP stacks and contains unsigned-overlap, one-past-end, and energy-vs-partition comparison faults. | Incorrect seed ensemble weights and boundary behavior. These seed defects were corrected in Next. |

For exact no-seed Legacy/Next prediction, each four-boundary site is completed once. A proposed optimization is to stream its energy directly into the top-k and Zall accumulators rather than retain the entire site map. This should restore the advertised \(O(n_1n_2)\) DP-space scale, but it has not been implemented here.

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.

nice, some of these bug can be easy fixed in the old code already..

Comment on lines +540 to +544
## 12. Remaining work

Priorities after this audit are:

1. generalize output-aware compact prediction to nearest-neighbor energy, supported constraints, and on-demand traceback without weakening exact semantics;

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.

so this seems to be level 1 so far.. 😜

@martin-raden

Copy link
Copy Markdown
Member

Hi Alex,
only had a brief look. will need more time to check..

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