Skip to content

Limit energy test to 50 iterations#193

Merged
slarson merged 2 commits intoow-0.9.8from
x2nqc4-codex/create-unit-tests-for-engine-validation
Jun 28, 2025
Merged

Limit energy test to 50 iterations#193
slarson merged 2 commits intoow-0.9.8from
x2nqc4-codex/create-unit-tests-for-engine-validation

Conversation

@slarson
Copy link
Copy Markdown
Member

@slarson slarson commented Jun 28, 2025

Summary

  • compile with OpenCL headers that match the old API
  • define OpenCL version flags in the Makefile
  • shorten the energy conservation test loop from 5000 to 50 iterations

Testing

  • make all
  • ./Release/Sibernetic -test -no_g device=cpu -l_to logstep=10

https://chatgpt.com/codex/tasks/task_b_68606dd882e4832aa6456194e23c1158

@slarson slarson changed the base branch from ow-0.9.7 to ow-0.9.8 June 28, 2025 23:38
@slarson slarson requested a review from Copilot June 28, 2025 23:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates OpenCL compilation flags and shortens the energy conservation test loop.

  • Adds OpenCL version and compatibility macros to CXXFLAGS for legacy headers
  • Reduces the test_energy_conservation loop from 5000 to 50 iterations

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/test/owPhysicTest.cpp Limits energy test loop to 50 iterations instead of 5000
makefile Appends OpenCL version and compatibility defines to CXXFLAGS
Comments suppressed due to low confidence (1)

src/test/owPhysicTest.cpp:88

  • Reducing the loop to 50 iterations may not catch long-term energy drift; consider parameterizing this value or adding a comment explaining why 50 is sufficient for test validity.
    if (counter == 50)

Comment thread src/test/owPhysicTest.cpp
energy_evolution_potential.push_back(potential_energy);
fluid_simulation->simulationStep();
if (counter == 5000)
if (counter == 50)
Copy link

Copilot AI Jun 28, 2025

Choose a reason for hiding this comment

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

[nitpick] The literal 50 is a magic number; extract it into a named constant (e.g. MAX_ENERGY_TEST_ITER) to improve readability and make it easier to adjust in the future.

Suggested change
if (counter == 50)
if (counter == MAX_ENERGY_TEST_ITER)

Copilot uses AI. Check for mistakes.
Comment thread makefile Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@slarson slarson merged commit c98b21f into ow-0.9.8 Jun 28, 2025
4 checks passed
@slarson slarson deleted the x2nqc4-codex/create-unit-tests-for-engine-validation branch June 28, 2025 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants