Repository navigation
Conversation
(cherry picked from commit 44976dc)
Pass explicit procedure pointers to the existing scalar constructors. Use pure module procedures for expected fields so Flang on macOS does not require executable-stack trampolines for a host-associated callback. Preserve the zero-boundary oracle and all numerical assertions.
certik
marked this pull request as ready for review
October 18, 2026 03:46
This was referenced Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix assignment from an interior-only
divergence_2D_tto an extended-gridscalar_2D_t: copy the complete interior, zero all four boundaries, and initialize the gradient operators from the copied metadata. The previous RHS-relative slicing lost interior values and left subsequent.grad.operations without initialized operators.Register
test/divergence_assignment_2D_test_m.F90intest/driver.f90. It checks nonsquare grids, orders 2 and 4, interior values, all boundaries, repeated assignment, and gradients against separately constructed expected scalars.Expected scalars use explicit procedure pointers to pure module initializers, matching the existing constructor interface and avoiding executable-stack callbacks on macOS. Every numerical assertion and tolerance is unchanged.
Correctness only: preserve upstream precision; no native, performance, GPU, or CI changes.
Verification
Compared base
d28eee9b37b4b74abe7f21bb2ccbdfb5c17f3e8awith this branch on macOS ARM using isolated FPM 0.13 builds and saved logs. The test-only portability follow-up was rebuilt and rerun; no compiler rebuild was performed.vector_3D_tdot-product test.Runs used
fpm test --target driverfor the full suite and added-- --contains 'The scalar_2D_t divergence assignment'for the regression. LFortran used--cpp --realloc-lhs-arrays --separate-compilationwith the existing LLVM 11.1.0 compiler build; its stale configure-time version string is not a current commit identifier.The initial Flang constructor errors were reproduced locally before the follow-up. The pointer-only intermediate fix exposed a macOS stack-trampoline fault, so the final test uses module callbacks instead of a host-associated internal procedure; the library API and numerical fix are untouched.
The follow-up Build run, on
363f8999e7c4575d8926c669fbb2ce8eab7cea06, passes all ten Flang 19–23/latest checks, including both macOS jobs, and all five Linux LFortran checks.Only the two macOS LFortran jobs remain blocked by the same source-independent packaging failure: the Homebrew LFortran
0.67.0_1bottles abort atlfortran --version, requiringlibz3.5.1.dylibwhile Z35.3.1is installed. Neither job reaches compilation. No dependency, workflow, compiler-version, or check-skipping workaround is included.CI is 15/17 compiler jobs passing, not fully green. A failed-job retry was requested, but GitHub denied it because repository admin rights are required; no retry ran. These external packaging failures are documented without expanding this correctness-only PR. The numerical fix and portable regression are ready for review.