LLM based coding documentation#279
Conversation
|
Deployed test documentation to https://exasim-project.com/NeoFOAM/Build_PR_279 |
chihtaw
left a comment
There was a problem hiding this comment.
LGTM!
The only major thing I think is missing is explicit GPU execution guidance.
| ### `test/` | ||
|
|
||
| Each test file starts an OpenFOAM `Time`/mesh in `test_main.cpp`, then Catch2 test cases use `GENERATE(allAvailableExecutor())` to run the same case on every compiled executor (Serial, CPUExecutor for OpenMP/threads, GPUExecutor for CUDA/HIP/SYCL). Setup case files live in `test/setup_<name>/`. | ||
|
|
There was a problem hiding this comment.
Consider adding a section about GPU execution semantics/Kokkos constraints
Since NeoFOAM heavily relies on NeoN/Kokkos portability, we can add something like
## GPU considerations
- Device kernels must use NEON_LAMBDA
- Avoid host-only allocations/access insider kernels
- Prefer parallelFor abstractions over raw loops
- Explicit synchronization may be required before host reads ( NeoN::fence(exec) )
- Use .copyToHost() when validating vectors in tests
There was a problem hiding this comment.
Good point so far, no one is using Claude or anything else on a GPU node, but this will come at some point.
|
|
||
| ### `test/` | ||
|
|
||
| Each test file starts an OpenFOAM `Time`/mesh in `test_main.cpp`, then Catch2 test cases use `GENERATE(allAvailableExecutor())` to run the same case on every compiled executor (Serial, CPUExecutor for OpenMP/threads, GPUExecutor for CUDA/HIP/SYCL). Setup case files live in `test/setup_<name>/`. |
There was a problem hiding this comment.
Consider documenting testing conventions more explicitly
| Each test file starts an OpenFOAM `Time`/mesh in `test_main.cpp`, then Catch2 test cases use `GENERATE(allAvailableExecutor())` to run the same case on every compiled executor (Serial, CPUExecutor for OpenMP/threads, GPUExecutor for CUDA/HIP/SYCL). Setup case files live in `test/setup_<name>/`. | |
| Tests should generally validate behavior across all enabled executors (CPU/GPU) and avoid assumptions about deterministic floating-point ordering. | |
| Each test file starts an OpenFOAM `Time`/mesh in `test_main.cpp`, then Catch2 test cases use `GENERATE(allAvailableExecutor())` to run the same case on every compiled executor (Serial, CPUExecutor for OpenMP/threads, GPUExecutor for CUDA/HIP/SYCL). Setup case files live in `test/setup_<name>/`. |
| ## Agentic coding | ||
|
|
||
| We provide an `AGENTS.md` file to support LLM-based coding workflows. | ||
| Please instruct tools such as Claude Code to reference this file, for example by prompting: “See `AGENTS.md` for shared project instructions.” |
There was a problem hiding this comment.
The current wording might unintentionally imply a Claude-specific workflow. It could be slightly broader.
| Please instruct tools such as Claude Code to reference this file, for example by prompting: “See `AGENTS.md` for shared project instructions.” | |
| Please instruct AI coding tools to reference this file, for example by prompting: “See `AGENTS.md` for shared project instructions.” |
This PR adds a first AGENTS.md and instructions for LLM based coding. I think we can gradually extend the AGENTS.md file.
Additionally, to avoid flooding the repo with tool specific stuff CLAUDE.md and .planning are added to gitignore.