Skip to content

Skip GhiaEulerAvx2Test without AVX2, and let a failed release be retried - #245

Merged
shaia merged 2 commits into
masterfrom
fix/ghia-euler-avx2-skip
Oct 4, 2026
Merged

shaia merged 2 commits into
masterfrom
fix/ghia-euler-avx2-skip

Conversation

@shaia

@shaia shaia commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Summary

The v0.4.0 release run (37190077878) failed in Physics Validation (Ghia Tests), so no tag or GitHub Release was created. This PR fixes the test that failed, and adds a way to retry a release that failed before tagging.

1. GhiaEulerAvx2Test skips when AVX2 is not compiled in

Physics Validation builds with default options, where CFD_ENABLE_AVX2 is OFF. Since #215, explicit_euler_optimized refuses init with CFD_ERROR_UNSUPPORTED on such a build; before #215 it silently ran scalar loops and the test passed. The shared harness already sets solver_unavailable for that refusal, and GhiaProjectionAvx2Test ignores the test when it is set. The Euler test was missed, and it asserted result.success:

test_ghia_euler_avx2.c:22:test_euler_avx2_ghia_re100:FAIL: Solver 'explicit_euler_optimized' backend not available (not compiled)

It now uses the same three-line TEST_IGNORE_MESSAGE as its projection sibling. Every other validation test that uses an optional backend already skips one that is missing (20/21 passed in the failed run). No other CI job runs the validation label with AVX2 off, which is why this surfaced only at release.

2. version-release.yml gains workflow_dispatch

Re-running the failed run would rebuild the same commit, and this fix does not touch VERSION, so nothing would re-trigger the release. With this change, after merge, run gh workflow run version-release.yml --ref master.

  • check-version runs only on refs/heads/master or refs/heads/main. Every other job needs it, so a dispatch from another branch skips the whole workflow instead of tagging that branch's commit.
  • The existing tag check still refuses a version that is already tagged, so the trigger cannot re-publish a release.

Testing

  • Before: reproduced locally on a default-options build (AVX2 off): test_ghia_euler_avx2 FAILs with the message above, exit 1.
  • After: it reports IGNORE: AVX2 Euler solver not available (SIMD not enabled), exit 0, and ctest -R GhiaEulerAvx2Test passes.
  • Workflow file: parses with triggers push and workflow_dispatch, and the check-version guard is in place.
  • Fast suite: ctest -LE "cross-arch|validation" passed 101/101 (Debug).
  • /pr-ready: passed, including /code-review medium with no findings.

After merge

Dispatch the release on master. v0.4.0 will then tag the merge commit of this PR, which includes the release commit (#244).

🤖 Generated with Claude Code

The v0.4.0 release run failed in Physics Validation: that job builds with
default options, AVX2 off, and GhiaEulerAvx2Test asserted success where
explicit_euler_optimized now refuses init with CFD_ERROR_UNSUPPORTED (#215;
before it, the solver ran scalar loops and the test passed). The harness
already flags that as solver_unavailable and GhiaProjectionAvx2Test ignores
it; the Euler test was missed. Every other validation test using an optional
backend already skips it.

Re-running the failed release run rebuilds the same commit, and this fix
does not touch VERSION, so the release workflow gains workflow_dispatch.
check-version now runs only on master or main, and every other job needs
it, so a dispatch from another branch cannot tag that branch's commit.
Copilot AI balanced review requested due to automatic review settings October 4, 2026 10:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The new skip can incorrectly hide solver registration or allocation failures.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds safe release retries and skips unavailable AVX2 Euler validation.

Changes:

  • Skips Ghia Euler AVX2 validation when unsupported.
  • Enables manual release workflow dispatch on protected branches.
File Description
tests/​validation/​test_ghia_euler_avx2.c Handles unavailable AVX2 solver.
.github/​workflows/​version-release.yml Adds guarded manual release retries.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/validation/test_ghia_euler_avx2.c Resolved
… NULL

Addresses Copilot's review of PR #245. Both creation sites in the shared
cavity harness set solver_unavailable whenever cfd_solver_create() returned
NULL, which also covers an unregistered name (CFD_ERROR_NOT_FOUND) and an
allocation failure (CFD_ERROR_NOMEM); every Ghia and cavity test that skips
on that flag would have passed such a failure as a skip. The harness now
creates with cfd_solver_create_checked(), which reports a backend this build
lacks as CFD_ERROR_UNSUPPORTED before the name lookup, and sets the flag
only for that status. Pre-existing in the harness; the PR's new Euler skip
made it reachable from one more test.

Checked on a default build (AVX2 off): all 13 Ghia and cavity tests pass,
both AVX2 ones skipping. On a build without OpenMP the two OMP Ghia tests
still skip, now through UNSUPPORTED rather than NOT_FOUND. A misspelled
solver name in the Euler AVX2 test fails ("not created: Resource not
found"), where before it was skipped.

Deferred to the follow-up PR with the examples: the standalone validation
tests that build their own solvers (test_solver_architecture,
test_taylor_green_decay, test_natural_convection, test_backward_facing_step,
test_quiescent_3d and taylor_green_reference.h) treat a NULL from
cfd_solver_create() the same way.
Copilot AI balanced review requested due to automatic review settings October 4, 2026 11:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The changes correctly address the recorded release failure while retaining safeguards against invalid solver failures and duplicate releases.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@shaia
shaia merged commit f173aae into master Oct 4, 2026
19 checks passed
@shaia
shaia deleted the fix/ghia-euler-avx2-skip branch October 5, 2026 05:46
shaia added a commit that referenced this pull request Nov 18, 2026
…ure (#246)

* Make the examples report solver failures and exit nonzero

Six examples discarded solver_init, solver_step and run_simulation_step
statuses, so a solver that stopped working still printed results and
exited 0, and the release gate's example run could not see it. Each now
checks every status, skips a solver whose backend the build or machine
lacks, and exits 1 on anything else.

solver_selection checks cfd_backend_is_available() before switching to the
AVX2 solver: simulation_set_solver_by_name() reports success even when the
new solver's init fails, so the failure would only show at the first step.
It also creates the directory for its direct-API VTK file, which it wrote
into a missing output/ while printing "Output written to". runtime_comparison
is rebuilt on create_sim() and time_solver(), which separate a missing
backend from a failure; it used to step NULL simulations and divide by zero
timings, and now prints n/a.

Checked on a default build (AVX2 off) and one without OpenMP: all six exit
0, and with a negative dt injected minimal_example, runtime_comparison and
solver_selection exit 1 with the failing step named.

* Skip a validation solver only when its backend is missing

Several harnesses treated any NULL from cfd_solver_create() as "not
available" and skipped, which also hid an unregistered name or an
allocation failure (test_solver_architecture, test_taylor_green_decay,
test_natural_convection, test_ghia_projection_gpu, and the Taylor-Green
backend consistency test, which skipped on any failure at all), while
BackwardFacingStepRe400Test failed instead of skipping on a build without
OpenMP, where the _omp solvers are not registered and creation reports
CFD_ERROR_NOT_FOUND.

tests/validation/solver_availability.h creates solvers with
cfd_solver_create_checked(), which reports a missing backend as
CFD_ERROR_UNSUPPORTED before the name lookup, and marks only that status
unavailable. Every harness that may be handed an optional backend uses it,
including the two cavity-harness sites #245 fixed inline. tg_run_simulation()
also stops ignoring solver_init() and solver_step() statuses.

Exempt: poiseuille_3d_reference.h, taylor_green_3d_reference.h,
test_poiseuille_flow, test_turbulent_channel and the cavity harness's
scalar-only site only ever create the scalar projection, and a NULL there
already fails.

Checked on a default build and on one without OpenMP: the 20 and 21 affected
validation tests pass, BackwardFacingStepRe400Test now skips without
OpenMP, and a misspelled solver in the Taylor-Green consistency test fails
("not created: Resource not found") where it used to print SKIPPED.

* Report a failure with its own message, not the library's last one

failure_reason() printed cfd_get_last_error() whenever a message was stored,
so a failure that set none was reported with an earlier, unrelated message,
such as a backend skipped further up the run. It now uses the stored message
only when cfd_get_last_status() matches the status being reported.
Found by /code-review on this branch in solver_selection; the same helper in
performance_comparison (from #244) gets the same fix.

* Clear the error state before creating a validation solver

Review finding (#246): cfd_solver_create() reports a factory's NULL as
CFD_ERROR_NOMEM only while the last status is still CFD_SUCCESS, and that
status is sticky. An UNSUPPORTED left over from an earlier solver made a later
allocation failure read as unavailable, so validation_create_solver() skipped
exactly the failure it exists to expose.

* Skip an example solver only when its backend is refused

Review findings (#246): runtime_comparison and solver_selection read "not in
the registry" as "backend unavailable", so a misspelled or removed solver
printed n/a or SKIPPED and the example still exited 0. solver_selection also
ignored a failed registry allocation, after which every solver read as
skipped and the run reported zero failures.

Both now probe with cfd_solver_create_checked(), which refuses an unavailable
backend with CFD_ERROR_UNSUPPORTED before the name lookup, and skip only that
status; any other creation failure, an unknown name included, is a failure. A
NULL registry in solver_selection is reported and counted as one.
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