Skip to content

Fix develop tsan failure due to cantera build - #2990

Closed
bigfooted wants to merge 28 commits into
developfrom
fix_cantera_tsan
Closed

bigfooted wants to merge 28 commits into
developfrom
fix_cantera_tsan

Conversation

@bigfooted

Copy link
Copy Markdown
Contributor

Proposed Changes

Give a brief overview of your contribution here in a few sentences.

The "FATAL: ThreadSanitizer: unexpected memory mapping" message comes from the TSan runtime. It happens when the kernel's ASLR randomization is too high for TSan's fixed shadow-memory layout (vm.mmap_rnd_bits=32). That is the default on recent GitHub runner images and kernels.
The failing step is the bootstrap of ninja, because the Cantera subproject builds its own ninja when none is on the PATH. The TSan flags from the job are inherited by that bootstrap. The freshly built ./ninja is therefore TSan-instrumented and dies on startup with exit status 66, which gives the Python traceback you see.

Related Work

Resolve any issues (bug fix or feature request), note any related PRs, or mention interactions with the work of others, if any.

failing tsan on develop

PR Checklist

Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
  • My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary.

bigfooted and others added 28 commits September 25, 2026 11:37
Agglomeration:
- In 3D a symmetry plane met at an angle by another boundary no longer makes
  a node mixed, so wall/symmetry edges coarsen instead of staying fine-size
  singletons on every level (3D bump: 288 -> 26 singletons per level).
- Columns standing on mixed nodes (wall ends) are paved first, so no column
  from either side straddles a leading or trailing edge.
- A column only advances along a stiff edge of the mesh, so columns from side
  planes no longer march along thin layers and break up wall-normal columns.

Prolongation:
- The linear prolongation gradient is rejected only for a degenerate stencil
  (condition of the unit directions), and solved by Cholesky, instead of
  rejecting every stretched cell (constant fallback 31% -> 1.5% of cells).
- Each level's correction fades in over 4 coarse CVs from where a wall ends.

Adaptive CFL: escalating cuts on repeated stalls, and cap increases stay below
the cap set at the last stall.

3D bump 17x177x81 (MG_CFL_SCALING 0.05): MG1 313 its, MG2 374, single grid 561,
MG1 before 1128. 2D flat plate and 3-element airfoil unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On an agglomerated coarse level the averaged gradient term of the viscous flux
crosses faces that are poorly aligned with the edges between CV centroids. The
implicit Jacobian does not hold that term, so the coarse iteration diverged
once the coarse CFL exceeded a few hundred, which is why MG_CFL_SCALING had to
be around 0.05. With the primitive gradients zero on coarse levels the coarse
residual matches its Jacobian and the coarse smoother converges at any CFL.

3D bump 9x89x41, MG_CFL_SCALING 0.25: MG1 204, MG2 200, MG3 202 iterations
(single grid 210, previously 700 / 318 / 321 or worse). Scaling 1.0 also works.
2D flat plate and 3-element airfoil unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A flip-flop above a certain CFL repeats at every CFL that the cap probe and the
ceiling regrowth reach again, so on a stalled run each attempt cost 40 to 70
iterations and the residual never fell. The lowest CFL at which a flip-flop
occurred now caps the CFL at half of it and limits the cap probe to that, until
the flow residuals have fallen three orders of magnitude.

3D bump 17x177x81, MG1, CFL cap 1e5: converges in 480 iterations where it
stalled at -10 for more than 960. Single grid, 2D flat plate, 2_2DCJ and the
2D bump are unchanged (561, 226, 330, 581 iterations); 4_2DANW does not reach
the rule and behaves as before.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rge function'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
# Conflicts:
#	Common/src/linear_algebra/CSysSolve.cpp
MG_LINEAR_PROLONGATION now also selects the limited linear reconstruction
when the full multigrid warmup hands its solution to the next finer level,
for the flow and the scalar solvers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… promotion

Wall nodes take their coarse wall parent's value instead of the linear
extrapolation, so the promoted solution starts from the wall condition.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…in the template

The Corr-smooth column of MG_SMOOTH_OUTPUT printed the initial norm, which
was never set. The config template now shows MG_CORRECTION_SMOOTH at its
default of 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fit now weights each neighbour's directional difference equally,
which makes it independent of the neighbour distances. Restricting
analytic fields and prolongating them back, the error drops on every
level of an irregular mixed-element mesh (wall-layer field on level 3:
0.24 of the constant-operator error, against 0.36 unweighted).
Iteration counts are equal or slightly lower: 2_2DCJ 197 (198),
1_2DZP 137x097 214 (217), 273x193 at CFL cap 500 2040 (2040).

The aspect-ratio gate stays. Without it, the more accurate transfer
slows the solver in boundary and shear layers (2_2DCJ 266, 273x193
capped 2143).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… ASLR entropy

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@bigfooted bigfooted closed this Oct 23, 2026
@bigfooted
bigfooted deleted the fix_cantera_tsan branch October 23, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant