Skip to content

Avoid stack allocation for large locals#96

Merged
t-kalinowski merged 6 commits intomainfrom
fix-heap-allocation-for-locals
Feb 9, 2026
Merged

Avoid stack allocation for large locals#96
t-kalinowski merged 6 commits intomainfrom
fix-heap-allocation-for-locals

Conversation

@t-kalinowski
Copy link
Owner

Summary:

  • Emit large local arrays as deferred-shape allocatable locals + allocate() at subroutine entry (avoids flang stack overflows)
  • Add allocatable-locals tests

Testing:

  • R -q -e "devtools::test()"

@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 96.46018% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.89%. Comparing base (1de5107) to head (b2360ee).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
R/r2f-closures.R 92.68% 3 Missing ⚠️
R/manifest.R 98.36% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #96      +/-   ##
==========================================
+ Coverage   92.78%   92.89%   +0.11%     
==========================================
  Files          27       27              
  Lines        5754     5859     +105     
==========================================
+ Hits         5339     5443     +104     
- Misses        415      416       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

- Emit self-sized locals as deferred-shape allocatables; avoid invalid explicit allocate

- Preserve triplet indices like i:i on LHS subset assignment to prevent rank drops

- Add snapshot + runtime tests for deferred-shape locals; add regression test for i:i assignment
- Allow logical-vector subscripts on [<<- LHS by converting masks to pack() integer subscripts

- Make var_storage_bytes() error for unsupported Variable@mode values (e.g., character)

- Add regression tests
- Ignore non-Variable bindings found via scope inheritance when resolving symbols

- Add regression test for x in enclosure masking undeclared arg x
@t-kalinowski t-kalinowski merged commit 2f8206c into main Feb 9, 2026
8 checks passed
@t-kalinowski t-kalinowski deleted the fix-heap-allocation-for-locals branch February 9, 2026 13:52
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.

1 participant